From e071bd81ee90e16e51f8596c89453cd253d3d509 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 6 Oct 2012 14:29:45 -0700 Subject: [PATCH] Handle select of darray signals in general expressions. --- tgt-vvp/eval_expr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 303db2438..b6c77b04d 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -2479,6 +2479,17 @@ static struct vector_info draw_select_signal(ivl_expr_t expr, unsigned use_word = 0; unsigned use_wid, lab_x, lab_end; + /* Special case: the sub expression is a DARRAY variable, so + do a dynamic array word load. */ + if (ivl_signal_data_type(sig) == IVL_VT_DARRAY) { + res.base = allocate_vector(wid); + res.wid = wid; + draw_eval_expr_into_integer(bit_idx, 3); + fprintf(vvp_out, " %%load/dar %u, v%p_0, %u;\n", + res.base, sig, res.wid); + return res; + } + /* If this is an access to an array, try to get the index as a constant. If it is (and the array is not a reg array then this reduces to a signal access and we stay here. If it is