3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-30 13:56:33 +00:00
yosys/tests/check_mem/negative_idx.sv
Krystine Sherwin 52e0030cc5
tests/check_mem: Add problematic case
Verific reports it as 16 2-bit addresses, meaning we have to iterate over the last dimension while skipping indices.
2026-05-29 18:40:25 +12:00

13 lines
297 B
Systemverilog

module top;
(* nomem2reg *)
logic [1:0] a3 [-2:-1][-1:1] = '{'{0, 1, 2}, '{1, 0, 3}};
always_comb begin
assert(a3[-2][-1] == 0);
assert(a3[-2][0] == 1);
assert(a3[-2][1] == 2);
assert(a3[-1][-1] == 1);
assert(a3[-1][0] == 0);
assert(a3[-1][1] == 3);
end
endmodule