Skip to content
Permalink
Browse files

Fix for GitHub issue #18 : undef propagation of const multiplies is i…

…ncorrect.

When an expression is elaborated, the compiler converts multiplies with
one constamt zero operand into a constant zero value. This is only valid
if the other operand is not a 4-state variable.
  • Loading branch information
martinwhitaker committed Feb 27, 2014
1 parent 5dcd2e8 commit ed2e339dd6ea366864969cbd929325e117ec23e9
Showing with 1 addition and 1 deletion.
  1. +1 −1 elab_expr.cc
@@ -538,7 +538,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
return tmp;
}

if (rp_val.is_zero()) {
if (rp_val.is_zero() && (lp->expr_type() != IVL_VT_LOGIC)) {
NetEConst*tmp = make_const_0(expr_wid);
tmp->cast_signed(signed_flag_);
tmp->set_line(*this);

0 comments on commit ed2e339

Please sign in to comment.