What you practice
Analysis port: broadcast monitored data (2.5). Use analysis ports to broadcast monitored transactions to downstream components. It is in Analysis port — Part 2 · Agent: Driver & Monitor of the UVM Masterclass. Connect software UVM components to hardware FIFO pins.
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 use a UVM uvm_analysis_port to broadcast sampled transactions from a monitor to other components like subscribers or scoreboards.
Learning objectives
- Declare and instantiate a
uvm_analysis_portin a UVM monitor. - Call
write()on the analysis port to broadcast each sampled transaction. - Connect the analysis port to a subscriber or log sink in the testbench.
- Understand how analysis ports enable decoupled data flow in UVM verification environments.
Theory
UVM provides uvm_analysis_port as a one-to-many broadcast mechanism for exporting data from components like monitors. It uses the observer pattern: the publisher (monitor) calls write() on its port, and any connected subscribers receive the data.
| Component | Role |
|---|---|
uvm_analysis_port | Publisher interface — declared in monitor, calls write(item) |
uvm_analysis_export / uvm_analysis_imp | Subscriber interfaces — receive write(item) |
uvm_subscriber | Base class for subscribers; must implement write(T t) |
No handshake or blocking occurs — write() is non-blocking and returns immediately. This enables scalable, reusable verification components.
Practice
Open RtlStudio and select this chapter. Files appear in Explore; no manual setup needed.
- Open
student/tb/tb_top.svin the editor. - In the
moninstance, declare auvm_analysis_portnamedapof typeuvm_analysis_port #(fifo_seq_item). - In
mon'sbuild_phase, instantiate the port:ap = new("ap", this);. - In
mon'srun_phase, after sampling a transaction intomon_item, callap.write(mon_item);. - In
tb_top, connectmon.apto a simple subscriber or log sink (e.g., a custom subscriber that prints each item). - Run Simulation and verify the log shows broadcast transactions.
Summary
You practiced declaring and using a UVM analysis port to broadcast sampled transactions from the monitor. This enables decoupled components like subscribers or scoreboards to receive and process data without direct connections. The write() method is the standard way to push transactions through the analysis port. This pattern forms the foundation for building more complex verification components in Part 3.
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 Analysis port: broadcast monitored data. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.