What you practice
UVM agent: active vs passive is_active (3.1). Build a reusable agent with is_active to switch between active and passive (monitor-only) modes. It is in UVM agent — 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
Today you will learn how to build a reusable UVM agent that adapts its components based on the is_active configuration, enabling both active (driver + sequencer) and passive (monitor-only) agents in verification environments.
Learning objectives
- Understand the difference between active and passive UVM agents.
- Use
get_is_active()to conditionally build driver and sequencer inbuild_phase. - Connect components in
connect_phaseonly when active.
Theory
An active UVM agent contains a sequencer, driver, and monitor, and can drive stimuli to the DUT. A passive agent contains only a monitor and observes transactions without driving the DUT. The is_active field (UVM_ACTIVE or UVM_PASSIVE) controls which components are built.
| Agent Type | Sequencer | Driver | Monitor | Drives DUT? |
|---|---|---|---|---|
| Active | Yes | Yes | Yes | Yes |
| Passive | No | No | Yes | No |
The build_phase method typically uses if (get_is_active() == UVM_ACTIVE) to conditionally instantiate driver and sequencer. The monitor is always instantiated. In connect_phase, sequencer–driver connection (driver.seq_item_port.connect(sequencer.seq_item_export)) is done only when active.
Practice
- Open this chapter in RtlStudio.
Confirm files appear in Explore — no manual setup needed.
- Open
student/tb/tb_top.svandgolden/tb/env/fifo_agent.sv(if not visible, checkgolden/tb/env/). - In
golden/tb/env/fifo_agent.sv, observe howbuild_phaseusesget_is_active()to conditionally create driver and sequencer. - In
student/tb/tb_top.sv, ensure the testbench configuresis_activeviauvm_config_dbbeforerun_test.
The testbench already sets up fifo_env_config and passes it to the environment.
- Run Simulation and check the Log panel for
INFO:output.
Summary
You practiced building a reusable UVM agent by conditionally instantiating the driver and sequencer based on the agent's is_active setting, while always creating the monitor. This approach allows the same agent to operate in active mode for stimulus generation or passive mode for observation-only scenarios. The key takeaway is that is_active controls the agent’s behavior, enabling flexible reuse across different testbench environments.
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 agent: active vs passive is_active. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.