mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 02:45:52 +00:00
More undef-propagation related fixes
This commit is contained in:
parent
9f49d538e1
commit
259cc1391e
2 changed files with 9 additions and 0 deletions
|
@ -1116,6 +1116,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
detectSignWidth(width_hint, sign_hint);
|
||||
RTLIL::SigSpec left = children[0]->genRTLIL(width_hint, sign_hint);
|
||||
RTLIL::SigSpec right = children[1]->genRTLIL(width_hint, sign_hint);
|
||||
#if 0
|
||||
int width = std::max(left.width, right.width);
|
||||
if (width > width_hint && width_hint > 0)
|
||||
width = width_hint;
|
||||
|
@ -1127,6 +1128,9 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
if (type == AST_MUL)
|
||||
width = std::min(left.width + right.width, width_hint);
|
||||
}
|
||||
#else
|
||||
int width = std::max(std::max(left.width, right.width), width_hint);
|
||||
#endif
|
||||
is_signed = children[0]->is_signed && children[1]->is_signed;
|
||||
return binop2rtlil(this, type_name, width, left, right);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue