config: tweak ruby configs to clean up hierarchy
authorSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 23 May 2011 21:29:23 +0000 (14:29 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 23 May 2011 21:29:23 +0000 (14:29 -0700)
Re-enabling implicit parenting (see previous patch) causes current
Ruby config scripts to create some strange hierarchies and generate
several warnings.  This patch makes three general changes to address
these issues.

1. The order of object creation in the ruby config files makes the L1
   caches children of the sequencer rather than the controller; these
   config ciles are rewritten to assign the L1 caches to the
   controller first.

2. The assignment of the sequencer list to system.ruby.cpu_ruby_ports
   causes the sequencers to be children of system.ruby, generating
   warnings because they are already parented to their respective
   controllers.  Changing this attribute to _cpu_ruby_ports fixes this
   because the leading underscore means this is now treated as a plain
   Python attribute rather than a child assignment. As a result, the
   configuration hierarchy changes such that, e.g.,
   system.ruby.cpu_ruby_ports0 becomes system.l1_cntrl0.sequencer.

3. In the topology classes, the routers become children of some random
   internal link node rather than direct children of the topology.
   The topology classes are rewritten to assign the routers to the
   topology object first.

22 files changed:
configs/example/ruby_direct_test.py
configs/example/ruby_fs.py
configs/example/ruby_mem_test.py
configs/example/ruby_network_test.py
configs/example/ruby_random_test.py
configs/example/se.py
configs/ruby/MESI_CMP_directory.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
src/mem/ruby/network/topologies/Crossbar.py
src/mem/ruby/network/topologies/Mesh.py
src/mem/ruby/network/topologies/MeshDirCorners.py
src/mem/ruby/network/topologies/Pt2Pt.py
src/mem/ruby/network/topologies/Torus.py
tests/configs/memtest-ruby.py
tests/configs/rubytest-ruby.py
tests/configs/simple-timing-mp-ruby.py
tests/configs/simple-timing-ruby.py

index e744c35bdeeced21ca527e5794657c8a500d51af..12585b8d5b5cda8b8c0876fdad548dbd16567076 100644 (file)
@@ -99,9 +99,9 @@ system.tester = RubyDirectedTester(requests_to_complete = \
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
 
-for ruby_port in system.ruby.cpu_ruby_ports:
+for ruby_port in system.ruby._cpu_ruby_ports:
     #
     # Tie the ruby tester ports to the ruby cpu ports
     #
index 2081a10c4c4b4dd72ece928161cf0ef330583a19..8c03e14cb0efdba9c4de6f73febcb60355efec19 100644 (file)
@@ -128,11 +128,11 @@ for (i, cpu) in enumerate(system.cpu):
     #
     # Tie the cpu ports to the correct ruby system ports
     #
-    cpu.icache_port = system.ruby.cpu_ruby_ports[i].port
-    cpu.dcache_port = system.ruby.cpu_ruby_ports[i].port
+    cpu.icache_port = system.ruby._cpu_ruby_ports[i].port
+    cpu.dcache_port = system.ruby._cpu_ruby_ports[i].port
     if buildEnv['TARGET_ISA'] == "x86":
-        cpu.itb.walker.port = system.ruby.cpu_ruby_ports[i].port
-        cpu.dtb.walker.port = system.ruby.cpu_ruby_ports[i].port
+        cpu.itb.walker.port = system.ruby._cpu_ruby_ports[i].port
+        cpu.dtb.walker.port = system.ruby._cpu_ruby_ports[i].port
         cpu.interrupts.pio = system.piobus.port
         cpu.interrupts.int_port = system.piobus.port
 
index f58ebc1de99d3a917e3141d2a10899052487ade2..15416491926f7ff3a2ebb898dffbf56c7f6166bb 100644 (file)
@@ -126,20 +126,20 @@ system.ruby = Ruby.create_system(options, \
 #
 system.ruby.randomization = True
  
-assert(len(cpus) == len(system.ruby.cpu_ruby_ports))
+assert(len(cpus) == len(system.ruby._cpu_ruby_ports))
 
 for (i, cpu) in enumerate(cpus):
     #
     # Tie the cpu memtester ports to the correct system ports
     #
-    cpu.test = system.ruby.cpu_ruby_ports[i].port
+    cpu.test = system.ruby._cpu_ruby_ports[i].port
     cpu.functional = system.funcmem.port
 
     #
     # Since the memtester is incredibly bursty, increase the deadlock
     # threshold to 5 million cycles
     #
-    system.ruby.cpu_ruby_ports[i].deadlock_threshold = 5000000
+    system.ruby._cpu_ruby_ports[i].deadlock_threshold = 5000000
 
 for (i, dma) in enumerate(dmas):
     #
index c2c574493610486a138f841617490e40814ec33a..fb2a642b8250c1467328a3cc9277672880d9382f 100644 (file)
@@ -108,7 +108,7 @@ system = System(cpu = cpus,
 system.ruby = Ruby.create_system(options, system)
 
 i = 0
-for ruby_port in system.ruby.cpu_ruby_ports:
+for ruby_port in system.ruby._cpu_ruby_ports:
      #
      # Tie the cpu test ports to the ruby cpu port
      #
index 8c415641bb539386f744ec9776b5314de7675b71..b60afc1923276fecc57164110a36dd3ea2822967 100644 (file)
@@ -101,7 +101,7 @@ system = System(tester = tester, physmem = PhysicalMemory())
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
 
 #
 # The tester is most effective when randomization is turned on and
@@ -109,7 +109,7 @@ assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
 #
 system.ruby.randomization = True
 
-for ruby_port in system.ruby.cpu_ruby_ports:
+for ruby_port in system.ruby._cpu_ruby_ports:
     #
     # Tie the ruby tester ports to the ruby cpu ports
     #
index 98fbbfbaae46cffbf1d4917f6950498e00f0a440..9c35f80a0e56210962e8d36ba401c0d566952c82 100644 (file)
@@ -178,7 +178,7 @@ system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
 if options.ruby:
     options.use_map = True
     system.ruby = Ruby.create_system(options, system)
-    assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+    assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
 else:
     system.physmem.port = system.membus.port
     CacheConfig.config_cache(options, system)
@@ -187,8 +187,8 @@ for i in xrange(np):
     system.cpu[i].workload = multiprocesses[i]
 
     if options.ruby:
-        system.cpu[i].icache_port = system.ruby.cpu_ruby_ports[i].port
-        system.cpu[i].dcache_port = system.ruby.cpu_ruby_ports[i].port
+        system.cpu[i].icache_port = system.ruby._cpu_ruby_ports[i].port
+        system.cpu[i].dcache_port = system.ruby._cpu_ruby_ports[i].port
 
     if options.fastmem:
         system.cpu[0].physmem_port = system.physmem.port
index 4bd969be57efdb82e1e4ba701c80ab3646c056f1..f0e072f90e9d1fc39c7462c7d32790172effb3a8 100644 (file)
@@ -84,22 +84,23 @@ def create_system(options, system, piobus, dma_devices):
                             assoc = options.l1d_assoc,
                             start_index_bit = block_size_bits)
 
+        l1_cntrl = L1Cache_Controller(version = i,
+                                      cntrl_id = cntrl_count,
+                                      L1IcacheMemory = l1i_cache,
+                                      L1DcacheMemory = l1d_cache,
+                                      l2_select_num_bits = l2_bits)
+
         cpu_seq = RubySequencer(version = i,
                                 icache = l1i_cache,
                                 dcache = l1d_cache,
                                 physMemPort = system.physmem.port,
                                 physmem = system.physmem)
 
+        l1_cntrl.sequencer = cpu_seq
+
         if piobus != None:
             cpu_seq.pio_port = piobus.port
 
-        l1_cntrl = L1Cache_Controller(version = i,
-                                      cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
-                                      L1IcacheMemory = l1i_cache,
-                                      L1DcacheMemory = l1d_cache,
-                                      l2_select_num_bits = l2_bits)
-
         exec("system.l1_cntrl%d = l1_cntrl" % i)
         
         #
index 5f5703d4e014047c2b44858483873dc772692341..5018f2c18a0371f8717ef51a59e4e3bfe14ecefc 100644 (file)
@@ -78,20 +78,21 @@ def create_system(options, system, piobus, dma_devices):
         #
         # Only one unified L1 cache exists.  Can cache instructions and data.
         #
+        l1_cntrl = L1Cache_Controller(version = i,
+                                      cntrl_id = cntrl_count,
+                                      cacheMemory = cache)
+
         cpu_seq = RubySequencer(version = i,
                                 icache = cache,
                                 dcache = cache,
                                 physMemPort = system.physmem.port,
                                 physmem = system.physmem)
 
+        l1_cntrl.sequencer = cpu_seq
+
         if piobus != None:
             cpu_seq.pio_port = piobus.port
 
-        l1_cntrl = L1Cache_Controller(version = i,
-                                      cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
-                                      cacheMemory = cache)
-
         exec("system.l1_cntrl%d = l1_cntrl" % i)
         #
         # Add controllers and sequencers to the appropriate lists
index 15558a62d682925776c429c5522bc5e9479f6c33..c8b16fc5d1ab7c346160f7c4d74423027e7d5823 100644 (file)
@@ -84,22 +84,23 @@ def create_system(options, system, piobus, dma_devices):
                             assoc = options.l1d_assoc,
                             start_index_bit = block_size_bits)
 
+        l1_cntrl = L1Cache_Controller(version = i,
+                                      cntrl_id = cntrl_count,
+                                      L1IcacheMemory = l1i_cache,
+                                      L1DcacheMemory = l1d_cache,
+                                      l2_select_num_bits = l2_bits)
+
         cpu_seq = RubySequencer(version = i,
                                 icache = l1i_cache,
                                 dcache = l1d_cache,
                                 physMemPort = system.physmem.port,
                                 physmem = system.physmem)
 
+        l1_cntrl.sequencer = cpu_seq
+
         if piobus != None:
             cpu_seq.pio_port = piobus.port
 
-        l1_cntrl = L1Cache_Controller(version = i,
-                                      cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
-                                      L1IcacheMemory = l1i_cache,
-                                      L1DcacheMemory = l1d_cache,
-                                      l2_select_num_bits = l2_bits)
-
         exec("system.l1_cntrl%d = l1_cntrl" % i)
         #
         # Add controllers and sequencers to the appropriate lists
index 5b6e21f33a17e9b19c962f082529604de9f134bb..36999be5de9a32ada701cc539e8a71ddeefcd57d 100644 (file)
@@ -97,18 +97,8 @@ def create_system(options, system, piobus, dma_devices):
                             assoc = options.l1d_assoc,
                             start_index_bit = block_size_bits)
 
-        cpu_seq = RubySequencer(version = i,
-                                icache = l1i_cache,
-                                dcache = l1d_cache,
-                                physMemPort = system.physmem.port,
-                                physmem = system.physmem)
-
-        if piobus != None:
-            cpu_seq.pio_port = piobus.port
-
         l1_cntrl = L1Cache_Controller(version = i,
                                       cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
                                       L1IcacheMemory = l1i_cache,
                                       L1DcacheMemory = l1d_cache,
                                       l2_select_num_bits = l2_bits,
@@ -122,6 +112,17 @@ def create_system(options, system, piobus, dma_devices):
                                       no_mig_atomic = not \
                                         options.allow_atomic_migration)
 
+        cpu_seq = RubySequencer(version = i,
+                                icache = l1i_cache,
+                                dcache = l1d_cache,
+                                physMemPort = system.physmem.port,
+                                physmem = system.physmem)
+
+        l1_cntrl.sequencer = cpu_seq
+
+        if piobus != None:
+            cpu_seq.pio_port = piobus.port
+
         exec("system.l1_cntrl%d = l1_cntrl" % i)
         #
         # Add controllers and sequencers to the appropriate lists
index 4a03912646c61d7000717549c5267257729c4667..7e789d8e3f91309988e499776a2f032d0a357e63 100644 (file)
@@ -96,24 +96,25 @@ def create_system(options, system, piobus, dma_devices):
                            assoc = options.l2_assoc,
                            start_index_bit = block_size_bits)
 
