Subject: Re: [sv-cc] default values limitations for function/task arguments
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Mon Feb 24 2003 - 14:56:29 PST
> I was reviewing some changes proposed by the EC to the chapter 10 (task and
> function),
> it appears that default values can only be provided for singular
> non-composite arguments.
> I remember that you had some questions about which kind of default values
> could be
> provided.
>
> SystemVerilog allows a subroutine declaration to specify a default value
> for each singular (non-packed-array) argument.
> Previously the singular was defined as:
> A singular type includes packed arrays (and structures) and all other data
> types except unpacked structures, unpacked arrays, and handles (used for
> the C interface).
>
> Francoise
Francoise,
Thanks for the info.
I'm not sure I know how to interpret the last statement.
("A singular type includes [...] and handles"
or "A singular type includes [...] except [...] and handles")
Does singular type include handles or not? It would be natural to allow
a default value for handles (null).
BTW, the fact that the EC excluded the unpacked structures from those that may
have a default value has NOT solved the issue of literal aggregates as
default values. Is a literal aaggregate (struct/array) allowed as a default
value for a formal argument of a packed type?
Example:
function void foo(Type1 i1 = {1,2,3}, Type2 i2 = {1,2,3});
where Type1, Type2 are defined as packed structs or arrays.
Andrzej
This archive was generated by hypermail 2b28 : Mon Feb 24 2003 - 14:57:29 PST