diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-11-07 11:25:19 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-11-07 11:25:19 +0100 |
commit | 536621a98ba6fd41bf170f5ad469df17f73ed2c8 (patch) | |
tree | 06a3bf184d8fe99f55252ae801ca39d1231bc2cd /frontends | |
parent | f050c405190c50d2c1aed22644a9a207445e6592 (diff) | |
download | yosys-536621a98ba6fd41bf170f5ad469df17f73ed2c8.tar.gz yosys-536621a98ba6fd41bf170f5ad469df17f73ed2c8.tar.bz2 yosys-536621a98ba6fd41bf170f5ad469df17f73ed2c8.zip |
Fixed at_zero evaluation of dynamic ranges
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index d34960481..1bdd68626 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -965,13 +965,8 @@ skip_dynamic_range_lvalue_expansion:; if (children.size() == 0) newNode = current_scope[str]->children[0]->clone(); } - else if (at_zero && current_module->wires.count(str) > 0) { - assert(current_scope.count(str) > 0 && (current_scope[str]->type == AST_WIRE || current_scope[str]->type == AST_AUTOWIRE)); - if (children.size() != 0 && children[0]->type == AST_RANGE && children[0]->range_valid) - newNode = mkconst_int(0, false, children[0]->range_left - children[0]->range_right + 1); - else - if (children.size() == 0) - newNode = mkconst_int(0, current_scope[str]->is_signed, current_module->wires[str]->width); + else if (at_zero && current_scope.count(str) > 0 && (current_scope[str]->type == AST_WIRE || current_scope[str]->type == AST_AUTOWIRE)) { + newNode = mkconst_int(0, sign_hint, width_hint); } break; case AST_BIT_NOT: |