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)