Professional Documents
Culture Documents
09/05/12
KSL-DOEACC CALICUT
VHDL Terms
Entity :
All designs are expressed in terms of entities. An entity is the most basic building block in a design. If the design is hierarchical, then the top-level description will have lower-level descriptions contained in it. These lower-level descriptions will be lower-level entities contained in the top-level entity description
09/05/12
KSL-DOEACC CALICUT
VHDL Terms
Architecture :
All entities that can be simulated have an architecture description. The architecture describes the behaviour of the entity. A single entity can have multiple architectures. One architecture might be behavioural while another might be structural description of the design.
09/05/12
KSL-DOEACC CALICUT
VHDL Terms
Configuration :
A Configuration statement is used to bind a component instance to an entity-architecture pair.
Package :
A package is a collection of commonly used data types and subprograms in a design. (like a toolbox that contains tools used to build designs)
09/05/12 KSL-DOEACC CALICUT 5
Architecture Bodies
09/05/12
KSL-DOEACC CALICUT
Components
Package Declaration Entity (Interface)
Package Body
Architecture (Function)
Configuration
09/05/12
KSL-DOEACC CALICUT
A VHDL File
09/05/12
KSL-DOEACC CALICUT
Design Entity
E n t i t y E I n A F
09/05/12
n t e
t i t y r f a i t e
D c e
c D
r c h u n
c t u n
9
c t i o
KSL-DOEACC CALICUT
Entity
Declares the design name. Provides the port information Describes the interface of the design entity . The interface includes all inputs, outputs and bidirectional signals and generics. A declarative part to declare Subprograms, types and constants . Declarations are visible to all the architectures assigned to the entity An entity may contain its own passive statements.
09/05/12
KSL-DOEACC CALICUT
10
Entity Syntax
Entity entity-name is [generic (list-of-generics-and-their-types);] [port (list-of-interface-port-names-and-theirtypes);]
[entity-item-declarations]
[begin
entity-statements]
End [entity][entity_name];
09/05/12 KSL-DOEACC CALICUT 11
PORTS
Each I/O signal in an entity declaration is a port. Must have a name, a direction (mode) and a data type. A port is a data object (signal). It can be assigned values and used in expressions.
port ( portname : [mode] subtype_indication [:= init_value] {; portname : [mode] subtype_indication [:= init_value]} );
09/05/12 KSL-DOEACC CALICUT 12
09/05/12
KSL-DOEACC CALICUT
13
Modes
In - input port, read only out - output port , write only inout - bi-directional port, read/write, multiple drivers buffer - read and update, single driver
09/05/12 KSL-DOEACC CALICUT 14
VHDL Entity
entity- name of a function and its interfaces
Full adder
sum_ou t cy_out
15
Entity
entity fulladder port is in bit ;
( a_in,b_in,cy_in :
09/05/12
KSL-DOEACC CALICUT
16
Entity Declarations
a 4 4 b ci
Sum co
09/05/12
KSL-DOEACC CALICUT
17
Entity Declaration
Example
Entity add4 is port ( a b ci co : : : : in std_logic_vector(3 downto 0); std_logic_vector in std_logic_vector(3 downto 0); std_logic_vector in std_logic; std_logic out std_logic); std_logic
Example
entity and 2 is port (a,b end and2; architecture dataflow of and2 is Begin y<=a and b; end dataflow; : in bit; y : out bit); --and gate
a b y
09/05/12
KSL-DOEACC CALICUT
19