Files
iverilog/ivtest/ivltests/sv_darray_oob_string.v
T
Lars-Peter Clausen b83daa3ae3 Add regression tests for dynamic array and queue out-of-bounds access
Check that out-of-bounds access on a dynamic array or queue works and
returns the correct value.

  * 2-state vectors: '0 with the element width
  * 4-state vectors: 'x with the element width
  * reals: 0.0
  * strings: ""

Note that the 2-state test currently still fails as out-of-bounds access on
a 2-state vector incorrectly returns 'x.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2022-05-15 21:58:01 +02:00

19 lines
322 B
Verilog

// Check that out-of-bounds access on a string typed dynamic array works and
// returns the right value.
module test;
string d[];
string x;
initial begin
x = d[1];
if (x == "") begin
$display("PASSED");
end else begin
$display("FAILED. Expected '', got '%s'", x);
end
end
endmodule