diff --git a/net_design.cc b/net_design.cc index 6a9ebe386..84f4a7a34 100644 --- a/net_design.cc +++ b/net_design.cc @@ -409,7 +409,7 @@ void NetScope::evaluate_parameter_logic_(Design*des, param_ref_t cur) sure the type is set right. Note that if the parameter doesn't have an explicit type or range, then it will get the signedness from the expression itself. */ - if ((*cur).second.signed_flag || range_flag) { + if (range_flag) { /* If we have a real value convert it to an integer. */ if(NetECReal*tmp = dynamic_cast(expr)) { verinum nval(tmp->value().as_long64(), (unsigned)lv_width); @@ -419,6 +419,8 @@ void NetScope::evaluate_parameter_logic_(Design*des, param_ref_t cur) } (*cur).second.val->cast_signed((*cur).second.signed_flag); + } else if ((*cur).second.signed_flag) { + (*cur).second.val->cast_signed(true); } // If there are no value ranges to test the value against,