What you practice
Driver: seq_item_port.get_next_item() (2.1). Retrieve the next transaction from the sequencer with get_next_item() in run_phase. It is in Driver basics — 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 the UVM driver pulls the next transaction from the sequencer using seq_item_port.get_next_item(), the core mechanism for stimulus delivery in UVM.
Learning objectives
- Understand the role of
uvm_driverand itsseq_item_port. - Learn how
get_next_item()blocks until a transaction is available from the sequencer. - Implement the driver’s
run_phaseto callget_next_item()and hold the request handle. - Observe the driver pulling and processing one transaction per simulation cycle.
Theory
The uvm_driver is the stimulus consumer in a UVM agent. It connects to the sequencer via the seq_item_port, a TLM port that retrieves sequence items.
get_next_item() is a blocking call that waits for the next item from the sequence, returns a handle to the request (req), and keeps the item locked until item_done() is called (not required in this lesson). This ensures ordered, synchronized transaction delivery.
| Method | Behavior |
|---|---|
get_next_item(req) | Blocks until an item is available; returns req handle |
item_done() | Releases the item (not used here) |
The driver’s run_phase typically contains a forever loop that repeatedly calls get_next_item() to drive each transaction.
Practice
Open this chapter in RtlStudio. Files appear automatically in Explore.
- Open
student/tb/tb_top.svin the editor. - In the
initialblock, locate thefork drv.run_phase(null); join_noneline. - Confirm the driver’s
run_phasecontains aforeverloop that callsseq_item_port.get_next_item(req). - Run Simulation and check the Log panel for expected output.
You do not need to edit RTL — focus on verifying the driver’s API usage in the testbench.
Summary
You implemented the driver’s run_phase to pull one transaction from the sequencer using seq_item_port.get_next_item(), establishing the foundational handshake mechanism between the sequencer and driver in UVM. You verified correct behavior by observing a single iteration in the log, confirming proper item retrieval. The key takeaway is that get_next_item() blocks until a sequence item is available, enabling synchronized stimulus delivery in the UVM environment.
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 Driver: seq_item_port.get_next_item(). Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.