3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-02 21:46:07 +00:00
This commit is contained in:
ALAN-Hu-1999 2026-06-19 04:05:48 +00:00 committed by GitHub
commit 94fe6c4274
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 3 deletions

View file

@ -3694,14 +3694,22 @@ skip_dynamic_range_lvalue_expansion:;
}
if (assign_data)
newNode->children.push_back(std::move(assign_data));
std::unique_ptr<AstNode> meminit_en = nullptr;
if (current_always->type == AST_INITIAL && assign_en && assign_en->children[1]->isConst())
meminit_en = assign_en->children[1]->clone();
if (assign_en)
newNode->children.push_back(std::move(assign_en));
std::unique_ptr<AstNode> wrnode;
if (current_always->type == AST_INITIAL)
wrnode = std::make_unique<AstNode>(location, AST_MEMINIT, std::move(node_addr), std::move(node_data), std::move(node_en), mkconst_int(location, 1, false));
else
if (current_always->type == AST_INITIAL) {
if (!meminit_en)
meminit_en = std::move(node_en);
wrnode = std::make_unique<AstNode>(location, AST_MEMINIT, std::move(node_addr), std::move(node_data), std::move(meminit_en), mkconst_int(location, 1, false));
} else {
wrnode = std::make_unique<AstNode>(location, AST_MEMWR, std::move(node_addr), std::move(node_data), std::move(node_en));
}
wrnode->str = children[0]->str;
wrnode->id2ast = children[0]->id2ast;
wrnode->location = location;