I have an array of std_logic_vectors. The length of the array and std_logic_vectors are variable based on generics. How can I concatenate all the std_logic_vectors in my array without knowing the exact number of elements in my array?
Here's an example of what I need where I hard code the number of elements in the array:
constant NUM_ELEMENTS : integer := 3;
constant VECTOR_LENGTH : integer := 2
type t_small_vectors is array (0 to NUM_ELEMENTS-1) of std_logic_vector(VECTOR_LENGTH-1 downto 0);
signal small_vectors : t_small_vectors;
signal large_vector : std_logic_vector(NUM_ELEMENTS*VECTOR_LENGTH-1 downto 0);
begin
large_vector <= small_vectors(2) & small_vectors(1) & small_vectors(0);
end architecture
This example doesn't work for me because I would need to change a line of code every time I changed NUM_ELEMENTS
I realize this has to fit in a generate statement or a for loop in a process but can't think through how it'd work.