LehKui Posted September 12, 2013 Report Share Posted September 12, 2013 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; run_test(); $finish(2); 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. Thanks Quote Link to comment Share on other sites More sharing options...
uwes Posted September 12, 2013 Report Share Posted September 12, 2013 hi, there is no nice path or setting to accomplish this with the current uvm library. what you could do is to override the system function $finish via pli and supply an own version of $finish. /uwe Quote Link to comment Share on other sites More sharing options...
LehKui Posted September 13, 2013 Author Report Share Posted September 13, 2013 Will the pending release of UVM 1.2 include a fix of some sort to this? Quote Link to comment Share on other sites More sharing options...
uwes Posted September 13, 2013 Report Share Posted September 13, 2013 no, nothing is planned in this area. the core question is why does the simulator emit different info when you terminate with different exit codes... this doesnt sound like a good practice /uwe Quote Link to comment Share on other sites More sharing options...
LehKui Posted September 14, 2013 Author Report Share Posted September 14, 2013 The answer is in the Verilog LRM. Quote Link to comment Share on other sites More sharing options...
adielkhan Posted October 8, 2013 Report Share Posted October 8, 2013 hi, 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) . Quote Link to comment Share on other sites More sharing options...
dave_59 Posted October 8, 2013 Report Share Posted October 8, 2013 You can put commands into your scripts that would provide more information than what $finish(2) provides. Questa provides a Tcl command simstats, and you can also use OS commands like time to get similar info. Quote Link to comment Share on other sites More sharing options...
LehKui Posted October 15, 2013 Author Report Share Posted October 15, 2013 hi, 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 Quote Link to comment Share on other sites More sharing options...
ljepson74 Posted October 18, 2013 Report Share Posted October 18, 2013 I suppose that Adiel means here: http://www.eda.org/svdb, but you probably don't have permissions to create a mantis item there. It appears that he might be able to file it on your behalf. Quote Link to comment Share on other sites More sharing options...
adielkhan Posted December 4, 2013 Report Share Posted December 4, 2013 Done. http://www.eda.org/svdb/view.php?id=4809 Quote Link to comment Share on other sites More sharing options...
LehKui Posted March 26, 2014 Author Report Share Posted March 26, 2014 Fabulous, thanks Adiel. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted March 26, 2014 Report Share Posted March 26, 2014 There are existing solutions to this Use a final block. This assumes there is only one final block in the design. initial begin run_test(); end 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.