From 8a5b8d5f38f0f36e05d35fcc310c910dc7cbc4c4 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 1 Nov 2019 20:10:45 -0400 Subject: [PATCH] Internals: Fix VFlagBitPacked giving 4-state types. --- src/V3Ast.h | 2 ++ src/V3AstNodes.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 3a669deb9..e8bc544ac 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -1410,6 +1410,8 @@ public: void dtypeChgWidthSigned(int width, int widthMin, AstNumeric numeric); void dtypeSetBitUnsized(int width, int widthMin, AstNumeric numeric) { dtypep(findBitDType(width, widthMin, numeric)); } + void dtypeSetBitSized(int width, AstNumeric numeric) { + dtypep(findBitDType(width, width, numeric)); } // Since sized, widthMin is width void dtypeSetLogicUnsized(int width, int widthMin, AstNumeric numeric) { dtypep(findLogicDType(width, widthMin, numeric)); } void dtypeSetLogicSized(int width, AstNumeric numeric) { diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index ccfeb61f4..5e873f96b 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -1234,7 +1234,7 @@ public: , m_name(name), m_origName(name) { init(); combineType(type); - dtypeSetLogicSized(wantwidth, AstNumeric::UNSIGNED); + dtypeSetBitSized(wantwidth, AstNumeric::UNSIGNED); m_declKwd = AstBasicDTypeKwd::BIT; } AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep)