There is a segment of code below:
$display("current random value: %0d", $random);
I use Cadence irun to compile and simulate this code. Although I add option " -seed random" to irun, but each time the result is same. It seems that $random is not controlled by -seed.
If I change $random to $urandom, it works! Each time I run, the result is not different.
So, my question is that, why $random is not controlled by -seed ???
The $random call matches the behavior from the older Verilog standard. You adjust its seed by passing in a signed integer value in the HDL.The behavior of that function (including its default seed) is strongly defined and hasn't changed for 20+ years.
The $urandom call was added for the new SystemVerilog language. It was explicitly defined by the language to allow its initial seed to be implementation dependent, which frees the various simulators to allow it to be set from the command line.