diff options
author | gatecat <gatecat@ds0.me> | 2021-03-09 08:48:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 08:48:12 +0000 |
commit | 326b34887cdf82dc834382f4bf35d120bd4173dd (patch) | |
tree | bb346955c661bf96b51e309a3f1030c27ac1bb07 /common/placer_heap.cc | |
parent | 0f17e80eef2a4c0e417b65efa559481f83831f00 (diff) | |
parent | 8a4bf3a7805080db2c8f2e797a0f12aad7c99f5d (diff) | |
download | nextpnr-326b34887cdf82dc834382f4bf35d120bd4173dd.tar.gz nextpnr-326b34887cdf82dc834382f4bf35d120bd4173dd.tar.bz2 nextpnr-326b34887cdf82dc834382f4bf35d120bd4173dd.zip |
Merge pull request #609 from YosysHQ/gatecat/sta-v2
Use new timing engine for criticality
Diffstat (limited to 'common/placer_heap.cc')
-rw-r--r-- | common/placer_heap.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc index eb931a37..3ee8503c 100644 --- a/common/placer_heap.cc +++ b/common/placer_heap.cc @@ -139,9 +139,12 @@ template <typename T> struct EquationSystem class HeAPPlacer { public: - HeAPPlacer(Context *ctx, PlacerHeapCfg cfg) : ctx(ctx), cfg(cfg), fast_bels(ctx, /*check_bel_available=*/true, -1) + HeAPPlacer(Context *ctx, PlacerHeapCfg cfg) + : ctx(ctx), cfg(cfg), fast_bels(ctx, /*check_bel_available=*/true, -1), tmg(ctx) { Eigen::initParallel(); + tmg.setup_only = true; + tmg.setup(); } bool place() @@ -269,7 +272,7 @@ class HeAPPlacer // Update timing weights if (cfg.timing_driven) - get_criticalities(ctx, &net_crit); + tmg.run(); if (legal_hpwl < best_hpwl) { best_hpwl = legal_hpwl; @@ -355,6 +358,8 @@ class HeAPPlacer FastBels fast_bels; std::unordered_map<IdString, std::tuple<int, int>> bel_types; + TimingAnalyser tmg; + struct BoundingBox { // Actual bounding box @@ -392,8 +397,6 @@ class HeAPPlacer // Performance counting double solve_time = 0, cl_time = 0, sl_time = 0; - NetCriticalityMap net_crit; - // Place cells with the BEL attribute set to constrain them void place_constraints() { @@ -736,11 +739,9 @@ class HeAPPlacer std::max<double>(1, (yaxis ? cfg.hpwl_scale_y : cfg.hpwl_scale_x) * std::abs(o_pos - this_pos))); - if (user_idx != -1 && net_crit.count(ni->name)) { - auto &nc = net_crit.at(ni->name); - if (user_idx < int(nc.criticality.size())) - weight *= (1.0 + cfg.timingWeight * - std::pow(nc.criticality.at(user_idx), cfg.criticalityExponent)); + if (user_idx != -1) { + weight *= (1.0 + cfg.timingWeight * std::pow(tmg.get_criticality(CellPortKey(port)), + cfg.criticalityExponent)); } // If cell 0 is not fixed, it will stamp +w on its equation and -w on the other end's equation, |