mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-02 22:48:43 +02:00
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]>
19 lines
315 B
Verilog
19 lines
315 B
Verilog
// Check that out-of-bounds access on a string typed queue works and returns the
|
|
// right value.
|
|
|
|
module test;
|
|
|
|
string q[$];
|
|
string x;
|
|
|
|
initial begin
|
|
x = q[1];
|
|
if (x == "") begin
|
|
$display("PASSED");
|
|
end else begin
|
|
$display("FAILED. Expected '', got '%s'", x);
|
|
end
|
|
end
|
|
|
|
endmodule
|