changeset 4148f9af0b70 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=4148f9af0b70
description:
        Config: corrects the way Ruby attaches to the DMA ports
        With recent changes to the memory system, a port cannot be assigned a 
peer
        port twice. While making use of the Ruby memory system in FS mode, DMA
        ports were assigned peer twice, once for the classic memory system
        and once for the Ruby memory system. This patch removes this double
        assignment of peer ports.

diffstat:

 configs/common/FSConfig.py          |  13 +++++--------
 configs/example/ruby_fs.py          |   2 +-
 configs/example/ruby_mem_test.py    |   8 ++++++--
 configs/ruby/MESI_CMP_directory.py  |  10 +++-------
 configs/ruby/MI_example.py          |  11 +++--------
 configs/ruby/MOESI_CMP_directory.py |  10 +++-------
 configs/ruby/MOESI_CMP_token.py     |  10 +++-------
 configs/ruby/MOESI_hammer.py        |   9 +++------
 configs/ruby/Network_test.py        |   4 ++--
 configs/ruby/Ruby.py                |   5 ++---
 src/dev/x86/Pc.py                   |   4 ++--
 src/dev/x86/SouthBridge.py          |   5 +++--
 12 files changed, 36 insertions(+), 55 deletions(-)

diffs (truncated from 332 to 300 lines):

diff -r 051bc173ea72 -r 4148f9af0b70 configs/common/FSConfig.py
--- a/configs/common/FSConfig.py        Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/common/FSConfig.py        Thu Apr 05 11:09:19 2012 -0500
@@ -134,16 +134,14 @@
     self.tsunami.attachIO(self.piobus)
     self.tsunami.ide.pio = self.piobus.master
     self.tsunami.ide.config = self.piobus.master
-    self.tsunami.ide.dma = self.piobus.slave
     self.tsunami.ethernet.pio = self.piobus.master
     self.tsunami.ethernet.config = self.piobus.master
-    self.tsunami.ethernet.dma = self.piobus.slave
 
     #
     # Store the dma devices for later connection to dma ruby ports.
     # Append an underscore to dma_devices to avoid the SimObjectVector check.
     #
-    self._dma_devices = [self.tsunami.ide, self.tsunami.ethernet]
+    self._dma_ports = [self.tsunami.ide.dma, self.tsunami.ethernet.dma]
 
     self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
                                                read_only = True))
@@ -408,8 +406,10 @@
     # the piobus a direct connection to physical memory
     #
     x86_sys.piobus.master = x86_sys.physmem.port
-
-    x86_sys.pc.attachIO(x86_sys.piobus)
+    # add the ide to the list of dma devices that later need to attach to
+    # dma controllers
+    x86_sys._dma_ports = [x86_sys.pc.south_bridge.ide.dma]
+    x86_sys.pc.attachIO(x86_sys.piobus, x86_sys._dma_ports)
 
 
 def makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None, Ruby = 
False):
@@ -432,9 +432,6 @@
     # Create and connect the busses required by each memory system
     if Ruby:
         connectX86RubySystem(self)
-        # add the ide to the list of dma devices that later need to attach to
-        # dma controllers
-        self._dma_devices = [self.pc.south_bridge.ide]
     else:
         connectX86ClassicSystem(self, numCPUs)
 
diff -r 051bc173ea72 -r 4148f9af0b70 configs/example/ruby_fs.py
--- a/configs/example/ruby_fs.py        Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/example/ruby_fs.py        Thu Apr 05 11:09:19 2012 -0500
@@ -96,7 +96,7 @@
     system.readfile = options.script
 
 system.cpu = [CPUClass(cpu_id=i) for i in xrange(options.num_cpus)]
-Ruby.create_system(options, system, system.piobus, system._dma_devices)
+Ruby.create_system(options, system, system.piobus, system._dma_ports)
 
 for (i, cpu) in enumerate(system.cpu):
     #
diff -r 051bc173ea72 -r 4148f9af0b70 configs/example/ruby_mem_test.py
--- a/configs/example/ruby_mem_test.py  Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/example/ruby_mem_test.py  Thu Apr 05 11:09:19 2012 -0500
@@ -115,13 +115,17 @@
                      percent_functional = 0,
                      percent_uncacheable = 0,
                      progress_interval = options.progress,
