- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need to write a GENERATE statement, but the step must be different from unit. Something like:
gen: for i in 0 to 20 generate
temp(i) <= temp(i+4-2) or temp(i+4-1);
end generate;
this "i" must be incremented by 4 units instead of 1. Regards Jaraqui
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
with something like this:
gen: for i in 0 to 4 generate temp(i) <= temp(i * 4 +4-2) or temp(i * 4+4-1); end generate; but check the range of i.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- with something like this: gen: for i in 0 to 4 generate temp(i) <= temp(i * 4 +4-2) or temp(i * 4+4-1); end generate; but check the range of i. --- Quote End --- thank you! I will test this solution, but I need only temp(0), temp(4), temp(8), ... be the positions to receive assignments. Writing in this way, I suspect that temp(0), temp(1), temp(2), ... would receive assignments Regards Jaraqui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're right. The new code would be:
temp(i * 4) <= temp(...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found another thread about this.
http://www.alteraforum.com/forum/showthread.php?t=25890 Sorry for my poor previous query. What I was exactly looking for is a "programmable step" and not a step that has to stablish some logic between the index and my desired positions. Something like for i in begin to end loop (step n) generate... Reading about this I seems that this feature isn´t availabe for concurrent generate as well as for sequential loops... Is that correct? Regards Jaraqui- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To learn about allowed VHDL constructs I suggest to read a text book or the LRM.
In the present case, these points should be considered: - the range of sequential for loops as well as generate loops must be constant. - you can achieve a variable range or a variable step size in sequential for loops by combining it with conditional statements - this is impossible with generate statements by their nature
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page