Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > For Loop Generate Statement

Reply
Thread Tools

For Loop Generate Statement

 
 
Roman Zeilinger
Guest
Posts: n/a
 
      09-23-2004
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


 
Reply With Quote
 
 
 
 
jandc
Guest
Posts: n/a
 
      09-23-2004
> 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...
 
Reply With Quote
 
 
 
 
Allan Herriman
Guest
Posts: n/a
 
      09-23-2004
On Thu, 23 Sep 2004 15:46:28 +0100, "Roman Zeilinger"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user instance. Harlan Messinger ASP .Net 2 03-28-2010 06:51 PM
How to generate warnings when How generate a warning when int is converted to bool or vice versa? PengYu.UT@gmail.com C++ 3 04-06-2006 11:24 PM
How to generate variable labels for same component within a generate loop Weng Tianxiang VHDL 5 02-16-2006 01:45 PM
Error Generate Statement Isaac VHDL 3 08-07-2003 07:24 PM



Advertisments