[UVM]UVM_ERROR數量統計 --- 在env中Override report_phase

                                     UVM_ERROR數量統計

一、如何在仿真結束后,報告ERROR的數量呢?

1.1、可以在env中Override report_phase來實現

function void my_env::report_phase(uvm_phase phase);
  bit                             check_error;

  uvm_report_serve                svr;

  $display("\n\n");

  svr = _global_report.get_report_server();

  if(svr.get_severity_count(UVM_FATAL) + svr.get_severity_count(UVM_ERROR) != 0) begin
    check_error = 1;
    `uvm_info(get_type_name(), "SIMULATION FAIL", UVM_NONE)
  end

  if(check_error == 0) begin
    `ivm_info(get_type_name, "   Simulation PASSED!  ", UVM_NONE)

  end else begin
    `ivm_info(get_type_name, "   Simulation FAILED!  ", UVM_NONE)    
  end

  $display("\n\n");

endfunction : report_phase

1.2、當UVM_ERROR數量達到threshold時沒結仿真

  • 如下面的例子,當UVM_ERROR數量達到1000時,結束仿真
virtual function void build_phase(uvm_phase phase);

  set_report_max_quit_count(1000);

endfuction : build_phase
发布了213 篇原创文章 · 获赞 151 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/gsjthxy/article/details/105519260