library clause

Discussion in 'VHDL' started by =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Jul 27, 2006.

  1. Hello all,

    I tried to google for it and search in my book
    unfortunately I couldn't find the answer

    we have primary design units and secondary in VHDL.
    If I use library clause above a primary unit, such as entity
    do I then make this library available to all its architectures?

    what if I write the same library clause above one of
    the architectures, does it make that library available for other
    architectures of the same entity?

    Of course the same game for package(as primary unit) and
    package body(as secondary unit).

    Thanks in advance.

    Regards, Daniel
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Jul 27, 2006
    #1
    1. Advertising

  2. Schüle Daniel wrote:

    > we have primary design units and secondary in VHDL.
    > If I use library clause above a primary unit, such as entity
    > do I then make this library available to all its architectures?


    Yes, If the architectures are in the same file
    and if there is an appropriate USE statement.

    > what if I write the same library clause above one of
    > the architectures, does it make that library available for other
    > architectures of the same entity?


    No.

    -- Mike Treseler
    Mike Treseler, Jul 27, 2006
    #2
    1. Advertising

  3. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    john Doef Guest

    Mike Treseler a écrit :

    > Schüle Daniel wrote:
    >
    > > we have primary design units and secondary in VHDL.
    > > If I use library clause above a primary unit, such as entity
    > > do I then make this library available to all its architectures?

    >
    > Yes, If the architectures are in the same file

    Yes, even if they are not in the same file!

    > and if there is an appropriate USE statement.


    All the context clauses of an entity apply to its architecture.
    Cf LRM Chap 10, if you are *very* courageous.

    > > what if I write the same library clause above one of
    > > the architectures, does it make that library available for other
    > > architectures of the same entity?

    >
    > No.


    JD.
    john Doef, Jul 27, 2006
    #3
  4. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    Andy Guest

    Just a point of clarification, but the design unit includes the context
    _clause_ immediately preceeding the library unit. The _context_ for a
    secondary unit includes both its context_clause, and that of its
    associated primary unit. (i.e. a package body's context includes that
    of its package, and an architecture's context includes that of its
    entity.)

    Whether or not the primary and secondary units are in the same file is
    irrelavant per the language spec, but some tools do not properly handle
    that case.

    Andy



    john Doef wrote:
    > Mike Treseler a écrit :
    >
    > > Schüle Daniel wrote:
    > >
    > > > we have primary design units and secondary in VHDL.
    > > > If I use library clause above a primary unit, such as entity
    > > > do I then make this library available to all its architectures?

    > >
    > > Yes, If the architectures are in the same file

    > Yes, even if they are not in the same file!
    >
    > > and if there is an appropriate USE statement.

    >
    > All the context clauses of an entity apply to its architecture.
    > Cf LRM Chap 10, if you are *very* courageous.
    >
    > > > what if I write the same library clause above one of
    > > > the architectures, does it make that library available for other
    > > > architectures of the same entity?

    > >
    > > No.

    >
    > JD.
    Andy, Jul 27, 2006
    #4
  5. [...]

    thx for responses so far
    I found out that an entity may also contain shared variable

    entity test is
    shared variable i: integer;
    end;

    I suppose that then all processes in all architectures of test
    have access to it.

    Regards, Daniel
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Jul 28, 2006
    #5
  6. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    Andy Guest

    Only the one architecture bound to that instance of the entity will
    have access to it. For the other architectures to access it, they would
    have to be bound to different instances of the entity, and thus would
    not see the same shared variable.

    Andy


    Schüle Daniel wrote:
    > [...]
    >
    > thx for responses so far
    > I found out that an entity may also contain shared variable
    >
    > entity test is
    > shared variable i: integer;
    > end;
    >
    > I suppose that then all processes in all architectures of test
    > have access to it.
    >
    > Regards, Daniel
    Andy, Aug 2, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Simpson

    Re: Formatting string in WHERE clause

    Lee Simpson, Jul 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,243
    Lee Simpson
    Jul 18, 2003
  2. Jan
    Replies:
    2
    Views:
    1,413
    Mike Treseler
    Dec 16, 2004
  3. bxbxb3

    "else process" clause

    bxbxb3, May 26, 2005, in forum: VHDL
    Replies:
    3
    Views:
    649
    combinational.logic $ soc-ip.com
    May 27, 2005
  4. feiyang
    Replies:
    1
    Views:
    1,629
    Ajeetha
    Nov 23, 2006
  5. David C Hendry

    USE clause for cell library

    David C Hendry, Dec 11, 2008, in forum: VHDL
    Replies:
    6
    Views:
    506
    David C Hendry
    Dec 12, 2008
Loading...

Share This Page