Report the vvp only supports a dynamic array of size 8, 16, 32 or 64

This commit is contained in:
Cary R 2015-01-15 18:16:15 -08:00
parent 21c60b38e1
commit 40ae1051d4
1 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,20 @@ static int eval_darray_new(ivl_expr_t ex)
int lsb = ivl_type_packed_lsb(element_type, 0);
int wid = msb>=lsb? msb - lsb : lsb - msb;
wid += 1;
// At the moment vvp only supports widths of 8, 16, 32 or 64
switch (wid) {
case 8:
case 16:
case 32:
case 64:
break;
default:
fprintf(stderr, "%s:%u: tgt-vvp sorry: vvp currently only "
"supports dynamic array widths of 8, 16, 32 or 64 "
"bits, given (%d)\n",
ivl_expr_file(ex), ivl_expr_lineno(ex), wid);
errors += 1;;
}
fprintf(vvp_out, " %%new/darray %u, \"%sb%d\";\n", size_reg,
ivl_type_signed(element_type) ? "s" : "", wid);