From a07a980b73cdde207a096e74a797f9cd0cc4da31 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Mon, 15 Jun 2026 09:17:41 +0100 Subject: [PATCH] Internals: Do not overload AstVar::isPrimaryIO() for sampled value vars --- src/V3Sampled.cpp | 2 -- src/V3Sched.cpp | 2 +- src/V3SchedReplicate.cpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/V3Sampled.cpp b/src/V3Sampled.cpp index 4fb45e772..841b32d55 100644 --- a/src/V3Sampled.cpp +++ b/src/V3Sampled.cpp @@ -51,8 +51,6 @@ class SampledVisitor final : public VNVisitor { AstVar* const newvarp = new AstVar{flp, VVarType::MODULETEMP, newvarname, varp->dtypep()}; m_scopep->modp()->addStmtsp(newvarp); AstVarScope* const newvscp = new AstVarScope{flp, m_scopep, newvarp}; - newvarp->direction(VDirection::INPUT); // Inform V3Sched that it will be driven later - newvarp->primaryIO(true); newvarp->sampled(true); vscp->user1p(newvscp); m_scopep->addVarsp(newvscp); diff --git a/src/V3Sched.cpp b/src/V3Sched.cpp index 217cd3f95..6078fbbf0 100644 --- a/src/V3Sched.cpp +++ b/src/V3Sched.cpp @@ -608,7 +608,7 @@ AstNode* createInputCombLoop(AstNetlist* netlistp, AstCFunc* const initFuncp, auto it = inp2changedp.find(vscp); if (it != inp2changedp.end()) { out.push_back(it->second); - } else if (varp->isPrimaryInish() || varp->isSigUserRWPublic()) { + } else if (varp->isPrimaryInish() || varp->isSigUserRWPublic() || varp->sampled()) { if (!firstIterTriggerp) { firstIterTriggerp = trigKit.newExtraTriggerSenTree(trigKit.vscp(), firstIterationTrigger); diff --git a/src/V3SchedReplicate.cpp b/src/V3SchedReplicate.cpp index 35718b98a..3aa404018 100644 --- a/src/V3SchedReplicate.cpp +++ b/src/V3SchedReplicate.cpp @@ -150,8 +150,8 @@ public: : SchedReplicateVertex{graphp} , m_vscp{vscp} { // Top level inputs are - if (varp()->isPrimaryInish() || varp()->isSigUserRWPublic() || varp()->isWrittenByDpi() - || varp()->sensIfacep() || varp()->isVirtIface()) { + if (varp()->isPrimaryInish() || varp()->isSigUserRWPublic() || varp()->sampled() + || varp()->isWrittenByDpi() || varp()->sensIfacep() || varp()->isVirtIface()) { addDrivingRegions(INPUT); } // Currently we always execute suspendable processes at the beginning of