Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs...
Transcript of Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs...
![Page 1: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/1.jpg)
Intro to FPGAs
October 11, 2006
![Page 2: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/2.jpg)
Programmable Logic
Implement wide variety of logic functions inone digital chip
Gates: AND, OR, NOT Storage: Flip flop, latch Switches: Mux Larger blocks: Memory, adder
![Page 3: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/3.jpg)
History
Individual chips (esp. 7400 series TTL) ROM as lookup table 1970s: PAL – one-time field programmable, dozens
of gates 1980s: GAL – reprogrammable, hundreds of gates,
CPLD – several thousand gates, FPGA – tens ofthousand gates
1990s: CPLD/FPGA get larger, FPGAs get moreflexibility/features
![Page 4: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/4.jpg)
FPGAs Now
Some one-time programmable, some re-programmable, some in-systemprogrammable
Few thousand to few million gates Few dozen to thousand I/O pins Available with variety of power profiles,
clocking schemes, RAM blocks, DSP blocks,I/O standards
![Page 5: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/5.jpg)
FPGA vs Custom Chip (ASIC)
Advantages Shorter time to market Re-program in field Low NRE costs
Disadvantages Slower Higher power Less complex designs
![Page 6: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/6.jpg)
FPGA vs Software
Advantages Faster for logic (esp. shift operations) Faster for some atypical bit lengths Good control over timing Often more pinouts
Disadvantages Slower for math Less flexible/familiar May be more expensive
![Page 7: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/7.jpg)
Getting Started with an FPGA
Pick a technology Reprogrammable? Power? Security? Speed?
Environment? Pick a manufacturer
Xilinx, Altera, Lattice, Actel Pick an evaluation board or design your own
board Pick a tool set for programming
![Page 8: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/8.jpg)
FPGA for this class
Xilinx Spartan3 XC3S1500-4FG320 1.5 Million Gates Speed: “-4” Package: Fine-pitch ball grid array, 320 pins
(221 user I/O)
![Page 9: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/9.jpg)
Opal Kelly Board: XEM3010
http://www.opalkelly.com/products/xem3010/
![Page 10: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/10.jpg)
Opal Kelly Board: XEM3010
http://www.opalkelly.com/products/xem3010/
![Page 11: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/11.jpg)
Programming an FPGA
Think hardware! Start with a block diagram Describe the circuit, not an algorithm Schematic or VHDL (or Verilog)
Schematic: more precise VHDL: faster to write/change Most people use VHDL, but keep schematic in
mind
![Page 12: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/12.jpg)
Xilinx Design Flow
http://toolbox.xilinx.com/docsan/xilinx7/help/iseguide/html/ise_fpga_design_flow_overview.htm
![Page 13: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/13.jpg)
Getting Started: Create a Project
Xilinx ISE File -> New Project
Careful! ISE doesn’t like spaces Select options for target chip
![Page 14: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/14.jpg)
Design Entry: VHDL
Create new source -> VHDL module Specify inputs and outputs (make sure
names match documentation) Use the “lightbulb” language templates for
help “Synthesis” constructs VHDL also has strong modeling ability, but
these won’t synthesize to a circuit so becareful
![Page 15: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/15.jpg)
Synthesis
Checks code syntax Analyzes design hierarchy Produces Xilinx-specific netlist Can also view produced schematic
Many advanced options, but just leave at default fornow
Read synthesis reports! Understanding anywarnings before proceeding
![Page 16: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/16.jpg)
Implementation
Translates netlists and constraints Maps the design into available resources Places and routes these resources to meet constraints Also generates timing models for more complete
simulation
*.ucf has the pin list. Add and edit the *.ucf file toreflect input and output pins before implementing.
Read the “pad report” to make sure the pins wereassigned as desired
![Page 17: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/17.jpg)
Programming File
Creates a bit stream to download to the chip Use Opal Kelly Front Panel to download this
*.bit to the FPGA
![Page 18: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/18.jpg)
Async vs Sync
Asynchronous logic progresses continuously Pipe analogy AND, OR, NOT…
Synchronous logic progresses on clockedges Valve analogy Flip flops
![Page 19: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/19.jpg)
Flip Flop
Simple storage element Input transferred to output on clock edge Output held until next clock edge Reset to known state (usually async) Clock enable signal to enable/disable
transfers
![Page 20: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/20.jpg)
Sim: Flip flops
![Page 21: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/21.jpg)
RTL Example: Flip flops
![Page 22: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/22.jpg)
VHDL Example: Flip flops
![Page 23: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/23.jpg)
Sim: Counter+1 Counting Reset
![Page 24: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/24.jpg)
RTL example: Counter
![Page 25: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/25.jpg)
VHDL Example : Counter
![Page 26: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/26.jpg)
In Class Today
Make LEDs display repeating pattern Pick pattern (suggestion: binary counting) Control whether pattern is moving or not Use speed where pattern is visible. Better yet,
make it move once per second
![Page 27: Intro to FPGAs - Johns Hopkins Universityastubble/ee/fpga.pdf · 2006. 10. 11. · Intro to FPGAs October 11, 2006. Programmable Logic ... VHDL also has strong modeling ability, but](https://reader036.fdocuments.net/reader036/viewer/2022071604/613f4a57a7a58608c268d41e/html5/thumbnails/27.jpg)
Hints
Be careful with active high/low Double-check *.ucf file Use Xilinx help as needed (lightbulb)