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_nis sampled low,rst_out_nis low. - After
rst_in_ngoes high,rst_out_nrises on the 4th rising edge that samplesrst_in_nhigh, and stays high. - If
rst_in_ngoes low again at any time,rst_out_ngoes 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.