From e82bafcb8423fecada9cfdf22a9eef3c8dc8a19c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 20 Jun 2014 20:52:15 +0100 Subject: [PATCH] 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. --- elab_expr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elab_expr.cc b/elab_expr.cc index 693f4f84d..ea8f19e5d 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -530,7 +530,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*, if (NetEConst*rp_const = dynamic_cast (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);