Update unsupported and clean up warnings

Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
This commit is contained in:
Matthew Ballance 2026-03-19 22:35:38 +00:00
parent cbf6c64d05
commit 2c371c88bd
7 changed files with 73 additions and 14 deletions

View File

@ -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;

View File

@ -7095,14 +7095,17 @@ bins_or_options<nodep>: // ==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{$<fl>2, *$2, $6, false, false};
DEL($10, $12); /* TODO: Support 'with' clause */ }
{ AstCoverBin* const binp = new AstCoverBin{$<fl>2, *$2, $6, false, false};
BBCOVERIGN($<fl>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{$<fl>2, *$2, $6, true, false};
DEL($10, $12); /* TODO: Support 'with' clause */ }
{ AstCoverBin* const binp = new AstCoverBin{$<fl>2, *$2, $6, true, false};
BBCOVERIGN($<fl>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{$<fl>2, *$2, $6, false, true};
DEL($10, $12); /* TODO: Support 'with' clause */ }
{ AstCoverBin* const binp = new AstCoverBin{$<fl>2, *$2, $6, false, true};
BBCOVERIGN($<fl>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($<fl>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<nodep>: // ==IEEE: bins_or_options
bins_orBraE<fl>: // IEEE: part of bins_or_options: returns fileline (abuse for boolean flag)
/* empty */ { $$ = nullptr; }
| '[' ']' { $$ = $<fl>1; /* Mark as array */ }
| '[' cgexpr ']' { $$ = nullptr; /*UNSUP*/ DEL($2); }
| '[' cgexpr ']' { BBCOVERIGN($<fl>1, "Unsupported: 'bins' explicit array size (treated as '[]')"); DEL($2); $$ = $<fl>1; }
;
trans_list<nodep>: // ==IEEE: trans_list
@ -7256,7 +7259,7 @@ cover_cross<nodep>: // ==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<nodep>: // ==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;

View File

@ -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());

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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 ); }
| ^~~~