The this Keyword in SystemVerilog: When and Why (Tested)
The this keyword in SystemVerilog is a handle to the current object: use it for name clashes, to pass or return yourself, and as the parent in create(). 8 checks, tested on VCS.
The this keyword in SystemVerilog is a handle to the current object: use it for name clashes, to pass or return yourself, and as the parent in create(). 8 checks, tested on VCS.
In short: Use logic for almost every signal in SystemVerilog. It holds 4 states (0, 1, X, Z) and takes either one assign or procedural writes. reg is just the old name for the same thing. Use wire only when a signal has more than one driver, like a shared bus or an inout port….
How static works in SystemVerilog classes: static properties, static methods, static local variables, parameterized classes, inheritance and super, each run in one UVM bench on VCS.
In short: Lifetime decides how many copies of a variable exist. A static variable has one copy, created once and shared by every call; it remembers its value between calls. An automatic variable gets a fresh copy every time the task or function is called, and it disappears when the call ends. Tasks and functions…
In short: A virtual interface is a pointer (a handle) to a real, physical interface in SystemVerilog. Testbench classes are created and destroyed at run time (they are dynamic), while an interface with its wires is fixed at elaboration (it is static). A class cannot hold a static interface directly, so it holds a virtual…
Polymorphism in SystemVerilog lets one base handle hold many classes, and virtual methods let each object answer its own way. 8 checks with interface classes, type parameters and the UVM factory, tested on VCS.
A virtual function can be overridden; a pure virtual function must be. One tested SystemVerilog file, real VCS output, and the mistakes VCS does and doesn’t catch.
How the SystemVerilog streaming operator packs and unpacks data: >> vs <<, slice size, byte and bit reverse, and a packet round trip, tested on VCS.
How inheritance works in SystemVerilog: extends, super.new(), virtual vs non-virtual methods, constraint override, shadowing and $cast, tested on VCS.
Line, branch, condition, toggle and FSM coverage next to a covergroup, all measured on one small design in VCS. See where each one finds holes the other misses.