aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/main.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-02-25 14:45:43 +0000
committerDavid Shah <dave@ds0.me>2019-02-25 14:45:43 +0000
commitba4150aeccb0f0dbdfb9f23d1459077d38b15553 (patch)
treeba31ce644ef06b2dd3726a8089c24d22ccbebdee /ecp5/main.cc
parent81b176e1504a05da65fd5989c3a2d2f389786ab0 (diff)
downloadnextpnr-ba4150aeccb0f0dbdfb9f23d1459077d38b15553.tar.gz
nextpnr-ba4150aeccb0f0dbdfb9f23d1459077d38b15553.tar.bz2
nextpnr-ba4150aeccb0f0dbdfb9f23d1459077d38b15553.zip
ecp5: Add an error for mixed constrained/unconstrained IO
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/main.cc')
-rw-r--r--ecp5/main.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/ecp5/main.cc b/ecp5/main.cc
index 98b6b901..15027a5a 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -25,6 +25,7 @@
#include "design_utils.h"
#include "log.h"
#include "timing.h"
+#include "util.h"
USING_NEXTPNR_NAMESPACE
@@ -68,6 +69,7 @@ po::options_description ECP5CommandHandler::getArchOptions()
specific.add_options()("textcfg", po::value<std::string>(), "textual configuration in Trellis format to write");
specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
+ specific.add_options()("lpf-allow-unconstrained", "don't require LPF file(s) to constrain all IO");
return specific;
}
@@ -162,6 +164,22 @@ void ECP5CommandHandler::customAfterLoad(Context *ctx)
if (!ctx->applyLPF(filename, in))
log_error("failed to parse LPF file '%s'\n", filename.c_str());
}
+
+ for (auto cell : sorted(ctx->cells)) {
+ CellInfo *ci = cell.second;
+ if (ci->type == ctx->id("$nextpnr_ibuf") || ci->type == ctx->id("$nextpnr_obuf") ||
+ ci->type == ctx->id("$nextpnr_iobuf")) {
+ if (!ci->attrs.count(ctx->id("LOC"))) {
+ if (vm.count("lpf-allow-unconstrained"))
+ log_warning("IO '%s' is unconstrained in LPF and will be automatically placed\n",
+ cell.first.c_str(ctx));
+ else
+ log_error("IO '%s' is unconstrained in LPF (override this error with "
+ "--lpf-allow-unconstrained)\n",
+ cell.first.c_str(ctx));
+ }
+ }
+ }
}
}