diff --git a/src/V3Active.cpp b/src/V3Active.cpp index 8b1a2e9b8..99fcc3a5c 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -168,13 +168,14 @@ private: // Convert to a non-delayed assignment UINFO(5," ASSIGNDLY "<v3warn(INITIALDLY, "Delayed assignments (<=) in initial" - " or final block; suggest blocking assignments (=)."); + nodep->v3warn(INITIALDLY, "Delayed assignments (<=) in initial or final block\n" + <warnMore()<<"... Suggest blocking assignments (=)"); } else if (m_check == CT_LATCH) { // Suppress. Shouldn't matter that the interior of the latch races } else { nodep->v3warn(COMBDLY, "Delayed assignments (<=) in non-clocked" - " (non flop or latch) block; suggest blocking assignments (=)."); + " (non flop or latch) block\n" + <warnMore()<<"... Suggest blocking assignments (=)"); } AstNode* newp = new AstAssign(nodep->fileline(), nodep->lhsp()->unlinkFrBack(), @@ -196,16 +197,15 @@ private: if (m_check == CT_SEQ && m_assignp && !varp->isUsedLoopIdx() // Ignore loop indicies - && !varp->isTemp() - ) { + && !varp->isTemp()) { // Allow turning off warnings on the always, or the variable also if (!m_alwaysp->fileline()->warnIsOff(V3ErrorCode::BLKSEQ) && !m_assignp->fileline()->warnIsOff(V3ErrorCode::BLKSEQ) - && !varp->fileline()->warnIsOff(V3ErrorCode::BLKSEQ) - ) { + && !varp->fileline()->warnIsOff(V3ErrorCode::BLKSEQ)) { + m_assignp->v3warn(BLKSEQ, "Blocking assignments (=) in sequential (flop or latch) block\n" + <warnMore()<<"... Suggest delayed assignments (<=)"); m_alwaysp->fileline()->modifyWarnOff(V3ErrorCode::BLKSEQ, true); // Complain just once for the entire always varp->fileline()->modifyWarnOff(V3ErrorCode::BLKSEQ, true); - nodep->v3warn(BLKSEQ, "Blocking assignments (=) in sequential (flop or latch) block; suggest delayed assignments (<=)."); } } } diff --git a/src/V3Case.cpp b/src/V3Case.cpp index 3b81b9cc9..704fe015b 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -72,7 +72,7 @@ private: itemp; itemp=VN_CAST(itemp->nextp(), CaseItem)) { if (itemp->isDefault()) { if (hitDefault) { - nodep->v3error("Multiple default statements in case statement."); + itemp->v3error("Multiple default statements in case statement."); } hitDefault = true; } @@ -186,8 +186,8 @@ private: if (!m_valueItem[i]) { m_valueItem[i] = itemp; } else if (!itemp->ignoreOverlap() && !bitched) { - itemp->v3warn(CASEOVERLAP, "Case values overlap (example pattern 0x" - <v3warn(CASEOVERLAP, "Case values overlap (example pattern 0x" + <varp()->prettyNameQ()<warnOther()<<"... Location of first driving block"<varp()->warnContextPrimary()<warnContextPrimary()<warnOther()<<"... Location of other driving block"<warnContextSecondary() ); diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 53838c96b..57ddadaf8 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -337,8 +337,10 @@ private: // Arrayed instants: one bit for each of the instants (each // assign is 1 pinwidth wide) if (m_cellRangep->littleEndian()) { - nodep->v3warn(LITENDIAN, "Little endian cell range connecting to vector: MSB < LSB of cell range: " - <lsbConst()<<":"<msbConst()); + nodep->exprp()->v3warn( + LITENDIAN, + "Little endian cell range connecting to vector: MSB < LSB of cell range: " + <lsbConst()<<":"<msbConst()); } AstNode* exprp = nodep->exprp()->unlinkFrBack(); bool inputPin = nodep->modVarp()->isNonOutput(); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 8161a50f8..b157cd885 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -829,12 +829,15 @@ private: V3Const::constifyParamsEdit(nodep->ticksp()); // ticksp may change const AstConst* constp = VN_CAST(nodep->ticksp(), Const); if (!constp || constp->toSInt() < 1) { - nodep->v3error("$past tick value must be constant and >= 1 (IEEE 2017 16.9.3)"); + nodep->v3error("$past tick value must be constant (IEEE 2017 16.9.3)"); + nodep->ticksp()->unlinkFrBack()->deleteTree(); + } else if (constp->toSInt() < 1) { + constp->v3error("$past tick value must be >= 1 (IEEE 2017 16.9.3)"); nodep->ticksp()->unlinkFrBack()->deleteTree(); } else { if (constp->toSInt() > 10) { - nodep->v3warn(TICKCOUNT, "$past tick value of "<toSInt() - <<" may have a large performance cost"); + constp->v3warn(TICKCOUNT, "$past tick value of "<toSInt() + <<" may have a large performance cost"); } } } diff --git a/test_regress/t/t_case_default_bad.out b/test_regress/t/t_case_default_bad.out index f66e2fcf9..a802929e6 100644 --- a/test_regress/t/t_case_default_bad.out +++ b/test_regress/t/t_case_default_bad.out @@ -1,2 +1,2 @@ -%Error: t/t_case_default_bad.v:12: Multiple default statements in case statement. +%Error: t/t_case_default_bad.v:15: Multiple default statements in case statement. %Error: Exiting due to diff --git a/test_regress/t/t_initial_dlyass_bad.out b/test_regress/t/t_initial_dlyass_bad.out index 4a084c56d..c966481ac 100644 --- a/test_regress/t/t_initial_dlyass_bad.out +++ b/test_regress/t/t_initial_dlyass_bad.out @@ -1,4 +1,6 @@ -%Warning-INITIALDLY: t/t_initial_dlyass.v:17: Delayed assignments (<=) in initial or final block; suggest blocking assignments (=). +%Warning-INITIALDLY: t/t_initial_dlyass.v:17: Delayed assignments (<=) in initial or final block + : ... Suggest blocking assignments (=) ... Use "/* verilator lint_off INITIALDLY */" and lint_on around source to disable this message. -%Warning-INITIALDLY: t/t_initial_dlyass.v:18: Delayed assignments (<=) in initial or final block; suggest blocking assignments (=). +%Warning-INITIALDLY: t/t_initial_dlyass.v:18: Delayed assignments (<=) in initial or final block + : ... Suggest blocking assignments (=) %Error: Exiting due to diff --git a/test_regress/t/t_lint_blksync_bad.out b/test_regress/t/t_lint_blksync_bad.out index d59370891..d101b971f 100644 --- a/test_regress/t/t_lint_blksync_bad.out +++ b/test_regress/t/t_lint_blksync_bad.out @@ -1,6 +1,8 @@ -%Warning-BLKSEQ: t/t_lint_blksync_bad.v:23: Blocking assignments (=) in sequential (flop or latch) block; suggest delayed assignments (<=). +%Warning-BLKSEQ: t/t_lint_blksync_bad.v:23: Blocking assignments (=) in sequential (flop or latch) block + : ... Suggest delayed assignments (<=) ... Use "/* verilator lint_off BLKSEQ */" and lint_on around source to disable this message. -%Warning-COMBDLY: t/t_lint_blksync_bad.v:30: Delayed assignments (<=) in non-clocked (non flop or latch) block; suggest blocking assignments (=). +%Warning-COMBDLY: t/t_lint_blksync_bad.v:30: Delayed assignments (<=) in non-clocked (non flop or latch) block + : ... Suggest blocking assignments (=) *** See the manual before disabling this, else you may end up with different sim results. %Error: Exiting due to diff --git a/test_regress/t/t_lint_blksync_bad.pl b/test_regress/t/t_lint_blksync_bad.pl index af96f5596..df455cd4c 100755 --- a/test_regress/t/t_lint_blksync_bad.pl +++ b/test_regress/t/t_lint_blksync_bad.pl @@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -scenarios(vlt_all => 1); +scenarios(linter => 1); lint( verilator_flags2 => ["--lint-only -Wwarn-BLKSEQ -Wwarn-COMBDLY"], diff --git a/test_regress/t/t_lint_latch_bad.out b/test_regress/t/t_lint_latch_bad.out index f72e4393a..7c5cf3d40 100644 --- a/test_regress/t/t_lint_latch_bad.out +++ b/test_regress/t/t_lint_latch_bad.out @@ -1,4 +1,5 @@ -%Warning-COMBDLY: t/t_lint_latch_bad.v:24: Delayed assignments (<=) in non-clocked (non flop or latch) block; suggest blocking assignments (=). +%Warning-COMBDLY: t/t_lint_latch_bad.v:24: Delayed assignments (<=) in non-clocked (non flop or latch) block + : ... Suggest blocking assignments (=) ... Use "/* verilator lint_off COMBDLY */" and lint_on around source to disable this message. *** See the manual before disabling this, else you may end up with different sim results. diff --git a/test_regress/t/t_past_bad.out b/test_regress/t/t_past_bad.out index 6bda9f53a..9811283d3 100644 --- a/test_regress/t/t_past_bad.out +++ b/test_regress/t/t_past_bad.out @@ -1,4 +1,4 @@ -%Error: t/t_past_bad.v:11: $past tick value must be constant and >= 1 (IEEE 2017 16.9.3) +%Error: t/t_past_bad.v:11: $past tick value must be constant (IEEE 2017 16.9.3) %Warning-TICKCOUNT: t/t_past_bad.v:12: $past tick value of 10000 may have a large performance cost ... Use "/* verilator lint_off TICKCOUNT */" and lint_on around source to disable this message. %Error: Exiting due to diff --git a/test_regress/t/t_past_bad.pl b/test_regress/t/t_past_bad.pl index b3eb5b75d..adc555a8d 100755 --- a/test_regress/t/t_past_bad.pl +++ b/test_regress/t/t_past_bad.pl @@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -scenarios(vlt_all => 1); +scenarios(vlt => 1); compile( fails => 1,