Add regression test for multi-dimensional real array
Check that multi-dimensional real arrays are supported and can be accessed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
1eb22b7e14
commit
ef009e7200
|
|
@ -0,0 +1,35 @@
|
|||
// Check that multi-dimensional real arrays are supported
|
||||
|
||||
module test;
|
||||
|
||||
reg failed = 1'b0;
|
||||
|
||||
`define check(expr, val) \
|
||||
if (expr != val) begin \
|
||||
$display("FAILED: `%s`, expected %f, got %f", `"expr`", val, expr); \
|
||||
failed = 1'b1; \
|
||||
end
|
||||
|
||||
real r[3:0][1:0];
|
||||
integer i;
|
||||
|
||||
initial begin
|
||||
for (i = 0; i < 8; i = i + 1) begin
|
||||
r[i/2][i%2] = i / 8.0 - 0.5;
|
||||
end
|
||||
|
||||
`check(r[0][0], -0.5);
|
||||
`check(r[0][1], -0.375);
|
||||
`check(r[1][0], -0.25);
|
||||
`check(r[1][1], -0.125);
|
||||
`check(r[2][0], 0.0);
|
||||
`check(r[2][1], 0.125);
|
||||
`check(r[3][0], 0.25);
|
||||
`check(r[3][1], 0.375);
|
||||
|
||||
if (!failed) begin
|
||||
$display("PASSED");
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
@ -1461,6 +1461,7 @@ real7 normal ivltests
|
|||
real9 normal ivltests
|
||||
real10 normal ivltests
|
||||
real11 normal ivltests
|
||||
real_array_multi_dim normal ivltests
|
||||
real_assign_deassign normal ivltests
|
||||
real_concat_invalid2 CE ivltests
|
||||
real_delay normal,-gspecify ivltests gold=real_delay.gold
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ pr3054101h CE ivltests
|
|||
pr3592746 CE ivltests
|
||||
real_array CE ivltests
|
||||
real_array_nb CE,-pallowsigned=1 ivltests
|
||||
real_array_multi_dim CE,-pallowsigned=1 ivltests
|
||||
scan-invalid CE ivltests
|
||||
sel_rval_bit_ob CE ivltests
|
||||
sel_rval_part_ob CE ivltests
|
||||
|
|
|
|||
Loading…
Reference in New Issue