mirror of
https://github.com/verilator/verilator.git
synced 2025-01-15 02:54:03 +00:00
Internals: Refactor some VAssign printing. No functional change.
This commit is contained in:
parent
2aedc91151
commit
80284c437e
@ -131,6 +131,10 @@ public:
|
|||||||
static const char* const names[] = {"RD", "WR"};
|
static const char* const names[] = {"RD", "WR"};
|
||||||
return names[m_e];
|
return names[m_e];
|
||||||
}
|
}
|
||||||
|
const char* arrow() const {
|
||||||
|
static const char* const names[] = {"[RV] <-", "[LV] =>"};
|
||||||
|
return names[m_e];
|
||||||
|
}
|
||||||
inline VAccess()
|
inline VAccess()
|
||||||
: m_e{READ} {}
|
: m_e{READ} {}
|
||||||
// cppcheck-suppress noExplicitConstructor
|
// cppcheck-suppress noExplicitConstructor
|
||||||
|
@ -1453,12 +1453,8 @@ void AstVarScope::dump(std::ostream& str) const {
|
|||||||
void AstNodeVarRef::dump(std::ostream& str) const { this->AstNodeMath::dump(str); }
|
void AstNodeVarRef::dump(std::ostream& str) const { this->AstNodeMath::dump(str); }
|
||||||
void AstVarXRef::dump(std::ostream& str) const {
|
void AstVarXRef::dump(std::ostream& str) const {
|
||||||
this->AstNodeVarRef::dump(str);
|
this->AstNodeVarRef::dump(str);
|
||||||
if (packagep()) { str << " pkg=" << nodeAddr(packagep()); }
|
if (packagep()) str << " pkg=" << nodeAddr(packagep());
|
||||||
if (access().isWrite()) {
|
str << " " << access().arrow() << " ";
|
||||||
str << " [LV] => ";
|
|
||||||
} else {
|
|
||||||
str << " [RV] <- ";
|
|
||||||
}
|
|
||||||
str << ".=" << dotted() << " ";
|
str << ".=" << dotted() << " ";
|
||||||
if (inlinedDots() != "") str << " inline.=" << inlinedDots() << " - ";
|
if (inlinedDots() != "") str << " inline.=" << inlinedDots() << " - ";
|
||||||
if (varScopep()) {
|
if (varScopep()) {
|
||||||
@ -1471,12 +1467,8 @@ void AstVarXRef::dump(std::ostream& str) const {
|
|||||||
}
|
}
|
||||||
void AstVarRef::dump(std::ostream& str) const {
|
void AstVarRef::dump(std::ostream& str) const {
|
||||||
this->AstNodeVarRef::dump(str);
|
this->AstNodeVarRef::dump(str);
|
||||||
if (packagep()) { str << " pkg=" << nodeAddr(packagep()); }
|
if (packagep()) str << " pkg=" << nodeAddr(packagep());
|
||||||
if (access().isWrite()) {
|
str << " " << access().arrow() << " ";
|
||||||
str << " [LV] => ";
|
|
||||||
} else {
|
|
||||||
str << " [RV] <- ";
|
|
||||||
}
|
|
||||||
if (varScopep()) {
|
if (varScopep()) {
|
||||||
varScopep()->dump(str);
|
varScopep()->dump(str);
|
||||||
} else if (varp()) {
|
} else if (varp()) {
|
||||||
|
@ -314,7 +314,7 @@ private:
|
|||||||
// It was an expression, then got constified. In reality, the WordSel
|
// It was an expression, then got constified. In reality, the WordSel
|
||||||
// must be wrapped in a Cond, that will be false.
|
// must be wrapped in a Cond, that will be false.
|
||||||
return (VN_IS(nodep->rhsp(), Const) && VN_IS(nodep->fromp(), NodeVarRef)
|
return (VN_IS(nodep->rhsp(), Const) && VN_IS(nodep->fromp(), NodeVarRef)
|
||||||
&& !VN_CAST_CONST(nodep->fromp(), NodeVarRef)->access().isWrite()
|
&& VN_CAST_CONST(nodep->fromp(), NodeVarRef)->access().isReadOnly()
|
||||||
&& (static_cast<int>(VN_CAST_CONST(nodep->rhsp(), Const)->toUInt())
|
&& (static_cast<int>(VN_CAST_CONST(nodep->rhsp(), Const)->toUInt())
|
||||||
>= VN_CAST(nodep->fromp(), NodeVarRef)->varp()->widthWords()));
|
>= VN_CAST(nodep->fromp(), NodeVarRef)->varp()->widthWords()));
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ private:
|
|||||||
vvertexp->setIsClock();
|
vvertexp->setIsClock();
|
||||||
// For SYNCASYNCNET
|
// For SYNCASYNCNET
|
||||||
varscp->user2(true);
|
varscp->user2(true);
|
||||||
} else if (m_activep && m_activep->hasClocked() && !nodep->access().isWrite()) {
|
} else if (m_activep && m_activep->hasClocked() && nodep->access().isReadOnly()) {
|
||||||
if (varscp->user2()) {
|
if (varscp->user2()) {
|
||||||
if (!vvertexp->rstAsyncNodep()) vvertexp->rstAsyncNodep(nodep);
|
if (!vvertexp->rstAsyncNodep()) vvertexp->rstAsyncNodep(nodep);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1237,7 +1237,7 @@ class TristateVisitor : public TristateBaseVisitor {
|
|||||||
UINFO(9, " Ref-to-lvalue " << nodep << endl);
|
UINFO(9, " Ref-to-lvalue " << nodep << endl);
|
||||||
m_tgraph.didProcess(nodep);
|
m_tgraph.didProcess(nodep);
|
||||||
mapInsertLhsVarRef(nodep);
|
mapInsertLhsVarRef(nodep);
|
||||||
} else if (!nodep->access().isWrite()
|
} else if (nodep->access().isReadOnly()
|
||||||
// Not already processed, nor varref from visit(AstPin) creation
|
// Not already processed, nor varref from visit(AstPin) creation
|
||||||
&& !nodep->user1p()
|
&& !nodep->user1p()
|
||||||
// Reference to another tristate variable
|
// Reference to another tristate variable
|
||||||
|
@ -451,7 +451,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_varModeReplace && nodep->varp() == m_forVarp && nodep->varScopep() == m_forVscp
|
if (m_varModeReplace && nodep->varp() == m_forVarp && nodep->varScopep() == m_forVscp
|
||||||
&& !nodep->access().isWrite()) {
|
&& nodep->access().isReadOnly()) {
|
||||||
AstNode* newconstp = m_varValuep->cloneTree(false);
|
AstNode* newconstp = m_varValuep->cloneTree(false);
|
||||||
nodep->replaceWith(newconstp);
|
nodep->replaceWith(newconstp);
|
||||||
pushDeletep(nodep);
|
pushDeletep(nodep);
|
||||||
|
Loading…
Reference in New Issue
Block a user