From d90064eaee3121f5eb3c3af634e18d10029a2b82 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 23 Jul 2018 18:57:34 -0400 Subject: [PATCH] Change MODDUP errors to warnings, msg2588. --- Changes | 2 ++ bin/verilator | 10 +++++++--- src/V3Error.h | 2 +- test_regress/t/t_mod_dup_bad.pl | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index bac574aa7..3406f20ae 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix std:: build error, bug1322. +**** Change MODDUP errors to warnings, msg2588. [Marshal Qiao] + * Verilator 3.924 2018-06-12 diff --git a/bin/verilator b/bin/verilator index a3c5ce590..e4d6246c3 100755 --- a/bin/verilator +++ b/bin/verilator @@ -3361,10 +3361,14 @@ correctly. =item MODDUP -Error that a module has multiple definitions. Generally this indicates a +Warns that a module has multiple definitions. Generally this indicates a coding error, or a mistake in a library file and it's good practice to have -one module per file to avoid these issues. For some gate level netlists -duplicates are unavoidable, and this error may be disabled. +one module per file (and only put each file once on the command line) to +avoid these issues. For some gate level netlists duplicates are sometimes +unavoidable, and MODDUP should be disabled. + +Ignoring this warning will cause the more recent module definition to be +discarded. =item MULTIDRIVEN diff --git a/src/V3Error.h b/src/V3Error.h index 15e4d3583..71ce37c58 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -154,7 +154,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==IMPURE || m_e==MODDUP); } + || m_e==IMPURE); } // Warnings to mention manual bool mentionManual() const { return ( m_e==EC_FATALSRC || m_e==SYMRSVDWORD || pretendError() ); } diff --git a/test_regress/t/t_mod_dup_bad.pl b/test_regress/t/t_mod_dup_bad.pl index 1ebee5d1a..92d6612c5 100755 --- a/test_regress/t/t_mod_dup_bad.pl +++ b/test_regress/t/t_mod_dup_bad.pl @@ -12,8 +12,8 @@ scenarios(vlt_all => 1); compile( fails => 1, expect => -'%Error-MODDUP: t/t_mod_dup_bad.v:\d+: Duplicate declaration of module: a -%Error-MODDUP: t/t_mod_dup_bad.v:\d+: ... Location of original declaration +'%Warning-MODDUP: t/t_mod_dup_bad.v:\d+: Duplicate declaration of module: a +%Warning-MODDUP: t/t_mod_dup_bad.v:\d+: ... Location of original declaration .* %Error: Exiting due to.*', );