prfered style of coding?

B

bxbxb3

Guest
Hi,
I just wanted to ask which is prefered style of coding...behavioral or
structural? Which among the two fit into FPGA easily?
Thanks.
 
Behavioral is mainly for testbenches and simulation, structural is the style
for implementation on FPGAs/CPLDs/ASICs.
 
bxbxb3 wrote:


I just wanted to ask which is prefered style of coding...behavioral or
structural?
If you have got a core of a subcomponent - use it. Somebody has done the
work for you and you don't need to do it again unless you try to do it
better or you try to expand it. -> structural

If you have a huge project - split it into smaller parts. This is more
readable for humans and the parts can be synthesized and tested
separately. -> structural

Don't break down hierarchy to the gates. (Don't try to model an adder
through instantiation of fulladder cells - use the power of your
synthesis tool which can do this better.) Find a balance between
splitting your design in parts and modelling something in one component.
-> behavioral

Try to write target-indipendent code as long as possible. (Do not use
primitive cells (except you /really/ need it). If you use IP cores,
encapsulate them into a common entity making it exchangeable by a
different IP core with the same functionality.) -> behavioral


Which among the two fit into FPGA easily?
Not the target is important but the synthesis tool! (Write
target-indipendent code.) If your code can be synthesized (and it
performs well), everything is o.k..

There are several other facts, that become important after choosing your
target:
* latches allowed?
* (a)synchronous resets? everytime?
* both clock edges?
* divided clocks?
....
But this is indipendent from behavioral / structural design.


Ralf
 

Welcome to EDABoard.com

Sponsor

Back
Top