prfered style of coding?

Discussion in 'VHDL' started by bxbxb3, Apr 21, 2005.

  1. bxbxb3

    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.
     
    bxbxb3, Apr 21, 2005
    #1
    1. Advertising

  2. Behavioral is mainly for testbenches and simulation, structural is the style
    for implementation on FPGAs/CPLDs/ASICs.
     
    Christian Gelinek, Apr 21, 2005
    #2
    1. Advertising

  3. 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
     
    Ralf Hildebrandt, Apr 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Baxter

    style for coding latches

    Paul Baxter, Aug 10, 2003, in forum: VHDL
    Replies:
    7
    Views:
    1,145
    Mike Treseler
    Aug 15, 2003
  2. Willem Oosthuizen

    Coding style to prioritize certain inputs

    Willem Oosthuizen, Sep 2, 2003, in forum: VHDL
    Replies:
    5
    Views:
    500
    Mike Treseler
    Sep 4, 2003
  3. Analog Guy

    Coding style for CPLD vs FPGA

    Analog Guy, Mar 11, 2005, in forum: VHDL
    Replies:
    3
    Views:
    5,457
    Klaus Falser
    Mar 14, 2005
  4. calmar
    Replies:
    11
    Views:
    901
    calmar
    Feb 21, 2006
  5. Ken Varn
    Replies:
    0
    Views:
    472
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page