@@ -319,10 +319,10 @@ std::pair<float, float> MapLookahead::get_expected_delay_and_cong(RRNodeId from_
319319
320320 e_rr_type from_type = rr_graph.node_type (from_node);
321321 if (from_type == e_rr_type::SOURCE || from_type == e_rr_type::OPIN) {
322- // When estimating costs from a SOURCE/OPIN we look-up to find which wire types (and the
323- // cost to reach them) in src_opin_delays. Once we know what wire types are
324- // reachable, we query the f_wire_cost_map (i.e. the wire lookahead) to get the final
325- // delay to reach the sink.
322+ // When estimating costs from a SOURCE/OPIN we look-up to find which wire types (and the
323+ // cost to reach them) in src_opin_delays. Once we know what wire types are
324+ // reachable, we query the f_wire_cost_map (i.e. the wire lookahead) to get the final
325+ // delay to reach the sink.
326326
327327 t_physical_tile_type_ptr from_tile_type = device_ctx.grid .get_physical_type ({rr_graph.node_xlow (from_node),
328328 rr_graph.node_ylow (from_node),
@@ -335,7 +335,7 @@ std::pair<float, float> MapLookahead::get_expected_delay_and_cong(RRNodeId from_
335335 // get_cost_from_src_opin iterates over all routing segments passed to it (the first argument) and returns
336336 // the minimum cost among them. In the following for loop, we iterate over each layer and pass it the
337337 // routing segments on that layer reachable from the OPIN/SOURCE to segments on that layer. This for loop then calculates and returns
338- // the minimum cost from the given OPIN/SOURCE to the specified SINK considering routing options across all layers.
338+ // the minimum cost from the given OPIN/SOURCE to the specified SINK considering routing options across all layers.
339339 for (size_t layer_num = 0 ; layer_num < device_ctx.grid .get_num_layers (); layer_num++) {
340340 const auto [this_delay_cost, this_cong_cost] = util::get_cost_from_src_opin (src_opin_delays[from_layer_num][from_tile_index][from_ptc][layer_num],
341341 delta_x,
@@ -389,6 +389,9 @@ std::pair<float, float> MapLookahead::get_expected_delay_and_cong(RRNodeId from_
389389 delta_y,
390390 to_layer_num);
391391
392+ expected_delay_cost = cost_entry.delay * params.criticality ;
393+ expected_cong_cost = cost_entry.congestion * (1 - params.criticality );
394+
392395 VTR_ASSERT_SAFE_MSG (std::isfinite (expected_delay_cost),
393396 vtr::string_fmt (" Lookahead failed to estimate cost from %s: %s" ,
394397 rr_node_arch_name (from_node, is_flat_).c_str (),
@@ -399,8 +402,6 @@ std::pair<float, float> MapLookahead::get_expected_delay_and_cong(RRNodeId from_
399402 is_flat_)
400403 .c_str ())
401404 .c_str ());
402- expected_delay_cost = cost_entry.delay * params.criticality ;
403- expected_cong_cost = cost_entry.congestion * (1 - params.criticality );
404405 } else if (from_type == e_rr_type::IPIN) { // Change if you're allowing route-throughs
405406 return std::make_pair (0 ., device_ctx.rr_indexed_data [RRIndexedDataId (SINK_COST_INDEX)].base_cost );
406407 } else { // Change this if you want to investigate route-throughs
0 commit comments