Internals: Add AstNodeCCall and other items towards classes.
This commit is contained in:
parent
961ac49c5c
commit
808c958d42
71
src/V3Ast.h
71
src/V3Ast.h
|
|
@ -55,6 +55,12 @@ typedef std::set<int> MTaskIdSet; // Set of mtaskIds for Var sorting
|
|||
do { \
|
||||
if (VL_UNCOVERABLE(test)) return #test; \
|
||||
} while (0)
|
||||
// For broken() function, return error string if a base of this class has a match
|
||||
#define BROKEN_BASE_RTN(test) \
|
||||
do { \
|
||||
const char* reasonp = (test); \
|
||||
if (VL_UNCOVERABLE(reasonp)) return reasonp; \
|
||||
} while (0)
|
||||
|
||||
// (V)erilator (N)ode is: True if AstNode is of a a given AstType
|
||||
#define VN_IS(nodep,nodetypename) (AstNode::privateIs<Ast ## nodetypename>(nodep))
|
||||
|
|
@ -2230,6 +2236,54 @@ public:
|
|||
//######################################################################
|
||||
// Tasks/functions common handling
|
||||
|
||||
class AstNodeCCall : public AstNodeStmt {
|
||||
// A call of a C++ function, perhaps a AstCFunc or perhaps globally named
|
||||
// Functions are not statements, while tasks are. AstNodeStmt needs isStatement() to deal.
|
||||
AstCFunc* m_funcp;
|
||||
string m_hiername;
|
||||
string m_argTypes;
|
||||
public:
|
||||
AstNodeCCall(AstType t, FileLine* fl, AstCFunc* funcp, AstNode* argsp = NULL)
|
||||
: AstNodeStmt(t, fl, true)
|
||||
, m_funcp(funcp) {
|
||||
addNOp2p(argsp);
|
||||
}
|
||||
// Replacement form for V3Combine
|
||||
// Note this removes old attachments from the oldp
|
||||
AstNodeCCall(AstType t, AstNodeCCall* oldp, AstCFunc* funcp)
|
||||
: AstNodeStmt(t, oldp->fileline(), true)
|
||||
, m_funcp(funcp) {
|
||||
m_funcp = funcp;
|
||||
m_hiername = oldp->hiername();
|
||||
m_argTypes = oldp->argTypes();
|
||||
if (oldp->argsp()) addNOp2p(oldp->argsp()->unlinkFrBackWithNext());
|
||||
}
|
||||
ASTNODE_BASE_FUNCS(NodeCCall)
|
||||
virtual void dump(std::ostream& str=std::cout) const;
|
||||
virtual void cloneRelink();
|
||||
virtual const char* broken() const;
|
||||
virtual int instrCount() const { return instrCountCall(); }
|
||||
virtual V3Hash sameHash() const { return V3Hash(funcp()); }
|
||||
virtual bool same(const AstNode* samep) const {
|
||||
const AstNodeCCall* asamep = static_cast<const AstNodeCCall*>(samep);
|
||||
return (funcp() == asamep->funcp() && argTypes() == asamep->argTypes());
|
||||
}
|
||||
AstNode* exprsp() const { return op2p(); } // op2 = expressions to print
|
||||
virtual bool isGateOptimizable() const { return false; }
|
||||
virtual bool isPredictOptimizable() const { return false; }
|
||||
virtual bool isPure() const;
|
||||
virtual bool isOutputter() const { return !isPure(); }
|
||||
AstCFunc* funcp() const { return m_funcp; }
|
||||
string hiername() const { return m_hiername; }
|
||||
void hiername(const string& hn) { m_hiername = hn; }
|
||||
string hiernameProtect() const;
|
||||
void argTypes(const string& str) { m_argTypes = str; }
|
||||
string argTypes() const { return m_argTypes; }
|
||||
// op1p reserved for AstCMethodCall
|
||||
AstNode* argsp() const { return op2p(); }
|
||||
void addArgsp(AstNode* nodep) { addOp2p(nodep); }
|
||||
};
|
||||
|
||||
class AstNodeFTask : public AstNode {
|
||||
private:
|
||||
string m_name; // Name of task
|
||||
|
|
@ -2311,12 +2365,12 @@ public:
|
|||
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, AstNode* namep, AstNode* pinsp)
|
||||
: AstNodeStmt(t, fl, statement)
|
||||
, m_taskp(NULL), m_packagep(NULL) {
|
||||
setOp1p(namep); addNOp2p(pinsp);
|
||||
setOp1p(namep); addNOp3p(pinsp);
|
||||
}
|
||||
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, const string& name, AstNode* pinsp)
|
||||
: AstNodeStmt(t, fl, statement)
|
||||
, m_taskp(NULL), m_name(name), m_packagep(NULL) {
|
||||
addNOp2p(pinsp);
|
||||
addNOp3p(pinsp);
|
||||
}
|
||||
ASTNODE_BASE_FUNCS(NodeFTaskRef)
|
||||
virtual const char* broken() const { BROKEN_RTN(m_taskp && !m_taskp->brokeExists()); return NULL; }
|
||||
|
|
@ -2338,12 +2392,13 @@ public:
|
|||
void packagep(AstPackage* nodep) { m_packagep = nodep; }
|
||||
// op1 = namep
|
||||
AstNode* namep() const { return op1p(); }
|
||||
// op2 = Pin interconnection list
|
||||
AstNode* pinsp() const { return op2p(); }
|
||||
void addPinsp(AstNode* nodep) { addOp2p(nodep); }
|
||||
// op3 = scope tracking
|
||||
AstScopeName* scopeNamep() const { return VN_CAST(op3p(), ScopeName); }
|
||||
void scopeNamep(AstNode* nodep) { setNOp3p(nodep); }
|
||||
// op2 = reserved for AstMethodCall
|
||||
// op3 = Pin interconnection list
|
||||
AstNode* pinsp() const { return op3p(); }
|
||||
void addPinsp(AstNode* nodep) { addOp3p(nodep); }
|
||||
// op4 = scope tracking
|
||||
AstScopeName* scopeNamep() const { return VN_CAST(op4p(), ScopeName); }
|
||||
void scopeNamep(AstNode* nodep) { setNOp4p(nodep); }
|
||||
};
|
||||
|
||||
class AstNodeModule : public AstNode {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "V3Global.h"
|
||||
#include "V3Graph.h"
|
||||
#include "V3PartitionGraph.h" // Just for mtask dumping
|
||||
#include "V3EmitCBase.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <iomanip>
|
||||
|
|
@ -88,6 +89,27 @@ const char* AstNodeUOrStructDType::broken() const {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void AstNodeCCall::dump(std::ostream& str) const {
|
||||
this->AstNode::dump(str);
|
||||
if (funcp()) {
|
||||
str << " " << funcp()->name() << " => ";
|
||||
funcp()->dump(str);
|
||||
} else {
|
||||
str << " " << name();
|
||||
}
|
||||
}
|
||||
void AstNodeCCall::cloneRelink() {
|
||||
if (m_funcp && m_funcp->clonep()) { m_funcp = m_funcp->clonep(); }
|
||||
}
|
||||
const char* AstNodeCCall::broken() const {
|
||||
BROKEN_RTN(m_funcp && !m_funcp->brokeExists());
|
||||
return NULL;
|
||||
}
|
||||
bool AstNodeCCall::isPure() const { return funcp()->pure(); }
|
||||
string AstNodeCCall::hiernameProtect() const {
|
||||
return VIdProtect::protectWordsIf(hiername(), protect());
|
||||
}
|
||||
|
||||
void AstNodeCond::numberOperate(V3Number& out, const V3Number& lhs,
|
||||
const V3Number& rhs, const V3Number& ths) {
|
||||
if (lhs.isNeqZero()) out.opAssign(rhs); else out.opAssign(ths);
|
||||
|
|
@ -679,10 +701,6 @@ AstNode* AstArraySel::baseFromp(AstNode* nodep) { ///< What is the base variabl
|
|||
return nodep;
|
||||
}
|
||||
|
||||
string AstCCall::hiernameProtect() const {
|
||||
return VIdProtect::protectWordsIf(hiername(), protect());
|
||||
}
|
||||
|
||||
const char* AstScope::broken() const {
|
||||
BROKEN_RTN(m_aboveScopep && !m_aboveScopep->brokeExists());
|
||||
BROKEN_RTN(m_aboveCellp && !m_aboveCellp->brokeExists());
|
||||
|
|
@ -1024,6 +1042,16 @@ void AstMemberSel::dump(std::ostream& str) const {
|
|||
if (varp()) { varp()->dump(str); }
|
||||
else { str << "%Error:UNLINKED"; }
|
||||
}
|
||||
void AstMethodCall::dump(std::ostream& str) const {
|
||||
this->AstNode::dump(str);
|
||||
if (isStatement()) str << " [STMT]";
|
||||
str << " -> ";
|
||||
if (taskp()) {
|
||||
taskp()->dump(str);
|
||||
} else {
|
||||
str << " -> UNLINKED";
|
||||
}
|
||||
}
|
||||
void AstModportFTaskRef::dump(std::ostream& str) const {
|
||||
this->AstNode::dump(str);
|
||||
if (isExport()) str<<" EXPORT";
|
||||
|
|
@ -1343,13 +1371,6 @@ void AstCFile::dump(std::ostream& str) const {
|
|||
if (source()) str<<" [SRC]";
|
||||
if (slow()) str<<" [SLOW]";
|
||||
}
|
||||
void AstCCall::dump(std::ostream& str) const {
|
||||
this->AstNode::dump(str);
|
||||
if (funcp()) {
|
||||
str<<" "<<funcp()->name()<<" => ";
|
||||
funcp()->dump(str);
|
||||
}
|
||||
}
|
||||
void AstCFunc::dump(std::ostream& str) const {
|
||||
this->AstNode::dump(str);
|
||||
if (slow()) str<<" [SLOW]";
|
||||
|
|
|
|||
108
src/V3AstNodes.h
108
src/V3AstNodes.h
|
|
@ -1408,31 +1408,33 @@ public:
|
|||
void declRange(const VNumRange& flag) { m_declRange = flag; }
|
||||
};
|
||||
|
||||
class AstMethodCall : public AstNode {
|
||||
class AstMethodCall : public AstNodeFTaskRef {
|
||||
// A reference to a member task (or function)
|
||||
// We do not support generic member calls yet, so this is only enough to
|
||||
// make built-in methods work
|
||||
private:
|
||||
string m_name; // Name of method
|
||||
// PARENTS: stmt/math
|
||||
// Not all calls are statments vs math. AstNodeStmt needs isStatement() to deal.
|
||||
// Don't need the class we are extracting from, as the "fromp()"'s datatype can get us to it
|
||||
public:
|
||||
AstMethodCall(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstNode* pinsp)
|
||||
: ASTGEN_SUPER(fl), m_name(name) {
|
||||
setOp1p(fromp);
|
||||
AstMethodCall(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name,
|
||||
AstNode* pinsp)
|
||||
: ASTGEN_SUPER(fl, false, name, pinsp) {
|
||||
setOp2p(fromp);
|
||||
dtypep(NULL); // V3Width will resolve
|
||||
addNOp2p(pinsp);
|
||||
}
|
||||
AstMethodCall(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
|
||||
: ASTGEN_SUPER(fl), m_name(name) {
|
||||
setOp1p(fromp);
|
||||
addNOp2p(pinsp);
|
||||
: ASTGEN_SUPER(fl, false, name, pinsp) {
|
||||
setOp2p(fromp);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(MethodCall)
|
||||
virtual string name() const { return m_name; } // * = Var name
|
||||
virtual void name(const string& name) { m_name = name; }
|
||||
AstNode* fromp() const { return op1p(); } // op1 = Extracting what (NULL=TBD during parsing)
|
||||
void fromp(AstNode* nodep) { setOp1p(nodep); }
|
||||
AstNode* pinsp() const { return op2p(); } // op2 = Pin interconnection list
|
||||
void addPinsp(AstNode* nodep) { addOp2p(nodep); }
|
||||
virtual const char* broken() const {
|
||||
BROKEN_BASE_RTN(AstNodeFTaskRef::broken());
|
||||
BROKEN_RTN(!fromp());
|
||||
return NULL;
|
||||
}
|
||||
virtual void dump(std::ostream& str) const;
|
||||
virtual bool hasDType() const { return true; }
|
||||
void makeStatement() { statement(true); dtypeSetVoid(); }
|
||||
AstNode* fromp() const { return op2p(); } // op2 = Extracting what (NULL=TBD during parsing)
|
||||
void fromp(AstNode* nodep) { setOp2p(nodep); }
|
||||
};
|
||||
|
||||
class AstCMethodHard : public AstNodeStmt {
|
||||
|
|
@ -3995,7 +3997,6 @@ class AstNew : public AstNodeMath {
|
|||
public:
|
||||
AstNew(FileLine* fl, AstNode* argsp)
|
||||
: ASTGEN_SUPER(fl) {
|
||||
dtypep(NULL); // V3Width will resolve
|
||||
addNOp2p(argsp);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(New)
|
||||
|
|
@ -6881,54 +6882,37 @@ public:
|
|||
bool emptyBody() const { return argsp()==NULL && initsp()==NULL && stmtsp()==NULL && finalsp()==NULL; }
|
||||
};
|
||||
|
||||
class AstCCall : public AstNodeStmt {
|
||||
class AstCCall : public AstNodeCCall {
|
||||
// C++ function call
|
||||
// Parents: Anything above a statement
|
||||
// Children: Args to the function
|
||||
private:
|
||||
AstCFunc* m_funcp;
|
||||
string m_hiername;
|
||||
string m_argTypes;
|
||||
public:
|
||||
AstCCall(FileLine* fl, AstCFunc* funcp, AstNode* argsp=NULL)
|
||||
: ASTGEN_SUPER(fl) {
|
||||
m_funcp = funcp;
|
||||
addNOp1p(argsp);
|
||||
}
|
||||
AstCCall(AstCCall* oldp, AstCFunc* funcp) // Replacement form for V3Combine
|
||||
// Note this removes old attachments from the oldp
|
||||
: ASTGEN_SUPER(oldp->fileline()) {
|
||||
m_funcp = funcp;
|
||||
m_hiername = oldp->hiername();
|
||||
m_argTypes = oldp->argTypes();
|
||||
if (oldp->argsp()) addNOp1p(oldp->argsp()->unlinkFrBackWithNext());
|
||||
}
|
||||
AstCCall(FileLine* fl, AstCFunc* funcp, AstNode* argsp = NULL)
|
||||
: ASTGEN_SUPER(fl, funcp, argsp) {}
|
||||
// Replacement form for V3Combine
|
||||
// Note this removes old attachments from the oldp
|
||||
AstCCall(AstCCall* oldp, AstCFunc* funcp)
|
||||
: ASTGEN_SUPER(oldp, funcp) {}
|
||||
ASTNODE_NODE_FUNCS(CCall)
|
||||
virtual void dump(std::ostream& str=std::cout) const;
|
||||
virtual void cloneRelink() { if (m_funcp && m_funcp->clonep()) {
|
||||
m_funcp = m_funcp->clonep();
|
||||
}}
|
||||
virtual const char* broken() const { BROKEN_RTN(m_funcp && !m_funcp->brokeExists()); return NULL; }
|
||||
virtual int instrCount() const { return instrCountCall(); }
|
||||
virtual V3Hash sameHash() const { return V3Hash(funcp()); }
|
||||
virtual bool same(const AstNode* samep) const {
|
||||
const AstCCall* asamep = static_cast<const AstCCall*>(samep);
|
||||
return (funcp() == asamep->funcp()
|
||||
&& argTypes() == asamep->argTypes()); }
|
||||
AstNode* exprsp() const { return op1p(); } // op1 = expressions to print
|
||||
virtual bool isGateOptimizable() const { return false; }
|
||||
virtual bool isPredictOptimizable() const { return false; }
|
||||
virtual bool isPure() const { return funcp()->pure(); }
|
||||
virtual bool isOutputter() const { return !(funcp()->pure()); }
|
||||
AstCFunc* funcp() const { return m_funcp; }
|
||||
string hiername() const { return m_hiername; }
|
||||
void hiername(const string& hn) { m_hiername = hn; }
|
||||
string hiernameProtect() const;
|
||||
void argTypes(const string& str) { m_argTypes = str; }
|
||||
string argTypes() const { return m_argTypes; }
|
||||
//
|
||||
AstNode* argsp() const { return op1p(); }
|
||||
void addArgsp(AstNode* nodep) { addOp1p(nodep); }
|
||||
};
|
||||
|
||||
class AstCMethodCall : public AstNodeCCall {
|
||||
// C++ method call
|
||||
// Parents: Anything above a statement
|
||||
// Children: Args to the function
|
||||
public:
|
||||
AstCMethodCall(FileLine* fl, AstNode* fromp, AstCFunc* funcp, AstNode* argsp = NULL)
|
||||
: ASTGEN_SUPER(fl, funcp, argsp) {
|
||||
setOp1p(fromp);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(CMethodCall)
|
||||
virtual const char* broken() const {
|
||||
BROKEN_BASE_RTN(AstNodeCCall::broken());
|
||||
BROKEN_RTN(!fromp());
|
||||
return NULL;
|
||||
}
|
||||
AstNode* fromp() const { return op1p(); } // op1 = Extracting what (NULL=TBD during parsing)
|
||||
void fromp(AstNode* nodep) { setOp1p(nodep); }
|
||||
};
|
||||
|
||||
class AstCReturn : public AstNodeStmt {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ private:
|
|||
m_likely = lastLikely;
|
||||
m_unlikely = lastUnlikely;
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
checkUnlikely(nodep);
|
||||
nodep->funcp()->user1Inc();
|
||||
iterateChildren(nodep);
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
ensureCleanAndNext(nodep->bodysp());
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
ensureCleanAndNext(nodep->argsp());
|
||||
setClean(nodep, true);
|
||||
|
|
|
|||
|
|
@ -188,6 +188,10 @@ private:
|
|||
else nodep->packagep()->user1Inc();
|
||||
}
|
||||
}
|
||||
virtual void visit(AstMethodCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
checkAll(nodep);
|
||||
}
|
||||
virtual void visit(AstRefDType* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
checkDType(nodep);
|
||||
|
|
@ -211,6 +215,12 @@ private:
|
|||
}
|
||||
checkAll(nodep);
|
||||
}
|
||||
virtual void visit(AstMemberSel* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
if (nodep->varp()) nodep->varp()->user1Inc();
|
||||
if (nodep->fromp()->dtypep()) nodep->fromp()->dtypep()->user1Inc(); // classref
|
||||
checkAll(nodep);
|
||||
}
|
||||
virtual void visit(AstModport* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
if (m_elimCells) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ private:
|
|||
void visitStmt(AstNodeStmt* nodep) {
|
||||
m_depth++;
|
||||
if (m_depth > v3Global.opt.compLimitBlocks()
|
||||
&& !VN_IS(nodep, CCall)) { // Already done
|
||||
&& !VN_IS(nodep, NodeCCall)) { // Already done
|
||||
UINFO(4, "DeepBlocks "<<m_depth<<" "<<nodep<<endl);
|
||||
AstNode* backp = nodep->backp(); // Only for debug
|
||||
if (debug()>=9) backp->dumpTree(cout, "- pre : ");
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ private:
|
|||
nodep->hierThis(hierThis);
|
||||
nodep->varScopep(NULL);
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
// UINFO(9," "<<nodep<<endl);
|
||||
iterateChildren(nodep);
|
||||
// Convert the hierch name
|
||||
|
|
|
|||
|
|
@ -307,8 +307,14 @@ public:
|
|||
puts(".data()"); // Access returned std::array as C array
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
puts(nodep->hiernameProtect());
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
if (AstCMethodCall* ccallp = VN_CAST(nodep, CMethodCall)) {
|
||||
// make this a Ast type for future opt
|
||||
iterate(ccallp->fromp());
|
||||
putbs("->");
|
||||
} else {
|
||||
puts(nodep->hiernameProtect());
|
||||
}
|
||||
puts(nodep->funcp()->nameProtect());
|
||||
puts("(");
|
||||
puts(nodep->argTypes());
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
if (!nodep->funcp()->entryPoint()) {
|
||||
// Enter the function and trace it
|
||||
|
|
|
|||
|
|
@ -150,7 +150,8 @@ private:
|
|||
}
|
||||
virtual void visit(AstNodeFTaskRef* nodep) VL_OVERRIDE {
|
||||
// Cleanup link until V3LinkDot can correct it
|
||||
if (!nodep->packagep()) nodep->taskp(NULL);
|
||||
// MethodCalls not currently supported by inliner, so keep linked
|
||||
if (!nodep->packagep() && !VN_IS(nodep, MethodCall)) nodep->taskp(NULL);
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstAlways* nodep) VL_OVERRIDE {
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ private:
|
|||
markCost(nodep);
|
||||
UASSERT_OBJ(nodep == m_startNodep, nodep, "Multiple actives, or not start node");
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
VisitBase vb(this, nodep);
|
||||
iterateChildren(nodep);
|
||||
m_tracingCall = true;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ private:
|
|||
bodyLifep->lifeToAbove();
|
||||
VL_DO_DANGLING(delete bodyLifep, bodyLifep);
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
//UINFO(4," CCALL "<<nodep<<endl);
|
||||
iterateChildren(nodep);
|
||||
// Enter the function and trace it
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ private:
|
|||
// Only track the top scopes, not lower level functions
|
||||
if (nodep->isTop()) iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
if (!nodep->funcp()->entryPoint()) {
|
||||
// Enter the function and trace it
|
||||
|
|
@ -319,7 +319,7 @@ private:
|
|||
// Only track the top scopes, not lower level functions
|
||||
if (nodep->isTop()) iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
if (!nodep->funcp()->entryPoint()) {
|
||||
// Enter the function and trace it
|
||||
|
|
|
|||
|
|
@ -1777,7 +1777,7 @@ private:
|
|||
}
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
// Enter the function and trace it
|
||||
m_tracingCall = true;
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ private:
|
|||
UASSERT_OBJ(newp, nodep, "No clone for package function");
|
||||
nodep->taskp(newp);
|
||||
UINFO(9," New pkg-taskref "<<nodep<<endl);
|
||||
} else {
|
||||
} else if (!VN_IS(nodep, MethodCall)) {
|
||||
nodep->taskp(NULL);
|
||||
UINFO(9," New pkg-taskref "<<nodep<<endl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ private:
|
|||
// While's we assume evaluate once.
|
||||
//virtual void visit(AstWhile* nodep) VL_OVERRIDE {
|
||||
|
||||
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
|
||||
virtual void visit(AstNodeCCall* nodep) VL_OVERRIDE {
|
||||
allNodes(nodep);
|
||||
iterateChildrenConst(nodep);
|
||||
if (m_fast && !nodep->funcp()->entryPoint()) {
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ private:
|
|||
m_assignwp = NULL;
|
||||
}
|
||||
virtual void visit(AstNodeFTaskRef* nodep) VL_OVERRIDE {
|
||||
// Includes handling AstMethodCall
|
||||
if (m_assignwp) {
|
||||
// Wire assigns must become always statements to deal with insertion
|
||||
// of multiple statements. Perhaps someday make all wassigns into always's?
|
||||
|
|
@ -487,7 +488,12 @@ private:
|
|||
//
|
||||
AstNode* beginp = new AstComment(refp->fileline(),
|
||||
string("Function: ")+refp->name(), true);
|
||||
AstCCall* ccallp = new AstCCall(refp->fileline(), cfuncp, NULL);
|
||||
AstNodeCCall* ccallp;
|
||||
if (AstMethodCall* mrefp = VN_CAST(refp, MethodCall)) {
|
||||
ccallp = new AstCMethodCall(refp->fileline(), mrefp->fromp()->unlinkFrBack(), cfuncp);
|
||||
} else {
|
||||
ccallp = new AstCCall(refp->fileline(), cfuncp);
|
||||
}
|
||||
beginp->addNext(ccallp);
|
||||
|
||||
// Convert complicated outputs to temp signals
|
||||
|
|
@ -1174,7 +1180,7 @@ private:
|
|||
}
|
||||
// Replace the ref
|
||||
AstNode* visitp = NULL;
|
||||
if (VN_IS(nodep, FuncRef)) {
|
||||
if (!nodep->isStatement()) {
|
||||
UASSERT_OBJ(nodep->taskp()->isFunction(), nodep, "func reference to non-function");
|
||||
AstVarRef* outrefp = new AstVarRef(nodep->fileline(), outvscp, false);
|
||||
nodep->replaceWith(outrefp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue