RE: [vhdl-200x-ft] Question On Type Genericity

From: <tgingold@free.fr>
Date: Thu Jan 20 2005 - 00:56:35 PST

Selon Peter Ashenden <peter@ashenden.com.au>:

> Yannick,
>
> Re 1): In my modified example, I passed T'succ in as the actual function:
>
> c : entity work.counter(behavioral)
> generic map ( T, T'low, T'high, T'succ )
> port map ( ... );
>
> My reasoning was that 'succ is defined to be of a function kind, so why not
> treat it so in a general way?
>
> Whether we would want to allow this or not is an open question. Currently,
> the only places I can think of where a suprogram name can appear, denoting
> the subprogram without calling it, are attribute specifications and group
> declarations. In the case of attribute specifications, the name must be a
> simple name, operator symbol or character literal, so an attribute name is
> not allowed. In the case of a group declaration, the LRM explicitly
> prohibits attribute names.
Well, there is also resolution function. However, the may-be only possible
attribute function for a resolution function is 'length.
GHDL does not support it, however I don't know wether it is a bug or not !

> My inclination would be not to allow attribute names as actuals for
> subprogram formals, since I think the expectation is that they be built into
> the innards of a compiler, rather than being implemented as subprograms. If
> that is the case, then you would need to define a helper function to
> increment a value and pass that function as the actual.
However, the same is true for implicit functions such as "+".
So, this argument doesn't really stand.
Furthermore, you are making hypothesis on the implementation.

Tristan.
Received on Thu Jan 20 01:02:51 2005

This archive was generated by hypermail 2.1.8 : Thu Jan 20 2005 - 01:02:56 PST