diff --git a/Changes b/Changes index d474e0e8b..0396a8d04 100644 --- a/Changes +++ b/Changes @@ -18,6 +18,8 @@ indicates the contributor was also the author of the fix; Thanks! *** Add $random. +*** Add --Wfuture-, for improving forward compatibility. + **** Fix verilator_includer not being installed properly. [Holger Waechtler] **** Fix IMPURE errors due to X-assignment temporary variables. [Steve Tong] diff --git a/bin/verilator b/bin/verilator index d43d9a08e..fed75aa74 100755 --- a/bin/verilator +++ b/bin/verilator @@ -224,6 +224,7 @@ descriptions in the next sections for more information. --underline-zero Zero signals with leading _'s -v Verilog library -Werror- Convert warning to error + -Wfuture- Disable unknown message warnings -Wno- Disable warning -x-assign Initially assign Xs to this value -y Directory to search for modules @@ -556,6 +557,14 @@ Convert the specified warning message into a error message. This is generally to discourage users from violating important site-wide rules, for example C<-Werror-NOUNOPTFLAT>. +=item -Wfuture-I + +Suppress unknown Verilator comments or warning messages with the given +message code. This is used to allow code written with pragmas for a later +version of Verilator to run under a older version; add -Wfuture- arguments +for each message code or comment that the new version supports which the +older version does not support. + =item -Wno-I Disable the specified warning message. diff --git a/src/V3Options.cpp b/src/V3Options.cpp index a6fc660a5..e13874dee 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -95,6 +95,15 @@ void V3Options::addCppFile(const string& filename) { m_cppFiles.insert(filename); } } +void V3Options::addFuture(const string& flag) { + if (m_futures.find(flag) == m_futures.end()) { + m_futures.insert(flag); + } +} +bool V3Options::isFuture(const string& flag) const { + return m_futures.find(flag) != m_futures.end(); +} + void V3Options::addLibraryFile(const string& filename) { if (m_libraryFiles.find(filename) == m_libraryFiles.end()) { m_libraryFiles.insert(filename); @@ -646,11 +655,18 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) { string msg = sw+strlen("-Werror-"); V3ErrorCode code (msg.c_str()); if (code == V3ErrorCode::ERROR) { - fl->v3fatal("Unknown warning specified: "<v3fatal("Unknown warning specified: "<