Tristan,
I suspect you may have missed out on some of the history. My original
proposal was based on Ada generics, and included many of the same features
for specifying kinds of formal types in generic lists. However, we decided
to limit formal generic types in the current revision to be essentially like
Ada "is private" generic types. The main reason for doing so is that we
plan to develop object-oriented extensions to the type system in a later
revision. Whatever we do with generic types needs to be compatible with the
extensions to the type system. I've proposed a minimal form of generic
types that I believe will not constrain the type-system extensions.
Ada-95 introduced object orientation through extensions to packages and to
types and operations defined in packages. While we could do similarly, we
need to recognize the VHDL's protected types are closely aligned to class
definitions in OO languages. There is a preference among WG members to
develop OO features based on extending protected types rather than by
following the Ada-95 approach. Either way, this will take some effort to
develop, hence it's deferred to the next revision. (Which, by the way, need
not be as far away as 5 years from the current rev)
I hope this clarifies the direction being proposed.
Cheers,
PA
-- Dr. Peter J. Ashenden peter@ashenden.com.au Ashenden Designs Pty. Ltd. www.ashenden.com.au PO Box 640 Ph: +61 8 8339 7532 Stirling, SA 5152 Fax: +61 8 8339 2616 Australia Mobile: +61 414 70 9106 > -----Original Message----- > From: tgingold@free.fr [mailto:tgingold@free.fr] > Sent: Friday, 24 December 2004 20:24 > To: Peter Ashenden > Cc: 'Jim Lewis'; vhdl-200x-ft@eda.org > Subject: RE: [vhdl-200x-ft] Question on Type and Package Generics > > > Quoting Peter Ashenden <peter@ashenden.com.au>: > > > Jim, > > > > > I have a question on instantiating packages. > > > If I create a generic package as follows: > > > package MuxPkg is > > > generic( type array_type) ; > > > > > > function Mux4 ( > > > Sel : array_type(1 downto 0) ; > > > A : array_type ; > > > B : array_type ; > > > C : array_type ; > > > D : array_type > > > ) return array_type ; > > > end MuxPkg ; > > > > Actually, you wouldn't be able to apply an index constraint to the > > formal type, since you don't know that the actual will be an > > unconstrained array type. The actual could be any type. > For example, > > if you instantiated the package with type BIT as the actual for > > array_type, applying an index constraint wouldn't make sense. > > > > In the proposal we're working with, we don't provide a way > of adding > > information to the formal about the kind of type that can > be supplied > > as an actual. So let's proceed with the example revised as: > Again, we should look on Ada generic, they are more powerful > than what is proposed in VHDL. > > Tristan. >Received on Fri Dec 24 03:29:04 2004
This archive was generated by hypermail 2.1.8 : Fri Dec 24 2004 - 03:29:05 PST