Parameterisable number of shift reg components

Joined
Apr 26, 2007
Messages
5
Reaction score
0
Hi everyone.

i want to make a design with a number of shift registers. The number of shift registers is controlled by a parameter 'b'.

how can i do that?

For now i try the folloing but is not working:

GEN: FOR i IN 1 TO b GENERATE
a1: ENTITY sftreg GENERIC MAP(width=>8) PORT MAP(clk,sin(i),pout(i));
END GENERATE GEN;

Each register is 8-bit width
'clk' is std_logic type
'sin' is a std_logic_vector(1 TO b) type
'pout' is a array2D type defined as bellow

TYPE array2D IS ARRAY (b DOWNTO 1) OF std_logic_vector(width DOWNTO 1);

It seems to me (maybe i am wrong) that vhdl does not support parameterisable number of instance statements in a generate because of the instance statementy label.

Thank you
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,172
Messages
2,570,937
Members
47,473
Latest member
pioneertraining

Latest Threads

Top