mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 08:33:38 +02:00
* V3Common.cpp::makeVlToString: fix `VL_TOSTRING_W` statement generation to include width argument * fix contribution name * add testcase for long struct `VL_TO_STRING_W` bug
This commit is contained in:
+5
-3
@@ -82,11 +82,13 @@ static void makeVlToString(AstNodeUOrStructDType* nodep) {
|
||||
}
|
||||
stmt += VIdProtect::protect(itemp->prettyName()) + ":\" + ";
|
||||
if (VN_IS(itemp->dtypep()->skipRefp(), BasicDType) && itemp->isWide()) {
|
||||
stmt += "VL_TO_STRING_W";
|
||||
stmt += "VL_TO_STRING_W(";
|
||||
stmt += cvtToStr(itemp->widthWords());
|
||||
stmt += ", ";
|
||||
} else {
|
||||
stmt += "VL_TO_STRING";
|
||||
stmt += "VL_TO_STRING(";
|
||||
}
|
||||
stmt += "(obj." + itemp->nameProtect() + ");\n";
|
||||
stmt += "obj." + itemp->nameProtect() + ");\n";
|
||||
funcp->addStmtsp(new AstCStmt{nodep->fileline(), stmt});
|
||||
}
|
||||
funcp->addStmtsp(new AstCStmt{nodep->fileline(), "out += \"}\";\n"});
|
||||
|
||||
Reference in New Issue
Block a user