From 050e5ddb5b0d9d729257313d01755cde241dbf01 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 23 Jul 2025 17:17:35 -0400 Subject: [PATCH] Fix internal error after bad method --- src/V3Options.cpp | 2 +- src/V3Timing.cpp | 2 +- src/V3Width.cpp | 2 +- .../t/t_covergroup_coverpoints_unsup.out | 27 +++++++++++++++++-- test_regress/t/t_fuzz_triand_bad.out | 9 ++++--- test_regress/t/t_queue_method3_bad.out | 6 +---- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 1b64307ce..0d2bafc62 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -2143,7 +2143,7 @@ void V3Options::setDebugMode(int level) { if (!m_dumpLevel.count("tree")) m_dumpLevel["tree"] = 3; // Don't override if already set. m_stats = true; m_debugCheck = true; - cout << "Starting " << version() << "\n"; + if (level) cout << "Starting " << version() << "\n"; } unsigned V3Options::debugLevel(const string& tag) const VL_MT_SAFE { diff --git a/src/V3Timing.cpp b/src/V3Timing.cpp index e077b9518..c23799239 100644 --- a/src/V3Timing.cpp +++ b/src/V3Timing.cpp @@ -266,7 +266,7 @@ class TimingSuspendableVisitor final : public VNVisitor { getNeedsProcDepVtx(nodep); addFlags(nodep, T_ALLOCS_PROC); if (VN_IS(nodep, Always)) { - UINFO(1, "Always does " << (nodep->needProcess() ? "" : "NOT ") << "need process"); + UINFO(9, "Always does " << (nodep->needProcess() ? "" : "NOT ") << "need process"); } iterateChildren(nodep); } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index ff6de8dee..32eacdca9 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -3340,7 +3340,7 @@ class WidthVisitor final : public VNVisitor { << nodep->fromp()->prettyTypeName() << "' which is a '" << nodep->fromp()->dtypep()->prettyTypeName() << "'"); - nodep->dtypep(m_vup->dtypeNullp()); + nodep->dtypeSetVoid(); } } AstWith* methodWithArgument(AstNodeFTaskRef* nodep, bool required, bool arbReturn, diff --git a/test_regress/t/t_covergroup_coverpoints_unsup.out b/test_regress/t/t_covergroup_coverpoints_unsup.out index 456364f10..7e822aa5a 100644 --- a/test_regress/t/t_covergroup_coverpoints_unsup.out +++ b/test_regress/t/t_covergroup_coverpoints_unsup.out @@ -25,5 +25,28 @@ 35 | $display("coverage a = %f", the_cg.a.get_inst_coverage()); | ^~~~~~~~~~~~~~~~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt -%Error: Command Failed +%Error: t/t_covergroup_coverpoints_unsup.v:36:48: Member 'b' not found in class 'cg' + : ... note: In instance 't' + 36 | $display("coverage b = %f", the_cg.b.get_inst_coverage()); + | ^ +%Error-UNSUPPORTED: t/t_covergroup_coverpoints_unsup.v:36:50: Unsupported: Member call on object 'CONST '1'h0'' which is a 'BASICDTYPE 'logic'' + : ... note: In instance 't' + 36 | $display("coverage b = %f", the_cg.b.get_inst_coverage()); + | ^~~~~~~~~~~~~~~~~ +%Error: t/t_covergroup_coverpoints_unsup.v:37:24: Member 'a' not found in class 'cg' + : ... note: In instance 't' + 37 | if (the_cg.a.get_inst_coverage() != 15/16.0) $stop(); + | ^ +%Error-UNSUPPORTED: t/t_covergroup_coverpoints_unsup.v:37:26: Unsupported: Member call on object 'CONST '1'h0'' which is a 'BASICDTYPE 'logic'' + : ... note: In instance 't' + 37 | if (the_cg.a.get_inst_coverage() != 15/16.0) $stop(); + | ^~~~~~~~~~~~~~~~~ +%Error: t/t_covergroup_coverpoints_unsup.v:38:24: Member 'b' not found in class 'cg' + : ... note: In instance 't' + 38 | if (the_cg.b.get_inst_coverage() != 4/5.0) $stop(); + | ^ +%Error-UNSUPPORTED: t/t_covergroup_coverpoints_unsup.v:38:26: Unsupported: Member call on object 'CONST '1'h0'' which is a 'BASICDTYPE 'logic'' + : ... note: In instance 't' + 38 | if (the_cg.b.get_inst_coverage() != 4/5.0) $stop(); + | ^~~~~~~~~~~~~~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_fuzz_triand_bad.out b/test_regress/t/t_fuzz_triand_bad.out index df4c63b13..497744d83 100644 --- a/test_regress/t/t_fuzz_triand_bad.out +++ b/test_regress/t/t_fuzz_triand_bad.out @@ -3,8 +3,9 @@ 8 | tri g=g.and.g; | ^~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error: Internal Error: t/t_fuzz_triand_bad.v:8:12: ../V3Width.cpp:#: Unlinked data type - : ... note: In instance 't' +%Error: t/t_fuzz_triand_bad.v:8:16: Member selection of non-struct/union object 'METHODCALL 'and'' which is a 'VOIDDTYPE' + : ... note: In instance 't' 8 | tri g=g.and.g; - | ^~~ - ... This fatal error may be caused by the earlier error(s); resolve those first. + | ^ + ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. +%Error: Exiting due to diff --git a/test_regress/t/t_queue_method3_bad.out b/test_regress/t/t_queue_method3_bad.out index df38b71fb..041af3fa2 100644 --- a/test_regress/t/t_queue_method3_bad.out +++ b/test_regress/t/t_queue_method3_bad.out @@ -3,8 +3,4 @@ 16 | points_qv = points_q.find_first(a) with (a.x.index == 0); | ^~~~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error: Internal Error: t/t_queue_method3_bad.v:16:58: ../V3Width.cpp:#: Node has no type - : ... note: In instance 't' - 16 | points_qv = points_q.find_first(a) with (a.x.index == 0); - | ^~ - ... This fatal error may be caused by the earlier error(s); resolve those first. +%Error: Exiting due to