Advertisement
RTL Architecture & Silicon Reliability

Clock Domain Crossing
Architecture & Risk Analyzer

Safely transferring data across asynchronous clock domains is one of the most critical challenges in ASIC and FPGA development. Standard RTL simulators use zero-delay models that completely hide metastability, causing unverified CDC boundaries to pass tests and fail catastrophically in silicon. Master 2-FF/3-FF synchronizers, fast-to-slow pulse synchronizers, reset synchronization (ARSR), handshake protocols, and MTBF calculation.

35 min read
MTBF & FIT Failure Analysis
Interactive Simulator & Verilog RTL Generator
Launch Interactive CDC Lab Gray Code CDC Visualizer Async FIFO Depth Solver

The Physics of Metastability & Why Simulation Fails

Modern chips integrate dozens of asynchronous clock domains: a PCIe Gen5 controller at 1 GHz, an LPDDR5 interface at 3.2 GHz, an ARM/RISC-V core at 2.5 GHz, and low-speed UART/I2C peripherals. When signals cross between clocks running from independent oscillators or PLLs, clock edges align unpredictably relative to data transitions.

1. Setup & Hold Violation

If an asynchronous data transition arrives within the flip-flop's setup window ($T_{setup}$) or hold window ($T_{hold}$), the internal feedback latch cannot decide whether to lock 0 or 1. The output voltage balances near $V_{DD}/2$.

2. Exponential Resolution ($\tau$)

A metastable flip-flop behaves like a ball perched on the peak of a steep hill. Internal cross-coupled inverters amplify the voltage exponentially toward 0 or 1 with a time constant $\tau$ (tau): $V(t) \propto \exp(t/\tau)$.

3. The Simulation Blindspot

Standard RTL simulators evaluate logic deterministically: if data changes simultaneously with a clock edge, the simulator arbitrarily picks 0 or 1 based on event order. It never models intermediate voltage or resolution time.

Silicon Reality Check: A CDC bug that appears to work perfectly in RTL simulation will randomly corrupt data once every 10 minutes or once every 3 months in silicon. At higher operating temperatures or lower voltages, transistor transconductance drops, $\tau$ degrades, and failure rates skyrocket by orders of magnitude.

MTBF & FIT Failure Analysis Derivation

Engineers quantify CDC reliability using MTBF (Mean Time Between Failures) and FIT (Failures in Time per $10^9$ device operating hours). The classic formula derived from statistical semiconductor mechanics is:

MTBF = \frac{\exp(N \cdot T_{res} / \tau)}{f_{clk} \cdot f_{data} \cdot T_w} \quad \text{seconds}
Resolution Time (T_res) = T_{clk\_dst} − T_{setup} − T_{cq} \quad \text{per stage}
FIT Rate (per 10^9 hours) = \frac{10^9 \text{ hours}}{\text{MTBF (hours)}} = \frac{3.6 \times 10^{12}}{\text{MTBF (seconds)}}
Parameter Physical Meaning Typical 16nm/7nm FinFET Typical 130nm / SKY130
f_clk Destination clock frequency 500 MHz – 2.0 GHz 50 MHz – 200 MHz
f_data Asynchronous data toggle rate 10 MHz – 200 MHz 1 MHz – 20 MHz
T_w Metastability hazard window ($T_{su} + T_{hold}$) 25 – 45 ps 120 – 200 ps
τ (tau) Metastability resolution time constant 10 – 25 ps 60 – 100 ps
N Number of synchronizer stages 2 or 3 flip-flops 2 flip-flops

The 4 Canonical CDC Architectures

Different signal types require fundamentally different synchronization circuits. Applying the wrong synchronizer topology is the number one cause of silicon CDC respins.

1. 2-FF / 3-FF Synchronizer

Use for: Single-bit slow control signals (enables, interrupts, flags).
Constraint: Source signal must remain stable for at least $1.5 \times T_{dst\_clk}$ so the destination clock cannot miss it.

2. Fast-to-Slow Pulse Synchronizer

Use for: 1-cycle pulses crossing from a fast clock into a slow clock.
Architecture: Toggle flip-flop in source → 2-FF synchronizer → XOR edge detector in destination domain.

