mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Add final loop variable assignment when unrolling for-loops, fixes #968
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
314ff1e4ca
commit
9af825e31e
|
@ -1172,6 +1172,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
|
||||||
varbuf->children[0] = buf;
|
varbuf->children[0] = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == AST_FOR) {
|
||||||
|
AstNode *buf = next_ast->clone();
|
||||||
|
delete buf->children[1];
|
||||||
|
buf->children[1] = varbuf->children[0]->clone();
|
||||||
|
current_block->children.insert(current_block->children.begin() + current_block_idx++, buf);
|
||||||
|
}
|
||||||
|
|
||||||
current_scope[varbuf->str] = backup_scope_varbuf;
|
current_scope[varbuf->str] = backup_scope_varbuf;
|
||||||
delete varbuf;
|
delete varbuf;
|
||||||
delete_children();
|
delete_children();
|
||||||
|
|
Loading…
Reference in a new issue