Internals: Rename isInoutish

This commit is contained in:
Wilson Snyder 2024-11-25 18:25:36 -05:00
parent 1277a40b31
commit a934d965be
11 changed files with 19 additions and 18 deletions

View File

@ -786,8 +786,8 @@ public:
}
string prettyName() const { return verilogKwd(); }
bool isAny() const { return m_e != NONE; }
// Looks like inout - "ish" because not identical to being an INOUT
bool isInoutish() const { return m_e == INOUT; }
bool isInout() const { return m_e == INOUT; }
bool isInoutOrRef() const { return m_e == INOUT || m_e == REF || m_e == CONSTREF; }
bool isInput() const { return m_e == INPUT; }
bool isNonOutput() const {
return m_e == INPUT || m_e == INOUT || m_e == REF || m_e == CONSTREF;

View File

@ -2060,7 +2060,8 @@ public:
bool isAnsi() const { return m_ansi; }
bool isContinuously() const { return m_isContinuously; }
bool isDeclTyped() const { return m_declTyped; }
bool isInoutish() const { return m_direction.isInoutish(); }
bool isInout() const { return m_direction.isInout(); }
bool isInoutOrRef() const { return m_direction.isInoutOrRef(); }
bool isInput() const { return m_direction.isInput(); }
bool isNonOutput() const { return m_direction.isNonOutput(); }
bool isReadOnly() const VL_MT_SAFE { return m_direction.isReadOnly(); }

View File

@ -535,7 +535,7 @@ string AstVar::vlEnumType() const {
string AstVar::vlEnumDir() const {
string out;
if (isInoutish()) {
if (isInout()) {
out = "VLVD_INOUT";
} else if (isWritable()) {
out = "VLVD_OUT";
@ -2448,7 +2448,7 @@ int AstVarRef::instrCount() const {
void AstVar::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (isSc()) str << " [SC]";
if (isPrimaryIO()) str << (isInoutish() ? " [PIO]" : (isWritable() ? " [PO]" : " [PI]"));
if (isPrimaryIO()) str << (isInout() ? " [PIO]" : (isWritable() ? " [PO]" : " [PI]"));
if (isIO()) str << " " << direction().ascii();
if (isConst()) str << " [CONST]";
if (isPullup()) str << " [PULLUP]";
@ -2649,7 +2649,7 @@ bool AstNodeFTask::getPurityRecurse() const {
// or any write reference to a variable that isn't an automatic function local.
for (AstNode* stmtp = this->stmtsp(); stmtp; stmtp = stmtp->nextp()) {
if (const AstVar* const varp = VN_CAST(stmtp, Var)) {
if (varp->isInoutish() || varp->isRef()) return false;
if (varp->isInoutOrRef()) return false;
}
if (!stmtp->isPure()) return false;
if (stmtp->exists([](const AstNodeVarRef* const varrefp) {

View File

@ -192,7 +192,7 @@ void EmitCBaseVisitorConst::emitVarDecl(const AstVar* nodep, bool asRef) {
if (nodep->attrScClocked() && nodep->isReadOnly()) {
putns(nodep, "sc_core::sc_in_clk ");
} else {
if (nodep->isInoutish()) {
if (nodep->isInout()) {
putns(nodep, "sc_core::sc_inout<");
} else if (nodep->isWritable()) {
putns(nodep, "sc_core::sc_out<");
@ -213,7 +213,7 @@ void EmitCBaseVisitorConst::emitVarDecl(const AstVar* nodep, bool asRef) {
emitDeclArrayBrackets(nodep);
puts(";\n");
} else if (nodep->isIO() && basicp && !basicp->isOpaque()) {
if (nodep->isInoutish()) {
if (nodep->isInout()) {
putns(nodep, "VL_INOUT");
} else if (nodep->isWritable()) {
putns(nodep, "VL_OUT");

View File

@ -733,7 +733,7 @@ class EmitCTrace final : EmitCFunc {
puts("," + cvtToStr(enumNum));
// Direction
if (nodep->declDirection().isInoutish()) {
if (nodep->declDirection().isInout()) {
puts(", VerilatedTraceSigDirection::INOUT");
} else if (nodep->declDirection().isWritable()) {
puts(", VerilatedTraceSigDirection::OUTPUT");

View File

@ -433,7 +433,7 @@ class DynScopeVisitor final : public VNVisitor {
nodep->v3warn(
E_UNSUPPORTED,
"Unsupported: Writing to a captured "
<< (nodep->varp()->isInoutish() ? "inout" : "output") << " variable in a "
<< (nodep->varp()->isInout() ? "inout" : "output") << " variable in a "
<< (VN_IS(nodep->backp(), AssignDly) ? "non-blocking assignment" : "fork")
<< " after a timing control");
}

View File

@ -67,7 +67,7 @@ class InstVisitor final : public VNVisitor {
AstNodeExpr* const exprp = VN_AS(nodep->exprp(), NodeExpr)->cloneTree(false);
UASSERT_OBJ(exprp->width() == nodep->modVarp()->width(), nodep,
"Width mismatch, should have been handled in pinReconnectSimple");
if (nodep->modVarp()->isInoutish()) {
if (nodep->modVarp()->isInout()) {
nodep->v3fatalSrc("Unsupported: Verilator is a 2-state simulator");
} else if (nodep->modVarp()->isWritable()) {
AstNodeExpr* const rhsp = new AstVarXRef{exprp->fileline(), nodep->modVarp(),
@ -558,7 +558,7 @@ public:
// Important to add statement next to cell, in case there is a
// generate with same named cell
cellp->addNextHere(newvarp);
if (pinVarp->isInoutish()) {
if (pinVarp->isInout()) {
pinVarp->v3fatalSrc("Unsupported: Inout connections to pins must be"
" direct one-to-one connection (without any expression)");
} else if (pinVarp->isWritable()) {

View File

@ -775,7 +775,7 @@ public:
const std::pair<uint32_t, uint32_t> dim = nodep->dtypep()->dimensions(false);
UINFO(7, nodep->prettyNameQ()
<< " pub:" << nodep->isSigPublic() << " pri:" << nodep->isPrimaryIO()
<< " io:" << nodep->isInoutish() << " typ:" << nodep->varType() << "\n");
<< " io:" << nodep->isInout() << " typ:" << nodep->varType() << "\n");
const char* reason = nullptr;
// Public variable cannot be split.
// at least one unpacked dimension must exist

View File

@ -515,7 +515,7 @@ class TaskVisitor final : public VNVisitor {
pinp->v3fatalSrc("ref argument should have caused non-inline of function");
}
}
} else if (portp->isInoutish()) {
} else if (portp->isInout()) {
// if (debug() >= 9) pinp->dumpTree("-pinrsize- ");
AstVarScope* const newvscp
@ -900,7 +900,7 @@ class TaskVisitor final : public VNVisitor {
if (portp->isNonOutput()) {
std::string frName
= portp->isInoutish() && portp->basicp()->isDpiPrimitive()
= portp->isInout() && portp->basicp()->isDpiPrimitive()
&& portp->dtypep()->skipRefp()->arrayUnpackedElements() == 1
? "*"
: "";

View File

@ -23,7 +23,7 @@
// Over each module, from child to parent:
// Build a graph, connecting signals together so we can propagate tristates
// Variable becomes tristate with
// VAR->isInoutish
// VAR->isInout
// VAR->isPullup/isPulldown (converted to AstPullup/AstPulldown
// BufIf0/1
// All variables on the LHS need to become tristate when there is:
@ -1779,7 +1779,7 @@ class TristateVisitor final : public TristateBaseVisitor {
nodep->addNextHere(newp);
// We'll iterate on the new AstPull later
}
if (nodep->isInoutish()
if (nodep->isInout()
//|| varp->isOutput()
// Note unconnected output only changes behavior vs. previous
// versions and causes outputs that don't come from anywhere to

View File

@ -504,7 +504,7 @@ class UndrivenVisitor final : public VNVisitorConst {
}
void visit(AstPin* nodep) override {
VL_RESTORER(m_inInoutPin);
m_inInoutPin = nodep->modVarp()->isInoutish();
m_inInoutPin = nodep->modVarp()->isInout();
iterateChildrenConst(nodep);
}