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_scoreboardfor transaction-level comparison. - Learn to retrieve actual transactions from a TLM analysis FIFO.
- Predict expected transactions using a reference queue or model.
- Use
uvm_errorto flag mismatches during simulation.
Theory
A UVM scoreboard verifies DUT behavior by comparing expected and actual transactions.
| Component | Role |
|---|---|
uvm_scoreboard | Base class for verification logic; no sequencer/agent needed |
| TLM analysis FIFO | Stores transactions captured from DUT outputs |
| Expected queue | Stores 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
- Open this chapter in RtlStudio; confirm files appear in Explore.
- Open
student/tb/tb_top.svand locate the TODO section. - Implement the scoreboard by extending
uvm_scoreboard, overridingbuild_phaseto create the analysis FIFO export andrun_phaseto perform comparison. - In
run_phase, get actual transactions from the TLM FIFO, push expected transactions into a queue (or predict them), and usecompare()to check equality. - On mismatch, call
uvm_errorwith a descriptive message. - Run Simulation and verify the Log panel shows expected
uvm_infomessages (e.g.,uvm_info (UVM_SCOREBOARD) ...) and nouvm_errorif 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
- 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 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.