diff --git a/include/verilated.h b/include/verilated.h index 2188f124b..9f761e209 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -272,17 +272,6 @@ public: #define VL_MODULE(modname) class modname VL_NOT_FINAL : public VerilatedModule // Not class final in VL_MODULE, as users might be abstracting our models (--hierarchical) -/// Constructor, ala SC_CTOR -#define VL_CTOR(modname) modname(const char* __VCname = "") - -/// Constructor declaration for C++, ala SP_CTOR_IMPL -#define VL_CTOR_IMP(modname) \ - modname::modname(const char* __VCname) \ - : VerilatedModule(__VCname) - -/// Constructor declaration for SystemC, ala SP_CTOR_IMPL -#define VL_SC_CTOR_IMP(modname) modname::modname(sc_module_name) - //========================================================================= // Functions overridable by user defines // (Internals however must use VL_PRINTF_MT, which calls these.) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 99f1f7361..8a9ab194b 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -2427,10 +2427,12 @@ void EmitCImp::emitCtorImp(AstNodeModule* modp) { if (VN_IS(modp, Class)) { modp->v3fatalSrc("constructors should be AstCFuncs instead"); } else if (optSystemC() && modp->isTop()) { - puts("VL_SC_CTOR_IMP(" + prefixNameProtect(modp) + ")"); + puts(prefixNameProtect(modp) + "::" + prefixNameProtect(modp) + "(sc_module_name)"); } else { - puts("VL_CTOR_IMP(" + prefixNameProtect(modp) + ")"); - first = false; // VL_CTOR_IMP includes the first ':' + puts(prefixNameProtect(modp) + "::" + prefixNameProtect(modp) + + "(const char* __VCname)\n"); + puts(" : VerilatedModule(__VCname)\n"); + first = false; // printed the first ':' } emitVarCtors(&first); if (modp->isTop() && v3Global.opt.mtasks()) emitMTaskVertexCtors(&first); @@ -3184,7 +3186,7 @@ void EmitCImp::emitInt(AstNodeModule* modp) { puts("virtual ~" + prefixNameProtect(modp) + "();\n"); } else if (optSystemC()) { ofp()->putsPrivate(false); // public: - puts("VL_CTOR(" + prefixNameProtect(modp) + ");\n"); + puts(prefixNameProtect(modp) + "(const char* __VCname = \"\");\n"); puts("~" + prefixNameProtect(modp) + "();\n"); } else { ofp()->putsPrivate(false); // public: