From 7fd1e8323548c981f6a90d881f3e47b43564cdc6 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Thu, 26 Feb 2026 10:17:38 +0100 Subject: [PATCH] Handle unions Signed-off-by: Ryszard Rozak --- src/V3Force.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/V3Force.cpp b/src/V3Force.cpp index 9eab4ff47..2fd7d163e 100644 --- a/src/V3Force.cpp +++ b/src/V3Force.cpp @@ -355,6 +355,11 @@ private: enStructp = new AstStructDType{structp->fileline(), structp->packed() ? VSigning::SIGNED : VSigning::NOSIGN}; + } else if (VN_IS(structp, UnionDType) && structp->packed()) { + const AstUnionDType* const unionp = VN_AS(structp, UnionDType); + enStructp = new AstUnionDType{ + unionp->fileline(), unionp->isSoft(), unionp->isTagged(), + unionp->packed() ? VSigning::SIGNED : VSigning::NOSIGN}; } else { varp->v3fatalSrc("Unsupported: Force of variable of unhandled data type"); return dtypep;