You are on page 1of 37

HDL (Hardware Description Language) XILINX TOOL FLOW By SUNIL MP

SPARTAN -3 FPGA IC

XSTXilinx Synthesis Technology

ISE

Integrated Software Environment


4

Xilinx Tool Flow


Step 1
. Launch the ISE Project Navigator and create a new design project

1. Select Start All Programs Xilinx ISE 9.2i Project Navigator

2.It appears windows like this

2. In the Project Navigator, select File New Project

3. The New Project Wizard opens

4. For Project Location, use your USN file folder location For Project Name, Example---type and123 Top-Level source type-- select HDL only Click Next

5. The Device dialog will appear

Select the following options and click Next: Device Family: Spartan 3 Device: XC3S400 Package: TQ144 Speed Grade: 4 Synthesis Tool: XST (VHDL/Verilog) Simulator: ISE Simulator (VHDL/Verilog) Preferred Language: VHDL (as per users choice) 6. The Create New Source dialog will appear. You can use this dialog to create a new HDL source file by defining the module name and ports. All of the source files have been created for you in this project.

Creating a Design
file name in the File Name Test Box and click next

Step 2

1. A New Source Wizard will open. Click on VHDL Module if you are using VHDL language and specify a

2. Assign inputs and outputs of your design, Mention the input and output port name ,direction
and the width of the port and click next

3. Click next and finish to creat a module.


4. Write Behavioral Code as show in below figure in Editor library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity and_gate is Port ( a : in STD_LOGIC; b : in STD_LOGIC; y : out STD_LOGIC); end and_gate; architecture Behavioral of and_gate is begin y <= a and b; end Behavioral;.

5. Following window will appear

y <= a and b;

Write Architecture module according to your design 6. Save all 10

Synthesize the Design

Step 3

1. Select the Behavioral(and_gate.vhd) in the Sources window and synthesize the Design by Double clicking on the synthesis option

2. If the synthesis is successfully done it will show a tick mark. And it will show following message.

11

Check for RTL Schematic and Technology Schematic( Double click on that to view)

12

Synthesize Report
========================================================================= Final Report ========================================================================= Final Results RTL Top Level Output File Name : and_gate.ngr Top Level Output File Name : and_gate Output Format : NGC Optimization Goal : Speed Keep Hierarchy : NO Design Statistics # IOs :3 Cell Usage : # BELS :1 # LUT2 :1 # IO Buffers :3 # IBUF :2 # OBUF :1 =========================================================================
Device utilization summary: =========================================================================

Selected Device : 3s200tq144-4 Number of Slices: 1 out of 1920 0% Number of 4 input LUTs: 1 out of 3840 0% Number of IOs: 3 Number of bonded IOBs: 3 out of 97 3% ========================================================================= TIMING REPORT =========================================================================
Clock Information: No clock signals found in this design Asynchronous Control Signals Information: No asynchronous control signals found in this design Timing Summary: Speed Grade: -4 Minimum period: No path found Minimum input arrival time before clock: No path found Maximum output required time after clock: No path found Maximum combinational path delay: 8.957ns Timing Detail: All values displayed in nanoseconds (ns) Timing constraint: Default path analysis

13

Total number of paths / destination ports: 2 / 1 ------------------------------------------------------------------------Delay: Source: Destination: 8.957ns (Levels of Logic = 3) a (PAD) y (PAD)

Data Path: a to y Gate Cell:in->out Net

fanout Delay Delay Logical Name (Net Name)

---------------------------------------- -----------IBUF:I->O LUT2:I0->O OBUF:I->O 1 0.821 1.140 a_IBUF (a_IBUF) 1 0.551 0.801 y1 (y_OBUF) 5.644 y_OBUF (y)

---------------------------------------Total 8.957ns (7.016ns logic, 1.941ns route) (78.3% logic, 21.7% route)

========================================================================= CPU : 3.82 / 4.05 s | Elapsed : 4.00 / 4.00 s

14

Simulation
1. In order simulate, first we need to write test bench
Add New source

