aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-12-09 13:57:41 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:54 +0000
commitc926b273ded6e6d805ae66d1f9c5be8a85156ca8 (patch)
tree8d61debf19fa5ec4912fc3dfd90d3a4016bab6ad /common
parent23306c163f48250140ca770454cbe893630aad05 (diff)
downloadnextpnr-c926b273ded6e6d805ae66d1f9c5be8a85156ca8.tar.gz
nextpnr-c926b273ded6e6d805ae66d1f9c5be8a85156ca8.tar.bz2
nextpnr-c926b273ded6e6d805ae66d1f9c5be8a85156ca8.zip
placer1: Tweaks
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/placer1.cc9
-rw-r--r--common/timing.cc3
2 files changed, 7 insertions, 5 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index bf8ccd09..db10b7d3 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -507,7 +507,8 @@ class SAPlacer
std::vector<std::pair<CellInfo *, BelId>> dest_bels;
double delta = 0;
moveChange.reset();
- log_info("finding cells for chain swap %s\n", cell->name.c_str(ctx));
+ if (ctx->debug)
+ log_info("finding cells for chain swap %s\n", cell->name.c_str(ctx));
Loc baseLoc = ctx->getBelLocation(cell->bel);
discover_chain(baseLoc, cell, cell_rel);
@@ -530,7 +531,8 @@ class SAPlacer
return false;
dest_bels.emplace_back(std::make_pair(cr.first, targetBel));
}
- log_info("trying chain swap %s\n", cell->name.c_str(ctx));
+ if (ctx->debug)
+ log_info("trying chain swap %s\n", cell->name.c_str(ctx));
// <cell, oldBel>
for (const auto &db : dest_bels) {
BelId oldBel = swap_cell_bels(db.first, db.second);
@@ -553,7 +555,8 @@ class SAPlacer
// SA acceptance criterea
if (delta < 0 || (temp > 1e-8 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
n_accept++;
- log_info("accepted chain swap %s\n", cell->name.c_str(ctx));
+ if (ctx->debug)
+ log_info("accepted chain swap %s\n", cell->name.c_str(ctx));
} else {
goto swap_fail;
}
diff --git a/common/timing.cc b/common/timing.cc
index 2a0af874..17adc078 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -611,8 +611,7 @@ struct Timing
continue;
delay_t dmax = crit_path->at(ClockPair{startdomain.first, startdomain.first}).path_delay;
for (size_t i = 0; i < net->users.size(); i++) {
- float criticality =
- 1.0f - ((float(nc.slack.at(i)) - float(worst_slack.at(startdomain.first))) / dmax);
+ float criticality = 1.0f - (float(nc.slack.at(i) - worst_slack.at(startdomain.first)) / dmax);
nc.criticality.at(i) = std::min<double>(1.0, std::max<double>(0.0, criticality));
}
nc.max_path_length = nd.max_path_length;