We have a need for xrun to exit during the simulation step of our system verilog design when an error occurs. The error we want to exit on is generally from an assertion (*E,ASRTST) but also could be from a $error in the verilog. The solution seemed to be upgrading the error to a fatal using -xmfatal ASRTST, but this seems to only elevate errors that occur during compile or elaboration, but not in the simulate step. Are there any other methods of getting an error to cause the simulator to exit? the only other solution we've found is to change $error to $fatal, but this doesn't seem like a good long term solution as the code that will generate the error is not maintained by us.
-xmfatal can be used the way you want, but you have to pass it to the simulation run, it sounds like you are passing it to the compile/elab command.
There is also a -errormax switch, also used at simulation time, which causes the simulator to exit after N errors, regardless of the mnemonic code for the error; this owuld be a more generic solution than using -xmfatal.
Thanks for the reply. The command I'm using to run the simulation is 'xrun -xmfatal ASRTST fil1.sv' does this not pass the -xmfatal through to simulation? Do I need to run the simulation as a separate command, I'm assuming xmsim, though I've never used it before.
Strange, you're using it correctly then, but it's not working for the ASRTST errors, I'm not sure why that would be.
You can look in xcelium.d/run.d/xmsim.args, to see what got passed to the simulator phase, and for me at least, I do see -xmfatal in there! :-/
I tried again doing xrun -elaborate then xmsim -xmfatal with no luck. I checked the xmsim.args file and there is a -xmfatal when I run the xrun command, however my error is still not being elevated to fatal.