RTL Design #30 · 2026-10-23 · Reset stretching · Easy · about 10 min

A reset stretcher that only stretches once

rst_stretch turns a short reset request into a clean reset pulse for the rest of the chip.

  • While rst_in_n is sampled low, rst_out_n is low.
  • After rst_in_n goes high, rst_out_n rises on the 4th rising edge that samples rst_in_n high, and stays high.
  • If rst_in_n goes low again at any time, rst_out_n goes low at that edge and the count of 4 starts over on the next release.

Fix rst_stretch.sv. Both signals are synchronous to clk.

Write and run your answer in the browser. The hidden tests check it, and it’s free.