Hello,
Could you please let me know what simulators should do when we use
assert(std::randomize(variable))
and assertions are turned off
I am using it but bit confused what should simulators do ?
will it still randomize variable
or keep previous value
or it is going to be 0 (variable is int)
The LRM just says that $assertoffshall stop the checking of all specified assertions. The LRM does not specifically mention if the evaluation of expression is inseparable from its checking. Apparently, most simulators ignore the entire assertion statement when the assertion is turned off. This has the unfortunate consequence of not calling the randomize method.
We recommend using a simple if ( randomize() ) statement to avoid this issue as well as having an assert statement in your testbench interferes with the reporting of functional coverage of your design.