diff --git a/Changes b/Changes index cc872b130..658674056 100644 --- a/Changes +++ b/Changes @@ -3,7 +3,7 @@ Revision history for Verilator The contributors that suggested a given feature are shown in []. [by ...] indicates the contributor was also the author of the fix; Thanks! -* Verilator 3.600 08/26/2006 +* Verilator 3.600 08/28/2006 ** Support dotted cross-hierarchy variable and task references. diff --git a/src/V3Name.cpp b/src/V3Name.cpp index a065752fe..979ce627f 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -60,10 +60,9 @@ private: nodep->iterateChildren(*this); } virtual void visit(AstModule* nodep, AstNUser*) { - //VV***** We reset all userp() on each module!!! - AstNode::userClearTree(); m_modp = nodep; nodep->iterateChildren(*this); + m_modp = NULL; } // Add __PVT__ to names of local signals virtual void visit(AstVar* nodep, AstNUser*) { @@ -106,6 +105,7 @@ private: : (nodep->aboveScopep()->name()+"."+nodep->aboveCellp()->name())); nodep->user(1); } + nodep->iterateChildren(*this); } //-------------------- diff --git a/src/V3Task.cpp b/src/V3Task.cpp index e3b43b2ed..ba20715f4 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -156,13 +156,13 @@ private: //int debug() { return 9; } // METHODS - AstVarScope* createVarScope(AstVar* invarp, const string& namePrefix) { + AstVarScope* createVarScope(AstVar* invarp, const string& name) { // We could create under either the ref's scope or the ftask's scope. // It shouldn't matter, as they are only local variables. // We choose to do it under whichever called this function, which results // in more cache locality. AstVar* newvarp = new AstVar (invarp->fileline(), AstVarType::BLOCKTEMP, - namePrefix+"__"+invarp->shortName(), invarp); + name, invarp); newvarp->funcLocal(false); m_modp->addStmtp(newvarp); AstVarScope* newvscp = new AstVarScope (newvarp->fileline(), m_scopep, newvarp); @@ -186,6 +186,8 @@ private: for (AstNode* stmtp = newbodysp; stmtp; pinp=nextpinp, stmtp=nextstmtp) { nextstmtp = stmtp->nextp(); if (AstVar* portp = stmtp->castVar()) { + portp->unlinkFrBack(); // Remove it from the clone (not original) + pushDeletep(portp); if (portp->isIO()) { if (pinp==NULL) { refp->v3error("Too few arguments in function call"); @@ -197,8 +199,6 @@ private: // nextpinp = pinp->nextp(); pinp->unlinkFrBack(); // Relinked to assignment below - portp->unlinkFrBack(); // Remove it from the clone (not original) - pushDeletep(portp); // if (portp->isTristate()) { refp->v3error("Unsupported: Inouts in functions/tasks"); @@ -347,6 +347,7 @@ private: m_lastStmtp = NULL; m_modNCalls = 0; nodep->iterateChildren(*this); + m_modp = NULL; } virtual void visit(AstScope* nodep, AstNUser*) { m_scopep = nodep; diff --git a/src/Verilator.cpp b/src/Verilator.cpp index 036ce48c4..68a297bf6 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -236,6 +236,7 @@ void process () { v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("task.tree")); // Add __PVT's + // After V3Task so task internal variables will get renamed V3Name::nameAll(v3Global.rootp()); //v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("name.tree")); diff --git a/src/config.h.in b/src/config.h.in index 6bddcfad5..6643404c0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -24,7 +24,7 @@ //********************************************************************** //**** Version and host name -#define DTVERSION "Verilator 3.600 08/26/2006" +#define DTVERSION "Verilator 3.600 08/28/2006" //********************************************************************** //**** Functions