@@ -134,6 +134,7 @@ static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder,
134
134
const int num_seg_types);
135
135
136
136
static int get_opin_direct_connections (RRGraphBuilder& rr_graph_builder,
137
+ const RRGraphView& rr_graph,
137
138
int x,
138
139
int y,
139
140
e_side side,
@@ -270,7 +271,8 @@ static std::vector<vtr::Matrix<int>> alloc_and_load_actual_fc(const std::vector<
270
271
const enum e_directionality directionality,
271
272
bool * Fc_clipped);
272
273
273
- static RRNodeId pick_best_direct_connect_target_rr_node (RRNodeId from_rr,
274
+ static RRNodeId pick_best_direct_connect_target_rr_node (const RRGraphView& rr_graph,
275
+ RRNodeId from_rr,
274
276
const std::vector<RRNodeId>& candidate_rr_nodes);
275
277
276
278
static void process_non_config_sets ();
@@ -1276,6 +1278,8 @@ static void build_bidir_rr_opins(RRGraphBuilder& rr_graph_builder,
1276
1278
const int num_directs,
1277
1279
const t_clb_to_clb_directs* clb_to_clb_directs,
1278
1280
const int num_seg_types) {
1281
+
1282
+ const auto & rr_graph = g_vpr_ctx.device ().rr_graph ;
1279
1283
// Don't connect pins which are not adjacent to channels around the perimeter
1280
1284
if ((i == 0 && side != RIGHT)
1281
1285
|| (i == int (grid.width () - 1 ) && side != LEFT)
@@ -1318,7 +1322,7 @@ static void build_bidir_rr_opins(RRGraphBuilder& rr_graph_builder,
1318
1322
}
1319
1323
1320
1324
/* Add in direct connections */
1321
- get_opin_direct_connections (rr_graph_builder, i, j, side, pin_index,
1325
+ get_opin_direct_connections (rr_graph_builder, rr_graph, i, j, side, pin_index,
1322
1326
node_index, rr_edges_to_create,
1323
1327
directs, num_directs, clb_to_clb_directs);
1324
1328
}
@@ -2486,6 +2490,8 @@ static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder,
2486
2490
* This routine adds the edges from opins to channels at the specified
2487
2491
* grid location (i,j) and grid tile side
2488
2492
*/
2493
+
2494
+ const auto & rr_graph = g_vpr_ctx.device ().rr_graph ;
2489
2495
*Fc_clipped = false ;
2490
2496
2491
2497
auto type = grid[i][j].type ;
@@ -2565,7 +2571,7 @@ static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder,
2565
2571
}
2566
2572
2567
2573
/* Add in direct connections */
2568
- get_opin_direct_connections (rr_graph_builder, i, j, side, pin_index, opin_node_index, rr_edges_to_create,
2574
+ get_opin_direct_connections (rr_graph_builder, rr_graph, i, j, side, pin_index, opin_node_index, rr_edges_to_create,
2569
2575
directs, num_directs, clb_to_clb_directs);
2570
2576
}
2571
2577
}
@@ -2681,6 +2687,7 @@ static t_clb_to_clb_directs* alloc_and_load_clb_to_clb_directs(const t_direct_in
2681
2687
* The current opin is located at (x,y) along the specified side
2682
2688
*/
2683
2689
static int get_opin_direct_connections (RRGraphBuilder& rr_graph_builder,
2690
+ const RRGraphView& rr_graph,
2684
2691
int x,
2685
2692
int y,
2686
2693
e_side side,
@@ -2782,7 +2789,7 @@ static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder,
2782
2789
// target ipin. We only need to connect to one of them (since the physical pins
2783
2790
// are logically equivalent). This also ensures the graphics look reasonable and map
2784
2791
// back fairly directly to the architecture file in the case of pin equivalence
2785
- RRNodeId inode = pick_best_direct_connect_target_rr_node (from_rr_node, inodes);
2792
+ RRNodeId inode = pick_best_direct_connect_target_rr_node (rr_graph, from_rr_node, inodes);
2786
2793
2787
2794
rr_edges_to_create.emplace_back (from_rr_node, inode, clb_to_clb_directs[i].switch_index );
2788
2795
++num_pins;
@@ -2896,7 +2903,8 @@ static std::vector<bool> alloc_and_load_perturb_opins(const t_physical_tile_type
2896
2903
return perturb_opins;
2897
2904
}
2898
2905
2899
- static RRNodeId pick_best_direct_connect_target_rr_node (RRNodeId from_rr,
2906
+ static RRNodeId pick_best_direct_connect_target_rr_node (const RRGraphView& rr_graph,
2907
+ RRNodeId from_rr,
2900
2908
const std::vector<RRNodeId>& candidate_rr_nodes) {
2901
2909
// With physically equivalent pins there may be multiple candidate rr nodes (which are equivalent)
2902
2910
// to connect the direct edge to.
@@ -2906,9 +2914,6 @@ static RRNodeId pick_best_direct_connect_target_rr_node(RRNodeId from_rr,
2906
2914
// candidate would be picked (i.e. to minimize the drawn edge length).
2907
2915
//
2908
2916
// This function attempts to pick the 'best/closest' of the candidates.
2909
- auto & device_ctx = g_vpr_ctx.device ();
2910
- const auto & rr_graph = device_ctx.rr_graph ;
2911
-
2912
2917
VTR_ASSERT (rr_graph.node_type (from_rr) == OPIN);
2913
2918
2914
2919
float best_dist = std::numeric_limits<float >::infinity ();
0 commit comments