+        l1_cntrl = L1Cache_Controller(version = i,
+                                      cntrl_id = cntrl_count,
+                                      L1IcacheMemory = l1i_cache,
+                                      L1DcacheMemory = l1d_cache,
+                                      L2cacheMemory = l2_cache,
+                                      no_mig_atomic = not \
+                                        options.allow_atomic_migration)
+
         cpu_seq = RubySequencer(version = i,
                                 icache = l1i_cache,
                                 dcache = l1d_cache,
                                 physMemPort = system.physmem.port,
                                 physmem = system.physmem)
 
+        l1_cntrl.sequencer = cpu_seq
+
         if piobus != None:
             cpu_seq.pio_port = piobus.port
 
-        l1_cntrl = L1Cache_Controller(version = i,
-                                      cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
-                                      L1IcacheMemory = l1i_cache,
-                                      L1DcacheMemory = l1d_cache,
-                                      L2cacheMemory = l2_cache,
-                                      no_mig_atomic = not \
-                                        options.allow_atomic_migration)
-
         if options.recycle_latency:
             l1_cntrl.recycle_latency = options.recycle_latency
 
index 75ec9099ef311944940eb326e0fdf79999e15fbb..308354f0f9c8b89053b17b6d09af425d25516952 100644 (file)
@@ -83,20 +83,21 @@ def create_system(options, system, piobus, dma_devices):
         #
         # Only one unified L1 cache exists.  Can cache instructions and data.
         #
