generate statements with complex connection logic

W

wallge

when doing a series of nested if ... generate and for ... generate
statements,

the only sort of "book-keeping variables" that can be used to control
connection of block A to block B seem to be the loop indices
themselves.
I have found that you can call custom functions that can return other
values based on loop indices or constants / generics. Is this the only
way
to have a sense of "book-keeping" variables that may be needed when
doing complex
component generate statements? (a genericly-sized, pipelined matrix (m
x k, k x n) multiply, or 2d convolution (m x n)
is a good example of the need for complex generate statements)
 
M

Mike Treseler

wallge said:
when doing a series of nested if ... generate and for ... generate
statements,
the only sort of "book-keeping variables" that can be used to control
connection of block A to block B seem to be the loop indices
themselves. I have found that you can call custom functions that can return other
values based on loop indices or constants / generics.
Is this the only way
to have a sense of "book-keeping" variables that may be needed when
doing complex component generate statements?

I agree that complex generate statements are annoying.
I prefer to declare array subtypes in a single process
as shown below.

-- Mike Treseler
__________________________
subtype stat_reg_t is unsigned (cnt_len-1 downto 0);
-- 32 bit register
type cnt_reg_t is array(1 to 2) of stat_reg_t; -- counter/reg pair
type err_cnt_t is array(error_descriptor) of cnt_reg_t;
-- each error type gets a counter/reg
variable err_cnt : err_cnt_t;
variable octet_cnt : cnt_reg_t;
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top