The entity of system A would define the ports needed to interface with the external world. Since system A is composed of systems B, C, and D, its entity would define ports for communicating with each of those internal systems. It would not need to specify the internal details of how systems B, C, and D are implemented.The entity for system A may look something like:entity system_A is port( clk_B : in std_logic; data_B : in std_logic_vector(7 downto 0); ack_B : out std_logic; clk_C : in std_logic; data_C : out std_logic_vector(15
Similaire à The entity of system A would define the ports needed to interface with the external world. Since system A is composed of systems B, C, and D, its entity would define ports for communicating with each of those internal systems. It would not need to specify the internal details of how systems B, C, and D are implemented.The entity for system A may look something like:entity system_A is port( clk_B : in std_logic; data_B : in std_logic_vector(7 downto 0); ack_B : out std_logic; clk_C : in std_logic; data_C : out std_logic_vector(15
Digital VLSI Design and FPGA ImplementationAmber Bhaumik
Similaire à The entity of system A would define the ports needed to interface with the external world. Since system A is composed of systems B, C, and D, its entity would define ports for communicating with each of those internal systems. It would not need to specify the internal details of how systems B, C, and D are implemented.The entity for system A may look something like:entity system_A is port( clk_B : in std_logic; data_B : in std_logic_vector(7 downto 0); ack_B : out std_logic; clk_C : in std_logic; data_C : out std_logic_vector(15 (20)
The entity of system A would define the ports needed to interface with the external world. Since system A is composed of systems B, C, and D, its entity would define ports for communicating with each of those internal systems. It would not need to specify the internal details of how systems B, C, and D are implemented.The entity for system A may look something like:entity system_A is port( clk_B : in std_logic; data_B : in std_logic_vector(7 downto 0); ack_B : out std_logic; clk_C : in std_logic; data_C : out std_logic_vector(15
1. http://www.bized.co.uk
Session 1
Prepared by
Alaa Salah Shehata
Mahmoud A. M. Abd El Latif
Mohamed Mohamed Tala’t
Mohamed Salah Mahmoud
Version 02 – October 2011
Copyright 2006 – Biz/ed
2. http://www.bized.co.uk
Contents -Introduction to VHDL
- ASIC & FPGA Design flow
1
-How to read and write VHDL code
- Library and package
- Entity
- Basic data types
- Architecture
- Demo no. 1
Using Xilinx and Modelsim tools
2
Copyright 2006 – Biz/ed
4. Session 1
http://www.bized.co.uk
Designing with Boolean Equations
Boolean equations are impractical for large design containing hundreds of flip flops
because it could result in a huge number of logical equations.
X= A.B
4
Copyright 2006 – Biz/ed
5. Session 1
http://www.bized.co.uk
Schematic based design
-Schematic based design expanded the
capabilities of Boolean equations.
-The major drawback of traditional design
methods is the manual translation of design
description into a set of logical equations.
-This step can be entirely eliminated with
hardware description languages (HDLs).
5
Copyright 2006 – Biz/ed
6. Session 1
http://www.bized.co.uk
Hardware Description Language [HDL]
Question:
How do we know that we have not made a mistake when
we manually draw a schematic and connect components
to implement a function?
Answer:
By describing the design in a high-level [such as (c,
basic…)] language, we can simulate our design before
we manufacture it. This allows us to catch design errors,
i.e., that the design does not work as we thought it would.
• Simulation guarantees that the design behaves as it
should.
HDL is short for Hardware Description Language
6
Copyright 2006 – Biz/ed
7. Session 1
http://www.bized.co.uk
What is VHDL ?
-Very high speed integrated circuit Hardware Description Language
-Early 1980s : It was developed by the U.S. Department of Defense
-1987 : IEEE Std 1076 - 87
-1993 : Added some new features and became IEEE Std 1076 – 93
-1999 : An extension to the language called VHDL – AMS
Analog Mixed Signal extension
-2008: IEEE Std 1076 – 2008 (New features)
7
Copyright 2006 – Biz/ed
9. Session 1
http://www.bized.co.uk
Specifications
ASIC and FPGA Design Flow
System Level
Design
Function
RTL Description
Verification
Gate Level
Synthesis
Simulation
Place
&Route
Fabrication Configuration
ASIC FPGA
9
Copyright 2006 – Biz/ed
10. Session 1
http://www.bized.co.uk
ASIC and FPGA Design Flow
Specification is an set of requirements before designing the system
RTL Description Register-Transfer Level (RTL)
Function Verification Does this proposed design do what is intended?
Synthesis Convert RTL description into a H/W.
Placement Deciding where to place all electronic components.
Routing Wiring the placed components
This last two steps depend on the rules and limitations of the manufacturing process.
10
Copyright 2006 – Biz/ed
11. Session 1
http://www.bized.co.uk
VHDL Language Scope
There is two types of tools
that deal with VHDL
-Simulation
to test the logic design using simulation
models ―All Language syntax used‘‘
-Synthesis
to convert codes to hardware
―pare of Language syntax used‖
11
Copyright 2006 – Biz/ed
12. Session 1
http://www.bized.co.uk
How to read
VHDL code
12
Copyright 2006 – Biz/ed
13. Session 1
http://www.bized.co.uk
Library and Package
The first lines that you will find at the top of any project
Library and Packages define special types used in the code;
13
Copyright 2006 – Biz/ed
14. Session 1
http://www.bized.co.uk
Design Units
There are two types of design units in VHDL
–Primary
Not dependent upon other design units
Entity (Interface)
?
How the system will communicate with the outside world
–Secondary
Depends on primary design unit
Architecture (Function )
–What the system should do ?
-No secondary can exist as stand-alone—without the primary
-Whenever the primary design unit changes, the secondary design must be
reanalyzed
14
Copyright 2006 – Biz/ed
15. Session 1
http://www.bized.co.uk
Entity
Define ports (inputs and outputs) of the module
i.e the interface of the block
Entity declaration
entity <entity_name> is
port (
<port_name> : <mode> <type>;
<port_name> : <mode> <type>;
…
<port_name> : <mode> <type>
);
End <entity_name> ;
15
Copyright 2006 – Biz/ed
16. Session 1
http://www.bized.co.uk
Entity
- <entity_name> Define the port name
- VHDL is case Insensitive ----- Important Note
- Don‘t start the port name or entity name of the port with Underscore _ or number
- <mode> Define the port direction
IN : Only read from it
OUT : Only write on it
INOUT : read from or write on it (controlled by another signal)
- <type> Define the port data type
--------------------------------------------------------------------------------------------
- Last port has no semicolon ;
- Line Comments started by - -
- Comma , can separate ports with the same type and mode
- A,b : in bit ;
16
Copyright 2006 – Biz/ed
17. Session 1
http://www.bized.co.uk
Question
System A is composed of system B,C and D.
Determine the entity of system A?
17
Copyright 2006 – Biz/ed
18. Session 1
http://www.bized.co.uk
• Entity of 2-input AND Gate
A
C
B AND Gate
Example
1
18
Copyright 2006 – Biz/ed
19. Session 1
http://www.bized.co.uk
Entity of 2-input AND Gate A
C
B AND_GATE
ENTITY AND_GATE IS
port ( a : in BIT;
b : in BIT;
C : out BIT
); -- inputs and outputs of the entity
END ENTITY AND_GATE ;
Important Note
to make a comment in VHDL you can put (--) before any line you need it to be a
comment.
19
Copyright 2006 – Biz/ed
20. Session 1
http://www.bized.co.uk
Basic data types
VHDL is strongly typed
BIT STD_LOGIC
0 1 0 1 H L U
Default X W Z - Default
value value
BIT_VECTOR : STD_LOGIC_VECTOR :
1D-array each element of the BIT type 1D-array each element of the STD_LOGIC type
Example: Example:
a : in BIT; a : in STD_LOGIC;
b : in BIT_VECTOR (3 downto 0); b : in STD_LOGIC_VECTOR(3 downto 0);
c : in BIT_VECTOR (0 to 3); c : in STD_LOGIC_VECTOR(0 to 3);
20
Copyright 2006 – Biz/ed
21. Session 1
http://www.bized.co.uk
Basic data types
X Z 0 1 U
Unknown High Strong Strong Unitialized
Impedance Zero One Default value
W - H L
Weak Don‘t Weak Weak
Unknown care One Zero
To define std_logic data type
LIBRARY ieee;
USE ieee.std_logic_1164 .all;
21
Copyright 2006 – Biz/ed
22. Session 1
http://www.bized.co.uk
• Entity of 2-input AND Gate
using STD_LOGIC type
A
C
B AND Gate
Example
2
22
Copyright 2006 – Biz/ed
23. Session 1
http://www.bized.co.uk
Entity of 2-input AND Gate using STD_LOGIC type
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY AND_GATE IS
port ( a : in STD_LOGIC;
b : in STD_LOGIC;
C : out STD_LOGIC
);
END ENTITY AND_GATE ;
A
C
B AND_GATE
23
Copyright 2006 – Biz/ed
24. Session 1
http://www.bized.co.uk
Architecture
Describe the operation (relations between inputs and outputs) of the module
i.e the Body of the block
Architecture declaration
architecture <arch_name> of <entity_name> is
-- architecture declarations
begin
-- architecture body
end <arch_name> ;
24
Copyright 2006 – Biz/ed
25. Session 1
http://www.bized.co.uk
Architecture
Non-Blocking assignment <=
c <= a and b ;
Note
-the LHS Outputs only as we write on it
-the RHS Inputs only as we read from it
and make operations on it
To assign a value in std_logic or bit type
c <= „0‟; or c <= „1‟;
To assign a value in std_logic_vector or bit_vector type
c <= “10……1001”;
25
Copyright 2006 – Biz/ed
26. Session 1
http://www.bized.co.uk
• 2-input AND Gate
A
C
B AND Gate
Example
3
26
Copyright 2006 – Biz/ed
27. Session 1
http://www.bized.co.uk
2-input AND Gate
LIBRARY ieee;
A
C
USE ieee.std_logic_1164.all;
B AND_GATE
ENTITY AND_GATE IS
port ( a : in std_logic;
b : in std_logic;
C : out std_logic
); -- inputs and outputs of the entity
END ENTITY AND_GATE ;
ARCHITECTURE behave OF AND_GATE IS
BEGIN
c <= a and b; --non blocking assignment
END ARCHITECTURE behave;
27
Copyright 2006 – Biz/ed
28. Session 1
http://www.bized.co.uk
• N-bits AND Gate
A
C
B AND Gate
Example
4
28
Copyright 2006 – Biz/ed
29. Session 1
http://www.bized.co.uk
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all; Libraries & Packages headers
ENTITY and_gate IS
port ( A : in std_logic_vector (3 downto 0);
B : in std_logic_vector (3 downto 0);
Interface definition
C : out std_logic_vector (3 downto 0)
(input/output ports)
);
END ENTITY and_gate ;
ARCHITECTURE behave OF and_gate IS
BEGIN
c<= a and b; Functional/behavioral
END ARCHITECTURE behave; Implementation
Important Note
If we need to use a specific bit in vector C,A or B
If we want to put ‗1‘ onsode 2nd bit in vector C then we say C(1)
ex : c(2) <= ‗1‘;
29
Copyright 2006 – Biz/ed
30. Session 1
http://www.bized.co.uk
Using Xilinx and Modelsim tools
30
Copyright 2006 – Biz/ed
31. Session 1
http://www.bized.co.uk
Writing code that describe the Entity and Architecture of 2-XOR Gate of 2 bit width,
Simulating it on Modelsim and using Xilinx ISE synthesis tool.
2
A
2
XOR C
2
B
31
Copyright 2006 – Biz/ed
32. Session 1
http://www.bized.co.uk
Assignment
Session-1
Read Session-1 Notes carefully to be ready
for the next session‘s QUIZ
32
Copyright 2006 – Biz/ed
33. Session 1
http://www.bized.co.uk
Download Session 1 material
Introduction to the course.pdf
Session 1.pdf
Demo 1.txt
Ask for the material through mail
start.courses@gmail.com
Facebook group
start.group@groups.facebook.com
33
Copyright 2006 – Biz/ed