Inexplicable compilation error

B

better_cs_now

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;
 
D

Duane Clark

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 ;)
 
A

Andy

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top