Internals: Fix some spacing. No functional change.
This commit is contained in:
parent
57f2fe77ea
commit
f0af8726e3
|
|
@ -172,7 +172,7 @@ private:
|
||||||
m_cellRangep = nodep->rangep();
|
m_cellRangep = nodep->rangep();
|
||||||
UINFO(4," CELL "<<nodep<<endl);
|
UINFO(4," CELL "<<nodep<<endl);
|
||||||
|
|
||||||
AstVar *ifaceVarp = nodep->nextp()->castVar();
|
AstVar* ifaceVarp = nodep->nextp()->castVar();
|
||||||
bool isIface = ifaceVarp
|
bool isIface = ifaceVarp
|
||||||
&& ifaceVarp->dtypep()->castUnpackArrayDType()
|
&& ifaceVarp->dtypep()->castUnpackArrayDType()
|
||||||
&& ifaceVarp->dtypep()->castUnpackArrayDType()->subDTypep()->castIfaceRefDType();
|
&& ifaceVarp->dtypep()->castUnpackArrayDType()->subDTypep()->castIfaceRefDType();
|
||||||
|
|
@ -193,9 +193,9 @@ private:
|
||||||
// If this AstCell is actually an interface instantiation, let's ensure we also clone
|
// If this AstCell is actually an interface instantiation, let's ensure we also clone
|
||||||
// the IfaceRef.
|
// the IfaceRef.
|
||||||
if (isIface) {
|
if (isIface) {
|
||||||
AstUnpackArrayDType *arrdtype = ifaceVarp->dtypep()->castUnpackArrayDType();
|
AstUnpackArrayDType* arrdtype = ifaceVarp->dtypep()->castUnpackArrayDType();
|
||||||
AstVar* varNewp = ifaceVarp->cloneTree(false);
|
AstVar* varNewp = ifaceVarp->cloneTree(false);
|
||||||
AstIfaceRefDType *ifaceRefp = arrdtype->subDTypep()->castIfaceRefDType()->cloneTree(false);
|
AstIfaceRefDType* ifaceRefp = arrdtype->subDTypep()->castIfaceRefDType()->cloneTree(false);
|
||||||
arrdtype->addNextHere(ifaceRefp);
|
arrdtype->addNextHere(ifaceRefp);
|
||||||
ifaceRefp->cellp(newp);
|
ifaceRefp->cellp(newp);
|
||||||
ifaceRefp->cellName(newp->name());
|
ifaceRefp->cellName(newp->name());
|
||||||
|
|
@ -246,21 +246,21 @@ private:
|
||||||
} else {
|
} else {
|
||||||
nodep->v3fatalSrc("Width mismatch; V3Width should have errored out.");
|
nodep->v3fatalSrc("Width mismatch; V3Width should have errored out.");
|
||||||
}
|
}
|
||||||
} else if(AstArraySel *arrselp = nodep->exprp()->castArraySel()) {
|
} else if(AstArraySel* arrselp = nodep->exprp()->castArraySel()) {
|
||||||
if (AstUnpackArrayDType *arrp = arrselp->lhsp()->dtypep()->castUnpackArrayDType()) {
|
if (AstUnpackArrayDType* arrp = arrselp->lhsp()->dtypep()->castUnpackArrayDType()) {
|
||||||
if (!arrp->subDTypep()->castIfaceRefDType())
|
if (!arrp->subDTypep()->castIfaceRefDType())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
V3Const::constifyParamsEdit(arrselp->rhsp());
|
V3Const::constifyParamsEdit(arrselp->rhsp());
|
||||||
AstConst *constp = arrselp->rhsp()->castConst();
|
AstConst* constp = arrselp->rhsp()->castConst();
|
||||||
if (!constp) {
|
if (!constp) {
|
||||||
nodep->v3error("Unsupported: Non-constant index when passing interface to module");
|
nodep->v3error("Unsupported: Non-constant index when passing interface to module");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string index = AstNode::encodeNumber(constp->toSInt());
|
string index = AstNode::encodeNumber(constp->toSInt());
|
||||||
AstVarRef *varrefp = arrselp->lhsp()->castVarRef();
|
AstVarRef* varrefp = arrselp->lhsp()->castVarRef();
|
||||||
AstVarXRef *newp = new AstVarXRef(nodep->fileline(),varrefp->name () + "__BRA__" + index + "__KET__", "", true);
|
AstVarXRef* newp = new AstVarXRef(nodep->fileline(),varrefp->name () + "__BRA__" + index + "__KET__", "", true);
|
||||||
AstVar *varp = varrefp->varp()->cloneTree(true);
|
AstVar* varp = varrefp->varp()->cloneTree(true);
|
||||||
varp->name(varp->name() + "__TMP__" + "__BRA__" + index + "__KET__");
|
varp->name(varp->name() + "__TMP__" + "__BRA__" + index + "__KET__");
|
||||||
if (!nodep->modVarp()->dtypep()) nodep->v3fatalSrc("No dtype for AstPin");
|
if (!nodep->modVarp()->dtypep()) nodep->v3fatalSrc("No dtype for AstPin");
|
||||||
varp->dtypep(nodep->modVarp()->dtypep());
|
varp->dtypep(nodep->modVarp()->dtypep());
|
||||||
|
|
|
||||||
|
|
@ -349,12 +349,12 @@ private:
|
||||||
// may remap interfaces to be more like a class.
|
// may remap interfaces to be more like a class.
|
||||||
if (!nodep->hasIfaceVar()) {
|
if (!nodep->hasIfaceVar()) {
|
||||||
string varName = nodep->name() + "__Viftop"; // V3LinkDot looks for this naming
|
string varName = nodep->name() + "__Viftop"; // V3LinkDot looks for this naming
|
||||||
AstIfaceRefDType *idtypep = new AstIfaceRefDType(nodep->fileline(), nodep->name(),
|
AstIfaceRefDType* idtypep = new AstIfaceRefDType(nodep->fileline(), nodep->name(),
|
||||||
nodep->modp()->name());
|
nodep->modp()->name());
|
||||||
idtypep->ifacep(NULL); // cellp overrides
|
idtypep->ifacep(NULL); // cellp overrides
|
||||||
AstVar *varp;
|
AstVar* varp;
|
||||||
if (nodep->rangep()) {
|
if (nodep->rangep()) {
|
||||||
AstNodeArrayDType *arrp = new AstUnpackArrayDType(nodep->fileline(),VFlagChildDType(), idtypep, nodep->rangep()->cloneTree(true));
|
AstNodeArrayDType* arrp = new AstUnpackArrayDType(nodep->fileline(),VFlagChildDType(), idtypep, nodep->rangep()->cloneTree(true));
|
||||||
varp = new AstVar(nodep->fileline(), AstVarType::IFACEREF, varName,
|
varp = new AstVar(nodep->fileline(), AstVarType::IFACEREF, varName,
|
||||||
VFlagChildDType(), arrp);
|
VFlagChildDType(), arrp);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -496,7 +496,7 @@ void ParamVisitor::visitCell(AstCell* nodep) {
|
||||||
if (modvarp->isIfaceRef()) {
|
if (modvarp->isIfaceRef()) {
|
||||||
AstIfaceRefDType* portIrefp = modvarp->subDTypep()->castIfaceRefDType();
|
AstIfaceRefDType* portIrefp = modvarp->subDTypep()->castIfaceRefDType();
|
||||||
AstIfaceRefDType* pinIrefp = NULL;
|
AstIfaceRefDType* pinIrefp = NULL;
|
||||||
AstNode *exprp = pinp->exprp();
|
AstNode* exprp = pinp->exprp();
|
||||||
if (exprp
|
if (exprp
|
||||||
&& exprp->castVarRef()
|
&& exprp->castVarRef()
|
||||||
&& exprp->castVarRef()->varp()
|
&& exprp->castVarRef()->varp()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue