Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL Generate loop index

Status
Not open for further replies.

vlsi_freak

Full Member level 2
Joined
Sep 3, 2007
Messages
127
Helped
14
Reputation
28
Reaction score
8
Trophy points
1,298
Activity points
2,041
Hi,

I am working on an HDL for an Altera design. I came a situation where i want to increment vhdl generate loop index by 2.

An example is show below,

LABEL: for i in 1 to CNTR_WIDTH -1 generate

REG1(i) <= ORG_REG(i)(1 downto 0);
REG1(i+1) <= ORG_REG(i)(3 downto 2);

end generate;

I want the generate loop i variable index proceeds like 0,2,4,6 upto the defined range.
Please help me how to do this in vhdl?

Regards,
freak
 

Generate loop describe some identical hardware then this is no sense to have index 0,2,4,6

but you can simply try :

LABEL: for i in 1 to CNTR_WIDTH -1 generate

REG1(2*i) <= ORG_REG(i)(1 downto 0);
REG1(2*i+1) <= ORG_REG(i)(3 downto 2);

end generate;

Regards
Jerome
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top