V
Ved
Guest
Hi all,
I have problem in assigning 2 dimensional array column to an array in
generate statement.
I have to take out columns(array of 8 elements) from 8x16 matrix (i.e.
2-D array) and give it to a component which is to be generated 16
times.
I am confused in assigning a column array of 2D array to a 1D
array(simple array) inside a GENERATE statement.
I hope explanation is clear ?
I have tried to do something (please see codes below).
How to use a for loop inside generate.
Textbooks and internet resources are not very clear about.
Please correct me.
Thanks
Regards
Ved
------Data types---------
MatrixInt ---> array (0 to 7 , 0 to 15) of integer range 0 to 8;
---I am calling this Matrix
comp_caseSel --> array (0 to 7) of integer range 0 to 8;
---- I am calling this 1D array
countArray ---> array (0 to 15) of integer range 0 to 8 ;
-------------------------------
entity is
Matrix2D : in MatrixInt;
WordIndexCase: out countArray;
end entity
architecture......
component Comp_Metric is
port(
IndexCOL : in comp_caseSel;
WordIndexCase_c: out integer range 0 to 8
);
end component;
begin
gen: for i in 0 to 15 generate ---Generate 16 times
for j in 0 to M-1 loop
compx: Comp_Metric
port map(
IndexCOL => Matrix2D(j,i), ---What to do here ??
----1D array <=
clolumn of 2D
WordIndexCase_c => WordIndexCase(i)
);
end loop;
end generate;
I have problem in assigning 2 dimensional array column to an array in
generate statement.
I have to take out columns(array of 8 elements) from 8x16 matrix (i.e.
2-D array) and give it to a component which is to be generated 16
times.
I am confused in assigning a column array of 2D array to a 1D
array(simple array) inside a GENERATE statement.
I hope explanation is clear ?
I have tried to do something (please see codes below).
How to use a for loop inside generate.
Textbooks and internet resources are not very clear about.
Please correct me.
Thanks
Regards
Ved
------Data types---------
MatrixInt ---> array (0 to 7 , 0 to 15) of integer range 0 to 8;
---I am calling this Matrix
comp_caseSel --> array (0 to 7) of integer range 0 to 8;
---- I am calling this 1D array
countArray ---> array (0 to 15) of integer range 0 to 8 ;
-------------------------------
entity is
Matrix2D : in MatrixInt;
WordIndexCase: out countArray;
end entity
architecture......
component Comp_Metric is
port(
IndexCOL : in comp_caseSel;
WordIndexCase_c: out integer range 0 to 8
);
end component;
begin
gen: for i in 0 to 15 generate ---Generate 16 times
for j in 0 to M-1 loop
compx: Comp_Metric
port map(
IndexCOL => Matrix2D(j,i), ---What to do here ??
----1D array <=
clolumn of 2D
WordIndexCase_c => WordIndexCase(i)
);
end loop;
end generate;