Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/One-outstanding-event CDC handshake

Hardware interview practice

One-outstanding-event CDC handshake

MediumCDC and ResetSystemVerilog

A source clock sends events to an unrelated destination clock. At most one event may be in flight. Design synthesizable SystemVerilog for a request/acknowledge event crossing.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

input logic src_clk, src_rst_n, src_valid;
output logic src_ready;
input logic dst_clk, dst_rst_n;
output logic dst_pulse;
Reviewed example

Work through one case

Input
Accept one source event while dst_clk runs four times slower than src_clk.
Expected output
The destination produces exactly one dst_pulse.

The request toggle persists until its synchronized acknowledgement returns, so the slower domain cannot miss or duplicate the event.

What to cover

Requirements

  1. Accept an event only on src_valid && src_ready; while src_valid&&!src_ready the source must keep src_valid asserted, and the crossing must hold its request or toggle until acknowledgement returns.
  2. Generate exactly one destination-clock pulse for each accepted event and accept no second event while one is pending.
  3. Every signal crossing a clock boundary must pass through two destination-domain flip-flops before use.
  4. Both resets must be asserted together for at least two edges of each clock; during reset, clear the handshake and drive src_ready=0 and dst_pulse=0, then recover without a phantom event.
Continue practicing

Related questions

CDC and ResetBridge a sticky memory-error alarm across clocks→CDC and ResetSynchronize and filter an asynchronous alarm→CDC and ResetCheck reset-bounded delivery of asynchronous events→
asic.fyi · Learn silicon end to end.info@asic.fyi