On 15/08/16 14:37, Patrick Lehmann wrote:
Hello,



how can I pass a package as generic parameter to another package in GHDL?

You can do that only if you follow the vhdl restrictions: you can only pass an instance of a generic package.

Currently, GHDL doesn’t support type generics, so I would like to use a
package,

to carry a type into another package. How can I do this?

No, you cannot work-around like this.

Type generics are indeed not yet supported (and I think the design for it in the vhdl standard is bogus. I am not sure it would allow you to do what you want).

package P1 is

  subtype MyType is integer;

end package;



package P2 is

  generic (

    package Foo

  );



  type T_MyArray is array(integer range <>) of Foo.MyType;

end package;



GHDL complains, that a “is” is missing after “package Foo”.



P.S.

Is there another way to pass a type into a package (which is supported
by GHDL)?

No.

Tristan.


_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to