diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 405b76513..ff182fe8e 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -847,16 +847,13 @@ class EmitCImp : EmitCStmts { if (nodep->symProlog()) puts(EmitCBaseVisitor::symTopAssign()+"\n"); if (nodep->initsp()) putsDecoration("// Variables\n"); - ofp()->putAlign(V3OutFile::AL_AUTO, 4); for (AstNode* subnodep=nodep->argsp(); subnodep; subnodep = subnodep->nextp()) { if (AstVar* varp=subnodep->castVar()) { if (varp->isFuncReturn()) emitVarDecl(varp, ""); } } emitVarList(nodep->initsp(), EVL_ALL, ""); - ofp()->putAlign(V3OutFile::AL_AUTO, 4); emitVarList(nodep->stmtsp(), EVL_ALL, ""); - ofp()->putAlign(V3OutFile::AL_AUTO, 4); nodep->initsp()->iterateAndNext(*this); @@ -964,7 +961,6 @@ void EmitCStmts::emitVarDecl(AstVar* nodep, const string& prefixIfImp) { if (nodep->isIO()) { if (nodep->isSc()) { m_ctorVarsVec.push_back(nodep); - ofp()->putAlign(nodep->isStatic(), 4); // sc stuff is a structure, so bigger alignment if (nodep->attrScClocked() && nodep->isInput()) { puts("sc_in_clk\t"); } else { @@ -985,8 +981,6 @@ void EmitCStmts::emitVarDecl(AstVar* nodep, const string& prefixIfImp) { emitDeclArrayBrackets(nodep); puts(";\n"); } else { // C++ signals - ofp()->putAlign(nodep->isStatic(), nodep->dtypeSkipRefp()->widthAlignBytes(), - nodep->dtypeSkipRefp()->widthTotalBytes()); if (nodep->isInout()) puts("VL_INOUT"); else if (nodep->isInput()) puts("VL_IN"); else if (nodep->isOutput()) puts("VL_OUT"); @@ -1013,8 +1007,6 @@ void EmitCStmts::emitVarDecl(AstVar* nodep, const string& prefixIfImp) { } else { // Arrays need a small alignment, but may need different padding after. // For example three VL_SIG8's needs alignment 1 but size 3. - ofp()->putAlign(nodep->isStatic(), nodep->dtypeSkipRefp()->widthAlignBytes(), - nodep->dtypeSkipRefp()->widthTotalBytes()); if (nodep->isStatic() && prefixIfImp=="") puts("static "); if (nodep->isStatic()) puts("VL_ST_"); else puts("VL_"); if (nodep->widthMin() <= 8) { @@ -1788,7 +1780,6 @@ void EmitCStmts::emitVarList(AstNode* firstp, EisWhich which, const string& pref } } } - ofp()->putAlign(isstatic, 4, 0, prefixIfImp); } } @@ -1908,18 +1899,14 @@ void EmitCImp::emitInt(AstNodeModule* modp) { puts("\n// INTERNAL VARIABLES\n"); if (modp->isTop()) puts("// Internals; generally not touched by application code\n"); ofp()->putsPrivate(!modp->isTop()); // private: unless top - ofp()->putAlign(V3OutFile::AL_AUTO, 8); puts(symClassName()+"*\t__VlSymsp;\t\t// Symbol table\n"); ofp()->putsPrivate(false); // public: if (modp->isTop()) { if (v3Global.opt.inhibitSim()) { - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(bool)); puts("bool\t__Vm_inhibitSim;\t///< Set true to disable evaluation of module\n"); } } - ofp()->putAlign(V3OutFile::AL_AUTO, 8); emitCoverageDecl(modp); // may flip public/private - ofp()->putAlign(V3OutFile::AL_AUTO, 8); puts("\n// PARAMETERS\n"); if (modp->isTop()) puts("// Parameters marked /*verilator public*/ for use by application code\n"); @@ -2400,7 +2387,6 @@ class EmitCTrace : EmitCStmts { if (nodep->initsp()) putsDecoration("// Variables\n"); emitVarList(nodep->initsp(), EVL_ALL, ""); nodep->initsp()->iterateAndNext(*this); - ofp()->putAlign(V3OutFile::AL_AUTO, 4); putsDecoration("// Body\n"); puts("{\n"); diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index 6e861a940..05a459f11 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -303,14 +303,10 @@ void EmitCSyms::emitSymHdr() { ofp()->putsPrivate(false); // public: puts("\n// LOCAL STATE\n"); - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(vluint64_t)); puts("const char* __Vm_namep;\n"); // Must be before subcells, as constructor order needed before _vlCoverInsert. - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(bool)); puts("bool\t__Vm_activity;\t\t///< Used by trace routines to determine change occurred\n"); - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(bool)); puts("bool\t__Vm_didInit;\n"); - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(vluint64_t)); puts("\n// SUBCELL STATE\n"); for (vector::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) { AstScope* scopep = it->first; AstNodeModule* modp = it->second; @@ -326,7 +322,6 @@ void EmitCSyms::emitSymHdr() { puts("\n// COVERAGE\n"); if (m_coverBins) { - ofp()->putAlign(V3OutFile::AL_AUTO, sizeof(uint32_t)); puts("uint32_t\t__Vcoverage["); puts(cvtToStr(m_coverBins)); puts("];\n"); } diff --git a/src/V3File.cpp b/src/V3File.cpp index 2ad8db3cb..7d2391aba 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -553,8 +553,7 @@ bool V3InFilter::readWholefile(const string& filename, V3InFilter::StrList& outl V3OutFormatter::V3OutFormatter(const string& filename, V3OutFormatter::Language lang) : m_filename(filename), m_lang(lang) , m_lineno(1), m_column(0) - , m_nobreak(false), m_prependIndent(true), m_indentLevel(0) - , m_declSAlign(0), m_declNSAlign(0), m_declPadNum(0) { + , m_nobreak(false), m_prependIndent(true), m_indentLevel(0) { m_blockIndent = v3Global.opt.decoration() ? 4 : 1; m_commaWidth = v3Global.opt.decoration() ? 50 : 150; } @@ -797,24 +796,6 @@ void V3OutFormatter::putcNoTracking (char chr) { putcOutput (chr); } -void V3OutFormatter::putAlign (bool/*AlignClass*/ isStatic, int align, int size, const string& prefix) { - if (size==0) size=align; - int alignSize = size; if (alignSize>8) alignSize=8; - int& alignr = isStatic ? m_declSAlign : m_declNSAlign; - int padsize = alignSize - (alignr % alignSize); - if (padsize && padsize!=alignSize) { - // Modern versions of GCC no longer need this, they'll pad for us, so - // we'll save the work and danger of getting it wrong. - puts("//char\t"); - puts(prefix); - puts("__VpadToAlign"+cvtToStr(alignr) - +"["+cvtToStr(padsize)+"];\n"); - alignr += padsize; - m_declPadNum++; - } - alignr += size; -} - //---------------------------------------------------------------------- // Simple wrappers diff --git a/src/V3File.h b/src/V3File.h index c0d36aba7..be2763ac7 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -120,9 +120,6 @@ private: int m_nobreak; // Basic operator or begin paren, don't break next bool m_prependIndent; int m_indentLevel; // Current {} indentation - int m_declSAlign; // Byte alignment of next declaration, statics - int m_declNSAlign; // Byte alignment of next declaration, nonstatics - int m_declPadNum; // Pad variable number stack m_parenVec; // Stack of columns where last ( was int endLevels(const char* strg); @@ -144,7 +141,6 @@ public: void putsQuoted(const string& strg); void putBreak(); // Print linebreak if line is too wide void putBreakExpr(); // Print linebreak in expression if line is too wide - void putAlign(bool isstatic/*AlignClass*/, int align, int size=0/*=align*/, const string& prefix=""); // Declare a variable, with natural alignment void putbs(const char* strg) { putBreakExpr(); puts(strg); } void putbs(const string& strg) { putBreakExpr(); puts(strg); } bool exceededWidth() const { return m_column > m_commaWidth; }