Professional Documents
Culture Documents
Cours3 - Prise - en Main - Xilinx - Final
Cours3 - Prise - en Main - Xilinx - Final
RST(S9)-ENSA
GMA-S9-ENSA
GMA-S9-ENSA–KENITRA
-KENITRA 1
OUTLINE
Goal
What is FPGA ?
Domain applications of FPGAs
Leading manufacturers of FPGAs
FPGA XILINX Spartan 6
Nexys3 Board
FPGA Design Flow
Creating a new project
Adding a new VHDL source
XST Synthesis
Functional simulation with Isim
RTL Schematic (Register Transfert Level)
Assigning PINS FPGA -File UCF
Implementation of the project
Creating the configuration file with Adept
FPGA programming : JTAG Mode
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 2
1
10/11/2023
Goal
We want to program the decoder in the FPGA using Nexys3 Board
SW[0:2] Led[0:7]
0 1 2 0 1 2 3 4 5 6 7
led(0) 0 0 0 1 0 0 0 0 0 0 0
led(1) 0 0 1 0 1 0 0 0 0 0 0
Sw(0)
led(2)
0 1 0 0 0 1 0 0 0 0 0
Sw(1) Decoder led(3)
38 led(4) 0 1 1 0 0 0 1 0 0 0 0
Sw(2) led(5) 1 0 0 0 0 0 0 1 0 0 0
led(6)
led(7) 1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 3
Goal
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Decoder is
Port
(
sw : in STD_LOGIC_VECTOR (2 downto 0);
led : out STD_LOGIC_VECTOR (7 downto 0)
);
end Decoder;
architecture Behavioral of Decoder is
begin VHDL Code
led <= "00000001" when sw="000" else
"00000010" when sw="001" else
"00000100" when sw="010" else
"00001000" when sw="011" else
"00010000" when sw="100" else
"00100000" when sw="101" else
"01000000" when sw="110" else
"10000000";
end Behavioral;
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 4
2
10/11/2023
Goal
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY decoder_tb IS
END decoder_tb;
BEGIN
uut: Decoder PORT MAP (sw => sw, led => led);
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 5
Goal
stim_proc: process
begin
end process;
END;
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 6
3
10/11/2023
What is FPGA ?
FPGA
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 7
What is FPGA ?
Matériel Logiciel
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 8
4
10/11/2023
What is FPGA ?
Entrées/Sorties
technologies architectures du plan actif :
de programmation : - PAL hiérarchique (EPLD)
- EEPROM - gate-array (FPGA)
- SRAM - mixtes (CPLD ALTERAs)
- antifusible
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 9
What is FPGA ?
I/O Blocks
Multiplexer
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 10
5
10/11/2023
What is FPGA ?
ASIC Placement
spec Code+synth fab
Routage
FPGA
P
spec Code+synth Time to market
R
mP
+
spec Code
temps
logiciel
Temps de conception
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 11
What is FPGA ?
60
F clock 50
40
30
Logiciel : traitement séquentiel
20
fclock
10
f=
nb op/cycle
1 2 3 4 8 12 16 20 24 28 32 36 40 44 48 52
Nb opérations/cycle
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 12
6
10/11/2023
Medical
Automotive
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 13
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 14
7
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 15
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 16
8
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 17
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 18
9
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 19
The SLICEMs contain the carry structure and multiplexers, and add
the ability to use the LUTs as 64-bit distributed RAM and as variable-length shift registers
(maximum 32-bit)
A1
A2
A3
A4 LUT =
A5
A6
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 20
10
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 21
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 22
11
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 23
Nexys3 Board
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 24
12
10/11/2023
Nexys3 Board
Spartan 6
XC6SLX16-3 CSG324
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 25
Features
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 26
13
10/11/2023
Features
Xilinx Spartan 6 XC6SLX16-3 CSG324
Digilent Adept USB port for power, programming & data transfers
USB-UART
8-bit VGA
Power Supplies
The main regulator on the Nexys3 can accommodate input voltages up to 5.5VDC
Voltage regulator circuits from Linear Technology create the required 3.3V, 2.5V, 1 .8V, and 1.2V
supplies from the main power input
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 28
14
10/11/2023
Configuration sources
The Spartan-6 FPGA board must be configured (or programmed) in one of four ways By :
• Programming file transferred from a USB memory stick attached to the USB HID port
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 29
Requirements
Synthesize
Gate-level
Model Simulate Test Bench
Timing
Model Simulate
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 30
15
10/11/2023
RST(S9)-ENSA
GMA-S9-ENSA -KENITRA 31
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 32
16
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 33
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 34
17
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 35
• Family: Spartan6
• Device: XC6SLX16
• Package: CSG324
• Speed: -3
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 36
18
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 37
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 38
19
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 39
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 40
20
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 41
Click Next
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 42
21
10/11/2023
Click Next
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 43
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 44
22
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 45
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 46
23
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 47
XST Synthesis
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 48
24
10/11/2023
XST Synthesis
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 49
XST Synthesis
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 50
25
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 51
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 52
26
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 53
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 54
27
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 55
• Select the decoder_tb.vhd file. The Isim Simulator displays in the Processes window
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 56
28
10/11/2023
Expand the ISim Simulator if it is not already expanded by clicking the plus sign
Double click the Simulate Behavioral Model option under the ISim Simulator
The simulator will start. Once the simulation is complete the ISim application window
will open
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 57
Wave Window
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 58
29
10/11/2023
The View RTL Schematic tool is an excellent product for visualizing the circuit
that the Hardware Description Language (VHDL) creates
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 59
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 60
30
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 61
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 62
31
10/11/2023
We now need to assign FPGA pins to the switches and leds so they will
be connected to the correct ports on the board. This is done by creating
a UCF file (User Constraints File)
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 63
Expand the User Constraints process in the Processes window and double-click on the
I/O Pin Planning (Plan Ahead) - Post Synthesis.
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 64
32
10/11/2023
Plan Ahead will start and alert you to create a UCF file
Select Yes
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 65
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 66
33
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 67
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 68
34
10/11/2023
led(0)=U16
led(1)=V16
led(2)=U15
led(3)=V15
led(4)=M11
led(5)=N11
led(6)=R11
led(7)=T11
INPUTS
sw(0)=T10
sw(1)=T9
sw(2)=V9
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 69
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 70
35
10/11/2023
• Translation : merges all of the input netlists and design constraints and create a
Xilinx Native Generic Database (NGD) file
• Mapping : maps the logic defined by an NGD file into FPGA elements and create The
Native Circuit Description (NCD) file
• Placement & Routing : takes a mapped NCD file, places and routes the design, and
produces an NCD file that is used as input for bitstream generation
ISE Design suite call automatically the appropriate integrated tool for
successively perform each step
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 71
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 72
36
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 73
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 74
37
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 75
• JTAG (Joint Test Action Group) Clock when we load the FPGA through the USB
connector using the Adept Programming Software (recommended here)
• CCLK (Configuration Clock) when we generating configuration file that will be
stored on a a PROM (FLASH)
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 76
38
10/11/2023
Right-click on the Generate Programming File in the Processes window and then
select Process Properties
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 77
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 78
39
10/11/2023
If successful you should see a green check mark next to the Generate Programming
File operation
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 79
Here we want to transfer .bin or . svf file ( using decoder. Bit) , to the FPGA
device , through the USB cable using the Digilent Adept software
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 80
40
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 81
Open Digilent Adept by selecting Start All Programs Digilent Adept Adept
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 82
41
10/11/2023
Problème
Pour la version du système d’exploitation
64 bits , il fallait procéder comme suit pour
lancer la simulation à base du logiciel Isim:
Ouvrir le logiciel ISE14.3 à partir du
chemin suivant :
C:\xilinx\14,3\ise_ds\ise\bin\nt64\
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 84
42
10/11/2023
RST(S9)-ENSA
ENSA -KENITRA
-KENITRA 85
43