diff --git a/Changes b/Changes index 07c6c9b30..bf67ba73d 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,7 @@ Verilator 4.219 devel * Add trace dumpvars() call for selective runtime tracing (#3322). [Shunyao CAD] * Fix skipping public enum values with four-state values (#3303). * Fix $readmem file not found to be warning not error (#3310). [Alexander Grobman] +* Fix class stringification on wide arrays (#3312). [Iru Cai] * Fix public function arguments that are arrayed (#3316). [pawel256] * Fix compile error with --trace-fst --sc (#3332). [leavinel] * Fix crash in recursive module inlining (#3324). [Larry Doolittle] diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 29e1bebd4..7915126a4 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -71,7 +71,7 @@ static void makeToStringMiddle(AstClass* nodep) { comma = ", "; stmt += itemp->origNameProtect(); stmt += ":\" + "; - if (itemp->isWide()) { + if (VN_IS(itemp->dtypep()->skipRefp(), BasicDType) && itemp->isWide()) { stmt += "VL_TO_STRING_W("; stmt += cvtToStr(itemp->widthWords()); stmt += ", "; diff --git a/test_regress/t/t_class_format.out b/test_regress/t/t_class_format.out index e4886448b..dd9e17d2a 100644 --- a/test_regress/t/t_class_format.out +++ b/test_regress/t/t_class_format.out @@ -1,4 +1,4 @@ -''{b:'h1, i:'h2a, carray4:'{'h11, 'h22, 'h33, 'h44} , name:"object_name"}' -''{b:'h1, i:'h2a, carray4:'{'h911, 'h922, 'h933, 'h944} , name:"object_name"}' +''{b:'h1, i:'h2a, carray4:'{'h11, 'h22, 'h33, 'h44} , cwide:'{'h0, 'h0} , name:"object_name"}' +''{b:'h1, i:'h2a, carray4:'{'h911, 'h922, 'h933, 'h944} , cwide:'{'h0, 'h0} , name:"object_name"}' DEBUG: object_name (@0) message *-* All Finished *-* diff --git a/test_regress/t/t_class_format.v b/test_regress/t/t_class_format.v index 15a67bca9..ac11b68c0 100644 --- a/test_regress/t/t_class_format.v +++ b/test_regress/t/t_class_format.v @@ -15,6 +15,7 @@ class Cls; bit b; int i; bit [15:0] carray4 [4]; + bit [64:0] cwide[2]; string name; task debug(); $display("DEBUG: %s (@%0t) %s", this.name, $realtime, "message");