aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pcf.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-12-26 16:00:19 +0000
committerDavid Shah <dave@ds0.me>2018-12-26 16:00:19 +0000
commit4444a39fd481cafebb527850e9c7fff38d846154 (patch)
treeb0d753a11046832d3940bae27d43c91d4216f4fc /ice40/pcf.cc
parente76479f379e4ba15b8f788cfb171c0de10feb076 (diff)
downloadnextpnr-4444a39fd481cafebb527850e9c7fff38d846154.tar.gz
nextpnr-4444a39fd481cafebb527850e9c7fff38d846154.tar.bz2
nextpnr-4444a39fd481cafebb527850e9c7fff38d846154.zip
ice40: Improve handling of unconstrained IO
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40/pcf.cc')
-rw-r--r--ice40/pcf.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/ice40/pcf.cc b/ice40/pcf.cc
index a351b95d..a8273dd6 100644
--- a/ice40/pcf.cc
+++ b/ice40/pcf.cc
@@ -21,6 +21,7 @@
#include "pcf.h"
#include <sstream>
#include "log.h"
+#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -100,6 +101,21 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
log_error("unsupported PCF command '%s' (on line %d)\n", cmd.c_str(), lineno);
}
}
+ 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("BEL"))) {
+ if (bool_or_default(ctx->settings, ctx->id("pcf_allow_unconstrained")))
+ log_warning("IO '%s' is unconstrained in PCF and will be automatically placed\n",
+ cell.first.c_str(ctx));
+ else
+ log_error("IO '%s' is unconstrained in PCF (override this error with "
+ "--pcf-allow-unconstrained)\n",
+ cell.first.c_str(ctx));
+ }
+ }
+ }
ctx->settings.emplace(ctx->id("input/pcf"), filename);
return true;
} catch (log_execution_error_exception) {