+        l1_cntrl = L1Cache_Controller(version = i,
+                                      cntrl_id = cntrl_count,
+                                      cacheMemory = cache)
+
         cpu_seq = RubySequencer(icache = cache,
                                 dcache = cache,
                                 physMemPort = system.physmem.port,
                                 physmem = system.physmem,
                                 using_network_tester = True)
 
+        l1_cntrl.sequencer = cpu_seq
+
         if piobus != None:
             cpu_seq.pio_port = piobus.port
 
-        l1_cntrl = L1Cache_Controller(version = i,
-                                      cntrl_id = cntrl_count,
-                                      sequencer = cpu_seq,
-                                      cacheMemory = cache)
-
         exec("system.l1_cntrl%d = l1_cntrl" % i)
         #
         # Add controllers and sequencers to the appropriate lists
index 604bb7a73ebaa56732743cef78aed7d421e3f65a..3c58dfd2fb4b6e77efe2068041eb94d99511b59a 100644 (file)
@@ -145,7 +145,7 @@ def create_system(options, system, piobus = None, dma_devices = []):
                       tracer = RubyTracer(),
                       mem_size = total_mem_size)
 
-    ruby.cpu_ruby_ports = cpu_sequencers
+    ruby._cpu_ruby_ports = cpu_sequencers
     ruby.random_seed    = options.random_seed
 
     return ruby
