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; std::vector<std::pair<CellInfo *, BelId>> dest_bels;
double delta = 0; double delta = 0;
moveChange.reset(); 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); Loc baseLoc = ctx->getBelLocation(cell->bel);
discover_chain(baseLoc, cell, cell_rel); discover_chain(baseLoc, cell, cell_rel);
@ -530,7 +531,8 @@ class SAPlacer
return false; return false;
dest_bels.emplace_back(std::make_pair(cr.first, targetBel)); 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> // <cell, oldBel>
for (const auto &db : dest_bels) { for (const auto &db : dest_bels) {
BelId oldBel = swap_cell_bels(db.first, db.second); BelId oldBel = swap_cell_bels(db.first, db.second);
@ -553,7 +555,8 @@ class SAPlacer
// SA acceptance criterea // SA acceptance criterea
if (delta < 0 || (temp > 1e-8 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) { if (delta < 0 || (temp > 1e-8 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
n_accept++; 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 { } else {
goto swap_fail; goto swap_fail;
} }

View File

@ -611,8 +611,7 @@ struct Timing
continue; continue;
delay_t dmax = crit_path->at(ClockPair{startdomain.first, startdomain.first}).path_delay; delay_t dmax = crit_path->at(ClockPair{startdomain.first, startdomain.first}).path_delay;
for (size_t i = 0; i < net->users.size(); i++) { for (size_t i = 0; i < net->users.size(); i++) {
float criticality = float criticality = 1.0f - (float(nc.slack.at(i) - worst_slack.at(startdomain.first)) / dmax);
1.0f - ((float(nc.slack.at(i)) - float(worst_slack.at(startdomain.first))) / dmax);
nc.criticality.at(i) = std::min<double>(1.0, std::max<double>(0.0, criticality)); nc.criticality.at(i) = std::min<double>(1.0, std::max<double>(0.0, criticality));
} }
nc.max_path_length = nd.max_path_length; nc.max_path_length = nd.max_path_length;