In gate-level simulations (GLS), Clock Domain Crossing (CDC) synchronizers face a unique challenge: timing violations. Because the data arrives asynchronously to the receiving clock, setup and hold time violations on the first-stage flip-flop of a synchronizer are practically guaranteed. By default, the simulator will inject an X (unknown) state into the flip-flop when this occurs, cascading X values throughout your entire design (X-propagation).
To run a functional GLS sign-off, we must suppress these timing violations, but only on the asynchronous paths. This lesson covers the industry-standard approach: the Dual-SDF Fix Strategy.
Standard Delay Format (SDF) files describe the timing delays of standard cells in your synthesized netlist. The most robust method to suppress X-generation at synchronizers is to override their specific setup and hold timing constraints to zero.
We accomplish this using a Dual-SDF Approach:
By loading the base SDF first, and the override SDF second, the simulator overwrites the timing properties of just those specific synchronization cells, eliminating the false X-propagation while keeping the rest of the chip's timing perfectly accurate.
The second SDF replaces the first because simulators process SDF files sequentially, mapping the latest constraints to the instance path.
For this strategy to work, we need an automated way to extract the hierarchical instance paths of every first-stage synchronizer flop. There are two common approaches:
If your RTL methodology rigorously follows naming conventions (as discussed in Module 9, Lesson 1), you can simply use a script to parse the netlist for specific string matches:
grep -r ".*_sync1_reg.*" syn_netlist.v > sync_flops.list
The safest approach is leveraging your CDC linting tool (e.g., Siemens Questa CDC or Synopsys Spyglass). These tools can identify structural synchronizers and automatically dump a list of instance paths or even generate the override SDF file directly.
In your testbench, you invoke the $sdf_annotate system task. It is critical to load the base SDF first, followed by the override SDF.
initial begin
// 1. Load the Base SDF (Full Chip Timing)
$sdf_annotate("soc_top_pt.sdf", tb_top.dut);
// 2. Load the Override SDF (Zero Setup/Hold for CDC)
$sdf_annotate("cdc_sync_override.sdf", tb_top.dut);
endLet's look at the actual SDF syntax before and after the override.
| Base SDF (soc_top_pt.sdf) | Override SDF (cdc_sync_override.sdf) |
|---|---|
|
(CELL (CELLTYPE "DFF_X2") (INSTANCE u_rx/meta_reg) (TIMINGCHECK (SETUP D (posedge CLK) (0.045)) (HOLD D (posedge CLK) (0.012)) ) ) |
(CELL (CELLTYPE "DFF_X2") (INSTANCE u_rx/meta_reg) (TIMINGCHECK (SETUP D (posedge CLK) (0.000)) (HOLD D (posedge CLK) (0.000)) ) ) |
With the override applied, the simulator evaluates the setup and hold requirement as 0.000 ns. When asynchronous data transitions exactly on the clock edge, no timing violation is triggered, and the output correctly resolves to a deterministic 0 or 1 instead of X.
You must never zero out the timing on the second-stage (or third-stage) synchronizer flops, nor any downstream logic. The entire purpose of the second stage is to ensure the first-stage's potentially metastable output has resolved. If there is a setup violation on the second stage, it indicates a real clock period constraint failure (the clock is too fast for the cell's resolution time), which is a fatal silicon bug. Masking it will result in a dead chip.
While SDF overriding is standard, some advanced teams use a different methodology: replacing the standard cell netlist with behavioral Verilog models specifically for the synchronizer cells during simulation.
Instead of relying on standard cell timing arcs, these behavioral models detect timing violations and use a random number generator (e.g., $random) to instantly resolve the output to a clean 0 or 1 (sometimes after a randomized delay). This more accurately mimics true metastable resolution behavior in silicon, but requires a more complex library management flow.
You have now completed the CDC course. The golden flow for silicon success is: