aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer_heap.cc
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-01-29 11:11:05 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-02 07:34:56 -0800
commit8d9390fc460bf98932afa5ef8362f932b48cf744 (patch)
tree537cb3d7ed9bf5e75fb035a5c91d26857c729b21 /common/placer_heap.cc
parent16394d3158f6dc608f8fcbbcac96f851824915bd (diff)
downloadnextpnr-8d9390fc460bf98932afa5ef8362f932b48cf744.tar.gz
nextpnr-8d9390fc460bf98932afa5ef8362f932b48cf744.tar.bz2
nextpnr-8d9390fc460bf98932afa5ef8362f932b48cf744.zip
Fix regression in use of FastBels.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'common/placer_heap.cc')
-rw-r--r--common/placer_heap.cc22
1 files changed, 19 insertions, 3 deletions
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 <typename T> 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<IdString> cell_types_in_use;
+ std::unordered_set<PartitionId> 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 &region : sorted(ctx->region)) {
Region *r = region.second;