Professional Documents
Culture Documents
VHDL Development
US DoD initiated in 80s Very High Speed ASIC Description Language Initial objective was modeling only and thus only a simulator was envisaged Subsequently tools for VHDL synthesis were developed
History of VHDL
Launched in 1980 by Defense Advanced Research Projects Agency (DARPA) July 1983Intermetrics, IBM and Texas Instruments were awarded a contract to
develop VHDL
August 1985 release of final version of the language under government contract, VHDL Version 7.2
December 1987IEEE Standard 10761987 1988VHDL became an American National Standards Institute (ANSI ) standard In 1990 Cadence opened the language to the public
For RTL design VITAL added VITAL(VHDL Initiative Towards ASIC Library) IEEE revised VHDL & VITAL in 1993 September Final review of standard in 2001
VHDL
vs.
Verilog
Complex grammar Complicated compiler Large memory for simulation Hard to learn A lot of data types High level data types, Pointers Alias
Easy language Simple & fast compiler Efficient memory usage and faster Easy to learn for beginner A few data types Hardware related Wires Registers
VHDL
vs.
Verilog
User defined types Strong type checking (ie it checks the typing more rigorously) User defined Library & package Open Language
Verilog modeled after C, VHDL is modeled after Ada Verilog is case sensitive while VHDL is not VHDL is more flexible Verilog used extensively in the US while VHDL is used internationally
Data Types
bit values: '0', '1' boolean values: TRUE, FALSE integer values: -(231) to +(231 - 1)
std_logic values: 'U','X','1','0','Z','W','H','L','-' U' = uninitialized 'X' = unknown 'W' = weak 'X 'Z' = floating 'H'/'L' = weak '1'/'0 '-' = don't care Std_logic_vector (n downto 0); Std_logic_vector (0 upto n);
timing data
IEEE 1164 (data types)
Synthesis
Simulation
Simulation is modeling the output response of a circuit to given input stimuli For our example circuit: Given the values of A, B and S Determine the values of X and Y Many types of simulators used Event driven simulator is used popularly Simulation tool we shall use: ModelSim/inbuilt simulator ISE
A X
my_ckt
S
Module/Unit
A B Out put
Logic module
C
In puts
Full Adder
Levels of Abstraction
VHDL Programming
VHDL structure
Library
Definitions, constants
Entity
Interface
Architecture
Implementation, function
Libraries
Library ieee;
Entity
B C
Chip
Entity
entity name
entity Reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1, q2, q3 : out std_logic); end Reg4;
port type
Basic Identifiers
Can Only Use alphabetic letters ( A-Z, a-z ), or Decimal digits ( 0-9 ), or Underline character ( _ ) Must Start With Alphabetic Letter May NOT end with underline ( MyVal_ ) May NOT contain sequential underlines (My__Val)
Not case sensitive, but recommended to use always the same way. It is also recommended to use capitals for language components Examples B3,b3,ram1,ram_1,ram_1_c, MyVal. The followings are not used _Basic_gate Ram_2_ Ram__2
Concurrent operation
Q=a+ b .c <=a or (b and c) =/ a or b and c=(a+ b) .c H= a + b . c + d (not (a or (b and not c) or d)) g<=(x or y) and (z or not (w and v))
Architecture
A
Chip
E
X
Dataflow Model
The flow of data through the entity is modeled primarily using concurrent signal assignment statements. (uses statements that defines the actual flow of data.....)
The structure of the entity is not explicitly specified but it can be implicitly deduced. Architecture MYARCH of MYENT is begin SUM <= A xor B after 8ns end MYARCH;
a
entity half_adder is Port ( a : in STD_LOGIC; b : in STD_LOGIC; carry : out STD_LOGIC; sum : out STD_LOGIC); end half_adder;
sum b
XOR
architecture Behavioral of half_adder is begin sum<= a xor b; carry<= a and b; end Behavioral;
&
carry
There are two types of delay that can be applied when assigning a time/value pair into the driver of a signal Inertial Delay Transport Delay
Inertial Delay
Inertial delay models the delays often found in switching circuits. An input value must remain stable for a specified time (pulse rejection limit) before the value is allowed to propagate to the output. This is the delay due to the fact that electronic gates require a short amount of time to respond to the movement of energy within the circuit. The value appears at the output after the specified inertial-delay.
Transport Delay
This delay models pure propagation delay; ie, any change in the input (no matter how small) is transported to the output after the specified delay time period To use a transport delay model, the keyword transport must be used in a signal assignment statement Ideal delay modeling can be obtained by using this delay model, where spikes would be propagated through instead of being ignored Output<=transport (x) after 10ps;
Example of Communicating Processes - the full adder. In1 In2 c_in s1 HA HA sum
s2
OR c_out
s3
This example shows a model of a full adder constructed from 2 half-adders and a 2 input OR gate.
The behavior of the 3 components is described using processes that communicate through signals.
When there is an event on either of the input signals, process HA1 executes (see code in next slide), which creates events on internal signals s1 and s2.
library IEEE; use IEEE.std_logic_1164.all; entity full_adder is port(in1, in2, c_in: in std_ulogic; sum, c_out: out std_ulogic); end full_adder;
architecture dataflow of full_adder is signal s1, s2, s3 : std_ulogic; constant gate_delay: Time:=5 ns; begin L1: s1<=(in1 xor in2) after gate_delay; L2: s2<=(c_in and s1) after gate_delay; L3: s3<=(in1 and in2) after gate_delay; L4: sum<=(s1 xor c_in) after gate_delay; L5: c_out<=(s2 or s3) after gate_delay; end dataflow;
Architecture Body
Structural Model
Digital circuits consist of components and interconnection between them A component can in turn be composed of subcomponents and their interconnections A component interacts with other components through pins Component is modeled as entity Component pins are modeled as ports Interconnections between components are modeled as signals
Entity: Interface Architecture: Implementation, behavior, function Process: Concurrency, event controlled Configuration: Model chaining, structure, hierarchy Package: Modular design, standard solution, data types, constants Library: Compilation, object code
Chip
E X Y
--Structural Description
entity AOI_Network is port(A,B.C,D:in std_logic; C E:out std_logic); D end AOI_Network architecture structural of AOI_Network is component AND2 port(x,y:in std_logic; z:out std_logic); end component;
component or2 port(x,y:in std_logic; z:out std_logic); end component; signal X,Y:std_logic; Begin G1:AND2 port map (A,B,X); G2:AND2 port map (C,D,Y); G3:OR2 port map (X,Y,E); End structural;
Before this the module should be previously defined use library. entity AND2 is port (u,v:in std_logic; q:out std_logic); end AND2; architecture of AND2 is begin q<=u and v; end AND2; Similarly for OR2, module should be defined.
The concept of component can be understood using the concept of a design library, which is a collection of different modules, each defined by entity and architecture statement. Once cells are used in library we can use copies by component command This is called instancing the cell, and component itself is called an instance of the original.
Architecture body describes an implementation of an entity may be several per entity Behavioral architecture describes the algorithm performed by the module contains process statements, each containing sequential statements, including signal assignment statements and wait statements
library ieee; use ieee.std_logic_1164.all; entity FULL_ADDER is port (A, B, Cin : in std_logic; Sum, Cout : out std_logic); end FULL_ADDER;
architecture BEHAV_FA -- Process P2 that defines the second half adder of FULL_ADDER is and the OR -- gate signal int1, int2, int3: P2: process (int1, int2, std_logic; Cin) begin begin -- Process P1 that defines the first half adder Sum <= int1 xor Cin; P1: process (A, B) int3 <= int1 and begin Cin; int1<= A xor Cout <= int2 or B; int3; int2<= A and end process; B; end BEHAV_FA; end process;
Multiplexers
I0 I1
I2
I3
4-to-1 MUX
A B I0 A B I1 A B I2 A B I3
A 0 0 1 1
B 0 1 0 1
Z I0 I1 I2 I3
sel
x0 x1 x2 x3
OR ARRAY
AB
AC
B BC AC
AND ARRAY
F0 F1 F2 Outputs F3
THANK
YOU ALL