Module 8: Protocol Projects | Intermediate UVM

Multi-Agent Integration Project

Build a coordinated UVM environment that drives multiple interfaces, observes their interactions, and verifies end-to-end behavior.

Learning objectives

  • Explain why a system-level UVM environment may require multiple protocol agents.
  • Coordinate multiple sequencers with a virtual sequence.
  • Connect monitor analysis ports to a scoreboard and verify cross-interface behavior.
  • Separate protocol-specific behavior from system-level test intent.
  • Use logs, assertions, scoreboard checks, and coverage as evidence of integration correctness.

Step 1: Understand the concept

A realistic DUT rarely communicates through only one interface. A subsystem might expose an APB or AXI-Lite register interface, generate interrupts, exchange data through a FIFO, or communicate with another block through a serial interface. Each interface can have its own reusable UVM agent, but the verification environment must still understand how those interfaces interact.

A multi-agent environment separates protocol responsibilities while allowing the testbench to verify system-level behavior. For example, a register write might configure a block, a data transaction might trigger processing, and the DUT might eventually assert an interrupt. The verification environment should be able to drive and observe that complete flow.

Design principle: Agents should understand their own protocols. The test, virtual sequence, and scoreboard should understand how those protocols participate in the larger system scenario.

Step 2: Define the integration architecture

Before writing sequences, identify every interface involved in the scenario and decide which component owns each responsibility. A typical environment might contain a register agent, data agent, interrupt monitor, and system-level scoreboard.

class subsystem_env extends uvm_env;


apb_agent        apb;
data_agent       data;
interrupt_agent  irq;
subsystem_scoreboard scoreboard;

function void build_phase(uvm_phase phase);
super.build_phase(phase);


apb = apb_agent::type_id::create("apb", this);
data = data_agent::type_id::create("data", this);
irq = interrupt_agent::type_id::create("irq", this);

scoreboard =
  subsystem_scoreboard::type_id::create("scoreboard", this);


endfunction

function void connect_phase(uvm_phase phase);
apb.monitor.ap.connect(scoreboard.apb_export);
data.monitor.ap.connect(scoreboard.data_export);
irq.monitor.ap.connect(scoreboard.irq_export);
endfunction

endclass

Notice that the environment does not need to know the details of every protocol transaction. The APB agent handles APB behavior, the data agent handles its own protocol, and the interrupt monitor observes interrupt activity. The scoreboard receives the information needed to make system-level comparisons.

Step 3: Coordinate agents with a virtual sequence

A multi-agent test often needs more than one sequencer. A virtual sequence provides a convenient place to coordinate activity across those sequencers without moving protocol details into the test itself.

class subsystem_vseq extends uvm_sequence;


`uvm_object_utils(subsystem_vseq)
  `uvm_declare_p_sequencer(subsystem_virtual_sequencer)

task body();


apb_config_seq cfg_seq;
data_write_seq data_seq;

cfg_seq = apb_config_seq::type_id::create("cfg_seq");
data_seq = data_write_seq::type_id::create("data_seq");

// Configure the DUT first.
cfg_seq.start(p_sequencer.apb_seqr);

// Then exercise the data path.
data_seq.start(p_sequencer.data_seqr);


endtask

endclass

The important idea is not the exact class names. The virtual sequence expresses the system scenario: configure the DUT, perform an operation, and allow the environment to observe the resulting behavior.

Common mistake: placing APB-specific register details directly inside a system test. Keep those details inside reusable APB sequences and let the virtual sequence describe the higher-level flow.

Step 4: Verify interactions, not just individual interfaces

Running each agent independently proves that the individual drivers and monitors work. It does not prove that the DUT correctly connects those interfaces together.

For an integration scenario, define an expected relationship between events. For example:

  1. A register transaction enables a feature.
  2. A data transaction is accepted by the DUT.
  3. The DUT processes the data.
  4. An interrupt is asserted.
  5. The interrupt status register reports the expected condition.

The scoreboard can consume transactions from several monitors and compare them against the expected system behavior. This is more powerful than checking each transaction in isolation.

function void write_irq(irq_transaction irq_tr);


if (expected_irq_pending) begin
if (!irq_tr.asserted) begin
`uvm_error("INTEGRATION",
        "Expected interrupt was not observed")
    end
    else begin
      `uvm_info("INTEGRATION",
"Expected interrupt observed",
UVM_MEDIUM)
end
end

endfunction

Step 5: Build the project incrementally

  1. Verify each agent independently. Confirm that every driver, monitor, sequencer, and protocol transaction works before debugging system-level interactions.
  2. Connect the environment. Connect monitor analysis ports to the appropriate scoreboard exports or analysis FIFOs.
  3. Create a virtual sequencer. Give the system-level sequence controlled access to the required agent sequencers.
  4. Implement one end-to-end scenario. Keep the first scenario deterministic and easy to diagnose.
  5. Add cross-interface checking. Verify that an event on one interface produces the expected response on another.
  6. Add constrained-random scenarios. Vary transaction data, timing, configuration, and legal protocol conditions only after the basic integration flow is reliable.
  7. Add coverage. Track meaningful combinations such as configuration state × operation type × response or interrupt condition.

Step 6: Debug integration failures systematically

Multi-agent failures can be difficult because the visible error may occur several transactions after the actual cause. Debug from the earliest observable event rather than starting with the final failure.

  1. Record the test name and random seed.
  2. Confirm reset completed successfully.
  3. Check that the virtual sequence started the expected agent sequences.
  4. Verify that each monitor observed the transactions it should have seen.
  5. Compare scoreboard expectations against actual transactions in timestamp order.
  6. Inspect the waveform around the first divergence from the expected flow.
Debug rule: distinguish a stimulus problem, an observation problem, and a DUT behavior problem. A scoreboard failure does not automatically mean that the DUT is wrong.

Step 7: Add meaningful integration coverage

Multi-agent projects benefit from coverage that measures interactions rather than merely counting transactions. Useful coverage might include:

  • Different register configuration modes.
  • Different data transaction types.
  • Interrupt generated versus not generated.
  • Successful and rejected operations.
  • Reset followed by immediate traffic.
  • Cross coverage between configuration state and operation type.

The goal is not to maximize a percentage blindly. Coverage should demonstrate that the important system-level behaviors have actually been exercised.

Try it yourself

Build a small environment with at least two agents—for example, a register agent and a data-path agent—and add an interrupt monitor.

  1. Write one sequence for each protocol-specific agent.
  2. Create a virtual sequence that coordinates the agents.
  3. Connect all monitor outputs to a scoreboard.
  4. Create one end-to-end scenario with a clearly defined expected result.
  5. Force one integration failure and identify whether it originated in stimulus, observation, synchronization, or DUT behavior.
  6. Add one coverage point and one cross-coverage relationship for the scenario.

Your final evidence should include the test name, seed, relevant log messages, scoreboard result, and coverage observation.

Key takeaways

  • Use separate agents to encapsulate independent protocols and keep them reusable.
  • Use virtual sequences to express system-level coordination between multiple sequencers.
  • Connect monitor outputs to scoreboards or analysis components for independent observation.
  • Integration verification must check relationships between interfaces, not only individual transactions.
  • Debug from the first observable divergence and distinguish stimulus, observation, and DUT failures.
  • Use functional and cross coverage to measure meaningful multi-interface scenarios.