通过uvm_report_server::get_server().get_max_quit_count()来调用即可解决。
function void build_phase(uvm_phase phase);
super.build_phase(phase);
set_report_max_quit_count(10);
`uvm_info("quit",$sformatf("the quit num is %d",uvm_report_server::get_server().get_max_quit_count()),UVM_LOW)
endfunction
原因:set_report_max_quit_count函数是uvm_component的函数,而get_max_quit_count()其实是uvm_report_server类的函数。所以会出现前者可用后者不可用的情况set_report_max_quit_count源代码如下。