When determining if a signal is an array use array_dimensions_
The previous code looked for more than one array word to determine
if the given signal was an array or not. The problem with this is
that a single word memory was considered a signal. This is fixed
here by looking for an array_dimension to be greater than zero.
(cherry picked from commit 3d449f60a2)
This commit is contained in:
parent
ceea5d568c
commit
aa28430832
|
|
@ -450,10 +450,10 @@ void dll_target::expr_signal(const NetESignal*net)
|
||||||
|
|
||||||
/* Make account for the special case that this is a reference
|
/* Make account for the special case that this is a reference
|
||||||
to an array as a whole. We detect this case by noting that
|
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
|
this is an array (more than 0 array dimensions) and that
|
||||||
select expression. In that case, this is an IVL_EX_ARRAY
|
there is no word select expression. For this case, we have
|
||||||
expression instead of a SIGNAL expression. */
|
an IVL_EX_ARRAY expression instead of a SIGNAL expression. */
|
||||||
if (sig->array_words > 1 && word_expr == 0) {
|
if (sig->array_dimensions_ > 0 && word_expr == 0) {
|
||||||
expr_->type_ = IVL_EX_ARRAY;
|
expr_->type_ = IVL_EX_ARRAY;
|
||||||
expr_->width_ = 0; // Doesn't make much sense for arrays.
|
expr_->width_ = 0; // Doesn't make much sense for arrays.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,13 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result,
|
||||||
Create the right code to handle it. */
|
Create the right code to handle it. */
|
||||||
ivl_signal_t sig = ivl_expr_signal(expr);
|
ivl_signal_t sig = ivl_expr_signal(expr);
|
||||||
unsigned use_word = 0;
|
unsigned use_word = 0;
|
||||||
|
unsigned use_word_defined = 0;
|
||||||
ivl_expr_t word_ex = ivl_expr_oper1(expr);
|
ivl_expr_t word_ex = ivl_expr_oper1(expr);
|
||||||
if (word_ex) {
|
if (word_ex) {
|
||||||
/* Some array select have been evaluated. */
|
/* Some array select have been evaluated. */
|
||||||
if (number_is_immediate(word_ex, IMM_WID, 0)) {
|
if (number_is_immediate(word_ex, IMM_WID, 0)) {
|
||||||
use_word = get_number_immediate(word_ex);
|
use_word = get_number_immediate(word_ex);
|
||||||
|
use_word_defined = 1;
|
||||||
word_ex = 0;
|
word_ex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,6 +158,7 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result,
|
||||||
result->vec = av;
|
result->vec = av;
|
||||||
result->vec_flag = 1;
|
result->vec_flag = 1;
|
||||||
} else {
|
} else {
|
||||||
|
assert(use_word_defined);
|
||||||
snprintf(buffer, sizeof buffer, "&A<v%p, %u>",
|
snprintf(buffer, sizeof buffer, "&A<v%p, %u>",
|
||||||
sig, use_word);
|
sig, use_word);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue