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:
Martin Whitaker 2014-06-20 20:52:15 +01:00
parent 54f4c1147b
commit e82bafcb84
1 changed files with 2 additions and 2 deletions

View File

@ -530,7 +530,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
if (NetEConst*rp_const = dynamic_cast<NetEConst*> (rp)) {
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);
tmp->cast_signed(signed_flag_);
tmp->set_line(*this);
@ -538,7 +538,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
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);
tmp->cast_signed(signed_flag_);
tmp->set_line(*this);