From 35f20a4251df8bd92508ab3a86a49e88b96314fc Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Wed, 25 Oct 2023 16:28:23 +0200 Subject: [PATCH] Skip references in dtypes Signed-off-by: Ryszard Rozak --- src/V3Randomize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index af72b95c0db..71ecfe696de 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -55,7 +55,7 @@ class RandomizeMarkVisitor final : public VNVisitorConst { for (auto* memberp = classp->stmtsp(); memberp; memberp = memberp->nextp()) { // If member is rand and of class type, mark its class if (VN_IS(memberp, Var) && VN_AS(memberp, Var)->isRand()) { - if (const auto* const classRefp = VN_CAST(memberp->dtypep(), ClassRefDType)) { + if (const auto* const classRefp = VN_CAST(memberp->dtypep()->skipRefp(), ClassRefDType)) { auto* const rclassp = classRefp->classp(); if (!rclassp->user1()) { rclassp->user1(true); @@ -100,7 +100,7 @@ class RandomizeMarkVisitor final : public VNVisitorConst { iterateChildrenConst(nodep); if (nodep->name() != "randomize") return; if (const AstClassRefDType* const classRefp - = VN_CAST(nodep->fromp()->dtypep(), ClassRefDType)) { + = VN_CAST(nodep->fromp()->dtypep()->skipRefp(), ClassRefDType)) { AstClass* const classp = classRefp->classp(); classp->user1(true); markMembers(classp);