forked from github/verilator
DFG: Correctly set dtype when converting DfgCountOnes to Ast
This commit is contained in:
parent
6fa14bf029
commit
0570cb8d9f
@ -54,6 +54,16 @@ Node* makeNode(const Vertex* vtxp, Ops... ops) {
|
||||
//======================================================================
|
||||
// Vertices needing special conversion
|
||||
|
||||
template <>
|
||||
AstCountOnes* makeNode<AstCountOnes, DfgCountOnes, AstNodeMath*>( //
|
||||
const DfgCountOnes* vtxp, AstNodeMath* 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);
|
||||
return nodep;
|
||||
}
|
||||
|
||||
template <>
|
||||
AstExtend* makeNode<AstExtend, DfgExtend, AstNodeMath*>( //
|
||||
const DfgExtend* vtxp, AstNodeMath* op1) {
|
||||
|
Loading…
Reference in New Issue
Block a user