index 8aa6c350413b1e5bcbed8a0faa0a49fadb6538a5..04e01ee1c92a588c8ea6a8edcdb2993ef2a7bb72 100644 (file)
@@ -37,14 +37,15 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
     # centralized crossbar.  The large numbers of routers are needed because
     # external links do not model outgoing bandwidth in the simple network, but
     # internal links do.
-    routers = [Router(router_id=i) for i in range(len(nodes)+1)]
-    ext_links = [ExtLink(link_id=i, ext_node=n, int_node=routers[i])
-                 for (i, n) in enumerate(nodes)]
+    cb = Crossbar()
+    cb.routers = [Router(router_id=i) for i in range(len(nodes)+1)]
+    cb.ext_links = [ExtLink(link_id=i, ext_node=n, int_node=cb.routers[i])
+                    for (i, n) in enumerate(nodes)]
     link_count = len(nodes)
-    xbar = routers[len(nodes)] # the crossbar router is the last router created
-    int_links = [IntLink(link_id=(link_count+i), node_a=routers[i], node_b=xbar)
-                 for i in range(len(nodes))]
-    return Crossbar(ext_links=ext_links, int_links=int_links,
-                    routers=routers)
+    xbar = cb.routers[len(nodes)] # the crossbar router is the last router created
+    cb.int_links = [IntLink(link_id=(link_count+i),
+                            node_a=cb.routers[i], node_b=xbar)
+                    for i in range(len(nodes))]
+    return cb
 
 
index 20f3bba317e5d9e71bbb0bafc93161ec455566ad..fa6e6335405b9c63dd6cd29a714d7c0c3001f21a 100644 (file)
@@ -46,8 +46,11 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
     num_columns = int(num_routers / num_rows)
     assert(num_columns * num_rows == num_routers)
 
