summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/topologies/MeshDirCorners.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/topologies/MeshDirCorners.py')
-rw-r--r--src/mem/ruby/network/topologies/MeshDirCorners.py41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/mem/ruby/network/topologies/MeshDirCorners.py b/src/mem/ruby/network/topologies/MeshDirCorners.py
index 8b08241ae..b87b749f6 100644
--- a/src/mem/ruby/network/topologies/MeshDirCorners.py
+++ b/src/mem/ruby/network/topologies/MeshDirCorners.py
@@ -29,20 +29,16 @@
from m5.params import *
from m5.objects import *
-#
-# This file contains a special network creation function. This networks is not
-# general and will only work with specific system configurations. The network
-# specified is similar to GEMS old file specified network.
-#
+# This file contains a special network creation function. This
+# networks is not general and will only work with specific system
+# configurations. The network specified is similar to GEMS old file
+# specified network.
def makeTopology(nodes, options):
-
num_routers = options.num_cpus
num_rows = options.mesh_rows
-
- #
+
# First determine which nodes are cache cntrls vs. dirs vs. dma
- #
cache_nodes = []
dir_nodes = []
dma_nodes = []
@@ -54,12 +50,11 @@ def makeTopology(nodes, options):
dir_nodes.append(node)
elif node.type == 'DMA_Controller':
dma_nodes.append(node)
-
- #
- # Obviously the number or rows must be <= the number of routers and evenly
- # divisible. Also the number of caches must be a multiple of the number of
- # routers and the number of directories must be four.
- #
+
+ # Obviously the number or rows must be <= the number of routers
+ # and evenly divisible. Also the number of caches must be a
+ # multiple of the number of routers and the number of directories
+ # must be four.
assert(num_rows <= num_routers)
num_columns = int(num_routers / num_rows)
assert(num_columns * num_rows == num_routers)
@@ -67,37 +62,31 @@ def makeTopology(nodes, options):
assert(remainder == 0)
assert(len(dir_nodes) == 4)
- #
# Connect each cache controller to the appropriate router
- #
ext_links = []
for (i, n) in enumerate(cache_nodes):
cntrl_level, router_id = divmod(i, num_routers)
assert(cntrl_level < caches_per_router)
ext_links.append(ExtLink(ext_node=n, int_node=router_id))
- #
# Connect the dir nodes to the corners.
- #
ext_links.append(ExtLink(ext_node=dir_nodes[0], int_node=0))
- ext_links.append(ExtLink(ext_node=dir_nodes[1], int_node=(num_columns - 1)))
+ ext_links.append(ExtLink(ext_node=dir_nodes[1],
+ int_node=(num_columns - 1)))
ext_links.append(ExtLink(ext_node=dir_nodes[2],
int_node=(num_routers - num_columns)))
- ext_links.append(ExtLink(ext_node=dir_nodes[3], int_node=(num_routers - 1)))
+ ext_links.append(ExtLink(ext_node=dir_nodes[3],
+ int_node=(num_routers - 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=0))
-
- #
+
# Create the mesh links. First row (east-west) links then column
# (north-south) links
- #
int_links = []
for row in xrange(num_rows):
for col in xrange(num_columns):