ivtest: Add test for $left / $right on structure field
See issue #1032 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
8ca387d6de
commit
d564cecfb9
|
|
@ -0,0 +1,23 @@
|
||||||
|
module main;
|
||||||
|
|
||||||
|
typedef struct packed {
|
||||||
|
logic [15:8] f;
|
||||||
|
} structtype;
|
||||||
|
|
||||||
|
structtype s;
|
||||||
|
|
||||||
|
initial
|
||||||
|
begin
|
||||||
|
$display("$left(s.f) = %2d, $right(s.f) = %2d", $left(s.f), $right(s.f));
|
||||||
|
if ($left(s.f) !== 15) begin
|
||||||
|
$display("FAILED -- $left(s.f) = %2d", $left(s.f));
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
if ($right(s.f) !== 8) begin
|
||||||
|
$display("FAILED -- $right(s.f) = %2d", $right(s.f));
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
$display("PASSED");
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -46,6 +46,7 @@ pr903 vvp_tests/pr903.json
|
||||||
pr903-vlog95 vvp_tests/pr903-vlog95.json
|
pr903-vlog95 vvp_tests/pr903-vlog95.json
|
||||||
pv_wr_fn_vec2 vvp_tests/pv_wr_fn_vec2.json
|
pv_wr_fn_vec2 vvp_tests/pv_wr_fn_vec2.json
|
||||||
pv_wr_fn_vec4 vvp_tests/pv_wr_fn_vec4.json
|
pv_wr_fn_vec4 vvp_tests/pv_wr_fn_vec4.json
|
||||||
|
struct_field_left_right vvp_tests/struct_field_left_right.json
|
||||||
struct_packed_write_read vvp_tests/struct_packed_write_read.json
|
struct_packed_write_read vvp_tests/struct_packed_write_read.json
|
||||||
struct_packed_write_read2 vvp_tests/struct_packed_write_read2.json
|
struct_packed_write_read2 vvp_tests/struct_packed_write_read2.json
|
||||||
sv_2state_array_init_prop vvp_tests/sv_2state_array_init_prop.json
|
sv_2state_array_init_prop vvp_tests/sv_2state_array_init_prop.json
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"type" : "normal",
|
||||||
|
"source" : "struct_field_left_right.v",
|
||||||
|
"iverilog-args" : [ "-g2009" ]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue