Improve E_UNSUPPORTED warning messages (#7329)

This commit is contained in:
Eunseo Song 2026-03-27 02:25:30 +09:00 committed by GitHub
parent e0963bd587
commit f369a629c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 17 additions and 12 deletions

View File

@ -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();

View File

@ -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;
}

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;
| ^