Deprecation (#2088)

* Add deprecation warning

* Deprecate -msg in configuration files

* Deprecate sc_clock
This commit is contained in:
Stefan Wallentowitz 2020-01-03 17:27:51 +01:00 committed by GitHub
parent 924fe235a9
commit 37dc33a195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 111 additions and 9 deletions

View File

@ -77,6 +77,7 @@ public:
CONTASSREG, // Continuous assignment on reg
DEFPARAM, // Style: Defparam
DECLFILENAME, // Declaration doesn't match filename
DEPRECATED, // Feature will be deprecated
ENDLABEL, // End lable name mismatch
GENCLK, // Generated Clock
IFDEPTH, // If statements too deep
@ -143,7 +144,7 @@ public:
"BLKANDNBLK", "BLKLOOPINIT", "BLKSEQ", "BSSPACE",
"CASEINCOMPLETE", "CASEOVERLAP", "CASEWITHX", "CASEX", "CDCRSTLOGIC", "CLKDATA",
"CMPCONST", "COLONPLUS", "COMBDLY", "CONTASSREG",
"DEFPARAM", "DECLFILENAME",
"DEFPARAM", "DECLFILENAME", "DEPRECATED",
"ENDLABEL", "GENCLK",
"IFDEPTH", "IGNOREDRETURN",
"IMPERFECTSCH", "IMPLICIT", "IMPORTSTAR", "IMPURE",

View File

@ -260,6 +260,7 @@ private:
}
else if (nodep->attrType() == AstAttrType::VAR_CLOCK) {
UASSERT_OBJ(m_varp, nodep, "Attribute not attached to variable");
nodep->v3warn(DEPRECATED, "sc_clock is deprecated and will be removed");
m_varp->attrScClocked(true);
nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep);
}

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

@ -8,8 +8,8 @@ module t (/*AUTOARG*/
clk, fastclk
);
input clk /*verilator sc_clock*/;
input fastclk /*verilator sc_clock*/;
input clk;
input fastclk;
reg reset_l;
int cyc;
@ -32,8 +32,8 @@ module t_clk (/*AUTOARG*/
clk, fastclk, reset_l
);
input clk /*verilator sc_clock*/;
input fastclk /*verilator sc_clock*/;
input clk;
input fastclk;
input reset_l;
// surefire lint_off STMINI

View File

@ -0,0 +1,5 @@
%Warning-DEPRECATED: t/t_clk_first_deprecated.v:11: sc_clock is deprecated and will be removed
input clk /*verilator sc_clock*/ ;
^~~~~~~~~~~~~~~~~~~~~~
... 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 2003 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_clk_first_deprecated.v");
lint(
verilator_flags2 => ["--lint-only"],
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1,17 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 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);
lint(
verilator_flags2 => ["--lint-only", "-Wno-DEPRECATED"],
);
ok(1);
1;

View File

@ -0,0 +1,13 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk /*verilator sc_clock*/;
endmodule

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"