Elaborate divide expressions to the proper width.
If the operands of a divide expression are fixed width, pad them out to the width of the expression so that the calculations come out right.
This commit is contained in:
parent
1922a0df9e
commit
1ec09327e9
10
elab_expr.cc
10
elab_expr.cc
|
|
@ -404,6 +404,16 @@ NetExpr* PEBinary::elaborate_expr_base_div_(Design*des,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The original elaboration of the left and right expressions
|
||||||
|
already tried to elaborate to the expr_wid. If the
|
||||||
|
expressions are not that width by now, then they need to be
|
||||||
|
padded. The divide expression operands must be the width
|
||||||
|
of the output. */
|
||||||
|
if (expr_wid > 0) {
|
||||||
|
lp = pad_to_width(lp, expr_wid);
|
||||||
|
rp = pad_to_width(rp, expr_wid);
|
||||||
|
}
|
||||||
|
|
||||||
NetEBDiv*tmp = new NetEBDiv(op_, lp, rp);
|
NetEBDiv*tmp = new NetEBDiv(op_, lp, rp);
|
||||||
tmp->set_line(*this);
|
tmp->set_line(*this);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue