M
Marwan
Guest
Peace,
Context:
I am trying to discuss and demonstrate the inefficiency of the for
loop in synthesis and hardware as compared to equivalent counter
implementation.
Main body:
According to The verilog golden reference guide, the for loop
synthesizes into repeated hardware structures, provided the loop
bounds are fixed.
I am currently having difficulty in coding an example module which
demonstrates this in synthesis. Does anyone have some simple example
code that they could share?
I am using Xilinx ISE to do the simulation, synthesis testing etc...
My understanding of a for loop is that in hardware/synthesis it
'unrolls' into the repeated structures, which is obviously extremely
wasteful of resources.
It is also my understanding that a more efficient manner of
implementing a for loop, one which allows every iteration to be
controllled by a clock edge and which does not repeat structures, is
to use counters with bit select to replace for loops and nested for
loops. This would be the second example code that I will need to use
to demonstrate more efficient coding of for like functionality. This
code would be a modification of the code using the for loop.
Summary:
I am looking for synthesizable example verilog code of a module which
demonstrates the production of repeated hardware structures using a
for loop.
Of currently secondary importance is synthesizable sample code which
repreoduces the functionality of the for loop code without repeated
hardware structures but using counters.
Thanks in advance to any who attempt to answer.
Context:
I am trying to discuss and demonstrate the inefficiency of the for
loop in synthesis and hardware as compared to equivalent counter
implementation.
Main body:
According to The verilog golden reference guide, the for loop
synthesizes into repeated hardware structures, provided the loop
bounds are fixed.
I am currently having difficulty in coding an example module which
demonstrates this in synthesis. Does anyone have some simple example
code that they could share?
I am using Xilinx ISE to do the simulation, synthesis testing etc...
My understanding of a for loop is that in hardware/synthesis it
'unrolls' into the repeated structures, which is obviously extremely
wasteful of resources.
It is also my understanding that a more efficient manner of
implementing a for loop, one which allows every iteration to be
controllled by a clock edge and which does not repeat structures, is
to use counters with bit select to replace for loops and nested for
loops. This would be the second example code that I will need to use
to demonstrate more efficient coding of for like functionality. This
code would be a modification of the code using the for loop.
Summary:
I am looking for synthesizable example verilog code of a module which
demonstrates the production of repeated hardware structures using a
for loop.
Of currently secondary importance is synthesizable sample code which
repreoduces the functionality of the for loop code without repeated
hardware structures but using counters.
Thanks in advance to any who attempt to answer.