From 5f6aaa2475774af2b0bd70f0bc013c975bcfe844 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 4 Mar 2021 10:24:59 +0000 Subject: [PATCH] timing: Use new engine in SA except for budget-based mode Signed-off-by: gatecat --- common/placer1.cc | 17 +++++++---------- 1 file 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)