R
Ralf Hildebrandt
Guest
Hi all!
I have to write the configuration for a component, that contains some
subcomponents, that are instanced depending on generic parameters. Let
me give a theoretical example:
architecture behavior of top_component is
component subcomp
-- generic / port declaration
end component;
begin
gen_label_1 : if (gen_param=1) generate
instance_name_1 : subcomp
generic map(
... );
port map(
... );
end generate;
gen_label_2 : if (gen_param=2) generate
instance_name_2 : subcomp
generic map(
... );
port map(
... );
end generate;
-- and so on...
end behavior;
The configuration can be written as:
for behavior
for gen_label_1
for instance_name_1: subcomp use entity lib.subcomp(behavior);
end for; -- instance_name_1
end for; -- gen_label_1
for gen_label_2
for instance_name_2: subcomp use entity lib.subcomp(behavior);
end for; -- instance_name_2
end for; -- gen_label_2
-- and so on...
end for; -- behavior
If there are a lot of instances the configuration gets huge, too. In my
special case I want the same configuration for all instances of subcomp.
Additionally I have a second subcomponent (subcomp2), that is used quite
similar: many instances depending on generate statements. For subcomp2
everytime the same configuration is needed, too.
A for-generate is impossible, because of the unique port map of each
instance. So for simplifying the configuration I tried something like:
for behavior
for all
for all
subcomp use entity lib.subcomp(behavior);
subcomp2 use entity lib.subcomp2(behavior);
end for; -- all
end for; -- all
end for; -- behavior
But this is invalid. So my concluded question is:
Is there a way to say "take everytime this configuration for an instance
independet from logic depth of the block/generate labels"?
Ralf
I have to write the configuration for a component, that contains some
subcomponents, that are instanced depending on generic parameters. Let
me give a theoretical example:
architecture behavior of top_component is
component subcomp
-- generic / port declaration
end component;
begin
gen_label_1 : if (gen_param=1) generate
instance_name_1 : subcomp
generic map(
... );
port map(
... );
end generate;
gen_label_2 : if (gen_param=2) generate
instance_name_2 : subcomp
generic map(
... );
port map(
... );
end generate;
-- and so on...
end behavior;
The configuration can be written as:
for behavior
for gen_label_1
for instance_name_1: subcomp use entity lib.subcomp(behavior);
end for; -- instance_name_1
end for; -- gen_label_1
for gen_label_2
for instance_name_2: subcomp use entity lib.subcomp(behavior);
end for; -- instance_name_2
end for; -- gen_label_2
-- and so on...
end for; -- behavior
If there are a lot of instances the configuration gets huge, too. In my
special case I want the same configuration for all instances of subcomp.
Additionally I have a second subcomponent (subcomp2), that is used quite
similar: many instances depending on generate statements. For subcomp2
everytime the same configuration is needed, too.
A for-generate is impossible, because of the unique port map of each
instance. So for simplifying the configuration I tried something like:
for behavior
for all
for all
subcomp use entity lib.subcomp(behavior);
subcomp2 use entity lib.subcomp2(behavior);
end for; -- all
end for; -- all
end for; -- behavior
But this is invalid. So my concluded question is:
Is there a way to say "take everytime this configuration for an instance
independet from logic depth of the block/generate labels"?
Ralf