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"};
|
||||
return names[m_e];
|
||||
}
|
||||
const char* arrow() const {
|
||||
static const char* const names[] = {"[RV] <-", "[LV] =>"};
|
||||
return names[m_e];
|
||||
}
|
||||
inline VAccess()
|
||||
: m_e{READ} {}
|
||||
// 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 AstVarXRef::dump(std::ostream& str) const {
|
||||
this->AstNodeVarRef::dump(str);
|
||||
if (packagep()) { str << " pkg=" << nodeAddr(packagep()); }
|
||||
if (access().isWrite()) {
|
||||
str << " [LV] => ";
|
||||
} else {
|
||||
str << " [RV] <- ";
|
||||
}
|
||||
if (packagep()) str << " pkg=" << nodeAddr(packagep());
|
||||
str << " " << access().arrow() << " ";
|
||||
str << ".=" << dotted() << " ";
|
||||
if (inlinedDots() != "") str << " inline.=" << inlinedDots() << " - ";
|
||||
if (varScopep()) {
|
||||
@ -1471,12 +1467,8 @@ void AstVarXRef::dump(std::ostream& str) const {
|
||||
}
|
||||
void AstVarRef::dump(std::ostream& str) const {
|
||||
this->AstNodeVarRef::dump(str);
|
||||
if (packagep()) { str << " pkg=" << nodeAddr(packagep()); }
|
||||
if (access().isWrite()) {
|
||||
str << " [LV] => ";
|
||||
} else {
|
||||
str << " [RV] <- ";
|
||||
}
|
||||
if (packagep()) str << " pkg=" << nodeAddr(packagep());
|
||||
str << " " << access().arrow() << " ";
|
||||
if (varScopep()) {
|
||||
varScopep()->dump(str);
|
||||
} else if (varp()) {
|
||||
|
@ -314,7 +314,7 @@ private:
|
||||
// It was an expression, then got constified. In reality, the WordSel
|
||||
// must be wrapped in a Cond, that will be false.
|
||||
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())
|
||||
>= VN_CAST(nodep->fromp(), NodeVarRef)->varp()->widthWords()));
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ private:
|
||||
vvertexp->setIsClock();
|
||||
// For SYNCASYNCNET
|
||||
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 (!vvertexp->rstAsyncNodep()) vvertexp->rstAsyncNodep(nodep);
|
||||
} else {
|
||||
|
@ -1237,7 +1237,7 @@ class TristateVisitor : public TristateBaseVisitor {
|
||||
UINFO(9, " Ref-to-lvalue " << nodep << endl);
|
||||
m_tgraph.didProcess(nodep);
|
||||
mapInsertLhsVarRef(nodep);
|
||||
} else if (!nodep->access().isWrite()
|
||||
} else if (nodep->access().isReadOnly()
|
||||
// Not already processed, nor varref from visit(AstPin) creation
|
||||
&& !nodep->user1p()
|
||||
// Reference to another tristate variable
|
||||
|
@ -451,7 +451,7 @@ private:
|
||||
}
|
||||
|
||||
if (m_varModeReplace && nodep->varp() == m_forVarp && nodep->varScopep() == m_forVscp
|
||||
&& !nodep->access().isWrite()) {
|
||||
&& nodep->access().isReadOnly()) {
|
||||
AstNode* newconstp = m_varValuep->cloneTree(false);
|
||||
nodep->replaceWith(newconstp);
|
||||
pushDeletep(nodep);
|
||||
|
Loading…
Reference in New Issue
Block a user