Jump to content

UVM_FATAL invokes $finish(1)


Recommended Posts

To circumvent UVM calling on $finish directly when completing normally, one would override "finish_on_completion" to 0 before calling "run_test()". What I do is:


   uvm_top.finish_on_completion = 0;




The last statement tells the tool to publish useful simulation statistics such as total run time, memory used, etc. This information is very useful in monitoring large batches of simulations for many purposes, among which is farm optimisation and debugging bad code consuming lots of memory.


However, when UVM_FATAL is invoked, effectively a $finish(1) is called - and the above-mentioned information is thrown away. Is there a way to overcome this and get UVM to call $finish(2) or at least allows this to be customised? Probably via a uvm_config_db::set()  and uvm_config_db::get() ? Or perhaps I am not aware of something that already allows this?


A work-around would be avoid using UVM_FATAL and use UVM_ERROR with a following $finish(2) - but this is clumsy and widespread change is required.



Link to comment
Share on other sites

  • 4 weeks later...


You should file a Mantis to have UVM support diagnostics for $finish as described in 1800-LRM.

As a workaround you might be able to code a report_catcher to catch all FATALs and ERRORs then call $finish(arg) .

Forgive my lack of knowledge here, but where exactly should this Mantis be filed? A link, pls? Cheers

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

There are existing solutions to this


Use a final block.

This assumes there is only one final block in the design.

initial begin
final $finish(2); // or DPI call to get the system information you want.

Or, as I mentioned above, there are tool specific ways of writing your scripts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...