+    # Create the mesh object
+    mesh = Mesh()
+
     # Create the routers in the mesh
-    routers = [Router(router_id=i) for i in range(num_routers)]
+    mesh.routers = [Router(router_id=i) for i in range(num_routers)]
 
     # link counter to set unique link ids
     link_count = 0
@@ -68,7 +71,7 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
         cntrl_level, router_id = divmod(i, num_routers)
         assert(cntrl_level < cntrls_per_router)
         ext_links.append(ExtLink(link_id=link_count, ext_node=n,
-                                 int_node=routers[router_id]))
+                                 int_node=mesh.routers[router_id]))
         link_count += 1
 
     # Connect the remainding nodes to router 0.  These should only be
@@ -77,7 +80,7 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
         assert(node.type == 'DMA_Controller')
         assert(i < remainder)
         ext_links.append(ExtLink(link_id=link_count, ext_node=node,
-                                 int_node=routers[0]))
+                                 int_node=mesh.routers[0]))
         link_count += 1
 
     # Create the mesh links.  First row (east-west) links then column
@@ -89,8 +92,8 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
                 east_id = col + (row * num_columns)
                 west_id = (col + 1) + (row * num_columns)
                 int_links.append(IntLink(link_id=link_count,
-                                         node_a=routers[east_id],
-                                         node_b=routers[west_id],
+                                         node_a=mesh.routers[east_id],
+                                         node_b=mesh.routers[west_id],
                                          weight=1))
                 link_count += 1
                 
@@ -100,10 +103,12 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
                 north_id = col + (row * num_columns)
                 south_id = col + ((row + 1) * num_columns)
                 int_links.append(IntLink(link_id=link_count,
-                                         node_a=routers[north_id],
-                                         node_b=routers[south_id],
+                                         node_a=mesh.routers[north_id],
+                                         node_b=mesh.routers[south_id],
                                          weight=2))
                 link_count += 1
-    return Mesh(ext_links=ext_links,
-                int_links=int_links,
-                routers=routers)
+
+    mesh.int_links = int_links
+    mesh.ext_links = ext_links
+
+    return mesh
index 1234d61c527fa06ea50387d78bcc065185759fbb..f9d302d192b8ef683da0570b768d129bae8cabf8 100644 (file)
@@ -65,8 +65,10 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
     assert(remainder == 0)
     assert(len(dir_nodes) == 4)
 
+    mesh = MeshDirCorners()
+
     # Create the routers in the mesh
-    routers = [Router(router_id=i) for i in range(num_routers)]
+    mesh.routers = [Router(router_id=i) for i in range(num_routers)]
 
     # link counter to set unique link ids
     link_count = 0
@@ -77,27 +79,27 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
         cntrl_level, router_id = divmod(i, num_routers)
         assert(cntrl_level < caches_per_router)
         ext_links.append(ExtLink(link_id=link_count, ext_node=n,
-                                 int_node=routers[router_id]))
+                                 int_node=mesh.routers[router_id]))
         link_count += 1
 
     # Connect the dir nodes to the corners.
     ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[0],
-                             int_node=routers[0]))
+                             int_node=mesh.routers[0]))
     link_count += 1
     ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[1],
-                             int_node=routers[num_columns - 1]))
+                             int_node=mesh.routers[num_columns - 1]))
     link_count += 1
     ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[2],
-                             int_node=routers[num_routers - num_columns]))
+                             int_node=mesh.routers[num_routers - num_columns]))
     link_count += 1
     ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[3],
