UVM Class Hierarchy

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_object inherits from uvm_void and 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()
  • 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

uvm_void
    └── uvm_object
        ├── uvm_component
        └── uvm_sequence_item 
            (uvm_transaction - deprecated for user-defined transactions)

4. The uvm_component Branch

  • uvm_component is 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 from uvm_object) represents the data items (transactions) that are exchanged between components, particularly between sequencers and drivers.
  • While uvm_transaction exists, it’s now recommended to derive user-defined transactions directly from uvm_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_object is the root of most UVM classes, providing fundamental functionalities.
  • uvm_component is for active testbench elements with a hierarchical structure.
  • uvm_sequence_item is for data items (transactions) passed between components.
  • Understanding this hierarchy is crucial for building and navigating UVM testbenches.