Fix for GitHub issue #30 : failed assertion in eval_tree.cc
The root cause was the constant propagation done during elaboration of a multiply operation, which didn't check for mixed real/logic expressions.
This commit is contained in:
parent
54f4c1147b
commit
e82bafcb84
|
|
@ -530,7 +530,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
|
||||||
if (NetEConst*rp_const = dynamic_cast<NetEConst*> (rp)) {
|
if (NetEConst*rp_const = dynamic_cast<NetEConst*> (rp)) {
|
||||||
verinum rp_val = rp_const->value();
|
verinum rp_val = rp_const->value();
|
||||||
|
|
||||||
if (! rp_val.is_defined()) {
|
if (!rp_val.is_defined() && (lp->expr_type() == IVL_VT_LOGIC)) {
|
||||||
NetEConst*tmp = make_const_x(expr_wid);
|
NetEConst*tmp = make_const_x(expr_wid);
|
||||||
tmp->cast_signed(signed_flag_);
|
tmp->cast_signed(signed_flag_);
|
||||||
tmp->set_line(*this);
|
tmp->set_line(*this);
|
||||||
|
|
@ -538,7 +538,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rp_val.is_zero() && (lp->expr_type() != IVL_VT_LOGIC)) {
|
if (rp_val.is_zero() && (lp->expr_type() == IVL_VT_BOOL)) {
|
||||||
NetEConst*tmp = make_const_0(expr_wid);
|
NetEConst*tmp = make_const_0(expr_wid);
|
||||||
tmp->cast_signed(signed_flag_);
|
tmp->cast_signed(signed_flag_);
|
||||||
tmp->set_line(*this);
|
tmp->set_line(*this);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue