What you practice
Hello UVM: macros and uvm_info (0.1). Introduce UVM logging with uvm_info in a console-first testbench without UVM components. It is in Hello UVM — Part 0 · UVM Warming Up of the UVM Masterclass. How SystemVerilog classes evolve into the UVM verification framework.
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 learn how to enable UVM macros and use uvm_info to print messages in a SystemVerilog testbench.
Learning objectives
- Include
uvm_macros.svhin your testbench. - Import
uvm_pkgand calluvm_infowith correct arguments. - Observe UVM info messages in the simulation log.
- Distinguish UVM logging from
$display.
Theory
UVM (Universal Verification Methodology) provides standardized logging, reporting, and component hierarchy.
| Macro / Function | Purpose |
|---|---|
` include "uvm_macros.svh" `` | Enables UVM macros like uvm_info, uvm_error, etc. |
import uvm_pkg::*; | Imports UVM package definitions (required for macros to expand). |
` uvm_info(id, msg, verbosity) `` | Logs a message with ID, string content, and verbosity level. |
uvm_info requires three arguments: a string ID (e.g., "HELLO"), a message string, and a verbosity level (e.g., UVM_LOW). Messages appear in the simulation log only if the configured verbosity threshold allows them.
Practice
- Open RtlStudio and select this chapter — all files appear in Explore.
- Open
student/tb/tb_top.svfrom the Explore tree. - In the
initialblock, replace the__TODO__with a correctuvm_infocall. - Run Simulation from the left sidebar and check the Log panel.
- Confirm the
INFO:banner anduvm_infooutput appear beforeINFO: PASS.
Summary
You practiced enabling UVM macros by including uvm_macros.svh and importing uvm_pkg to prepare a minimal testbench environment. You successfully invoked uvm_info with the correct arguments to log a message and confirmed its appearance in the simulation output alongside a $display statement. This exercise verified that UVM logging is properly integrated and established a reliable baseline for future testbench components. The key takeaway is that uvm_info serves as a standardized, verbosity-controlled console logging primitive essential for debugging and monitoring UVM simulations.
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 Hello UVM: macros and uvm_info. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.