vlog95: A parameter in 1364-1995 is always zero based.

The 1364-1995 version of Verilog does not support non zero based
parameters. This patch removes the comment requesting the parameter
MSB/LSB information to denormalize the expression and replaces it
with one stating that we need to keep the compiler normalization.
This commit is contained in:
Cary R 2011-02-25 18:18:16 -08:00 committed by Stephen Williams
parent fc3118bd7f
commit 2df6850824
1 changed files with 7 additions and 6 deletions

View File

@ -280,6 +280,7 @@ static void emit_select_name(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
fprintf(stderr, "%s:%u: vlog95 error: Unable to find parameter "
"for select expression \n",
ivl_expr_file(expr), ivl_expr_lineno(expr));
vlog_errors += 1;
} else {
emit_expr(scope, expr, wid);
}
@ -373,16 +374,16 @@ static void emit_expr_select(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
emit_scaled_expr(scope, sel_expr, 1, 0);
fprintf(vlog_out, ")" );
} else {
int msb;
int lsb;
/* A constant/parameter must be zero based in 1364-1995
* so keep the compiler generated normalization. This
* does not always work for selects before the parameter
* since 1364-1995 does not support signed math. */
int msb = 1;
int lsb = 0;
if (type == IVL_EX_SIGNAL) {
ivl_signal_t sig = ivl_expr_signal(sig_expr);
msb = ivl_signal_msb(sig);
lsb = ivl_signal_lsb(sig);
} else {
// HERE: Need to get the parameter and then the MSB/LSB information.
msb = 1;
lsb = 0;
}
/* A bit select. */
if (width == 1) {