RTL Studio Open IDE

3.3 · UVM CLASS

UVM scoreboard compare() and uvm_error

Compare expected and actual FIFO transactions and raise uvm_error on mismatch.

Watch on YouTube

What you practice

UVM scoreboard compare() and uvm_error (3.3). Compare expected and actual FIFO transactions and raise uvm_error on mismatch. It is in Scoreboard — Part 3 · Env and Coverage of the UVM Masterclass. Assemble the verification environment, compare data, and hunt coverage.

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 implement a UVM scoreboard that compares expected and actual FIFO transactions and triggers uvm_error on mismatch, enabling automated correctness checking in testbenches.

Learning objectives

  • Understand how to extend uvm_scoreboard for transaction-level comparison.
  • Learn to retrieve actual transactions from a TLM analysis FIFO.
  • Predict expected transactions using a reference queue or model.
  • Use uvm_error to flag mismatches during simulation.

Theory

A UVM scoreboard verifies DUT behavior by comparing expected and actual transactions.

ComponentRole
uvm_scoreboardBase class for verification logic; no sequencer/agent needed
TLM analysis FIFOStores transactions captured from DUT outputs
Expected queueStores predicted transactions (e.g., from reference model)
compare()Method where mismatch detection and uvm_error are triggered

The scoreboard typically runs in run_phase, pulling actual transactions from the FIFO and comparing them with expected ones. A mismatch calls uvm_error, which increments error counters and halts the test if configured.

Practice

  1. Open this chapter in RtlStudio; confirm files appear in Explore.
  2. Open student/tb/tb_top.sv and locate the TODO section.
  3. Implement the scoreboard by extending uvm_scoreboard, overriding build_phase to create the analysis FIFO export and run_phase to perform comparison.
  4. In run_phase, get actual transactions from the TLM FIFO, push expected transactions into a queue (or predict them), and use compare() to check equality.
  5. On mismatch, call uvm_error with a descriptive message.
  6. Run Simulation and verify the Log panel shows expected uvm_info messages (e.g., uvm_info (UVM_SCOREBOARD) ...) and no uvm_error if the test passes.

Summary

You implemented a UVM scoreboard extending uvm_scoreboard to validate DUT behavior by comparing actual FIFO transactions against expected values. In the run_phase, you retrieved actual transactions from a TLM analysis FIFO, predicted expected transactions, and used the compare() method to check for mismatches. When mismatches occurred, you triggered uvm_error to flag errors, reinforcing the importance of accurate transaction comparison in verification. The key takeaway is that scoreboard-based comparison with uvm_error provides a robust mechanism for catching functional bugs during simulation.

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 UVM scoreboard compare() and uvm_error. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.