Internals: Merge VFlag rename. No functional change.

This commit is contained in:
Wilson Snyder 2012-03-31 11:10:34 -04:00
parent a3ee6131a3
commit 61cbdd1a19
15 changed files with 28 additions and 28 deletions

View File

@ -36,8 +36,8 @@
// class V3AstNode; // class V3AstNode;
// Hint class so we can choose constructors // Hint class so we can choose constructors
class AstLogicPacked {}; class VFlagLogicPacked {};
class AstBitPacked {}; class VFlagBitPacked {};
//###################################################################### //######################################################################

View File

@ -258,11 +258,11 @@ public:
: AstNodeDType(fl) { : AstNodeDType(fl) {
init(kwd, signst, 0, NULL); init(kwd, signst, 0, NULL);
} }
AstBasicDType(FileLine* fl, AstLogicPacked, int wantwidth) AstBasicDType(FileLine* fl, VFlagLogicPacked, int wantwidth)
: AstNodeDType(fl) { : AstNodeDType(fl) {
init(AstBasicDTypeKwd::LOGIC, signedst_NOSIGNED, wantwidth, NULL); init(AstBasicDTypeKwd::LOGIC, signedst_NOSIGNED, wantwidth, NULL);
} }
AstBasicDType(FileLine* fl, AstBitPacked, int wantwidth) AstBasicDType(FileLine* fl, VFlagBitPacked, int wantwidth)
: AstNodeDType(fl) { : AstNodeDType(fl) {
init(AstBasicDTypeKwd::BIT, signedst_NOSIGNED, wantwidth, NULL); init(AstBasicDTypeKwd::BIT, signedst_NOSIGNED, wantwidth, NULL);
} }
@ -647,20 +647,20 @@ public:
width(dtp->basicp()->width(), 0); width(dtp->basicp()->width(), 0);
} else width(1, 0); } else width(1, 0);
} }
AstVar(FileLine* fl, AstVarType type, const string& name, AstLogicPacked, int wantwidth) AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth)
:AstNode(fl) :AstNode(fl)
, m_name(name) { , m_name(name) {
init(); init();
combineType(type); combineType(type);
setOp1p(new AstBasicDType(fl, AstLogicPacked(), wantwidth)); setOp1p(new AstBasicDType(fl, VFlagLogicPacked(), wantwidth));
width(wantwidth,0); width(wantwidth,0);
} }
AstVar(FileLine* fl, AstVarType type, const string& name, AstBitPacked, int wantwidth) AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth)
:AstNode(fl) :AstNode(fl)
, m_name(name) { , m_name(name) {
init(); init();
combineType(type); combineType(type);
setOp1p(new AstBasicDType(fl, AstBitPacked(), wantwidth)); setOp1p(new AstBasicDType(fl, VFlagBitPacked(), wantwidth));
width(wantwidth,0); width(wantwidth,0);
} }
AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep) AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep)

View File

@ -85,7 +85,7 @@ private:
AstVar* varp = vscp->varp(); AstVar* varp = vscp->varp();
if (!varp->width1()) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName()); if (!varp->width1()) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName());
string newvarname = ((string)"__Vclklast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName()); string newvarname = ((string)"__Vclklast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName());
AstVar* newvarp = new AstVar (vscp->fileline(), AstVarType::MODULETEMP, newvarname, AstLogicPacked(), 1); AstVar* newvarp = new AstVar (vscp->fileline(), AstVarType::MODULETEMP, newvarname, VFlagLogicPacked(), 1);
m_modp->addStmtp(newvarp); m_modp->addStmtp(newvarp);
AstVarScope* newvscp = new AstVarScope(vscp->fileline(), m_scopep, newvarp); AstVarScope* newvscp = new AstVarScope(vscp->fileline(), m_scopep, newvarp);
vscp->user1p(newvscp); vscp->user1p(newvscp);
@ -103,7 +103,7 @@ private:
AstVarScope* getCreateLocalVar(FileLine* fl, const string& name, AstVar* examplep, int width) { AstVarScope* getCreateLocalVar(FileLine* fl, const string& name, AstVar* examplep, int width) {
AstVar* newvarp; AstVar* newvarp;
if (width) { if (width) {
newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, AstLogicPacked(), width); newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, VFlagLogicPacked(), width);
} else { } else {
newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, examplep); // No range; 1 bit. newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, examplep); // No range; 1 bit.
} }

View File

@ -858,9 +858,9 @@ private:
string name1 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc())); string name1 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc()));
string name2 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc())); string name2 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc()));
AstVar* temp1p = new AstVar(sel1p->fileline(), AstVarType::BLOCKTEMP, name1, AstVar* temp1p = new AstVar(sel1p->fileline(), AstVarType::BLOCKTEMP, name1,
AstLogicPacked(), msb1-lsb1+1); VFlagLogicPacked(), msb1-lsb1+1);
AstVar* temp2p = new AstVar(sel2p->fileline(), AstVarType::BLOCKTEMP, name2, AstVar* temp2p = new AstVar(sel2p->fileline(), AstVarType::BLOCKTEMP, name2,
AstLogicPacked(), msb2-lsb2+1); VFlagLogicPacked(), msb2-lsb2+1);
m_modp->addStmtp(temp1p); m_modp->addStmtp(temp1p);
m_modp->addStmtp(temp2p); m_modp->addStmtp(temp2p);
AstNodeAssign* asn1ap=nodep->cloneType AstNodeAssign* asn1ap=nodep->cloneType

View File

@ -134,7 +134,7 @@ private:
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, oldvarscp->varp()); varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, oldvarscp->varp());
varp->widthSignedFrom(oldvarscp); varp->widthSignedFrom(oldvarscp);
} else { // Used for vset and dimensions, so can zero init } else { // Used for vset and dimensions, so can zero init
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, AstBitPacked(), width); varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, VFlagBitPacked(), width);
} }
addmodp->addStmtp(varp); addmodp->addStmtp(varp);
m_modVarMap.insert(make_pair(make_pair(addmodp, name), varp)); m_modVarMap.insert(make_pair(make_pair(addmodp, name), varp));

View File

@ -69,7 +69,7 @@ private:
// though it's one bit wide, needs the mask in the upper bits. // though it's one bit wide, needs the mask in the upper bits.
// (Someday we'll have a valid bitmask instead of widths....) // (Someday we'll have a valid bitmask instead of widths....)
// See t_func_crc for an example test that requires this // See t_func_crc for an example test that requires this
AstLogicPacked(), nodep->width()); VFlagLogicPacked(), nodep->width());
if (!m_funcp) nodep->v3fatalSrc("Deep expression not under a function"); if (!m_funcp) nodep->v3fatalSrc("Deep expression not under a function");
m_funcp->addInitsp(varp); m_funcp->addInitsp(varp);
// Replace node tree with reference to var // Replace node tree with reference to var

View File

@ -198,7 +198,7 @@ private:
} }
} }
AstVar* newp = new AstVar (forrefp->fileline(), AstVarType::WIRE, AstVar* newp = new AstVar (forrefp->fileline(), AstVarType::WIRE,
forrefp->name(), AstLogicPacked(), 1); forrefp->name(), VFlagLogicPacked(), 1);
newp->trace(m_modp->modTrace()); newp->trace(m_modp->modTrace());
m_modp->addStmtp(newp); m_modp->addStmtp(newp);

View File

@ -139,7 +139,7 @@ private:
string name = string("__Vrepeat")+cvtToStr(m_repeatNum++); string name = string("__Vrepeat")+cvtToStr(m_repeatNum++);
// Spec says value is integral, if negative is ignored // Spec says value is integral, if negative is ignored
AstVar* varp = new AstVar(nodep->fileline(), AstVarType::BLOCKTEMP, name, AstVar* varp = new AstVar(nodep->fileline(), AstVarType::BLOCKTEMP, name,
AstBitPacked(), 32); VFlagBitPacked(), 32);
varp->numeric(AstNumeric::SIGNED); varp->numeric(AstNumeric::SIGNED);
varp->dtypep()->numeric(AstNumeric::SIGNED); varp->dtypep()->numeric(AstNumeric::SIGNED);
varp->usedLoopIdx(true); varp->usedLoopIdx(true);

View File

@ -144,7 +144,7 @@ private:
// Make a new temp wire // Make a new temp wire
string newvarname = "__Vsenitemexpr"+cvtToStr(++m_senitemCvtNum); string newvarname = "__Vsenitemexpr"+cvtToStr(++m_senitemCvtNum);
AstVar* newvarp = new AstVar (sensp->fileline(), AstVarType::MODULETEMP, newvarname, AstVar* newvarp = new AstVar (sensp->fileline(), AstVarType::MODULETEMP, newvarname,
AstLogicPacked(), 1); VFlagLogicPacked(), 1);
// We can't just add under the module, because we may be inside a generate, begin, etc. // We can't just add under the module, because we may be inside a generate, begin, etc.
// We know a SenItem should be under a SenTree/Always etc, we we'll just hunt upwards // We know a SenItem should be under a SenTree/Always etc, we we'll just hunt upwards
AstNode* addwherep = nodep; // Add to this element's next AstNode* addwherep = nodep; // Add to this element's next

