From 4fb91ec7c7bb341219f94452e13c6534f6a0ff1b Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 25 Aug 2014 16:35:54 -0700 Subject: [PATCH] vlog95: Add SV queue specific error message and code generation. --- tgt-vlog95/expr.c | 6 ++++-- tgt-vlog95/logic_lpm.c | 1 + tgt-vlog95/scope.c | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tgt-vlog95/expr.c b/tgt-vlog95/expr.c index 7b029c9ac..f516a7a9e 100644 --- a/tgt-vlog95/expr.c +++ b/tgt-vlog95/expr.c @@ -855,9 +855,11 @@ static void emit_expr_select(ivl_scope_t scope, ivl_expr_t expr, unsigned wid) ivl_expr_t sig_expr = ivl_expr_oper1(expr); ivl_select_type_t sel_type = ivl_expr_sel_type(expr); (void)wid; /* Parameter is not used. */ - /* If this is a dynamic array select, translate it differently. */ + /* If this is a dynamic array or queue select, translate the + * select differently. */ if ((ivl_expr_type(sig_expr) == IVL_EX_SIGNAL) && - (ivl_signal_data_type(ivl_expr_signal(sig_expr)) == IVL_VT_DARRAY)) { + ((ivl_signal_data_type(ivl_expr_signal(sig_expr)) == IVL_VT_DARRAY) || + (ivl_signal_data_type(ivl_expr_signal(sig_expr)) == IVL_VT_QUEUE))) { assert(sel_expr); emit_select_name(scope, sig_expr); fprintf(vlog_out, "["); diff --git a/tgt-vlog95/logic_lpm.c b/tgt-vlog95/logic_lpm.c index c6cb6943d..7e390d809 100644 --- a/tgt-vlog95/logic_lpm.c +++ b/tgt-vlog95/logic_lpm.c @@ -2127,6 +2127,7 @@ void dump_nexus_information(ivl_scope_t scope, ivl_nexus_t nex) case IVL_VT_STRING: fprintf(stderr, " string"); break; case IVL_VT_DARRAY: fprintf(stderr, " dynamic array"); case IVL_VT_CLASS: fprintf(stderr, " class"); + case IVL_VT_QUEUE: fprintf(stderr, " queue"); break; } if (ivl_signal_signed(sig)) fprintf(stderr, " "); diff --git a/tgt-vlog95/scope.c b/tgt-vlog95/scope.c index afdefdb07..e6dd88efa 100644 --- a/tgt-vlog95/scope.c +++ b/tgt-vlog95/scope.c @@ -125,6 +125,14 @@ static void emit_var_def(ivl_signal_t sig) ivl_signal_file(sig), ivl_signal_lineno(sig), ivl_signal_basename(sig)); vlog_errors += 1; + } else if (ivl_signal_data_type(sig) == IVL_VT_QUEUE) { + fprintf(vlog_out, " "); + emit_sig_id(sig); + fprintf(stderr, "%s:%u: vlog95 error: SystemVerilog queues " + "(%s) are not supported.\n", + ivl_signal_file(sig), + ivl_signal_lineno(sig), ivl_signal_basename(sig)); + vlog_errors += 1; } else { int msb, lsb; get_sig_msb_lsb(sig, &msb, &lsb);