I have question on how to use array to declare my constant values. I want to use all the constant value in generic map. So, should I declare all the constant in generic..? As example :
constant ( z : integer := 3);
type a is array (0 to z-1) of integer;
constant b : a := (3,5,7)
I need to use all these value in generic map..thanks in advance...
No you cant, which is one of the problems - you need to then declare the constant in the package.
But the code you posted you dont need the constant.
Code:
package type_pkg is
type a_t is array(integer range <>) of integer;
end package type_pkg.
entity some_ent is
generic (
a : a_t(0 to 2); --you dont need Z anymore, because you can declare the size of the array here
);
how about the constant value 5,6,7? Do i have to declare it in the package as well? I need to include all these value later in generate statement..which it will be call in my generic map..