What you practice
Virtual sequence: multi-agent fork-join conductor (4.6). Coordinate parallel write and read sequences on separate sequencers with a virtual sequence and fork–join. It is in Virtual sequence — Part 4 · Advanced UVM of the UVM Masterclass. Factory, config objects, virtual sequences, and pipelined drivers for large SoC verification.
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 use a virtual sequence to coordinate multiple sequencers in parallel using fork...join, enabling concurrent stimulus on write and read agents in a UVM testbench.
Learning objectives
- Understand the role of virtual sequences in multi-agent UVM environments.
- Implement a fork-join block to start child sequences on separate sequencers concurrently.
- Recognize how
p_sequencerprovides access to multiple virtual sequencers. - Verify parallel execution via testbench log output.
Theory
Virtual sequences do not drive pins directly; they orchestrate sequences on other sequencers via p_sequencer references. They are defined in a virtual sequencer container that holds references to multiple agent sequencers.
| Concept | Purpose |
|---|---|
p_sequencer | Cast reference to virtual sequencer holding sqr_wr, sqr_rd, etc. |
fork...join | Run child sequences concurrently on their respective sequencers |
| Virtual sequence class | Extends uvm_sequence#(uvm_sequence_item) but starts *other* sequences |
A typical virtual sequence body looks like: This enables concurrent write and read operations—critical for testing bidirectional interfaces like FIFOs.
For single-agent FIFO courses, the virtual sequencer may contain two sequencers (e.g., sqr_wr, sqr_rd) even if both map to the same physical agent, or use repeat blocks on one sequencer. The key is modeling logical separation for concurrent behavior.
Practice
Open RtlStudio and select this chapter; all files appear in Explore.
- Open
student/tb/tb_top.svin the editor. - Locate the
initialblock where the test runs. - Add a
$displayline beforerun_testto print the FIFO status:$display("INFO: fifo full=%b empty=%b", vif.full, vif.empty); - Confirm the
INFO: === Virtual sequence ===andINFO: PASSlines are present. - Run Simulation from the left sidebar and check the Log panel for expected output.
No changes to student/rtl/design.sv are needed—the DUT remains unchanged.
Summary
You practiced coordinating multiple sequencers from a virtual sequence using a fork...join block to run write and read operations in parallel. The key takeaway is that virtual sequences enable flexible orchestration of concurrent transactions across different agents or sequencers. This pattern is essential for modeling complex test scenarios involving multiple interfaces or agents. For single-agent scenarios, you can simulate parallelism by repeating operations on the same sequencer.
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 Virtual sequence: multi-agent fork-join conductor. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.