diff --git a/Changes b/Changes index 03329b463..bab2ffb71 100644 --- a/Changes +++ b/Changes @@ -74,6 +74,7 @@ Verilator 5.047 devel * Fix typedef scope resolution for parameterized class aliases (#5977) (#7319). [Nick Brereton] * Fix lambda coroutines (#6106) (#7135). [Nick Brereton] * Fix super constructor calls with local variables (#6214) (#6933). [Igor Zaworski, Antmicro Ltd.] +* Fix parameter default comparison when value contains type cast (#6281) (#7369) (#6281). [Yilou Wang] * Fix `local::` false error in randomize() with on parameterized class (#6680) (#7293). [Yilou Wang] * Fix false recursive definition error (#6769) (#7118). [Alex Zhou] * Fix port assignment to large arrays (#6904). diff --git a/test_regress/t/t_param_cast_default.v b/test_regress/t/t_param_cast_default.v index 526d743fd..34f01e8f6 100644 --- a/test_regress/t/t_param_cast_default.v +++ b/test_regress/t/t_param_cast_default.v @@ -12,35 +12,45 @@ // Original #6281 reproducer: parameter passed via localparam variable // vs. literal constant should resolve to the same specialization. // Fixed by ParameterizedHierBlocks::areSame fallback (landed earlier). -class ClsIntDefault #(parameter int P = 32); +class ClsIntDefault #( + parameter int P = 32 +); function int get_p; return P; endfunction endclass // Parameter with byte cast default value -class ClsByteCast #(parameter byte P = byte'(8)); +class ClsByteCast #( + parameter byte P = byte'(8) +); function byte get_p; return P; endfunction endclass // Parameter with int cast default value -class ClsIntCast #(parameter int P = int'(42)); +class ClsIntCast #( + parameter int P = int'(42) +); function int get_p; return P; endfunction endclass // Parameter with signed cast default value -class ClsSignedCast #(parameter int P = int'(-5)); +class ClsSignedCast #( + parameter int P = int'(-5) +); function int get_p; return P; endfunction endclass // Module with cast default (cell array test) -module sub #(parameter byte P = byte'(8)); +module sub #( + parameter byte P = byte'(8) +); initial begin `checkd(P, 8); end @@ -49,7 +59,7 @@ endmodule module t; // Original #6281 case: localparam variable vs. literal constant localparam int WIDTH = 32; - ClsIntDefault #(32) orig_a; + ClsIntDefault #(32) orig_a; ClsIntDefault #(WIDTH) orig_b; // Byte cast default: #() and #(8) should be same type