Deprecate -msg in configuration files

This commit is contained in:
Stefan Wallentowitz 2020-01-03 15:08:56 +01:00
parent 3e03e3cdde
commit be03e78374
5 changed files with 48 additions and 4 deletions

View File

@ -5599,7 +5599,7 @@ vltOffFront<errcodeen>:
| 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); }
$2->v3warn(DEPRECATED, "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); } }
@ -5612,7 +5612,7 @@ vltOnFront<errcodeen>:
| 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); }
$2->v3warn(DEPRECATED, "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

@ -5,10 +5,11 @@
`verilator_config
lint_off -msg CASEINCOMPLETE -file "t/t_vlt_warn.v" // Deprecation info about msg
lint_off -rule DEPRECATED -file "t/t_vlt_warn.vlt" -lines 12
lint_off -rule CASEINCOMPLETE -file "t/t_vlt_warn.v"
lint_off -rule WIDTH -file "t/t_vlt_warn.v" -lines 18
// Test wildcard filenames
lint_off -rule WIDTH -file "*/t_vlt_warn.v" -lines 19-19
lint_off -msg WIDTH -file "*/t_vlt_warn.v" -lines 19-19
// Test global disables
lint_off -file "*/t_vlt_warn.v" -lines 20-20

View File

@ -0,0 +1,5 @@
%Warning-DEPRECATED: t/t_vlt_warn_bad.vlt:11: Deprecated -msg in configuration files, use -rule instead.
lint_off -msg WIDTH -file "*/t_vlt_warn.v" -lines 19-19
^~~~
... Use "/* verilator lint_off DEPRECATED */" and lint_on around source to disable this message.
%Error: Exiting due to

View File

@ -0,0 +1,21 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2008 by Wilson Snyder. 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.
scenarios(vlt => 1);
top_filename("t/t_vlt_warn.v");
lint(
verilator_flags2 => ["--lint-only t/t_vlt_warn_bad.vlt"],
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1,17 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2010 by Wilson Snyder.
`verilator_config
lint_off -rule CASEINCOMPLETE -file "t/t_vlt_warn.v"
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
// Test global disables
lint_off -file "*/t_vlt_warn.v" -lines 20-20
coverage_off -file "t/t_vlt_warn.v"
// Test --flag is also accepted
tracing_off --file "t/t_vlt_warn.v"