diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 8027a37fa..ddd06e05a 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -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; diff --git a/test_regress/t/t_class_localparam_dotref_funcref_arg_bad.out b/test_regress/t/t_class_localparam_dotref_funcref_arg_bad.out deleted file mode 100644 index 43c05c798..000000000 --- a/test_regress/t/t_class_localparam_dotref_funcref_arg_bad.out +++ /dev/null @@ -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 diff --git a/test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.out b/test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.out new file mode 100644 index 000000000..489988e3d --- /dev/null +++ b/test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.out @@ -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 diff --git a/test_regress/t/t_class_localparam_dotref_funcref_arg_bad.py b/test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.py similarity index 100% rename from test_regress/t/t_class_localparam_dotref_funcref_arg_bad.py rename to test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.py diff --git a/test_regress/t/t_class_localparam_dotref_funcref_arg_bad.v b/test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.v similarity index 100% rename from test_regress/t/t_class_localparam_dotref_funcref_arg_bad.v rename to test_regress/t/t_class_localparam_dotref_funcref_arg_unsup.v diff --git a/test_regress/t/t_class_lparam_nonparam_bad.out b/test_regress/t/t_class_lparam_nonparam_bad.out index 44264d2e8..4012e2c8f 100644 --- a/test_regress/t/t_class_lparam_nonparam_bad.out +++ b/test_regress/t/t_class_lparam_nonparam_bad.out @@ -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 diff --git a/test_regress/t/t_class_param_nested_bad.out b/test_regress/t/t_class_param_nested_bad.out index a3f0f32de..a930d9be4 100644 --- a/test_regress/t/t_class_param_nested_bad.out +++ b/test_regress/t/t_class_param_nested_bad.out @@ -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 diff --git a/test_regress/t/t_class_param_nested_bad.v b/test_regress/t/t_class_param_nested_bad.v index 0aa2333b7..b2837bbbd 100644 --- a/test_regress/t/t_class_param_nested_bad.v +++ b/test_regress/t/t_class_param_nested_bad.v @@ -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