Altera_Forum
Honored Contributor
11 years agoGeneric parameter with variable size
Hi all
My design requires a parameter defined at compilation time that can range from 1 to 128 bytes. It isn't possible to create a generic based on another generic like this: generic (es_size : natural range 1 to 128 := 2;
es_info : bidim_array_t(es_size-1 downto 0) := (x"00",x"00"));
) Where bidim_array_t is defined inside a package: type bidim_array_t is array(natural range <>) of std_logic_vector(7 downto 0); With this code Quartus reports the following error: ***generic "es_size" cannot be used in its own interface list*** Removing the es_size and fixating the size of es_info to 128 could be one solution but I would like to know if there is anything more elegant to do in this case. Thank you Best regards Thiago