From fbfb6016c1bed1d9291dd2cc6c0f7206395ff22f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 11 Dec 2022 10:47:08 -0800 Subject: [PATCH] Add regression test for using packed scoped type identifier in class Check that it is possible to use a packed scope type identifier for the type of a class property when the class is defined in the unit scope. This makes sure that the elaboration is done in an order so that the type is available when the class property is elaborated. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/sv_ps_type_class_prop.v | 23 +++++++++++++++++++++++ ivtest/regress-sv.list | 1 + ivtest/regress-vlog95.list | 1 + 3 files changed, 25 insertions(+) create mode 100644 ivtest/ivltests/sv_ps_type_class_prop.v diff --git a/ivtest/ivltests/sv_ps_type_class_prop.v b/ivtest/ivltests/sv_ps_type_class_prop.v new file mode 100644 index 000000000..3c55b7aa1 --- /dev/null +++ b/ivtest/ivltests/sv_ps_type_class_prop.v @@ -0,0 +1,23 @@ +// Check that it is possible to use a package scope type identifier for the type +// of a property of class defined in the root scope + +package P; + typedef integer T; +endpackage + +class C; + P::T x; +endclass + +module test; + C c; + initial begin + c = new; + c.x = 32'h55aa55aa; + if (c.x === 32'h55aa55aa) begin + $display("PASSED"); + end else begin + $display("FAILED"); + end + end +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 66bb051c7..443af55bd 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -640,6 +640,7 @@ sv_ps_type1 normal,-g2009 ivltests sv_ps_type_cast1 normal,-g2009 ivltests sv_ps_type_cast2 normal,-g2009 ivltests sv_ps_type_class1 normal,-g2009 ivltests +sv_ps_type_class_prop normal,-g2009 ivltests sv_ps_type_enum1 normal,-g2009 ivltests sv_ps_type_expr1 normal,-g2009 ivltests sv_ps_type_expr2 normal,-g2009 ivltests diff --git a/ivtest/regress-vlog95.list b/ivtest/regress-vlog95.list index 722ab7543..d1c41a8d3 100644 --- a/ivtest/regress-vlog95.list +++ b/ivtest/regress-vlog95.list @@ -440,6 +440,7 @@ sv_port_default7 CE,-g2009,-pallowsigned=1 ivltests sv_port_default8 CE,-g2009,-pallowsigned=1 ivltests sv_port_default9 CE,-g2009 ivltests sv_ps_type_class1 CE,-g2009 ivltests +sv_ps_type_class_prop CE,-g2009 ivltests sv_root_class CE,-g2009 ivltests sv_typedef_fwd_class CE,-g2009 ivltests sv_typedef_fwd_class2 CE,-g2009 ivltests