diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h index 904547e56..194ba3e62 100644 --- a/include/verilated_vcd_c.h +++ b/include/verilated_vcd_c.h @@ -86,8 +86,8 @@ private: NameMap* m_namemapp; ///< List of names for the header static vector s_vcdVecp; ///< List of all created traces - inline size_t bufferSize() { return 256*1024; } // See below for slack calculation - inline size_t bufferInsertSize() { return 16*1024; } + inline static size_t bufferSize() { return 256*1024; } // See below for slack calculation + inline static size_t bufferInsertSize() { return 16*1024; } void bufferFlush(); void bufferCheck() { // Flush the write buffer if there's not enough space left for new information diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index c99b2c955..5c4a4814d 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -184,7 +184,7 @@ private: } if (nodep->fullPragma() || nodep->priorityPragma()) { // Simply need to add a default if there isn't one already - m_statAsFull++; + ++m_statAsFull; if (!has_default) { nodep->addItemsp(new AstCaseItem(nodep->fileline(), NULL/*DEFAULT*/, newFireAssert(nodep, "synthesis full_case, but non-match found"))); @@ -193,7 +193,7 @@ private: if (nodep->parallelPragma() || nodep->uniquePragma() || nodep->unique0Pragma()) { // Need to check that one, and only one of the case items match at any moment // If there's a default, we allow none to match, else exactly one must match - m_statAsFull++; + ++m_statAsFull; if (!has_default && !nodep->itemsp()) { // Not parallel, but harmlessly so. } else { @@ -241,18 +241,18 @@ private: if (m_beginp && nodep->name() == "") nodep->name(m_beginp->name()); newPslAssertion(nodep, nodep->propp(), nodep->sentreep(), nodep->stmtsp(), nodep->name()); nodep=NULL; - m_statAsCover++; + ++m_statAsCover; } virtual void visit(AstPslAssert* nodep, AstNUser*) { nodep->iterateChildren(*this); newPslAssertion(nodep, nodep->propp(), nodep->sentreep(), NULL, nodep->name()); nodep=NULL; - m_statAsPsl++; + ++m_statAsPsl; } virtual void visit(AstVAssert* nodep, AstNUser*) { nodep->iterateChildren(*this); newVAssertion(nodep, nodep->propp()); nodep=NULL; - m_statAsSV++; + ++m_statAsSV; } virtual void visit(AstNodeModule* nodep, AstNUser*) { diff --git a/src/V3Case.cpp b/src/V3Case.cpp index 40aebfb6a..cce5c4330 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -452,10 +452,10 @@ private: if (isCaseTreeFast(nodep) && v3Global.opt.oCase()) { // It's a simple priority encoder or complete statement // we can make a tree of statements to avoid extra comparisons - m_statCaseFast++; + ++m_statCaseFast; replaceCaseFast(nodep); nodep=NULL; } else { - m_statCaseSlow++; + ++m_statCaseSlow; replaceCaseComplicated(nodep); nodep=NULL; } } diff --git a/src/V3ClkGater.cpp b/src/V3ClkGater.cpp index 7bb94639c..4d77063b9 100644 --- a/src/V3ClkGater.cpp +++ b/src/V3ClkGater.cpp @@ -696,7 +696,7 @@ class GaterVisitor : public GaterBaseVisitor { // Blow old statements from new body GaterBodyVisitor(alwp,exprp,false); - m_statGaters++; + ++m_statGaters; if (debug()>=9) alwp->dumpTree(cout," new: "); } diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 4628694ff..ba3f34218 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -70,8 +70,8 @@ protected: virtual ~CombBaseVisitor() {} //***** optimization levels - bool emptyFunctionDeletion() { return true; } - bool duplicateFunctionCombine() { return true; } + static bool emptyFunctionDeletion() { return true; } + static bool duplicateFunctionCombine() { return true; } // Note this is disabled, it still needed work // Also repair it for DPI functions; when make __common need to insure proper // flags get inherited from the old to new AstCFunc, and that AstText doesn't @@ -257,7 +257,7 @@ private: UINFO(5," DupFunc "<user4p())<<" "<user4p())<<" "<unlinkFrBack(); diff --git a/src/V3CoverageJoin.cpp b/src/V3CoverageJoin.cpp index 1dbc55769..a410ee831 100644 --- a/src/V3CoverageJoin.cpp +++ b/src/V3CoverageJoin.cpp @@ -97,7 +97,7 @@ private: removep->unlinkFrBack(); pushDeletep(removep); removep=NULL; // Remove node from comparison so don't hit it again hashed.erase(dupit); - m_statToggleJoins++; + ++m_statToggleJoins; } } } diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index 3bf0dcbb8..ae3da5127 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -224,7 +224,6 @@ private: } // //=== Setting/not setting boolean: __Vdlyvset__ - bool sharedVset = false; AstVarScope* setvscp; if (nodep->user3p()) { @@ -232,9 +231,8 @@ private: // then we told this nodep->user3 we can use its Vdlyvset rather than making a new one. // This is good for code like: // for (i=0; i<5; i++) vector[i] <= something; - sharedVset = true; setvscp = nodep->user3p()->castNode()->castVarScope(); - m_statSharedSet++; + ++m_statSharedSet; } else { // Create new one string setvarname = (string("__Vdlyvset__")+oldvarp->shortName()+"__v"+cvtToStr(modVecNum)); setvscp = createVarSc(varrefp->varScopep(), setvarname, 1); diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index 0293e496e..34e0a9e5c 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -535,7 +535,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) { AstNode* substp = okVisitor.substTree(); if (debug()>=5) logicp->dumpTree(cout,"\telimVar: "); if (debug()>=5) substp->dumpTree(cout,"\t subst: "); - m_statSigs++; + ++m_statSigs; while (V3GraphEdge* edgep = vvertexp->outBeginp()) { GateLogicVertex* consumeVertexp = dynamic_cast(edgep->top()); AstNode* consumerp = consumeVertexp->nodep(); @@ -557,7 +557,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) { } // Remove the edge edgep->unlinkDelete(); edgep=NULL; - m_statRefs++; + ++m_statRefs; } // Remove input links while (V3GraphEdge* edgep = vvertexp->inBeginp()) { diff --git a/src/V3GraphDfa.cpp b/src/V3GraphDfa.cpp index ffe5d1246..a13dc92b3 100644 --- a/src/V3GraphDfa.cpp +++ b/src/V3GraphDfa.cpp @@ -70,7 +70,7 @@ private: // MEMBERS uint32_t m_step; // Processing step, so we can avoid clearUser all the time HashMap m_hashMap; // Dfa Vertex for each set of NFA vertexes - int debug() { return 0; } + static int debug() { return 0; } // METHODS DfaGraph* graphp() { return static_cast(m_graphp); } @@ -94,7 +94,7 @@ private: } // Hashing - uint32_t hashVertex(V3GraphVertex* vertexp) { + static uint32_t hashVertex(V3GraphVertex* vertexp) { union { void* up; struct {uint32_t upper; uint32_t lower;} l;} u; u.l.upper=0; u.l.lower=0; u.up=vertexp; return u.l.upper ^ u.l.lower; @@ -362,7 +362,7 @@ void DfaGraph::nfaToDfa() { class DfaGraphReduce : GraphAlg { private: // METHODS - int debug() { return 0; } + static int debug() { return 0; } DfaGraph* graphp() { return static_cast(m_graphp); } bool isDead(DfaVertex* vertexp) { @@ -507,7 +507,7 @@ private: DfaVertex* m_tempNewerReject; // METHODS - int debug() { return 9; } + static int debug() { return 9; } DfaGraph* graphp() { return static_cast(m_graphp); } void add_complement_edges() { diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 60f2fa4f4..aa67969a1 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -106,7 +106,7 @@ private: if (m_cellp) nodep->v3error("Cloning should have already been done bottom-up"); UINFO(5," Inline CELL "<varScopep()->user4p(lhsp->varScopep()); nodep->unlinkFrBack()->deleteTree(); nodep=NULL; - m_statAssnDel++; + ++m_statAssnDel; } } } diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index c53ba7749..601c88245 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -141,7 +141,7 @@ private: && nodep->user1p()) { // Single cfunc // We don't need to test for tracing; it would be in the tracefunc if it was needed UINFO(4," ModVar->BlkVar "<user1p()->castNode()->castCFunc(); nodep->unlinkFrBack(); newfuncp->addInitsp(nodep); diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 39e9d8270..bcfde4418 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -416,9 +416,9 @@ bool V3Number::displayedFmtLegal(char format) { string V3Number::displayed(const string& vformat) const { string::const_iterator pos = vformat.begin(); UASSERT(pos != vformat.end() && pos[0]=='%', "display with non format argument "<<*this); - pos++; + ++pos; string fmtsize; - for (; pos != vformat.end() && (isdigit(pos[0]) || pos[0]=='.'); pos++) { + for (; pos != vformat.end() && (isdigit(pos[0]) || pos[0]=='.'); ++pos) { fmtsize += pos[0]; } string str; diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index b11695f2c..a07a56414 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -127,7 +127,7 @@ struct V3PreProcImp : public V3PreProc { ps_DEFNAME_IFDEF, ps_DEFNAME_IFNDEF, ps_DEFNAME_ELSIF, ps_DEFFORM, ps_DEFVALUE, ps_DEFPAREN, ps_DEFARG, ps_INCNAME, ps_ERRORNAME, ps_JOIN, ps_STRIFY }; - const char* procStateName(ProcState s) { + static const char* procStateName(ProcState s) { static const char* states[] = {"ps_TOP", "ps_DEFNAME_UNDEF", "ps_DEFNAME_DEFINE", diff --git a/src/V3PreProc.h b/src/V3PreProc.h index 6a30b33d2..c7fd7b0aa 100644 --- a/src/V3PreProc.h +++ b/src/V3PreProc.h @@ -67,10 +67,10 @@ public: // CONTROL METHODS // These options control how the parsing proceeds - int keepComments() { return 2; } // Return comments, 0=no, 1=yes, 2=callback - bool keepWhitespace() { return false; } - bool lineDirectives() { return true; } // Insert `line directives - bool pedantic() { return false; } // Obey standard; Don't substitute `error + static int keepComments() { return 2; } // Return comments, 0=no, 1=yes, 2=callback + static bool keepWhitespace() { return false; } + static bool lineDirectives() { return true; } // Insert `line directives + static bool pedantic() { return false; } // Obey standard; Don't substitute `error static bool optPsl(); // CALLBACK METHODS diff --git a/src/V3Split.cpp b/src/V3Split.cpp index c6f772e71..eb0f57875 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -413,7 +413,7 @@ private: newListp = newListp->addNext(nextp); } if (splitAlwaysp) { - m_statSplits++; + ++m_statSplits; AstAlways* alwaysp = new AstAlways(newListp->fileline(), NULL, NULL); addAfterp->addNextHere(alwaysp); addAfterp=alwaysp; alwaysp->addStmtp(newListp); diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp index 8ee5d6f6e..e4898896d 100644 --- a/src/V3SplitAs.cpp +++ b/src/V3SplitAs.cpp @@ -185,7 +185,7 @@ private: // Now isolate the always if (m_splitVscp) { splitAlways(nodep); - m_statSplits++; + ++m_statSplits; } else { nodep->user1(true); } diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index f3922af5c..5533f6bb2 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -309,7 +309,7 @@ private: if (debug()>5) newp->dumpTree(cout," w_new: "); nodep->replaceWith(newp); pushDeletep(nodep); nodep=NULL; - m_statSubsts++; + ++m_statSubsts; } virtual void visit(AstWordSel* nodep, AstNUser*) { nodep->rhsp()->accept(*this); diff --git a/src/V3Table.cpp b/src/V3Table.cpp index e520a6c35..3caaca866 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -176,8 +176,8 @@ public: private: void createTable(AstAlways* nodep) { // We've determined this table of nodes is optimizable, do it. - m_modTables++; - m_statTablesCre++; + ++m_modTables; + ++m_statTablesCre; // Index into our table AstVar* indexVarp = new AstVar (nodep->fileline(), AstVarType::BLOCKTEMP, diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index e9dfa63fc..2fc6e8822 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -484,7 +484,7 @@ private: nodep->code(m_code); m_code += nodep->codeInc(); m_statUniqCodes += nodep->codeInc(); - m_statUniqSigs++; + ++m_statUniqSigs; } return nodep->code(); } @@ -517,7 +517,7 @@ private: if (!codePreassigned) { // Add to trace cfuncs if (needChg) { - m_statChgSigs++; + ++m_statChgSigs; incAddp = nodep->cloneTree(true); } diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index cc105b6d7..3c8342dc6 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -137,12 +137,12 @@ private: if (showname.substr(0,4) == "TOP ") showname.replace(0,4,""); if (!m_initSubFuncp) nodep->v3fatalSrc("NULL"); if (varIgnoreTrace(varp)) { - m_statIgnSigs++; + ++m_statIgnSigs; m_initSubFuncp->addStmtsp( new AstComment(nodep->fileline(), "Tracing: "+showname+" // Ignored: "+varIgnoreTrace(varp))); } else { - m_statSigs++; + ++m_statSigs; AstNode* valuep = NULL; if (nodep->valuep()) valuep=nodep->valuep()->cloneTree(true); else valuep = new AstVarRef(nodep->fileline(), nodep, false); diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index f1106c800..905816907 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -289,7 +289,7 @@ private: AstVar* newvarp = new AstVar (nodep->fileline(), AstVarType::XTEMP, newvarname, AstLogicPacked(), nodep->width()); - m_statUnkVars++; + ++m_statUnkVars; AstNRelinker replaceHandle; nodep->unlinkFrBack(&replaceHandle); AstNodeVarRef* newref1p = new AstVarRef(nodep->fileline(), newvarp, false); diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index 9a16a9669..130eaaf13 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -259,7 +259,7 @@ private: loopValue.opAssign(numInit); AstNode* newbodysp = NULL; - m_statLoops++; + ++m_statLoops; if (stmtsp) { int times = 0; while (1) { @@ -287,7 +287,7 @@ private: if (newbodysp) newbodysp->addNext(oneloopp); else newbodysp = oneloopp; - m_statIters++; + ++m_statIters; if (++times > unrollCount()*3) { nodep->v3error("Loop unrolling took too long; probably this is an infinite loop, or set --unroll-count above "<