UVM Factory Interview Questions
Object creation, Overrides, and polymorphism in UVM.
Beginner Level
It allows objects to be created dynamically and substituted (overridden) without changing the source code where they are created. It enables polymorphism via configuration.
Intermediate Level
Type Override: Replaces OriginalType with NewType everywhere in the simulation.
Instance Override: Replaces OriginalType with NewType only for a specific component hierarchy path.
Advanced Level
Create a `BadPacket` class extending `Packet`. Add error constraints. Use `set_type_override(Packet::get_type(), BadPacket::get_type())`. Now the testbench generates bad packets without changing the driver or sequence code.
The factory is bypassed. You lose the ability to override that object from the test. It is a major coding violation in UVM VIPs.