Hello,
I am trying to figure out how to map a constant to a port in a component instantiation.
I have a package that contains several types, namely the following:
-------------------------------------------------
type ALPHA is array (natural range <>) of
std_logic_vector((DATAWORD/2 - 1) downto 0); -- alphabet array
constant ALPHA_LUT: ALPHA := (0 => "0001", 1 => "0011", 2 => "0101",
3 => "1001", 4 => "1101", 5 => "1111"
-- Original 8-bit DCT coefficients
-- a=0.49, b=0.46, c=0.42, d=0.35, e=0.28, f=0.19, g=0.10
-------------------------------------------------
This creates a constant array of 6 std_logic_vectors. Now, how is it I can assign this to a port? I want to do something like below. However, this gives me an error since I am assigning a std_logic_vector to a constant I assume. I could hardwire the ports, but I do not want that. I need the package to contain constants and types so that any changes are reflected in many blocks.
This is what I have now, and it is wrong.
-------------
port map (
y0 => ALPHA_LUT(0),
-- .... more here
);
-------------
Thanks.
I am trying to figure out how to map a constant to a port in a component instantiation.
I have a package that contains several types, namely the following:
-------------------------------------------------
type ALPHA is array (natural range <>) of
std_logic_vector((DATAWORD/2 - 1) downto 0); -- alphabet array
constant ALPHA_LUT: ALPHA := (0 => "0001", 1 => "0011", 2 => "0101",
3 => "1001", 4 => "1101", 5 => "1111"
-- Original 8-bit DCT coefficients
-- a=0.49, b=0.46, c=0.42, d=0.35, e=0.28, f=0.19, g=0.10
-------------------------------------------------
This creates a constant array of 6 std_logic_vectors. Now, how is it I can assign this to a port? I want to do something like below. However, this gives me an error since I am assigning a std_logic_vector to a constant I assume. I could hardwire the ports, but I do not want that. I need the package to contain constants and types so that any changes are reflected in many blocks.
This is what I have now, and it is wrong.
-------------
port map (
y0 => ALPHA_LUT(0),
-- .... more here
);
-------------
Thanks.