Hi,
Is there a way to add a predetermined simulation time delay after UVM_MAX_QUIT_COUNT has reached its value?
Thanks
In reply to shaygueta:
How about
UVM_MAX_QUIT_COUNT = [your desired quit count] + 1?
Sort of work-around…
Srini
In reply to shaygueta:
The only way I can think of is to turn off MAX_QUIT_COUNT by setting it to 0, and then writing a report catcher that reads the error count and sets up a timeout with the pre-determined exit delay.
In reply to dave_59:
I do not believe the Simulator is immediatly stopping when MAX_QUIT_COUNT has been reached. I think then it goes through all the steps to stop the Simulation in a regular way. I’s try to set a specific drain_time.
In reply to dave_59:
Hi,
Thanks. Can you add an example code for such a report catcher?
The errors can originate from various components in the environmdnt.
In reply to shaygueta:
Untested:
class my_report_catcher extends uvm_report_catcher;
int unsigned max_error = 1; // limit
time fatal_timeout = 20ns; // amount to delay before exiting
function new (string name = ""); super.new(name); endfunction
function action_e catch;
if (get_severity() == UVM_ERROR && --max_error == 0) // short-circuit && operator
fork
#fatal_timeout get_client().die();
join_none
return THROW;
endfunction
endclass : my_report_catcher
Then in your test
my_report_catcher rc_h;
rc_h = new("rc");
rc_h.max_error = 10;
rc_h.fatal_timeout = 100ms;
uvm_report_cb::add(null, rc_h); // all errors in all contexts
P.S. Christoph - UVM calls die() when reaching MAX_QUIT_COUNT.
In reply to dave_59:
Nice trick Dave. I would like to extend this to add a command line arg (like UVM_MAX_QUIT_COUNT) and make it little easier to deploy (Didn’t think through it yet fully). I hope you won’t mind me copying this code into a Go2UVM app soon (We already have some form of this - to print a summary of error IDs etc. as part go “go2uvm debug layer” - not released yet though). I will make sure to give the credits to this thread and our “Walking LRM” (As you are referred to on social media).
Having said that, I am bit worried that this may hurt some performance as it is a callback on every message. Maybe we can improve that, will delve deeper later.
Thanks
Srini
In reply to Srini @ CVCblr.com:
No, in such a case the simulator does not stop