Fix module parameter name collision (#3854) (#3855)

This commit is contained in:
James Shi
2023-01-20 18:38:59 -05:00
committed by GitHub
parent be53eec5ca
commit 5ef373500f
4 changed files with 42 additions and 3 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ class EmitCHeader final : public EmitCConstInit {
if (!VN_IS(modp, Class)) { // Classes use CFuncs with isConstructor/isDestructor
const string& name = prefixNameProtect(modp);
putsDecoration("\n// CONSTRUCTORS\n");
puts(name + "(" + symClassName() + "* symsp, const char* name);\n");
puts(name + "(" + symClassName() + "* symsp, const char* v__name);\n");
puts("~" + name + "();\n");
puts("VL_UNCOPYABLE(" + name + ");\n");
}
+2 -2
View File
@@ -250,8 +250,8 @@ class EmitCImp final : EmitCFunc {
"(" + modName + "* vlSelf);");
puts("\n");
puts(modName + "::" + modName + "(" + symClassName() + "* symsp, const char* name)\n");
puts(" : VerilatedModule{name}\n");
puts(modName + "::" + modName + "(" + symClassName() + "* symsp, const char* v__name)\n");
puts(" : VerilatedModule{v__name}\n");
ofp()->indentInc();
for (const AstNode* nodep = modp->stmtsp(); nodep; nodep = nodep->nextp()) {