changeset d3bae341e151 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d3bae341e151
description:
        ruby: remove random seed

        We no longer use the C library based random number generator: random().
        Instead we use the C++ library provided rng.  So setting the random 
seed for
        the RubySystem class has no effect.  Hence the variable and the 
corresponding
        option are being dropped.

diffstat:

 configs/ruby/Ruby.py              |  4 ----
 src/mem/ruby/system/RubySystem.py |  1 -
 src/mem/ruby/system/System.cc     |  3 ---
 src/mem/ruby/system/System.hh     |  2 --
 4 files changed, 0 insertions(+), 10 deletions(-)

diffs (71 lines):

diff -r ec668f8466eb -r d3bae341e151 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py      Fri Aug 14 19:28:44 2015 -0500
+++ b/configs/ruby/Ruby.py      Fri Aug 14 19:28:44 2015 -0500
@@ -82,9 +82,6 @@
     parser.add_option("--recycle-latency", type="int", default=10,
                       help="Recycle latency for ruby controller input buffers")
 
-    parser.add_option("--random_seed", type="int", default=1234,
-                      help="Used for seeding the random number generator")
-
     protocol = buildEnv['PROTOCOL']
     exec "import %s" % protocol
     eval("%s.define_options(parser)" % protocol)
@@ -236,7 +233,6 @@
 
     ruby._cpu_ports = cpu_sequencers
     ruby.num_of_sequencers = len(cpu_sequencers)
-    ruby.random_seed    = options.random_seed
 
     # Create a backing copy of physical memory in case required
     if options.access_backing_store:
diff -r ec668f8466eb -r d3bae341e151 src/mem/ruby/system/RubySystem.py
--- a/src/mem/ruby/system/RubySystem.py Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/system/RubySystem.py Fri Aug 14 19:28:44 2015 -0500
@@ -34,7 +34,6 @@
 class RubySystem(ClockedObject):
     type = 'RubySystem'
     cxx_header = "mem/ruby/system/System.hh"
-    random_seed = Param.Int(1234, "random seed used by the simulation");
     randomization = Param.Bool(False,
         "insert random delays on message enqueue times");
     block_size_bytes = Param.UInt32(64,
diff -r ec668f8466eb -r d3bae341e151 src/mem/ruby/system/System.cc
--- a/src/mem/ruby/system/System.cc     Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/system/System.cc     Fri Aug 14 19:28:44 2015 -0500
@@ -45,7 +45,6 @@
 
 using namespace std;
 
-int RubySystem::m_random_seed;
 bool RubySystem::m_randomization;
 uint32_t RubySystem::m_block_size_bytes;
 uint32_t RubySystem::m_block_size_bits;
@@ -60,8 +59,6 @@
     : ClockedObject(p), m_access_backing_store(p->access_backing_store),
       m_cache_recorder(NULL)
 {
-    m_random_seed = p->random_seed;
-    srandom(m_random_seed);
     m_randomization = p->randomization;
 
     m_block_size_bytes = p->block_size_bytes;
diff -r ec668f8466eb -r d3bae341e151 src/mem/ruby/system/System.hh
--- a/src/mem/ruby/system/System.hh     Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/system/System.hh     Fri Aug 14 19:28:44 2015 -0500
@@ -70,7 +70,6 @@
     ~RubySystem();
 
     // config accessors
-    static int getRandomSeed() { return m_random_seed; }
     static int getRandomization() { return m_randomization; }
     static uint32_t getBlockSizeBytes() { return m_block_size_bytes; }
     static uint32_t getBlockSizeBits() { return m_block_size_bits; }
@@ -129,7 +128,6 @@
 
   private:
     // configuration parameters
-    static int m_random_seed;
     static bool m_randomization;
     static uint32_t m_block_size_bytes;
     static uint32_t m_block_size_bits;
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to