From 89fb5a2ef603872f943e60b85467bc8fc1ca136e Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Fri, 6 Dec 2024 15:44:30 +0100 Subject: [PATCH] Include variable to map if it uses rand mode Signed-off-by: Ryszard Rozak --- src/V3Randomize.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 86a18f20d5..4f042eeeb0 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -1163,10 +1163,8 @@ class RandomizeVisitor final : public VNVisitor { } void fillConstrainedMapRecurse(AstNode* const nodep, AstClass* const classp) { if (AstVarRef* const varRefp = VN_CAST(nodep, VarRef)) { - if (varRefp->user1()) { - AstVar* const varp = varRefp->varp(); - m_constrainedVars[classp].insert(varp); - } + AstVar* const varp = varRefp->varp(); + if (varRefp->user1() || varp->user1()) m_constrainedVars[classp].insert(varp); return; } if (nodep->op1p()) fillConstrainedMapRecurse(nodep->op1p(), classp);