Xilinx ISE 10.1 Tutorials
Xilinx ISE 10.1 Tutorials
Laboratory #1
Objectives
• To become familiar with using Xilinx ISE to draw schematic representations of PLD circuits
• To become familiar with using Xilinx ISE to conduct graphical waveform simulations of PLD
circuits
• To become familiar with using Xilinx ISE to write HDL representations of PLD circuits
• To become familiar with using Xilinx ISE to write HDL testbench simulations of PLD circuits
• To become familiar with downloading PLD circuits to the Nexys development board
Introduction
“There is more than one way to do it” (TIMTOWTDI, usually pronounced "Tim Toady") is a
Perl motto. The language was designed with this idea in mind, so that it "doesn't try to tell the
programmer how to program". This makes it easy to write extremely messy programs, but, as
proponents of this motto argue, it also makes it easy to write beautiful and concise ones.
The Zen of Python has a principle which is the exact opposite of TIMTOWTDI: "There should
be one—and preferably only one—obvious way to do it."1
In designing programmable logic, and in the tools used to do so, there is definitely more than one way to
do it.
1. Start ISE from the Start menu by selecting Start -> Programs -> Xilinx ISE Design Suite 10.1 ->
ISE -> Project Navigator. The ISE Project Navigator opens as shown in Figure 1. The Project
Navigator lets you manage the sources and processes in your ISE project.
1
Description reprinted from Wikipedia
EGR426 W’09 2
2. The next step is to create a new ISE project. To create a new project for this tutorial:
Select File -> New Project. The New Project Wizard appears as shown in Figure 2.
First, enter a Project Location (directory path) for the new project. Choose a location on your USB
drive since files stored on laboratory computers do not persist once the computer shuts down.
Type counter in the Project Name field. When you type counter in the Project Name field, a
counter subdirectory is created automatically in the directory path you selected.
Select Schematic in the Top-Level Source Type list, indicating that the top-level file in your
project will be a schematic rather than another type, such as HDL, EDIF or NGC/NGO. Click
Next to go to the Device Properties window
4. Click Next three times and you will reach the Project Summary window. This window gives you an
overview of your project created so far. Click on Finish and your project is created as shown in Figure
4. Verify that the project name is counter.ise (shown as the last component in the title bar of the
application). You can also verify by going to the location where you created the project and double-
clicking on the folder named counter.
5. Now you will create a top level schematic for your design. In the Sources window, right click on
xc3s500e-4fg320 and select New Source. A New Source Wizard window appears as shown in
Figure 5. Select Schematic and enter counter under file name. Make sure the “Add to project”
checkbox is checked.
6. Click Next two times followed by Finish to create the counter.sch file under the project folder.
Figure 6 shows the final layout of the project after the source file is created. If you don’t see the
schematic, you may see a Design Summary. Click on the “counter.sch” tab at the bottom of the main
design window to see the schematic.
7. The Sources window at the top-left should have the Symbols tab selected (there are 5 tabs at the
bottom of the window). From this tab, you can select schematic symbols to add to the schematic.
From the Categories listbox, select Counter. Then, from the Symbols listbox, select “cb2ce”. Move
your cursor to the main schematic window on the right and you will see a schematic symbol attached
to the cursor. Left-click to place the symbol on the schematic. Press ESCAPE to detach the symbol
from the cursor, and then press the F8 key several times to zoom in on the symbol you placed. The
result should be as shown in Figure 7.
8. To enable the counter to count, we have to tie the CLR input low, since this is an active-high
asynchronous clear input. From the Categories listbox on the left, select General, and from the
Symbols listbox select ‘gnd’. Place a ground symbol on the schematic below the connection point of
the CLR pin (look forward to Figure 8 for reference).
9. The CE clock-enable pin is active-high. To allow the counter to count, we have to tie this pin high.
From the Categories listbox, select the <-All Symbols-> choice right at the top, and type ‘vcc’ in the
Symbol Name Filter textbox (a quicker way to add symbols when you already know the name). Click
on the ‘vcc’ symbol name in the Symbols listbox and use the cursor to place a VCC symbol above the
CE pin on the schematic.
10. Press Ctrl-W to start drawing wires, then click on the connection point of the CE pin (the small
square). Draw a wire ending at the connection point of the VCC symbol. Similarly, connect the CLR
pin and GND symbol together. The result should be as shown in Figure 8.
11. Press Ctrl-G or click on the “Add I/O Marker” tool in the toolbar to start placing I/O markers (which
are connections to the outside world). Place an I/O marker directly over the connection point for the C
(clock) input. An I/O port symbol with an arbitrary name such as “XLXN_3” will appear. Press
ESCAPE and use the mouse to click and drag this I/O port symbol away from the symbol. A wire will
automatically be drawn to keep the I/O port and clock pin connected.
12. Right-click on the I/O port symbol, select Rename Port and type in the name CLK. The result should
be as shown in Figure 9.
13. Finally, add two I/O ports for the Q0 and Q1 outputs and connect them. Name the I/O ports Q0 and
Q1. This is a good time to save your work (press Ctrl-S).
14. The counter design must now be synthesized, i.e., converted to a representation that maps to actual
hardware resources on the Xilinx FPGA that you selected. To do so:
1. In the Sources window, click on the left-most Sources tab at the bottom.
2. Open the tree control beside the xc3s500e-4fg320 heading.
3. This will show the counter(counter.sch) item. Click on it.
4. Go to the Processes window below the Sources window and click on the Processes tab at the
bottom. Your screen should now appear as in Figure 10.
5. Double-click on the Synthesize-XST item. It’s OK if a yellow warning icon appears next to
this item once the process is complete.
counter is the top-level module name selected for this test bench waveform file. Click Next followed
by Finish.
2. The Initial Timing and Clock Wizard dialog opens, which allows you to create a clock stimulus for
the 2-bit counter design. Set the values in the dialog as shown in Figure 12 and then click Finish.
3. You should see a timing diagram display that looks like a logic analyzer with the filename
countersim.tbw, as shown in Figure 13. Press Ctrl-S to save the file.
4. To run the simulation, go to the Sources window at the top-left, click on the Sources tab at the bottom,
and use the drop-down listbox to switch from Implementation to Behavioral Simulation. Click on
the countersim(countersim.tbw) module name. In the Processes window below it, click on the
Processes tab, then open the Xilinx ISE Simulator tree control. Finally, double-click on the Simulate
Behavioral Model item.
5. After a surprisingly long time for such a simple circuit, the simulation results should appear in a
Simulation window, as shown in Figure 14. Verify that your circuit functions as a 2-bit counter with
Q1 as the most significant bit.
1. Close the 2-bit counter project by using the File->Close Project menu item. Now create a new project
by selecting File->New Project. In the New Project Wizard dialog, set the name for this project to
be counter_vhdl, and set the Top-Level Source Type to be HDL. The wizard should appear as in
Figure 15.
Figure 15:
Creating a new
project using
VHDL as the top-
level source
2. Click Next,
and verify
that the
Device Properties are the same as for the previous project (Spartan3E XC3S500E FG320-4 device
(or XC3S1200E device), VHDL as the preferred language, XST synthesis tool, ISE simulator).
3. Once again, right-click on the xc3s500e-4fg320 module name in the Sources window and select New
Source. The New Source Wizard dialog appears. Set the file name to be ‘counter_vhdl’ and select
the type of the module to be VHDL Module. Make sure the “Add to project” checkbox is checked.
Click Next.
4. The Define Module dialog box appears. In this dialog you will set the names of the input and output
“pins” of the circuit. Set the fields of this dialog to appear as in Figure 16 and click Next and then
Finish.
5. Back in the New Project Wizard dialog, click Next twice then Finish. After the process completes,
you should see the ‘counter_vhdl.vhd’ file, as shown in Figure 17.
7. To verify that you typed in the code correctly, perform a syntax check by clicking on the
counter_vhdl module in the Sources window, opening the Synthesize-XST tree control in the
Processes window and double-clicking on the Check Syntax item. If your code is correct, a green
checkbox will eventually appear next to this item.
8. Once the code is correct, synthesize the design by double-clicking on the Synthesize-XST tree control
in the Processes window.
9. After synthesizing the design, let’s perform a behavioral simulation of the design. Right-click on
counter_vhdl in the Sources window and select New Source. In New Source Wizard, select Test
Bench Waveform and set the File name to be ‘countersim’. Click Next and then make sure
‘counter_vhdl’ is the top level module name with which you are associating this test bench file. Click
Next followed by Finish to open Initial Timing and Clock Wizard. Make changes as shown in
Figure 19 and then click Finish.
10. Once you click on Finish, the Test bench waveform window opens as shown in Figure 20.
11. To run the simulation, switch the Sources window drop-down listbox from Implementation to
Behavioral Simulation, then click on the countersim(countersim.tbw) module (you will have to
expand the xc3s500e-4fg320 module tree control). Under the Processes window, click on the
Processes tab and expand Xilinx ISE Simulator and double-click Simulate Behavioral Model.
12. The simulator runs and opens another window which has the results of the simulation. You may need
to zoom in on the simulation by clicking on icon on the toolbar at the top of the window. Figure
21 shows the simulation output.
13. Scroll horizontally through the simulation results to verify that the circuit functions as an 8-bit
counter.
1. In the Sources window, make sure the drop-down box setting is still Behavioral Simulation. In the
Processes window, select the Processes tab and expand the Xilinx ISE Simulator tree control.
Expand the Simulate Behavioral Model tree control and double-click on the Generate Self-
Checking Test Bench item, as shown in Figure 22.
2. Note that a new entry has been added to the ‘xc3s500e-4fg320’ module in the Sources window.
Right-click on the new ‘countersim_selfcheck_beh’ item in the Sources window and select Open.
The ‘countersim_selfcheck_beh.vhd’ file is a VHDL test bench that both provides clock stimulus to
your counter and also checks the outputs. Scroll through this file for a big-picture view of what it is
doing.
3. To simulate this test bench, make sure the countersim_selfcheck_beh.vhd module is highlighted in
the Sources window. Open the Xilinx ISE Simulator tree control in the Processes window and
double-click the Simulate Behavioral Model item.
4. To verify that this test bench is capable of detecting errors, let’s change an expected result. In the
‘countersim_selfcheck_beh.vhd’ file at about line 103 (simulation time of 75ns), change the line that
reads “CHECK_ledout(“00000100”, 75)” to “CHECK_ledout(“10000100”, 75)”. Double-click on
Simulate Behavioral Model again and verify that the Transcript window at the bottom of the screen
indicates an error at 75ns.
2. Synthesize your design again by double-clicking on the Synthesize-XST item in the Processes
window (switch the drop-down list back to Implementation). On successful synthesis, you should see
a green check next to Synthesize-XST, although a yellow “caution” symbol might also appear.
3. After converting your design into a hardware representation, the next step is to assign actual device
pins to your design input/output ports through a constraint file. Select the counter_vhdl module in the
Sources window, then open up the User Constraints tree control in the Processes window.
4. Double-click on Floorplan Area / IO / Logic. Click on Yes for the dialog box that asks whether you
want to have a UCF file automatically added to your project. This process starts a separate program,
Xilinx PACE. This program allows you to assign pins to your ports.
5. In the Design Object List – I/O Pins window at the bottom-left of PACE (see Figure 24), click on
the I/O Name column to sort the pin names alphabetically. Enter the pin numbers in the LOC column
as shown in the figure.
How do you know which pins go where? Download the Nexys reference manual from Digilent.
6. Select File->Save to save the counter_vhdl.ucf file and close the Xilinx PACE application window.
After assigning the pins, you now need to convert and map your design to the logic blocks inside the
FPGA. In the Sources window, select the ‘counter_vhdl.vhd’ file and under the Processes window,
double-click on Implement Design as shown in Figure 25. On successful implementation, you should
see a yellow exclamation mark next to Implement Design.
7. Now under the Processes window, double-click on Generate Programming File to create a bit file
(the file that will be downloaded onto your hardware). You should see a green check beside it when
the process completes.
8. Now you need to open a downloading tool that will download your design onto the FPGA. Go to
Start -> Programs -> Digilent -> Adept -> ExPort to open the tool as shown in Figure 26.
9. Connect your Nexys board to the computer using the USB cable provided with the board. Make sure
that the Power Select jumper JP7 (near the top-left of the board) is configured for USB (this is the
factory-default position). Also, the Nexys board as-shipped has jumper JP9 (near the top-right of the
board) installed in the ROM position. This will cause the FPGA to execute a “program” stored in a
factory-programmed ROM. It is a good idea to run this program to make sure your board is functional.
Leave JP9 in the ROM position and turn on power to the board by sliding the main power switch
(top-left of the board) upwards. The LED display should eventually show PASS to indicate your
board is functional. Press the buttons and play with the slide switches to see what happens.
10. Slide the main power switch back down to turn off power to the board. Then, move the JP9 jumper
from the ROM to the JTAG position. Turn the power switch on again.
11. Now click on the Initialize Chain button in the Digilent ExPort window. Two devices are detected,
FPGA and ROM as shown in Figure 27.
12. Click on the FPGA graphic (not the checkbox next to it). It should turn green indicating it’s selected.
Then click on Browse and go to your design folder and select the ‘counter_vhdl.bit’ file and click
Open. A warning window appears. Click Yes and you will see the ‘counter_vhdl.bit’ file associated
with the FPGA as ahown in Figure 28.
13. Click on Program Chain and your program is downloaded to the FPGA. You should see the 8 LED’s
counting in binary at a rate of 1 Hz.
14. Once you verify that the program works, try modifying the ‘counter_vhdl.vhd’ file to achieve a faster
count rate. You may have to think and experiment a bit!
15. Once you are done, slide the power switch down to turn off the board power then disconnect the USB
cable from the computer. Close the Digilent ExPort and Xilinx ISE applications.