UVM Test

The UVM Test is the top-level control component that configures and runs the verification environment.

📘 What is a UVM Test?

A UVM Test extends uvm_test and is responsible for:

  • Creating the Environment
  • Configuring Agents (Active/Passive)
  • Starting Sequences
  • Overriding components via Factory

It is the highest-level component in the UVM hierarchy.

🏗 Test Architecture

        -------------------------
        |         TEST          |
        |-----------------------|
        |         ENV           |
        |-----------------------|
        |      Agent(s)         |
        |      Scoreboard       |
        -------------------------

The Test instantiates the Environment, which then builds the rest of the verification components.

💻 Basic UVM Test Example

class my_test extends uvm_test;

  `uvm_component_utils(my_test)

  my_env env;

  function new(string name = "my_test", uvm_component parent);
    super.new(name, parent);
  endfunction

  function void build_phase(uvm_phase phase);
    super.build_phase(phase);

    env = my_env::type_id::create("env", this);
  endfunction

endclass
▶ Starting a Sequence in run_phase

task run_phase(uvm_phase phase);
  my_sequence seq;

  phase.raise_objection(this);

  seq = my_sequence::type_id::create("seq");
  seq.start(env.agent.seqr);

  phase.drop_objection(this);
endtask

The test controls simulation duration using objections.

🔄 Advanced Test Capabilities
  • Factory Overrides
  • Configuration via uvm_config_db
  • Multiple Sequences
  • Virtual Sequences
  • Randomized Test Variants
🚀 Why the UVM Test is Powerful
  • Defines verification scenario
  • Separates stimulus from structure
  • Enables regression testing
  • Supports scalable and reusable testbenches
⚙ Running a Specific Test

+UVM_TESTNAME=my_test

This command-line argument selects which test to run in simulation.