How to exit from simulation on getting UVM_ERROR

I am trying to stop simulation on getting UVM_ERROR,

i used +uvm_set_action=uvm_test_top.*,ALL,UVM_ERROR,UVM_EXIT, but it is not displaying the error .It is given that use “|” to add other actions and then i given as

+uvm_set_action=uvm_test_top.*,ALL,UVM_ERROR,UVM_DISPLAY | UVM_EXIT. but it is considering “|” as pipe operator and giving as UVM_EXIT not a proper command.

Plesae suggest me hoe to resolve the issue.

Depending on which shell you are using, you will have to escape the pipe operator.

with backslash
+uvm_set_action=uvm_test_top.,ALL,UVM_ERROR,UVM_DISPLAY|UVM_EXIT
with single quotes
'+uvm_set_action=uvm_test_top.
,ALL,UVM_ERROR,UVM_DISPLAY|UVM_EXIT’

You will probably have to remove the spaces within the command if the command line processor cannot deal with them.

You can also set the max quit count to 1, which has the makes the first error quit the simulation. +UVM_MAX_QUIT_COUNT=1

In reply to dave_59:

Thank you dave , UVM_MAX_QUIT_COUNT is working fine for my requirement.

but the suggestions you have given for escaping the “|” operator didn’t work.

i am using c shell, Please suggest me how to escape the pipe operator .

Thanks .

In reply to dave_59:

There might be additional levels of nested scripts that would require additional levels of escaping. You should contact your tool vendor directly with the exact command line you are using.

In reply to subhash@ineda:

What if I only want to stop the simulator instead of exit?

Thanks

In reply to Enzo Chi:

Change the action from UVM_EXIT to UVM_STOP

Hi, Dave, Subhash.

That solution is valid only for uvm_errors that are called from inside a component.
But if you have an uvm_error inside an uvm_object it will not work anymore!

A “universal solution” would be:
+uvm_set_action=“*,ALL,UVM_ERROR,UVM_STOP”

Best regards,
Aurelian

In reply to Aurelian_from_AMIQ:

Hi Aurelian,

+uvm_set_action does exit simulation if UVM_EXIT is used but UVM_ERROR does not get print in logfile. Is there any way to get UVM_ERROR in logfile before simulation is exited?
I have used `uvm_error in a module and not any uvm component.

In reply to tomrohit:

Hi, tomrohit.

You just need to state explicitly to display the error. UVM_DISPLAY does that.

+uvm_set_action=“*,ALL,UVM_ERROR,UVM_DISPLAY|UVM_EXIT”

Best regards,
Aurelian

we can also use the following function to quit the simulation whenever the error count reaches the limit
set_report_max_quit_count(int max_count)

In the above function, if you set the max_count as ‘1’, simulation will exit immediately after getting a single UVM_ERROR.

Thanks
Mahesh

If you use Questa, then i find that it is a more practical way to insert a breakpoint in the UVM base library for UVM_ERROR.

You can do this by writing the following command in the console of your Questasim GUI. (uvm1.1d)
bp $::env(UVM_HOME)/src/base/uvm_report_catcher.svh 584

If you look in the uvm_report_catcher file (on line 584), then you will see that there is a case block depending on UVM_ERROR. Of course, you can use another line if you are not interested to stop on UVM_ERRORs.

Having breakpoints is useful, if you are not interested on filter and on severity, which is so most of the time. The best advantage of using the breakpoint is that you don’t have to restart your simulation to be able to stop on a UVM_ERROR.

In addition to the previous discussions, there is also an interesting UVM_MACRO that can be used.

It is the: +UVM_MAX_QUIT_COUNT
+UVM_MAX_QUIT_COUNT=“count”,“overridable”.
This allows users to change max quit count for the report server.

If you use +UVM_MAX_QUIT_COUNT macro in your simulation call, then the vendor tool should break the simulation.
This is useful for regressions in batch mode.
I hope it helps.

Hi Dave,

Using UVM_MAX_QUIT_COUNT=1 will end the simulation as soon as it sees a single UVM_ERROR.
Any inbuilt way to exit simulation after some # delay after encountering first uvm_error?

(I know adding a hack using uvm_report_catcher will solve this. But any inbuilt API to do so directly?)

Thanks,
Prasad

In reply to psubudhi:

Nothing I can think of. Report catcher is your best option.