UVM Reporting
Learn how to use UVM reporting to communicate progress, warnings, errors, and fatal failures clearly throughout a verification environment.
Learning objectives
- Explain why UVM reporting is preferable to scattered simulator print statements.
- Use
uvm_info,uvm_warning,uvm_error, anduvm_fatalappropriately. - Choose meaningful message IDs and verbosity levels.
- Write report messages that provide useful debugging context.
- Distinguish diagnostic messages from actual verification failures.
Step 1: Understand the concept
A UVM testbench contains many components operating concurrently: sequences generate transactions, drivers communicate with the DUT, monitors observe activity, reference models predict behavior, and scoreboards check results.
When something goes wrong, you need to know what happened, where it happened, and how serious it is.
UVM provides a standardized reporting system for this purpose.
Sequence
|
| "Starting traffic"
v
Driver
|
| "Driving transaction"
v
DUT
|
v
Monitor
|
| "Observed transaction"
v
Scoreboard
|
| "Expected != Actual"
v
UVM ERROR
Instead of every component inventing its own logging mechanism, UVM components can use the same reporting infrastructure.
Step 2: Learn the four basic severities
The four reporting macros you will use most often are:
| Macro | Typical meaning |
|---|---|
uvm_info |
Normal diagnostic or progress information. |
uvm_warning |
Something unusual happened, but simulation can continue. |
uvm_error |
A verification problem occurred, but simulation can continue so more evidence can be collected. |
uvm_fatal |
A critical problem prevents meaningful simulation from continuing. |
For example:
`uvm_info("DRIVER",
"Starting transaction",
UVM_MEDIUM)
`uvm_warning("CONFIG",
"Optional configuration was not provided")
`uvm_error("SCOREBOARD",
"Expected data does not match actual data")
`uvm_fatal("NOVIF",
"Virtual interface was not configured")
Use severity based on the consequence of the condition, not simply how much you want the message to stand out.
Step 3: Use meaningful message IDs
Every report macro takes an ID. The ID identifies the category or source of the message.
`uvm_info("MON",
"Observed a valid transfer",
UVM_MEDIUM)
`uvm_info("SEQ",
"Generated write transaction",
UVM_MEDIUM)
`uvm_error("SB",
"Scoreboard mismatch",
)
Common IDs might include:
SEQ— sequence activityDRV— driver activityMON— monitor observationsREF— reference model activitySB— scoreboard checksCFG— configuration problemsRESET— reset-related behavior
Good IDs make long simulation logs easier to scan and filter.
SB_MISMATCHWeak ID:
MESSAGE1
Step 4: Control diagnostic detail with verbosity
uvm_info includes a verbosity level. This allows you to keep useful debugging information in the code without displaying every message during every normal run.
Common verbosity levels include:
| Level | Typical use |
|---|---|
UVM_NONE |
Minimal verbosity. |
UVM_LOW |
Important high-level progress. |
UVM_MEDIUM |
Normal diagnostic information. |
UVM_HIGH |
Detailed debugging. |
UVM_FULL |
Very detailed information. |
UVM_DEBUG |
Maximum diagnostic detail. |
For example:
`uvm_info("DRV",
$sformatf("Driving:\n%s", req.sprint()),
UVM_HIGH)
Detailed transaction dumps can be extremely useful while debugging, but they can also produce enormous logs during a large regression. Verbosity lets you control that tradeoff.
Step 5: Put useful information in the message
A message such as:
`uvm_error("SB", "Mismatch")
is technically valid but not very useful.
A better message identifies the important values:
`uvm_error(
"SB_MISMATCH",
$sformatf(
"Data mismatch: addr=0x%02h expected=0x%02h actual=0x%02h",
actual.addr,
expected.data,
actual.data
)
)
When possible, include information that helps answer these questions:
- What failed?
- Which transaction failed?
- What was expected?
- What actually happened?
- What context is relevant?
This is especially important for constrained-random tests. A failure that says only "Mismatch" may be difficult to reproduce. A failure containing the transaction values provides a much stronger debugging starting point.
Step 6: Reporting in a real monitor
Consider the monitor from earlier lessons. It reconstructs a transaction whenever a valid transfer occurs.
task run_phase(uvm_phase phase);
bus_transaction observed;
forever begin
@(posedge vif.clk);
if (vif.reset)
continue;
if (vif.valid && vif.ready) begin
observed =
bus_transaction::type_id::create("observed");
observed.write = vif.write;
observed.addr = vif.addr;
observed.data = vif.data;
`uvm_info(
"MON",
$sformatf(
"Observed transaction:\n%s",
observed.sprint()
),
UVM_MEDIUM
)
analysis_port.write(observed);
end
end
endtask
This creates a useful observation point without changing the DUT or controlling the transaction.
The monitor reports what it observed. It should not report that the DUT behaved correctly simply because the transaction was seen. Correctness belongs to the checking components.
Step 7: Reporting versus checking
Reporting and checking are related, but they are not the same thing.
Monitor
|
| "I observed data=55"
v
Reference Model
|
| "Expected data=AA"
v
Scoreboard
|
| Compare
v
UVM ERROR if different
The monitor provides evidence about what happened. The scoreboard determines whether that observation violates the expected behavior.
For example, this is appropriate:
`uvm_info(
"MON",
$sformatf("Observed data=0x%02h", observed.data),
UVM_MEDIUM
)
while this belongs in the checking logic:
if (actual.data != expected.data) begin
`uvm_error(
"SB_MISMATCH",
"Actual data does not match expected data"
)
end
Step 8: Choose severity carefully
A common beginner mistake is using uvm_fatal for every problem.
Imagine a regression with 100 tests and one incorrect DUT transaction. If the scoreboard uses uvm_fatal immediately, you may lose useful information about later transactions and additional failures.
For many functional mismatches, uvm_error is more appropriate because the simulation can continue and collect additional evidence.
Use uvm_fatal for conditions that make continued simulation meaningless, such as a required virtual interface that could not be configured:
if (!uvm_config_db#(virtual bus_if)::get(
this, "", "vif", vif
)) begin
`uvm_fatal(
"NOVIF",
"Required virtual interface was not configured"
)
end
The exact choice depends on the verification architecture and failure policy, but the general rule is:
Diagnostic problem → INFO / WARNING
Verification failure → ERROR
Cannot meaningfully continue → FATAL Step 9: Build a useful reporting strategy
A well-designed testbench should produce enough information to understand its behavior without overwhelming the engineer with noise.
Normal regression:
INFO → important milestones
WARNING → unusual but recoverable conditions
ERROR → verification failures
FATAL → unrecoverable setup/environment failures
Debug run:
Increase verbosity
|
v
More transaction-level detail
|
v
Trace the first incorrect behavior
Think of reporting as an observability layer for your verification environment.
Try it yourself
Add UVM reporting to a small driver, monitor, and scoreboard.
- Print a
UVM_LOWmessage when a sequence starts. - Print a
UVM_MEDIUMmessage when the driver receives a transaction. - Print the observed transaction from the monitor using
UVM_HIGH. - Generate a
uvm_errorwhen the scoreboard detects a mismatch. - Generate a
uvm_fatalwhen a required virtual interface cannot be obtained. - Give every message a meaningful ID such as
SEQ,DRV,MON, orSB.
Challenge: Run the test normally, then increase the report verbosity and compare the two logs. Notice how the same testbench can provide either a concise regression log or detailed debugging information.
Key takeaways
- UVM reporting provides a consistent mechanism for communicating verification activity and failures.
- Use
uvm_info,uvm_warning,uvm_error, anduvm_fatalaccording to the severity of the situation. - Meaningful message IDs and verbosity levels make large simulation logs easier to understand.
- A useful error message includes enough context to diagnose and reproduce the problem.
- Monitors report observations; scoreboards and other checkers report correctness.
- Use errors for functional verification failures and fatal reports for conditions that prevent meaningful simulation.
Core mental model
Observe
|
v
Report what happened
|
v
Check correctness
|
v
Report the result
|
+---- INFO/WARNING → useful information
|
+---- ERROR --------> verification failure
|
+---- FATAL --------> cannot continue meaningfully
Good reporting turns simulation activity into understandable evidence.
What comes next?
The next lesson focuses on Objections and End of Test. You will learn how UVM knows when time-consuming stimulus is still running and how to prevent a test from ending too early—or running forever.