FPGA Design from Scratch ยท Test Before You Build

Part IV: Simulation & Verification

Free simulators (Icarus Verilog, GHDL), self-checking testbenches, waveforms, and finite state machines โ€” all verified before touching the board.

The verification loop

Every design in this course is checked in a simulator before it goes anywhere near the board. A testbench drives the design under test (DUT) with stimulus, computes the expected outputs with an independent reference model, and compares the two on every cycle. When something disagrees, a waveform file shows every internal signal so you can find the first wrong value, fix the HDL, and run the loop again in seconds.

stimulusclock, reset, vectorsDUTyour Verilog / VHDLreference modelinteger maths, Python, regexcheckeractual !== expected?PASSโ†’ Vivado, boardFAILactualexpectedwaveform (VCD) โ†’ find the first wrong value โ†’ fixfix the DUT (or the model)
The loop used throughout Part IV: the same stimulus feeds the DUT and a reference model; a checker compares them and prints PASS or FAIL; on failure, the waveform guides the fix.

Why simulate first

A simulation of a few thousand cycles runs in well under a second and shows every signal inside the design. A hardware build of the same design takes minutes of synthesis and place-and-route, and on the board you can only observe the handful of pins wired to LEDs or a logic analyser. Bugs that are obvious in a waveform โ€” an X from a forgotten reset, a counter that wraps one cycle late โ€” can take hours to diagnose on hardware, and some, like a simulation/synthesis mismatch, look like random flakiness there. Chapter 10 builds self-checking testbenches, Chapter 11 teaches you to read waveforms and recognise the common bugs, and Chapter 12 applies both to finite state machines, the control logic of almost every design that follows.

Chapters in Part IV

Share:XRedditLinkedIn