RTL Design #3 · 2026-09-26 · Waveform debug · Hard · about 15 min
A depth-4 FIFO that counts to 5
The waveform comes from this synchronous FIFO with DEPTH = 4. Seven writes are attempted back to back, then five reads. At the marker, count reaches 5: the FIFO accepted a write it had no room for.
Find the cause in the waveform, then fix fifo.sv. full and empty must match what the FIFO holds on every cycle: a write is accepted only while full is 0, and a read only while empty is 0, even when both happen in the same cycle.
Write and run your answer in the browser. The hidden tests check it, and it’s free.