Remove no-op VL_CELL. No functional change intended.

This commit is contained in:
Geza Lore 2021-06-19 16:48:20 +01:00
parent fcb8bc22bd
commit 19398efc4c
2 changed files with 9 additions and 19 deletions

View File

@ -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)

View File

@ -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.