-                             int_node=routers[num_routers - 1]))
+                             int_node=mesh.routers[num_routers - 1]))
     link_count += 1
 
     # Connect the dma nodes to router 0.  These should only be DMA nodes.
     for (i, node) in enumerate(dma_nodes):
         assert(node.type == 'DMA_Controller')
-        ext_links.append(ExtLink(ext_node=node, int_node=routers[0]))
+        ext_links.append(ExtLink(ext_node=node, int_node=mesh.routers[0]))
 
     # Create the mesh links.  First row (east-west) links then column
     # (north-south) links
@@ -108,8 +110,8 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
                 east_id = col + (row * num_columns)
                 west_id = (col + 1) + (row * num_columns)
                 int_links.append(IntLink(link_id=link_count,
-                                         node_a=routers[east_id],
-                                         node_b=routers[west_id],
+                                         node_a=mesh.routers[east_id],
+                                         node_b=mesh.routers[west_id],
                                          weight=1))
                 link_count += 1
                 
@@ -119,12 +121,12 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
                 north_id = col + (row * num_columns)
                 south_id = col + ((row + 1) * num_columns)
                 int_links.append(IntLink(link_id=link_count,
-                                         node_a=routers[north_id],
-                                         node_b=routers[south_id],
+                                         node_a=mesh.routers[north_id],
+                                         node_b=mesh.routers[south_id],
                                          weight=2))
                 link_count += 1
 
-    return MeshDirCorners(ext_links=ext_links,
-                          int_links=int_links,
-                          routers=routers)
+    mesh.ext_links = ext_links
+    mesh.int_links = int_links
 
+    return mesh
index ecab96d74479a2544de45de7cccef7adf71da465..f6ca13626139294795c208d939644de97e691843 100644 (file)
@@ -36,8 +36,9 @@ class Pt2Pt(Topology):
 
 def makeTopology(nodes, options, IntLink, ExtLink, Router):
     # Create an individual router for each controller, and connect all to all.
-    routers = [Router(router_id=i) for i in range(len(nodes))]
-    ext_links = [ExtLink(link_id=i, ext_node=n, int_node=routers[i])
+    pt2pt = Pt2Pt()
+    pt2pt.routers = [Router(router_id=i) for i in range(len(nodes))]
+    ext_links = [ExtLink(link_id=i, ext_node=n, int_node=pt2pt.routers[i])
                  for (i, n) in enumerate(nodes)]
     link_count = len(nodes)
 
@@ -47,9 +48,10 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
             if (i != j):
                 link_count += 1
                 int_links.append(IntLink(link_id=link_count,
-                                         node_a=routers[i],
-                                         node_b=routers[j]))
+                                         node_a=pt2pt.routers[i],
+                                         node_b=pt2pt.routers[j]))
 
-    return Pt2Pt(ext_links=ext_links,
-                 int_links=int_links,
-                 routers=routers)
+    pt2pt.ext_links = ext_links
+    pt2pt.int_links = int_links
+
+    return pt2pt
index 636e4636bde83a6545e9fba36547e098b9d39a79..f3583bfc18e677da3e954ea8ded815b73fe0f4cb 100644 (file)
@@ -51,8 +51,11 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
     num_columns = int(num_routers / num_rows)
     assert(num_columns * num_rows == num_routers)
 
+    # Create the torus object
+    torus = Torus()
+
     # Create the routers in the torus
-    routers = [Router(router_id=i) for i in range(num_routers)]
+    torus.routers = [Router(router_id=i) for i in range(num_routers)]
 
     # link counter to set unique link ids
     link_count = 0
@@ -73,7 +76,7 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
         cntrl_level, router_id = divmod(i, num_routers)
         assert(cntrl_level < cntrls_per_router)
         ext_links.append(ExtLink(link_id=link_count, ext_node=n, 
-                                 int_node=routers[router_id]))
+                                 int_node=torus.routers[router_id]))
         link_count += 1
 
     # Connect the remainding nodes to router 0.  These should only be
@@ -82,7 +85,7 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
         assert(node.type == 'DMA_Controller')
         assert(i < remainder)
         ext_links.append(ExtLink(link_id=link_count, ext_node=node,
-                                 int_node=routers[0]))
+                                 int_node=torus.routers[0]))
         link_count += 1
 
     # Create the torus links.  First row (east-west) links then column
