From 8d9390fc460bf98932afa5ef8362f932b48cf744 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 29 Jan 2021 11:11:05 -0800 Subject: Fix regression in use of FastBels. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/placer_heap.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'common/placer_heap.cc') diff --git a/common/placer_heap.cc b/common/placer_heap.cc index cc9f5c36..00700388 100644 --- a/common/placer_heap.cc +++ b/common/placer_heap.cc @@ -138,7 +138,7 @@ template struct EquationSystem class HeAPPlacer { public: - HeAPPlacer(Context *ctx, PlacerHeapCfg cfg) : ctx(ctx), cfg(cfg), fast_bels(ctx, -1) { Eigen::initParallel(); } + HeAPPlacer(Context *ctx, PlacerHeapCfg cfg) : ctx(ctx), cfg(cfg), fast_bels(ctx, /*check_bel_available=*/true, -1) { Eigen::initParallel(); } bool place() { @@ -146,7 +146,7 @@ class HeAPPlacer ctx->lock(); place_constraints(); - setup_grid(); + build_fast_bels(); seed_placement(); update_all_chains(); wirelen_t hpwl = total_hpwl(); @@ -410,7 +410,7 @@ class HeAPPlacer ctx->yield(); } - void setup_grid() + void build_fast_bels() { for (auto bel : ctx->getBels()) { if (!ctx->checkBelAvail(bel)) @@ -420,6 +420,22 @@ class HeAPPlacer max_y = std::max(max_y, loc.y); } + std::unordered_set cell_types_in_use; + std::unordered_set partitions_in_use; + for (auto cell : sorted(ctx->cells)) { + IdString cell_type = cell.second->type; + cell_types_in_use.insert(cell_type); + PartitionId partition = ctx->getPartitionForCellType(cell_type); + partitions_in_use.insert(partition); + } + + for(auto cell_type : cell_types_in_use) { + fast_bels.addCellType(cell_type); + } + for(auto partition : partitions_in_use) { + fast_bels.addPartition(partition); + } + // Determine bounding boxes of region constraints for (auto ®ion : sorted(ctx->region)) { Region *r = region.second; -- cgit v1.2.3