F
feng
Guest
Hi,
Assume i have a counter which i want to set to 0 at the first clock
edge. For this, i set its value to the maximum during the reset phase,
i.e.
if reset='1' then
counter_int<="1111"
elsif rising_edge(clk) then,,,
hence at the first clock edge, it turns to zero. Likewise, if i have
two cascaded blocks: block1 and block2 with . a counter in block2.
The counter should start at a certain value when block1 starts
generating meaningful data. To set the counter accordingly at this
starting value, i compute the time to generate block1 data in terms
of number of cycles. By using the counter period, i deduce the initial
value of the counter at the reset phase. Similar code to the above is
then written. my whole architecture is pipelined and fed with
continous stream of data frames
Would you recommend this approach? Any comments about its pros and
cons? I understand that we can use a sort of handshaking between
block1 and block2. For this a dedicate signal needs to be generated,
which requires logic and might descrease the speed of the architecture
[its path to block2 might be long]. that's why i use the above
approach. Regardless this signal might need to be initialised as well
Thank you
Assume i have a counter which i want to set to 0 at the first clock
edge. For this, i set its value to the maximum during the reset phase,
i.e.
if reset='1' then
counter_int<="1111"
elsif rising_edge(clk) then,,,
hence at the first clock edge, it turns to zero. Likewise, if i have
two cascaded blocks: block1 and block2 with . a counter in block2.
The counter should start at a certain value when block1 starts
generating meaningful data. To set the counter accordingly at this
starting value, i compute the time to generate block1 data in terms
of number of cycles. By using the counter period, i deduce the initial
value of the counter at the reset phase. Similar code to the above is
then written. my whole architecture is pipelined and fed with
continous stream of data frames
Would you recommend this approach? Any comments about its pros and
cons? I understand that we can use a sort of handshaking between
block1 and block2. For this a dedicate signal needs to be generated,
which requires logic and might descrease the speed of the architecture
[its path to block2 might be long]. that's why i use the above
approach. Regardless this signal might need to be initialised as well
Thank you