mirror of https://github.com/YosysHQ/yosys.git
Merge 556a19c611 into a9446d7389
This commit is contained in:
commit
f4f2031bcb
|
|
@ -3687,14 +3687,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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
read_verilog <<EOT
|
||||
module top(output [31:0] y);
|
||||
reg [31:0] mem [0:3];
|
||||
|
||||
initial begin
|
||||
mem[0] = 32'h00000000;
|
||||
mem[1] = 32'h11111111;
|
||||
mem[2] = 32'h22222222;
|
||||
mem[3] = 32'h33333333;
|
||||
end
|
||||
|
||||
assign y = mem[0];
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
write_verilog
|
||||
Loading…
Reference in New Issue