For Loop Generate Statement

R

Roman Zeilinger

Guest
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
 
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...
 
On Thu, 23 Sep 2004 15:46:28 +0100, "Roman Zeilinger"
<Patrick.Bateman23@gmx.at> wrote:

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
 

Welcome to EDABoard.com

Sponsor

Back
Top