From 9f9770e722e45f5d0cc2c236703abfe9ea33c388 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 21 Sep 2024 21:00:02 -0400 Subject: [PATCH] Parse elaboration-time nettype declarations (as UNSUPPORTED) --- src/verilog.y | 26 +++++++++++++++++++------- test_regress/t/t_nettype.out | 6 +++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index e4b561c15..c80cbf488 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2560,16 +2560,28 @@ data_declarationVarFrontClass: // IEEE: part of data_declaration (for class_pro ; nettype_declaration: // IEEE: nettype_declaration/net_type_declaration - yNETTYPE data_type idAny/*nettype_identifier*/ ';' + // // Union of data_typeAny and nettype_identifier matching + yNETTYPE data_typeNoRef + /*cont*/ idAny/*nettype_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } - // // package_scope part of data_type - | yNETTYPE data_type idAny yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' - { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } - | yNETTYPE packageClassScopeE id/*nettype_identifier*/ idAny/*nettype_identifier*/ ';' - { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } - | yNETTYPE packageClassScopeE id/*nettype_identifier*/ idAny/*nettype_identifier*/ + | yNETTYPE data_typeNoRef + /*cont*/ idAny/*nettype_identifier*/ /*cont*/ yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' + { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype with"); } + | yNETTYPE packageClassScopeE idAny packed_dimensionListE + /*cont*/ idAny/*nettype_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } + | yNETTYPE packageClassScopeE idAny packed_dimensionListE + /*cont*/ idAny/*nettype_identifier*/ + /*cont*/ yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' + { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype with"); } + | yNETTYPE packageClassScopeE idAny parameter_value_assignmentClass packed_dimensionListE + /*cont*/ idAny/*nettype_identifier*/ ';' + { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } + | yNETTYPE packageClassScopeE idAny parameter_value_assignmentClass packed_dimensionListE + /*cont*/ idAny/*nettype_identifier*/ + /*cont*/ yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' + { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype with"); } ; implicit_typeE: // IEEE: part of *data_type_or_implicit diff --git a/test_regress/t/t_nettype.out b/test_regress/t/t_nettype.out index dc401b4c9..f7581cc3f 100644 --- a/test_regress/t/t_nettype.out +++ b/test_regress/t/t_nettype.out @@ -1,14 +1,14 @@ -%Error-UNSUPPORTED: t/t_nettype.v:25:4: Unsupported: nettype +%Error-UNSUPPORTED: t/t_nettype.v:25:4: Unsupported: nettype with 25 | nettype real real1_n with Pkg::resolver; | ^~~~~~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error-UNSUPPORTED: t/t_nettype.v:29:4: Unsupported: nettype +%Error-UNSUPPORTED: t/t_nettype.v:29:4: Unsupported: nettype with 29 | nettype real real2_n with local_resolver; | ^~~~~~~ %Error-UNSUPPORTED: t/t_nettype.v:34:4: Unsupported: nettype 34 | nettype real2_n real3_n; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_nettype.v:38:4: Unsupported: nettype +%Error-UNSUPPORTED: t/t_nettype.v:38:4: Unsupported: nettype with 38 | nettype Pkg::real_t real4_n with Pkg::resolver; | ^~~~~~~ %Error: Exiting due to