[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-11-30 Thread Gabriel Busnot via gem5-users
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

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-11-22 Thread Victor Kariofillis via gem5-users
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

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Đức Anh via gem5-users
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

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Gabriel Busnot via gem5-users
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

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Đức Anh via gem5-users
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

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Gabriel Busnot via gem5-users
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 =