@@ -80,6 +80,7 @@ static util::Cost_Entry get_wire_cost_entry(e_rr_type rr_type,
8080 int to_layer_num);
8181
8282static void compute_router_wire_lookahead (const std::vector<t_segment_inf>& segment_inf);
83+
8384/* **
8485 * @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
8586 * @param intra_tile_pin_primitive_pin_delay
@@ -253,8 +254,7 @@ float MapLookahead::get_expected_cost_flat_router(RRNodeId current_node, RRNodeI
253254 // Since we don't know which type of wires are accessible from an OPIN inside the cluster, we use
254255 // distance_based_min_cost to get an estimation of the global cost, and then, add this cost to the tile_min_cost
255256 // 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);
258258 delta_x = abs (delta_x);
259259 delta_y = abs (delta_y);
260260 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
285285 delay_offset_cost = 0 .;
286286 cong_offset_cost = 0 .;
287287 } 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);
290289 delta_x = abs (delta_x);
291290 delta_y = abs (delta_y);
292291 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_
309308 auto & device_ctx = g_vpr_ctx.device ();
310309 auto & rr_graph = device_ctx.rr_graph ;
311310
312- int delta_x, delta_y;
313311 int from_layer_num = rr_graph.node_layer (from_node);
314312 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);
316314 delta_x = abs (delta_x);
317315 delta_y = abs (delta_y);
318316
@@ -513,7 +511,6 @@ static void compute_router_wire_lookahead(const std::vector<t_segment_inf>& segm
513511 // Profile each wire segment type
514512 for (int from_layer_num = 0 ; from_layer_num < grid.get_num_layers (); from_layer_num++) {
515513 for (const auto & segment_inf : segment_inf_vec) {
516- std::map<t_rr_type, std::vector<RRNodeId>> sample_nodes;
517514 std::vector<e_rr_type> chan_types;
518515 if (segment_inf.parallel_axis == X_AXIS)
519516 chan_types.push_back (CHANX);
@@ -547,10 +544,7 @@ static void compute_router_wire_lookahead(const std::vector<t_segment_inf>& segm
547544
548545/* sets the lookahead cost map entries based on representative cost entries from routing_cost_map */
549546static 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 ;
554548
555549 /* set the lookahead cost map entries with a representative cost entry from routing_cost_map */
556550 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_
566560
567561/* fills in missing lookahead map entries by copying the cost of the closest valid entry */
568562static 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 ;
573564
574565 auto & device_ctx = g_vpr_ctx.device ();
575566
@@ -650,7 +641,7 @@ static util::Cost_Entry get_nearby_cost_entry_average_neighbour(int from_layer_n
650641 int to_layer_num,
651642 int segment_index,
652643 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
654645 VTR_ASSERT (std::isnan (f_wire_cost_map[from_layer_num][chan_index][segment_index][to_layer_num][missing_dx][missing_dy].delay ));
655646 VTR_ASSERT (std::isnan (f_wire_cost_map[from_layer_num][chan_index][segment_index][to_layer_num][missing_dx][missing_dy].congestion ));
656647
0 commit comments