Entity Generics Question

Discussion in 'VHDL' started by dohzer, Aug 21, 2009.

  1. dohzer

    dohzer

    Joined:
    Aug 21, 2009
    Messages:
    1
    I'm declaring the following interface and getting the following error:

    Code (Text):
    entity entity_a is
        generic
        (
            SIG_A_WIDTH         : integer := 16;
            SIG_B_WIDTH         : integer := 2;
            SIG_C_WIDTH     : integer := SIG_WIDTH_A - SIG_WIDTH_B;
        );

        port
        (
            ...
            blah
            ...
        );
    end entity_a;
    Code (Text):
    Object 'sig_a_width' cannot be used within the same interface as it is declared
    I want to be able to define "SIG_C_WIDTH" as a function of the other two widths, so is there an easier and/or more correct way to do it? Should I be declaring it in a separate package or somewhere else in the code?
     
    dohzer, Aug 21, 2009
    #1
    1. Advertisements

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. Juergen Berchtel
    Replies:
    1
    Views:
    6,286
    John C. Bollinger
    May 20, 2005
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,950
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    662
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    3,136
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,348
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page