RTL Studio Open IDE

4.6 · UVM CLASS

Virtual sequence: multi-agent fork-join conductor

Coordinate parallel write and read sequences on separate sequencers with a virtual sequence and fork–join.

Watch on YouTube

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_sequencer provides 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.

ConceptPurpose
p_sequencerCast reference to virtual sequencer holding sqr_wr, sqr_rd, etc.
fork...joinRun child sequences concurrently on their respective sequencers
Virtual sequence classExtends 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.

  1. Open student/tb/tb_top.sv in the editor.
  2. Locate the initial block where the test runs.
  3. Add a $display line before run_test to print the FIFO status: $display("INFO: fifo full=%b empty=%b", vif.full, vif.empty);
  4. Confirm the INFO: === Virtual sequence === and INFO: PASS lines are present.
  5. 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

  1. Open the UVM workspace in the IDE. The DUT and the testbench compile together in the browser.
  2. Run the SystemVerilog simulation with Verilator and read the phase and scoreboard lines in the log.
  3. When the check is on pins rather than a print, open the VCD next to that log.
  4. 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.