mirror of
https://github.com/verilator/verilator.git
synced 2025-05-02 05:26:53 +00:00
Visitors that just accept netlists should say so. No functional change
This commit is contained in:
parent
9499047f8e
commit
03c5d06107
@ -364,7 +364,7 @@ private:
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ActiveVisitor(AstNode* nodep) {
|
ActiveVisitor(AstNetlist* nodep) {
|
||||||
m_scopeFinalp = NULL;
|
m_scopeFinalp = NULL;
|
||||||
m_alwaysp = NULL;
|
m_alwaysp = NULL;
|
||||||
m_itemCombo = false;
|
m_itemCombo = false;
|
||||||
|
@ -262,11 +262,10 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
CleanVisitor() {}
|
CleanVisitor(AstNetlist* nodep) {
|
||||||
virtual ~CleanVisitor() {}
|
|
||||||
void main(AstNetlist* nodep) {
|
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
|
virtual ~CleanVisitor() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//######################################################################
|
//######################################################################
|
||||||
@ -274,6 +273,5 @@ public:
|
|||||||
|
|
||||||
void V3Clean::cleanAll(AstNetlist* nodep) {
|
void V3Clean::cleanAll(AstNetlist* nodep) {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2,__FUNCTION__<<": "<<endl);
|
||||||
CleanVisitor visitor;
|
CleanVisitor visitor (nodep);
|
||||||
visitor.main(nodep);
|
|
||||||
}
|
}
|
||||||
|
@ -280,8 +280,7 @@ private:
|
|||||||
virtual void visit(AstAlways* nodep, AstNUser*) {
|
virtual void visit(AstAlways* nodep, AstNUser*) {
|
||||||
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
||||||
nodep->replaceWith(cmtp);
|
nodep->replaceWith(cmtp);
|
||||||
AstNode* stmtsp = nodep->bodysp();
|
if (AstNode* stmtsp = nodep->bodysp()) {
|
||||||
if (stmtsp) {
|
|
||||||
stmtsp->unlinkFrBackWithNext();
|
stmtsp->unlinkFrBackWithNext();
|
||||||
cmtp->addNextHere(stmtsp);
|
cmtp->addNextHere(stmtsp);
|
||||||
}
|
}
|
||||||
@ -290,8 +289,7 @@ private:
|
|||||||
virtual void visit(AstAlwaysPost* nodep, AstNUser*) {
|
virtual void visit(AstAlwaysPost* nodep, AstNUser*) {
|
||||||
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
||||||
nodep->replaceWith(cmtp);
|
nodep->replaceWith(cmtp);
|
||||||
AstNode* stmtsp = nodep->bodysp();
|
if (AstNode* stmtsp = nodep->bodysp()) {
|
||||||
if (stmtsp) {
|
|
||||||
stmtsp->unlinkFrBackWithNext();
|
stmtsp->unlinkFrBackWithNext();
|
||||||
cmtp->addNextHere(stmtsp);
|
cmtp->addNextHere(stmtsp);
|
||||||
}
|
}
|
||||||
@ -320,8 +318,7 @@ private:
|
|||||||
virtual void visit(AstInitial* nodep, AstNUser*) {
|
virtual void visit(AstInitial* nodep, AstNUser*) {
|
||||||
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName());
|
||||||
nodep->replaceWith(cmtp);
|
nodep->replaceWith(cmtp);
|
||||||
AstNode* stmtsp = nodep->bodysp();
|
if (AstNode* stmtsp = nodep->bodysp()) {
|
||||||
if (stmtsp) {
|
|
||||||
stmtsp->unlinkFrBackWithNext();
|
stmtsp->unlinkFrBackWithNext();
|
||||||
cmtp->addNextHere(stmtsp);
|
cmtp->addNextHere(stmtsp);
|
||||||
}
|
}
|
||||||
@ -534,7 +531,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ClockVisitor(AstNode* nodep) {
|
ClockVisitor(AstNetlist* nodep) {
|
||||||
m_modp=NULL; m_activep=NULL;
|
m_modp=NULL; m_activep=NULL;
|
||||||
m_evalFuncp = NULL;
|
m_evalFuncp = NULL;
|
||||||
m_topScopep=NULL;
|
m_topScopep=NULL;
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ConstVarMarkVisitor(AstNode* nodep) {
|
ConstVarMarkVisitor(AstNode* nodep) {
|
||||||
AstNode::user4ClearTree(); // Check marked InUse before we're called
|
AstNode::user4ClearTree(); // Check marked InUse before we're called
|
||||||
nodep->iterateAndNext(*this, NULL);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
virtual ~ConstVarMarkVisitor() {}
|
virtual ~ConstVarMarkVisitor() {}
|
||||||
};
|
};
|
||||||
|
@ -441,7 +441,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
DelayedVisitor(AstNode* nodep) {
|
DelayedVisitor(AstNetlist* nodep) {
|
||||||
m_inDly = false;
|
m_inDly = false;
|
||||||
m_activep=NULL;
|
m_activep=NULL;
|
||||||
m_cfuncp=NULL;
|
m_cfuncp=NULL;
|
||||||
|
@ -156,7 +156,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
DepthVisitor(AstNode* nodep) {
|
DepthVisitor(AstNetlist* nodep) {
|
||||||
m_modp=NULL;
|
m_modp=NULL;
|
||||||
m_funcp=NULL;
|
m_funcp=NULL;
|
||||||
m_stmtp=NULL;
|
m_stmtp=NULL;
|
||||||
|
@ -126,7 +126,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
DepthBlockVisitor(AstNode* nodep) {
|
DepthBlockVisitor(AstNetlist* nodep) {
|
||||||
m_modp=NULL;
|
m_modp=NULL;
|
||||||
m_depth=0;
|
m_depth=0;
|
||||||
//
|
//
|
||||||
|
@ -905,13 +905,11 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ExpandVisitor() {
|
ExpandVisitor(AstNetlist* nodep) {
|
||||||
m_stmtp=NULL;
|
m_stmtp=NULL;
|
||||||
}
|
|
||||||
virtual ~ExpandVisitor() {}
|
|
||||||
void main(AstNode* nodep) {
|
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
|
virtual ~ExpandVisitor() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -922,6 +920,5 @@ public:
|
|||||||
|
|
||||||
void V3Expand::expandAll(AstNetlist* nodep) {
|
void V3Expand::expandAll(AstNetlist* nodep) {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2,__FUNCTION__<<": "<<endl);
|
||||||
ExpandVisitor visitor;
|
ExpandVisitor visitor (nodep);
|
||||||
visitor.main(nodep);
|
|
||||||
}
|
}
|
||||||
|
@ -258,15 +258,13 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
LinkCellsVisitor() {
|
LinkCellsVisitor(AstNetlist* rootp) {
|
||||||
m_modp = NULL;
|
m_modp = NULL;
|
||||||
m_libVertexp = NULL;
|
m_libVertexp = NULL;
|
||||||
m_topVertexp = NULL;
|
m_topVertexp = NULL;
|
||||||
}
|
|
||||||
virtual ~LinkCellsVisitor() {}
|
|
||||||
void main(AstNetlist* rootp) {
|
|
||||||
rootp->accept(*this);
|
rootp->accept(*this);
|
||||||
}
|
}
|
||||||
|
virtual ~LinkCellsVisitor() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//######################################################################
|
//######################################################################
|
||||||
@ -274,6 +272,5 @@ public:
|
|||||||
|
|
||||||
void V3LinkCells::link(AstNetlist* rootp) {
|
void V3LinkCells::link(AstNetlist* rootp) {
|
||||||
UINFO(4,__FUNCTION__<<": "<<endl);
|
UINFO(4,__FUNCTION__<<": "<<endl);
|
||||||
LinkCellsVisitor visitor;
|
LinkCellsVisitor visitor (rootp);
|
||||||
visitor.main(rootp);
|
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ private:
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
NameVisitor(AstNode* nodep) {
|
NameVisitor(AstNetlist* nodep) {
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
virtual ~NameVisitor() {}
|
virtual ~NameVisitor() {}
|
||||||
|
@ -306,17 +306,15 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
PremitVisitor() {
|
PremitVisitor(AstNetlist* nodep) {
|
||||||
m_modp = NULL;
|
m_modp = NULL;
|
||||||
m_funcp = NULL;
|
m_funcp = NULL;
|
||||||
m_stmtp = NULL;
|
m_stmtp = NULL;
|
||||||
m_inWhilep = NULL;
|
m_inWhilep = NULL;
|
||||||
m_inTracep = NULL;
|
m_inTracep = NULL;
|
||||||
}
|
|
||||||
virtual ~PremitVisitor() {}
|
|
||||||
void main(AstNode* nodep) {
|
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
|
virtual ~PremitVisitor() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -327,6 +325,5 @@ public:
|
|||||||
|
|
||||||
void V3Premit::premitAll(AstNetlist* nodep) {
|
void V3Premit::premitAll(AstNetlist* nodep) {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2,__FUNCTION__<<": "<<endl);
|
||||||
PremitVisitor visitor;
|
PremitVisitor visitor (nodep);
|
||||||
visitor.main(nodep);
|
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ private:
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ScopeVisitor(AstNode* nodep) {
|
ScopeVisitor(AstNetlist* nodep) {
|
||||||
m_aboveCellp = NULL;
|
m_aboveCellp = NULL;
|
||||||
m_aboveScopep = NULL;
|
m_aboveScopep = NULL;
|
||||||
m_modp = NULL;
|
m_modp = NULL;
|
||||||
@ -313,7 +313,7 @@ private:
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
ScopeCleanupVisitor(AstNode* nodep) {
|
ScopeCleanupVisitor(AstNetlist* nodep) {
|
||||||
m_scopep = NULL;
|
m_scopep = NULL;
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
|
@ -548,7 +548,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
SplitVisitor(AstNode* nodep, bool reorder)
|
SplitVisitor(AstNetlist* nodep, bool reorder)
|
||||||
: m_reorder(reorder) {
|
: m_reorder(reorder) {
|
||||||
scoreboardClear();
|
scoreboardClear();
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
|
@ -377,7 +377,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTUCTORS
|
// CONSTUCTORS
|
||||||
UnknownVisitor(AstNode* nodep) {
|
UnknownVisitor(AstNetlist* nodep) {
|
||||||
nodep->accept(*this);
|
nodep->accept(*this);
|
||||||
}
|
}
|
||||||
virtual ~UnknownVisitor() {
|
virtual ~UnknownVisitor() {
|
||||||
|
@ -1197,7 +1197,7 @@ void V3Width::widthSignedIfNotAlready(AstNode* nodep) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void V3Width::widthCommit(AstNode* nodep) {
|
void V3Width::widthCommit(AstNetlist* nodep) {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2,__FUNCTION__<<": "<<endl);
|
||||||
WidthCommitVisitor visitor (nodep);
|
WidthCommitVisitor visitor (nodep);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
static void widthParams(AstNode* nodep);
|
static void widthParams(AstNode* nodep);
|
||||||
static void widthSignedIfNotAlready(AstNode* nodep);
|
static void widthSignedIfNotAlready(AstNode* nodep);
|
||||||
// Final step... Mark all widths as equal
|
// Final step... Mark all widths as equal
|
||||||
static void widthCommit(AstNode* nodep);
|
static void widthCommit(AstNetlist* nodep);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // Guard
|
#endif // Guard
|
||||||
|
Loading…
Reference in New Issue
Block a user