Handle case that strings are arguments of functions/tasks.

When strings are arguments to functions/tasks, that doesn't suddenly
make them implicitly scalar. Strings are vectors and should be treated
that was, even if they are IMPLICIT_REG.

Ported from git master.
This commit is contained in:
Stephen Williams 2019-10-30 09:36:49 -07:00
parent 055dcf60cb
commit f1990caf6f
1 changed files with 7 additions and 1 deletions

View File

@ -932,9 +932,15 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
wtype = NetNet::WIRE;
is_implicit_scalar = true;
}
// Certain contexts, such as arguments to functions, presume
// "reg" instead of "wire". The parser reports these as
// IMPLICIT_REG. Also, certain cases, such as:
// fun(string arg1) ...
// are implicitly NOT scalar, so detect that case here.
if (wtype == NetNet::IMPLICIT_REG) {
wtype = NetNet::REG;
is_implicit_scalar = true;
if (data_type_!=IVL_VT_STRING)
is_implicit_scalar = true;
}
unsigned wid = 1;