1
Xlinx ISE 7.1 and Spartan-3 TutorialEE3810
2
Simple 3-to-8 DecoderPart1) Starting a new project
Start the Xilinx ISE 7.1i Project Navigator:
Select File > New Projectin the opened window
3
Simple 3-to-8 Decoder
Select a project location andname. For this tutorial we willname the project “decoder”.
Click Next.
4
Simple 3-to-8 Decoder
Click Next.
Select the device family, device, package, and speed grade, as shown here:
5
Simple 3-to-8 Decoder
Click New Source.
Select VHDL Module and enter “decoder” as the file name:
Click Next.
6
Simple 3-to-8 Decoder
Specify the inputs and outputs for the decoder.We have one 3-bit input (“sel”) and one 8-bit output (“y”)
Click Next.
7
Simple 3-to-8 Decoder
In the summary window click Finish.
8
Simple 3-to-8 Decoder
Click Next.
9
Simple 3-to-8 Decoder
Click Next, because we do not want to add any other source.
10
Simple 3-to-8 Decoder
In this summary window click Finish.
11
Simple 3-to-8 Decoder
On the Project Navigator window, Click on the “decoder.vhd” tab below the summary window, or double-click on “decoder behavioral” in the top left “Sources” pane.
12
Simple 3-to-8 Decoder
Using VHDL, describe the behavior for a 3-to-8 decoder.Don’t worry about the code yet, you will learn its details soon ☺
13
Simple 3-to-8 Decoder
We want to create a UCF file, so click Yes.
Double-Click on “Assign Package Pins” in the “Processes”pane in the left of the Project Navigator window shown in slide 11.
Before we can synthesize this design we need tospecify what pins on the FPGA the inputs and outputs
are connected to.
Note: You may be asked to save the VHDL file, and your design will be checked for syntax errors (these will need to be fixed before
you can proceed).
14
Simple 3-to-8 Decoder
The PACE editor will load as seen aboveSelect “Package View” at the bottom of the right pane (this simply gives a
better view of the physical FPGA package)
15
Simple 3-to-8 Decoder
Enter the pin names for each signal in the“Design Object List” at the left as shown here:
Click File > Save followed by File > Exit.
16
Simple 3-to-8 Decoder
Note: This dialog may appear when saving the file:
Note: You may notice that the items listed in the “Processes” panehave changed. The “Processes” pane shows the actions that can berun on the file that is currently selected in the “Sources” pane. Select
the “decoder-behavioral” source to get the same actions that werepreviously shown.
17
Simple 3-to-8 Decoder
You can then view the UCF file by double-clicking “Edit Constraints (Text)” in the Project Navigator:
18
Simple 3-to-8 DecoderPart2) Generating a PROM file
How to generate a PROM file that can be written to the Platform Flashon the Spartan-3 board, so that your FPGA’s configuration is saved even
when the board is powered down.
Double-click on “Generate PROM, ACE, or JTAG File” in the “Processes” pane. You will
notice that Project Navigator will execute the steps listed above “Generate Programming File”
(Synthesis and Implement Design) and mark them with a
green checkmark as they complete.
19
Simple 3-to-8 Decoder
Select PROM File andclick Next
Enter the PROM File Name(for example, “decoder_prom”)
and click Next
20
Simple 3-to-8 Decoder
Select the appropriate PROM (which is “xcf” / “xcf02s” for this board) from the dropdown menus and click Addand click Next.
Click Next.
21
Simple 3-to-8 Decoder
Click Add File.
Select the “decoder.bit” file and click Open.
22
Simple 3-to-8 Decoder
Simply click Ok.
Click No.
23
Simple 3-to-8 Decoder
You can now click Finish.
24
Simple 3-to-8 Decoder
iMPACT will ask:Select Yes.
You should then see iMPACTreport successful file
generation:
25
Simple 3-to-8 Decoder
Before you close iMPACT, select File Save Project As…Save the configuration under a filename such as “decoder_prom.ipf”, but do not use the default filename of “decoder.ipf” (remember this filename). You
can now close iMPACT.
26
Simple 3-to-8 DecoderIn the Project Navigator, right-click on “Generate PROM, ACE, or JTAG
File” in the “Processes” pane and select “Properties”.
In the Process Properties window that opens, set the “iMPACT Project File” to the “decoder_prom.ipf” file that you saved at the end of Part 2.This will cause iMPACT to always load this configuration. To enableautomatic file generation (iMPACT will not open, but the PROM file
simply created in batch mode), turn on “Automatically Generate File”.
Click Ok to apply these settings.
Now, anytime you double-click “Generate PROM, ACE or JTAG
File”, the PROM file will beautomatically created.
27
Simple 3-to-8 DecoderPart3) Programming the board
Make sure that your JTAG cable is plugged into your PC and the board, and that the board is powered up.
Right-click on “Generate Programming File” in the
“Processes” pane and select “Properties”.
28
Simple 3-to-8 Decoder
In the “Process Properties” window that opens, select the “Startup Options” tab.
Click Ok.
29
Simple 3-to-8 DecoderDouble-click on “Configure Device (iMPACT)”. The iMPACT tool will open
and a wizard to create a new configuration will open.
Click Next.
30
Simple 3-to-8 Decoder
Click Next.
31
Simple 3-to-8 Decoder
32
Simple 3-to-8 DecoderFirst, the FPGA should be highlighted in the main window (“xc3s200”). You
should select the “decoder.bit” file:
Click Open.
33
Simple 3-to-8 DecoderThe PROM should now be highlighted in the main window (“xcf02s”).
Select the “decoder_prom.bit” file that you generatedand click Open.
34
Simple 3-to-8 DecoderYou will now be at the main iMPACT window:
Right-click on the FPGA (“xc3s200”) and select “Program”. The following dialog will appear:
35
Simple 3-to-8 Decoder
Make sure that “Verify” is not checked and click Ok.
36
Simple 3-to-8 Decoder
The FPGA will now be programmed:
And you get this message:
37
Simple 3-to-8 Decoder
Right-click on the PROM and select “Program”. The following dialog will appear:
38
Simple 3-to-8 Decoder
Make sure that “Erase Before Programming” and “Verify” are both checked. Then click Ok.
39
Simple 3-to-8 Decoder
The device will now be programmed:
And you get this message:
40
Simple 3-to-8 Decoder
You can select Yes here,
If somehow you get the following problem:
Problem: Whenever you double-click “Generate PROM, ACE, or JTAG File”, iMPACT will not show you the dialogs to create the PROM file as shown in Part 2.
Solutions: There are two workarounds to this problem: (1) delete any “*.ipf” files in the project’s directory before you try to generate a PROM file, or (2) when iMPACT opens, select File New and select “Prepare Configuration Files”, then follow the steps as described in Part 2.
41
References
http://ece.wpi.edu/~rjduck/Spartan3_Tutorial.pdf
Special thanks to James Duckworth and Hauke Daempfling for the tutorial.For more information:
Top Related