diff --git a/common/kernel/arch_api.h b/common/kernel/arch_api.h index c7cb7f87..c1dfb27a 100644 --- a/common/kernel/arch_api.h +++ b/common/kernel/arch_api.h @@ -58,7 +58,6 @@ template struct ArchAPI : BaseCtx virtual bool getBelGlobalBuf(BelId bel) const = 0; virtual bool checkBelAvail(BelId bel) const = 0; virtual CellInfo *getBoundBelCell(BelId bel) const = 0; - virtual CellInfo *getConflictingBelCell(BelId bel) const = 0; virtual IdString getBelType(BelId bel) const = 0; virtual bool getBelHidden(BelId bel) const = 0; virtual typename R::BelAttrsRangeT getBelAttrs(BelId bel) const = 0; diff --git a/common/kernel/arch_pybindings_shared.h b/common/kernel/arch_pybindings_shared.h index ac0eda07..ccc15e92 100644 --- a/common/kernel/arch_pybindings_shared.h +++ b/common/kernel/arch_pybindings_shared.h @@ -60,8 +60,6 @@ fn_wrapper_1a_v, conv_from_str>::def_wrap(ctx_cls, "getBoundBelCell"); -fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getConflictingBelCell"); fn_wrapper_0a>::def_wrap(ctx_cls, "getBels"); diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index db02dc42..2229e598 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -179,7 +179,6 @@ template struct BaseArch : ArchAPI auto fnd = base_bel2cell.find(bel); return fnd == base_bel2cell.end() ? nullptr : fnd->second; } - virtual CellInfo *getConflictingBelCell(BelId bel) const override { return getBoundBelCell(bel); } virtual typename R::BelAttrsRangeT getBelAttrs(BelId /*bel*/) const override { return empty_if_possible(); diff --git a/common/place/place_common.cc b/common/place/place_common.cc index 2ddbcb60..efa0756d 100644 --- a/common/place/place_common.cc +++ b/common/place/place_common.cc @@ -171,7 +171,7 @@ class ConstraintLegaliseWorker if (!ctx->isValidBelForCellType(cell->type, locBel)) return false; if (!ctx->checkBelAvail(locBel)) { - CellInfo *confCell = ctx->getConflictingBelCell(locBel); + CellInfo *confCell = ctx->getBoundBelCell(locBel); if (confCell->belStrength >= STRENGTH_STRONG) { return false; } @@ -191,7 +191,7 @@ class ConstraintLegaliseWorker for (auto &p : placement) { Loc p_loc = ctx->getBelLocation(p.second); if (!ctx->checkBelAvail(p.second)) { - CellInfo *confCell = ctx->getConflictingBelCell(p.second); + CellInfo *confCell = ctx->getBoundBelCell(p.second); if (confCell->belStrength >= STRENGTH_STRONG) { return false; } @@ -270,7 +270,7 @@ class ConstraintLegaliseWorker cp.second.y, cp.second.z); BelId target = ctx->getBelByLocation(cp.second); if (!ctx->checkBelAvail(target)) { - CellInfo *confl_cell = ctx->getConflictingBelCell(target); + CellInfo *confl_cell = ctx->getBoundBelCell(target); if (confl_cell != nullptr) { if (ctx->verbose) log_info(" '%s' already placed at '%s'\n", ctx->nameOf(confl_cell), diff --git a/docs/archapi.md b/docs/archapi.md index 9166db11..52f7d3dd 100644 --- a/docs/archapi.md +++ b/docs/archapi.md @@ -201,12 +201,6 @@ Return the cell the given bel is bound to, or nullptr if the bel is not bound. *BaseArch default: returns entry in `base_bel2cell`* -### CellInfo \*getConflictingBelCell(BelId bel) const - -If the bel is unavailable, and unbinding a single cell would make it available, then this method must return that cell. - -*BaseArch default: returns `getBoundBelCell(bel)`* - ### AllBelsRangeT getBels() const Return a list of all bels on the device. diff --git a/ecp5/arch.h b/ecp5/arch.h index 9b1061ee..0af88677 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -638,13 +638,6 @@ struct Arch : BaseArch return slot; } - CellInfo *getConflictingBelCell(BelId bel) const override - { - NPNR_ASSERT(bel != BelId()); - CellInfo *slot = tile_status.at(tile_index(bel)).boundcells.at(bel.index); - return slot; - } - BelRange getBels() const override { BelRange range; diff --git a/generic/arch.cc b/generic/arch.cc index f7a3dc03..d6002bba 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -338,8 +338,6 @@ bool Arch::checkBelAvail(BelId bel) const CellInfo *Arch::getBoundBelCell(BelId bel) const { return bel_info(bel).bound_cell; } -CellInfo *Arch::getConflictingBelCell(BelId bel) const { return bel_info(bel).bound_cell; } - linear_range Arch::getBels() const { return linear_range(bels.size()); } IdString Arch::getBelType(BelId bel) const { return bel_info(bel).type; } diff --git a/generic/arch.h b/generic/arch.h index 1bf1f0b6..2e8cf561 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -261,7 +261,6 @@ struct Arch : BaseArch void unbindBel(BelId bel) override; bool checkBelAvail(BelId bel) const override; CellInfo *getBoundBelCell(BelId bel) const override; - CellInfo *getConflictingBelCell(BelId bel) const override; linear_range getBels() const override; IdString getBelType(BelId bel) const override; bool getBelHidden(BelId bel) const override; diff --git a/gui/designwidget.cc b/gui/designwidget.cc index c14b7423..0c5ddb9e 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -635,8 +635,6 @@ void DesignWidget::onSelectionChanged(int num, const QItemSelection &, const QIt addProperty(topItem, QVariant::String, "Bound Cell", ctx->nameOf(ctx->getBoundBelCell(bel)), ElementType::CELL); addProperty(topItem, QVariant::String, "Bound Cell Type", ctx->getBoundBelCell(bel) ? ctx->getBoundBelCell(bel)->type.c_str(ctx) : ""); - addProperty(topItem, QVariant::String, "Conflicting Cell", ctx->nameOf(ctx->getConflictingBelCell(bel)), - ElementType::CELL); QtProperty *attrsItem = addSubGroup(topItem, "Attributes"); for (auto &item : ctx->getBelAttrs(bel)) { diff --git a/ice40/arch.h b/ice40/arch.h index e1009ddc..6ec7eb2e 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -482,12 +482,6 @@ struct Arch : BaseArch return bel_to_cell[bel.index]; } - CellInfo *getConflictingBelCell(BelId bel) const override - { - NPNR_ASSERT(bel != BelId()); - return bel_to_cell[bel.index]; - } - BelRange getBels() const override { BelRange range; diff --git a/machxo2/arch.h b/machxo2/arch.h index 45233586..b194f9c7 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -627,13 +627,6 @@ struct Arch : BaseArch return slot; } - CellInfo *getConflictingBelCell(BelId bel) const override - { - NPNR_ASSERT(bel != BelId()); - CellInfo *slot = tile_status.at(tile_index(bel)).boundcells.at(bel.index); - return slot; - } - BelRange getBels() const override { BelRange range; diff --git a/mistral/arch.h b/mistral/arch.h index 10309bf0..67eed7f1 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -359,7 +359,6 @@ struct Arch : BaseArch } bool checkBelAvail(BelId bel) const override { return bel_data(bel).bound == nullptr; } CellInfo *getBoundBelCell(BelId bel) const override { return bel_data(bel).bound; } - CellInfo *getConflictingBelCell(BelId bel) const override { return bel_data(bel).bound; } void update_bel(BelId bel); BelId bel_by_block_idx(int x, int y, IdString type, int block_index) const;