-                     warn_on_failure = options.warn_on_failure) \
+                     suppress_func_warnings =
+                                        not options.suppress_func_warnings) \
              for i in xrange(options.num_dmas) ]
     system.dma_devices = dmas
 else:
     dmas = []
 
-Ruby.create_system(options, system, dma_devices = dmas)
+dma_ports = []
+for (i, dma) in enumerate(dmas):
+    dma_ports.append(dma.test)
+Ruby.create_system(options, system, dma_ports = dma_ports)
 
 #
 # The tester is most effective when randomization is turned on and
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/MESI_CMP_directory.py
--- a/configs/ruby/MESI_CMP_directory.py        Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/MESI_CMP_directory.py        Thu Apr 05 11:09:19 2012 -0500
@@ -47,7 +47,7 @@
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'MESI_CMP_directory':
         panic("This script requires the MESI_CMP_directory protocol to be 
built.")
@@ -162,7 +162,7 @@
 
         cntrl_count += 1
 
-    for i, dma_device in enumerate(dma_devices):
+    for i, dma_port in enumerate(dma_ports):
         #
         # Create the Ruby objects associated with the dma controller
         #
@@ -175,12 +175,8 @@
                                    ruby_system = ruby_system)
 
         exec("system.dma_cntrl%d = dma_cntrl" % i)
-        if dma_device.type == 'MemTest':
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.test" % 
i)
-        else:
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.dma" % i)
+        exec("system.dma_cntrl%d.dma_sequencer.slave = dma_port" % i)
         dma_cntrl_nodes.append(dma_cntrl)
-
         cntrl_count += 1
 
     all_cntrls = l1_cntrl_nodes + \
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/MI_example.py
--- a/configs/ruby/MI_example.py        Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/MI_example.py        Thu Apr 05 11:09:19 2012 -0500
@@ -41,7 +41,7 @@
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'MI_example':
         panic("This script requires the MI_example protocol to be built.")
@@ -135,7 +135,7 @@
 
         cntrl_count += 1
 
-    for i, dma_device in enumerate(dma_devices):
+    for i, dma_port in enumerate(dma_ports):
         #
         # Create the Ruby objects associated with the dma controller
         #
@@ -148,13 +148,8 @@
                                    ruby_system = ruby_system)
 
         exec("system.dma_cntrl%d = dma_cntrl" % i)
-        if dma_device.type == 'MemTest':
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.test" % 
i)
-        else:
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.dma" % i)
-        dma_cntrl.dma_sequencer.slave = dma_device.dma
+        exec("system.dma_cntrl%d.dma_sequencer.slave = dma_port" % i)
         dma_cntrl_nodes.append(dma_cntrl)
-
         cntrl_count += 1
 
     all_cntrls = l1_cntrl_nodes + dir_cntrl_nodes + dma_cntrl_nodes
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/MOESI_CMP_directory.py
--- a/configs/ruby/MOESI_CMP_directory.py       Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/MOESI_CMP_directory.py       Thu Apr 05 11:09:19 2012 -0500
@@ -47,7 +47,7 @@
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
         panic("This script requires the MOESI_CMP_directory protocol to be 
built.")
@@ -159,7 +159,7 @@
 
         cntrl_count += 1
 
-    for i, dma_device in enumerate(dma_devices):
+    for i, dma_port in enumerate(dma_ports):
         #
         # Create the Ruby objects associated with the dma controller
         #
@@ -172,12 +172,8 @@
                                    ruby_system = ruby_system)
 
         exec("system.dma_cntrl%d = dma_cntrl" % i)
-        if dma_device.type == 'MemTest':
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.test" % 
i)
-        else:
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.dma" % i)
+        exec("system.dma_cntrl%d.dma_sequencer.slave = dma_port" % i)
         dma_cntrl_nodes.append(dma_cntrl)
-
         cntrl_count += 1
 
     all_cntrls = l1_cntrl_nodes + \
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/MOESI_CMP_token.py
--- a/configs/ruby/MOESI_CMP_token.py   Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/MOESI_CMP_token.py   Thu Apr 05 11:09:19 2012 -0500
@@ -54,7 +54,7 @@
     parser.add_option("--allow-atomic-migration", action="store_true",
           help="allow migratory sharing for atomic only accessed blocks")
     
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'MOESI_CMP_token':
         panic("This script requires the MOESI_CMP_token protocol to be built.")
