From ea4cc4e0767b1d003240d8b1d19c2c8a4f6ea816 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 14 Mar 2023 19:52:01 -0400 Subject: [PATCH] Parse nettype with package, still unsupported --- src/verilog.y | 3 +++ test_regress/t/t_nettype.out | 15 +++++++++------ test_regress/t/t_nettype.v | 5 +++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index 1fdc118a7..ec68a46e4 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2480,6 +2480,9 @@ net_type_declaration: // IEEE: net_type_declaration { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } | yNETTYPE packageClassScopeE id/*net_type_identifier*/ idAny/*net_type_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } + | yNETTYPE packageClassScopeE id/*net_type_identifier*/ idAny/*net_type_identifier*/ + /*cont*/ yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' + { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } ; 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 6811cc566..dc401b4c9 100644 --- a/test_regress/t/t_nettype.out +++ b/test_regress/t/t_nettype.out @@ -1,11 +1,14 @@ -%Error-UNSUPPORTED: t/t_nettype.v:24:4: Unsupported: nettype - 24 | nettype real real1_n with Pkg::resolver; +%Error-UNSUPPORTED: t/t_nettype.v:25:4: Unsupported: nettype + 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:28:4: Unsupported: nettype - 28 | nettype real real2_n with local_resolver; +%Error-UNSUPPORTED: t/t_nettype.v:29:4: Unsupported: nettype + 29 | nettype real real2_n with local_resolver; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_nettype.v:33:4: Unsupported: nettype - 33 | nettype real2_n real3_n; +%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 + 38 | nettype Pkg::real_t real4_n with Pkg::resolver; | ^~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_nettype.v b/test_regress/t/t_nettype.v index 312a5960f..c81792601 100644 --- a/test_regress/t/t_nettype.v +++ b/test_regress/t/t_nettype.v @@ -5,6 +5,7 @@ // SPDX-License-Identifier: CC0-1.0 package Pkg; + typedef real real_t; real last_resolve; function automatic real resolver(input real drivers[]); @@ -34,6 +35,10 @@ module t(/*AUTOARG*/); real3_n real3; assign real3 = 1.23; + nettype Pkg::real_t real4_n with Pkg::resolver; + real4_n real4; + assign real4 = 1.23; + // TODO when implement net types need to check multiple driver cases, across // submodules