diff --git a/t-dll-expr.cc b/t-dll-expr.cc index 7eafcc525..303449a07 100644 --- a/t-dll-expr.cc +++ b/t-dll-expr.cc @@ -450,10 +450,10 @@ void dll_target::expr_signal(const NetESignal*net) /* Make account for the special case that this is a reference to an array as a whole. We detect this case by noting that - this is an array (more than 1 word) and there is no word - select expression. In that case, this is an IVL_EX_ARRAY - expression instead of a SIGNAL expression. */ - if (sig->array_words > 1 && word_expr == 0) { + this is an array (more than 0 array dimensions) and that + there is no word select expression. For this case, we have + an IVL_EX_ARRAY expression instead of a SIGNAL expression. */ + if (sig->array_dimensions_ > 0 && word_expr == 0) { expr_->type_ = IVL_EX_ARRAY; expr_->width_ = 0; // Doesn't make much sense for arrays. } diff --git a/tgt-vvp/draw_vpi.c b/tgt-vvp/draw_vpi.c index 6e602b63f..5ab4e9d8f 100644 --- a/tgt-vvp/draw_vpi.c +++ b/tgt-vvp/draw_vpi.c @@ -125,11 +125,13 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result, Create the right code to handle it. */ ivl_signal_t sig = ivl_expr_signal(expr); unsigned use_word = 0; + unsigned use_word_defined = 0; ivl_expr_t word_ex = ivl_expr_oper1(expr); if (word_ex) { /* Some array select have been evaluated. */ if (number_is_immediate(word_ex, IMM_WID, 0)) { use_word = get_number_immediate(word_ex); + use_word_defined = 1; word_ex = 0; } } @@ -156,6 +158,7 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result, result->vec = av; result->vec_flag = 1; } else { + assert(use_word_defined); snprintf(buffer, sizeof buffer, "&A", sig, use_word); }