diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-27 13:26:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 13:26:12 +0200 |
commit | 92dde319fc603223304a64a5a49bbbe6c1ec3045 (patch) | |
tree | b98df78534834164a6d652c7cf5cfa4ce09fd9af /frontends | |
parent | 40a070e269ac5dbc88d2f81a4d9b340ecb524009 (diff) | |
parent | 84ffb217081fed7ddf1f683f65f2a2fdf813cd6b (diff) | |
download | yosys-92dde319fc603223304a64a5a49bbbe6c1ec3045.tar.gz yosys-92dde319fc603223304a64a5a49bbbe6c1ec3045.tar.bz2 yosys-92dde319fc603223304a64a5a49bbbe6c1ec3045.zip |
Merge pull request #1044 from mmicko/invalid_width_range
Give error instead of asserting for invalid range, fixes #947
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/genrtlil.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index d9dfc17cc..382b865a4 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -904,7 +904,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) if (!range_valid) log_file_error(filename, linenum, "Signal `%s' with non-constant width!\n", str.c_str()); - log_assert(range_left >= range_right || (range_left == -1 && range_right == 0)); + if (!(range_left >= range_right || (range_left == -1 && range_right == 0))) + log_file_error(filename, linenum, "Signal `%s' with invalid width range %d!\n", str.c_str(), range_left - range_right + 1); RTLIL::Wire *wire = current_module->addWire(str, range_left - range_right + 1); wire->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum); |