aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authormyrtle <gatecat@ds0.me>2022-12-07 16:19:55 +0100
committerGitHub <noreply@github.com>2022-12-07 16:19:55 +0100
commit0eb53d59d84ea1c46de7d9e25eb5a9901544202d (patch)
treeaa7203b5b1064f327b863e7d4cb025b6292c55e4 /common
parent519011533a3b7582b984226536cb424d462d1599 (diff)
parentdf99b4ff6c5ce88ce1a731dc8682ab1875b8c237 (diff)
downloadnextpnr-0eb53d59d84ea1c46de7d9e25eb5a9901544202d.tar.gz
nextpnr-0eb53d59d84ea1c46de7d9e25eb5a9901544202d.tar.bz2
nextpnr-0eb53d59d84ea1c46de7d9e25eb5a9901544202d.zip
Merge pull request #1059 from YosysHQ/gatecat/validity-errors
Add new option for verbose validity errors, use for ice40
Diffstat (limited to 'common')
-rw-r--r--common/kernel/arch_api.h2
-rw-r--r--common/kernel/arch_pybindings_shared.h4
-rw-r--r--common/kernel/base_arch.h2
-rw-r--r--common/place/placer1.cc4
-rw-r--r--common/place/placer_heap.cc4
5 files changed, 8 insertions, 8 deletions
diff --git a/common/kernel/arch_api.h b/common/kernel/arch_api.h
index 94a88338..56c5cf0a 100644
--- a/common/kernel/arch_api.h
+++ b/common/kernel/arch_api.h
@@ -135,7 +135,7 @@ template <typename R> struct ArchAPI : BaseCtx
virtual BelBucketId getBelBucketByName(IdString name) const = 0;
virtual BelBucketId getBelBucketForBel(BelId bel) const = 0;
virtual BelBucketId getBelBucketForCellType(IdString cell_type) const = 0;
- virtual bool isBelLocationValid(BelId bel) const = 0;
+ virtual bool isBelLocationValid(BelId bel, bool explain_invalid = false) const = 0;
virtual typename R::CellTypeRangeT getCellTypes() const = 0;
virtual typename R::BelBucketRangeT getBelBuckets() const = 0;
virtual typename R::BucketBelRangeT getBelsInBucket(BelBucketId bucket) const = 0;
diff --git a/common/kernel/arch_pybindings_shared.h b/common/kernel/arch_pybindings_shared.h
index d78d240c..ac0eda07 100644
--- a/common/kernel/arch_pybindings_shared.h
+++ b/common/kernel/arch_pybindings_shared.h
@@ -127,8 +127,8 @@ fn_wrapper_0a<Context, decltype(&Context::archId), &Context::archId, conv_to_str
fn_wrapper_2a_v<Context, decltype(&Context::writeSVG), &Context::writeSVG, pass_through<std::string>,
pass_through<std::string>>::def_wrap(ctx_cls, "writeSVG");
-fn_wrapper_1a<Context, decltype(&Context::isBelLocationValid), &Context::isBelLocationValid, pass_through<bool>,
- conv_from_str<BelId>>::def_wrap(ctx_cls, "isBelLocationValid");
+fn_wrapper_2a<Context, decltype(&Context::isBelLocationValid), &Context::isBelLocationValid, pass_through<bool>,
+ conv_from_str<BelId>, pass_through<bool>>::def_wrap(ctx_cls, "isBelLocationValid");
// const\_range\<BelBucketId\> getBelBuckets() const
fn_wrapper_0a<Context, decltype(&Context::getBelBuckets), &Context::getBelBuckets,
diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h
index 53e28652..609d9378 100644
--- a/common/kernel/base_arch.h
+++ b/common/kernel/base_arch.h
@@ -357,7 +357,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
{
return getBelBucketByName(cell_type);
};
- virtual bool isBelLocationValid(BelId bel) const override { return true; }
+ virtual bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override { return true; }
virtual typename R::CellTypeRangeT getCellTypes() const override
{
NPNR_ASSERT(cell_types_initialised);
diff --git a/common/place/placer1.cc b/common/place/placer1.cc
index 23264ce2..e37d3daf 100644
--- a/common/place/placer1.cc
+++ b/common/place/placer1.cc
@@ -173,7 +173,7 @@ class SAPlacer
}
ctx->bindBel(bel, cell, STRENGTH_USER);
- if (!ctx->isBelLocationValid(bel)) {
+ if (!ctx->isBelLocationValid(bel, /* explain_invalid */ true)) {
IdString bel_type = ctx->getBelType(bel);
log_error("Bel \'%s\' of type \'%s\' is not valid for cell "
"\'%s\' of type \'%s\'\n",
@@ -404,7 +404,7 @@ class SAPlacer
ctx->yield();
for (auto bel : ctx->getBels()) {
CellInfo *cell = ctx->getBoundBelCell(bel);
- if (!ctx->isBelLocationValid(bel)) {
+ if (!ctx->isBelLocationValid(bel, /* explain_invalid */ true)) {
std::string cell_text = "no cell";
if (cell != nullptr)
cell_text = std::string("cell '") + ctx->nameOf(cell) + "'";
diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc
index 8da4ee2e..0dfc29e6 100644
--- a/common/place/placer_heap.cc
+++ b/common/place/placer_heap.cc
@@ -327,7 +327,7 @@ class HeAPPlacer
bool any_bad_placements = false;
for (auto bel : ctx->getBels()) {
CellInfo *cell = ctx->getBoundBelCell(bel);
- if (!ctx->isBelLocationValid(bel)) {
+ if (!ctx->isBelLocationValid(bel, /* explain_invalid */ true)) {
std::string cell_text = "no cell";
if (cell != nullptr)
cell_text = std::string("cell '") + ctx->nameOf(cell) + "'";
@@ -434,7 +434,7 @@ class HeAPPlacer
}
ctx->bindBel(bel, cell, STRENGTH_USER);
- if (!ctx->isBelLocationValid(bel)) {
+ if (!ctx->isBelLocationValid(bel, /* explain_invalid */ true)) {
IdString bel_type = ctx->getBelType(bel);
log_error("Bel \'%s\' of type \'%s\' is not valid for cell "
"\'%s\' of type \'%s\'\n",