diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:33 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:33 -0500 |
commit | e9ae8b7d29e83fa2cad55006d2c6dc58115965cc (patch) | |
tree | c418f84ec5ed77be77ca84de9517126b5cfa4ad6 /configs/topologies/Pt2Pt.py | |
parent | 24dc914d8758464ed6d757cf2830456562686be0 (diff) | |
download | gem5-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/Pt2Pt.py')
-rw-r--r-- | configs/topologies/Pt2Pt.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/configs/topologies/Pt2Pt.py b/configs/topologies/Pt2Pt.py index 74ff116ff..8fada26bf 100644 --- a/configs/topologies/Pt2Pt.py +++ b/configs/topologies/Pt2Pt.py @@ -39,15 +39,18 @@ class Pt2Pt(SimpleTopology): def __init__(self, controllers): self.nodes = controllers - def makeTopology(self, options, IntLink, ExtLink, Router): + def makeTopology(self, options, network, IntLink, ExtLink, Router): nodes = self.nodes - # Create an individual router for each controller, and connect all to all. + # Create an individual router for each controller, and connect all to all. routers = [Router(router_id=i) for i in range(len(nodes))] + network.routers = routers + ext_links = [ExtLink(link_id=i, ext_node=n, int_node=routers[i]) for (i, n) in enumerate(nodes)] - link_count = len(nodes) + network.ext_links = ext_links + link_count = len(nodes) int_links = [] for i in xrange(len(nodes)): for j in xrange(len(nodes)): @@ -57,4 +60,4 @@ class Pt2Pt(SimpleTopology): node_a=routers[i], node_b=routers[j])) - return routers, int_links, ext_links + network.int_links = int_links |