Re: generics




"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-


.



Relevant Pages

  • Re: generics
    ... do you mean that if I set a default value in the declaration part, ... while I forget to specify a value in the instantiation, I'll synthesize ...
    (comp.lang.vhdl)
  • Re: implementing roles in OOP......
    ... > relationship instantiation from relationship navigation. ... > It's not an interface issue; ... > The Client provides the Visitor reference when it invokes ... autognerate the declaration for me. ...
    (comp.object)
  • Re: Using default value of a generic in VHDL
    ... instantiation. ... component declaration inside the architecture that instantiated it, ... I would put it in a package that is in the same physical file as the ... I now have my interface using records, which means I don't have as ...
    (comp.lang.vhdl)
  • Re: Possible F77 Code Improvement ??
    ... SUMT = SumKahan (ValT, kount) ... I find it difficult to believe that the compiler would say this if you ... we are talking about just using the same declaration in ... aren't allowed to) specify it in two separate places, ...
    (comp.lang.fortran)
  • Re: metapost or something? Coordinate system - transformation with cosine...
    ... scanprse.web:10970: error: explicit qualification in declaration of ... This error refers to explicit declarations of template functions that ... GCC needs this, but some other systems generate the ... compilation units that call an instantiation of the function. ...
    (comp.text.tex)

Loading