Anatomy of a testbench

You will learn

The parts every *_tb.t27 spec has: stimulus, expected values, checks, a verdict.

Every testbench in this repo is one .t27 file with the same skeleton, and the player compiles it like any other spec. Open fifo_tb: it builds the stimulus (bytes into a FIFO), the expected values (the same bytes, in order), the checks (one assert per invariant, so a failure names the one that broke), and a verdict (a count, not a feeling). The widget generates JavaScript from a spec in the browser and runs it -- the same generate-then-execute shape a testbench uses, small enough to watch happen.

Open the interactive lesson →