From fdf462ff3c120f812d612d4d85d92872d6d8efbf Mon Sep 17 00:00:00 2001 From: Nick Brereton Date: Fri, 27 Mar 2026 14:57:02 -0400 Subject: [PATCH] V3Tristate: limit resolved xref tri propagation to feedsTri reads --- src/V3Tristate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index f68067f1e..dfe9537d6 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -2009,8 +2009,10 @@ class TristateVisitor final : public TristateBaseVisitor { // Reference to another tristate variable in this module context && ((m_tgraph.isTristate(nodep->varp()) && m_tgraph.feedsTri(nodep)) // Or a cross-module/interface reference whose target already has - // a resolved tristate-enable signal from prior processing. - || (VN_IS(nodep, VarXRef) && VN_IS(nodep->varp()->user1p(), Var)))) { + // a resolved tristate-enable signal from prior processing, and this + // read actually feeds a tristate path in the current module. + || (VN_IS(nodep, VarXRef) && VN_IS(nodep->varp()->user1p(), Var) + && m_tgraph.feedsTri(nodep)))) { // Then propagate the enable from the original variable UINFO(9, " Ref-to-tri " << nodep); FileLine* const fl = nodep->fileline();