Hello ahan,
I’m not sure what your objective is for setting the seed inside the SV code and also setting from the command line?
In IUS (and I’m sure Questa as well…) you have the option to set the seed from the command line:
-svseed int_number
OR
-svseed random
If you don’t set a seed, it will default to 1
In all cases, the seed is printed into the log file so you can re-run a simulation and specify the seed you want.
The OVM library has built-in random seed stability. All objects derived from ovm_object have this implemented. Please take a look at the OVM Reference (page 12) to see more information about using the OVM built-in seeding. You have the option to do something else as well but I suggest you use the capability that was built into the library.
Kathleen