Testbenches create thousands of transactions at runtime and pass them between threads. Classes provide dynamic objects, inheritance and polymorphism for that reuse, with virtual interfaces bridging to DUT pins.
Topic | Lessons | Description | Time | Path |
|---|---|---|---|---|
5 | Classes, objects and handles: the memory model behind every class-based testbench. | 40 min | Required | |
4 | Base handles, virtual dispatch, checked casts, and contracts for reusable testbenches. | 30 min | Required | |
5 | Static members, access control, parameterized classes, constants, enums and extern organization. | 40 min | Recommended | |
5 | Virtual interfaces bridge classes and pins: binding, clocking drives, config, multi-port vifs. | 40 min | Required | |
6 | Events, semaphores, mailboxes, threads and bench sync patterns in one place. | 50 min | Required | |
5 | Five hand-built testbench patterns and the UVM standards each one becomes. | 40 min | Recommended |
Path labels. Required means core first pass for this part, Recommended means most learners should read it, and Optional means reference, specialist or revision material you can return to later.
Handles, objects, constructors and copies: Classes, Objects & Handles.
Base handles, virtual methods and $cast: Inheritance and Polymorphism.
The virtual interface that lets a driver reach pins: Virtual Interfaces.
Mailboxes, events and fork for concurrent bench code: Events, Semaphores, Mailboxes and Processes.
Constants, enums, extern methods and class files: Static, Encapsulation & Parameterized Classes, after the first environment compiles.
Singleton and config objects, plus multi-port vifs: revisit when a bench needs shared settings or several interfaces.
The five hand-built patterns: OOP Patterns for Testbenches read best next to the Testbench part, when the UVM names make sense.
Modules are built once, before simulation starts, so their number is fixed. A class is a type: new builds a fresh object at run time, as many as the test needs, and a handle keeps track of each one.
b = a; for two class handles, and later c = new();, which pairs reach the same object, and how do you compare contents?a and b reach one object; c reaches a different one, even with equal fields. Compare contents with a compare() method. Taught in Handles vs Objects and Shallow vs Deep Copy.
Only when the method is virtual: the object's type picks the body. For a derived-only field use a checked $cast and test its result. Taught in Virtual dispatch and Casting with $cast.
Through a virtual interface property bound top-down from the top module; an unbound one is null and the first access fails at run time. Taught in Declaring & Binding a vif.
A mailbox carries the items; a completion counter or objection with a drain delay marks the end. Taught in Mailboxes and Synchronization Patterns.
The creator registry with overrides, the hook queue on the driver, and the build, connect and run waves of a component tree. Taught in The Factory Pattern, Callbacks and Hooks and Building a Component Hierarchy.