@@ -80,7 +80,7 @@ static bool check_pb_route_for_block(ClusterBlockId clb_id,
80
80
PB_route_error& err) {
81
81
err.reset ();
82
82
err.clb_id_ = clb_id;
83
- err.clbLoc_ = plCon.block_locs [clb_id];
83
+ err.clbLoc_ = plCon.block_locs () [clb_id];
84
84
85
85
const t_pb& clb = *clCon.clb_nlist .block_pb (clb_id);
86
86
VTR_ASSERT (clb.name );
@@ -260,7 +260,7 @@ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_li
260
260
* Deposit all the sides
261
261
*/
262
262
if (wanted_sides.empty ()) {
263
- for (e_side side : {TOP, BOTTOM, LEFT, RIGHT} ) {
263
+ for (e_side side : TOTAL_2D_SIDES ) {
264
264
wanted_sides.push_back (side);
265
265
}
266
266
}
@@ -309,55 +309,49 @@ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_li
309
309
ParentNetId routing_net_id = ParentNetId::INVALID ();
310
310
std::vector<RRNodeId> visited_rr_nodes;
311
311
short valid_routing_net_cnt = 0 ;
312
- int addToY = 0 , addToX = 0 ;
313
- addToY = physical_tile->height ;
314
- addToX = physical_tile->width ;
315
- for (int ix = 0 ; ix < addToX; ix++) {
316
- for (int iy = 0 ; iy < addToY; iy++) {
317
- for (const e_side& pin_side : pin_sides) {
318
- /* Find the net mapped to this pin in routing results */
319
- RRNodeId rr_node = node_lookup.find_node (coord_layer, coord_x + ix, coord_y + iy, rr_node_type, physical_pin, pin_side);
320
-
321
- /* Bypass invalid nodes, after that we must have a valid rr_node id */
322
- if (!rr_node) {
323
- continue ;
324
- }
325
- VTR_ASSERT ((size_t )rr_node < device_ctx.rr_graph .num_nodes ());
312
+ for (const e_side& pin_side : pin_sides) {
313
+ /* Find the net mapped to this pin in routing results */
314
+ RRNodeId rr_node = node_lookup.find_node (coord_layer, coord_x, coord_y, rr_node_type, physical_pin, pin_side);
326
315
327
- /* If the node has been visited on the other side, we just skip it */
328
- if (visited_rr_nodes.end () != std::find (visited_rr_nodes.begin (), visited_rr_nodes.end (), RRNodeId (rr_node))) {
329
- continue ;
330
- }
316
+ /* Bypass invalid nodes, after that we must have a valid rr_node id */
317
+ if (!rr_node) {
318
+ continue ;
319
+ }
320
+ VTR_ASSERT ((size_t )rr_node < device_ctx.rr_graph .num_nodes ());
331
321
332
- /* Get the cluster net id which has been mapped to this net
333
- * In general, there is only one valid rr_node among all the sides.
334
- * However, we have an exception in the Stratix-IV arch modeling,
335
- * where a pb_pin may exist in two different sides but
336
- * router will only map to 1 rr_node
337
- * Therefore, it is better to compare the routing nets
338
- * for all the sides and pick
339
- * - The unique valid net id (others should be all invalid)
340
- * assume that this pin is used by router
341
- * - A invalid net id (others should be all invalid as well)
342
- * assume that this pin is not used by router
343
- */
344
- if (rr_node_nets[rr_node]) {
345
- if (routing_net_id) {
346
- if (routing_net_id != rr_node_nets[rr_node]) {
347
- VTR_LOG_ERROR (" Pin '%s' is mapped to two nets: '%s' and '%s'\n " ,
348
- pb_graph_pin->to_string ().c_str (),
349
- net_list.net_name (routing_net_id).c_str (),
350
- net_list.net_name (rr_node_nets[rr_node]).c_str ());
351
- }
352
- VTR_ASSERT (routing_net_id == rr_node_nets[rr_node]);
353
- }
354
- routing_net_id = rr_node_nets[rr_node];
355
- valid_routing_net_cnt++;
356
- visited_rr_nodes.push_back (rr_node);
322
+ /* If the node has been visited on the other side, we just skip it */
323
+ if (visited_rr_nodes.end () != std::find (visited_rr_nodes.begin (), visited_rr_nodes.end (), RRNodeId (rr_node))) {
324
+ continue ;
325
+ }
326
+
327
+ /* Get the cluster net id which has been mapped to this net
328
+ * In general, there is only one valid rr_node among all the sides.
329
+ * However, we have an exception in the Stratix-IV arch modeling,
330
+ * where a pb_pin may exist in two different sides but
331
+ * router will only map to 1 rr_node
332
+ * Therefore, it is better to compare the routing nets
333
+ * for all the sides and pick
334
+ * - The unique valid net id (others should be all invalid)
335
+ * assume that this pin is used by router
336
+ * - A invalid net id (others should be all invalid as well)
337
+ * assume that this pin is not used by router
338
+ */
339
+ if (rr_node_nets[rr_node]) {
340
+ if (routing_net_id) {
341
+ if (routing_net_id != rr_node_nets[rr_node]) {
342
+ VTR_LOG_ERROR (" Pin '%s' is mapped to two nets: '%s' and '%s'\n " ,
343
+ pb_graph_pin->to_string ().c_str (),
344
+ net_list.net_name (routing_net_id).c_str (),
345
+ net_list.net_name (rr_node_nets[rr_node]).c_str ());
357
346
}
347
+ VTR_ASSERT (routing_net_id == rr_node_nets[rr_node]);
358
348
}
349
+ routing_net_id = rr_node_nets[rr_node];
350
+ valid_routing_net_cnt++;
351
+ visited_rr_nodes.push_back (rr_node);
359
352
}
360
353
}
354
+
361
355
VTR_ASSERT ((0 == valid_routing_net_cnt) || (1 == valid_routing_net_cnt));
362
356
363
357
/* Find the net mapped to this pin in clustering results*/
@@ -935,8 +929,7 @@ static void update_cluster_regular_routing_traces_with_post_routing_results(Atom
935
929
*/
936
930
VTR_ASSERT (sink_pb_route == sink_pb_pin_to_add->pin_count_in_cluster );
937
931
t_pb_graph_pin* new_sink_pb_pin_to_add = sink_pb_pin_to_add;
938
- // VTR_ASSERT(is_single_fanout_pb_pin(const_cast<const t_pb_graph_pin*>(new_sink_pb_pin_to_add)));
939
- VTR_ASSERT (new_sink_pb_pin_to_add->output_edges [0 ]->num_output_pins == 1 );
932
+ VTR_ASSERT (is_single_fanout_pb_pin (const_cast <const t_pb_graph_pin*>(new_sink_pb_pin_to_add)));
940
933
int new_driver_pb_pin = pb_graph_pin->pin_count_in_cluster ;
941
934
while (1 ) {
942
935
int new_sink_pb_route_id = new_sink_pb_pin_to_add->pin_count_in_cluster ;
@@ -1045,7 +1038,7 @@ static void update_cluster_regular_routing_traces_with_post_routing_results(Atom
1045
1038
for (int & sink_pb_route : new_pb_route.sink_pb_pin_ids ) {
1046
1039
usedItems.push_back (sink_pb_route);
1047
1040
}
1048
-
1041
+
1049
1042
VTR_LOGV (verbose,
1050
1043
" Remap clustered block '%s' routing trace[%d] to net '%s'\n " ,
1051
1044
clustering_ctx.clb_nlist .block_pb (blk_id)->name ,
@@ -1264,18 +1257,15 @@ void sync_netlists_to_routing(const Netlist<>& net_list,
1264
1257
clb_blk_id = convert_to_cluster_block_id (blk_id);
1265
1258
}
1266
1259
VTR_ASSERT (clb_blk_id != ClusterBlockId::INVALID ());
1267
- // vtr::Point<size_t> grid_coord(placement_ctx.block_locs[clb_blk_id].loc.x,
1268
- // placement_ctx.block_locs[clb_blk_id].loc.y);
1269
1260
1270
1261
if (seen_block_ids.insert (clb_blk_id).second ) {
1271
1262
update_cluster_pin_with_post_routing_results (net_list,
1272
1263
atom_ctx,
1273
1264
device_ctx,
1274
1265
clustering_ctx,
1275
1266
rr_node_nets,
1276
- placement_ctx.block_locs [clb_blk_id].loc ,
1267
+ placement_ctx.block_locs () [clb_blk_id].loc ,
1277
1268
clb_blk_id,
1278
- // placement_ctx.block_locs[clb_blk_id].loc.sub_tile,
1279
1269
num_mismatches,
1280
1270
verbose,
1281
1271
is_flat);
0 commit comments