Fix leading/trailing mixed whitespace
This commit is contained in:
parent
3073db4e81
commit
499f98a51c
|
|
@ -643,7 +643,7 @@ void AstNode::iterateListBackwards(AstNVisitor& v, AstNUser* vup) {
|
||||||
while (nodep->m_nextp) nodep=nodep->m_nextp;
|
while (nodep->m_nextp) nodep=nodep->m_nextp;
|
||||||
while (nodep) {
|
while (nodep) {
|
||||||
// Edits not supported: nodep->m_iterpp = &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();
|
if (nodep->backp()->m_nextp == nodep) nodep=nodep->backp();
|
||||||
else nodep = NULL; // else: backp points up the tree.
|
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;) {
|
for (AstNode* nodep=this; nodep;) {
|
||||||
AstNode* niterp = nodep;
|
AstNode* niterp = nodep;
|
||||||
niterp->m_iterpp = &niterp;
|
niterp->m_iterpp = &niterp;
|
||||||
niterp->accept(v, vup);
|
niterp->accept(v, vup);
|
||||||
// accept may do a replaceNode and change niterp on us...
|
// accept may do a replaceNode and change niterp on us...
|
||||||
if (!niterp) return;
|
if (!niterp) return;
|
||||||
niterp->m_iterpp = NULL;
|
niterp->m_iterpp = NULL;
|
||||||
|
|
@ -681,7 +681,7 @@ void AstNode::iterateAndNextIgnoreEdit(AstNVisitor& v, AstNUser* vup) {
|
||||||
if (!this) return;
|
if (!this) return;
|
||||||
for (AstNode* nodep=this; nodep; ) {
|
for (AstNode* nodep=this; nodep; ) {
|
||||||
AstNode* nnextp = nodep->m_nextp;
|
AstNode* nnextp = nodep->m_nextp;
|
||||||
nodep->accept(v, vup);
|
nodep->accept(v, vup);
|
||||||
nodep = nnextp;
|
nodep = nnextp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,12 +244,12 @@ private:
|
||||||
//UINFO(4," MOD "<<nodep<<endl);
|
//UINFO(4," MOD "<<nodep<<endl);
|
||||||
m_modp = nodep;
|
m_modp = nodep;
|
||||||
m_stableNum = 0;
|
m_stableNum = 0;
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
}
|
}
|
||||||
virtual void visit(AstScope* nodep, AstNUser*) {
|
virtual void visit(AstScope* nodep, AstNUser*) {
|
||||||
//UINFO(4," SCOPE "<<nodep<<endl);
|
//UINFO(4," SCOPE "<<nodep<<endl);
|
||||||
m_scopep = nodep;
|
m_scopep = nodep;
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
if (AstNode* movep = nodep->finalClksp()) {
|
if (AstNode* movep = nodep->finalClksp()) {
|
||||||
if (!m_topScopep) nodep->v3fatalSrc("Final clocks under non-top scope");
|
if (!m_topScopep) nodep->v3fatalSrc("Final clocks under non-top scope");
|
||||||
movep->unlinkFrBackWithNext();
|
movep->unlinkFrBackWithNext();
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ private:
|
||||||
m_hashed.clear();
|
m_hashed.clear();
|
||||||
// Compute hash of all statement trees in the function
|
// Compute hash of all statement trees in the function
|
||||||
m_state = STATE_HASH;
|
m_state = STATE_HASH;
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
m_state = STATE_IDLE;
|
m_state = STATE_IDLE;
|
||||||
// Walk the hashes removing empty functions
|
// Walk the hashes removing empty functions
|
||||||
if (emptyFunctionDeletion()) {
|
if (emptyFunctionDeletion()) {
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ public:
|
||||||
// Terminals
|
// Terminals
|
||||||
virtual void visit(AstVarRef* nodep, AstNUser*) {
|
virtual void visit(AstVarRef* nodep, AstNUser*) {
|
||||||
puts(nodep->hiername());
|
puts(nodep->hiername());
|
||||||
puts(nodep->varp()->name());
|
puts(nodep->varp()->name());
|
||||||
}
|
}
|
||||||
void emitConstant(AstConst* nodep, AstVarRef* assigntop, const string& assignString) {
|
void emitConstant(AstConst* nodep, AstVarRef* assigntop, const string& assignString) {
|
||||||
// Put out constant set to the specified variable, or given variable in a string
|
// Put out constant set to the specified variable, or given variable in a string
|
||||||
|
|
|
||||||
|
|
@ -367,12 +367,12 @@ public:
|
||||||
// Terminals
|
// Terminals
|
||||||
virtual void visit(AstVarRef* nodep, AstNUser*) {
|
virtual void visit(AstVarRef* nodep, AstNUser*) {
|
||||||
puts(nodep->hiername());
|
puts(nodep->hiername());
|
||||||
puts(nodep->varp()->name());
|
puts(nodep->varp()->name());
|
||||||
}
|
}
|
||||||
virtual void visit(AstVarXRef* nodep, AstNUser*) {
|
virtual void visit(AstVarXRef* nodep, AstNUser*) {
|
||||||
puts(nodep->dotted());
|
puts(nodep->dotted());
|
||||||
puts(".");
|
puts(".");
|
||||||
puts(nodep->varp()->name());
|
puts(nodep->varp()->name());
|
||||||
}
|
}
|
||||||
virtual void visit(AstConst* nodep, AstNUser*) {
|
virtual void visit(AstConst* nodep, AstNUser*) {
|
||||||
puts(nodep->num().ascii(true,true));
|
puts(nodep->num().ascii(true,true));
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,7 @@ private:
|
||||||
rhsp->lhsp(), rhsshift),
|
rhsp->lhsp(), rhsshift),
|
||||||
newAstWordSelClone (rhsp->rhsp(), w)));
|
newAstWordSelClone (rhsp->rhsp(), w)));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(AstReplicate* nodep, AstNUser*) {
|
virtual void visit(AstReplicate* nodep, AstNUser*) {
|
||||||
|
|
@ -730,7 +730,7 @@ private:
|
||||||
}
|
}
|
||||||
addWordAssign(nodep, w, newp);
|
addWordAssign(nodep, w, newp);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(AstChangeXor* nodep, AstNUser*) {
|
virtual void visit(AstChangeXor* nodep, AstNUser*) {
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
|
||||||
if (debug()>=5) substp->dumpTree(cout,"\t subst: ");
|
if (debug()>=5) substp->dumpTree(cout,"\t subst: ");
|
||||||
m_statSigs++;
|
m_statSigs++;
|
||||||
while (V3GraphEdge* edgep = vvertexp->outBeginp()) {
|
while (V3GraphEdge* edgep = vvertexp->outBeginp()) {
|
||||||
GateLogicVertex* consumeVertexp = dynamic_cast<GateLogicVertex*>(edgep->top());
|
GateLogicVertex* consumeVertexp = dynamic_cast<GateLogicVertex*>(edgep->top());
|
||||||
AstNode* consumerp = consumeVertexp->nodep();
|
AstNode* consumerp = consumeVertexp->nodep();
|
||||||
optimizeElimVar(vvertexp->varScp(), substp, consumerp);
|
optimizeElimVar(vvertexp->varScp(), substp, consumerp);
|
||||||
// If the new replacement referred to a signal,
|
// If the new replacement referred to a signal,
|
||||||
|
|
|
||||||
|
|
@ -512,7 +512,7 @@ private:
|
||||||
void add_complement_edges() {
|
void add_complement_edges() {
|
||||||
// Find accepting vertex
|
// Find accepting vertex
|
||||||
DfaVertex* acceptp = NULL;
|
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<DfaVertex*>(vertexp)) {
|
if (DfaVertex* vvertexp = dynamic_cast<DfaVertex*>(vertexp)) {
|
||||||
if (vvertexp->accepting()) {
|
if (vvertexp->accepting()) {
|
||||||
acceptp = vvertexp;
|
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
|
// Remap edges
|
||||||
for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
|
for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public:
|
||||||
: V3GraphVertex(graphp)
|
: V3GraphVertex(graphp)
|
||||||
, m_start(start), m_accepting(accepting) {}
|
, m_start(start), m_accepting(accepting) {}
|
||||||
virtual DfaVertex* clone(DfaGraph* graphp) {
|
virtual DfaVertex* clone(DfaGraph* graphp) {
|
||||||
return new DfaVertex(graphp, start(), accepting()); }
|
return new DfaVertex(graphp, start(), accepting()); }
|
||||||
virtual ~DfaVertex() {}
|
virtual ~DfaVertex() {}
|
||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
virtual string dotShape() const { return (accepting()?"doublecircle":""); }
|
virtual string dotShape() const { return (accepting()?"doublecircle":""); }
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ private:
|
||||||
|
|
||||||
// VISITORS
|
// VISITORS
|
||||||
virtual void visit(AstNetlist* nodep, AstNUser*) {
|
virtual void visit(AstNetlist* nodep, AstNUser*) {
|
||||||
// Iterate modules backwards, in bottom-up order. Required!
|
// Iterate modules backwards, in bottom-up order. Required!
|
||||||
nodep->iterateChildrenBackwards(*this);
|
nodep->iterateChildrenBackwards(*this);
|
||||||
}
|
}
|
||||||
virtual void visit(AstModule* nodep, AstNUser*) {
|
virtual void visit(AstModule* nodep, AstNUser*) {
|
||||||
if (m_cellp) {
|
if (m_cellp) {
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ private:
|
||||||
|
|
||||||
//---- Track control flow changes
|
//---- Track control flow changes
|
||||||
virtual void visit(AstNodeIf* nodep, AstNUser*) {
|
virtual void visit(AstNodeIf* nodep, AstNUser*) {
|
||||||
UINFO(4," IF "<<nodep<<endl);
|
UINFO(4," IF "<<nodep<<endl);
|
||||||
// Condition is part of PREVIOUS block
|
// Condition is part of PREVIOUS block
|
||||||
nodep->condp()->iterateAndNext(*this);
|
nodep->condp()->iterateAndNext(*this);
|
||||||
LifeBlock* prevLifep = m_lifep;
|
LifeBlock* prevLifep = m_lifep;
|
||||||
|
|
@ -331,7 +331,7 @@ private:
|
||||||
nodep->elsesp()->iterateAndNext(*this);
|
nodep->elsesp()->iterateAndNext(*this);
|
||||||
m_lifep = prevLifep;
|
m_lifep = prevLifep;
|
||||||
}
|
}
|
||||||
UINFO(4," join "<<endl);
|
UINFO(4," join "<<endl);
|
||||||
// Find sets on both flows
|
// Find sets on both flows
|
||||||
m_lifep->dualBranch (ifLifep, elseLifep);
|
m_lifep->dualBranch (ifLifep, elseLifep);
|
||||||
// For the next assignments, clear any variables that were read or written in the block
|
// For the next assignments, clear any variables that were read or written in the block
|
||||||
|
|
@ -363,7 +363,7 @@ private:
|
||||||
nodep->bodysp()->iterateAndNext(*this);
|
nodep->bodysp()->iterateAndNext(*this);
|
||||||
m_lifep = prevLifep;
|
m_lifep = prevLifep;
|
||||||
}
|
}
|
||||||
UINFO(4," joinfor"<<endl);
|
UINFO(4," joinfor"<<endl);
|
||||||
// For the next assignments, clear any variables that were read or written in the block
|
// For the next assignments, clear any variables that were read or written in the block
|
||||||
condLifep->lifeToAbove();
|
condLifep->lifeToAbove();
|
||||||
bodyLifep->lifeToAbove();
|
bodyLifep->lifeToAbove();
|
||||||
|
|
@ -371,7 +371,7 @@ private:
|
||||||
delete bodyLifep;
|
delete bodyLifep;
|
||||||
}
|
}
|
||||||
virtual void visit(AstCCall* nodep, AstNUser*) {
|
virtual void visit(AstCCall* nodep, AstNUser*) {
|
||||||
//UINFO(4," CCALL "<<nodep<<endl);
|
//UINFO(4," CCALL "<<nodep<<endl);
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
// Enter the function and trace it
|
// Enter the function and trace it
|
||||||
if (!nodep->funcp()->entryPoint()) { // else is non-inline or public function we optimize separately
|
if (!nodep->funcp()->entryPoint()) { // else is non-inline or public function we optimize separately
|
||||||
|
|
|
||||||
|
|
@ -1228,13 +1228,13 @@ void OrderVisitor::processMove() {
|
||||||
// Recompute the next domScopep to process
|
// Recompute the next domScopep to process
|
||||||
if (scopeHuntp) {
|
if (scopeHuntp) {
|
||||||
domScopep = scopeHuntp;
|
domScopep = scopeHuntp;
|
||||||
UINFO(6," MoveIt: SameScope "<<*domScopep<<endl);
|
UINFO(6," MoveIt: SameScope "<<*domScopep<<endl);
|
||||||
} else if (domHuntp) { // No exact scope matches, try only matching the domain
|
} else if (domHuntp) { // No exact scope matches, try only matching the domain
|
||||||
domScopep = domHuntp;
|
domScopep = domHuntp;
|
||||||
UINFO(6," MoveIt: SameDomain "<<*domScopep<<endl);
|
UINFO(6," MoveIt: SameDomain "<<*domScopep<<endl);
|
||||||
} else if (loopHuntp) { // No exact scope or domain matches, only match the loop
|
} else if (loopHuntp) { // No exact scope or domain matches, only match the loop
|
||||||
domScopep = loopHuntp;
|
domScopep = loopHuntp;
|
||||||
UINFO(6," MoveIt: SameLoop "<<*domScopep<<endl);
|
UINFO(6," MoveIt: SameLoop "<<*domScopep<<endl);
|
||||||
} else { // else we're hopefully all done
|
} else { // else we're hopefully all done
|
||||||
if (curLoop != LOOPID_NOTLOOPED)
|
if (curLoop != LOOPID_NOTLOOPED)
|
||||||
domScopep->domainp()->v3fatalSrc("Can't find more nodes like "<<*domScopep); // Should be at least a "end loop"
|
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()) {
|
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: "<<vertexp<<endl);
|
vertexp->logicp()->nodep()->v3fatalSrc("Didn't converge; nodes waiting, none ready, perhaps some input activations lost: "<<vertexp<<endl);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
while (!m_pomReadyDomScope.empty()) {
|
while (!m_pomReadyDomScope.empty()) {
|
||||||
// Start with top node on ready list's domain & scope
|
// Start with top node on ready list's domain & scope
|
||||||
OrderMoveDomScope* domScopep = m_pomReadyDomScope.begin();
|
OrderMoveDomScope* domScopep = m_pomReadyDomScope.begin();
|
||||||
OrderMoveVertex* topVertexp = domScopep->readyVertices().begin();
|
OrderMoveVertex* topVertexp = domScopep->readyVertices().begin();
|
||||||
UASSERT(topVertexp, "domScope on ready list without any nodes ready under it");
|
UASSERT(topVertexp, "domScope on ready list without any nodes ready under it");
|
||||||
// Work on all scopes ready inside this domain
|
// Work on all scopes ready inside this domain
|
||||||
while (domScopep) {
|
while (domScopep) {
|
||||||
UINFO(6," MoveDomain l="<<domScopep->domainp()<<endl);
|
UINFO(6," MoveDomain l="<<domScopep->domainp()<<endl);
|
||||||
// Process all nodes ready under same domain & scope
|
// Process all nodes ready under same domain & scope
|
||||||
m_pomNewFuncp = NULL;
|
m_pomNewFuncp = NULL;
|
||||||
while (OrderMoveVertex* vertexp = domScopep->readyVertices().begin()) {
|
while (OrderMoveVertex* vertexp = domScopep->readyVertices().begin()) {
|
||||||
processMoveOne(vertexp, domScopep, 1);
|
processMoveOne(vertexp, domScopep, 1);
|
||||||
}
|
}
|
||||||
// Done with scope/domain pair, pick new scope under same domain, or NULL if none left
|
// Done with scope/domain pair, pick new scope under same domain, or NULL if none left
|
||||||
OrderMoveDomScope* domScopeNextp = NULL;
|
OrderMoveDomScope* domScopeNextp = NULL;
|
||||||
for (OrderMoveDomScope* huntp = m_pomReadyDomScope.begin();
|
for (OrderMoveDomScope* huntp = m_pomReadyDomScope.begin();
|
||||||
huntp; huntp = huntp->readyDomScopeNextp()) {
|
huntp; huntp = huntp->readyDomScopeNextp()) {
|
||||||
if (huntp->domainp() == domScopep->domainp()) {
|
if (huntp->domainp() == domScopep->domainp()) {
|
||||||
domScopeNextp = huntp;
|
domScopeNextp = huntp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
domScopep = domScopeNextp;
|
domScopep = domScopeNextp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UASSERT (m_pomWaiting.empty(), "Didn't converge; nodes waiting, none ready, perhaps some input activations lost.");
|
UASSERT (m_pomWaiting.empty(), "Didn't converge; nodes waiting, none ready, perhaps some input activations lost.");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ psl [p]sl
|
||||||
|
|
||||||
/* Optional directives we recognize */
|
/* Optional directives we recognize */
|
||||||
<INITIAL>"`__FILE__" { if (!pedantic()) {
|
<INITIAL>"`__FILE__" { if (!pedantic()) {
|
||||||
yytext = (char*)V3PreLex::s_currentLexp->m_curFilelinep->cfilename();
|
yytext = (char*)V3PreLex::s_currentLexp->m_curFilelinep->cfilename();
|
||||||
yyleng = strlen(yytext); return (VP_TEXT);
|
yyleng = strlen(yytext); return (VP_TEXT);
|
||||||
} else return(VP_DEFREF); }
|
} else return(VP_DEFREF); }
|
||||||
<INITIAL>"`__LINE__" { if (!pedantic()) {
|
<INITIAL>"`__LINE__" { if (!pedantic()) {
|
||||||
static char buf[10];
|
static char buf[10];
|
||||||
|
|
@ -153,18 +153,18 @@ psl [p]sl
|
||||||
appendDefValue(yytext,yyleng);
|
appendDefValue(yytext,yyleng);
|
||||||
} else {
|
} else {
|
||||||
return (VP_TEXT);
|
return (VP_TEXT);
|
||||||
}}
|
}}
|
||||||
<ARGMODE>[)] { V3PreLex::s_currentLexp->m_parenLevel--;
|
<ARGMODE>[)] { V3PreLex::s_currentLexp->m_parenLevel--;
|
||||||
if (V3PreLex::s_currentLexp->m_parenLevel>0) {
|
if (V3PreLex::s_currentLexp->m_parenLevel>0) {
|
||||||
appendDefValue(yytext,yyleng);
|
appendDefValue(yytext,yyleng);
|
||||||
} else {
|
} else {
|
||||||
yy_pop_state(); return (VP_DEFARG);
|
yy_pop_state(); return (VP_DEFARG);
|
||||||
}}
|
}}
|
||||||
<ARGMODE>[,] { if (V3PreLex::s_currentLexp->m_parenLevel>1) {
|
<ARGMODE>[,] { if (V3PreLex::s_currentLexp->m_parenLevel>1) {
|
||||||
appendDefValue(yytext,yyleng);
|
appendDefValue(yytext,yyleng);
|
||||||
} else {
|
} else {
|
||||||
yy_pop_state(); return (VP_DEFARG);
|
yy_pop_state(); return (VP_DEFARG);
|
||||||
}}
|
}}
|
||||||
<ARGMODE>"`"{symb} { return (VP_DEFREF); } /* defref in defref */
|
<ARGMODE>"`"{symb} { return (VP_DEFREF); } /* defref in defref */
|
||||||
<ARGMODE>[^\/\*\n\r\\(,){}\[\]\"`]+ |
|
<ARGMODE>[^\/\*\n\r\\(,){}\[\]\"`]+ |
|
||||||
<ARGMODE>. { appendDefValue(yytext,yyleng); }
|
<ARGMODE>. { appendDefValue(yytext,yyleng); }
|
||||||
|
|
|
||||||
|
|
@ -707,7 +707,7 @@ int V3PreProcImp::getToken() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case ps_DEFVALUE: {
|
case ps_DEFVALUE: {
|
||||||
static string newlines;
|
static string newlines;
|
||||||
newlines = "\n"; // Always start with trailing return
|
newlines = "\n"; // Always start with trailing return
|
||||||
if (tok == VP_DEFVALUE) {
|
if (tok == VP_DEFVALUE) {
|
||||||
// Remove returns
|
// Remove returns
|
||||||
|
|
@ -735,7 +735,7 @@ int V3PreProcImp::getToken() {
|
||||||
// Remove leading whitespace
|
// Remove leading whitespace
|
||||||
unsigned leadspace = 0;
|
unsigned leadspace = 0;
|
||||||
while (m_lexp->m_defValue.length() > leadspace
|
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);
|
if (leadspace) m_lexp->m_defValue.erase(0,leadspace);
|
||||||
// Remove trailing whitespace
|
// Remove trailing whitespace
|
||||||
unsigned trailspace = 0;
|
unsigned trailspace = 0;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ private:
|
||||||
|
|
||||||
// METHODS
|
// METHODS
|
||||||
bool assignNoTemp(AstNodeAssign* nodep) {
|
bool assignNoTemp(AstNodeAssign* nodep) {
|
||||||
return (nodep->lhsp()->castVarRef()
|
return (nodep->lhsp()->castVarRef()
|
||||||
&& !nodep->lhsp()->castVarRef()->varp()->isSc()
|
&& !nodep->lhsp()->castVarRef()->varp()->isSc()
|
||||||
&& nodep->rhsp()->castConst());
|
&& nodep->rhsp()->castConst());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ private:
|
||||||
UINFO(4," MOD AT "<<scopename<<" "<<nodep<<endl);
|
UINFO(4," MOD AT "<<scopename<<" "<<nodep<<endl);
|
||||||
AstNode::userClearTree();
|
AstNode::userClearTree();
|
||||||
|
|
||||||
m_scopep = new AstScope((m_aboveCellp?(AstNode*)m_aboveCellp:(AstNode*)nodep)->fileline(),
|
m_scopep = new AstScope((m_aboveCellp?(AstNode*)m_aboveCellp:(AstNode*)nodep)->fileline(),
|
||||||
nodep, scopename, m_aboveScopep, m_aboveCellp);
|
nodep, scopename, m_aboveScopep, m_aboveCellp);
|
||||||
|
|
||||||
// Now for each child cell, iterate the module this cell points to
|
// Now for each child cell, iterate the module this cell points to
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void visit(AstNodeIf* nodep, AstNUser*) {
|
virtual void visit(AstNodeIf* nodep, AstNUser*) {
|
||||||
UINFO(4," IF "<<nodep<<endl);
|
UINFO(4," IF "<<nodep<<endl);
|
||||||
allNodes(nodep);
|
allNodes(nodep);
|
||||||
// Condition is part of PREVIOUS block
|
// Condition is part of PREVIOUS block
|
||||||
nodep->condp()->iterateAndNext(*this);
|
nodep->condp()->iterateAndNext(*this);
|
||||||
|
|
@ -159,7 +159,7 @@ private:
|
||||||
//virtual void visit(AstWhile* nodep, AstNUser*) {
|
//virtual void visit(AstWhile* nodep, AstNUser*) {
|
||||||
|
|
||||||
virtual void visit(AstCCall* nodep, AstNUser*) {
|
virtual void visit(AstCCall* nodep, AstNUser*) {
|
||||||
//UINFO(4," CCALL "<<nodep<<endl);
|
//UINFO(4," CCALL "<<nodep<<endl);
|
||||||
allNodes(nodep);
|
allNodes(nodep);
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
if (m_fast) {
|
if (m_fast) {
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ public:
|
||||||
void clear() {
|
void clear() {
|
||||||
m_whyNotOptimizable = NULL;
|
m_whyNotOptimizable = NULL;
|
||||||
m_anyAssignComb = false;
|
m_anyAssignComb = false;
|
||||||
m_anyAssignDly = false;
|
m_anyAssignDly = false;
|
||||||
m_inDlyAssign = false;
|
m_inDlyAssign = false;
|
||||||
m_instrCount = 0;
|
m_instrCount = 0;
|
||||||
m_dataCount = 0;
|
m_dataCount = 0;
|
||||||
|
|
|
||||||
|
|
@ -547,7 +547,7 @@ private:
|
||||||
}
|
}
|
||||||
virtual void visit(AstCFunc* nodep, AstNUser*) {
|
virtual void visit(AstCFunc* nodep, AstNUser*) {
|
||||||
UINFO(8," CFUNC "<<nodep<<endl);
|
UINFO(8," CFUNC "<<nodep<<endl);
|
||||||
if (nodep->funcType() == AstCFuncType::TRACE_INIT) {
|
if (nodep->funcType() == AstCFuncType::TRACE_INIT) {
|
||||||
m_initFuncp = nodep;
|
m_initFuncp = nodep;
|
||||||
} else if (nodep->funcType() == AstCFuncType::TRACE_FULL) {
|
} else if (nodep->funcType() == AstCFuncType::TRACE_FULL) {
|
||||||
m_fullFuncp = nodep;
|
m_fullFuncp = nodep;
|
||||||
|
|
|
||||||
|
|
@ -673,15 +673,15 @@ escid \\[^ \t\f\r\n]+
|
||||||
return yaINTNUM;
|
return yaINTNUM;
|
||||||
}
|
}
|
||||||
[0-9][_0-9]*(\.[_0-9]+)([eE][-+]?[_0-9]+)? {
|
[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;
|
return yaFLOATNUM;
|
||||||
}
|
}
|
||||||
[0-9][_0-9]*(\.[_0-9]+)?([eE][-+]?[_0-9]+) {
|
[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;
|
return yaFLOATNUM;
|
||||||
}
|
}
|
||||||
[0-9][_0-9]*(\.[_0-9]+)?(fs|ps|ns|us|ms|s|step) {
|
[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;
|
return yaFLOATNUM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,7 @@ port: yaID portRangeE { $$ = new AstPort(CRELINE(),V3Parse::s_pinNum+
|
||||||
|
|
||||||
portV2kArgs: portV2kDecl { $$ = $1; }
|
portV2kArgs: portV2kDecl { $$ = $1; }
|
||||||
| portV2kDecl ',' portV2kList { $$ = $1->addNext($3); }
|
| portV2kDecl ',' portV2kList { $$ = $1->addNext($3); }
|
||||||
;
|
;
|
||||||
|
|
||||||
portV2kList: portV2kSecond { $$ = $1; }
|
portV2kList: portV2kSecond { $$ = $1; }
|
||||||
| portV2kList ',' portV2kSecond { $$ = $1->addNext($3); }
|
| portV2kList ',' portV2kSecond { $$ = $1->addNext($3); }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue