diff options
author | whitequark <whitequark@whitequark.org> | 2020-12-29 02:59:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-29 02:59:09 +0000 |
commit | da1d06d7852a64e562a8a8a75aa8b4c1864bc9e7 (patch) | |
tree | ba74cb19aab98d2b81a6222509e1582f81018992 /frontends | |
parent | e609bc48985c07cdf8d6e4c51a08ea21c6058c34 (diff) | |
parent | 750831e3e096398856053d9cbc2701e49fe0c29e (diff) | |
download | yosys-da1d06d7852a64e562a8a8a75aa8b4c1864bc9e7.tar.gz yosys-da1d06d7852a64e562a8a8a75aa8b4c1864bc9e7.tar.bz2 yosys-da1d06d7852a64e562a8a8a75aa8b4c1864bc9e7.zip |
Merge pull request #2509 from zachjs/issue-2427
Fix elaboration of whole memory words used as indices
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index c6d63f247..17b4d4cdc 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -3451,7 +3451,14 @@ replace_fcall_later:; if (current_scope[str]->children[0]->isConst()) newNode = current_scope[str]->children[0]->clone(); } - else if (at_zero && current_scope.count(str) > 0 && (current_scope[str]->type == AST_WIRE || current_scope[str]->type == AST_AUTOWIRE)) { + else if (at_zero && current_scope.count(str) > 0) { + AstNode *node = current_scope[str]; + if (node->type == AST_WIRE || node->type == AST_AUTOWIRE || node->type == AST_MEMORY) + newNode = mkconst_int(0, sign_hint, width_hint); + } + break; + case AST_MEMRD: + if (at_zero) { newNode = mkconst_int(0, sign_hint, width_hint); } break; |