class uvm_err_catcher extends uvm_report_catcher;
sring demote_error_str[$];
function new(string name="uvm_err_catcher");
super.new(name);
endfunction
virtual function action_e catch();
if(get_severity() == UVM_ERROR)begin
string full_msg = $sformatf("%0s %0s %0s", get_context(),get_id(),get_message());
foreach(demote_error_str[idx])begin
if(uvm_is_match(demote_error_str[idx], full_msg)) set_severity(UVM_INFO);
end
end
endfunction
endclass
usage:
in task:
uvm_err_catcher err_catcher;
begin
err_catcher = new();
uvm_report_cb::add(null, err_catcher);
err_catcher.demote_error_str.push_back("*check*");
end
disable it:
uvm_report_cb::delete(null,err_catcher);
标签:catcher,err,get,uvm,error,demote From: https://www.cnblogs.com/lybinger/p/18010024