Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Bridge a sticky memory-error alarm across clocks

Hardware interview practice

Bridge a sticky memory-error alarm across clocks

MediumCDC and ResetSystemVerilog

A fast memory-test clock may detect an error while a slower service clock is busy. The alarm must not be lost and only one alarm may be pending. Implement the request/acknowledge alarm bridge in SystemVerilog.

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, dst_clk, rst_n;
input logic src_error; output logic src_pending;
output logic dst_alarm; input logic dst_clear;
Reviewed example

Work through one case

Input
Pulse src_error once and leave dst_clear low.
Expected output
req and src_pending stay high, dst_alarm becomes and remains high, and ack stays low.

The four-phase request remains pending until the destination explicitly clears the sticky alarm and raises acknowledgement.

What to cover

Requirements

  1. Implement internal four-phase req/ack levels. In the source domain, src_error sets req=1 and src_pending=1; later src_error pulses while pending are coalesced into that request.
  2. Synchronize req through two destination flops. When a new synchronized req=1 is seen with ack=0, set dst_alarm. A dst_clear on that same edge loses to the set. On a later edge with dst_alarm=1, req=1, and dst_clear=1, clear dst_alarm and set ack=1.
  3. Synchronize ack through two source flops. When synchronized ack becomes 1, lower req but keep src_pending=1. The destination holds ack=1 until synchronized req becomes 0, then lowers ack; only after synchronized ack returns to 0 may the source clear src_pending.
  4. rst_n asynchronously clears req, ack, both synchronizer chains, src_pending, and dst_alarm. Reset has priority; no combinational path crosses domains, and dst_clear while dst_alarm=0 has no effect.
Continue practicing

Related questions

CDC and ResetOne-outstanding-event CDC handshake→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