Clock Domain Crossing (CDC)
Definition
A Clock Domain Crossing (CDC) occurs when a signal is transferred between two distinct clock domains in a digital design — that is, between flip-flops or logic elements clocked by different, asynchronous clocks. The term is most commonly used in the context of modern System-on-Chip (SoC) designs that operate on multiple asynchronous clock domains [arxiv:2406.06533v1].
Context in Modern SoC Designs
As SoC designs scale in complexity, designers often adopt a Globally-Asynchronous Locally-Synchronous (GALS) approach to improve power efficiency. In a GALS architecture, individual synchronous islands run on their own local clocks, while the boundaries between islands form asynchronous crossings. These crossings are the CDC paths, and their number grows with design complexity [arxiv:2406.06533v1].
Metastability
CDC paths are prone to metastability effects. When a signal launched from one clock domain is sampled by a flip-flop in the receiving domain near the receiving clock's transition edge, the flip-flop may enter a metastable state — neither logic 0 nor logic 1 — which can propagate incorrect values downstream [arxiv:2406.06533v1].
Verification Challenges
Functional verification of CDC is critical because uncorrected CDC bugs can escape into silicon. Key observations from the literature:
- Conventional verification methods, such as register transfer level (RTL) simulations and static timing analysis (STA), are not sufficient to fully address CDC issues, which may leave verification gaps [arxiv:2406.06533v1].
- Identifying CDC-related bugs is very time-consuming [arxiv:2406.06533v1].
- CDC bugs are one of the most common reasons for costly silicon re-spins [arxiv:2406.06533v1].
Formal Verification with Metastability Injection
To address the gaps left by simulation and STA, formal verification methodologies have been developed for CDC. One pragmatic approach exercises Metastability Injection (MSI) along different CDC paths, modeling the metastable behavior directly within the formal proof to find bugs that simulation cannot reach [arxiv:2406.06533v1].
Example: CDC in a Power Manager IP
CDC verification practices are visible in concrete IP blocks. In the OpenTitan power manager (pwrmgr) IP, signals cross between fast and slow clock domains:
- The
pwrmgrslow FSM produces clock enable outputs (core_clk_en,io_clk_en,usb_clk_en) that must be acknowledged by the corresponding validity inputs (core_clk_val,io_clk_val,usb_clk_val). Theslow_respondertask drives these inputs after a few random slow-clock cycles, and the protocol is checked via SystemVerilog Assertions (SVAs) inpwrmgr_clock_enables_sva_if.svandpwrmgr_ast_sva_if.sv[OpenTitan pwrmgr dv]. - Reset request handshakes (
rst_lc_req,rst_sys_req) cross between the fast and slow domains and are completed by thefast_respondertask [OpenTitan pwrmgr dv]. - A CSR is required to clear, indicating that the CDC to the slow clock has completed [OpenTitan pwrmgr dv].
These examples illustrate how CDC verification in practice combines handshaking protocols, timeouts, responder tasks modeling asynchronous behavior, and SVAs.
Related Concepts
- GALS (Globally-Asynchronous Locally-Synchronous) — the architectural pattern that motivates multiple CDC paths [arxiv:2406.06533v1].
- Metastability — the principal failure mode at CDC boundaries [arxiv:2406.06533v1].
- Metastability Injection (MSI) — a formal verification technique that models metastable behavior in CDC paths [arxiv:2406.06533v1].
- System-on-Chip (SoC) — the design context in which CDC is most commonly discussed [arxiv:2406.06533v1].
- Static Timing Analysis (STA) — a conventional timing-verification technique that is noted as insufficient on its own for CDC [arxiv:2406.06533v1].
- SystemVerilog Assertions (SVA) — a hardware assertion language used to specify CDC handshake and timing properties [OpenTitan pwrmgr dv].