yosys/tests/opt/bug2765.ys

35 lines
464 B
Plaintext
Raw Permalink Normal View History

read_verilog << EOT
module top(...);
input clk;
input [3:0] wa;
input [15:0] wd;
input [3:0] ra;
output [15:0] rd;
reg [15:0] mem[0:15];
integer i;
reg x;
always @(posedge clk) begin
for (i = 0; i < 2; i = i + 1) begin
x = i == 1;
if (x)
mem[wa] <= wd;
end
end
assign rd = mem[ra];
endmodule
EOT
proc
opt
2021-05-27 13:55:09 -05:00
select -assert-count 2 t:$memwr_v2
opt_mem
2021-05-27 13:54:29 -05:00
select -assert-count 1 t:$memwr_v2