Most debug time goes to searching, not fixing. A hierarchy-first method reproduces the failure, finds the first divergence, and narrows by level before any code changes.
4 lessons, about 13 min
Reproduce it with the logged seed and plusargs, then arm a trigger on the failure signature. Dumping everything from the start slows the run and buries the event.
The whole topic on one page, taken from each lesson's Remember box. Read it before an interview, or print it.
Debug hierarchy before touching code
Log the seed, plusargs and first failing transaction before opening any wave; the same seed must fail at the same cycle.
Drop a level only when the level above has named a suspect.
The cursor belongs on the first divergence, not the last.
Controlled dumps and trigger capture
Dumps are off by default; +WAVE_ON turns them on for the failing seed without recompiling.
A trigger prints a snapshot and finishes conditionally, never a bare $stop.
$dumpon cannot recover the past: reproduce the failure cycle, then rerun with a window that starts before it.
Waveform bug patterns: latch and race
A combinational block with no idle assignment holds its old value, and the wave shows a stale grant.
With blocking assignments in one process, both registers sample din at the edge, so the second stage adds no delay.
Equal outputs prove nothing: repeated inputs also make correct stages equal.
Handshake protocol violation
A transfer happens when valid and ready are both high; the source owns valid and the payload, the sink owns ready.
Valid stays asserted until the handshake, and the payload stays stable while valid waits for ready.
Both assertions are needed: one for valid, one for data.
Rule of thumb: once offered, a payload cannot change until the handshake.
Mini project: the capstone: a resilient streaming peripheral, stage by stage
Practice question: Waveform debug: write transaction timeout
Practice question: FSM incomplete case and unique0: simulation versus synthesis
Practice question: Two-stage valid/ready pipeline with backpressure
Code lab: AXI stream handshake
Interview: run a mock interview on this topic