Fix clocking-block sample of unpacked array (#7612) (#7613)

Fixes #7612.
This commit is contained in:
Nikolai Kumar
2026-05-18 21:40:54 -04:00
committed by GitHub
parent 2ebb99aaa2
commit a67c5f81f3
3 changed files with 52 additions and 0 deletions
+5
View File
@@ -206,6 +206,11 @@ class SliceVisitor final : public VNVisitor {
: elemIdx));
newp = new AstArraySel{nodep->fileline(), snodep->fromp()->cloneTree(false, needPure),
leOffset};
} else if (const AstSampled* const snodep = VN_CAST(nodep, Sampled)) {
UINFO(9, " cloneSliceSel(" << elements << "," << elemIdx << ") " << nodep);
AstNodeExpr* const exprp = VN_AS(snodep->exprp(), NodeExpr);
AstNodeExpr* const selp = cloneAndSel(exprp, elements, elemIdx, needPure);
return new AstSampled{nodep->fileline(),selp};
} else if (AstExprStmt* const snodep = VN_CAST(nodep, ExprStmt)) {
UINFO(9, " cloneExprStmt(" << elements << "," << elemIdx << ") " << nodep);
AstNodeExpr* const resultSelp