summaryrefslogtreecommitdiff
path: root/configs/topologies/Torus.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/Torus.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/Torus.py')
-rw-r--r--configs/topologies/Torus.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/configs/topologies/Torus.py b/configs/topologies/Torus.py
index 9869465ae..db67d3ede 100644
--- a/configs/topologies/Torus.py
+++ b/configs/topologies/Torus.py
@@ -44,7 +44,7 @@ class Torus(SimpleTopology):
# All links (including the wrap-around ones) are of equal length, double that
# of a mesh. Thus, each link is assigned a latency of 2 cycles.
- def makeTopology(self, options, IntLink, ExtLink, Router):
+ def makeTopology(self, options, network, IntLink, ExtLink, Router):
nodes = self.nodes
num_routers = options.num_cpus
@@ -59,6 +59,7 @@ class Torus(SimpleTopology):
# Create the routers in the torus
routers = [Router(router_id=i) for i in range(num_routers)]
+ network.routers = routers
# link counter to set unique link ids
link_count = 0
@@ -91,6 +92,8 @@ class Torus(SimpleTopology):
int_node=routers[0]))
link_count += 1
+ network.ext_links = ext_links
+
# Create the torus links. First row (east-west) links then column
# (north-south) links
# column links are given higher weights to implement XY routing
@@ -123,4 +126,4 @@ class Torus(SimpleTopology):
weight=2))
link_count += 1
- return routers, int_links, ext_links
+ network.int_links = int_links