12
Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple decoder Design synthesized and loaded to board) Jim Duckworth, January 2005, WPI. (updated September 2006 by Kahraman Akdemir for version 8.1ISE) Start Xilinx Project Navigator: Select File => New Project Select a project location and project name, for example: Click Next. Copyright © 2004 R James Duckworth 1 Rev B

Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Embed Size (px)

Citation preview

Page 1: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Spartan 3 Starter Board Tutorial (Simple decoder Design synthesized and loaded to board)

Jim Duckworth, January 2005, WPI. (updated September 2006 by Kahraman Akdemir for version 8.1ISE)

Start Xilinx Project Navigator:

Select File => New Project Select a project location and project name, for example:

Click Next.

Copyright © 2004 R James Duckworth 1 Rev B

Page 2: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Select the device family, device, and package as shown below (this corresponds to the Spartan 3 device on the starter board:

Click Next:

Click New Source and enter decoder for the file name and select the VHDL module for the type of source:

Copyright © 2004 R James Duckworth 2 Rev B

Page 3: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Click Next. You can now specify the inputs and outputs for the decoder. We have one 3-bit input (sel) and one 8-bit output (y) as shown:

Click Next A summary window opens:

Copyright © 2004 R James Duckworth 3 Rev B

Page 4: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Click Finish

Click Next

We do not need to add any existing sources so click Next A final summary window is shown:

Copyright © 2004 R James Duckworth 4 Rev B

Page 5: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Click Finish Project Navigator now shows your project including a top level VHDL file for the decoder. You can close the Design Summary window shown below, and you will have the decoder.vhd file instead.

We now need to describe the behavior of the decoder using statements in the architecture body. In this example we will use a conditional signal assignment statement:

Copyright © 2004 R James Duckworth 5 Rev B

Page 6: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Before we can synthesize this design we need to specify what pins on the FPGA the inputs and outputs are connected to. There are a number of ways to do this. 1) Click on the Assign Package Pins process in the left middle window, under User

Constraints. Note: You will be asked to save the file and your design will be checked for syntax errors (these will need to be fixed before you can proceed). The tools will prompt you to create a UCF file:

Click Yes The following window opens, Under IO pins section, enter the I/O Locations.

Copyright © 2004 R James Duckworth 6 Rev B

Page 7: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

2) Or create a text file called decoder.ucf

Copyright © 2004 R James Duckworth 7 Rev B

Page 8: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

Once you have saved the UCF file, go back and select the decoder source in the top left pane. Before we can load the design into the board we need to configure the JTAG connection. Right-click on the Generate Programming File process in the process window. Select the Startup Options tab and change the FPGA Start-Up Clock to JTAG clock as shown:

Click OK. Select the Configure Device (iMPACT) under the Generate Programming File process in the process window. Make sure your board is powered up and the JTAG cable is connected.

Copyright © 2004 R James Duckworth 8 Rev B

Page 9: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

The following window will come up. In the iMPCAT window; double click on the “Boundary Scan” under the “Flows” pane.

In this window that comes up, right click and say “Initialize chain”

Copyright © 2004 R James Duckworth 9 Rev B

Page 10: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

The FPGA will be highlighted in the main window (“xc3s200”). Select the decoder.bit file for the first device (the FPGA) in the chain. Click Open

A new dialog box opens for the second device (the PROM). Click Bypass:

Right-click on the first device (the FPGA) and select Program.

Copyright © 2004 R James Duckworth 10 Rev B

Page 11: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

The Programming Properties dialog box opens. Click OK

Copyright © 2004 R James Duckworth 11 Rev B

Page 12: Spartan 3 decoder tutorial - Worcester Polytechnic …users.wpi.edu/~rjduck/Spartan 3 decoder tutorial.pdf · Spartan 3 Decoder Tutorial EE574 Spartan 3 Starter Board Tutorial (Simple

Spartan 3 Decoder Tutorial EE574

The configuration file is sent to the FPGA, after a few seconds the programming succeeded message should be displayed:

The starter board should now have your decoder design loaded – if you change SW0, SW1, and SW2 you should see the LEDs change.

Copyright © 2004 R James Duckworth 12 Rev B