$random with seed parameter

In reply to abhilash1106:

There’s no need to supply a seed. Any random number generator should generate the same series of random values every time it is run, as long as there is no change to the source code. And the trick is to have the same series of random values when you DO change the source code.

SystemVerilog calls this Random Stability. SystemVerilog defines how random number generators get independently seeded, and what modifications to the source code would either preserve or disturb the seeding.

Verilog’s $random does not have this feature, you have to manually provide seed arguments and keep track of all the seeds yourself. So use $urandom instead $random.