diff --git a/elab_expr.cc b/elab_expr.cc index 34d868c20..f185b641f 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -185,6 +185,12 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des, case 'p': tmp = new NetEBPow(op_, lp, rp); tmp->set_line(*this); + if (tmp->expr_type() == IVL_VT_LOGIC) { + cerr << get_fileline() << ": sorry: Power operator is not " + "currently supported on unsigned bit based values." + << endl; + des->errors += 1; + } break; case '*': diff --git a/ivl_target.h b/ivl_target.h index 945cd1eb4..a022859a0 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -948,7 +948,7 @@ extern unsigned ivl_lpm_lineno(ivl_lpm_t net); * Multiply may be signed. If so, the output should be sign extended * to fill in its result. * - * - Power (IVL_LPM_POWR) + * - Power (IVL_LPM_POW) * The power takes two inputs and generates an output. Unlike other * arithmetic nodes, the width only refers to the output. The inputs * have independent widths, to reflect the arithmetic truth that the @@ -1124,12 +1124,12 @@ extern ivl_scope_t ivl_lpm_define(ivl_lpm_t net); /* IVL_LPM_FF */ extern ivl_nexus_t ivl_lpm_enable(ivl_lpm_t net); /* IVL_LPM_ADD IVL_LPM_CONCAT IVL_LPM_FF IVL_LPM_PART IVL_LPM_MULT - IVL_LPM_MUX IVL_LPM_POWR IVL_LPM_SHIFTL IVL_LPM_SHIFTR IVL_LPM_SUB + IVL_LPM_MUX IVL_LPM_POW IVL_LPM_SHIFTL IVL_LPM_SHIFTR IVL_LPM_SUB IVL_LPM_UFUNC */ extern ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx); - /* IVL_LPM_ADD IVL_LPM_MULT IVL_LPM_POWR IVL_LPM_SUB */ + /* IVL_LPM_ADD IVL_LPM_MULT IVL_LPM_POW IVL_LPM_SUB */ extern ivl_nexus_t ivl_lpm_datab(ivl_lpm_t net, unsigned idx); - /* IVL_LPM_ADD IVL_LPM_FF IVL_LPM_MULT IVL_LPM_PART IVL_LPM_POWR + /* IVL_LPM_ADD IVL_LPM_FF IVL_LPM_MULT IVL_LPM_PART IVL_LPM_POW IVL_LPM_SUB IVL_LPM_UFUNC */ extern ivl_nexus_t ivl_lpm_q(ivl_lpm_t net, unsigned idx); /* IVL_LPM_MUX */ diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 7d9c73ff5..0890e860f 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -1233,6 +1233,10 @@ static struct vector_info draw_binary_expr_arith(ivl_expr_t exp, unsigned wid) lv.base, rv.base, wid); break; + case 'p': + assert(0); + break; + default: assert(0); } @@ -1275,6 +1279,7 @@ static struct vector_info draw_binary_expr(ivl_expr_t exp, case '*': case '/': case '%': + case 'p': rv = draw_binary_expr_arith(exp, wid); break;