You must attach the catcher to the component generating the messages (or globally using
uvm_top).
class my_error_test extends my_base_test;
// ...
crc_error_demoter demoter;
task run_phase(uvm_phase phase);
demoter = new("demoter");
// Attach to the whole env hierarchy
uvm_report_cb::add(env, demoter);
// Start the sequence that causes errors
seq.start(env.agent.sqr);
// Remove catcher if needed later
// uvm_report_cb::delete(env, demoter);
endtask
endclass
Why not just use +uvm_set_severity?
CLI args like +uvm_set_severity affect ALL messages with that ID for the entire
simulation. A Catcher allows dynamic control—you can enable it only for the
duration of a specific sequence, then remove it!