Reply To: Usage of random functions (e.g RandSlv)
Why OSVVM™? › Forums › OSVVM › Usage of random functions (e.g RandSlv) › Reply To: Usage of random functions (e.g RandSlv)
If you create a randomization object (your RandomData variable) in a procedure or function, it will only be “live” when the procedure is called. Hence, in your procedure/function, there are only two different values of the seed, the default value (set by the package) and the value generated when InitSeed is called.
My recommendation is to pass the randomization object to the procedure:
variable RV : InOut RandomPType ;
. . .
Then in the process, you would need to declare an object of RandomPType.
There are examples in the RandomPkg User Guide that you can put loops around and try out.