diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index d2bd46310..4e1b8e62c 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -643,7 +643,7 @@ void AstNode::iterateListBackwards(AstNVisitor& v, AstNUser* vup) { while (nodep->m_nextp) nodep=nodep->m_nextp; while (nodep) { // Edits not supported: nodep->m_iterpp = &nodep; - nodep->accept(v, vup); + nodep->accept(v, vup); if (nodep->backp()->m_nextp == nodep) nodep=nodep->backp(); else nodep = NULL; // else: backp points up the tree. } @@ -664,7 +664,7 @@ void AstNode::iterateAndNext(AstNVisitor& v, AstNUser* vup) { for (AstNode* nodep=this; nodep;) { AstNode* niterp = nodep; niterp->m_iterpp = &niterp; - niterp->accept(v, vup); + niterp->accept(v, vup); // accept may do a replaceNode and change niterp on us... if (!niterp) return; niterp->m_iterpp = NULL; @@ -681,7 +681,7 @@ void AstNode::iterateAndNextIgnoreEdit(AstNVisitor& v, AstNUser* vup) { if (!this) return; for (AstNode* nodep=this; nodep; ) { AstNode* nnextp = nodep->m_nextp; - nodep->accept(v, vup); + nodep->accept(v, vup); nodep = nnextp; } } diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index 00fd2cf7f..1d6dd82d5 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -244,12 +244,12 @@ private: //UINFO(4," MOD "<iterateChildren(*this); + nodep->iterateChildren(*this); } virtual void visit(AstScope* nodep, AstNUser*) { //UINFO(4," SCOPE "<iterateChildren(*this); + nodep->iterateChildren(*this); if (AstNode* movep = nodep->finalClksp()) { if (!m_topScopep) nodep->v3fatalSrc("Final clocks under non-top scope"); movep->unlinkFrBackWithNext(); diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 164c90d81..b63d73296 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -391,7 +391,7 @@ private: m_hashed.clear(); // Compute hash of all statement trees in the function m_state = STATE_HASH; - nodep->iterateChildren(*this); + nodep->iterateChildren(*this); m_state = STATE_IDLE; // Walk the hashes removing empty functions if (emptyFunctionDeletion()) { diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 4b0f525c2..9fde50c8b 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -457,7 +457,7 @@ public: // Terminals virtual void visit(AstVarRef* nodep, AstNUser*) { puts(nodep->hiername()); - puts(nodep->varp()->name()); + puts(nodep->varp()->name()); } void emitConstant(AstConst* nodep, AstVarRef* assigntop, const string& assignString) { // Put out constant set to the specified variable, or given variable in a string diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp index e7b360347..6875ed8af 100644 --- a/src/V3EmitV.cpp +++ b/src/V3EmitV.cpp @@ -367,12 +367,12 @@ public: // Terminals virtual void visit(AstVarRef* nodep, AstNUser*) { puts(nodep->hiername()); - puts(nodep->varp()->name()); + puts(nodep->varp()->name()); } virtual void visit(AstVarXRef* nodep, AstNUser*) { puts(nodep->dotted()); puts("."); - puts(nodep->varp()->name()); + puts(nodep->varp()->name()); } virtual void visit(AstConst* nodep, AstNUser*) { puts(nodep->num().ascii(true,true)); diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index de553994c..6637bc9f8 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -669,7 +669,7 @@ private: rhsp->lhsp(), rhsshift), newAstWordSelClone (rhsp->rhsp(), w))); } - return true; + return true; } virtual void visit(AstReplicate* nodep, AstNUser*) { @@ -730,7 +730,7 @@ private: } addWordAssign(nodep, w, newp); } - return true; + return true; } virtual void visit(AstChangeXor* nodep, AstNUser*) { diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index 757c090d6..8d9588615 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -489,7 +489,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) { if (debug()>=5) substp->dumpTree(cout,"\t subst: "); m_statSigs++; while (V3GraphEdge* edgep = vvertexp->outBeginp()) { - GateLogicVertex* consumeVertexp = dynamic_cast(edgep->top()); + GateLogicVertex* consumeVertexp = dynamic_cast(edgep->top()); AstNode* consumerp = consumeVertexp->nodep(); optimizeElimVar(vvertexp->varScp(), substp, consumerp); // If the new replacement referred to a signal, diff --git a/src/V3GraphDfa.cpp b/src/V3GraphDfa.cpp index f01b79bd8..b00e5572b 100644 --- a/src/V3GraphDfa.cpp +++ b/src/V3GraphDfa.cpp @@ -512,7 +512,7 @@ private: void add_complement_edges() { // Find accepting vertex DfaVertex* acceptp = NULL; - for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) { + for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) { if (DfaVertex* vvertexp = dynamic_cast(vertexp)) { if (vvertexp->accepting()) { acceptp = vvertexp; @@ -520,7 +520,7 @@ private: } } } - if (!acceptp) v3fatalSrc("No accepting vertex in DFA\n"); + if (!acceptp) v3fatalSrc("No accepting vertex in DFA\n"); // Remap edges for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) { diff --git a/src/V3GraphDfa.h b/src/V3GraphDfa.h index a44d01049..6c0e111c0 100644 --- a/src/V3GraphDfa.h +++ b/src/V3GraphDfa.h @@ -98,7 +98,7 @@ public: : V3GraphVertex(graphp) , m_start(start), m_accepting(accepting) {} virtual DfaVertex* clone(DfaGraph* graphp) { - return new DfaVertex(graphp, start(), accepting()); } + return new DfaVertex(graphp, start(), accepting()); } virtual ~DfaVertex() {} // ACCESSORS virtual string dotShape() const { return (accepting()?"doublecircle":""); } diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index c40e42f57..1231251aa 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -65,8 +65,8 @@ private: // VISITORS virtual void visit(AstNetlist* nodep, AstNUser*) { - // Iterate modules backwards, in bottom-up order. Required! - nodep->iterateChildrenBackwards(*this); + // Iterate modules backwards, in bottom-up order. Required! + nodep->iterateChildrenBackwards(*this); } virtual void visit(AstModule* nodep, AstNUser*) { if (m_cellp) { diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 0ee382c70..39c8acb2c 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -315,7 +315,7 @@ private: //---- Track control flow changes virtual void visit(AstNodeIf* nodep, AstNUser*) { - UINFO(4," IF "<condp()->iterateAndNext(*this); LifeBlock* prevLifep = m_lifep; @@ -331,7 +331,7 @@ private: nodep->elsesp()->iterateAndNext(*this); m_lifep = prevLifep; } - UINFO(4," join "<dualBranch (ifLifep, elseLifep); // For the next assignments, clear any variables that were read or written in the block @@ -363,7 +363,7 @@ private: nodep->bodysp()->iterateAndNext(*this); m_lifep = prevLifep; } - UINFO(4," joinfor"<lifeToAbove(); bodyLifep->lifeToAbove(); @@ -371,7 +371,7 @@ private: delete bodyLifep; } virtual void visit(AstCCall* nodep, AstNUser*) { - //UINFO(4," CCALL "<iterateChildren(*this); // Enter the function and trace it if (!nodep->funcp()->entryPoint()) { // else is non-inline or public function we optimize separately diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 2ea789324..a45cfcfdd 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -1228,13 +1228,13 @@ void OrderVisitor::processMove() { // Recompute the next domScopep to process if (scopeHuntp) { domScopep = scopeHuntp; - UINFO(6," MoveIt: SameScope "<<*domScopep<domainp()->v3fatalSrc("Can't find more nodes like "<<*domScopep); // Should be at least a "end loop" @@ -1250,34 +1250,34 @@ void OrderVisitor::processMove() { } } if (!m_pomWaiting.empty()) { - OrderMoveVertex* vertexp = m_pomWaiting.begin(); + OrderMoveVertex* vertexp = m_pomWaiting.begin(); vertexp->logicp()->nodep()->v3fatalSrc("Didn't converge; nodes waiting, none ready, perhaps some input activations lost: "<readyVertices().begin(); - UASSERT(topVertexp, "domScope on ready list without any nodes ready under it"); - // Work on all scopes ready inside this domain - while (domScopep) { - UINFO(6," MoveDomain l="<domainp()<readyVertices().begin()) { - processMoveOne(vertexp, domScopep, 1); - } - // Done with scope/domain pair, pick new scope under same domain, or NULL if none left - OrderMoveDomScope* domScopeNextp = NULL; - for (OrderMoveDomScope* huntp = m_pomReadyDomScope.begin(); - huntp; huntp = huntp->readyDomScopeNextp()) { - if (huntp->domainp() == domScopep->domainp()) { - domScopeNextp = huntp; - break; - } - } - domScopep = domScopeNextp; - } + // Start with top node on ready list's domain & scope + OrderMoveDomScope* domScopep = m_pomReadyDomScope.begin(); + OrderMoveVertex* topVertexp = domScopep->readyVertices().begin(); + UASSERT(topVertexp, "domScope on ready list without any nodes ready under it"); + // Work on all scopes ready inside this domain + while (domScopep) { + UINFO(6," MoveDomain l="<domainp()<readyVertices().begin()) { + processMoveOne(vertexp, domScopep, 1); + } + // Done with scope/domain pair, pick new scope under same domain, or NULL if none left + OrderMoveDomScope* domScopeNextp = NULL; + for (OrderMoveDomScope* huntp = m_pomReadyDomScope.begin(); + huntp; huntp = huntp->readyDomScopeNextp()) { + if (huntp->domainp() == domScopep->domainp()) { + domScopeNextp = huntp; + break; + } + } + domScopep = domScopeNextp; + } } UASSERT (m_pomWaiting.empty(), "Didn't converge; nodes waiting, none ready, perhaps some input activations lost."); #endif diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 4dbfd6e4a..29f2c9582 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -89,8 +89,8 @@ psl [p]sl /* Optional directives we recognize */ "`__FILE__" { if (!pedantic()) { - yytext = (char*)V3PreLex::s_currentLexp->m_curFilelinep->cfilename(); - yyleng = strlen(yytext); return (VP_TEXT); + yytext = (char*)V3PreLex::s_currentLexp->m_curFilelinep->cfilename(); + yyleng = strlen(yytext); return (VP_TEXT); } else return(VP_DEFREF); } "`__LINE__" { if (!pedantic()) { static char buf[10]; @@ -153,18 +153,18 @@ psl [p]sl appendDefValue(yytext,yyleng); } else { return (VP_TEXT); - }} + }} [)] { V3PreLex::s_currentLexp->m_parenLevel--; if (V3PreLex::s_currentLexp->m_parenLevel>0) { appendDefValue(yytext,yyleng); } else { yy_pop_state(); return (VP_DEFARG); - }} + }} [,] { if (V3PreLex::s_currentLexp->m_parenLevel>1) { appendDefValue(yytext,yyleng); } else { yy_pop_state(); return (VP_DEFARG); - }} + }} "`"{symb} { return (VP_DEFREF); } /* defref in defref */ [^\/\*\n\r\\(,){}\[\]\"`]+ | . { appendDefValue(yytext,yyleng); } diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 79b96c668..65e22fe18 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -707,7 +707,7 @@ int V3PreProcImp::getToken() { } } case ps_DEFVALUE: { - static string newlines; + static string newlines; newlines = "\n"; // Always start with trailing return if (tok == VP_DEFVALUE) { // Remove returns @@ -735,7 +735,7 @@ int V3PreProcImp::getToken() { // Remove leading whitespace unsigned leadspace = 0; while (m_lexp->m_defValue.length() > leadspace - && isspace(m_lexp->m_defValue[leadspace])) leadspace++; + && isspace(m_lexp->m_defValue[leadspace])) leadspace++; if (leadspace) m_lexp->m_defValue.erase(0,leadspace); // Remove trailing whitespace unsigned trailspace = 0; diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 28ad08e96..7bf8e6301 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -59,7 +59,7 @@ private: // METHODS bool assignNoTemp(AstNodeAssign* nodep) { - return (nodep->lhsp()->castVarRef() + return (nodep->lhsp()->castVarRef() && !nodep->lhsp()->castVarRef()->varp()->isSc() && nodep->rhsp()->castConst()); } diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index 8c32bec5b..220606854 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -74,7 +74,7 @@ private: UINFO(4," MOD AT "<fileline(), + m_scopep = new AstScope((m_aboveCellp?(AstNode*)m_aboveCellp:(AstNode*)nodep)->fileline(), nodep, scopename, m_aboveScopep, m_aboveCellp); // Now for each child cell, iterate the module this cell points to diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp index 666e583e5..9bdbefba1 100644 --- a/src/V3Stats.cpp +++ b/src/V3Stats.cpp @@ -109,7 +109,7 @@ private: } } virtual void visit(AstNodeIf* nodep, AstNUser*) { - UINFO(4," IF "<condp()->iterateAndNext(*this); @@ -159,7 +159,7 @@ private: //virtual void visit(AstWhile* nodep, AstNUser*) { virtual void visit(AstCCall* nodep, AstNUser*) { - //UINFO(4," CCALL "<iterateChildren(*this); if (m_fast) { diff --git a/src/V3Table.cpp b/src/V3Table.cpp index dd87348de..d49316332 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -336,7 +336,7 @@ public: void clear() { m_whyNotOptimizable = NULL; m_anyAssignComb = false; - m_anyAssignDly = false; + m_anyAssignDly = false; m_inDlyAssign = false; m_instrCount = 0; m_dataCount = 0; diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 819804a63..e514d9c3d 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -547,7 +547,7 @@ private: } virtual void visit(AstCFunc* nodep, AstNUser*) { UINFO(8," CFUNC "<funcType() == AstCFuncType::TRACE_INIT) { + if (nodep->funcType() == AstCFuncType::TRACE_INIT) { m_initFuncp = nodep; } else if (nodep->funcType() == AstCFuncType::TRACE_FULL) { m_fullFuncp = nodep; diff --git a/src/verilog.l b/src/verilog.l index 9047c3c4c..e5e17789a 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -673,15 +673,15 @@ escid \\[^ \t\f\r\n]+ return yaINTNUM; } [0-9][_0-9]*(\.[_0-9]+)([eE][-+]?[_0-9]+)? { - yylval.cdouble = 0; /* Only for delays, not used yet */ + yylval.cdouble = 0; /* Only for delays, not used yet */ return yaFLOATNUM; } [0-9][_0-9]*(\.[_0-9]+)?([eE][-+]?[_0-9]+) { - yylval.cdouble = 0; /* Only for delays, not used yet */ + yylval.cdouble = 0; /* Only for delays, not used yet */ return yaFLOATNUM; } [0-9][_0-9]*(\.[_0-9]+)?(fs|ps|ns|us|ms|s|step) { - yylval.cdouble = 0; /* Only for times, not used yet */ + yylval.cdouble = 0; /* Only for times, not used yet */ return yaFLOATNUM; } } diff --git a/src/verilog.y b/src/verilog.y index c01a707cf..7f968393e 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -505,7 +505,7 @@ port: yaID portRangeE { $$ = new AstPort(CRELINE(),V3Parse::s_pinNum+ portV2kArgs: portV2kDecl { $$ = $1; } | portV2kDecl ',' portV2kList { $$ = $1->addNext($3); } - ; + ; portV2kList: portV2kSecond { $$ = $1; } | portV2kList ',' portV2kSecond { $$ = $1->addNext($3); }