ivtest: Add test for partselect on enum inside pack struct

See issue #1033

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2023-11-16 09:25:38 +01:00
parent e0b255f34f
commit 483de9a75b
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,24 @@
module main;
typedef enum logic [2:0] {
ENUM_VAL = 3'b110
} enumtype;
typedef struct packed {
enumtype e;
} structtype;
structtype s;
initial
begin
s.e = ENUM_VAL;
$display("s.e[2] = %d, s.e[1] = %d, s.e[0] = %d", s.e[2], s.e[1], s.e[0]);
if ((s.e[2] != 1'b1) || (s.e[1] != 1'b1) || (s.e[0] != 1'b0)) begin
$display("FAILED");
$finish;
end
$display("PASSED");
end
endmodule

View File

@ -46,6 +46,7 @@ pr903 vvp_tests/pr903.json
pr903-vlog95 vvp_tests/pr903-vlog95.json
pv_wr_fn_vec2 vvp_tests/pv_wr_fn_vec2.json
pv_wr_fn_vec4 vvp_tests/pv_wr_fn_vec4.json
struct_enum_partsel vvp_tests/struct_enum_partsel.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_read2 vvp_tests/struct_packed_write_read2.json

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "struct_enum_partsel.v",
"iverilog-args" : [ "-g2009" ]
}