VHDL之code structure

 1  VHDL units

VHDL code is composed of at least 3 fundamental sections:

 1) LIBRARY declarations: Contains a list of all libraries to be used in the design. For example: ieee, std, work, etc.

 2) ENTITY: Specifies the I/O pins of the circuit.

 3) ARCHITECTURE: Contains the VHDL code proper, which describes how the circuit should behave (function).

 

VHDL之code structure

 

2  Library declarations

  A LIBRARY is a collection of commonly used pieces of code. Placing such pieces inside a library allows them to be reused or shared by other designs.

VHDL之code structure

  To declare a LIBRARY(that is, to make it visble to the design) two lines of code are needed:

1 library library_name;

2 use library_name.package_name.package_parts;

  Three packages from three different libraries, are usually needed in design:

  - ieee.std_logic_1164 (from the ieee library)

  - standard (from the std library)

  work (work library)   

1 library IEEE;

2 use ieee.std_logic_1164.all

3 

4 library std; 5 use std.standard.all 6 7 library work; 8 use work.all;

   The libraries std and work are made visible by default, so there is no need to declare them; only the ieee library must be explicitly written when the STD_LOGIC(or STD_ULOGIC) data type is employed in design.

你可能感兴趣的:(struct)