@@ -97,8 +100,8 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
             else:
                 east_id = (row * num_columns)
             int_links.append(IntLink(link_id=link_count,
-                                     node_a=routers[east_id],
-                                     node_b=routers[west_id],
+                                     node_a=torus.routers[east_id],
+                                     node_b=torus.routers[west_id],
                                      latency=2,
                                      weight=1))
             link_count += 1
@@ -111,12 +114,13 @@ def makeTopology(nodes, options, IntLink, ExtLink, Router):
             else:
                 south_id = col
             int_links.append(IntLink(link_id=link_count,
-                                     node_a=routers[north_id],
-                                     node_b=routers[south_id],
+                                     node_a=torus.routers[north_id],
+                                     node_b=torus.routers[south_id],
                                      latency=2,
                                      weight=2))
             link_count += 1
 
-    return Torus(ext_links=ext_links,
-                 int_links=int_links,
-                 routers=routers)
+    torus.ext_links = ext_links
+    torus.int_links = int_links
+
+    return torus
index eb7a280f4096c3121a4a60f819a99c4aba59dd31..8e66c7334202dce42d1ce827abb21dbfb1a31b76 100644 (file)
@@ -87,9 +87,9 @@ system = System(cpu = cpus,
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(len(cpus) == len(system.ruby.cpu_ruby_ports))
+assert(len(cpus) == len(system.ruby._cpu_ruby_ports))
 
-for (i, ruby_port) in enumerate(system.ruby.cpu_ruby_ports):
+for (i, ruby_port) in enumerate(system.ruby._cpu_ruby_ports):
      #
      # Tie the cpu test and functional ports to the ruby cpu ports and
      # physmem, respectively
index 3ff4efed1c0e7413d1782035571f02b090573dfa..9c3207a90e346b2b0d9416efc58aacfb7b5810a6 100644 (file)
@@ -79,7 +79,7 @@ system = System(tester = tester, physmem = PhysicalMemory())
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
 
 #
 # The tester is most effective when randomization is turned on and
@@ -87,7 +87,7 @@ assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
 #
 system.ruby.randomization = True
 
-for ruby_port in system.ruby.cpu_ruby_ports:
+for ruby_port in system.ruby._cpu_ruby_ports:
     #
     # Tie the ruby tester ports to the ruby cpu ports
     #
index e5e60573b576458f3baf14d93e085ee61dcecc1b..56b7ae1eb513914d0d08f96eb5edd122c653f77d 100644 (file)
@@ -79,14 +79,14 @@ system = System(cpu = cpus, physmem = PhysicalMemory())
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
 
 for (i, cpu) in enumerate(system.cpu):
     #
     # Tie the cpu ports to the ruby cpu ports
     #
-    cpu.icache_port = system.ruby.cpu_ruby_ports[i].port
-    cpu.dcache_port = system.ruby.cpu_ruby_ports[i].port
+    cpu.icache_port = system.ruby._cpu_ruby_ports[i].port
+    cpu.dcache_port = system.ruby._cpu_ruby_ports[i].port
 
 # -----------------------
 # run simulation
index 6e51a0d67e924147ce614fdfa4bbf413659fc472..c07881d24de51f4c2c7e9fb90db3105f7a2bb3ff 100644 (file)
@@ -76,14 +76,14 @@ system = System(cpu = cpu, physmem = PhysicalMemory())
 
 system.ruby = Ruby.create_system(options, system)
 
-assert(len(system.ruby.cpu_ruby_ports) == 1)
+assert(len(system.ruby._cpu_ruby_ports) == 1)
 
 #
 # Tie the cpu cache ports to the ruby cpu ports and
 # physmem, respectively
 #
-cpu.icache_port = system.ruby.cpu_ruby_ports[0].port
-cpu.dcache_port = system.ruby.cpu_ruby_ports[0].port
+cpu.icache_port = system.ruby._cpu_ruby_ports[0].port
+cpu.dcache_port = system.ruby._cpu_ruby_ports[0].port
 
 # -----------------------
 # run simulation