diff options
author | gatecat <gatecat@ds0.me> | 2021-03-04 10:24:59 +0000 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-03-04 10:29:36 +0000 |
commit | 5f6aaa2475774af2b0bd70f0bc013c975bcfe844 (patch) | |
tree | 2f01db1dcdca3733aded18be587326a006530be5 /common | |
parent | ebc2527368d920ea3c40a9ca83f73df242785044 (diff) | |
download | nextpnr-5f6aaa2475774af2b0bd70f0bc013c975bcfe844.tar.gz nextpnr-5f6aaa2475774af2b0bd70f0bc013c975bcfe844.tar.bz2 nextpnr-5f6aaa2475774af2b0bd70f0bc013c975bcfe844.zip |
timing: Use new engine in SA except for budget-based mode
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common')
-rw-r--r-- | common/placer1.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/common/placer1.cc b/common/placer1.cc index d57a841a..63e2f438 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -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) |