forked from github/verilator
Fix --timescale-override not suppressing TIMESCALEMOD (#2838).
This commit is contained in:
parent
12eb4e85ac
commit
26c0fa0a6a
1
Changes
1
Changes
@ -19,6 +19,7 @@ Verilator 4.201 devel
|
||||
* Fix class unpacked-array compile error (#2774). [Iru Cai]
|
||||
* Fix exceeding command-line ar limit (#2834). [Yinan Xu]
|
||||
* Fix false $dumpfile warning on model save (#2834). [Yinan Xu]
|
||||
* Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett]
|
||||
|
||||
|
||||
Verilator 4.200 2021-03-12
|
||||
|
@ -102,8 +102,12 @@ void V3LinkLevel::timescaling(const ModVec& mods) {
|
||||
|
||||
for (AstNodeModule* nodep : mods) {
|
||||
if (nodep->timeunit().isNone()) {
|
||||
if (modTimedp && !VN_IS(nodep, Iface) && !VN_IS(nodep, Primitive)
|
||||
&& !(VN_IS(nodep, Package) && VN_CAST(nodep, Package)->isDollarUnit())) {
|
||||
if (modTimedp // Got previous
|
||||
&& ( // unit doesn't already include an override
|
||||
v3Global.opt.timeOverrideUnit().isNone()
|
||||
&& v3Global.opt.timeDefaultUnit().isNone())
|
||||
&& (!VN_IS(nodep, Iface) && !VN_IS(nodep, Primitive)
|
||||
&& !(VN_IS(nodep, Package) && VN_CAST(nodep, Package)->isDollarUnit()))) {
|
||||
nodep->v3warn(TIMESCALEMOD,
|
||||
"Timescale missing on this module as other modules have "
|
||||
"it (IEEE 1800-2017 3.14.2.3)\n"
|
||||
|
20
test_regress/t/t_timescale_lint2.pl
Executable file
20
test_regress/t/t_timescale_lint2.pl
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env 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.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
scenarios(linter => 1);
|
||||
|
||||
top_filename("t/t_timescale_lint.v");
|
||||
|
||||
lint(
|
||||
verilator_flags2 => ["--lint-only --timescale 1ns/1ns"],
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
@ -1,7 +1,7 @@
|
||||
%Warning-TIMESCALEMOD: t/t_timescale_lint_bad.v:7:8: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.3)
|
||||
%Warning-TIMESCALEMOD: t/t_timescale_lint.v:7:8: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.3)
|
||||
7 | module pre_no_ts;
|
||||
| ^~~~~~~~~
|
||||
t/t_timescale_lint_bad.v:12:8: ... Location of module with timescale
|
||||
t/t_timescale_lint.v:12:8: ... Location of module with timescale
|
||||
12 | module t;
|
||||
| ^
|
||||
... Use "/* verilator lint_off TIMESCALEMOD */" and lint_on around source to disable this message.
|
||||
|
@ -10,6 +10,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||
|
||||
scenarios(linter => 1);
|
||||
|
||||
top_filename("t/t_timescale_lint.v");
|
||||
|
||||
lint(
|
||||
verilator_flags2 => ["--lint-only"],
|
||||
fails => 1,
|
||||
|
@ -1,18 +0,0 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under The Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2020 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module pre_no_ts;
|
||||
endmodule
|
||||
|
||||
`timescale 1ns/1ns
|
||||
|
||||
module t;
|
||||
pre_no_ts pre_no_ts();
|
||||
post_no_ts pst_no_ts();
|
||||
endmodule
|
||||
|
||||
module post_no_ts;
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user