Re: generics
- From: "Ben Jones" <ben.jones@xxxxxxxxxx>
- Date: Wed, 24 May 2006 14:18:34 +0100
"Marco" <marco@xxxxxxxxxxx> wrote in message
news:1148475493.090133.146040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?
The value you specify in the declaration (my_generic : integer := 1) is the
default value.
The value you specify in the instantiation (generic map my_generic => 2) is
the actual value.
If no actual value is specified, the default value is used. If no actual
value is specified and no default value is specified either, then the
instantiation is an error.
Cheers,
-Ben-
.
- Follow-Ups:
- Re: generics
- From: Andy
- Re: generics
- From: Ralf Hildebrandt
- Re: generics
- From: Marco
- Re: generics
- References:
- generics
- From: Marco
- generics
- Prev by Date: Re: Paradigms in implementation of counters
- Next by Date: Re: Paradigms in implementation of counters
- Previous by thread: Re: generics
- Next by thread: Re: generics
- Index(es):
Relevant Pages
|
Loading