Part of Curriculum: CDC, RDC and Low-Power RTL (Module 2: Pulse Synchronizers (Fast-to-Slow & Slow-to-Fast))
View Full Roadmap →
Level 7 Hard 50 pts ✓ Solved

Stretch-and-Synchronize Pulse

Sequential Design · sequential, cdc

Widen a fast, possibly very short pulse to guarantee it's caught by a much slower destination clock, then synchronize the stretched level cleanly across domains.

Write a synthesizable Verilog module named top_module matching the ports below exactly.
📐 Circuit Schematic Diagram
fast_pulsesync_pulse>clkrst_nSTRETCH-AND-SYNCHRONDIGITAL HARDWARE BLOCK
⚡ Timing & Synthesizability Constraints

Timing Contract: Strict synchronous timing aligned to posedge clk or zero-delay combinational propagation.

RTL Constraints: Synthesizable Verilog-2001. No # delays in synthesizable RTL.

Concept: If the source pulse can be shorter than one destination clock period, a synchronizer might sample right between edges and miss it entirely. Stretching fixes this: latch a small counter on fast_pulse and hold an internal stretched flag high until it expires, guaranteeing at least a few destination-clock cycles of visibility. Only then does the usual 2-flop-sync-plus-edge-detect pipeline turn it back into a single clean pulse. Skipping the stretch stage (synchronizing fast_pulse directly) works fine in simulation but is exactly the kind of shortcut that misses real pulses on real silicon.
NameDirWidthDescription
clkinput1Destination (slower) clock
rstinput1Sync active-high reset
fast_pulseinput1Possibly very short pulse from a faster/unrelated domain
sync_pulseoutput1Clean 1-cycle pulse in the destination domain, guaranteed not to be missed
Expected Waveform (Golden Timing Contract)
Verilog-2001 / SV Saved
Font: |
// Click Run Tests (or press Ctrl+Enter) to compile your RTL and simulate against hidden testbenches.
Simulation Timing Diagram (VCD Waveform)
100%
No simulation waveform yet. Run tests to simulate and generate VCD traces.
No compilation run yet. Syntax warnings and elaboration messages will appear here.
No simulation output yet. Raw stdout from vvp will appear here.

RTL Problems / Level 7 · Sequential Design

What You Will Learn

By solving Stretch-and-Synchronize Pulse, 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

Widen a fast, possibly very short pulse to guarantee it's caught by a much slower destination clock, then synchronize the stretched level cleanly across 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.

Concept: If the source pulse can be shorter than one destination clock period, a synchronizer might sample right between edges and miss it entirely. Stretching fixes this: latch a small counter on fast_pulse and hold an internal stretched flag high until it expires, guaranteeing at least a few destination-clock cycles of visibility. Only then does the usual 2-flop-sync-plus-edge-detect pipeline turn it back into a single clean pulse. Skipping the stretch stage (synchronizing fast_pulse directly) works fine in simulation but is exactly the kind of shortcut that misses real pulses on real silicon.

Port List & Interface Timing

The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:

NameDirWidthDescription
clkinput1Destination (slower) clock
rstinput1Sync active-high reset
fast_pulseinput1Possibly very short pulse from a faster/unrelated domain
sync_pulseoutput1Clean 1-cycle pulse in the destination domain, guaranteed not to be missed

Timing Constraints & Synthesizable RTL Rules

⚡ Synthesizable Implementation Guidelines

Timing Contract: Strict synchronous timing aligned to posedge clk or zero-delay combinational propagation.

Synthesis Constraints: Synthesizable Verilog-2001. No # delays in synthesizable RTL.

Starter RTL Code

module top_module(
  input  clk,
  input  rst,
  input  fast_pulse,
  output reg sync_pulse
);

  // Your code here — stretch fast_pulse with a small counter, then 2-flop sync + edge-detect the stretched level.

endmodule
Advertisement

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.

Frequently Asked Questions

What does Stretch-and-Synchronize Pulse require?

Widen a fast, possibly very short pulse to guarantee it's caught by a much slower destination clock, then synchronize the stretched level cleanly across domains. Implement it as Verilog module top_module matching the listed ports.

Is this design combinational or sequential?

Tags: sequential, cdc. 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 Stretch-and-Synchronize Pulse to assess real-world synthesizability and race-condition awareness.

Advertisement