uvm_report_catcher: Demote a UVM_ERROR to a Warning (Tested)
In short: a uvm_report_catcher sees every report message before the report server prints or counts it, and can change it. The most common use is an error demoter: you catch one known, reviewed UVM_ERROR and lower it to a UVM_WARNING so it does not fail an otherwise passing test. You extend uvm_report_catcher, override catch(), register it with uvm_report_cb::add, and return THROW.
Sometimes a test hits an error you cannot remove today, such as a message from third-party VIP that you have already looked at and accepted. Editing that code is not an option, and raising the error limit hides every other error too.
A report catcher gives you one small, visible place to handle exactly that message. In this lesson we build one, then test six more things a catcher can do, all on Synopsys VCS.
Start here: the simplest example
One catcher, one known error. The catcher matches on severity and ID, lowers the severity, and passes the message on.
// tav_catch_simple.sv : the smallest uvm_report_catcher error demoter (UVM 1.2)
// The Art of Verification | theartofverification.com
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 2 Dec 2026.
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
`timescale 1ns/1ns
`include "uvm_macros.svh"
import uvm_pkg::*;
// The catcher: turns one known error (ID TAV_ADDR) into a warning
class tav_demoter extends uvm_report_catcher;
`uvm_object_utils(tav_demoter)
function new(string name = "tav_demoter");
super.new(name);
endfunction
// catch() runs for every report message, before it is printed or counted
virtual function action_e catch();
if (get_severity() == UVM_ERROR && get_id() == "TAV_ADDR")
set_severity(UVM_WARNING); // demote it
return THROW; // pass it on, so it still prints
endfunction
endclass
class tav_catch_test extends uvm_test;
`uvm_component_utils(tav_catch_test)
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
tav_demoter dem = tav_demoter::type_id::create("dem");
uvm_report_cb::add(null, dem); // null = apply to every component
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this);
#10 `uvm_error("TAV_ADDR", "address 0x40 is out of range (known issue, reviewed)")
phase.drop_objection(this);
endtask
function void report_phase(uvm_phase phase);
uvm_report_server rs = uvm_report_server::get_server();
`uvm_info("TAV_CATCH", $sformatf("UVM_ERROR count = %0d, UVM_WARNING count = %0d",
rs.get_severity_count(UVM_ERROR), rs.get_severity_count(UVM_WARNING)), UVM_LOW)
endfunction
endclass
module tav_top;
initial run_test("tav_catch_test");
endmodule
Here is what VCS printed:
UVM_INFO @ 0: reporter [RNTST] Running test tav_catch_test...
UVM_WARNING testbench.sv(40) @ 10: uvm_test_top [TAV_ADDR] address 0x40 is out of range (known issue, reviewed)
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(46) @ 10: uvm_test_top [TAV_CATCH] UVM_ERROR count = 0, UVM_WARNING count = 1
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_catcher.svh(705) @ 10: reporter [UVM/REPORT/CATCHER]
--- UVM Report catcher Summary ---
Number of demoted UVM_FATAL reports : 0
Number of demoted UVM_ERROR reports : 1
Number of demoted UVM_WARNING reports: 0
Number of caught UVM_FATAL reports : 0
Number of caught UVM_ERROR reports : 0
Number of caught UVM_WARNING reports : 0
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 10: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 5
UVM_WARNING : 1
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_ADDR] 1
[TAV_CATCH] 1
[TEST_DONE] 1
[UVM/RELNOTES] 1
[UVM/REPORT/CATCHER] 1
- The error printed as a warning: the
`uvm_errorline came out asUVM_WARNING ... [TAV_ADDR]. - The counts agree:
UVM_ERROR : 0andUVM_WARNING : 1. - UVM keeps a record: the catcher summary says
Number of demoted UVM_ERROR reports : 1, so a demotion is never fully silent.
What you will learn
- How
catch(),THROWandCAUGHTwork. - How to demote one error by ID and severity, and tag its text.
- How to drop a noisy message, and how to limit a catcher to one component.
- What the UVM catcher summary tells you, and the one mistake that makes an error vanish.
Cheat sheet: the catcher methods
| Method | What it does |
|---|---|
catch() | Runs for every message. You override it. |
get_severity(), get_id(), get_message() | Read the message |
set_severity() | Change the severity. This is how demotion works. |
set_message() | Rewrite the text |
return THROW | Pass the message on to the next catcher and the log |
return CAUGHT | Stop it here. It is not printed or counted. |
uvm_report_cb::add(obj, c) | Register. null means every component. |
uvm_report_cb::delete(obj, c) | Unregister |
Analogy: think of a mail sorting room. Every letter passes a sorter before delivery, who can restamp it, add a note, or drop it in the bin. A report catcher is that sorter, and the report server is the delivery.
Going further: one bench, 7 checks
tav_demoterlowersUVM_ERRORwith IDTAV_ADDRto a warning and adds[demoted]to the text.tav_dropreturnsCAUGHTfor everyTAV_NOISYmessage.tav_countercountsTAV_HELLO, registered onenv.agt_bonly.tav_observeris added last, so it records what the other catchers left behind.- Planted bug:
+BUG=1makes the demoter returnCAUGHTinstead ofTHROW.
Run it yourself: both files are on GitHub, with the expected output.
// tav_catch_uvm.sv : uvm_report_catcher in depth, 7 self-checks (UVM 1.2)
// The Art of Verification | theartofverification.com
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 2 Dec 2026.
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
// Paste this whole file into testbench.sv and leave design.sv empty.
//
// What is in here:
// tav_demoter demotes UVM_ERROR with ID TAV_ADDR to UVM_WARNING and tags the text
// tav_drop drops every TAV_NOISY message (returns CAUGHT)
// tav_counter counts TAV_HELLO, registered on env.agt_b only
// tav_observer added last, records what the other catchers left behind
// tav_agent, tav_env, tav_catch_test two agents and the test: 7 self-checks
//
// Run options:
// (none) all 7 checks pass, 0 errors
// +BUG=1 the demoter returns CAUGHT instead of THROW, so the demoted message vanishes (checks 1, 2, 6 fail)
`timescale 1ns/1ns
`include "uvm_macros.svh"
import uvm_pkg::*;
// 1. The error demoter
class tav_demoter extends uvm_report_catcher;
`uvm_object_utils(tav_demoter)
int tav_bug;
int tav_count;
function new(string name = "tav_demoter");
super.new(name);
endfunction
virtual function action_e catch();
if (get_severity() == UVM_ERROR && get_id() == "TAV_ADDR") begin
set_severity(UVM_WARNING); // demote
set_message({"[demoted] ", get_message()}); // tag the text
tav_count++;
if (tav_bug == 1) return CAUGHT; // BUG=1: the message never reaches the log
end
return THROW;
endfunction
endclass
// 2. A catcher that drops a noisy message
class tav_drop extends uvm_report_catcher;
`uvm_object_utils(tav_drop)
int tav_count;
function new(string name = "tav_drop");
super.new(name);
endfunction
virtual function action_e catch();
if (get_id() == "TAV_NOISY") begin
tav_count++;
return CAUGHT; // stop it here
end
return THROW;
endfunction
endclass
// 3. A catcher that only counts, registered on one component
class tav_counter extends uvm_report_catcher;
`uvm_object_utils(tav_counter)
int tav_count;
function new(string name = "tav_counter");
super.new(name);
endfunction
virtual function action_e catch();
if (get_id() == "TAV_HELLO") tav_count++;
return THROW;
endfunction
endclass
// 4. The observer: added last, so it sees each TAV_ADDR message after the demoter
class tav_observer extends uvm_report_catcher;
`uvm_object_utils(tav_observer)
string tav_addr_sev[$];
string tav_addr_msg[$];
function new(string name = "tav_observer");
super.new(name);
endfunction
virtual function action_e catch();
uvm_severity s;
if (get_id() == "TAV_ADDR") begin
s = get_severity();
tav_addr_sev.push_back(s.name());
tav_addr_msg.push_back(get_message());
end
return THROW;
endfunction
endclass
// 5. An agent that says hello twice
class tav_agent extends uvm_component;
`uvm_component_utils(tav_agent)
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
task run_phase(uvm_phase phase);
#10 `uvm_info("TAV_HELLO", "hello 1", UVM_LOW)
#10 `uvm_info("TAV_HELLO", "hello 2", UVM_LOW)
endtask
endclass
class tav_env extends uvm_env;
`uvm_component_utils(tav_env)
tav_agent agt_a, agt_b;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
agt_a = tav_agent::type_id::create("agt_a", this);
agt_b = tav_agent::type_id::create("agt_b", this);
endfunction
endclass
// 6. The test: registers the catchers, makes the messages, runs 7 checks
class tav_catch_test extends uvm_test;
`uvm_component_utils(tav_catch_test)
tav_env env;
tav_demoter dem;
tav_drop drop;
tav_counter cnt;
tav_observer obs;
int tav_noisy_before;
int tav_pass, tav_fail;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
env = tav_env::type_id::create("env", this);
dem = tav_demoter::type_id::create("dem");
drop = tav_drop::type_id::create("drop");
cnt = tav_counter::type_id::create("cnt");
obs = tav_observer::type_id::create("obs");
void'($value$plusargs("BUG=%d", dem.tav_bug));
uvm_report_cb::add(null, dem); // for every component, in this order
uvm_report_cb::add(null, drop);
uvm_report_cb::add(null, obs); // last, so it sees what the others did
endfunction
function void connect_phase(uvm_phase phase);
uvm_report_cb::add(env.agt_b, cnt); // only messages from env.agt_b
endfunction
task run_phase(uvm_phase phase);
uvm_report_server rs = uvm_report_server::get_server();
phase.raise_objection(this);
#30 `uvm_error("TAV_ADDR", "address 0x40 is out of range (known issue, reviewed)")
#10 `uvm_warning("TAV_ADDR", "address 0x3f is close to the limit")
#10 repeat (3) `uvm_info("TAV_NOISY", "polling status", UVM_LOW)
tav_noisy_before = rs.get_id_count("TAV_NOISY");
#10 uvm_report_cb::delete(null, drop);
`uvm_info("TAV_NOISY", "polling status after delete", UVM_LOW)
#10 phase.drop_objection(this);
endtask
function void tav_check(string what, string got, string exp);
if (got == exp) begin
tav_pass++;
`uvm_info("TAV_CATCH", $sformatf("PASS %s: %s", what, got), UVM_LOW)
end
else begin
tav_fail++;
`uvm_error("TAV_CATCH", $sformatf("FAIL %s: got %s, expected %s", what, got, exp))
end
endfunction
function void report_phase(uvm_phase phase);
uvm_report_server rs = uvm_report_server::get_server();
int n_err = rs.get_severity_count(UVM_ERROR); // read before any check can add an error
int n_warn = rs.get_severity_count(UVM_WARNING);
string first_sev, tag, last_s;
first_sev = (obs.tav_addr_sev.size() > 0) ? obs.tav_addr_sev[0] : "none";
tag = "untagged";
if (obs.tav_addr_msg.size() > 0 && obs.tav_addr_msg[0].len() >= 9)
if (obs.tav_addr_msg[0].substr(0, 8) == "[demoted]") tag = "tagged";
last_s = "none";
if (obs.tav_addr_msg.size() > 0) begin
last_s = obs.tav_addr_sev[$];
if (obs.tav_addr_msg[$].len() >= 9 && obs.tav_addr_msg[$].substr(0, 8) == "[demoted]")
last_s = {last_s, " tagged"};
else
last_s = {last_s, " untagged"};
end
tav_check("1 TAV_ADDR reports after the demoter: count / first severity",
$sformatf("%0d / %s", obs.tav_addr_sev.size(), first_sev), "2 / UVM_WARNING");
tav_check("2 demoted text", tag, "tagged");
tav_check("3 TAV_ADDR warning left alone", last_s, "UVM_WARNING untagged");
tav_check("4 TAV_NOISY: caught by tav_drop / reached the log",
$sformatf("%0d / %0d", drop.tav_count, tav_noisy_before), "3 / 0");
tav_check("5 TAV_HELLO: seen by agt_b-only counter / reached the log",
$sformatf("%0d / %0d", cnt.tav_count, rs.get_id_count("TAV_HELLO")), "2 / 4");
tav_check("6 UVM_ERROR / UVM_WARNING count", $sformatf("%0d / %0d", n_err, n_warn), "0 / 2");
tav_check("7 after delete: tav_drop count / TAV_NOISY in log",
$sformatf("%0d / %0d", drop.tav_count, rs.get_id_count("TAV_NOISY")), "3 / 1");
`uvm_info("TAV_CATCH", $sformatf("Checks: %0d pass, %0d fail", tav_pass, tav_fail), UVM_LOW)
endfunction
endclass
module tav_top;
initial run_test("tav_catch_test");
endmodule
How to run it
- Open EDA Playground and pick Synopsys VCS with UVM 1.2.
- Paste the file into
testbench.sv, leavedesign.svempty, and set the top module totav_top. - Run it once as is, then add
+BUG=1to the run options and run again.
What VCS returned
| # | Check | Result |
|---|---|---|
| 1 | TAV_ADDR reports after the demoter: count / first severity | 2 / UVM_WARNING |
| 2 | Demoted text starts with [demoted] | tagged |
| 3 | A TAV_ADDR warning is left alone | UVM_WARNING untagged |
| 4 | TAV_NOISY: caught by tav_drop / reached the log | 3 / 0 |
| 5 | TAV_HELLO: seen by the agt_b-only counter / reached the log | 2 / 4 |
| 6 | UVM_ERROR / UVM_WARNING count | 0 / 2 |
| 7 | After delete: tav_drop count / TAV_NOISY in the log | 3 / 1 |
Result: 7 pass, 0 fail. Here is the log.
UVM_INFO @ 0: reporter [RNTST] Running test tav_catch_test...
UVM_INFO testbench.sv(101) @ 10: uvm_test_top.env.agt_a [TAV_HELLO] hello 1
UVM_INFO testbench.sv(101) @ 10: uvm_test_top.env.agt_b [TAV_HELLO] hello 1
UVM_INFO testbench.sv(102) @ 20: uvm_test_top.env.agt_a [TAV_HELLO] hello 2
UVM_INFO testbench.sv(102) @ 20: uvm_test_top.env.agt_b [TAV_HELLO] hello 2
UVM_WARNING testbench.sv(153) @ 30: uvm_test_top [TAV_ADDR] [demoted] address 0x40 is out of range (known issue, reviewed)
UVM_WARNING testbench.sv(154) @ 40: uvm_test_top [TAV_ADDR] address 0x3f is close to the limit
UVM_INFO testbench.sv(158) @ 60: uvm_test_top [TAV_NOISY] polling status after delete
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 70: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 1 TAV_ADDR reports after the demoter: count / first severity: 2 / UVM_WARNING
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 2 demoted text: tagged
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 3 TAV_ADDR warning left alone: UVM_WARNING untagged
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 4 TAV_NOISY: caught by tav_drop / reached the log: 3 / 0
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 5 TAV_HELLO: seen by agt_b-only counter / reached the log: 2 / 4
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 6 UVM_ERROR / UVM_WARNING count: 0 / 2
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 7 after delete: tav_drop count / TAV_NOISY in log: 3 / 1
UVM_INFO testbench.sv(202) @ 70: uvm_test_top [TAV_CATCH] Checks: 7 pass, 0 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_catcher.svh(705) @ 70: reporter [UVM/REPORT/CATCHER]
--- UVM Report catcher Summary ---
Number of demoted UVM_FATAL reports : 0
Number of demoted UVM_ERROR reports : 1
Number of demoted UVM_WARNING reports: 0
Number of caught UVM_FATAL reports : 0
Number of caught UVM_ERROR reports : 0
Number of caught UVM_WARNING reports : 0
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 70: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 17
UVM_WARNING : 2
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_ADDR] 2
[TAV_CATCH] 8
[TAV_HELLO] 4
[TAV_NOISY] 1
[TEST_DONE] 1
[UVM/RELNOTES] 1
[UVM/REPORT/CATCHER] 1
- Check 3: the warning with the same ID was not touched, because the demoter also matches on severity.
- Checks 4 and 7: none of the three
TAV_NOISYlines printed until the catcher was deleted, then the fourth one did. - Check 5: all four hello lines reached the log, but the counter on
env.agt_bonly sawagt_b‘s two.
Look at the catcher summary too. The three caught TAV_NOISY messages do not appear there, because it only lists fatal, error and warning reports.
The planted bug: CAUGHT instead of THROW
With +BUG=1, the demoter still lowers the severity but then returns CAUGHT. That one word stops the message before it reaches the log.
UVM_INFO @ 0: reporter [RNTST] Running test tav_catch_test...
UVM_INFO testbench.sv(101) @ 10: uvm_test_top.env.agt_a [TAV_HELLO] hello 1
UVM_INFO testbench.sv(101) @ 10: uvm_test_top.env.agt_b [TAV_HELLO] hello 1
UVM_INFO testbench.sv(102) @ 20: uvm_test_top.env.agt_a [TAV_HELLO] hello 2
UVM_INFO testbench.sv(102) @ 20: uvm_test_top.env.agt_b [TAV_HELLO] hello 2
UVM_WARNING testbench.sv(154) @ 40: uvm_test_top [TAV_ADDR] address 0x3f is close to the limit
UVM_INFO testbench.sv(158) @ 60: uvm_test_top [TAV_NOISY] polling status after delete
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 70: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_ERROR testbench.sv(169) @ 70: uvm_test_top [TAV_CATCH] FAIL 1 TAV_ADDR reports after the demoter: count / first severity: got 1 / UVM_WARNING, expected 2 / UVM_WARNING
UVM_ERROR testbench.sv(169) @ 70: uvm_test_top [TAV_CATCH] FAIL 2 demoted text: got untagged, expected tagged
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 3 TAV_ADDR warning left alone: UVM_WARNING untagged
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 4 TAV_NOISY: caught by tav_drop / reached the log: 3 / 0
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 5 TAV_HELLO: seen by agt_b-only counter / reached the log: 2 / 4
UVM_ERROR testbench.sv(169) @ 70: uvm_test_top [TAV_CATCH] FAIL 6 UVM_ERROR / UVM_WARNING count: got 0 / 1, expected 0 / 2
UVM_INFO testbench.sv(165) @ 70: uvm_test_top [TAV_CATCH] PASS 7 after delete: tav_drop count / TAV_NOISY in log: 3 / 1
UVM_INFO testbench.sv(202) @ 70: uvm_test_top [TAV_CATCH] Checks: 4 pass, 3 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_catcher.svh(705) @ 70: reporter [UVM/REPORT/CATCHER]
--- UVM Report catcher Summary ---
Number of demoted UVM_FATAL reports : 0
Number of demoted UVM_ERROR reports : 1
Number of demoted UVM_WARNING reports: 0
Number of caught UVM_FATAL reports : 0
Number of caught UVM_ERROR reports : 1
Number of caught UVM_WARNING reports : 0
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 70: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 14
UVM_WARNING : 1
UVM_ERROR : 3
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_ADDR] 1
[TAV_CATCH] 8
[TAV_HELLO] 4
[TAV_NOISY] 1
[TEST_DONE] 1
[UVM/RELNOTES] 1
[UVM/REPORT/CATCHER] 1
The [demoted] line at 30 ns is gone. Checks 1, 2 and 6 failed: only one TAV_ADDR report was left, it was untagged, and the warning count dropped to 1.
The only trace is in the catcher summary: Number of caught UVM_ERROR reports : 1. In a real regression, that line is the one to look for when an expected message is missing.
The lesson: a demoter should almost always return THROW. CAUGHT turns “lower this error” into “delete this error”, and the test passes with nothing in the log to explain why.
Demote versus other ways to handle a known error
| Approach | When to use | Downside |
|---|---|---|
| Report catcher demoter | A known error you have reviewed, from code you cannot change | Hides a real error if the match is too broad |
set_report_severity_id_override | A simple severity change on one component | No logic and no text edit |
| Fix the source | Always best when you own the code | Not possible for third-party VIP |
| Raise the error count limit | Never recommended | Masks every error, not just the known one |
Common mistakes to avoid
| Mistake | What you see | Fix |
|---|---|---|
Returning CAUGHT from a demoter | The error disappears from the log (+BUG=1) | Return THROW |
| Matching on ID only | Warnings and infos with that ID get changed too | Also check get_severity() |
| Matching on message text | The demoter stops working when the text changes | Match on the ID |
Registering with null when one agent is the source | The same ID is hidden everywhere | Pass that component’s handle |
| Demoting without a note | Nobody knows why the error is a warning | Tag the text with set_message() |
How AI helps you master this
- Review a catcher: paste your
catch()and ask which messages it could change besides the one you meant. - Read a summary: paste the UVM catcher summary and report counts and ask whether anything was hidden.
- Plan scope: describe where a known error comes from and ask whether to register on
nullor one component.
Warning: a convincing AI answer is not the same as a correct engineering result. The CAUGHT bug above looks harmless in code review, so run it.
Interview questions on uvm_report_catcher
- What is a uvm_report_catcher? A callback that sees every report message before the report server prints or counts it.
- How do you demote an error? In
catch(), match the ID and severity, callset_severity(UVM_WARNING), and returnTHROW. - THROW vs CAUGHT?
THROWpasses the message on;CAUGHTstops it, so it is not printed or counted. - How do you limit a catcher to one component? Pass that component’s handle to
uvm_report_cb::addinstead ofnull. - Where can you see what catchers did? In the UVM catcher summary at the end of the run.
More practice: UVM interview questions.
Practice challenge
- Run the simple example and find the demoted line and the catcher summary.
- Run the full bench with
+BUG=1and find the one summary line that shows the hidden error. - Remove the severity check from
tav_demoter. Which check fails, and why? - Bonus: write a promoter that turns a
TAV_MUSTwarning into an error. What does the catcher summary say?
FAQ
What is uvm_report_catcher used for? Changing, dropping or counting report messages before the report server acts on them. Demoting a known error to a warning is the most common use.
How do I demote a UVM_ERROR to a warning? Extend uvm_report_catcher, override catch(), call set_severity(UVM_WARNING) when the ID and severity match, and return THROW.
How do I register a report catcher? Create it and call uvm_report_cb::add(null, catcher) in the test. Pass a component handle instead of null to limit its scope.
What is the difference between THROW and CAUGHT? THROW passes the message on, so it still prints. CAUGHT stops it, so it never reaches the log or the counts.
Does a demoted error still count as an error? No. In this bench the report server counted it as a warning (UVM_ERROR : 0), and the catcher summary recorded one demotion.
Should I match on ID or on message text? On the ID. It is stable, while the text can change.
References
- IEEE 1800.2-2020, Universal Verification Methodology (UVM) standard: report catcher and report server.
- Accellera UVM 1.2 Class Reference:
uvm_report_catcher,uvm_callbacksanduvm_report_server.
Keep learning
- Reporting basics: UVM macros, messaging and reporting.
- Callbacks in general: how a UVM callback works and callbacks vs the factory.
- Where catchers fit: UVM testbench architecture and UVM vs SystemVerilog.
- Interview prep: UVM interview questions.
Part of the learning path UVM methodology
