From 3773e2ef9595d7d4b0a467a2b3c0150e5d440e09 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Fri, 15 Jul 2022 16:18:41 +0100 Subject: [PATCH] Simplify primary input checks --- src/V3Sched.cpp | 7 +++---- src/V3SchedReplicate.cpp | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/V3Sched.cpp b/src/V3Sched.cpp index 2633ed8f4..5c7b43f15 100644 --- a/src/V3Sched.cpp +++ b/src/V3Sched.cpp @@ -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& 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); diff --git a/src/V3SchedReplicate.cpp b/src/V3SchedReplicate.cpp index 8a8c74d68..d047045f8 100644 --- a/src/V3SchedReplicate.cpp +++ b/src/V3SchedReplicate.cpp @@ -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 {};