Skip to content

Commit c5a4a15

Browse files
rename ERROR_TOL to PL_INCREMENTAL_COST_TOLERANCE
1 parent 57ff88e commit c5a4a15

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

vpr/src/place/net_cost_handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,10 +1688,10 @@ void NetCostHandler::recompute_costs_from_scratch(const PlaceDelayModel* delay_m
16881688
auto check_and_print_cost = [](double new_cost,
16891689
double old_cost,
16901690
const std::string& cost_name) -> void {
1691-
if (!vtr::isclose(new_cost, old_cost, ERROR_TOL, 0.)) {
1691+
if (!vtr::isclose(new_cost, old_cost, PL_INCREMENTAL_COST_TOLERANCE, 0.)) {
16921692
std::string msg = vtr::string_fmt(
16931693
"in recompute_costs_from_scratch: new_%s = %g, old %s = %g, ERROR_TOL = %g\n",
1694-
cost_name.c_str(), new_cost, cost_name.c_str(), old_cost, ERROR_TOL);
1694+
cost_name.c_str(), new_cost, cost_name.c_str(), old_cost, PL_INCREMENTAL_COST_TOLERANCE);
16951695
VPR_ERROR(VPR_ERROR_PLACE, msg.c_str());
16961696
}
16971697
};

vpr/src/place/noc_place_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ void NocCostHandler::recompute_costs_from_scratch(const t_noc_opts& noc_opts, t_
374374
auto check_and_print_cost = [](double new_cost,
375375
double old_cost,
376376
const std::string& cost_name) -> void {
377-
if (!vtr::isclose(new_cost, old_cost, ERROR_TOL, 0.)) {
377+
if (!vtr::isclose(new_cost, old_cost, PL_INCREMENTAL_COST_TOLERANCE, 0.)) {
378378
std::string msg = vtr::string_fmt(
379379
"in recompute_costs_from_scratch: new_%s = %g, old %s = %g, ERROR_TOL = %g\n",
380-
cost_name.c_str(), new_cost, cost_name.c_str(), old_cost, ERROR_TOL);
380+
cost_name.c_str(), new_cost, cost_name.c_str(), old_cost, PL_INCREMENTAL_COST_TOLERANCE);
381381
VPR_ERROR(VPR_ERROR_PLACE, msg.c_str());
382382
}
383383
};

vpr/src/place/place.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ static void check_place(const t_placer_costs& costs,
19561956

19571957
if (noc_opts.noc) {
19581958
// check the NoC costs during placement if the user is using the NoC supported flow
1959-
error += noc_cost_handler->check_noc_placement_costs(costs, ERROR_TOL, noc_opts);
1959+
error += noc_cost_handler->check_noc_placement_costs(costs, PL_INCREMENTAL_COST_TOLERANCE, noc_opts);
19601960
// make sure NoC routing configuration does not create any cycles in CDG
19611961
error += (int)noc_cost_handler->noc_routing_has_cycle();
19621962
}
@@ -1984,7 +1984,7 @@ static int check_placement_costs(const t_placer_costs& costs,
19841984

19851985
double bb_cost_check = net_cost_handler.comp_bb_cost(e_cost_methods::CHECK);
19861986

1987-
if (fabs(bb_cost_check - costs.bb_cost) > costs.bb_cost * ERROR_TOL) {
1987+
if (fabs(bb_cost_check - costs.bb_cost) > costs.bb_cost * PL_INCREMENTAL_COST_TOLERANCE) {
19881988
VTR_LOG_ERROR(
19891989
"bb_cost_check: %g and bb_cost: %g differ in check_place.\n",
19901990
bb_cost_check, costs.bb_cost);
@@ -1994,7 +1994,7 @@ static int check_placement_costs(const t_placer_costs& costs,
19941994
if (place_algorithm.is_timing_driven()) {
19951995
comp_td_costs(delay_model, *criticalities, placer_state, &timing_cost_check);
19961996
//VTR_LOG("timing_cost recomputed from scratch: %g\n", timing_cost_check);
1997-
if (fabs(timing_cost_check - costs.timing_cost) > costs.timing_cost * ERROR_TOL) {
1997+
if (fabs(timing_cost_check - costs.timing_cost) > costs.timing_cost * PL_INCREMENTAL_COST_TOLERANCE) {
19981998
VTR_LOG_ERROR(
19991999
"timing_cost_check: %g and timing_cost: %g differ in check_place.\n",
20002000
timing_cost_check, costs.timing_cost);

vpr/src/place/place_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @brief The error tolerance due to round off for the total cost computation.
1919
* When we check it from scratch vs. incrementally. 0.01 means that there is a 1% error tolerance.
2020
*/
21-
constexpr double ERROR_TOL = .01;
21+
constexpr double PL_INCREMENTAL_COST_TOLERANCE = .01;
2222

2323
// forward declaration of t_placer_costs so that it can be used an argument
2424
// in NocCostTerms constructor

0 commit comments

Comments
 (0)