incremental generic association

S

sebs

Hi,

In my toplevel testbench I'd like to only change one generic of a
component somewhere in my design. This component has many generics
that have no default binding. They are all set by the hierarchy
above.

so in my testbench I want to do something like the following in order
to change only the generic g_Segment, but leave the rest alone.

configuration blub of my_tb is

for tb
for C_data_src: data_src
for behav
for C_segment : segment
use entity work.segment
generic map (g_Segments => 10);
end for;
end for;
end for;
end configuration blub;


Unfortunately Modelsim complains about all generics that have no
default value ... "Formal generic ... has OPEN or no actual
association with it." Although all generics are defined in the
architecture where C_segment is instantiated. Why would i need to
define all generics in the generic map of the configuration, when I
want to only override one of them?
 
H

hssig

Although all generics are defined in the architecture

1. Generics are defined in the entity, not in the architecture
2. Do you provide default values for the generics ? They are
necessary if you do not want to map them in "generic map".

Cheers,
hssig
 
K

KJ

1. Generics are defined in the entity, not in the architecture
2. Do you provide default values for the generics ? They are
necessary if you do not want to map them in "generic map".

Cheers,
hssig

What sebs meant to say is that the *values for* all generics are
defined in the architecture where C_segment is instantiated. There is
more than one generic being mapped, sebs wants to override only one of
them in the testbench (or more generally speaking, he wants to
override a subset of all of the generics and can't rely on entity
defined defaults, if they happen to have defaults).

I don't think this can be done.

Kevin Jennings
 
J

JimLewis

Hi Sebs,
See Peter Ashenden's book. Below is my paraphrase.

With component instantiation, you are creating a local object
with local ports and local generics. By default, component
name binds to entity name, local ports map to entity formal
ports, and local generics map to entity formal generics.
When you choose to map the entity formal generics, you must
specify a value for each formal generic - either a new value
or the value from a component.

Hence change your generic map to:

generic map (
g_Segments => 10, -- formal generic getting new value
g_One => g_One, -- formal generic getting local
generic
... -- map all of the formal generics
);


Thanks for posting this as it clarified my understanding of this.
I had thought it was as easy as what you posted, but I do remember
having done it as above.

Best,
Jim
 

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,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top