Introduction
Introduction Get started Hello UVM example UVM Phases Part 1 UVM Phases Part 2 UVM Base Classes UVM Object and Core Methods UVM ComponentsBuilding a Testbench
UVM Transaction UVM Sequence UVM Sequencer UVM Driver UVM Monitor UVM Scoreboard UVM Agent UVM Environment UVM TestOther Components
Coverage CollectorExecution Model
UVM Phases ObjectionsCommunication
TLM Basics TLM Blocking Put Port TLM Non-Blocking Put Port TLM Blocking Peek Port Analysis Ports TLM FIFOConfiguration
UVM Factory UVM Config DBRuntime Control
UVM Plusargs Seeds & Reproducibility Verbosity Control Debug Runtime ControlsAdvanced
Virtual Sequences Virtual SequencerUVM RAL
Intro Abstraction Flexibility Comparison Coverage Minimum Requirements Learning Path Register Types First Implementation Register with 2 Fields Register with Reserved Bits Access Policies Part 1 Access Policies Part 2 Access Policies Part 3 Access Policies Part 4 Memory Modeling Register Block Adapter Introduction Adapter Methods Adapter Example Predictor Types Desired and Mirror Values Register Methods Desired Value Mirror ValueUVMArena
Introduction
Introduction Get started Hello UVM example UVM Phases Part 1 UVM Phases Part 2 UVM Base Classes UVM Object and Core Methods UVM ComponentsBuilding a Testbench
UVM Transaction UVM Sequence UVM Sequencer UVM Driver UVM Monitor UVM Scoreboard UVM Agent UVM Environment UVM TestOther Components
Coverage CollectorExecution Model
UVM Phases ObjectionsCommunication
TLM Basics TLM Blocking Put Port TLM Non-Blocking Put Port TLM Blocking Peek Port Analysis Ports TLM FIFOConfiguration
UVM Factory UVM Config DBRuntime Control
UVM Plusargs Seeds & Reproducibility Verbosity Control Debug Runtime ControlsAdvanced
Virtual Sequences Virtual SequencerUVM RAL
Intro Abstraction Flexibility Comparison Coverage Minimum Requirements Learning Path Register Types First Implementation Register with 2 Fields Register with Reserved Bits Access Policies Part 1 Access Policies Part 2 Access Policies Part 3 Access Policies Part 4 Memory Modeling Register Block Adapter Introduction Adapter Methods Adapter Example Predictor Types Desired and Mirror Values Register Methods Desired Value Mirror ValueUVM Object and Core Methods
uvm_object is the base class for most non-component UVM classes.
It provides essential functionality such as printing, copying, comparing,
packing, unpacking, and factory-based object creation.
What is uvm_object?
uvm_object is the base class for:
- Sequence items
- Sequences
- RAL objects
- Configuration objects
- Transaction-level data structures
uvm_object does NOT have phases and does NOT live in the UVM hierarchy.
It is lightweight and used mainly for data modeling.
Core Methods of uvm_object
The power of uvm_object comes from its built-in utility methods.
These methods enable automation and consistency in verification environments.
1️⃣ create()
Used for factory-based object creation.
my_item item;
item = my_item::type_id::create("item");
This enables factory overrides and polymorphism.
2️⃣ copy()
Copies the contents of one object into another.
item2.copy(item1);
Internally calls do_copy(), which users can override.
3️⃣ compare()
Compares two objects field-by-field.
if (item1.compare(item2))
`uvm_info("COMPARE", "Objects match", UVM_LOW)
Internally calls do_compare().
Extremely useful in scoreboards.
4️⃣ print()
Prints object fields using a printer policy.
item.print();
Internally calls do_print().
Useful for debugging transactions.
5️⃣ pack() / unpack()
Converts object data into a bitstream and vice versa.
bit bits[];
item.pack(bits);
item.unpack(bits);
Internally calls:
do_pack()do_unpack()
Used in predictors, reference models, and advanced TLM use cases.
Automation with Macros
UVM provides field automation macros to avoid manually implementing
do_copy(), do_compare(), etc.
class my_item extends uvm_sequence_item;
rand bit [7:0] addr;
rand bit [31:0] data;
`uvm_object_utils_begin(my_item)
`uvm_field_int(addr, UVM_ALL_ON)
`uvm_field_int(data, UVM_ALL_ON)
`uvm_object_utils_end
function new(string name = "my_item");
super.new(name);
endfunction
endclass
- Factory registration
- Copy
- Compare
- Pack / Unpack
uvm_object vs uvm_component
| Feature | uvm_object | uvm_component |
|---|---|---|
| Hierarchy | No | Yes |
| Phases | No | Yes |
| Factory Support | Yes | Yes |
| Used for | Data / Transactions | Structural elements (env, agent, driver) |
Expert Insight
uvm_object is critical.
Scoreboards, sequences, RAL models, and predictors all rely heavily on it.
If you understand how do_copy(), do_compare(),
and factory registration work internally, you are no longer a beginner in UVM.