@@ -80,6 +80,7 @@ static util::Cost_Entry get_wire_cost_entry(e_rr_type rr_type,
80
80
int to_layer_num);
81
81
82
82
static void compute_router_wire_lookahead (const std::vector<t_segment_inf>& segment_inf);
83
+
83
84
/* **
84
85
* @brief Compute the cost from pin to sinks of tiles - Compute the minimum cost to get to each tile sink from pins on the cluster
85
86
* @param intra_tile_pin_primitive_pin_delay
@@ -253,8 +254,7 @@ float MapLookahead::get_expected_cost_flat_router(RRNodeId current_node, RRNodeI
253
254
// Since we don't know which type of wires are accessible from an OPIN inside the cluster, we use
254
255
// distance_based_min_cost to get an estimation of the global cost, and then, add this cost to the tile_min_cost
255
256
// to have an estimation of the cost of getting into a cluster - We don't have any estimation of the cost to get out of the cluster
256
- int delta_x, delta_y;
257
- util::get_xy_deltas (current_node, target_node, &delta_x, &delta_y);
257
+ auto [delta_x, delta_y] = util::get_xy_deltas (current_node, target_node);
258
258
delta_x = abs (delta_x);
259
259
delta_y = abs (delta_y);
260
260
delay_cost = params.criticality * chann_distance_based_min_cost[rr_graph.node_layer (current_node)][to_layer_num][delta_x][delta_y].delay ;
@@ -285,8 +285,7 @@ float MapLookahead::get_expected_cost_flat_router(RRNodeId current_node, RRNodeI
285
285
delay_offset_cost = 0 .;
286
286
cong_offset_cost = 0 .;
287
287
} else {
288
- int delta_x, delta_y;
289
- util::get_xy_deltas (current_node, target_node, &delta_x, &delta_y);
288
+ auto [delta_x, delta_y] = util::get_xy_deltas (current_node, target_node);
290
289
delta_x = abs (delta_x);
291
290
delta_y = abs (delta_y);
292
291
delay_cost = params.criticality * chann_distance_based_min_cost[rr_graph.node_layer (current_node)][to_layer_num][delta_x][delta_y].delay ;
@@ -309,10 +308,9 @@ std::pair<float, float> MapLookahead::get_expected_delay_and_cong(RRNodeId from_
309
308
auto & device_ctx = g_vpr_ctx.device ();
310
309
auto & rr_graph = device_ctx.rr_graph ;
311
310
312
- int delta_x, delta_y;
313
311
int from_layer_num = rr_graph.node_layer (from_node);
314
312
int to_layer_num = rr_graph.node_layer (to_node);
315
- util::get_xy_deltas (from_node, to_node, &delta_x, &delta_y );
313
+ auto [delta_x, delta_y] = util::get_xy_deltas (from_node, to_node);
316
314
delta_x = abs (delta_x);
317
315
delta_y = abs (delta_y);
318
316
@@ -513,7 +511,6 @@ static void compute_router_wire_lookahead(const std::vector<t_segment_inf>& segm
513
511
// Profile each wire segment type
514
512
for (int from_layer_num = 0 ; from_layer_num < grid.get_num_layers (); from_layer_num++) {
515
513
for (const auto & segment_inf : segment_inf_vec) {
516
- std::map<t_rr_type, std::vector<RRNodeId>> sample_nodes;
517
514
std::vector<e_rr_type> chan_types;
518
515
if (segment_inf.parallel_axis == X_AXIS)
519
516
chan_types.push_back (CHANX);
@@ -547,10 +544,7 @@ static void compute_router_wire_lookahead(const std::vector<t_segment_inf>& segm
547
544
548
545
/* sets the lookahead cost map entries based on representative cost entries from routing_cost_map */
549
546
static void set_lookahead_map_costs (int from_layer_num, int segment_index, e_rr_type chan_type, util::t_routing_cost_map& routing_cost_map) {
550
- int chan_index = 0 ;
551
- if (chan_type == CHANY) {
552
- chan_index = 1 ;
553
- }
547
+ int chan_index = (chan_type == CHANX) ? 0 : 1 ;
554
548
555
549
/* set the lookahead cost map entries with a representative cost entry from routing_cost_map */
556
550
for (unsigned to_layer = 0 ; to_layer < routing_cost_map.dim_size (0 ); to_layer++) {
@@ -566,10 +560,7 @@ static void set_lookahead_map_costs(int from_layer_num, int segment_index, e_rr_
566
560
567
561
/* fills in missing lookahead map entries by copying the cost of the closest valid entry */
568
562
static void fill_in_missing_lookahead_entries (int segment_index, e_rr_type chan_type) {
569
- int chan_index = 0 ;
570
- if (chan_type == CHANY) {
571
- chan_index = 1 ;
572
- }
563
+ int chan_index = (chan_type == CHANX) ? 0 : 1 ;
573
564
574
565
auto & device_ctx = g_vpr_ctx.device ();
575
566
@@ -650,7 +641,7 @@ static util::Cost_Entry get_nearby_cost_entry_average_neighbour(int from_layer_n
650
641
int to_layer_num,
651
642
int segment_index,
652
643
int chan_index) {
653
- // Make sure that the given loaction doesn't have a valid entry
644
+ // Make sure that the given location doesn't have a valid entry
654
645
VTR_ASSERT (std::isnan (f_wire_cost_map[from_layer_num][chan_index][segment_index][to_layer_num][missing_dx][missing_dy].delay ));
655
646
VTR_ASSERT (std::isnan (f_wire_cost_map[from_layer_num][chan_index][segment_index][to_layer_num][missing_dx][missing_dy].congestion ));
656
647
0 commit comments