Generics, packages, and VHDL-2008

Discussion in 'VHDL' started by Rob Gaddi, May 9, 2013.

  1. Rob Gaddi

    Rob Gaddi Guest

    Hey y'all --

    If I have an entity with a generic, call it DATA_WIDTH. And I want
    that entity to use a package that has a DATA_WIDTH generic, in this
    specific case the package provides for a queue, implemented on shared
    variables, that the package would use.

    Is there any way to call out the instantiated package using the
    DATA_WIDTH that was passed into the entity?

    Thanks,
    Rob

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
     
    Rob Gaddi, May 9, 2013
    #1
    1. Advertising

  2. Rob Gaddi

    Andy Guest

    Rob,

    You can put a Package Instantiation Declaration in the declarative region of the entity, architecture, block, or several other declarative regions (not process).

    If the generic you wish to use is visible where the PID is, then that generic can be used in the PID's generic map aspect.

    You can include a use statement after the PID to access declarations within it.

    Andy
     
    Andy, May 9, 2013
    #2
    1. Advertising

  3. Rob Gaddi

    Rob Gaddi Guest

    On Thu, 9 May 2013 13:17:41 -0700 (PDT)
    Andy <> wrote:

    > Rob,
    >
    > You can put a Package Instantiation Declaration in the declarative region of the entity, architecture, block, or several other declarative regions (not process).
    >
    > If the generic you wish to use is visible where the PID is, then that generic can be used in the PID's generic map aspect.
    >
    > You can include a use statement after the PID to access declarations within it.
    >
    > Andy


    Thanks, Andy.

    I added the following line into the architecture declaration:

    package ldq is new data_queue
    generic map (
    DATA_WIDTH => DATA_WIDTH
    );

    But during compilation I got the message:
    Local instantiation of packages is not supported yet. Please contact
    Aldec Support to receive the latest status.

    Any clever workarounds, or am I subject to Aldec's implementational
    whims / my willingness to copy and paste code that should be nicely
    compartmentalized.

    Also, wasn't VHDL-2008 five years ago?

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
     
    Rob Gaddi, May 9, 2013
    #3
  4. Rob Gaddi

    Rob Gaddi Guest

    On Thu, 9 May 2013 13:35:04 -0700
    Rob Gaddi <> wrote:

    > On Thu, 9 May 2013 13:17:41 -0700 (PDT)
    > Andy <> wrote:
    >
    > > Rob,
    > >
    > > You can put a Package Instantiation Declaration in the declarative region of the entity, architecture, block, or several other declarative regions (not process).
    > >
    > > If the generic you wish to use is visible where the PID is, then that generic can be used in the PID's generic map aspect.
    > >
    > > You can include a use statement after the PID to access declarations within it.
    > >
    > > Andy

    >
    > Thanks, Andy.
    >
    > I added the following line into the architecture declaration:
    >
    > package ldq is new data_queue
    > generic map (
    > DATA_WIDTH => DATA_WIDTH
    > );
    >
    > But during compilation I got the message:
    > Local instantiation of packages is not supported yet. Please contact
    > Aldec Support to receive the latest status.
    >
    > Any clever workarounds, or am I subject to Aldec's implementational
    > whims / my willingness to copy and paste code that should be nicely
    > compartmentalized.
    >
    > Also, wasn't VHDL-2008 five years ago?
    >


    Found a workaround, at least for the special case of this issue. I was
    under the impression for some reason that you couldn't take a pointer
    to an incomplete type, and so I needed to make
    subtype t_element is std_logic_vector(DATA_WIDTH-1 downto 0);

    if I wanted to do dynamic structures with it.

    Turns out I'm just wrong, and I can use
    subtype t_element is std_logic_vector;

    and eliminate the need for DATA_WIDTH as a generic entirely.

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
     
    Rob Gaddi, May 9, 2013
    #4
  5. Rob Gaddi

    Andy Guest

    I think the large number of changes in 2008, combined with poor user-knowledge of the new features, and therefore little input from customers clamoring for them, all contributed to the delay in implementing these changes.

    Regardless of whether you find/use a work-around, let them know you need this feature. It helps them prioritize their efforts.

    Also, if you know of a competitor that supports the feature you need already, let Aldec know that too. That often helps.

    Andy
     
    Andy, May 10, 2013
    #5
  6. Rob Gaddi

    Rob Gaddi Guest

    On Thu, 9 May 2013 16:12:35 -0700 (PDT)
    Andy <> wrote:

    > I think the large number of changes in 2008, combined with poor user-knowledge of the new features, and therefore little input from customers clamoring for them, all contributed to the delay in implementing these changes.
    >
    > Regardless of whether you find/use a work-around, let them know you need this feature. It helps them prioritize their efforts.
    >
    > Also, if you know of a competitor that supports the feature you need already, let Aldec know that too. That often helps.
    >
    > Andy


    Just to follow up on this, Aldec says that version 9.3 should come out in August and fix this issue.

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
     
    Rob Gaddi, May 16, 2013
    #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. Replies:
    2
    Views:
    8,832
    Jim Lewis
    Mar 21, 2006
  2. Juergen Berchtel
    Replies:
    1
    Views:
    6,101
    John C. Bollinger
    May 20, 2005
  3. wallge
    Replies:
    7
    Views:
    537
  4. Amal
    Replies:
    1
    Views:
    1,789
    vipinlal
    Mar 4, 2010
  5. Soul
    Replies:
    0
    Views:
    553
Loading...

Share This Page