aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-12-10 15:28:16 +0000
committerDavid Shah <dave@ds0.me>2019-12-10 15:28:16 +0000
commitdd7f7a53bd5ae51ca3ff172b6e4de65128ab8a6d (patch)
tree2cee3160359e93c4d8d5ef18776df72d4735ce38 /ice40
parent992c9acd569687aabda1083b5cf9c2a1e66b7350 (diff)
downloadnextpnr-dd7f7a53bd5ae51ca3ff172b6e4de65128ab8a6d.tar.gz
nextpnr-dd7f7a53bd5ae51ca3ff172b6e4de65128ab8a6d.tar.bz2
nextpnr-dd7f7a53bd5ae51ca3ff172b6e4de65128ab8a6d.zip
ice40: Improve error handling of Lattice-style parameters
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/bitstream.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc
index 7149f127..9586b8ff 100644
--- a/ice40/bitstream.cc
+++ b/ice40/bitstream.cc
@@ -159,6 +159,9 @@ void configure_extra_cell(chipconfig_t &config, const Context *ctx, CellInfo *ce
if (string_style) {
// Lattice's weird string style params, not sure if
// prefixes other than 0b should be supported, only 0b features in docs
+ if (cell->params.count(ctx->id(p.first)) && !cell->params.at(ctx->id(p.first)).is_string)
+ log_error("expected configuration string starting with '0b' for parameter '%s' on cell '%s'\n",
+ p.first.c_str(), cell->name.c_str(ctx));
std::string raw = get_param_str_or_def(cell, ctx->id(p.first), "0b0");
if (raw.substr(0, 2) != "0b")
log_error("expected configuration string starting with '0b' for parameter '%s' on cell '%s'\n",