RTL Studio Open IDE

3.4 · UVM CLASS

UVM env: verification environment pack

Wire agent and scoreboard into a reusable environment in build_phase and connect_phase.

Watch on YouTube

What you practice

UVM env: verification environment pack (3.4). Wire agent and scoreboard into a reusable environment in build_phase and connect_phase. It is in UVM env — Part 3 · Env and Coverage of the UVM Masterclass. Assemble the verification environment, compare data, and hunt coverage.

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 learn how to compose a reusable UVM environment by wiring together agent and scoreboard components using TLM analysis ports.

Learning objectives

  • Create child components (uvm_agent, uvm_scoreboard) inside a uvm_env using type_id::create.
  • Connect analysis ports from monitor to scoreboard in the connect_phase.
  • Understand the role of uvm_env as a container for reusable verification infrastructure.

Theory

In UVM, uvm_env is a container component that instantiates and connects reusable components like agents, scoreboards, and coverage collectors.

PhaseRole
build_phaseCreates child components using type_id::create. No connections yet.
connect_phaseConnects TLM analysis ports (e.g., monitor.ap.connect(scoreboard.analysis_export)) and configures component hierarchies.

The environment abstracts component wiring so tests can reuse the same infrastructure without redefining agents or scoreboards.

Practice

Open RtlStudio and select Lesson 3.4. Files appear automatically in Explore.

  1. Open student/tb/tb_top.sv in the editor.
  2. Locate the __tst = new(...) block and the run_test call.
  3. In the test (fifo_base_test), ensure it creates and builds the environment (fifo_env) using type_id::create.
  4. In fifo_env, implement build_phase to instantiate agent and scoreboard using type_id::create.
  5. In fifo_env, implement connect_phase to connect agent.monitor.ap to scoreboard.analysis_export.
  6. Run Simulation and check the Log panel for expected INFO: lines.

Summary

You built a reusable UVM environment by instantiating the agent and scoreboard using type_id::create in the build_phase. You connected the monitor’s analysis port to the scoreboard’s TLM FIFO in the connect_phase to enable data flow from agent to scoreboard. The key takeaway is that environments encapsulate and interconnect verification components to form a cohesive, reusable testbench structure.

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 env: verification environment pack. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.