Hi, Gabriel I'm not interested in a specific gem5 component. I have a microbenchmark that makes use of the srand and rand functions with srand() being seeded by using time.
struct timeval t1; gettimeofday(&t1, NULL); srand(t1.tv_usec * t1.tv_sec); I assume that gem5 always uses the same time for the simulation and that's why I get the same streak of random numbers. Is this the case and if yes what would be the approach to change it? Thanks, Victor On Thu, 25 Nov 2021 at 12:20, Gabriel Busnot via gem5-users < gem5-users@gem5.org> wrote: > Hi Victor, > > It MAY result in different results depending on which components you are > using in gem5. As stated in my post you cited, the main random number > generator which is seeded by seedRandom (random_mt) is not always used in > gem5, which is an issue. Also, not every component in gem5 support > randomization. If you are using Ruby, you should observe different outputs > with different seeds though. > > If the component you use support randomization but use the wrong number > generator, replace it with random_mt (src/base/random.hh). If you think > that some components could add some randomness but don't, you can add it > yourself. Typically, you can add random delays to packets when ordering is > not a functional requirement. Take a look at MessageBuffer::enqueue for an > example. > > Best, > Gabriel > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s >
_______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s