diff --git a/netmisc.cc b/netmisc.cc index feee9add8..3fba3ae72 100644 --- a/netmisc.cc +++ b/netmisc.cc @@ -844,17 +844,13 @@ NetExpr* condition_reduce(NetExpr*expr) return cmp; } -static NetExpr* do_elab_and_eval(Design*des, NetScope*scope, PExpr*pe, - int context_width, bool need_const, - bool annotatable, bool force_expand, - ivl_variable_type_t cast_type, - bool force_unsigned) +NetExpr* elab_and_eval(Design*des, NetScope*scope, PExpr*pe, + int context_width, bool need_const, bool annotatable, + ivl_variable_type_t cast_type, bool force_unsigned) { PExpr::width_mode_t mode = PExpr::SIZED; if ((context_width == -2) && !gn_strict_expr_width_flag) mode = PExpr::EXPAND; - if (force_expand) - mode = PExpr::EXPAND; pe->test_width(des, scope, mode); @@ -891,7 +887,6 @@ static NetExpr* do_elab_and_eval(Design*des, NetScope*scope, PExpr*pe, << "returns type=" << pe->expr_type() << ", context_width=" << context_width << ", signed=" << pe->has_sign() - << ", force_expand=" << force_expand << ", expr_width=" << expr_width << ", mode=" << PExpr::width_mode_name(mode) << endl; cerr << pe->get_fileline() << ": : " @@ -964,13 +959,6 @@ static NetExpr* do_elab_and_eval(Design*des, NetScope*scope, PExpr*pe, } } - // If the context_width sent is is actually the minimum width, - // then raise the context_width to be big enough for the - // lossless expression. - if (force_expand && context_width > 0) { - context_width = max(context_width, (int)expr_width); - } - eval_expr(tmp, context_width); if (NetEConst*ce = dynamic_cast(tmp)) { @@ -981,29 +969,6 @@ static NetExpr* do_elab_and_eval(Design*des, NetScope*scope, PExpr*pe, return tmp; } -NetExpr* elab_and_eval(Design*des, NetScope*scope, PExpr*pe, - int context_width, bool need_const, bool annotatable, - ivl_variable_type_t cast_type, bool force_unsigned) -{ - return do_elab_and_eval(des, scope, pe, context_width, - need_const, annotatable, false, - cast_type, force_unsigned); -} - -/* - * This variant of elab_and_eval does the expression losslessly, no - * matter what the generation of Verilog. This is in support of - * certain special contexts, notably index expressions. - */ -NetExpr* elab_and_eval_lossless(Design*des, NetScope*scope, PExpr*pe, - int context_width, bool need_const, bool annotatable, - ivl_variable_type_t cast_type) -{ - return do_elab_and_eval(des, scope, pe, context_width, - need_const, annotatable, true, - cast_type, false); -} - NetExpr* elab_and_eval(Design*des, NetScope*scope, PExpr*pe, ivl_type_t lv_net_type, bool need_const) { diff --git a/netmisc.h b/netmisc.h index ec99c0b16..b824b631f 100644 --- a/netmisc.h +++ b/netmisc.h @@ -281,12 +281,6 @@ extern NetExpr* elab_and_eval(Design*des, NetScope*scope, ivl_variable_type_t cast_type =IVL_VT_NO_TYPE, bool force_unsigned =false); -extern NetExpr* elab_and_eval_lossless(Design*des, NetScope*scope, - PExpr*pe, int context_width, - bool need_const =false, - bool annotatable =false, - ivl_variable_type_t cast_type =IVL_VT_NO_TYPE); - /* * This form of elab_and_eval uses the ivl_type_t to carry type * information instead of the piecemeal form. We should transition to