The UVM class hierarchy is fundamental to understanding how UVM testbenches are structured and how components interact. Here’s a breakdown with diagrams to help visualize it:
1. The Root: uvm_void
- At the very top of the hierarchy is
uvm_void. It’s an abstract class, meaning it doesn’t have any data members or functions itself. It serves as the ultimate base for all other UVM classes.
2. The Foundation: uvm_object
uvm_objectinherits fromuvm_voidand is the base class for almost everything in UVM. It provides essential methods for:- Object creation:
create() - Copying:
copy() - Printing:
print() - Comparison:
compare() - Cloning:
clone()
- Object creation:
- It also includes mechanisms for transaction recording and reporting.
3. Branches of uvm_object
From uvm_object, the hierarchy splits into two main branches:
uvm_component: For active entities in the testbench (drivers, monitors, agents, etc.)uvm_transaction/uvm_sequence_item: For data items exchanged between components.
Diagram 1: Simplified Main Hierarchy
<img class="aligncenter wp-image-570" src="http://chipcoverage.com/wp-content/uploads/2025/01/Screenshot-2025-01-01-at-5.07.18 PM-300x187.png" alt="" width="526" height="328" />
4. The uvm_component Branch
uvm_componentis the base for active, hierarchical elements of the testbench. Key derived classes include:uvm_env: Represents an environment containing multiple agents and other components.uvm_agent: Encapsulates a driver, sequencer, and monitor for a specific interface.uvm_driver: Drives stimulus onto the design under verification (DUV).uvm_sequencer: Generates sequences of transactions.uvm_monitor: Observes and captures activity on the DUV interface.
Diagram 2: uvm_component Hierarchy
uvm_object
└── uvm_component
├── uvm_env
│ └── (User-defined envs)
├── uvm_agent
│ ├── uvm_driver
│ ├── uvm_sequencer
│ └── uvm_monitor
└── (Other specialized components)
5. The uvm_sequence_item Branch
uvm_sequence_item(inheriting fromuvm_object) represents the data items (transactions) that are exchanged between components, particularly between sequencers and drivers.- While
uvm_transactionexists, it’s now recommended to derive user-defined transactions directly fromuvm_sequence_item.
Diagram 3: uvm_sequence_item and uvm_transaction
uvm_object
└── uvm_sequence_item
└── (User-defined transaction classes)
└── uvm_transaction (Deprecated for user-defined transactions)
Complete Hierarchy (Simplified)
A more complete, though still simplified, view combining the above:
uvm_void
└── uvm_object
├── uvm_component
│ ├── uvm_env
│ │ └── (User-defined envs)
│ ├── uvm_agent
│ │ ├── uvm_driver
│ │ ├── uvm_sequencer
│ │ └── uvm_monitor
│ └── (Other specialized components)
└── uvm_sequence_item
└── (User-defined transaction classes)
Key Takeaways:
uvm_objectis the root of most UVM classes, providing fundamental functionalities.uvm_componentis for active testbench elements with a hierarchical structure.uvm_sequence_itemis for data items (transactions) passed between components.- Understanding this hierarchy is crucial for building and navigating UVM testbenches.
