Fix cascading errors after unsupported class dot reference in parameter value (#8551)

Signed-off-by: Martijn Wobbes <[email protected]>
This commit is contained in:
Martijn Wobbes
2026-09-30 17:53:42 -04:00
committed by GitHub
parent 1edf8f986a
commit 61289bc80b
8 changed files with 16 additions and 36 deletions
+2
View File
@@ -4116,6 +4116,8 @@ class WidthVisitor final : public VNVisitor {
// ^^~~~ this is our DOT
nodep->v3warn(E_UNSUPPORTED, "dotted expressions in parameters\n"
<< nodep->warnMore() << "... Suggest use a typedef");
nodep->replaceWith(new AstConst{nodep->fileline(), AstConst::BitFalseErroring{}});
VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
void visit(AstClassExtends* nodep) override {
if (nodep->didWidthAndSet()) return;
@@ -1,12 +0,0 @@
%Error-UNSUPPORTED: t/t_class_localparam_dotref_funcref_arg_bad.v:27:32: dotted expressions in parameters
: ... note: In instance 't'
: ... Suggest use a typedef
27 | localparam int y = D#(C#(7)::get_a())::x;
| ^~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: t/t_class_localparam_dotref_funcref_arg_bad.v:27:32: Can't convert defparam value to constant: Param '__paramNumber1' of 'D'
: ... note: In instance 't'
27 | localparam int y = D#(C#(7)::get_a())::x;
| ^~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: Exiting due to
@@ -0,0 +1,7 @@
%Error-UNSUPPORTED: t/t_class_localparam_dotref_funcref_arg_unsup.v:27:32: dotted expressions in parameters
: ... note: In instance 't'
: ... Suggest use a typedef
27 | localparam int y = D#(C#(7)::get_a())::x;
| ^~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Exiting due to
@@ -4,18 +4,9 @@
30 | Sub #(CFG::notaparam) u_prop ();
| ^~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: t/t_class_lparam_nonparam_bad.v:30:14: Can't convert defparam value to constant: Param '__paramNumber1' of 'u_prop'
: ... note: In instance 't'
30 | Sub #(CFG::notaparam) u_prop ();
| ^~~~~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error-UNSUPPORTED: t/t_class_lparam_nonparam_bad.v:31:14: dotted expressions in parameters
: ... note: In instance 't'
: ... Suggest use a typedef
31 | Sub #(CFG::alsonotaparam) u_static ();
| ^~~~~~~~~~~~~
%Error: t/t_class_lparam_nonparam_bad.v:31:14: Can't convert defparam value to constant: Param '__paramNumber1' of 'u_static'
: ... note: In instance 't'
31 | Sub #(CFG::alsonotaparam) u_static ();
| ^~~~~~~~~~~~~
%Error: Exiting due to
+5 -11
View File
@@ -1,11 +1,5 @@
%Error-UNSUPPORTED: t/t_class_param_nested_bad.v:57:23: dotted expressions in parameters
: ... note: In instance 't'
: ... Suggest use a typedef
57 | Wrap2 #(Wrap #(19)::PBASE * 2) w38;
| ^~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Internal Error: t/t_class_param_nested_bad.v:57:23: ../V3Width.cpp:#: Node has no type
: ... note: In instance 't'
57 | Wrap2 #(Wrap #(19)::PBASE * 2) w38;
| ^~~~~
... This fatal error may be caused by the earlier error(s); resolve those first.
%Error: t/t_class_param_nested_bad.v:56:23: Package/class for ':: reference' not found: 'c1'
56 | Wrap2 #(Wrap #(19)::c1::PBASE * 2) w38;
| ^~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: Exiting due to
+2 -4
View File
@@ -15,7 +15,7 @@ class Wrap #(
function new;
c1 = new;
endfunction
Cls #(PMINUS1 + 1) c1;
static Cls #(PMINUS1 + 1) c1;
localparam PMINUS1 = P - 1; // Checking works when last
endclass
@@ -48,13 +48,12 @@ endclass
typedef Cls#(8) Cls8_t;
module t;
Cls c12;
Cls #(.PBASE(4)) c4;
Cls8_t c8;
Wrap #(.P(16)) w16;
Wrap2 #(.P(32)) w32;
Wrap2 #(Wrap #(19)::PBASE * 2) w38;
Wrap2 #(Wrap #(19)::c1::PBASE * 2) w38;
initial begin
c12 = new;
c4 = new;
@@ -63,7 +62,6 @@ module t;
w32 = new;
w38 = new;
if (w38.get_p() != 38) $stop;
$write("*-* All Finished *-*\n");
$finish;
end