Codiode

Reset Synchronizer Tree

MediumVerilog / SystemVerilogBuildFree2 solved

One reset synchronizer can't drive every flip-flop in a large clock domain on time. A reset tree synchronizes the reset once, then pipelines and duplicates it so each region gets its own local copy.

The reset_sync_tree module takes an asynchronous active-low reset and a destination clock. It must safely synchronize the reset de-assertion to the destination clock domain and distribute it across a 4-branch pipeline.

To meet the architectural requirements, your design must implement exactly three stages of flip-flops:

  • Stage 1: A single synchronizer flip-flop that samples a constant 1'b1 on the positive edge of the clock.
  • Stage 2: A single flip-flop that samples the output of Stage 1.
  • Stage 3: Four parallel flip-flops that all sample the output of Stage 2. These drive the 4-bit output vector.

All flip-flops in the design must be asynchronously reset by the incoming reset signal. When the reset is asserted, all outputs must immediately drop to 0. When the reset is de-asserted, the release propagates through the shift register taking exactly three clock cycles to reach the outputs.

Signal Direction Width Description
clk input 1 Destination clock domain
async_rst_n input 1 Asynchronous active-low reset
sync_rst_n output 4 Four duplicated, synchronized active-low reset signals

Constraints

  • All flip-flops must be asynchronously reset by async_rst_n.
  • Output sync_rst_n must be registered.
  • The design must use exactly 3 stages of flip-flops from the internal constant 1'b1 to the output.
  • Stage 1 and Stage 2 must be single flip-flops.
  • Stage 3 must consist of four parallel flip-flops driving sync_rst_n.
  • The outputs must transition to 4'b0000 immediately when async_rst_n goes low.

Topics

Clock Domain CrossingResetPipelining

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against the problem's testbench. You get the waveform back, not a stored answer.

Free to solve. A Codiode account keeps your progress.

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Part of Clock Domain Crossing and Synchronization

Problem 3 of 36 in the Clock Domain Crossing and Synchronization track.

Related problems

Browse all problems · Verilog practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.