UVM gives you a smart way to print messages. Instead of using the basic Verilog
$display (which is just dumb text), UVM provides powerful Macros. These
let you tag messages with importance levels, filter them loops (like "only show errors"),
and even change them on the fly without rewriting code.
- Macro: A shortcut (starts with `) that expands into more complex code.
- Verbosity: How "chatty" your testbench is. Low verbosity = quiet (errors only), High = noisy (debug info).
- Simulation Impact: What happens to the simulation (continue, stop, or count error).
1. Severity Levels
| Macro | Simulation Impact | Standard Usage |
|---|---|---|
`uvm_info |
None. | Tracking flow, printing transaction data. |
`uvm_warning |
None (usually). | Potential issues that aren't failures (e.g., unusual but legal packet). |
`uvm_error |
Increments Error Count. | Data mismatches, protocol violations. |
`uvm_fatal |
Terminates immediately. | Hardware reset failures, missing config files. |
// `uvm_info(ID, MESSAGE, VERBOSITY)
`uvm_info("DRV", $sformatf("Driving packet with addr: %h", req.addr), UVM_MEDIUM)
// `uvm_error(ID, MESSAGE) -> No verbosity needed!
`uvm_error("SCOREBOARD", "In-flight queue should be empty at EOF!")