changeset 12390db623b4 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=12390db623b4
description:
        ruby: Memory size consistency check

        Ruby's memory is now sized according to the size of M5 physical memory.

diffstat:

2 files changed, 12 insertions(+), 2 deletions(-)
configs/ruby/MOESI_hammer.py |    9 ++++++++-
configs/ruby/Ruby.py         |    5 ++++-

diffs (47 lines):

diff -r 7b9f3cd45b03 -r 12390db623b4 configs/ruby/MOESI_hammer.py
--- a/configs/ruby/MOESI_hammer.py      Fri Jan 29 20:29:24 2010 -0800
+++ b/configs/ruby/MOESI_hammer.py      Fri Jan 29 20:29:24 2010 -0800
@@ -96,6 +96,9 @@
         cpu_sequencers.append(cpu_seq)
         l1_cntrl_nodes.append(l1_cntrl)
 
+    phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 
1
+    mem_module_size = phys_mem_size / options.num_dirs
+
     for i in xrange(options.num_dirs):
         #
         # Create the Ruby objects associated with the directory controller
@@ -103,9 +106,13 @@
 
         mem_cntrl = RubyMemoryControl(version = i)
 
+        dir_size = MemorySize('0B')
+        dir_size.value = mem_module_size
+
         dir_cntrl = Directory_Controller(version = i,
                                          directory = \
-                                           RubyDirectoryMemory(version = i),
+                                         RubyDirectoryMemory(version = i,
+                                                             size = dir_size),
                                          memBuffer = mem_cntrl)
 
         dir_cntrl_nodes.append(dir_cntrl)
diff -r 7b9f3cd45b03 -r 12390db623b4 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py      Fri Jan 29 20:29:24 2010 -0800
+++ b/configs/ruby/Ruby.py      Fri Jan 29 20:29:24 2010 -0800
@@ -55,11 +55,14 @@
     network = SimpleNetwork(topology = makeCrossbar(all_cntrls))
 
     #
-    # determine the total memory size of the ruby system
+    # determine the total memory size of the ruby system and verify it is equal
+    # to physmem
     #
     total_mem_size = MemorySize('0B')
     for dir_cntrl in dir_cntrls:
         total_mem_size.value += dir_cntrl.directory.size.value
+    physmem_size = long(physmem.range.second) - long(physmem.range.first) + 1
+    assert(total_mem_size.value == physmem_size)
 
     ruby_profiler = RubyProfiler(num_of_sequencers = len(cpu_sequencers))
     
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to