Hardware interview practice
Release reset synchronously
A destination clock domain needs an active-low reset that asserts immediately but deasserts only on a destination-clock edge after two clean samples. Write the two-flop reset synchronizer RTL.
Starting point
Question code
input logic dst_clk;
input logic arst_n;
output logic srst_n;Reviewed example
Work through one case
Input
arst_n rises before destination edges E1 and E2Expected output
srst_n=0 after E1 and srst_n=1 after E2Each edge advances one clean sample. If arst_n falls at any time, both stages clear immediately and release restarts.
What to cover
Requirements
- When arst_n falls, asynchronously drive both synchronizer stages and srst_n to 0 without waiting for dst_clk.
- When arst_n rises, shift a 1 through two destination-clocked stages using nonblocking assignments.
- Drive srst_n only from the second stage, so it rises on the second dst_clk edge after arst_n is high.
- Do not add combinational gating on srst_n; if arst_n falls during release, assertion again takes effect immediately.
