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 thefifo_envinbuild_phase. - Start the
fifo_sequenceon the agent sequencer inrun_phase. - Configure the environment via
uvm_config_dband 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.
| Phase | Purpose |
|---|---|
build_phase | Instantiate components (e.g., env) |
run_phase | Start 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
- Open
student/tb/tb_top.svandstudent/fifo_base_test.svin RtlStudio Explore. - In
tb_top.sv, ensurerun_test("fifo_base_test")is called after test creation in theinitialblock. - In
fifo_base_test.sv, implementbuild_phaseto createfifo_envandrun_phaseto startfifo_sequenceonenv.agent.sequencer. - Run Simulation from the sidebar and check the Log panel for
UVM_INFOmessages.
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
- Open the UVM workspace in the IDE. The DUT and the testbench compile together in the browser.
- Run the SystemVerilog simulation with Verilator and read the phase and scoreboard lines in the log.
- When the check is on pins rather than a print, open the VCD next to that log.
- 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.