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 auvm_envusingtype_id::create. - Connect analysis ports from monitor to scoreboard in the
connect_phase. - Understand the role of
uvm_envas 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.
| Phase | Role |
|---|---|
build_phase | Creates child components using type_id::create. No connections yet. |
connect_phase | Connects 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.
- Open
student/tb/tb_top.svin the editor. - Locate the
__tst = new(...)block and therun_testcall. - In the test (
fifo_base_test), ensure it creates and builds the environment (fifo_env) usingtype_id::create. - In
fifo_env, implementbuild_phaseto instantiateagentandscoreboardusingtype_id::create. - In
fifo_env, implementconnect_phaseto connectagent.monitor.aptoscoreboard.analysis_export. - 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
- 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 env: verification environment pack. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.