From a9a4cf061ac4d4e82055e3436505065e31be1075 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 20 Feb 2013 22:28:56 -0500 Subject: [PATCH] Fix tristate duplicate __Vcellinp declaration --- src/V3Inst.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 97caaf84e..ecdbe2a4c 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -266,10 +266,11 @@ AstAssignW* V3Inst::pinReconnectSimple(AstPin* pinp, AstCell* cellp, AstNodeModu // Done. Constant. } else { // Make a new temp wire - //if (1||debug()>=9) { pinp->dumpTree(cout,"in_pin:"); } + //if (1||debug()>=9) { pinp->dumpTree(cout,"-in_pin:"); } AstNode* pinexprp = pinp->exprp()->unlinkFrBack(); - string newvarname = ((pinVarp->isOutput() ? "__Vcellout__" : "__Vcellinp__") - +cellp->name()+"__"+pinp->name()); + string newvarname = ((string)(pinVarp->isOutput() ? "__Vcellout" : "__Vcellinp") + +(forTristate?"t":"") // Prevent name conflict if both tri & non-tri add signals + +"__"+cellp->name()+"__"+pinp->name()); AstVar* newvarp = new AstVar (pinVarp->fileline(), AstVarType::MODULETEMP, newvarname, pinVarp); // Important to add statement next to cell, in case there is a generate with same named cell cellp->addNextHere(newvarp); @@ -298,8 +299,8 @@ AstAssignW* V3Inst::pinReconnectSimple(AstPin* pinp, AstCell* cellp, AstNodeModu pinp->exprp(new AstVarRef (pinexprp->fileline(), newvarp, false)); } if (assignp) cellp->addNextHere(assignp); - //if (1||debug()) { pinp->dumpTree(cout," out:"); } - //if (1||debug()) { assignp->dumpTree(cout," aout:"); } + //if (debug()) { pinp->dumpTree(cout,"- out:"); } + //if (debug()) { assignp->dumpTree(cout,"- aout:"); } } return assignp; }