Inexplicable compilation error

Discussion in 'VHDL' started by better_cs_now@yahoo.com, Oct 7, 2006.

  1. Guest

    Hello all,

    I'm using Active HDL 6.3, student edition.

    In the code below, I'm getting the following error:

    # Error: COMP96_0078: full_adder.vhd : (22, 10): Unknown identifier
    "std_logic".

    This error occurs in the declaration of entity foo. Note that std_logic
    is found just fine prior to this point in the declaration of entity
    full_adder. What on earth is going on?

    Thanks in advance,
    Dave



    library ieee;
    use ieee.std_logic_1164.all;

    entity full_adder is
    port(
    a, b, cin : in std_logic;
    s, cout : out std_logic
    );
    end entity full_adder;

    entity foo is
    port(
    f: in std_logic
    );
    end entity foo;
     
    , Oct 7, 2006
    #1
    1. Advertising

  2. Duane Clark Guest

    wrote:
    > Hello all,
    >
    > I'm using Active HDL 6.3, student edition.
    >
    > In the code below, I'm getting the following error:
    >
    > # Error: COMP96_0078: full_adder.vhd : (22, 10): Unknown identifier
    > "std_logic".
    >
    > This error occurs in the declaration of entity foo. Note that std_logic
    > is found just fine prior to this point in the declaration of entity
    > full_adder. What on earth is going on?


    It is one of the stranger things in VHDL. You need to redeclare the
    libraries before each entity. That's just the way it works ;)
     
    Duane Clark, Oct 7, 2006
    #2
    1. Advertising

  3. Andy Guest

    The scope of the context clause (library and use statements) is
    independent of the file. It is limited to the design unit immediately
    following, in this case: full_adder. Note that architectures and
    package bodies inherit the scope of their associated entity and package
    declaration, regardless of whether those secondary units are located in
    the same file as their associated primary units.

    This behavior was borrowed from ada.

    Andy


    wrote:
    > Hello all,
    >
    > I'm using Active HDL 6.3, student edition.
    >
    > In the code below, I'm getting the following error:
    >
    > # Error: COMP96_0078: full_adder.vhd : (22, 10): Unknown identifier
    > "std_logic".
    >
    > This error occurs in the declaration of entity foo. Note that std_logic
    > is found just fine prior to this point in the declaration of entity
    > full_adder. What on earth is going on?
    >
    > Thanks in advance,
    > Dave
    >
    >
    >
    > library ieee;
    > use ieee.std_logic_1164.all;
    >
    > entity full_adder is
    > port(
    > a, b, cin : in std_logic;
    > s, cout : out std_logic
    > );
    > end entity full_adder;
    >
    > entity foo is
    > port(
    > f: in std_logic
    > );
    > end entity foo;
     
    Andy, Oct 9, 2006
    #3
    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. Dave
    Replies:
    13
    Views:
    771
    Cy Edmunds
    Jan 1, 2004
  2. O.o
    Replies:
    4
    Views:
    323
    Vladimir Jovic
    Dec 11, 2009
  3. Saqib Ali
    Replies:
    6
    Views:
    1,173
    Vyacheslav Lanovets
    Oct 24, 2011
  4. frankvfox

    Inexplicable (By Me) Null Reference Error

    frankvfox, May 7, 2006, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    189
    frankvfox
    May 7, 2006
  5. Tom Cloyd
    Replies:
    0
    Views:
    124
    Tom Cloyd
    May 6, 2009
Loading...

Share This Page