Simplify primary input checks

This commit is contained in:
Geza Lore 2022-07-15 16:18:41 +01:00
parent 00c1f67c57
commit 3773e2ef95
2 changed files with 5 additions and 7 deletions

View File

@ -805,10 +805,9 @@ AstNode* createInputCombLoop(AstNetlist* netlistp, SenExprBuilder& senExprBuilde
AstCFunc* const icoFuncp
= V3Order::order(netlistp, {&logic}, trigToSen, "ico", false, false,
[=](const AstVarScope* vscp, std::vector<AstSenTree*>& out) {
if (vscp->scopep()->isTop() && vscp->varp()->isNonOutput()) {
out.push_back(inputChanged);
}
if (vscp->varp()->isWrittenByDpi()) out.push_back(dpiExportTriggered);
AstVar* const varp = vscp->varp();
if (varp->isPrimaryInish()) out.push_back(inputChanged);
if (varp->isWrittenByDpi()) out.push_back(dpiExportTriggered);
});
splitCheck(icoFuncp);

View File

@ -121,16 +121,15 @@ public:
: Vertex{graphp}
, m_vscp{vscp} {
// Top level inputs are
if (isTopInput() || varp()->isWrittenByDpi()) addDrivingRegions(INPUT);
if (varp()->isPrimaryInish() || varp()->isWrittenByDpi()) addDrivingRegions(INPUT);
}
AstVarScope* vscp() const { return m_vscp; }
AstVar* varp() const { return m_vscp->varp(); }
AstScope* scopep() const { return m_vscp->scopep(); }
bool isTopInput() const { return scopep()->isTop() && varp()->isNonOutput(); }
// For graph dumping
string name() const override { return m_vscp->name(); }
string dotShape() const override { return isTopInput() ? "invhouse" : "ellipse"; }
string dotShape() const override { return varp()->isPrimaryInish() ? "invhouse" : "ellipse"; }
};
class Graph final : public V3Graph {};