config: ruby: remove piobus from protocols
authorNilay Vaish <nilay@cs.wisc.edu>
Mon, 17 Mar 2014 22:40:15 +0000 (17:40 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Mon, 17 Mar 2014 22:40:15 +0000 (17:40 -0500)
This patch removes the piobus from the protocol config files.  The ports
are now connected to the piobus in the Ruby.py file.

configs/ruby/MESI_Three_Level.py
configs/ruby/MESI_Two_Level.py
configs/ruby/MI_example.py
configs/ruby/MOESI_CMP_directory.py
configs/ruby/MOESI_CMP_token.py
configs/ruby/MOESI_hammer.py
configs/ruby/Network_test.py
configs/ruby/Ruby.py

index 67ed9af7493a146f3ea57271ea2e0a1ffa3f8a21..966c801727cdea14a495e9b8c8c1f22fc8dd7a90 100644 (file)
@@ -56,7 +56,7 @@ def define_options(parser):
             caches private to clusters")
     return
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MESI_Three_Level':
         fatal("This script requires the MESI_Three_Level protocol to be built.")
@@ -116,11 +116,6 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                           cache = l1_cache, l2_select_num_bits = l2_bits,
                           cluster_id = i, ruby_system = ruby_system)
 
-            if piobus != None:
-                cpu_seq.pio_master_port = piobus.slave
-                cpu_seq.mem_master_port = piobus.slave
-                cpu_seq.pio_slave_port = piobus.master
-
             exec("ruby_system.l0_cntrl%d = l0_cntrl" % (
                         i*num_cpus_per_cluster+j))
             exec("ruby_system.l1_cntrl%d = l1_cntrl" % (
index 5183361683a88354bfdb4948d9ec7ae29f9c9050..845d5cf2215110e9e8e0967b78ea16ef9d156ea9 100644 (file)
@@ -48,7 +48,7 @@ class L2Cache(RubyCache):
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MESI_Two_Level':
         fatal("This script requires the MESI_Two_Level protocol to be built.")
@@ -104,12 +104,6 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                 ruby_system = ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
-
-        if piobus != None:
-            cpu_seq.pio_master_port = piobus.slave
-            cpu_seq.mem_master_port = piobus.slave
-            cpu_seq.pio_slave_port = piobus.master
-
         exec("ruby_system.l1_cntrl%d = l1_cntrl" % i)
 
         #
index ed18c14cbe4d25ab2ea134f34931cfbc516c25d8..9fb6ca3661e2ad7c801e56890506bdb1a7d5359f 100644 (file)
@@ -42,7 +42,7 @@ class Cache(RubyCache):
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'MI_example':
         panic("This script requires the MI_example protocol to be built.")
@@ -90,13 +90,8 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                 ruby_system = ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
-
-        if piobus != None:
-            cpu_seq.pio_master_port = piobus.slave
-            cpu_seq.mem_master_port = piobus.slave
-            cpu_seq.pio_slave_port = piobus.master
-
         exec("ruby_system.l1_cntrl%d = l1_cntrl" % i)
+
         #
         # Add controllers and sequencers to the appropriate lists
         #
index 0af4643afcef442f06f0dcd763c64db727aa1ed6..a7de3bf8f55933397c703bdb03c596e61ac971d5 100644 (file)
@@ -48,7 +48,7 @@ class L2Cache(RubyCache):
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
         panic("This script requires the MOESI_CMP_directory protocol to be built.")
@@ -100,13 +100,8 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                 ruby_system = ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
-
-        if piobus != None:
-            cpu_seq.pio_master_port = piobus.slave
-            cpu_seq.mem_master_port = piobus.slave
-            cpu_seq.pio_slave_port = piobus.master
-
         exec("ruby_system.l1_cntrl%d = l1_cntrl" % i)
+
         #
         # Add controllers and sequencers to the appropriate lists
         #
index 78ccef71ab82d6f18939b36aaa075fda640cf09c..52c1b44f4eeb82f14343968f09158a479c3ae581 100644 (file)
@@ -55,7 +55,7 @@ def define_options(parser):
     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_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'MOESI_CMP_token':
         panic("This script requires the MOESI_CMP_token protocol to be built.")
@@ -120,13 +120,8 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                 ruby_system = ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
-
-        if piobus != None:
-            cpu_seq.pio_master_port = piobus.slave
-            cpu_seq.mem_master_port = piobus.slave
-            cpu_seq.pio_slave_port = piobus.master
-
         exec("ruby_system.l1_cntrl%d = l1_cntrl" % i)
+
         #
         # Add controllers and sequencers to the appropriate lists
         #
index d716aba7aec6f08a87da454aade1991acc801c4d..eaa3bc7a2beab5a13d9dee4269cbbbdcb8897466 100644 (file)
@@ -59,7 +59,7 @@ def define_options(parser):
     parser.add_option("--dir-on", action="store_true",
           help="Hammer: enable Full-bit Directory")
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
 
     if buildEnv['PROTOCOL'] != 'MOESI_hammer':
         panic("This script requires the MOESI_hammer protocol to be built.")
@@ -113,12 +113,6 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                 ruby_system = ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
-
-        if piobus != None:
-            cpu_seq.pio_master_port = piobus.slave
-            cpu_seq.mem_master_port = piobus.slave
-            cpu_seq.pio_slave_port = piobus.master
-
         if options.recycle_latency:
             l1_cntrl.recycle_latency = options.recycle_latency
 
index f48f5a792e43e0934dd92ff4df91ac26d4d28494..d331163b307099c4c0f580b235585b3cf4d29214 100644 (file)
@@ -42,7 +42,7 @@ class Cache(RubyCache):
 def define_options(parser):
     return
 
-def create_system(options, system, piobus, dma_ports, ruby_system):
+def create_system(options, system, dma_ports, ruby_system):
     
     if buildEnv['PROTOCOL'] != 'Network_test':
         panic("This script requires the Network_test protocol to be built.")
@@ -52,7 +52,6 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
     #
     # The Garnet tester protocol does not support fs nor dma
     #
-    assert(piobus == None)
     assert(dma_ports == [])
     
     #
index c74e887a8d001aaf4c3b8a5951ea08ede1d4a884..e66a68f1dea63491b01ed6849010808807ccf873 100644 (file)
@@ -107,7 +107,7 @@ def create_system(options, system, piobus = None, dma_ports = []):
     exec "import %s" % protocol
     try:
         (cpu_sequencers, dir_cntrls, topology) = \
-             eval("%s.create_system(options, system, piobus, dma_ports, ruby)"
+             eval("%s.create_system(options, system, dma_ports, ruby)"
                   % protocol)
     except:
         print "Error: could not create sytem for ruby protocol %s" % protocol
@@ -187,6 +187,16 @@ def create_system(options, system, piobus = None, dma_ports = []):
 
     ruby.network = network
     ruby.mem_size = total_mem_size
+
+    # Connect the cpu sequencers and the piobus
+    if piobus != None:
+        for cpu_seq in cpu_sequencers:
+            cpu_seq.pio_master_port = piobus.slave
+            cpu_seq.mem_master_port = piobus.slave
+
+            if buildEnv['TARGET_ISA'] == "x86":
+                cpu_seq.pio_slave_port = piobus.master
+
     ruby._cpu_ruby_ports = cpu_sequencers
     ruby.num_of_sequencers = len(cpu_sequencers)
     ruby.random_seed    = options.random_seed