When running SystemVerilog verifcation simulations (Virtuoso + Xcelium) I have certain conditions for which I want to produce an "$error()" output in the xrun logfile.
Just before the simulation is finished I want to write out how many of those "$errors()" occured.
Currently I am running a manual error counter in my testbench - but this does not help when a SV module in a lower hierarchy creates an "$error()" output.
1. What options do I have to automatically count (or summarize) the number of "$error()" thrown during simulation (from any hierarchy below - not only in testbench) ?
2. Is there another way to throw and count custom-errors during simulation (I am not familiar with this UVM thing) ?
I'm not aware of any built-in method to count arbitrary $error calls.
Xcelium has an option to translate $error into UVM_ERROR macro calls, but that only helps if you're using UVM for the testbench.In principle you can use VPI calls to override the definition of $error, but that's non-trivial and makes your code hard to integrate with anyone else's code if they rely on the built-in $error.