20
20
/* ******************* Subroutines local to this module **********************/
21
21
static void check_node_and_range (int inode, enum e_route_type route_type);
22
22
static void check_source (int inode, ClusterNetId net_id);
23
- static void check_sink (int inode, ClusterNetId net_id, bool * pin_done);
23
+ static void check_sink (int inode, int net_pin_index, ClusterNetId net_id, bool * pin_done);
24
24
static void check_switch (t_trace* tptr, int num_switch);
25
25
static bool check_adjacent (int from_node, int to_node);
26
26
static int chanx_chany_adjacent (int chanx_node, int chany_node);
@@ -46,7 +46,7 @@ void check_route(enum e_route_type route_type, e_check_route_option check_route_
46
46
return ;
47
47
}
48
48
49
- int max_pins, inode, prev_node;
49
+ int max_pins, inode, net_pin_index, prev_node;
50
50
unsigned int ipin;
51
51
bool valid, connects;
52
52
t_trace* tptr;
@@ -112,6 +112,7 @@ void check_route(enum e_route_type route_type, e_check_route_option check_route_
112
112
size_t num_sinks = 0 ;
113
113
while (tptr != nullptr ) {
114
114
inode = tptr->index ;
115
+ net_pin_index = tptr->net_pin_index ;
115
116
check_node_and_range (inode, route_type);
116
117
check_switch (tptr, num_switches);
117
118
@@ -135,7 +136,7 @@ void check_route(enum e_route_type route_type, e_check_route_option check_route_
135
136
connected_to_route[inode] = true ; /* Mark as in path. */
136
137
137
138
if (device_ctx.rr_nodes [inode].type () == SINK) {
138
- check_sink (inode, net_id, pin_done.get ());
139
+ check_sink (inode, net_pin_index, net_id, pin_done.get ());
139
140
num_sinks += 1 ;
140
141
}
141
142
@@ -177,48 +178,22 @@ void check_route(enum e_route_type route_type, e_check_route_option check_route_
177
178
178
179
/* Checks that this SINK node is one of the terminals of inet, and marks *
179
180
* the appropriate pin as being reached. */
180
- static void check_sink (int inode, ClusterNetId net_id, bool * pin_done) {
181
+ static void check_sink (int inode, int net_pin_index, ClusterNetId net_id, bool * pin_done) {
181
182
auto & device_ctx = g_vpr_ctx.device ();
182
183
auto & cluster_ctx = g_vpr_ctx.clustering ();
183
- auto & place_ctx = g_vpr_ctx.placement ();
184
184
185
185
VTR_ASSERT (device_ctx.rr_nodes [inode].type () == SINK);
186
- int i = device_ctx.rr_nodes [inode].xlow ();
187
- int j = device_ctx.rr_nodes [inode].ylow ();
188
- auto type = device_ctx.grid [i][j].type ;
189
- /* For sinks, ptc_num is the class */
190
- int ptc_num = device_ctx.rr_nodes [inode].ptc_num ();
191
- int ifound = 0 ;
192
-
193
- for (auto bnum : place_ctx.grid_blocks [i][j].blocks ) {
194
- unsigned int ipin = 1 ;
195
- for (auto pin_id : cluster_ctx.clb_nlist .net_sinks (net_id)) {
196
- if (cluster_ctx.clb_nlist .pin_block (pin_id) == bnum) {
197
- int pin_index = tile_pin_index (pin_id);
198
- int iclass = type->pin_class [pin_index];
199
- if (iclass == ptc_num) {
200
- /* Could connect to same pin class on the same clb more than once. Only *
201
- * update pin_done for a pin that hasn't been reached yet. */
202
- if (pin_done[ipin] == false ) {
203
- ifound++;
204
- pin_done[ipin] = true ;
205
- break ;
206
- }
207
- }
208
- }
209
- ipin++;
210
- }
211
- }
212
-
213
- VTR_ASSERT (ifound <= 1 );
214
186
215
- if (ifound < 1 ) {
187
+ if (net_pin_index == OPEN ) { /* If there is no legal net pin index associated with this sink node */
216
188
VPR_FATAL_ERROR (VPR_ERROR_ROUTE,
217
189
" in check_sink: node %d does not connect to any terminal of net %s #%lu.\n "
218
190
" This error is usually caused by incorrectly specified logical equivalence in your architecture file.\n "
219
191
" You should try to respecify what pins are equivalent or turn logical equivalence off.\n " ,
220
192
inode, cluster_ctx.clb_nlist .net_name (net_id).c_str (), size_t (net_id));
221
193
}
194
+
195
+ VTR_ASSERT (!pin_done[net_pin_index]); /* Should not have found a routed cnnection to it before */
196
+ pin_done[net_pin_index] = true ;
222
197
}
223
198
224
199
/* Checks that the node passed in is a valid source for this net. */
0 commit comments