Step 4

Select VHDL Test Bench and give File name of any

15

2. Select the TOP design module to write Test Bench

Click Next Finish

3. The color in which green,the tool generates automatically and Color in which blue we have to give inputs of
different combinations LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.std_logic_unsigned.all; USE ieee.numeric_std.ALL; ENTITY and_test_vhd IS END and_test_vhd; ARCHITECTURE behavior OF and_test_vhd IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT and_gate PORT( a : IN std_logic; b : IN std_logic; y : OUT std_logic ); END COMPONENT; --Inputs SIGNAL a : std_logic := '0'; SIGNAL b : std_logic := '0'; --Outputs SIGNAL y : std_logic; BEGIN -- Instantiate the Unit Under Test (UUT)

16

uut: and_gate PORT MAP( a => a, b => b, y => y ); tb : PROCESS BEGIN -- Wait 100 ns for global reset to finish wait for 100 ns; -- Place stimulus here

a<='1','0' after 100 ns,'1' after 200 ns, '1' after 300 ns; b<='0','1' after 100 ns,'0' after 200 ns, '1' after 300 ns;
wait; -- will wait forever END PROCESS; END;

4. Now Select Synthesis/Implementation to Behavioral Simulation in Sources

17

5. Select Design Top Module and Check Syntax

18

6. Run Simulation by selecting Design Module Simulate Behavioral Module

7. Observe Waveforms

19

OR
1. Add New source

2. Select Test Bench Waveform

20

3. Select the TOP design module

4. Select if any Clock in a design or if not select any input(a) as a clock in a design module

21

8. Another input(b) Force in Waveform itself

9. Now Select Synthesis/Implementation to Behavioral Simulation in Sources

22

10. Save all and Select Processes

11. Check Syntax Error by selecting Design Module

23

12. Run Simulation by selecting Design Module Simulate Behavioral Module

13. Observe Waveforms

24

Testing on Hardware Kit


Procedure: Software part

Step-5

1. Click on the Project navigator icon on the desktop of your PC. Write the vhdl code, check syntax and perform the functional simulation using ISE

25

2. Click User ConstraintsAssign Package Pins to assign IO pins of the design with FPGA I/O pins.

26

3. Following Window will appear

27

HDL LAB MANUAL

SUNIL MP

UCF For gates NET "A" LOC = "p74" ; NET "B" LOC = "p76" ; NET "Y" LOC = "p84" ;

IO PINs A, B and Y

28

HDL LAB MANUAL

SUNIL MP

4. Implement the design by double clicking on the implementation tool selection Implement Design---- SKIP THIS

5. Create programming file by running Generate Programming File

29

HDL LAB MANUAL

SUNIL MP

Hardware part Use Admin Login only(in order to get install Kit Drivers) Connect the FPGA kit to the parallel port of the PC through the cable provided along with the Kit. Connect the FRC cable provided with the kit to the DIP Switch and LED Array

30

HDL LAB MANUAL

SUNIL MP

Make the connection between FRC1 of the FPGA board to the Dip switch connector of the VTU card1.

Make the connection between FRC2 of the FPGA board to the LED array connector of the VTU card1.

Connect the downloading cable and power supply to the FPGA board Then open the Xilinx iMPACT software (refer ISE flow) select the slave serial mode and select the respective BIT file and click program.

5. After Configure Device( impact). This following Window will appear

31

HDL LAB MANUAL

SUNIL MP

Bypass for Xcf02s(FPGA)

32

HDL LAB MANUAL

SUNIL MP

Load .bit file of your design for Xc3s400 (FPGA)

33

HDL LAB MANUAL

SUNIL MP

When .bit is loaded it will appear like in following window (Eg:h_ware.bit)

34

HDL LAB MANUAL

SUNIL MP

6. Click Right click on respected FPGA(xc3s400)click Program

Click ok

35

HDL LAB MANUAL

SUNIL MP

Following window will appear

7. Finally Program Succeeded Message will appear

36

HDL LAB MANUAL

SUNIL MP

37