Use ivl_signal_dimensions to detect that signal is an array.

It is possible for an array to have 1 word in it, so using the array
count to detect an array is incorrect. Use the ivl_signal_dimensions
function, which is there exactly for that purpose.
This commit is contained in:
Stephen Williams 2008-05-19 11:31:40 -07:00
parent 680d3c8a3e
commit 9a00829ee4
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ static int is_fixed_memory_word(ivl_expr_t net)
sig = ivl_expr_signal(net);
if (ivl_signal_array_count(sig) == 1)
if (ivl_signal_dimensions(sig) == 0)
return 1;
if (ivl_signal_type(sig) == IVL_SIT_REG)

View File

@ -140,7 +140,7 @@ static void eval_logic_into_integer(ivl_expr_t expr, unsigned ix)
ivl_signal_t sig = ivl_expr_signal(expr);
unsigned word = 0;
if (ivl_signal_array_count(sig) > 1) {
if (ivl_signal_dimensions(sig) > 0) {
/* Detect the special case that this is a
variable array. In this case, the ix/getv
@ -1908,7 +1908,7 @@ static void draw_signal_dest(ivl_expr_t exp, struct vector_info res,
/* If this is an access to an array, handle that by emitting a
load/av instruction. */
if (ivl_signal_array_count(sig) > 1) {
if (ivl_signal_dimensions(sig) > 0) {
ivl_expr_t ix = ivl_expr_oper1(exp);
draw_eval_expr_into_integer(ix, 3);
@ -2043,7 +2043,7 @@ static struct vector_info draw_select_signal(ivl_expr_t sube,
and we stay here. If it is not constant, then give up and
do an array index in front of this part select. */
if (ivl_signal_array_count(sig) > 1) {
if (ivl_signal_dimensions(sig) > 0) {
ivl_expr_t ix = ivl_expr_oper1(sube);
if (!number_is_immediate(ix, 8*sizeof(unsigned long)))