base: Use the global Mersenne twister throughout
authorAndreas Hansson <andreas.hansson@arm.com>
Wed, 3 Sep 2014 11:42:54 +0000 (07:42 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Wed, 3 Sep 2014 11:42:54 +0000 (07:42 -0400)
commit2698e739660516af442c0f913eb0e91a00e7b7db
tree331dfa865e3b36d5187353fe3db57f93c73eb0e0
parent1ff4c45bbbaa22d5bd91e9bdd34d4435290ab8be
base: Use the global Mersenne twister throughout

This patch tidies up random number generation to ensure that it is
done consistently throughout the code base. In essence this involves a
clean-up of Ruby, and some code simplifications in the traffic
generator.

As part of this patch a bunch of skewed distributions (off-by-one etc)
have been fixed.

Note that a single global random number generator is used, and that
the object instantiation order will impact the behaviour (the sequence
of numbers will be unaffected, but if module A calles random before
module B then they would obviously see a different outcome). The
dependency on the instantiation order is true in any case due to the
execution-model of gem5, so we leave it as is. Also note that the
global ranom generator is not thread safe at this point.

Regressions using the memtest, TrafficGen or any Ruby tester are
affected and will be updated accordingly.
15 files changed:
src/cpu/testers/directedtest/SeriesRequestGenerator.cc
src/cpu/testers/memtest/memtest.cc
src/cpu/testers/networktest/networktest.cc
src/cpu/testers/rubytest/Check.cc
src/cpu/testers/rubytest/CheckTable.cc
src/cpu/testers/traffic_gen/generators.cc
src/cpu/testers/traffic_gen/traffic_gen.cc
src/mem/ruby/common/NetDest.cc
src/mem/ruby/common/NetDest.hh
src/mem/ruby/common/Set.cc
src/mem/ruby/common/Set.hh
src/mem/ruby/network/MessageBuffer.cc
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/slicc_interface/RubySlicc_Util.hh
src/mem/ruby/structures/RubyMemoryControl.cc