Fix DfgToAst conversion of CountBits (#4101) (#4143)

This commit is contained in:
Geza Lore
2023-04-23 08:49:44 -04:00
committed by GitHub
parent 08330bad0b
commit cac634d39b
4 changed files with 30 additions and 2 deletions
+1 -2
View File
@@ -59,8 +59,7 @@ AstCountOnes* makeNode<AstCountOnes, DfgCountOnes, AstNodeExpr*>( //
const DfgCountOnes* vtxp, AstNodeExpr* op1) {
AstCountOnes* const nodep = new AstCountOnes{vtxp->fileline(), op1};
// Set dtype same as V3Width
const int selwidth = V3Number::log2b(nodep->lhsp()->width()) + 1;
nodep->dtypeSetLogicSized(selwidth, VSigning::UNSIGNED);
nodep->dtypeSetLogicSized(32, VSigning::UNSIGNED);
return nodep;
}