ivl: Casting dynamic arrays to vectors.
This commit is contained in:
parent
ff5b696569
commit
a52242745a
|
|
@ -2536,7 +2536,7 @@ unsigned PECastType::test_width(Design*des, NetScope*scope, width_mode_t&wid)
|
|||
expr_width_ = t->packed_width();
|
||||
}
|
||||
|
||||
signed_flag_= t->get_signed();
|
||||
signed_flag_ = t->get_signed();
|
||||
min_width_ = expr_width_;
|
||||
return expr_width_;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ static int show_stmt_assign_vector(ivl_statement_t net)
|
|||
fprintf(vvp_out, " %%cvt/vr %u;\n", wid);
|
||||
|
||||
} else if (ivl_expr_value(rval) == IVL_VT_STRING) {
|
||||
/* Special case: vector to string casting */
|
||||
/* Special case: string to vector casting */
|
||||
ivl_lval_t lval = ivl_stmt_lval(net, 0);
|
||||
fprintf(vvp_out, " %%vpi_call %u %u \"$ivl_string_method$to_vec\", v%p_0, v%p_0 {0 0 0};\n",
|
||||
ivl_file_table_index(ivl_stmt_file(net)), ivl_stmt_lineno(net),
|
||||
|
|
@ -452,6 +452,15 @@ static int show_stmt_assign_vector(ivl_statement_t net)
|
|||
if (slices) free(slices);
|
||||
return 0;
|
||||
|
||||
} else if (ivl_expr_value(rval) == IVL_VT_DARRAY) {
|
||||
/* Special case: dynamic array to vector casting */
|
||||
ivl_lval_t lval = ivl_stmt_lval(net, 0);
|
||||
fprintf(vvp_out, " %%vpi_call %u %u \"$ivl_darray_method$to_vec\", v%p_0, v%p_0 {0 0 0};\n",
|
||||
ivl_file_table_index(ivl_stmt_file(net)), ivl_stmt_lineno(net),
|
||||
ivl_expr_signal(rval), ivl_lval_sig(lval));
|
||||
if (slices) free(slices);
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
unsigned wid = ivl_stmt_lwidth(net);
|
||||
draw_eval_vec4(rval);
|
||||
|
|
|
|||
Loading…
Reference in New Issue