diff options
author | Tushar Krishna <tushar@ece.gatech.edu> | 2016-10-06 14:35:22 -0400 |
---|---|---|
committer | Tushar Krishna <tushar@ece.gatech.edu> | 2016-10-06 14:35:22 -0400 |
commit | dbe8892b761067c5c1e828f889a513ea085b044f (patch) | |
tree | d3101cc8dbf74f1d3bc2f3f9ead1b948fd4ac33e /configs/topologies/Mesh_XY.py | |
parent | b512f4bf71fac79fb6e17bb2a9e05c1f494f69f4 (diff) | |
download | gem5-dbe8892b761067c5c1e828f889a513ea085b044f.tar.xz |
ruby: garnet2.0
Revamped version of garnet with more optimized single-cycle routers,
more configurability, and cleaner code.
Diffstat (limited to 'configs/topologies/Mesh_XY.py')
-rw-r--r-- | configs/topologies/Mesh_XY.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/configs/topologies/Mesh_XY.py b/configs/topologies/Mesh_XY.py index 134a5c07d..652ac16d8 100644 --- a/configs/topologies/Mesh_XY.py +++ b/configs/topologies/Mesh_XY.py @@ -53,15 +53,22 @@ class Mesh_XY(SimpleTopology): num_routers = options.num_cpus num_rows = options.mesh_rows + # default values for link latency and router latency. + # Can be over-ridden on a per link/router basis + link_latency = options.link_latency # used by simple and garnet + router_latency = options.router_latency # only used by garnet + + # There must be an evenly divisible number of cntrls to routers # Also, obviously the number or rows must be <= the number of routers cntrls_per_router, remainder = divmod(len(nodes), num_routers) - assert(num_rows <= num_routers) + assert(num_rows > 0 and num_rows <= num_routers) num_columns = int(num_routers / num_rows) assert(num_columns * num_rows == num_routers) # Create the routers in the mesh - routers = [Router(router_id=i) for i in range(num_routers)] + routers = [Router(router_id=i, latency = router_latency) \ + for i in range(num_routers)] network.routers = routers # link counter to set unique link ids @@ -83,7 +90,8 @@ class Mesh_XY(SimpleTopology): 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=routers[router_id], + latency = link_latency)) link_count += 1 # Connect the remainding nodes to router 0. These should only be @@ -92,7 +100,8 @@ class Mesh_XY(SimpleTopology): 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=routers[0], + latency = link_latency)) link_count += 1 network.ext_links = ext_links @@ -111,6 +120,7 @@ class Mesh_XY(SimpleTopology): dst_node=routers[west_in], src_outport="East", dst_inport="West", + latency = link_latency, weight=1)) link_count += 1 @@ -125,6 +135,7 @@ class Mesh_XY(SimpleTopology): dst_node=routers[east_in], src_outport="West", dst_inport="East", + latency = link_latency, weight=1)) link_count += 1 @@ -139,6 +150,7 @@ class Mesh_XY(SimpleTopology): dst_node=routers[south_in], src_outport="North", dst_inport="South", + latency = link_latency, weight=2)) link_count += 1 @@ -153,6 +165,7 @@ class Mesh_XY(SimpleTopology): dst_node=routers[north_in], src_outport="South", dst_inport="North", + latency = link_latency, weight=2)) link_count += 1 |