placer1: Tweaks

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-12-09 13:57:41 +00:00 committed by David Shah
parent 23306c163f
commit c926b273de
2 changed files with 7 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;