diff --git a/Changes b/Changes index b17e71805..f13e2b07d 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,7 @@ Verilator 4.201 devel **Minor:** * Add EOFNEWLINE warning when missing a newline at EOF. +* Changed TIMESCALEMOD from error into a warning. * Verilated signals now use VlWide and VlPacked in place of C arrays. * Fix class unpacked-array compile error (#2774). [Iru Cai] * Fix exceeding command-line ar limit (#2834). [Yinan Xu] diff --git a/bin/verilator b/bin/verilator index ce28b6d45..96a44c640 100755 --- a/bin/verilator +++ b/bin/verilator @@ -4885,16 +4885,18 @@ correctly. =item TIMESCALEMOD -Error that `timescale is used in some but not all modules. -Recommend using --timescale argument, or in front of all modules use: +Warns that `timescale is used in some but not all modules. Recommend using +--timescale argument, or in front of all modules use: `include "timescale.vh" Then in that file set the timescale. -This is an error due to IEEE specifications, but it may be disabled similar -to warnings. Ignoring this error may result in a module having an -unexpected timescale. +It may be disabled similar to other warnings. Ignoring this warning may +result in a module having an unexpected timescale. + +IEEE recommends this be an error, for that behavior use +-Werror-TIMESCALEMOD. =item UNDRIVEN diff --git a/src/V3Error.h b/src/V3Error.h index 307b8a397..eb3ec178d 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -190,8 +190,7 @@ public: // Later -Werror- options may make more of these. bool pretendError() const { return (m_e == ASSIGNIN || m_e == BLKANDNBLK || m_e == BLKLOOPINIT || m_e == CONTASSREG - || m_e == IMPURE || m_e == PKGNODECL || m_e == PROCASSWIRE // - || m_e == TIMESCALEMOD); // Says IEEE + || m_e == IMPURE || m_e == PKGNODECL || m_e == PROCASSWIRE); // Says IEEE } // Warnings to mention manual bool mentionManual() const { diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp index fd118f4a9..53ee0f514 100644 --- a/src/V3LinkLevel.cpp +++ b/src/V3LinkLevel.cpp @@ -106,7 +106,7 @@ void V3LinkLevel::timescaling(const ModVec& mods) { && !(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.2)\n" + "it (IEEE 1800-2017 3.14.2.3)\n" << nodep->warnContextPrimary() << '\n' << modTimedp->warnOther() << "... Location of module with timescale\n" diff --git a/test_regress/t/t_timescale_lint_bad.out b/test_regress/t/t_timescale_lint_bad.out index fece9ec2e..43d692c37 100644 --- a/test_regress/t/t_timescale_lint_bad.out +++ b/test_regress/t/t_timescale_lint_bad.out @@ -1,7 +1,8 @@ -%Error-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.2) +%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) 7 | module pre_no_ts; | ^~~~~~~~~ - t/t_timescale_lint_bad.v:12:8: ... Location of module with timescale + t/t_timescale_lint_bad.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. %Error: Exiting due to