Fix $bits on unpacked structs (#4521) (#7796)

Fixes #4521.
This commit is contained in:
Nick Brereton
2026-06-17 17:56:48 -04:00
committed by GitHub
parent 4c5e104825
commit 26c85d4495
5 changed files with 94 additions and 2 deletions
+2 -1
View File
@@ -9661,7 +9661,8 @@ class WidthVisitor final : public VNVisitor {
continue;
} else if (const AstNodeUOrStructDType* const adtypep
= VN_CAST(dtypep, NodeUOrStructDType)) {
bits *= adtypep->width();
bits *= adtypep->isStreamableFixedAggregate() ? adtypep->widthStream()
: adtypep->width();
break;
} else if (const AstBasicDType* const adtypep = VN_CAST(dtypep, BasicDType)) {
bits *= adtypep->width();