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.
This commit is contained in:
Cary R 2013-04-18 12:39:34 -07:00
parent 36b04748d4
commit 98694f15ce
1 changed files with 10 additions and 0 deletions

View File

@ -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;