From 2c371c88bd26c8a225fed6afcfeaf0280830a3c9 Mon Sep 17 00:00:00 2001 From: Matthew Ballance Date: Thu, 19 Mar 2026 22:35:38 +0000 Subject: [PATCH] Update unsupported and clean up warnings Signed-off-by: Matthew Ballance --- src/V3Covergroup.cpp | 5 +++-- src/verilog.y | 21 +++++++++++-------- .../t_covergroup_coverpoint_method_unsup.out | 5 +++++ .../t/t_covergroup_member_event_unsup.out | 7 +++++++ .../t/t_covergroup_member_event_unsup.py | 18 ++++++++++++++++ .../t/t_covergroup_member_event_unsup.v | 19 +++++++++++++++++ test_regress/t/t_covergroup_unsup.out | 12 ++++++++--- 7 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 test_regress/t/t_covergroup_member_event_unsup.out create mode 100644 test_regress/t/t_covergroup_member_event_unsup.py create mode 100644 test_regress/t/t_covergroup_member_event_unsup.v diff --git a/src/V3Covergroup.cpp b/src/V3Covergroup.cpp index 26a3f91e3..bc66a1c06 100644 --- a/src/V3Covergroup.cpp +++ b/src/V3Covergroup.cpp @@ -1644,8 +1644,9 @@ class FunctionalCoverageVisitor final : public VNVisitor { if (AstVarRef* const varrefp = VN_CAST(senItemp->sensp(), VarRef)) { if (varrefp->varp() && varrefp->varp()->isClassMember()) { - cgp->v3warn(COVERIGN, "Ignoring unsupported: covergroup " - "clocking event on member variable"); + cgp->v3warn(COVERIGN, + "Unsupported: 'covergroup' clocking event " + "on member variable"); eventUnsupported = true; hasUnsupportedEvent = true; break; diff --git a/src/verilog.y b/src/verilog.y index 5f3d68def..8c031df45 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -7095,14 +7095,17 @@ bins_or_options: // ==IEEE: bins_or_options if ($3) binp->isArray(true); $$ = binp; DEL($8); } | yBINS idAny/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' yWITH__PAREN '(' cgexpr ')' iffE - { $$ = new AstCoverBin{$2, *$2, $6, false, false}; - DEL($10, $12); /* TODO: Support 'with' clause */ } + { AstCoverBin* const binp = new AstCoverBin{$2, *$2, $6, false, false}; + BBCOVERIGN($8, "Unsupported: 'with' in cover bin (bin created without filter)"); + DEL($10, $12); $$ = binp; } | yIGNORE_BINS idAny/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' yWITH__PAREN '(' cgexpr ')' iffE - { $$ = new AstCoverBin{$2, *$2, $6, true, false}; - DEL($10, $12); /* TODO: Support 'with' clause */ } + { AstCoverBin* const binp = new AstCoverBin{$2, *$2, $6, true, false}; + BBCOVERIGN($8, "Unsupported: 'with' in cover bin (bin created without filter)"); + DEL($10, $12); $$ = binp; } | yILLEGAL_BINS idAny/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' yWITH__PAREN '(' cgexpr ')' iffE - { $$ = new AstCoverBin{$2, *$2, $6, false, true}; - DEL($10, $12); /* TODO: Support 'with' clause */ } + { AstCoverBin* const binp = new AstCoverBin{$2, *$2, $6, false, true}; + BBCOVERIGN($8, "Unsupported: 'with' in cover bin (bin created without filter)"); + DEL($10, $12); $$ = binp; } | yBINS idAny/*bin_identifier*/ bins_orBraE '=' id/*cover_point_id*/ yWITH__PAREN '(' cgexpr ')' iffE { $$ = nullptr; BBCOVERIGN($6, "Unsupported: 'with' in cover bin"); DEL($8, $10); } | yIGNORE_BINS idAny/*bin_identifier*/ bins_orBraE '=' id/*cover_point_id*/ yWITH__PAREN '(' cgexpr ')' iffE @@ -7165,7 +7168,7 @@ bins_or_options: // ==IEEE: bins_or_options bins_orBraE: // IEEE: part of bins_or_options: returns fileline (abuse for boolean flag) /* empty */ { $$ = nullptr; } | '[' ']' { $$ = $1; /* Mark as array */ } - | '[' cgexpr ']' { $$ = nullptr; /*UNSUP*/ DEL($2); } + | '[' cgexpr ']' { BBCOVERIGN($1, "Unsupported: 'bins' explicit array size (treated as '[]')"); DEL($2); $$ = $1; } ; trans_list: // ==IEEE: trans_list @@ -7256,7 +7259,7 @@ cover_cross: // ==IEEE: cover_cross } } if ($5) { - $5->v3warn(COVERIGN, "Ignoring unsupported: cross iff condition"); + $5->v3warn(COVERIGN, "Unsupported: 'iff' in coverage cross"); VL_DO_DANGLING($5->deleteTree(), $5); } $$ = nodep; @@ -7301,7 +7304,7 @@ cover_cross: // ==IEEE: cover_cross } } if ($3) { - $3->v3warn(COVERIGN, "Ignoring unsupported: cross iff condition"); + $3->v3warn(COVERIGN, "Unsupported: 'iff' in coverage cross"); VL_DO_DANGLING($3->deleteTree(), $3); } $$ = nodep; diff --git a/test_regress/t/t_covergroup_coverpoint_method_unsup.out b/test_regress/t/t_covergroup_coverpoint_method_unsup.out index 181c29ead..2cad9bd41 100644 --- a/test_regress/t/t_covergroup_coverpoint_method_unsup.out +++ b/test_regress/t/t_covergroup_coverpoint_method_unsup.out @@ -1,3 +1,8 @@ +%Warning-COVERIGN: t/t_covergroup_coverpoint_method_unsup.v:21:32: Unsupported: 'bins' explicit array size (treated as '[]') + 21 | coverpoint b {bins the_bins[5] = {[0 : 20]};} + | ^ + ... For warning description see https://verilator.org/warn/COVERIGN?v=latest + ... Use "/* verilator lint_off COVERIGN */" and lint_on around source to disable this message. %Error: t/t_covergroup_coverpoint_method_unsup.v:31:42: Member 'a' not found in covergroup 'cg' : ... note: In instance 't' 31 | $display("coverage a = %f", the_cg.a.get_inst_coverage()); diff --git a/test_regress/t/t_covergroup_member_event_unsup.out b/test_regress/t/t_covergroup_member_event_unsup.out new file mode 100644 index 000000000..7f093d75c --- /dev/null +++ b/test_regress/t/t_covergroup_member_event_unsup.out @@ -0,0 +1,7 @@ +%Warning-COVERIGN: t/t_covergroup_member_event_unsup.v:11:5: Unsupported: 'covergroup' clocking event on member variable + : ... note: In instance 't' + 11 | covergroup cov1 @m_z; + | ^~~~~~~~~~ + ... For warning description see https://verilator.org/warn/COVERIGN?v=latest + ... Use "/* verilator lint_off COVERIGN */" and lint_on around source to disable this message. +%Error: Exiting due to diff --git a/test_regress/t/t_covergroup_member_event_unsup.py b/test_regress/t/t_covergroup_member_event_unsup.py new file mode 100644 index 000000000..41c465422 --- /dev/null +++ b/test_regress/t/t_covergroup_member_event_unsup.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of either the GNU Lesser General Public License Version 3 +# or the Perl Artistic License Version 2.0. +# SPDX-FileCopyrightText: 2024 Wilson Snyder +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +import vltest_bootstrap + +test.scenarios('vlt') + +test.lint(expect_filename=test.golden_filename, + verilator_flags2=['--assert'], + fails=True) + +test.passes() diff --git a/test_regress/t/t_covergroup_member_event_unsup.v b/test_regress/t/t_covergroup_member_event_unsup.v new file mode 100644 index 000000000..c44eb5ba9 --- /dev/null +++ b/test_regress/t/t_covergroup_member_event_unsup.v @@ -0,0 +1,19 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain. +// SPDX-FileCopyrightText: 2024 Wilson Snyder +// SPDX-License-Identifier: CC0-1.0 + +module t(input clk); + class Packet; + int m_z; + int m_x; + covergroup cov1 @m_z; + coverpoint m_x; + endgroup + endclass + initial begin + $write("*-* All Finished *-*\n"); + $finish; + end +endmodule diff --git a/test_regress/t/t_covergroup_unsup.out b/test_regress/t/t_covergroup_unsup.out index c340d191e..835c4d7d6 100644 --- a/test_regress/t/t_covergroup_unsup.out +++ b/test_regress/t/t_covergroup_unsup.out @@ -3,10 +3,10 @@ | ^~ ... For warning description see https://verilator.org/warn/COVERIGN?v=latest ... Use "/* verilator lint_off COVERIGN */" and lint_on around source to disable this message. -%Warning-COVERIGN: t/t_covergroup_unsup.v:98:21: Ignoring unsupported: cross iff condition +%Warning-COVERIGN: t/t_covergroup_unsup.v:98:21: Unsupported: 'iff' in coverage cross 98 | cross a, b iff (!rst); | ^ -%Warning-COVERIGN: t/t_covergroup_unsup.v:101:21: Ignoring unsupported: cross iff condition +%Warning-COVERIGN: t/t_covergroup_unsup.v:101:21: Unsupported: 'iff' in coverage cross 101 | cross a, b iff (!rst) {} | ^ %Warning-COVERIGN: t/t_covergroup_unsup.v:108:21: Unsupported: 'function' in coverage cross body @@ -18,9 +18,15 @@ %Warning-COVERIGN: t/t_covergroup_unsup.v:109:7: Unsupported: explicit coverage cross bins 109 | bins one = crossfunc(); | ^~~~ -%Warning-COVERIGN: t/t_covergroup_unsup.v:113:31: Ignoring unsupported: cross iff condition +%Warning-COVERIGN: t/t_covergroup_unsup.v:113:31: Unsupported: 'iff' in coverage cross 113 | my_cg_id: cross a, b iff (!rst); | ^ +%Warning-COVERIGN: t/t_covergroup_unsup.v:124:14: Unsupported: 'bins' explicit array size (treated as '[]') + 124 | { bins ba[2] = {a}; } + | ^ +%Warning-COVERIGN: t/t_covergroup_unsup.v:126:21: Unsupported: 'with' in cover bin (bin created without filter) + 126 | { bins ba = {a} with ( b ); } + | ^~~~ %Warning-COVERIGN: t/t_covergroup_unsup.v:129:32: Unsupported: 'with' in wildcard cover bin 129 | { wildcard bins bwaw = {a} with ( b ); } | ^~~~