5

Is there an easy way to piggy back a custom function to UVM_ERROR macro without manipulating the UVM library ?(i.e whenever a UVM error is invoked anywhere in the environment I want my function to be called along with it.)

Jean
  • 21,665
  • 24
  • 69
  • 119

2 Answers2

6

Haven't yet tried this myself, but the uvm_report_catcher looks like it does what you want.

It's a callback that you can implement whenever a uvm report (like a UVM_ERROR) is about to be issued, and your function gets called before it gets reported.

Example is available here, section 4.9.3: http://low-powerdesign.com/article_Cadence-UVM_101810.html

Tim
  • 35,413
  • 11
  • 95
  • 121
0

Based on what you want , uvm_report_catcher class is the best option.

Here is the example you can use,

 class my_error_demoter extends uvm_report_catcher;
   function new(string name="my_error_demoter");
     super.new(name);
   endfunction

  function action_e catch();
    if(get_severity() == UVM_ERROR) begin
       ... your task () ; ...        
    end
    return THROW;
  endfunction
endclass

Hope this will solve your problem...