aboutsummaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-12-07 10:27:58 +0100
committergatecat <gatecat@ds0.me>2022-12-07 10:27:58 +0100
commit603b60da8dcadf23eec8609ffc128f8f191c1122 (patch)
tree11ee560444efa1bd2ec56994cb50641290c73662 /generic
parentd1afd6c0f1f8452d7461bbf33c84dbfd59236d03 (diff)
downloadnextpnr-603b60da8dcadf23eec8609ffc128f8f191c1122.tar.gz
nextpnr-603b60da8dcadf23eec8609ffc128f8f191c1122.tar.bz2
nextpnr-603b60da8dcadf23eec8609ffc128f8f191c1122.zip
api: add explain_invalid option to isBelLocationValid
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'generic')
-rw-r--r--generic/arch.cc4
-rw-r--r--generic/arch.h2
-rw-r--r--generic/viaduct/example/example.cc2
-rw-r--r--generic/viaduct/fabulous/fabulous.cc5
-rw-r--r--generic/viaduct/okami/okami.cc2
-rw-r--r--generic/viaduct_api.h2
6 files changed, 10 insertions, 7 deletions
diff --git a/generic/arch.cc b/generic/arch.cc
index c60c7674..579140b9 100644
--- a/generic/arch.cc
+++ b/generic/arch.cc
@@ -693,10 +693,10 @@ TimingClockingInfo Arch::getPortClockingInfo(const CellInfo *cell, IdString port
return tmg.clockingInfo.at(port).at(index);
}
-bool Arch::isBelLocationValid(BelId bel) const
+bool Arch::isBelLocationValid(BelId bel, bool explain_invalid) const
{
if (uarch)
- return uarch->isBelLocationValid(bel);
+ return uarch->isBelLocationValid(bel, explain_invalid);
std::vector<const CellInfo *> cells;
Loc loc = getBelLocation(bel);
for (auto tbel : getBelsByTile(loc.x, loc.y)) {
diff --git a/generic/arch.h b/generic/arch.h
index a27dc78e..2a177be9 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -386,7 +386,7 @@ struct Arch : BaseArch<ArchRanges>
{
return uarch ? uarch->isValidBelForCellType(cell_type, bel) : cell_type == getBelType(bel);
}
- bool isBelLocationValid(BelId bel) const override;
+ bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override;
static const std::string defaultPlacer;
static const std::vector<std::string> availablePlacers;
diff --git a/generic/viaduct/example/example.cc b/generic/viaduct/example/example.cc
index 987c3236..7a61a594 100644
--- a/generic/viaduct/example/example.cc
+++ b/generic/viaduct/example/example.cc
@@ -62,7 +62,7 @@ struct ExampleImpl : ViaductAPI
void prePlace() override { assign_cell_info(); }
- bool isBelLocationValid(BelId bel) const override
+ bool isBelLocationValid(BelId bel, bool explain_invalid) const override
{
Loc l = ctx->getBelLocation(bel);
if (is_io(l.x, l.y)) {
diff --git a/generic/viaduct/fabulous/fabulous.cc b/generic/viaduct/fabulous/fabulous.cc
index 3c6f025f..e2fe1b74 100644
--- a/generic/viaduct/fabulous/fabulous.cc
+++ b/generic/viaduct/fabulous/fabulous.cc
@@ -81,7 +81,10 @@ struct FabulousImpl : ViaductAPI
}
void prePlace() override { assign_cell_info(); }
- bool isBelLocationValid(BelId bel) const override { return blk_trk->check_validity(bel, cfg, cell_tags); }
+ bool isBelLocationValid(BelId bel, bool explain_invalid) const override
+ {
+ return blk_trk->check_validity(bel, cfg, cell_tags);
+ }
private:
FabricConfig cfg; // TODO: non-default config
diff --git a/generic/viaduct/okami/okami.cc b/generic/viaduct/okami/okami.cc
index 8142756f..4ff97cb3 100644
--- a/generic/viaduct/okami/okami.cc
+++ b/generic/viaduct/okami/okami.cc
@@ -64,7 +64,7 @@ struct OkamiImpl : ViaductAPI
void prePlace() override { assign_cell_info(); }
- bool isBelLocationValid(BelId bel) const override
+ bool isBelLocationValid(BelId bel, bool explain_invalid) const override
{
Loc l = ctx->getBelLocation(bel);
if (is_io(l.x, l.y)) {
diff --git a/generic/viaduct_api.h b/generic/viaduct_api.h
index 6887f56c..3caa0ba1 100644
--- a/generic/viaduct_api.h
+++ b/generic/viaduct_api.h
@@ -67,7 +67,7 @@ struct ViaductAPI
virtual BelBucketId getBelBucketForBel(BelId bel) const;
virtual BelBucketId getBelBucketForCellType(IdString cell_type) const;
virtual bool isValidBelForCellType(IdString cell_type, BelId bel) const;
- virtual bool isBelLocationValid(BelId bel) const { return true; }
+ virtual bool isBelLocationValid(BelId bel, bool explain_invalid = false) const { return true; }
// --- Wire and pip functions ---
// Called when a wire/pip is placed/unplaced (with net=nullptr for a unbind)