M
Marco
Guest
Hi,
there's something i don't understand about generics. Suppose I have to
use a component within my top entity, so in the declarative part of my
architecture I place the component declaration, while in the body of
the architecture I insert its instantiation. Here's my doubt, if I
assign a different value in these 2 places (say I write "my_generic :
integer := 1" inside declaration, while "my_generic => 2" in the
instantiation), which one will be the one considered by the
application?
Component Declaration:
component <component_name>
generic (
my_generic : integer := 1;
<other generics>...
);
port (
<port_name> : <mode> <type>;
<other ports>...
);
end component;
Component Instantiation:
<instance_name> : <component_name>
generic map (
my_generic => 2,
<other generics>...
)
port map (
<port_name> => <signal_name>,
<other ports>...
);
Thanks,
Marco
there's something i don't understand about generics. Suppose I have to
use a component within my top entity, so in the declarative part of my
architecture I place the component declaration, while in the body of
the architecture I insert its instantiation. Here's my doubt, if I
assign a different value in these 2 places (say I write "my_generic :
integer := 1" inside declaration, while "my_generic => 2" in the
instantiation), which one will be the one considered by the
application?
Component Declaration:
component <component_name>
generic (
my_generic : integer := 1;
<other generics>...
);
port (
<port_name> : <mode> <type>;
<other ports>...
);
end component;
Component Instantiation:
<instance_name> : <component_name>
generic map (
my_generic => 2,
<other generics>...
)
port map (
<port_name> => <signal_name>,
<other ports>...
);
Thanks,
Marco