archapi: Remove never-properly-used getConflictingBelCell API

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2025-09-04 16:51:03 +02:00
parent 21bfda4165
commit 30ca3e073c
12 changed files with 3 additions and 39 deletions

View File

@ -58,7 +58,6 @@ template <typename R> 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;

View File

@ -60,8 +60,6 @@ fn_wrapper_1a_v<Context, decltype(&Context::unbindBel), &Context::unbindBel, con
ctx_cls, "unbindBel");
fn_wrapper_1a<Context, decltype(&Context::getBoundBelCell), &Context::getBoundBelCell, deref_and_wrap<CellInfo>,
conv_from_str<BelId>>::def_wrap(ctx_cls, "getBoundBelCell");
fn_wrapper_1a<Context, decltype(&Context::getConflictingBelCell), &Context::getConflictingBelCell,
deref_and_wrap<CellInfo>, conv_from_str<BelId>>::def_wrap(ctx_cls, "getConflictingBelCell");
fn_wrapper_0a<Context, decltype(&Context::getBels), &Context::getBels, wrap_context<BelRange>>::def_wrap(ctx_cls,
"getBels");

View File

@ -179,7 +179,6 @@ template <typename R> struct BaseArch : ArchAPI<R>
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<typename R::BelAttrsRangeT>();

View File

@ -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),

View File

@ -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.

View File

@ -638,13 +638,6 @@ struct Arch : BaseArch<ArchRanges>
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;

View File

@ -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<BelId> Arch::getBels() const { return linear_range<BelId>(bels.size()); }
IdString Arch::getBelType(BelId bel) const { return bel_info(bel).type; }

View File

@ -261,7 +261,6 @@ struct Arch : BaseArch<ArchRanges>
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<BelId> getBels() const override;
IdString getBelType(BelId bel) const override;
bool getBelHidden(BelId bel) const override;

View File

@ -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)) {

View File

@ -482,12 +482,6 @@ struct Arch : BaseArch<ArchRanges>
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;

View File

@ -627,13 +627,6 @@ struct Arch : BaseArch<ArchRanges>
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;

View File

@ -359,7 +359,6 @@ struct Arch : BaseArch<ArchRanges>
}
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;