@@ -183,7 +183,7 @@
 
         cntrl_count += 1
 
-    for i, dma_device in enumerate(dma_devices):
+    for i, dma_port in enumerate(dma_ports):
         #
         # Create the Ruby objects associated with the dma controller
         #
@@ -196,12 +196,8 @@
                                    ruby_system = ruby_system)
 
         exec("system.dma_cntrl%d = dma_cntrl" % i)
-        if dma_device.type == 'MemTest':
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.test" % 
i)
-        else:
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.dma" % i)
+        exec("system.dma_cntrl%d.dma_sequencer.slave = dma_port" % i)
         dma_cntrl_nodes.append(dma_cntrl)
-
         cntrl_count += 1
 
     all_cntrls = l1_cntrl_nodes + \
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/MOESI_hammer.py
--- a/configs/ruby/MOESI_hammer.py      Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/MOESI_hammer.py      Thu Apr 05 11:09:19 2012 -0500
@@ -58,7 +58,7 @@
     parser.add_option("--dir-on", action="store_true",
           help="Hammer: enable Full-bit Directory")
 
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MOESI_hammer':
         panic("This script requires the MOESI_hammer protocol to be built.")
@@ -195,7 +195,7 @@
 
         cntrl_count += 1
 
-    for i, dma_device in enumerate(dma_devices):
+    for i, dma_port in enumerate(dma_ports):
         #
         # Create the Ruby objects associated with the dma controller
         #
@@ -208,10 +208,7 @@
                                    ruby_system = ruby_system)
 
         exec("system.dma_cntrl%d = dma_cntrl" % i)
-        if dma_device.type == 'MemTest':
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.test" % 
i)
-        else:
-            exec("system.dma_cntrl%d.dma_sequencer.slave = dma_device.dma" % i)
+        exec("system.dma_cntrl%d.dma_sequencer.slave = dma_port" % i)
         dma_cntrl_nodes.append(dma_cntrl)
 
         if options.recycle_latency:
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/Network_test.py
--- a/configs/ruby/Network_test.py      Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/Network_test.py      Thu Apr 05 11:09:19 2012 -0500
@@ -41,7 +41,7 @@
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_devices, ruby_system):
+def create_system(options, system, piobus, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'Network_test':
         panic("This script requires the Network_test protocol to be built.")
@@ -52,7 +52,7 @@
     # The Garnet tester protocol does not support fs nor dma
     #
     assert(piobus == None)
-    assert(dma_devices == [])
+    assert(dma_ports == [])
     
     #
     # The ruby network creation expects the list of nodes in the system to be
diff -r 051bc173ea72 -r 4148f9af0b70 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py      Thu Apr 05 10:45:26 2012 -0400
+++ b/configs/ruby/Ruby.py      Thu Apr 05 11:09:19 2012 -0500
@@ -76,7 +76,7 @@
     exec "import %s" % protocol
     eval("%s.define_options(parser)" % protocol)
 
-def create_system(options, system, piobus = None, dma_devices = []):
+def create_system(options, system, piobus = None, dma_ports = []):
 
     system.ruby = RubySystem(clock = options.clock,
                              stats_filename = options.ruby_stats,
@@ -87,8 +87,7 @@
     exec "import %s" % protocol
     try:
         (cpu_sequencers, dir_cntrls, all_cntrls) = \
-             eval("%s.create_system(options, system, piobus, \
-                                    dma_devices, ruby)" \
+             eval("%s.create_system(options, system, piobus, dma_ports, ruby)"
                   % protocol)
     except:
         print "Error: could not create sytem for ruby protocol %s" % protocol
diff -r 051bc173ea72 -r 4148f9af0b70 src/dev/x86/Pc.py
--- a/src/dev/x86/Pc.py Thu Apr 05 10:45:26 2012 -0400
+++ b/src/dev/x86/Pc.py Thu Apr 05 11:09:19 2012 -0500
@@ -69,8 +69,8 @@
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to