From f369a629c710a7dada96f0b4f882fd8f7c54110b Mon Sep 17 00:00:00 2001 From: Eunseo Song <162149585+eunseo9311@users.noreply.github.com> Date: Fri, 27 Mar 2026 02:25:30 +0900 Subject: [PATCH] Improve E_UNSUPPORTED warning messages (#7329) --- src/V3LinkInc.cpp | 4 +++- src/V3Timing.cpp | 4 +++- src/V3Width.cpp | 3 ++- test_regress/t/t_event_control_star.out | 2 +- test_regress/t/t_increment_bad.out | 14 +++++++------- test_regress/t/t_unbounded_bad.out | 2 +- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index cf34778a9..ca6a84b88 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -292,7 +292,9 @@ class LinkIncVisitor final : public VNVisitor { void prepost_expr_visit(AstNodeTriop* nodep) { iterateChildren(nodep); if (m_unsupportedHere) { - nodep->v3warn(E_UNSUPPORTED, "Unsupported: Incrementation in this context."); + nodep->v3warn(E_UNSUPPORTED, + "Unsupported: Pre/post increment/decrement operator" + " within a logical expression (&&, ||, ?:, etc.)"); return; } AstNodeExpr* const readp = nodep->rhsp(); diff --git a/src/V3Timing.cpp b/src/V3Timing.cpp index 316a9c642..bb1a69ec3 100644 --- a/src/V3Timing.cpp +++ b/src/V3Timing.cpp @@ -1046,7 +1046,9 @@ class TimingControlVisitor final : public VNVisitor { // Do not allow waiting on local named events, as they get enqueued for clearing, but can // go out of scope before that happens if (!nodep->sentreep()) { - nodep->v3warn(E_UNSUPPORTED, "Unsupported: no sense equation (@*)"); + nodep->v3warn(E_UNSUPPORTED, + "Unsupported: Event control with implicit sensitivity (@*)" + " in this context; use an explicit sensitivity list instead"); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); return; } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index a4a8c0c2d..c9a7c0538 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1666,7 +1666,8 @@ class WidthVisitor final : public VNVisitor { if (VN_IS(selp->fromp()->dtypep()->skipRefp(), QueueDType)) return; } // queue_slice[#:$] and queue_bitsel[$] etc handled in V3WidthSel - nodep->v3warn(E_UNSUPPORTED, "Unsupported/illegal unbounded ('$') in this context."); + nodep->v3warn(E_UNSUPPORTED, + "Unsupported: Unbounded ('$') outside of queue or string operations"); } void visit(AstInferredDisable* nodep) override { assertAtExpr(nodep); diff --git a/test_regress/t/t_event_control_star.out b/test_regress/t/t_event_control_star.out index a04a01ff7..087dcbbc1 100644 --- a/test_regress/t/t_event_control_star.out +++ b/test_regress/t/t_event_control_star.out @@ -1,4 +1,4 @@ -%Error-UNSUPPORTED: t/t_event_control_star.v:19:5: Unsupported: no sense equation (@*) +%Error-UNSUPPORTED: t/t_event_control_star.v:19:5: Unsupported: Event control with implicit sensitivity (@*) in this context; use an explicit sensitivity list instead 19 | @* a = c; | ^ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest diff --git a/test_regress/t/t_increment_bad.out b/test_regress/t/t_increment_bad.out index 4a3194a36..3534f7d84 100644 --- a/test_regress/t/t_increment_bad.out +++ b/test_regress/t/t_increment_bad.out @@ -1,23 +1,23 @@ -%Error-UNSUPPORTED: t/t_increment_bad.v:19:29: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:19:29: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 19 | if (0 && test_string[pos++] != "e"); | ^~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error-UNSUPPORTED: t/t_increment_bad.v:20:17: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:20:17: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 20 | if (1 || pos-- != 1); | ^~ -%Error-UNSUPPORTED: t/t_increment_bad.v:22:15: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:22:15: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 22 | if (a <-> --b); | ^~ -%Error-UNSUPPORTED: t/t_increment_bad.v:23:14: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:23:14: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 23 | if (0 -> ++b); | ^~ -%Error-UNSUPPORTED: t/t_increment_bad.v:25:22: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:25:22: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 25 | pos = (a > 0) ? a++ : --b; | ^~ -%Error-UNSUPPORTED: t/t_increment_bad.v:25:27: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:25:27: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 25 | pos = (a > 0) ? a++ : --b; | ^~ -%Error-UNSUPPORTED: t/t_increment_bad.v:30:36: Unsupported: Incrementation in this context. +%Error-UNSUPPORTED: t/t_increment_bad.v:30:36: Unsupported: Pre/post increment/decrement operator within a logical expression (&&, ||, ?:, etc.) 30 | assert property (@(posedge clk) a++ >= 0); | ^~ %Error: Exiting due to diff --git a/test_regress/t/t_unbounded_bad.out b/test_regress/t/t_unbounded_bad.out index 1e83db3fa..67890ac93 100644 --- a/test_regress/t/t_unbounded_bad.out +++ b/test_regress/t/t_unbounded_bad.out @@ -1,4 +1,4 @@ -%Error-UNSUPPORTED: t/t_unbounded_bad.v:9:9: Unsupported/illegal unbounded ('$') in this context. +%Error-UNSUPPORTED: t/t_unbounded_bad.v:9:9: Unsupported: Unbounded ('$') outside of queue or string operations : ... note: In instance 't' 9 | if ($) $stop; | ^