diff options
author | Zachary Snow <zach@zachjs.com> | 2020-12-26 21:38:13 -0700 |
---|---|---|
committer | Zachary Snow <zach@zachjs.com> | 2020-12-26 21:47:38 -0700 |
commit | 750831e3e096398856053d9cbc2701e49fe0c29e (patch) | |
tree | ff3cc3083ffae53c35527d1c6a296baf91fabc1e /frontends | |
parent | af457ce8d05bb57a48831c3c252c708625ae0ffd (diff) | |
download | yosys-750831e3e096398856053d9cbc2701e49fe0c29e.tar.gz yosys-750831e3e096398856053d9cbc2701e49fe0c29e.tar.bz2 yosys-750831e3e096398856053d9cbc2701e49fe0c29e.zip |
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; |