H
hssig
Guest
Hi,
I want to use VHDL-2008 generic packages so that I can pass a generic
to the package from the generic
of a component (in which the package is used), I read about "local
packages" in VHDL-2008, but the problem with them is that I need the
package instantiation after the generic part and before the
port declaration of the component. But this is not the declarative
part of an entity. Is that kind of generic structure possible at all
in VHDL-2008?
library ieee;
use ieee.std_logic_1164.all;
package pkg_test is
generic( NUM : positive :=77);
type t_type is array(0 to NUM) of std_logic_vector(NUM downto 0);
end package;
library ieee;
use ieee.std_logic_1164.all;
entity test_component is
generic( NUM_TEST : positive := 4 );
-- THIS is NOT the declarative part of an entity
library work;
use work.pkg_test.all;
package pkg_test_inst is new work.pkg_test -- Local Package
2008 ????
generic map( NUM => NUM_TEST);
library work;
use work.pkg_test_inst.all;
port(
SigIn : in t_type;
SigOut : out t_type
);
-- THIS is the declarative part of an entity
end entity;
architecture test of test_component is
begin
SigOut <= SigIn;
end architecture;
I want to use VHDL-2008 generic packages so that I can pass a generic
to the package from the generic
of a component (in which the package is used), I read about "local
packages" in VHDL-2008, but the problem with them is that I need the
package instantiation after the generic part and before the
port declaration of the component. But this is not the declarative
part of an entity. Is that kind of generic structure possible at all
in VHDL-2008?
library ieee;
use ieee.std_logic_1164.all;
package pkg_test is
generic( NUM : positive :=77);
type t_type is array(0 to NUM) of std_logic_vector(NUM downto 0);
end package;
library ieee;
use ieee.std_logic_1164.all;
entity test_component is
generic( NUM_TEST : positive := 4 );
-- THIS is NOT the declarative part of an entity
library work;
use work.pkg_test.all;
package pkg_test_inst is new work.pkg_test -- Local Package
2008 ????
generic map( NUM => NUM_TEST);
library work;
use work.pkg_test_inst.all;
port(
SigIn : in t_type;
SigOut : out t_type
);
-- THIS is the declarative part of an entity
end entity;
architecture test of test_component is
begin
SigOut <= SigIn;
end architecture;