RTL Problems / Level 4 · Clock Domain Crossing (CDC)
What You Will Learn
By solving Two-Flop Synchronizer — Single-Bit CDC, you will acquire core industry skills:
- Synthesizable hardware modeling in standard Verilog-2001 / SystemVerilog.
- Correct handling of interface port contracts, edge-triggered clocks, and active-low/high resets.
- Simulation waveform interpretation and debugging using timing diagrams (VCD traces).
- Architectural avoidance of timing violations, glitching hazards, and synthesis warnings.
Problem Statement & Requirements
Design a 2-flip-flop synchronizer to safely pass a single-bit control signal from an asynchronous source into the destination clock domain clk_dst.
Hardware design teams at leading semiconductor firms evaluate these exact port contracts, race-condition assertions, and corner cases during technical design reviews and ASIC engineer interviews.
Prerequisites: Flip-flop setup/hold times, metastability basics, clock domain crossings.
Port List & Interface Timing
The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:
| Name | Dir | Width | Description |
|---|---|---|---|
clk_dst | input | 1 | Destination clock domain |
areset_n | input | 1 | Destination domain active-low reset |
async_in | input | 1 | Asynchronous single-bit input signal |
sync_out | output | 1 | Synchronized output in clk_dst domain |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Asynchronous input `async_in` is sampled by stage 1 (`sync_q1`), and resolved by stage 2 (`sync_q2`). Total latency = 2 destination clock cycles.
Synthesis Constraints: Never apply 2-flop synchronizers to multi-bit buses without Gray coding or handshakes. Synthesizable sequential RTL.
Architectural Deep Dive & Implementation Walkthrough
Common RTL Designer Pitfalls
['Attempting to synchronize a multi-bit data bus with independent 2-flop synchronizers: skew causes different bits to arrive in different clock cycles, producing corrupted intermediate values.', 'Assuming functional RTL simulation proves metastability safety: simulators use ideal 0/1 binary states and CANNOT simulate analog metastability.']
Silicon & Hardware Engineering Notes
CRITICAL CDC NOTE: Passing functional simulation does not prove CDC safety! Static CDC verification tools (Synopsys SpyGlass CDC, Questa CDC) and physical placement constraints (`set_false_path`, `set_max_delay -datapath_only`) are mandatory in silicon design.
Starter RTL Code
module top_module(
input clk_dst,
input areset_n,
input async_in,
output sync_out
);
// 2-Flip-Flop Synchronizer for single-bit CDC
endmodule
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module(
input clk_dst,
input areset_n,
input async_in,
output sync_out
);
(* ASYNC_REG = "TRUE" *) reg q1;
(* ASYNC_REG = "TRUE" *) reg q2;
always @(posedge clk_dst or negedge areset_n) begin
if (!areset_n) begin
q1 <= 1'b0;
q2 <= 1'b0;
end else begin
q1 <= async_in;
q2 <= q1;
end
end
assign sync_out = q2;
endmodule
Related RTL Problems in Level 4
- Pulse Synchronizer — Clock-Domain Crossing — Design a Toggle-based Pulse Synchronizer to transfer a single-cycle pulse from a fast clock domain (clk_src) to a slow destination domain (clk_dst).
- Gray Code Counter — Gray Encoding — Implement a 4-bit Gray code counter that advances by exactly one bit per transition: 0000, 0001, 0011, 0010, 0110, 0111, 0101, 0100...
- Asynchronous FIFO Pointer Synchronization — Multi-Clock Design — Convert a 4-bit write pointer to Gray code in clk_wr, synchronize it across clock domains into clk_rd using a 2-flop synchronizer, and generate a safe rd_empty flag.
Connected EcrioniX Learning Resources
Accelerate your VLSI engineering knowledge with these curated learning materials:
Progress through step-by-step verified modules from fundamentals to advanced silicon design.
Benchmark your hardware knowledge across 10 semiconductor domains and receive study roadmaps.
Explore foundational circuit theory, waveform timing, and physical hardware implementation.
Frequently Asked Questions
What does Two-Flop Synchronizer — Single-Bit CDC require?
Design a 2-flip-flop synchronizer to safely pass a single-bit control signal from an asynchronous source into the destination clock domain clk_dst. Implement it as Verilog module top_module matching the listed ports.
Is this design combinational or sequential?
Tags: cdc, industry-rtl, arbiters, clock-domain-crossing, hard, bit-synchronizers. If a clock signal is present in the port table, implement it as sequential logic; otherwise, use continuous assignments or combinational blocks.
How is my solution graded?
A hidden SystemVerilog testbench simulates your module in the cloud judge. You pass when all directed corner cases match the golden model and the VCD timing waveform matches the contract.
How does this challenge help with semiconductor interviews?
Technical interviewers at NVIDIA, Qualcomm, Apple, and Intel routinely ask candidates to code, debug, and explain the timing waveforms of Two-Flop Synchronizer — Single-Bit CDC to assess real-world synthesizability and race-condition awareness.