summaryrefslogtreecommitdiff
path: root/configs/topologies/Mesh.py
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:33 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:33 -0500
commite9ae8b7d29e83fa2cad55006d2c6dc58115965cc (patch)
treec418f84ec5ed77be77ca84de9517126b5cfa4ad6 /configs/topologies/Mesh.py
parent24dc914d8758464ed6d757cf2830456562686be0 (diff)
downloadgem5-e9ae8b7d29e83fa2cad55006d2c6dc58115965cc.tar.xz
ruby: network: correct naming of routers
The routers are created before the network class. This results in the routers becoming children of the first link they are connected to and they get generic names like int_node and node_b. This patch creates the network object first and passes it to the topology creation function. Now the routers are children of the network object and names are much more sensible.
Diffstat (limited to 'configs/topologies/Mesh.py')
-rw-r--r--configs/topologies/Mesh.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/configs/topologies/Mesh.py b/configs/topologies/Mesh.py
index 81d87f5e5..446fc4a18 100644
--- a/configs/topologies/Mesh.py
+++ b/configs/topologies/Mesh.py
@@ -39,7 +39,7 @@ class Mesh(SimpleTopology):
# Makes a generic mesh assuming an equal number of cache and directory cntrls
- def makeTopology(self, options, IntLink, ExtLink, Router):
+ def makeTopology(self, options, network, IntLink, ExtLink, Router):
nodes = self.nodes
num_routers = options.num_cpus
@@ -54,6 +54,7 @@ class Mesh(SimpleTopology):
# Create the routers in the mesh
routers = [Router(router_id=i) for i in range(num_routers)]
+ network.routers = routers
# link counter to set unique link ids
link_count = 0
@@ -86,6 +87,8 @@ class Mesh(SimpleTopology):
int_node=routers[0]))
link_count += 1
+ network.ext_links = ext_links
+
# Create the mesh links. First row (east-west) links then column
# (north-south) links
int_links = []
@@ -111,4 +114,4 @@ class Mesh(SimpleTopology):
weight=2))
link_count += 1
- return routers, int_links, ext_links
+ network.int_links = int_links