forked from github/verilator
Internals: Tristate common pull setter. No functional change
This commit is contained in:
parent
2c9e2b2e3c
commit
86af244636
@ -182,10 +182,15 @@ class TristateVisitor : public TristateBaseVisitor {
|
|||||||
return newp;
|
return newp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkPullDirection(AstPull* pullp1, AstPull* pullp2) {
|
void setPullDirection(AstVar* varp, AstPull* pullp) {
|
||||||
if (pullp1 && pullp2 && pullp1->direction() != pullp2->direction()) {
|
AstPull* oldpullp = (AstPull*)varp->user3p();
|
||||||
pullp1->v3error("Unsupported: Conflicting pull directions.");
|
if (!oldpullp) {
|
||||||
pullp2->v3error("... Location of conflicing pull.");
|
varp->user3p(pullp); //save off to indicate the pull direction
|
||||||
|
} else {
|
||||||
|
if (oldpullp->direction() != pullp->direction()) {
|
||||||
|
pullp->v3error("Unsupported: Conflicting pull directions.");
|
||||||
|
oldpullp->v3error("... Location of conflicing pull.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -638,8 +643,7 @@ class TristateVisitor : public TristateBaseVisitor {
|
|||||||
AstVarRef* lhsp = nodep->lhsp()->unlinkFrBack()->castVarRef();
|
AstVarRef* lhsp = nodep->lhsp()->unlinkFrBack()->castVarRef();
|
||||||
lhsp->lvalue(true);
|
lhsp->lvalue(true);
|
||||||
AstVar* varp = lhsp->varp();
|
AstVar* varp = lhsp->varp();
|
||||||
AstPull* pullp = (AstPull*)varp->user3p();
|
setPullDirection(varp, nodep);
|
||||||
checkPullDirection(pullp, nodep);
|
|
||||||
V3Number zeros (nodep->fileline(), varp->width());
|
V3Number zeros (nodep->fileline(), varp->width());
|
||||||
zeros.setAllBits0();
|
zeros.setAllBits0();
|
||||||
AstConst* constp = new AstConst(nodep->fileline(), zeros);
|
AstConst* constp = new AstConst(nodep->fileline(), zeros);
|
||||||
@ -758,12 +762,8 @@ class TristateVisitor : public TristateBaseVisitor {
|
|||||||
if (refp) {
|
if (refp) {
|
||||||
if (AstPull* pullp = (AstPull*) nodep->modVarp()->user3p()) {
|
if (AstPull* pullp = (AstPull*) nodep->modVarp()->user3p()) {
|
||||||
UINFO(9, "propagate pull to "<<refp->varp());
|
UINFO(9, "propagate pull to "<<refp->varp());
|
||||||
if (!refp->varp()->user3p()) {
|
|
||||||
refp->varp()->user3p(pullp);
|
|
||||||
} else {
|
|
||||||
//selp: Note we don't currently obey selects; all bits must be consistently pulled
|
//selp: Note we don't currently obey selects; all bits must be consistently pulled
|
||||||
checkPullDirection(pullp, (AstPull*) refp->varp()->user3p());
|
setPullDirection(refp->varp(), pullp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Don't need to visit the created assigns, as it was added at the end of the next links
|
// Don't need to visit the created assigns, as it was added at the end of the next links
|
||||||
|
Loading…
Reference in New Issue
Block a user