diff --git a/include/verilated.h b/include/verilated.h index 107f217de..cb375d27c 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -283,8 +283,6 @@ public: #define VL_OUT(name, msb, lsb) IData name ///< Declare output signal, 17-32 bits #define VL_OUTW(name, msb, lsb, words) WData name[words] ///< Declare output signal, 65+ bits -#define VL_CELL(instname, type) ///< Declare a cell, ala SP_CELL - ///< Declare a module, ala SC_MODULE #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) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index dd48ecfe4..77142c101 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1873,7 +1873,6 @@ class EmitCImp final : EmitCStmts { return ""; } - void emitCellCtors(AstNodeModule* modp); void emitSensitives(); // Medium level void emitCtorImp(AstNodeModule* modp); @@ -2480,7 +2479,15 @@ void EmitCImp::emitCtorImp(AstNodeModule* modp) { if (modp->isTop() && v3Global.opt.mtasks()) emitThreadingCtors(&first); puts(" {\n"); - emitCellCtors(modp); + + if (modp->isTop()) { + putsDecoration("// Create Sym instance\n"); + // Must be before other constructors, as __vlCoverInsert calls it. + // Note _vcontextp__ may be nullptr, VerilatedSyms::VerilatedSyms cleans it up + puts(EmitCBaseVisitor::symClassVar() + " = new " + symClassName() + "(" + + (optSystemC() ? "nullptr" : "_vcontextp__") + ", this, name());\n"); + } + emitSensitives(); putsDecoration("// Reset internal values\n"); @@ -2717,21 +2724,6 @@ void EmitCImp::emitTextSection(AstType type) { if (last_line > 0) puts("//*** Above code from `systemc in Verilog file\n\n"); } -void EmitCImp::emitCellCtors(AstNodeModule* modp) { - if (modp->isTop()) { - // Must be before other constructors, as __vlCoverInsert calls it - // Note _vcontextp__ may be nullptr, VerilatedSyms::VerilatedSyms cleans it up - puts(EmitCBaseVisitor::symClassVar() + " = new " + symClassName() + "(" - + (optSystemC() ? "nullptr" : "_vcontextp__") + ", this, name());\n"); - } - for (AstNode* nodep = modp->stmtsp(); nodep; nodep = nodep->nextp()) { - if (AstCell* cellp = VN_CAST(nodep, Cell)) { - puts("VL_CELL(" + cellp->nameProtect() + ", " + prefixNameProtect(cellp->modp()) - + ");\n"); - } - } -} - void EmitCImp::emitSensitives() { // Create sensitivity list for when to evaluate the model. // If C++ code, the user must call this routine themself.