IIT Bombay
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
Logic Simulation- Part II Elements of VHDL
CDEEP Autumn 2009
Presented by- Anil Powai Labs Tech. Pvt. Ltd.
IIT Bombay CDEEP Autumn 2009 Logic Simulation- Part II Elements - - PowerPoint PPT Presentation
IIT Bombay CDEEP Autumn 2009 Logic Simulation- Part II Elements of VHDL Presented by- Anil Powai Labs Tech. Pvt. Ltd. EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini IIT Bombay A Brief History Of
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
CDEEP Autumn 2009
Presented by- Anil Powai Labs Tech. Pvt. Ltd.
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
Hardware Description Language
80's
documentation, simulation and ease of maintenance.
updated standard, IEEE 1164 was adopted in 1993. In 1996 IEEE 1076.3 became a VHDL synthesis standard.
description, simulation and synthesis.
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
– A design’s interface signals to the external circuitry.
– Describes a design’s behavior and functionality.
– Binds an entity to an architecture when there are multiple architectures for a single entity.
– Contains frequently used declarations, constants, functions, procedures, user data types and components.
– Consists of all the compiled design units like entities, architectures, packages and configurations
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
library IEEE; use IEEE.std_logic_1164.all; entity xor_gate is generic (p_delay : time:= 2 ns); port (ip1 : in std_logic; ip2 : in std_logic;
); end xor_gate; entity - defines the Interface.
XOR gate
Mode of the port :Direction of flow. Entity name –> xor_gate Port name –> ip1, ip2, op1 Port type –> std_logic
Syntax entity entity_name is [generic generic_name : data_type [:= initial value ]] [port port_name : port_direction data_type] [declarations] [begin statements] end entity_name;
Generic : for passing parameter
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini library IEEE; use IEEE.std_logic_1164.all; entity xor_gate is
generic (p_delay : time:= 2 ns);
port (ip1 : in std_logic; ip2 : in std_logic;
); end xor_gate;
Mode of the port : It can be in, out or inout Std_logic is the type of the port. It is defined in the std_logic_1164 package (present in IEEE library) std_logic can take 9 different values. ‘0’ , ’1’ , ’L’ , ’H’ , ’Z’ , ’U’ , ’X’ , ’W’ , ’-’
Type ‘time’ is defined in package STANDARD in library STD which need not to be declare Before accessing any unit in a library it needs to be declared . STD and WORK need not be declared . Library syntax is :- library library_name ; use library_name.package_name.item_name ; components declared inside a library can be accessed by the ‘USE’ statement
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
library IEEE; use IEEE.std_logic_1164.all; entity xor_gate is generic (p_delay : time:= 2 ns); port (ip1 : in std_logic; ip2 : in std_logic;
); end xor_gate; architecture xor_gate_beh of xor_gate is begin
end xor_gate_beh;
The architecture describes the
(for structural design)
‘xor’ is function defined in std_logic_1164 package.
architecture architecture_name of entity_name is [declarations] begin [statements] end [ architecture_name ];
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
architecture xor_gate_beh1 of xor_gate is signal temp1 : std_logic; signal temp2 : std_logic; begin temp1 <= ip1 and (not ip2) after p_delay ; temp2 <= ip2 and (not ip1) after p_delay;
end xor_gate_beh1;
One more architecture for entity ‘xor_gate’ using internal signals
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
configuration xor_gate_C of xor_gate is for xor_gate_beh end for; end xor_gate_C; configuration xor_gate_C1 of xor_gate is for xor_gate_beh1 end for; end xor_gate_C1; A configuration statement selects one
entity. Components within architectures can also be chosen. Unless specified, the last compiled architecture is used for simulation
configuration configuration_name of entity_name is for architecture_name for instance_name:component_name use entity library_name.entity_name(architecture_name); end for; end for; end configuration_name;
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini To test a circuit we will design another circuit (test bench) which will generate the signals required to test our circuit. This new circuit is also described in VHDL.
ip1 ip2
1 XOR_GATE
XOR_GATE_TS T
Test Benches should be as simple as possible
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
XOR_GATE
XOR_GATE_TST Test process
ip1_s ip2_s
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
entity xor_gate_tst is generic (p_delay_top : time:= 4 ns); end xor_gate_tst; architecture xor_gate_tst_A of xor_gate_tst is component xor_gate generic (p_delay : time:= 2 ns); port (ip1 : in std_logic; ip2 : in std_logic;
end component; signal ip1_s, ip2_s, op1_s : std_logic; begin U1: xor_gate generic map (p_delay => P_delay_top) port map( ip1 => ip1_s, ip2 => ip2_s,
........ end xor_gate_tst_A;
XOR_GATE
XOR_GATE_TST
Test process ip1_s ip2_s
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini
Perry.
EE705/707 Lecture No. 19 Prof. Maryam Shojaei Baghini