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.
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
Writing Testbenches
Installing Icarus Verilog and GHDL, clock and reset generation, stimulus, self-checking tests, exhaustive testing of small blocks, and a Python reference model.
Waveforms & Debugging
Dumping VCD files, reading them in GTKWave, X and Z values, and a field guide to the bugs every beginner meets.
Finite State Machines in HDL
Moore and Mealy machines, the one- and two-process styles, state encoding, and two complete designs: a sequence detector and a traffic-light controller.