Skip to content

Congestion-Aware Initial Accumulated Cost #3031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f76808d
enum class e_route_type
soheilshahrouz May 1, 2025
a9435b4
add estimate_routing_chann_util()
soheilshahrouz May 1, 2025
6a03592
add set_estimated_routing_util()
soheilshahrouz May 2, 2025
823c1a0
add empty() to prefix sum class
soheilshahrouz May 2, 2025
3208425
const reference
soheilshahrouz May 2, 2025
f28832e
add chan_util_threshold and congestion_weight arguments to set_estima…
soheilshahrouz May 2, 2025
b68b529
implemented channel congestion factoring in map lookahead
soheilshahrouz May 2, 2025
93b1d03
call set_estimated_routing_util() at the end of placement
soheilshahrouz May 2, 2025
177f73c
add cmd line options for router lookahead congestion related params
soheilshahrouz May 2, 2025
0c148d7
correct x_factor in congestion estimate of map lookahead
soheilshahrouz May 2, 2025
21add30
initialize acc_cost based on post-placement channel util estimate
soheilshahrouz May 6, 2025
30e0796
initialize chan_util_weight and chan_util_threshold with some cmd lin…
soheilshahrouz May 6, 2025
38e748f
init acc_cost with channel util info only if such info is availale
soheilshahrouz May 7, 2025
808b2ef
Merge branch 'master' into temp_lookahead_chan_cong
soheilshahrouz May 10, 2025
133c3de
document empty() method for prefix sum classes
soheilshahrouz May 10, 2025
56e8ee5
move t_rr_node_route_inf from vpr_types.h to rr_node_types.h
soheilshahrouz May 10, 2025
d6a8222
add doxygen comment for NetCostHandler::estimate_routing_chann_util()
soheilshahrouz May 10, 2025
dcf76f2
remove dead code in Placer::copy_locs_to_global_state()
soheilshahrouz May 10, 2025
83813fa
move chan_util_threshold and chan_util_weight from routing context to…
soheilshahrouz May 10, 2025
3ca5542
remove changes made to routerlookahead
soheilshahrouz May 10, 2025
c36bfb9
make format
soheilshahrouz May 10, 2025
49c0c98
make get_adjusted_rr_position() static again
soheilshahrouz May 10, 2025
167d8da
macro --> static constexpr
soheilshahrouz May 10, 2025
468be05
Merge branch 'master' into temp_lookahead_chan_cong and resolve confi…
soheilshahrouz May 12, 2025
9d64010
add calculate_channel_width() that computes channel width by iteratin…
soheilshahrouz May 12, 2025
7d86ca1
handle 3d architectures in calculate_channel_width() by adding anothe…
soheilshahrouz May 12, 2025
bd716ad
NetCostHandler::estimate_routing_chann_util() return 3-d matrices but…
soheilshahrouz May 12, 2025
80a85af
compute estimated wl for each channel when per-layer bb is used
soheilshahrouz May 13, 2025
bdfec62
initialize acc_cost for rr nodes on all layers
soheilshahrouz May 13, 2025
de05313
use calcualted channel width for post-placement channel util estimate
soheilshahrouz May 13, 2025
8d40d73
make format
soheilshahrouz May 13, 2025
42509b0
fix compilation warnings
soheilshahrouz May 16, 2025
d8abda9
add doxygen comments
soheilshahrouz May 16, 2025
a392361
add help message for --router_initial_acc_cost_chan_congestion_thresh…
soheilshahrouz May 16, 2025
bb55021
set default values for --router_initial_acc_cost_chan_congestion_weig…
soheilshahrouz May 16, 2025
a1b76f5
Merge branch 'master' into temp_lookahead_chan_cong
soheilshahrouz May 19, 2025
44dbc4f
Merge branch 'master' into temp_lookahead_chan_cong
soheilshahrouz May 20, 2025
08507dc
pragma once instead header guards
soheilshahrouz May 20, 2025
a2dc76c
remove clock_fwd.h
soheilshahrouz May 20, 2025
079e8c1
Merge remote-tracking branch 'origin/master' into temp_lookahead_chan…
soheilshahrouz May 27, 2025
f5c866a
incerement channel width counters by node capacity
soheilshahrouz May 27, 2025
af7950c
rename estimate_routing_chann_util(() to estimate_routing_chan_util()
soheilshahrouz May 27, 2025
bc7f9d1
doxygen comment for `e_route_type` and improve comments for NetCostHa…
soheilshahrouz May 27, 2025
20dd3f8
doxygen comment for `t_rr_rc_data`
soheilshahrouz May 27, 2025
26e1017
move `t_rr_node_route_inf` from rr_node_type.h to route_commmon.h
soheilshahrouz May 27, 2025
0837e07
make format
soheilshahrouz May 27, 2025
27553a7
Merge remote-tracking branch 'origin/master' into temp_lookahead_chan…
soheilshahrouz May 28, 2025
9e41b34
fix compilation error when server feature is enabled
soheilshahrouz May 28, 2025
546980b
fix compilation error on savi3
soheilshahrouz May 28, 2025
7fff850
fix remaining compiliation errors on savi3
soheilshahrouz May 28, 2025
9a1ef9d
rename copy_locs_to_global_state() to update_global_state()
soheilshahrouz Jun 1, 2025
d7d189b
add comment to comp_initial_acc_cost()
soheilshahrouz Jun 3, 2025
7bb3401
Merge branch 'master' into temp_lookahead_chan_cong
soheilshahrouz Jun 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libs/librrgraph/src/base/check_rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void check_rr_graph(const RRGraphView& rr_graph,
const t_chan_width& chan_width,
const e_graph_type graph_type,
bool is_flat) {
e_route_type route_type = DETAILED;
e_route_type route_type = e_route_type::DETAILED;
if (graph_type == e_graph_type::GLOBAL) {
route_type = GLOBAL;
route_type = e_route_type::GLOBAL;
}

auto total_edges_to_node = std::vector<int>(rr_graph.num_nodes());
Expand Down Expand Up @@ -420,7 +420,7 @@ void check_rr_node(const RRGraphView& rr_graph,
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
"in check_rr_node: CHANX out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
}
if (route_type == GLOBAL && xlow != xhigh) {
if (route_type == e_route_type::GLOBAL && xlow != xhigh) {
VPR_ERROR(VPR_ERROR_ROUTE,
"in check_rr_node: node %d spans multiple channel segments (not allowed for global routing).\n", inode);
}
Expand All @@ -431,7 +431,7 @@ void check_rr_node(const RRGraphView& rr_graph,
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
"Error in check_rr_node: CHANY out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
}
if (route_type == GLOBAL && ylow != yhigh) {
if (route_type == e_route_type::GLOBAL && ylow != yhigh) {
VPR_ERROR(VPR_ERROR_ROUTE,
"in check_rr_node: node %d spans multiple channel segments (not allowed for global routing).\n", inode);
}
Expand Down Expand Up @@ -480,7 +480,7 @@ void check_rr_node(const RRGraphView& rr_graph,

case e_rr_type::CHANX:
case e_rr_type::CHANY:
if (route_type == DETAILED) {
if (route_type == e_route_type::DETAILED) {
nodes_per_chan = chan_width.max;
tracks_per_node = 1;
} else {
Expand Down
3 changes: 2 additions & 1 deletion libs/librrgraph/src/base/rr_graph_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ struct t_chan_width {
std::vector<int> y_list;
};

enum e_route_type {
/// @brief Specifies whether global routing or combined global and detailed routing is performed.
enum class e_route_type {
GLOBAL,
DETAILED
};
Expand Down
8 changes: 4 additions & 4 deletions libs/librrgraph/src/base/rr_node_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ typedef vtr::Range<edge_idx_iterator> edge_idx_range;

typedef std::vector<std::map<int, int>> t_arch_switch_fanin;

/*
* Resistance/Capacitance data for an RR Nodes
/**
* @brief Resistance/Capacitance data for an RR Node.
*
* In practice many RR nodes have the same values, so they are fly-weighted
* to keep t_rr_node small. Each RR node holds an rc_index which allows
Expand All @@ -121,8 +121,8 @@ typedef std::vector<std::map<int, int>> t_arch_switch_fanin;
struct t_rr_rc_data {
t_rr_rc_data(float Rval, float Cval) noexcept;

float R;
float C;
float R; ///< Resistance to go through an RR node
float C; ///< Total capacitance of an RR node.
};

// This is the data type of fast lookups of an rr-node given an (rr_type, layer, x, y, and the side)
Expand Down
4 changes: 2 additions & 2 deletions libs/librrgraph/src/base/rr_rc_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "rr_node_types.h"

/*
* Returns the index to a t_rr_rc_data matching the specified values.
/**
* @brief Returns the index to a t_rr_rc_data matching the specified values.
*
* If an existing t_rr_rc_data matches the specified R/C it's index
* is returned, otherwise the t_rr_rc_data is created.
Expand Down
4 changes: 2 additions & 2 deletions libs/libvtrutil/src/vtr_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
*
* Note that to avoid 'unused' variable warnings when assertions are
* disabled, we pass the expr and msg to sizeof(). We use sizeof specifically
* since it accepts expressions, and the C++ standard gaurentees sizeof's arguments
* since it accepts expressions, and the C++ standard guarantees sizeof's arguments
* are never evaluated (ensuring any expensive expressions are not evaluated when
* assertions are disabled). To avoid warnings about the unused result of sizeof()
* we cast it to void.
Expand Down Expand Up @@ -140,7 +140,7 @@ namespace assert {
* function will never return. This should ensure the
* compiler won't warn about detected conditions such as
* dead-code or potential null pointer dereferences
* which are gaurded against by assertions.
* which are guarded against by assertions.
*/
[[noreturn]] void handle_assert(const char* expr, const char* file, unsigned int line, const char* function, const char* msg);
} // namespace assert
Expand Down
10 changes: 10 additions & 0 deletions libs/libvtrutil/src/vtr_prefix_sum.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class PrefixSum1D {
return prefix_sum_[upper_x + 1] - prefix_sum_[lower_x];
}

/// @brief Checks if the prefix sum is initialized or it is empty.
bool empty() const {
return prefix_sum_.empty();
}

private:
/**
* @brief The 1D prefix sum of the original array of values.
Expand Down Expand Up @@ -268,6 +273,11 @@ class PrefixSum2D {
+ prefix_sum_[lower_x][lower_y];
}

/// @brief Checks if the prefix sum is initialized or it is empty.
bool empty() const {
return prefix_sum_.empty();
}

private:
/**
* @brief The 2D prefix sum of the original grid of values.
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/detailed_placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void AnnealerDetailedPlacer::optimize_placement() {
placer_->place();

// Copy the placement solution into the global placement solution.
placer_->copy_locs_to_global_state(g_vpr_ctx.mutable_placement());
placer_->update_global_state();

// Since the placement was modified, need to resynchronize the pins in the
// clusters.
Expand Down
6 changes: 3 additions & 3 deletions vpr/src/base/CheckSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void CheckSetup(const t_packer_opts& packer_opts,
}
}

if ((GLOBAL == router_opts.route_type)
&& (placer_opts.place_algorithm.is_timing_driven())) {
if (e_route_type::GLOBAL == router_opts.route_type
&& placer_opts.place_algorithm.is_timing_driven()) {
/* Works, but very weird. Can't optimize timing well, since you're
* not doing proper architecture delay modelling. */
VTR_LOG_WARN(
Expand Down Expand Up @@ -100,7 +100,7 @@ void CheckSetup(const t_packer_opts& packer_opts,
}
}

if (DETAILED == router_opts.route_type) {
if (e_route_type::DETAILED == router_opts.route_type) {
if ((chans.chan_x_dist.type != UNIFORM)
|| (chans.chan_y_dist.type != UNIFORM)) {
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
Expand Down
3 changes: 3 additions & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
RouterOpts->router_debug_sink_rr = Options.router_debug_sink_rr;
RouterOpts->router_debug_iteration = Options.router_debug_iteration;
RouterOpts->lookahead_type = Options.router_lookahead_type;
RouterOpts->initial_acc_cost_chan_congestion_threshold = Options.router_initial_acc_cost_chan_congestion_threshold;
RouterOpts->initial_acc_cost_chan_congestion_weight = Options.router_initial_acc_cost_chan_congestion_weight;

RouterOpts->max_convergence_count = Options.router_max_convergence_count;
RouterOpts->reconvergence_cpd_threshold = Options.router_reconvergence_cpd_threshold;
RouterOpts->initial_timing = Options.router_initial_timing;
Expand Down
30 changes: 15 additions & 15 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ static void ShowAnnealSched(const t_annealing_sched& AnnealSched) {
static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.route_type: ");
switch (RouterOpts.route_type) {
case GLOBAL:
case e_route_type::GLOBAL:
VTR_LOG("GLOBAL\n");
break;
case DETAILED:
case e_route_type::DETAILED:
VTR_LOG("DETAILED\n");
break;
default:
Expand All @@ -248,7 +248,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("off\n");
}

VTR_ASSERT(GLOBAL == RouterOpts.route_type || DETAILED == RouterOpts.route_type);
VTR_ASSERT(e_route_type::GLOBAL == RouterOpts.route_type || e_route_type::DETAILED == RouterOpts.route_type);

VTR_LOG("RouterOpts.router_algorithm: ");
switch (RouterOpts.router_algorithm) {
Expand All @@ -266,9 +266,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
break;
default:
switch (RouterOpts.route_type) {
case DETAILED:
case e_route_type::DETAILED:
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "<Unknown>\n");
case GLOBAL:
case e_route_type::GLOBAL:
VTR_LOG_ERROR("Unknown router algorithm\n");
break;
default:
Expand All @@ -282,31 +282,31 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("DELAY_NORMALIZED\n");
break;
case DELAY_NORMALIZED_LENGTH:
if (GLOBAL == RouterOpts.route_type) {
if (e_route_type::GLOBAL == RouterOpts.route_type) {
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
}

VTR_LOG("DELAY_NORMALIZED_LENGTH\n");
break;
case DELAY_NORMALIZED_LENGTH_BOUNDED:
if (GLOBAL == RouterOpts.route_type) {
if (e_route_type::GLOBAL == RouterOpts.route_type) {
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
}

VTR_LOG("DELAY_NORMALIZED_LENGTH_BOUNDED\n");
break;
case DELAY_NORMALIZED_FREQUENCY:
if (GLOBAL == RouterOpts.route_type) {
if (e_route_type::GLOBAL == RouterOpts.route_type) {
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
}

VTR_LOG("DELAY_NORMALIZED_FREQUENCY\n");
break;
case DELAY_NORMALIZED_LENGTH_FREQUENCY:
if (GLOBAL == RouterOpts.route_type) {
if (e_route_type::GLOBAL == RouterOpts.route_type) {
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
}
Expand All @@ -317,7 +317,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("DEMAND_ONLY\n");
break;
case DEMAND_ONLY_NORMALIZED_LENGTH:
if (GLOBAL == RouterOpts.route_type) {
if (e_route_type::GLOBAL == RouterOpts.route_type) {
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
}
Expand All @@ -326,9 +326,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
break;
default:
switch (RouterOpts.route_type) {
case DETAILED:
case e_route_type::DETAILED:
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "Unknown base_cost_type\n");
case GLOBAL:
case e_route_type::GLOBAL:
VTR_LOG_ERROR("Unknown router base cost type\n");
break;
default:
Expand All @@ -343,7 +343,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("%d\n", RouterOpts.fixed_channel_width);
}

if (DETAILED == RouterOpts.route_type) {
if (e_route_type::DETAILED == RouterOpts.route_type) {
VTR_LOG("RouterOpts.check_route: ");
switch (RouterOpts.check_route) {
case e_check_route_option::OFF:
Expand Down Expand Up @@ -389,7 +389,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.max_criticality: %f\n", RouterOpts.max_criticality);
VTR_LOG("RouterOpts.init_wirelength_abort_threshold: %f\n", RouterOpts.init_wirelength_abort_threshold);

if (GLOBAL == RouterOpts.route_type)
if (e_route_type::GLOBAL == RouterOpts.route_type)
VTR_LOG("RouterOpts.incr_reroute_delay_ripup: %f\n", RouterOpts.incr_reroute_delay_ripup);
else {
std::string incr_delay_ripup_opts[3] = {"ON", "OFF", "AUTO"};
Expand Down Expand Up @@ -468,7 +468,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
}
}

if (DETAILED == RouterOpts.route_type) {
if (e_route_type::DETAILED == RouterOpts.route_type) {
if (RouterOpts.routing_failure_predictor == SAFE)
VTR_LOG("RouterOpts.routing_failure_predictor = SAFE\n");
else if (RouterOpts.routing_failure_predictor == AGGRESSIVE)
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/globals.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "globals.h"
#include "route_common.h"

VprContext g_vpr_ctx;
1 change: 1 addition & 0 deletions vpr/src/base/old_traceback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "clustered_netlist_fwd.h"
#include "globals.h"
#include "vtr_assert.h"
#include "route_common.h"

#include <vector>

Expand Down
8 changes: 4 additions & 4 deletions vpr/src/base/place_and_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,

/* Allocate the major routing structures. */

if (router_opts.route_type == GLOBAL) {
if (router_opts.route_type == e_route_type::GLOBAL) {
graph_type = e_graph_type::GLOBAL;
graph_directionality = e_graph_type::BIDIR;
} else {
Expand Down Expand Up @@ -376,8 +376,8 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,

init_draw_coords(final, g_vpr_ctx.placement().blk_loc_registry());

/* Allocate and load additional rr_graph information needed only by the router. */
alloc_and_load_rr_node_route_structs();
// Allocate and load additional rr_graph information needed only by the router.
alloc_and_load_rr_node_route_structs(router_opts);

init_route_structs(router_net_list,
router_opts.bb_factor,
Expand Down Expand Up @@ -424,7 +424,7 @@ t_chan_width setup_chan_width(const t_router_opts& router_opts,
width_fac = router_opts.fixed_channel_width;
}

if (router_opts.route_type == GLOBAL) {
if (router_opts.route_type == e_route_type::GLOBAL) {
graph_directionality = e_graph_type::BIDIR;
} else {
graph_directionality = e_graph_type::UNIDIR;
Expand Down
30 changes: 22 additions & 8 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ struct ParseRouteType {
ConvertedValue<e_route_type> from_str(const std::string& str) {
ConvertedValue<e_route_type> conv_value;
if (str == "global")
conv_value.set_value(GLOBAL);
conv_value.set_value(e_route_type::GLOBAL);
else if (str == "detailed")
conv_value.set_value(DETAILED);
conv_value.set_value(e_route_type::DETAILED);
else {
std::stringstream msg;
msg << "Invalid conversion from '" << str << "' to e_router_algorithm (expected one of: " << argparse::join(default_choices(), ", ") << ")";
Expand All @@ -445,10 +445,10 @@ struct ParseRouteType {

ConvertedValue<std::string> to_str(e_route_type val) {
ConvertedValue<std::string> conv_value;
if (val == GLOBAL)
if (val == e_route_type::GLOBAL)
conv_value.set_value("global");
else {
VTR_ASSERT(val == DETAILED);
VTR_ASSERT(val == e_route_type::DETAILED);
conv_value.set_value("detailed");
}
return conv_value;
Expand Down Expand Up @@ -2895,6 +2895,20 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("map")
.show_in(argparse::ShowIn::HELP_ONLY);

route_timing_grp.add_argument<double>(args.router_initial_acc_cost_chan_congestion_threshold, "--router_initial_acc_cost_chan_congestion_threshold")
.help("Utilization threshold above which initial accumulated routing cost (acc_cost) "
"is increased to penalize congested channels. Used to bias routing away from "
"highly utilized regions during early routing iterations.")
.default_value("0.5")
.show_in(argparse::ShowIn::HELP_ONLY);

route_timing_grp.add_argument<double>(args.router_initial_acc_cost_chan_congestion_weight, "--router_initial_acc_cost_chan_congestion_weight")
.help("Weight applied to the excess channel utilization (above threshold) "
"when computing the initial accumulated cost (acc_cost)of routing resources. "
"Higher values make the router more sensitive to early congestion.")
.default_value("0.5")
.show_in(argparse::ShowIn::HELP_ONLY);

route_timing_grp.add_argument(args.router_max_convergence_count, "--router_max_convergence_count")
.help(
"Controls how many times the router is allowed to converge to a legal routing before halting."
Expand Down Expand Up @@ -3429,25 +3443,25 @@ void set_conditional_defaults(t_options& args) {
*/
//Base cost type
if (args.base_cost_type.provenance() != Provenance::SPECIFIED) {
if (args.RouteType == DETAILED) {
if (args.RouteType == e_route_type::DETAILED) {
if (args.timing_analysis) {
args.base_cost_type.set(DELAY_NORMALIZED_LENGTH, Provenance::INFERRED);
} else {
args.base_cost_type.set(DEMAND_ONLY_NORMALIZED_LENGTH, Provenance::INFERRED);
}
} else {
VTR_ASSERT(args.RouteType == GLOBAL);
VTR_ASSERT(args.RouteType == e_route_type::GLOBAL);
//Global RR graphs don't have valid timing, so use demand base cost
args.base_cost_type.set(DEMAND_ONLY_NORMALIZED_LENGTH, Provenance::INFERRED);
}
}

//Bend cost
if (args.bend_cost.provenance() != Provenance::SPECIFIED) {
if (args.RouteType == GLOBAL) {
if (args.RouteType == e_route_type::GLOBAL) {
args.bend_cost.set(1., Provenance::INFERRED);
} else {
VTR_ASSERT(args.RouteType == DETAILED);
VTR_ASSERT(args.RouteType == e_route_type::DETAILED);
args.bend_cost.set(0., Provenance::INFERRED);
}
}
Expand Down
Loading