diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-06-08 14:03:06 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-06-08 14:03:06 +0200 |
commit | 13983e8318c8aa92a0549fea1803526f7920f331 (patch) | |
tree | 2907ea884816f4b86976a7a76b880bfaf0511fcb /frontends/ast/simplify.cc | |
parent | 08f9b38a9c974318efa071cd78616b1bc8de73b3 (diff) | |
download | yosys-13983e8318c8aa92a0549fea1803526f7920f331.tar.gz yosys-13983e8318c8aa92a0549fea1803526f7920f331.tar.bz2 yosys-13983e8318c8aa92a0549fea1803526f7920f331.zip |
Fixed handling of parameters with reversed range
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r-- | frontends/ast/simplify.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 30b4f5139..88df28f8b 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -678,7 +678,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, if (children.size() > 1 && children[1]->type == AST_RANGE) { if (!children[1]->range_valid) log_error("Non-constant width range on parameter decl at %s:%d.\n", filename.c_str(), linenum); - int width = children[1]->range_left - children[1]->range_right + 1; + int width = std::abs(children[1]->range_left - children[1]->range_right) + 1; if (children[0]->type == AST_REALVALUE) { RTLIL::Const constvalue = children[0]->realAsConst(width); log_warning("converting real value %e to binary %s at %s:%d.\n", |