F
FGreen
Guest
I'm trying to generate random numbers in my test bench in the
following manner.
for (i = 0; i < 10; i=i+1 ) begin
rand = $random($time);
...
end
The good thing is, I get a different 'rand' for each loop count, but
when I run the test the next time, I get the same set of 10 random
numbers. $display of $time shows that it's not the wall clock as in,
but the simulation clock (duh...).
How do I get the wall clock in Windows environment for this?
Or, is there a better way to get random numbers that'll differ from
one test run to next, as well as one loop count to another?
Of course, I'll save/print the seed value so I can reproduce the
problem.
Thank you.
following manner.
for (i = 0; i < 10; i=i+1 ) begin
rand = $random($time);
...
end
The good thing is, I get a different 'rand' for each loop count, but
when I run the test the next time, I get the same set of 10 random
numbers. $display of $time shows that it's not the wall clock as in,
but the simulation clock (duh...).
How do I get the wall clock in Windows environment for this?
Or, is there a better way to get random numbers that'll differ from
one test run to next, as well as one loop count to another?
Of course, I'll save/print the seed value so I can reproduce the
problem.
Thank you.