From dd7f7a53bd5ae51ca3ff172b6e4de65128ab8a6d Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 10 Dec 2019 15:28:16 +0000 Subject: ice40: Improve error handling of Lattice-style parameters Signed-off-by: David Shah --- ice40/bitstream.cc | 3 +++ 1 file changed, 3 insertions(+) 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", -- cgit v1.2.3