Hi Victor,
No, it won't because the random number generator that you seed with seedRandom
is independent from the one you seed inside your program. seedRandom seeds
random_mt declared in base/random.hh which is not accessible from inside your
program as of the latest version of gem5. You can
Hi Gabriel,
I've followed the instructions you have provided but I'm still getting the
same numbers on every gem5 run. The changes I made to se.py are the
following.
+
from _m5.core import seedRandom
seedRandom(int())
I'm producing random numbers in my program by seeding srand with time srand
Hi Gabriel,
Thanks for your help. This way is much simpler than trying to get a true
random generator in the C++ workload.
Best,
Duc Anh
On Tue, 20 Jul 2021 at 15:40, Gabriel Busnot via gem5-users <
gem5-users@gem5.org> wrote:
> Indeed, gem5 is designed to be deterministic so all random number
Indeed, gem5 is designed to be deterministic so all random number generation
should rely on a deterministically seeded random number generator. This random
number generator normally is 'random_mt' located in src/base/random.cc. However
not all random number generated in gem5 relies on this
Hi Gabriel,
It was indeed the output is stuck in the stdout buffer because the program
ran too long. When I increase the >> 25 to >> 45 I can see it works fine.
It was quite fast on the host, I just don't think it would be that slow on
the simulator.
I generate random numbers by
Hi Duc,
Having the print not displayed on screen does not necessarily mean that it has
not been executed. It could just have been stuck in stdout buffer which was not
flush because of an abnormal program termination.
If you initialize you data with truly random and unbounded data, "number =