RTL Problems / Level 7 · Advanced RTL & Protocol Design
What You Will Learn
By solving Toggle-Based Pulse Synchronizer Across Asynchronous Clock Domains, 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 toggle-based pulse synchronizer capable of reliably transferring 1-cycle event pulses between fast-to-slow and slow-to-fast clock domains.
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: Pulse swallowing problem in fast-to-slow CDC, toggle flip-flops, 2-flop synchronizers, edge detection.
Port List & Interface Timing
The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:
| Port | Dir | Width | Description |
|---|---|---|---|
src_clk, src_rst_n | input | 1 | Source clock domain and reset |
src_pulse | input | 1 | 1-cycle event pulse to be transmitted |
dst_clk, dst_rst_n | input | 1 | Destination clock domain and reset |
dst_pulse | output | 1 | Clean 1-cycle pulse reproduced in destination domain |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Completely asynchronous src_clk and dst_clk. Ensure consecutive pulses in src_clk are separated by at least 3 dst_clk periods to prevent pulse collisions.
Synthesis Constraints: No missed pulses. Synthesizable Verilog-2001.
Architectural Deep Dive & Implementation Walkthrough
The Pulse Swallowing Problem in CDC
When sending a 1-clock-cycle pulse from a fast clock domain (e.g. 500 MHz, 2 ns width) to a slow clock domain (e.g. 50 MHz, 20 ns period), the pulse frequently asserts and deasserts entirely between two rising edges of the slow clock. A direct 2-flop synchronizer will miss the pulse completely.
Toggle-Based Pulse Synchronization
- Pulse to Toggle: In the source domain, a T-type flip-flop toggles its state ($0 o 1$ or $1 o 0$) whenever
src_pulse = 1occurs. This transforms a transient pulse into a permanent DC level change. - Level Synchronization: The toggle level crosses into the destination domain via a standard 2-flop synchronizer.
- Edge Detection: In the destination domain, a third register stores the delayed state. An
XORbetween the 2nd and 3rd flops detects any state transition, generating a clean 1-cycle pulse in the destination clock domain.
Common RTL Designer Pitfalls
Using a simple rising-edge detector (in & ~in_d) instead of an XOR. Since the source toggles both 0->1 and 1->0, an XOR is required to detect every pulse.
Silicon & Hardware Engineering Notes
Consecutive source pulses must be separated by at least 2.5 destination clock periods to allow the toggle transition to propagate through the synchronizer chain.
Starter RTL Code
module top_module (
input wire src_clk,
input wire src_rst_n,
input wire src_pulse,
input wire dst_clk,
input wire dst_rst_n,
output reg dst_pulse
);
// Implement Toggle-Based Pulse Synchronizer:
// 1. In src_clk: toggle a register whenever src_pulse is high.
// 2. Synchronize toggle register into dst_clk through 2 flip-flops.
// 3. In dst_clk: detect any level change (using an XOR with a delayed flop) to generate 1-cycle dst_pulse.
endmodule
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module (
input wire src_clk,
input wire src_rst_n,
input wire src_pulse,
input wire dst_clk,
input wire dst_rst_n,
output reg dst_pulse
);
reg src_toggle;
reg dst_s1, dst_s2, dst_s3;
// Source domain: Pulse-to-Toggle
always @(posedge src_clk or negedge src_rst_n) begin
if (!src_rst_n) begin
src_toggle <= 1'b0;
end else if (src_pulse) begin
src_toggle <= ~src_toggle;
end
end
// Destination domain: 2-Flop Sync + 3rd Flop for Edge Detection
always @(posedge dst_clk or negedge dst_rst_n) begin
if (!dst_rst_n) begin
dst_s1 <= 1'b0;
dst_s2 <= 1'b0;
dst_s3 <= 1'b0;
dst_pulse <= 1'b0;
end else begin
dst_s1 <= src_toggle;
dst_s2 <= dst_s1;
dst_s3 <= dst_s2;
dst_pulse <= dst_s2 ^ dst_s3; // Pulses on ANY transition (0->1 or 1->0)
end
end
endmodule
Related RTL Problems in Level 7
- Async-Assert / Sync-Deassert Reset — Assert reset the instant it goes active, but only release it once it has been clean for 2 clock edges — the standard reset architecture for any real design.
- 3-Flop CDC Synchronizer — A deeper 3-stage synchronizer for signals that need extra MTBF margin beyond the standard 2-flop chain.
- Synchronized Rising-Edge Detector — Safely synchronize an asynchronous level signal, then produce a clean single-cycle pulse the moment it rises in the local clock domain.
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 Toggle-Based Pulse Synchronizer Across Asynchronous Clock Domains require?
Design a toggle-based pulse synchronizer capable of reliably transferring 1-cycle event pulses between fast-to-slow and slow-to-fast clock domains. Implement it as Verilog module top_module matching the listed ports.
Is this design combinational or sequential?
Tags: advanced-rtl, cdc-and-rdc, systemverilog, asic, fpga. 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 Toggle-Based Pulse Synchronizer Across Asynchronous Clock Domains to assess real-world synthesizability and race-condition awareness.