Configuration of instances

Discussion in 'VHDL' started by hssig, Nov 18, 2009.

  1. hssig

    hssig Guest

    Hi,

    maybe someone here can explain to me how to reach the following:

    I instantiate a component "cChannels" times in a generate loop. Now I
    define a configuration in which all instances do have the architecture
    "arch_compo_rtl".



    entity bundle_compo is
    end bundle_compo;

    architecture arch_bundle_compo iof bundle_compo is

    begin

    gL: for j 0 to cChannels-1 generate
    i_c: compo
    port map( iEna => ls_ena(j),
    iClk => Clk,
    iData => ls_data(j),
    oData => ls_data_rec(j)
    );
    end generate gK;

    end arch_bundle_compo;




    configuration cfg_bundle of bundle_compo is
    for arch_bundle_compo
    for all: i_c
    use entity work.compo(arch_compo_rtl);
    end for;
    end for;
    end configuration cfg_bundle_of bundle_compo;



    My question: How can I instantiate for example 10 components with
    architecture "arch_compo_rtl"
    and 10 components with architecture "arch_compo_beh" without having to
    define the config instances
    one by one ? Is there some possibility to use some kind of loop within
    the configuration ?

    Cheers,
    hssig
     
    hssig, Nov 18, 2009
    #1
    1. Advertising

  2. hssig

    Andy Guest

    Is there some reason you must use a configuration and components?

    If not, you can directly instantiate entities and specify the
    architecture in the instantiation:

    label_name: ENTITY library_name.entity_name(architecture_name)

    Or in your case:

    gL: for j 0 to cChannels-1 generate
    i_c: entity work.compo(arch_compo_rtl)
    port map( iEna => ls_ena(j),
    iClk => Clk,
    iData => ls_data(j),
    oData => ls_data_rec(j)
    );
    end generate gK;

    So you could just split your generate loop into two loops (or have a
    couple of if-generates inside one loop) to instantiate the entities
    with the architectures you wanted. You could even have a constant
    array that drives your if-generates to determine which entity/arch to
    instantiate. No component declarations or configurations are needed.

    Andy
     
    Andy, Nov 18, 2009
    #2
    1. Advertising

  3. hssig

    hssig Guest

    Hi Alan,

    great! That works :)

    @ Andi
    I should have mentioned that I need several configurations to be
    capable of simulating different scenarios.

    Cheers,
    hssig
     
    hssig, Nov 18, 2009
    #3
  4. Andy wrote:
    > Is there some reason you must use a configuration and components?


    Good question.
    The one-off use of configurations mystifies me.
    They remind me of a complex lisp function where
    '(' is replaced by "for" and
    ')' is replaced by "end for"

    But before that rant, I would like to than Alan for his
    fully functional example, as I sometimes do have to
    wade through such structural things.

    Newsgroup examples that run as written are rare.

    > If not, you can directly instantiate entities and specify the
    > architecture in the instantiation:
    >
    > label_name: ENTITY library_name.entity_name(architecture_name)


    Seems simpler to me.

    > So you could just split your generate loop into two loops (or have a
    > couple of if-generates inside one loop) to instantiate the entities
    > with the architectures you wanted. You could even have a constant
    > array that drives your if-generates to determine which entity/arch to
    > instantiate. No component declarations or configurations are needed.


    I could even redo the original
    entity using the data structures
    that I actually need.

    -- Mike Treseler
     
    Mike Treseler, Nov 18, 2009
    #4
  5. hssig

    hssig Guest

    Hi Mike,

    of course you would be right if I was trying to describe a structure
    for synthesis. But as I stated before I need that kind of
    configuration for simulation purposes.

    Cheers,
    hssig
     
    hssig, Nov 20, 2009
    #5
    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. Joerg Schrocke

    Multiple instances of web application

    Joerg Schrocke, Oct 21, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    2,502
    manger22
    Nov 22, 2005
  2. Valentin Tihomirov

    Structural VHDL - Accesing signals of instances

    Valentin Tihomirov, Nov 1, 2003, in forum: VHDL
    Replies:
    2
    Views:
    573
    Paul Uiterlinden
    Nov 2, 2003
  3. Mark
    Replies:
    0
    Views:
    863
  4. John Wohlbier
    Replies:
    2
    Views:
    399
    Josiah Carlson
    Feb 22, 2004
  5. Replies:
    8
    Views:
    490
    James Stroud
    Jan 29, 2009
Loading...

Share This Page