Configuration of instances

H

hssig

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
 
A

Andy

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
 
H

hssig

Hi Alan,

great! That works :)

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

Cheers,
hssig
 
M

Mike Treseler

Andy said:
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
 
H

hssig

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top