A class-based testbench has two worlds. The static module world holds clocks, reset, interfaces and the DUT, and the dynamic class world holds transactions, drivers, monitors and tests, reaching pins only through virtual interface handles.
TB ANATOMY — topic map
TEST LAYER base_test, smoke, stress, error (lesson 3)
| builds
ENVIRONMENT env: gen + drv + mon + scb + wiring (lesson 2)
| runs inside
STATIC HARNESS tb_top: clk, rst, interface, DUT (lesson 2)
| scheduling semantics
program vs module folded into lesson 2 as a closing section
All layers stacked: THE LAYERED TESTBENCH (lesson 1)
All layers together: COMPLETE MINI TESTBENCH (lesson 4)Lesson | What it covers |
|---|---|
Five layers, swap-point reuse, and the flat testbench it replaces. | |
Clock, reset, interface, DUT, virtual-interface handoff, and environment wiring. | |
Base and derived tests, plusarg selection, and the end-of-test contract. | |
Every layer working together against a small register file. |
At the virtual interface boundary. tb_top owns one physical interface instance, and every class holds a virtual handle to it. Nothing else crosses between the two worlds.