SystemVerilog OOP Mastery · All levels
Classes and Objects: Pitfalls
Pitfalls for Classes and Objects.
Pitfalls and red flags
Assuming declaration allocates an object and calling methods on a null handle.
Randomizing before construction, which causes runtime fatals or simulator errors.
Hiding new() deep in utility code so ownership and object lifetime become unclear.
Reusing one shared transaction object across components when independent objects are needed.