MeshDirCorners_XY.py (13774:a1be2a0c55f2) MeshDirCorners_XY.py (13885:d10ea5e56cb0)
1# Copyright (c) 2010 Advanced Micro Devices, Inc.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 18 unchanged lines hidden (view full) ---

27# Authors: Brad Beckmann
28
29from __future__ import print_function
30from __future__ import absolute_import
31
32from m5.params import *
33from m5.objects import *
34
1# Copyright (c) 2010 Advanced Micro Devices, Inc.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 18 unchanged lines hidden (view full) ---

27# Authors: Brad Beckmann
28
29from __future__ import print_function
30from __future__ import absolute_import
31
32from m5.params import *
33from m5.objects import *
34
35from common import FileSystemConfig
36
35from .BaseTopology import SimpleTopology
36
37# Creates a Mesh topology with 4 directories, one at each corner.
38# One L1 (and L2, depending on the protocol) are connected to each router.
39# XY routing is enforced (using link weights) to guarantee deadlock freedom.
40
41class MeshDirCorners_XY(SimpleTopology):
42 description='MeshDirCorners_XY'

--- 50 unchanged lines hidden (view full) ---

93 for (i, n) in enumerate(cache_nodes):
94 cntrl_level, router_id = divmod(i, num_routers)
95 assert(cntrl_level < caches_per_router)
96 ext_links.append(ExtLink(link_id=link_count, ext_node=n,
97 int_node=routers[router_id],
98 latency = link_latency))
99 link_count += 1
100
37from .BaseTopology import SimpleTopology
38
39# Creates a Mesh topology with 4 directories, one at each corner.
40# One L1 (and L2, depending on the protocol) are connected to each router.
41# XY routing is enforced (using link weights) to guarantee deadlock freedom.
42
43class MeshDirCorners_XY(SimpleTopology):
44 description='MeshDirCorners_XY'

--- 50 unchanged lines hidden (view full) ---

95 for (i, n) in enumerate(cache_nodes):
96 cntrl_level, router_id = divmod(i, num_routers)
97 assert(cntrl_level < caches_per_router)
98 ext_links.append(ExtLink(link_id=link_count, ext_node=n,
99 int_node=routers[router_id],
100 latency = link_latency))
101 link_count += 1
102
103 # NUMA Node for each quadrant
104 # With odd columns or rows, the nodes will be unequal
105 numa_nodes = [ [], [], [], []]
106 for i in xrange(num_routers):
107 if i % num_columns < num_columns / 2 and \
108 i < num_routers / 2:
109 numa_nodes[0].append(i)
110 elif i % num_columns >= num_columns / 2 and \
111 i < num_routers / 2:
112 numa_nodes[1].append(i)
113 elif i % num_columns < num_columns / 2 and \
114 i >= num_routers / 2:
115 numa_nodes[2].append(i)
116 else:
117 numa_nodes[3].append(i)
118
119 num_numa_nodes = 0
120 for n in numa_nodes:
121 if n:
122 num_numa_nodes += 1
123
101 # Connect the dir nodes to the corners.
102 ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[0],
103 int_node=routers[0],
104 latency = link_latency))
105 link_count += 1
106 ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[1],
107 int_node=routers[num_columns - 1],
108 latency = link_latency))

--- 76 unchanged lines hidden (view full) ---

185 src_outport="South",
186 dst_inport="North",
187 latency = link_latency,
188 weight=2))
189 link_count += 1
190
191
192 network.int_links = int_links
124 # Connect the dir nodes to the corners.
125 ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[0],
126 int_node=routers[0],
127 latency = link_latency))
128 link_count += 1
129 ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[1],
130 int_node=routers[num_columns - 1],
131 latency = link_latency))

--- 76 unchanged lines hidden (view full) ---

208 src_outport="South",
209 dst_inport="North",
210 latency = link_latency,
211 weight=2))
212 link_count += 1
213
214
215 network.int_links = int_links
216
217 # Register nodes with filesystem
218 def registerTopology(self, options):
219 i = 0
220 for n in numa_nodes:
221 if n:
222 FileSystemConfig.register_node(n,
223 MemorySize(options.mem_size) / num_numa_nodes, i)
224 i += 1
225