3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-29 23:43:16 +00:00

Fix elaboration of whole memory words used as indices

This commit is contained in:
Zachary Snow 2020-12-26 21:38:13 -07:00
parent af457ce8d0
commit 750831e3e0
4 changed files with 56 additions and 1 deletions

View file

@ -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;