Part 2 · Phases & Lifecycle · Intermediate
report_phase: Summary Banners and Authoritative PASS/FAIL
Printing human-readable summaries, consulting the report server, and consistent RESULT banners across env and test hierarchy.
report_phase role
The report_phase callback prints the human-readable end-of-test summary. Most testbenches compute final PASS/FAIL here by reading the uvm_report_server error and fatal counts — not by re-running checks. Traversal is bottom-up: leaf components report first, parents add context.
[PHASE][UVM] report_phase output stack
agent: "AXI: 1024 txns, 0 mismatches"
env: "ENV: cov=94.2%, all agents healthy"
test: "*** TEST PASSED ***" or "*** TEST FAILED ***"
(from report server ERROR+FATAL == 0)Reference implementation
function void report_phase(uvm_phase phase);
super.report_phase(phase);
uvm_report_server svr = uvm_report_server::get_server();
int errs = svr.get_severity_count(UVM_ERROR)
+ svr.get_severity_count(UVM_FATAL);
int warns = svr.get_severity_count(UVM_WARNING);
`uvm_info("REPORT", $sformatf(
"=== SUMMARY: txns=%0d mismatches=%0d cov=%.1f%% errs=%0d warns=%0d ===",
act_count, mismatches, cov_pct, errs, warns), UVM_NONE)
if (errs == 0)
`uvm_info("RESULT", "*** TEST PASSED ***", UVM_NONE)
else
`uvm_info("RESULT", "*** TEST FAILED ***", UVM_NONE)
endfunction// Reusable signoff helper (optional project utility)
function bit test_passed();
uvm_report_server svr = uvm_report_server::get_server();
return (svr.get_severity_count(UVM_ERROR)
+ svr.get_severity_count(UVM_FATAL)) == 0;
endfunctionUse UVM_NONE verbosity for RESULT banners so they always print.
Include numeric context (txn counts, coverage) in the same banner block.
Never print PASS if check_phase already raised errors.
Key takeaways
report_phase summarizes; PASS/FAIL comes from report server counts.
Bottom-up reporting lets children print detail before parent rollup.
One RESULT banner at test level avoids conflicting messages.
Common pitfalls
Custom PASS print ignoring accumulated uvm_error count.
Multiple competing RESULT banners at env and test without hierarchy discipline.
Using uvm_info at UVM_HIGH for the final banner — it may be filtered out.
Formatting patterns
[PHASE][UVM] report template
────────────────────────────────────────
TEST: my_soft_reset_test
SEED: 42
TXNS: 512 MISMATCHES: 0 COV: 91.3%
ERRORS: 0 WARNINGS: 2
RESULT: *** TEST PASSED ***
────────────────────────────────────────Structured banners make CI log parsers reliable. Keep field order stable across releases.