From 98694f15cead1cb1a17994018aa82e675a63c518 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 18 Apr 2013 12:39:34 -0700 Subject: [PATCH] vlog95: A valid task output can have a cast. When looking for a task call with arguments the output port assignments can also come from a cast of a simple signal in the task. --- tgt-vlog95/stmt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tgt-vlog95/stmt.c b/tgt-vlog95/stmt.c index 0779829a6..695299bd3 100644 --- a/tgt-vlog95/stmt.c +++ b/tgt-vlog95/stmt.c @@ -696,6 +696,16 @@ static unsigned utask_out_port_idx(ivl_scope_t scope, ivl_statement_t stmt) /* We must be selecting a signal. */ if (ivl_expr_type(expr) != IVL_EX_SIGNAL) return ports; rsig = ivl_expr_signal(expr); + /* Or a cast of a simple signal. */ + } else if (expr_type == IVL_EX_UNARY) { + ivl_expr_t expr = ivl_expr_oper1(rval); + char opcode = ivl_expr_opcode(rval); + /* This must be a cast opcode. */ + if ((opcode != '2') && (opcode != 'v') && + (opcode != 'r')) return ports; + /* We must be casting a signal. */ + if (ivl_expr_type(expr) != IVL_EX_SIGNAL) return ports; + rsig = ivl_expr_signal(expr); } else return ports; /* The R-value must have the same scope as the task. */ if (scope != ivl_signal_scope(rsig)) return ports;