Fix extra dot names, and missing __PVT in functions

git-svn-id: file://localhost/svn/verilator/trunk/verilator@756 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2006-08-27 14:51:25 +00:00
parent ce10dbd11c
commit 1c0b6d7ef3
5 changed files with 10 additions and 8 deletions

View File

@ -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.

View File

@ -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);
}
//--------------------

View File

@ -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;

View File

@ -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"));

View File

@ -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