Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Transfer Fast Events to a Slow Clock Exactly Once

Hardware interview practice

Transfer Fast Events to a Slow Clock Exactly Once

HardClock and Reset DomainsSystemVerilog

A 400 MHz source reports single-cycle events to an unrelated 80 MHz destination. Events must not be lost or duplicated; one event may remain outstanding while the round-trip acknowledgment is in progress. Implement a toggle-and-acknowledgment event bridge with source backpressure.

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

module event_cdc(
 input logic clk_f,rst_f_n,event_valid, output logic event_ready,
 input logic clk_s,rst_s_n, output logic event_pulse_s
);
reset protocol: both resets assert together before either domain runs
Reviewed example

Work through one case

Input
Case 1: Accept one 2.5 ns source pulse
Case 2: Keep request and returned acknowledgment different
Case 3: Issue two source events separated by a complete acknowledgment round trip
Expected output
Case 1: one 12.5 ns destination-cycle pulse eventually occurs despite the shorter source pulse
Case 2: event_ready stays zero and held event_valid is accepted only after event_ready returns high
Case 3: two distinct destination pulses occur in order

The shown result follows by applying this rule: Only stable toggle states cross the domains, with a two-flop synchronizer in each direction and no combinational CDC path. The cases also demonstrate this requirement: Coordinated reset clears request, acknowledgment, synchronizer stages, and event_pulse_s; outputs from the first clean post-reset transaction count once, and one-sided reset while traffic is active is illegal.

What to cover

Requirements

  1. In clk_f, toggle a request bit only on event_valid&&event_ready; event_ready is high exactly when the synchronized acknowledgment equals the current request toggle.
  2. Pass the request through a two-flop clk_s synchronizer, compare it with the last acknowledged value, and emit one clk_s pulse when they differ.
  3. After emitting the pulse, copy the received request value into the slow acknowledgment, synchronize that value back through two clk_f flops, and accept no second event before it returns.
  4. Coordinated reset clears request, acknowledgment, synchronizer stages, and event_pulse_s; outputs from the first clean post-reset transaction count once, and one-sided reset while traffic is active is illegal.
Continue practicing

Related questions

Clock and Reset DomainsSeparate related-clock timing from asynchronous CDC→Clock and Reset DomainsSize a synchronizer from an MTBF target→Clock and Reset DomainsImplement a four-phase CDC event handshake→
asic.fyi · Learn silicon end to end.info@asic.fyi