3. Reset Synchronizer (ARSR)

Use for: Global master resets.
Architecture: Asynchronous Assert (instantaneous protection) + Synchronous Deassert (no recovery/removal violations).

4. Req/Ack Handshake Synchronizer

Use for: Coherent multi-bit data buses with moderate throughput.
Architecture: 4-phase or 2-phase level handshake ensures data remains 100% stable while valid flag crosses domains.

Interactive CDC Architecture & Risk Analyzer
Select an architecture, adjust clock frequencies and technology node, and verify waveforms, MTBF, and synthesizable RTL.
Real EDA Physics
Calculated MTBF
> 10⁴⁴ yr
Virtually Infinite
FIT Rate (10⁹ hrs)
0.0000 FIT
< 1 failure / billion hrs
Metastability Risk Assessment SAFE FOR SILICON
CDC Signal Waveforms 2-FF Level Synchronizer
sync_2ff.v (Synthesizable Verilog)
Test in Simulator
Generating synthesizable RTL...
Advertisement

SDC Constraints for CDC — The Golden Rules

Simply writing a synchronizer in Verilog is not enough. You must write correct Synopsys Design Constraints (SDC) so synthesis and STA tools do not optimize away your synchronizer or leave routing delays unconstrained.

# 1. Declare Asynchronous Clock Domains Atomically
set_clock_groups -asynchronous \
  -group {SYS_CLK} \
  -group {PCIE_CLK}

# 2. Critical Rule: Constrain Multi-Bit Gray Code Skew (Max Delay)
# Cummings Rule: Max bus routing skew must be less than 1 source clock period!
set_max_delay -from [get_cells u_fifo/wptr_gray_reg*] \
              -to   [get_cells u_fifo/wptr_sync_reg*] \
              -datapath_only 2.000

# 3. Vivado / Synopsys Synthesis Attributes in Verilog
# (* ASYNC_REG = "TRUE" *)
# (* DONT_TOUCH = "TRUE" *)
Why -datapath_only is Mandatory on Gray Pointers: When synchronizing a Gray-coded FIFO pointer, the order of bit transitions must be preserved. If physical routing introduces more than 1 clock period of skew between bit 0 and bit 3, the destination synchronizer could capture bit 3 before bit 0, causing the pointer to jump by multiple steps! set_max_delay -datapath_only instructs P&R tools to place synchronizer flip-flops in close physical proximity with tightly matched trace lengths.

Frequently Asked Questions

A 2-FF synchronizer provides one destination clock cycle of resolution time ($T_{res}$). A 3-FF synchronizer provides two full clock cycles of resolution time. In ultra-high-speed designs (>1 GHz) or safety-critical automotive/aerospace chips where the clock period is very short (e.g. 500 ps), one cycle may yield an MTBF of only days or weeks. Adding the third stage multiplies MTBF by $\exp(T_{clk}/\tau)$, increasing reliability by billions of years at the cost of one extra cycle of latency.
Setting set_false_path tells the STA tool to stop timing checks. However, without a physical synchronizer circuit in the RTL, metastability will still occur in silicon! Furthermore, set_false_path disables maximum delay checks, allowing physical design tools to route CDC nets with massive 5 ns or 10 ns wire delays, destroying pulse synchronizers and multi-bit Gray code coherency. Always use set_clock_groups -asynchronous and set_max_delay -datapath_only.
When an external reset asserts (drops low), it directly drives the asynchronous clear/preset pins of all flip-flops, instantly resetting the system without needing a clock. When reset deasserts (rises high), the deassertion is sampled through a 2-FF synchronizer clocked by the local domain. The synchronized reset only transitions on a known clock edge, safely satisfying the flip-flop's recovery time ($T_{rec}$) and removal time ($T_{rem}$).
Yes! Gray code guarantees that only one bit transitions between consecutive count values ($0 \to 1 \to 3 \to 2 \dots$). Even if the destination clock samples the bus right in the middle of a transition, only that single changing bit can be ambiguous. The destination domain will therefore capture either the old valid count or the new valid count — but never a corrupted or wild value.

Explore Next in RTL & Silicon Architecture

← Pipelining & Latency
Verilog code copied to clipboard!
Advertisement