Rename msg to rule in configuration files (#2080)

Rename the -msg switch to -rule in configuration files as it is more
clear.

resolves #2068
This commit is contained in:
Stefan Wallentowitz 2019-12-30 19:15:43 +01:00 committed by GitHub
parent 19c8d32263
commit b7665a88db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 10 deletions

View File

@ -2737,8 +2737,8 @@ controlled by configuration files, typically named with the .vlt
extension. An example:
`verilator_config
lint_off -msg WIDTH
lint_off -msg CASEX -file "silly_vendor_code.v"
lint_off -rule WIDTH
lint_off -rule CASEX -file "silly_vendor_code.v"
This disables WIDTH warnings globally, and CASEX for a specific file.
@ -2767,9 +2767,9 @@ Enable/disable coverage for the specified filename (or wildcard with '*' or
omitted). Often used to ignore an entire module for coverage analysis
purposes.
=item lint_on [-msg <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
=item lint_on [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
=item lint_off [-msg <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
=item lint_off [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
Enable/disables the specified lint warning, in the specified filename (or
wildcard with '*' or '?', or all files if omitted) and range of line
@ -2778,10 +2778,13 @@ numbers (or all lines if omitted).
With lint_off using '*' will override any lint_on directives in the source,
i.e. the warning will still not be printed.
If the -msg is omitted, all lint warnings (see list in -Wno-lint) are
If the -rule is omitted, all lint warnings (see list in -Wno-lint) are
enabled/disabled. This will override all later lint warning enables for
the specified region.
In previous versions -rule was named -msg. The latter is deprecated, but
still works with a deprecation info, it may be removed in future versions.
=item tracing_on [-file "<filename>" [-lines <line> [ - <line> ]]]
=item tracing_off [-file "<filename>" [-lines <line> [ - <line> ]]]

View File

@ -145,6 +145,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
-?"-file" { FL; return yVLT_D_FILE; }
-?"-lines" { FL; return yVLT_D_LINES; }
-?"-msg" { FL; return yVLT_D_MSG; }
-?"-rule" { FL; return yVLT_D_RULE; }
}
/************************************************************************/

View File

@ -283,6 +283,7 @@ class AstSenTree;
%token<fl> yVLT_D_FILE "--file"
%token<fl> yVLT_D_LINES "--lines"
%token<fl> yVLT_D_MSG "--msg"
%token<fl> yVLT_D_RULE "--rule"
%token<strp> yaD_IGNORE "${ignored-bbox-sys}"
%token<strp> yaD_DPI "${dpi-sys}"
@ -5596,6 +5597,10 @@ vltOffFront<errcodeen>:
| yVLT_TRACING_OFF { $$ = V3ErrorCode::I_TRACING; }
| yVLT_LINT_OFF { $$ = V3ErrorCode::I_LINT; }
| yVLT_LINT_OFF yVLT_D_MSG yaID__ETC
{ $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); }
$1->v3info("Deprecated -msg in configuration files, use -rule instead."<<endl); }
| yVLT_LINT_OFF yVLT_D_RULE yaID__ETC
{ $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } }
;
@ -5605,6 +5610,10 @@ vltOnFront<errcodeen>:
| yVLT_TRACING_ON { $$ = V3ErrorCode::I_TRACING; }
| yVLT_LINT_ON { $$ = V3ErrorCode::I_LINT; }
| yVLT_LINT_ON yVLT_D_MSG yaID__ETC
{ $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); }
$1->v3info("Deprecated -msg in configuration files, use -rule instead."<<endl); }
| yVLT_LINT_ON yVLT_D_RULE yaID__ETC
{ $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } }
;

View File

@ -6,7 +6,7 @@
// Try inline config
`ifdef verilator
`verilator_config
lint_off -msg CASEX -file "t/t_vlt_warn.v"
lint_off -rule CASEX -file "t/t_vlt_warn.v"
`verilog
`endif

View File

@ -5,12 +5,12 @@
`verilator_config
lint_off -msg CASEINCOMPLETE -file "t/t_vlt_warn.v"
lint_off -msg WIDTH -file "t/t_vlt_warn.v" -lines 18
lint_off -msg CASEINCOMPLETE -file "t/t_vlt_warn.v" // Deprecation info about msg
lint_off -rule WIDTH -file "t/t_vlt_warn.v" -lines 18
// Test wildcard filenames
lint_off -msg WIDTH -file "*/t_vlt_warn.v" -lines 19-19
lint_off -rule WIDTH -file "*/t_vlt_warn.v" -lines 19-19
// Test global disables
lint_off -file "*/t_vlt_warn.v" -lines 20-20
lint_off -file "*/t_vlt_warn.v" -lines 20-20
coverage_off -file "t/t_vlt_warn.v"
// Test --flag is also accepted