For Loop Generate Statement

R

Roman Zeilinger

Hello

I have the following problem:

I want to generate a module consisting of single bit modules. The problem is
now that I want to increase the index i of the for loop by 2 in each
interation.

So can someone please tell me how I have to modify this for loop so that i
is incremented by 2 after each interation? I tried i := i+2 but this doesent
work

gen_modul: for i in 0 to 6 generate
.....
end generate gen_modul

Thanks a lot

Roman
 
J

jandc

Hello
I have the following problem:

I want to generate a module consisting of single bit modules. The problem is
now that I want to increase the index i of the for loop by 2 in each
interation.

So can someone please tell me how I have to modify this for loop so that i
is incremented by 2 after each interation? I tried i := i+2 but this doesent
work

gen_modul: for i in 0 to 6 generate
.....
end generate gen_modul

Why not do

gen_modul: for i in 0 to 3 generate
...
end generate gen_modul

and use i*2 instead of i everywhere you use i...
 
A

Allan Herriman

Hello

I have the following problem:

I want to generate a module consisting of single bit modules. The problem is
now that I want to increase the index i of the for loop by 2 in each
interation.

So can someone please tell me how I have to modify this for loop so that i
is incremented by 2 after each interation? I tried i := i+2 but this doesent
work

gen_modul: for i in 0 to 6 generate
.....
end generate gen_modul

You can't. However, you can use 2*i instead of i inside the loop,
which acheives the same thing.

Regards,
Allan
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top