timing: Use new engine in SA except for budget-based mode

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-03-04 10:24:59 +00:00
parent ebc2527368
commit 5f6aaa2475

View File

@ -78,7 +78,7 @@ class SAPlacer
public:
SAPlacer(Context *ctx, Placer1Cfg cfg)
: ctx(ctx), fast_bels(ctx, /*check_bel_available=*/false, cfg.minBelsForGridPick), cfg(cfg)
: ctx(ctx), fast_bels(ctx, /*check_bel_available=*/false, cfg.minBelsForGridPick), cfg(cfg), tmg(ctx)
{
for (auto bel : ctx->getBels()) {
Loc loc = ctx->getBelLocation(bel);
@ -242,7 +242,7 @@ class SAPlacer
// Invoke timing analysis to obtain criticalities
if (!cfg.budgetBased)
get_criticalities(ctx, &net_crit);
tmg.setup();
// Calculate costs after initial placement
setup_costs();
@ -379,7 +379,7 @@ class SAPlacer
// Invoke timing analysis to obtain criticalities
if (!cfg.budgetBased && cfg.timing_driven)
get_criticalities(ctx, &net_crit);
tmg.run();
// Need to rebuild costs after criticalities change
setup_costs();
// Reset incremental bounds
@ -836,11 +836,9 @@ class SAPlacer
double delay = ctx->getDelayNS(ctx->predictDelay(net, net->users.at(user)));
return std::min(10.0, std::exp(delay - ctx->getDelayNS(net->users.at(user).budget) / 10));
} else {
auto crit = net_crit.find(net->name);
if (crit == net_crit.end() || crit->second.criticality.empty())
return 0;
float crit = tmg.get_criticality(CellPortKey(net->users.at(user)));
double delay = ctx->getDelayNS(ctx->predictDelay(net, net->users.at(user)));
return delay * std::pow(crit->second.criticality.at(user), crit_exp);
return delay * std::pow(crit, crit_exp);
}
}
@ -1216,9 +1214,6 @@ class SAPlacer
wirelen_t last_wirelen_cost, curr_wirelen_cost;
double last_timing_cost, curr_timing_cost;
// Criticality data from timing analysis
NetCriticalityMap net_crit;
Context *ctx;
float temp = 10;
float crit_exp = 8;
@ -1235,6 +1230,8 @@ class SAPlacer
bool require_legal = true;
const int legalise_dia = 4;
Placer1Cfg cfg;
TimingAnalyser tmg;
};
Placer1Cfg::Placer1Cfg(Context *ctx)