timing: Use new engine in SA except for budget-based mode
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
ebc2527368
commit
5f6aaa2475
@ -78,7 +78,7 @@ class SAPlacer
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
SAPlacer(Context *ctx, Placer1Cfg cfg)
|
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()) {
|
for (auto bel : ctx->getBels()) {
|
||||||
Loc loc = ctx->getBelLocation(bel);
|
Loc loc = ctx->getBelLocation(bel);
|
||||||
@ -242,7 +242,7 @@ class SAPlacer
|
|||||||
|
|
||||||
// Invoke timing analysis to obtain criticalities
|
// Invoke timing analysis to obtain criticalities
|
||||||
if (!cfg.budgetBased)
|
if (!cfg.budgetBased)
|
||||||
get_criticalities(ctx, &net_crit);
|
tmg.setup();
|
||||||
|
|
||||||
// Calculate costs after initial placement
|
// Calculate costs after initial placement
|
||||||
setup_costs();
|
setup_costs();
|
||||||
@ -379,7 +379,7 @@ class SAPlacer
|
|||||||
|
|
||||||
// Invoke timing analysis to obtain criticalities
|
// Invoke timing analysis to obtain criticalities
|
||||||
if (!cfg.budgetBased && cfg.timing_driven)
|
if (!cfg.budgetBased && cfg.timing_driven)
|
||||||
get_criticalities(ctx, &net_crit);
|
tmg.run();
|
||||||
// Need to rebuild costs after criticalities change
|
// Need to rebuild costs after criticalities change
|
||||||
setup_costs();
|
setup_costs();
|
||||||
// Reset incremental bounds
|
// Reset incremental bounds
|
||||||
@ -836,11 +836,9 @@ class SAPlacer
|
|||||||
double delay = ctx->getDelayNS(ctx->predictDelay(net, net->users.at(user)));
|
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));
|
return std::min(10.0, std::exp(delay - ctx->getDelayNS(net->users.at(user).budget) / 10));
|
||||||
} else {
|
} else {
|
||||||
auto crit = net_crit.find(net->name);
|
float crit = tmg.get_criticality(CellPortKey(net->users.at(user)));
|
||||||
if (crit == net_crit.end() || crit->second.criticality.empty())
|
|
||||||
return 0;
|
|
||||||
double delay = ctx->getDelayNS(ctx->predictDelay(net, 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;
|
wirelen_t last_wirelen_cost, curr_wirelen_cost;
|
||||||
double last_timing_cost, curr_timing_cost;
|
double last_timing_cost, curr_timing_cost;
|
||||||
|
|
||||||
// Criticality data from timing analysis
|
|
||||||
NetCriticalityMap net_crit;
|
|
||||||
|
|
||||||
Context *ctx;
|
Context *ctx;
|
||||||
float temp = 10;
|
float temp = 10;
|
||||||
float crit_exp = 8;
|
float crit_exp = 8;
|
||||||
@ -1235,6 +1230,8 @@ class SAPlacer
|
|||||||
bool require_legal = true;
|
bool require_legal = true;
|
||||||
const int legalise_dia = 4;
|
const int legalise_dia = 4;
|
||||||
Placer1Cfg cfg;
|
Placer1Cfg cfg;
|
||||||
|
|
||||||
|
TimingAnalyser tmg;
|
||||||
};
|
};
|
||||||
|
|
||||||
Placer1Cfg::Placer1Cfg(Context *ctx)
|
Placer1Cfg::Placer1Cfg(Context *ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user