From 2b63219cc6e72c238613816ecda37d502cccfd3b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 5 Aug 2008 13:41:53 -0400 Subject: [PATCH] Add IMPERFECTSCH warning, disabled by default. --- Changes | 2 ++ bin/verilator | 11 +++++++++++ src/V3Changed.cpp | 1 + src/V3Error.cpp | 15 ++++++++++++++- src/V3Error.h | 7 +++++-- src/V3Options.cpp | 33 ++++++++++++++++++++++----------- 6 files changed, 55 insertions(+), 14 deletions(-) diff --git a/Changes b/Changes index 0147c1867..df0128c3d 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,8 @@ indicates the contributor was also the author of the fix; Thanks! *** Add by-design and by-module subtotals to verilator_profcfunc. +**** Add IMPERFECTSCH warning, disabled by default. + * Verilator 3.670 2008/07/23 ** Add --x-assign=fast option, and make it the default. diff --git a/bin/verilator b/bin/verilator index 28a54925f..e260bb005 100755 --- a/bin/verilator +++ b/bin/verilator @@ -580,6 +580,10 @@ It is strongly recommended you cleanup your code rather than using this option, it is only intended to be use when running test-cases of code received from third parties. +=item -Wwarn-I + +Enables the specified warning message. + =item -x-assign 0 =item -x-assign 1 @@ -1728,6 +1732,13 @@ additional ones.) Ignoring this warning may make Verilator simulations differ from other simulators. +=item IMPERFECTSCH + +Warns that the scheduling of the model is not absolutely perfect, and some +manual code edits may result in faster performance. This warning defaults +to off, and must be turned on explicitly before the top module statement is +processed. + =item IMPLICIT Warns that a wire is being implicitly declared (it is a single bit wide diff --git a/src/V3Changed.cpp b/src/V3Changed.cpp index 8116ff8af..1fa5b1fb6 100644 --- a/src/V3Changed.cpp +++ b/src/V3Changed.cpp @@ -63,6 +63,7 @@ private: vscp->v3fatalSrc("Not applicable\n"); #endif AstVar* varp = vscp->varp(); + vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<arraysp()) { vscp->v3error("Unsupported: Can't detect changes on arrayed variable (probably with UNOPTFLAT warning suppressed): "<prettyName()); } else { diff --git a/src/V3Error.cpp b/src/V3Error.cpp index 10580e8e0..091c9b4c4 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -65,6 +65,17 @@ V3ErrorCode::V3ErrorCode(const char* msgp) { //###################################################################### // FileLine class functions +FileLine::FileLine(FileLine::EmptySecret) { + m_lineno=0; + m_filename="COMMAND_LINE"; + + m_warnOff=0; + for (int codei=V3ErrorCode::FIRST_WARN; codeilineno(); m_filename = fromp->filename(); m_warnOff=fromp->m_warnOff; } - FileLine (EmptySecret) { m_lineno=0; m_filename="COMMAND_LINE"; m_warnOff=0; } + FileLine (EmptySecret); ~FileLine() { } #ifdef VL_LEAK_CHECKS static void* operator new(size_t size); diff --git a/src/V3Options.cpp b/src/V3Options.cpp index e13874dee..981a903a0 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -640,17 +640,6 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) { else if ( !strncmp (sw, "-U", 2)) { V3PreShell::undef (string (sw+strlen("-U"))); } - else if ( !strncmp (sw, "-Wno-",5) ) { - if (!strcmp (sw, "-Wno-lint")) { - FileLine::defaultFileLine().warnLintOff(true); - } - else { - string msg = sw+strlen("-Wno-"); - if (!(FileLine::defaultFileLine().warnOff(msg, true))) { - fl->v3fatal("Unknown warning disabled: "<v3fatal("Unknown warning specified: "<v3fatal("Unknown warning specified: "<