View File

@ -103,7 +103,7 @@ private:
AstVar* getBlockTemp(AstNode* nodep) { AstVar* getBlockTemp(AstNode* nodep) {
string newvarname = ((string)"__Vtemp"+cvtToStr(m_modp->varNumGetInc())); string newvarname = ((string)"__Vtemp"+cvtToStr(m_modp->varNumGetInc()));
AstVar* varp = new AstVar (nodep->fileline(), AstVarType::STMTTEMP, newvarname, AstVar* varp = new AstVar (nodep->fileline(), AstVarType::STMTTEMP, newvarname,
AstLogicPacked(), nodep->widthMin()); VFlagLogicPacked(), nodep->widthMin());
m_funcp->addInitsp(varp); m_funcp->addInitsp(varp);
return varp; return varp;
} }

View File

@ -182,7 +182,7 @@ private:
// Index into our table // Index into our table
AstVar* indexVarp = new AstVar (nodep->fileline(), AstVarType::BLOCKTEMP, AstVar* indexVarp = new AstVar (nodep->fileline(), AstVarType::BLOCKTEMP,
"__Vtableidx" + cvtToStr(m_modTables), "__Vtableidx" + cvtToStr(m_modTables),
AstBitPacked(), m_inWidth); VFlagBitPacked(), m_inWidth);
m_modp->addStmtp(indexVarp); m_modp->addStmtp(indexVarp);
AstVarScope* indexVscp = new AstVarScope (indexVarp->fileline(), m_scopep, indexVarp); AstVarScope* indexVscp = new AstVarScope (indexVarp->fileline(), m_scopep, indexVarp);
m_scopep->addVarp(indexVscp); m_scopep->addVarp(indexVscp);
@ -191,7 +191,7 @@ private:
FileLine* fl = nodep->fileline(); FileLine* fl = nodep->fileline();
AstNodeDType* dtypep AstNodeDType* dtypep
= new AstArrayDType (fl, = new AstArrayDType (fl,
new AstBasicDType(fl, AstBitPacked(), m_outVarps.size()), new AstBasicDType(fl, VFlagBitPacked(), m_outVarps.size()),
new AstRange (fl, VL_MASK_I(m_inWidth), 0)); new AstRange (fl, VL_MASK_I(m_inWidth), 0));
AstVar* chgVarp AstVar* chgVarp
= new AstVar (fl, AstVarType::MODULETEMP, = new AstVar (fl, AstVarType::MODULETEMP,
@ -238,7 +238,7 @@ private:
AstNodeDType* dtypep AstNodeDType* dtypep
= new AstArrayDType (fl, = new AstArrayDType (fl,
// FUTURE: If support more types, below can use outvarp->dtype() // FUTURE: If support more types, below can use outvarp->dtype()
new AstBasicDType(fl, AstLogicPacked(), outvarp->width()), new AstBasicDType(fl, VFlagLogicPacked(), outvarp->width()),
new AstRange (fl, VL_MASK_I(m_inWidth), 0)); new AstRange (fl, VL_MASK_I(m_inWidth), 0));
AstVar* tablevarp AstVar* tablevarp
= new AstVar (fl, AstVarType::MODULETEMP, = new AstVar (fl, AstVarType::MODULETEMP,

View File

@ -313,7 +313,7 @@ private:
if (!activityNumber) activityNumber++; // For simplicity, always create it if (!activityNumber) activityNumber++; // For simplicity, always create it
int activityBits = VL_WORDS_I(activityNumber)*VL_WORDSIZE; // For tighter code; round to next 32 bit point. int activityBits = VL_WORDS_I(activityNumber)*VL_WORDSIZE; // For tighter code; round to next 32 bit point.
AstVar* newvarp = new AstVar (m_chgFuncp->fileline(), AstVarType::MODULETEMP, AstVar* newvarp = new AstVar (m_chgFuncp->fileline(), AstVarType::MODULETEMP,
"__Vm_traceActivity", AstBitPacked(), activityBits); "__Vm_traceActivity", VFlagBitPacked(), activityBits);
m_topModp->addStmtp(newvarp); m_topModp->addStmtp(newvarp);
AstVarScope* newvscp = new AstVarScope(newvarp->fileline(), m_highScopep, newvarp); AstVarScope* newvscp = new AstVarScope(newvarp->fileline(), m_highScopep, newvarp);
m_highScopep->addVarp(newvscp); m_highScopep->addVarp(newvscp);

View File

@ -233,7 +233,7 @@ private:
AstVar* enp = new AstVar (outrefp->varp()->fileline(), AstVar* enp = new AstVar (outrefp->varp()->fileline(),
AstVarType::MODULETEMP, AstVarType::MODULETEMP,
outrefp->name() + "__en" + suffix + cvtToStr(m_unique++), outrefp->name() + "__en" + suffix + cvtToStr(m_unique++),
AstLogicPacked(), width); VFlagLogicPacked(), width);
enp->varType2Out(); enp->varType2Out();
if (enp->width() != enrhsp->width()) { if (enp->width() != enrhsp->width()) {
@ -412,7 +412,7 @@ private:
AstVar* newlhsp = new AstVar(lhsp->fileline(), AstVar* newlhsp = new AstVar(lhsp->fileline(),
AstVarType::MODULETEMP, AstVarType::MODULETEMP,
lhsp->name()+"__lhs"+cvtToStr(m_unique++), lhsp->name()+"__lhs"+cvtToStr(m_unique++),
AstLogicPacked(), w); VFlagLogicPacked(), w);
nodep->addStmtp(newlhsp); nodep->addStmtp(newlhsp);
// now append this driver to the driver logic. // now append this driver to the driver logic.
@ -427,7 +427,7 @@ private:
bitselp = new AstVar(lhsp->fileline(), bitselp = new AstVar(lhsp->fileline(),
AstVarType::MODULETEMP, AstVarType::MODULETEMP,
lhsp->name()+"__sel"+cvtToStr(m_unique-1), lhsp->name()+"__sel"+cvtToStr(m_unique-1),
AstLogicPacked(), ws); VFlagLogicPacked(), ws);
// //
nodep->addStmtp(bitselp); nodep->addStmtp(bitselp);
nodep->addStmtp(new AstAssignW(lhsp->fileline(), nodep->addStmtp(new AstAssignW(lhsp->fileline(),

View File

@ -127,7 +127,7 @@ private:
else { else {
string name = ((string)"__Vlvbound"+cvtToStr(m_modp->varNumGetInc())); string name = ((string)"__Vlvbound"+cvtToStr(m_modp->varNumGetInc()));
AstVar* varp = new AstVar(fl, AstVarType::MODULETEMP, name, AstVar* varp = new AstVar(fl, AstVarType::MODULETEMP, name,
AstLogicPacked(), prep->width()); VFlagLogicPacked(), prep->width());
m_modp->addStmtp(varp); m_modp->addStmtp(varp);
AstNode* abovep = prep->backp(); // Grab above point before lose it w/ next replace AstNode* abovep = prep->backp(); // Grab above point before lose it w/ next replace
@ -288,7 +288,7 @@ private:
+cvtToStr(m_modp->varNumGetInc())); +cvtToStr(m_modp->varNumGetInc()));
AstVar* newvarp AstVar* newvarp
= new AstVar (nodep->fileline(), AstVarType::XTEMP, newvarname, = new AstVar (nodep->fileline(), AstVarType::XTEMP, newvarname,
AstLogicPacked(), nodep->width()); VFlagLogicPacked(), nodep->width());
++m_statUnkVars; ++m_statUnkVars;
AstNRelinker replaceHandle; AstNRelinker replaceHandle;
nodep->unlinkFrBack(&replaceHandle); nodep->unlinkFrBack(&replaceHandle);

View File

@ -729,7 +729,7 @@ private:
width=32; width=32;
} }
if (!nodep->isDouble()) { if (!nodep->isDouble()) {
AstBasicDType* newp = new AstBasicDType(nodep->fileline(), AstLogicPacked(), width); AstBasicDType* newp = new AstBasicDType(nodep->fileline(), VFlagLogicPacked(), width);
newp->implicit(true); newp->implicit(true);
newp->numeric(rs); // SIGNED or UNSIGNED newp->numeric(rs); // SIGNED or UNSIGNED
bdtypep->replaceWith(newp); bdtypep->replaceWith(newp);