问题:
在一些异常case或者特殊的case, 遇到VIP报uvm_error或者uvm_warning,导致刷屏或者uvm_error数量达到上限仿真强制退出了。这时,可以用uvm_report_catcher捕获到它特定的message,并将其级别设置成UVM_INFO。
措施:
uvm_report_cacher provides the catch() function for users to extend.
Return action_e type enum - - - caught, throw, unknow_action;
THROW, report will continue to be processed by server;
CAUGHT, report will not continue to be processed by server;
class tc_01_catcher extends uvm_report_catcher;
virtual function action_e catch();
if (get_severity() == UVM_ERROR) begin
string _msg = get_message();
// uvm_re_match是匹配上了返回0
if (0 == uvm_re_match("UVM_ERROR.*xxxyyyy", _msg) ) begin
set_severity(UVM_INFO);
set_verbosity(UVM_LOW);
end
end
return THROW;
endfunction
endclass
class tc_01 extends base_test;
......
virtual build_phase();
tc_01_catcher = new();
uvm_report_cb::add(null, tc_01_catcher);
endfunction
endclass