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", |
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", |
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", |
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", |
156 weight=2)) 157 link_count += 1 158 159 160 network.int_links = int_links |