RTL Studio Open IDE

4.1 · UVM CLASS

UVM test: orchestrate env and sequences

Orchestrate the environment and sequences from a top-level UVM test class.

Watch on YouTube

What you practice

UVM test: orchestrate env and sequences (4.1). Orchestrate the environment and sequences from a top-level UVM test class. It is in UVM test — Part 4 · Advanced UVM of the UVM Masterclass. Factory, config objects, virtual sequences, and pipelined drivers for large SoC verification.

The UVM bench compiles in that same browser SystemVerilog simulator. You edit the test in the IDE, run Verilator, and read the log beside the waveform.

What you will learn

You will write a top-level UVM test to instantiate the environment and start the main sequence on the agent sequencer, enabling full verification orchestration from a single entry point.

Learning objectives

  • Create a uvm_test-derived class that builds the fifo_env in build_phase.
  • Start the fifo_sequence on the agent sequencer in run_phase.
  • Configure the environment via uvm_config_db and use the virtual interface.
  • Understand the UVM phase hierarchy and sequence execution flow.

Theory

UVM tests are the top-level entry point for verification. They orchestrate the environment and stimulus by creating the environment instance and starting sequences. The build_phase is used to construct components, while run_phase executes the actual stimulus via sequences. Sequences run on sequencers, which mediate between sequences and drivers. Configuration is passed via uvm_config_db to decouple components.

PhasePurpose
build_phaseInstantiate components (e.g., env)
run_phaseStart sequences, apply stimulus

The testbench uses a virtual interface (fifo_if) to connect the DUT and environment. The environment config (fifo_env_config) holds the virtual interface and is set in uvm_config_db for the environment to retrieve.

Practice

  1. Open student/tb/tb_top.sv and student/fifo_base_test.sv in RtlStudio Explore.
  2. In tb_top.sv, ensure run_test("fifo_base_test") is called after test creation in the initial block.
  3. In fifo_base_test.sv, implement build_phase to create fifo_env and run_phase to start fifo_sequence on env.agent.sequencer.
  4. Run Simulation from the sidebar and check the Log panel for UVM_INFO messages.

Summary

You built a base test that creates the FIFO environment and starts the main sequence on the agent sequencer during the run phase. This demonstrates how a top-level UVM test orchestrates the verification environment and sequences to drive stimulus. The test successfully passes, confirming correct integration of the environment and sequence infrastructure.

Run it in the Verilog IDE

  1. Open the UVM workspace in the IDE. The DUT and the testbench compile together in the browser.
  2. Run the SystemVerilog simulation with Verilator and read the phase and scoreboard lines in the log.
  3. When the check is on pins rather than a print, open the VCD next to that log.
  4. Edit the sequence, driver, or scoreboard in the IDE and rerun. You stay in the same simulator.

The lesson is done when the simulation matches UVM test: orchestrate env and sequences. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.