Mesh_XY.py (11663:cf870cd20cfc) Mesh_XY.py (11664:2365e9e396f7)
1# Copyright (c) 2010 Advanced Micro Devices, Inc.
2# 2016 Georgia Institute of Technology
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

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

104 for row in xrange(num_rows):
105 for col in xrange(num_columns):
106 if (col + 1 < num_columns):
107 east_out = col + (row * num_columns)
108 west_in = (col + 1) + (row * num_columns)
109 int_links.append(IntLink(link_id=link_count,
110 src_node=routers[east_out],
111 dst_node=routers[west_in],
1# Copyright (c) 2010 Advanced Micro Devices, Inc.
2# 2016 Georgia Institute of Technology
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

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

104 for row in xrange(num_rows):
105 for col in xrange(num_columns):
106 if (col + 1 < num_columns):
107 east_out = col + (row * num_columns)
108 west_in = (col + 1) + (row * num_columns)
109 int_links.append(IntLink(link_id=link_count,
110 src_node=routers[east_out],
111 dst_node=routers[west_in],
112 src_outport="East",
113 dst_inport="West",
112 weight=1))
113 link_count += 1
114
115 # West output to East input links (weight = 1)
116 for row in xrange(num_rows):
117 for col in xrange(num_columns):
118 if (col + 1 < num_columns):
119 east_in = col + (row * num_columns)
120 west_out = (col + 1) + (row * num_columns)
121 int_links.append(IntLink(link_id=link_count,
122 src_node=routers[west_out],
123 dst_node=routers[east_in],
114 weight=1))
115 link_count += 1
116
117 # West output to East input links (weight = 1)
118 for row in xrange(num_rows):
119 for col in xrange(num_columns):
120 if (col + 1 < num_columns):
121 east_in = col + (row * num_columns)
122 west_out = (col + 1) + (row * num_columns)
123 int_links.append(IntLink(link_id=link_count,
124 src_node=routers[west_out],
125 dst_node=routers[east_in],
126 src_outport="West",
127 dst_inport="East",
124 weight=1))
125 link_count += 1
126
127 # North output to South input links (weight = 2)
128 for col in xrange(num_columns):
129 for row in xrange(num_rows):
130 if (row + 1 < num_rows):
131 north_out = col + (row * num_columns)
132 south_in = col + ((row + 1) * num_columns)
133 int_links.append(IntLink(link_id=link_count,
134 src_node=routers[north_out],
135 dst_node=routers[south_in],
128 weight=1))
129 link_count += 1
130
131 # North output to South input links (weight = 2)
132 for col in xrange(num_columns):
133 for row in xrange(num_rows):
134 if (row + 1 < num_rows):
135 north_out = col + (row * num_columns)
136 south_in = col + ((row + 1) * num_columns)
137 int_links.append(IntLink(link_id=link_count,
138 src_node=routers[north_out],
139 dst_node=routers[south_in],
140 src_outport="North",
141 dst_inport="South",
136 weight=2))
137 link_count += 1
138
139 # South output to North input links (weight = 2)
140 for col in xrange(num_columns):
141 for row in xrange(num_rows):
142 if (row + 1 < num_rows):
143 north_in = col + (row * num_columns)
144 south_out = col + ((row + 1) * num_columns)
145 int_links.append(IntLink(link_id=link_count,
146 src_node=routers[south_out],
147 dst_node=routers[north_in],
142 weight=2))
143 link_count += 1
144
145 # South output to North input links (weight = 2)
146 for col in xrange(num_columns):
147 for row in xrange(num_rows):
148 if (row + 1 < num_rows):
149 north_in = col + (row * num_columns)
150 south_out = col + ((row + 1) * num_columns)
151 int_links.append(IntLink(link_id=link_count,
152 src_node=routers[south_out],
153 dst_node=routers[north_in],
154 src_outport="South",
155 dst_inport="North",
148 weight=2))
149 link_count += 1
150
151
152 network.int_links = int_links
156 weight=2))
157 link_count += 1
158
159
160 network.int_links = int_links