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).

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.

  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.

原文地址:https://www.cnblogs.com/mengdie/p/4483103.html