Now available in PDFTo tie in with the release of the GadgetFactory LogicStart Megawing (http://www.gadgetfactory.net/logicstart-megawing) I've migrated this whole project onto GitHub, and made it available in PDF form. To download the full PDF click on https://github.com/hamsternz/IntroToSpartanFPGABook/blob/master/IntroToSpartanFPGABook.pdf?raw=true Contains all that is here and more, and covers both the Digilent Basys2 and Papilio One + LogicStart development boards. I have two proofreaders working their way though it, so it should be much improved. Why learn to use FPGAs?
What I want to doI want to help hackers take the plunge, purchase an FPGA development board and get their first projects up and running. What will you learn?At the end of the modules you should have achieved the following:
This should get you well on the way to implementing your own projects. How to contact meEmail me at "nospam-hamster@snap.net.nz", after removing the "nospam-" bit. Any feedback is welcome! Course prerequisitesHere's what I think are the skills required for somebody wanting to learn to program FPGAs:
ModulesEach module has a hands-on project, with the largest similar in size to Papilio S6/Fading counter. This should allow most modules to be completed in an hour.
A good free reference bookSnag yourself a copy of "Free Range VHDL". Available at a web browser near you at http://www.freerangefactory.org/ A note to software-coder typesYour mind is presently wired to think about the flow of instructions in a process running in a memory space. It hurts to escape this! You will get horribly confused. When you get confused, the things to remember are:
And that is it - there are no loops (well, not in the sense you think of them now), no "do this then do that", there is no "flow" through the code - it is all concurrent. There is pretty much only one unit of time - a single tick of a clock signal. It can be quite freaky at times! The good thing is that as a result of this mind shift you will start thinking more 'superscalar', and the mental paradigm that you write your code in a closer match to the underlying hardware. You may find yourself changing a few small habits that will improve the quality of your code. The HDL paradigm in a Spreadsheet Size of projects that are possible to implement in an FPGAA very low end FPGA board (e.g. the XC3S100 on Digilent's BASYS2-100 http://www.digilentinc.com/Products/Detail.cfm?Prod=BASYS2) is equivalent to approximately 100,000 logic gates - or 25,000 TTL logic chips. The largest FPGA in the same product range has 16 times as many logic elements with an equivalent gate count of 1,600,000 gates. The easiest way to visualize this is to think in terms of solderless breadboards. A 40mm x 90mm breadboard can comfortably fit three 14 pin 7400 series TTL chips and associated wiring, making a small FPGA equivalent to something like a 4.0m x 7.2m array of breadboards, each populated with three TTL logic chips. This makes that large FPGA equivalent to nearly a basketball court full of breadboards! This much logic allows you to implement pretty much any design you can envisage. Why VHDL?I find that the explicitness of VHDL makes it more explainable. I'm also from outside of the USA - where VHDL seems to be the de facto standard for research and industry. I find Verilog code a bit like Perl. Sure it is quick to write but it feels very "fast an loose" - it is very hard to tell what the heck is going on. But for the size of projects in this course use whatever language you like - it is more about the underlying concept than the code. If you have any questions I can pretty much read either language. What development board am I basing a course around?Commercial FPGA boards are available from Digilent, Terasic and others, with prices from around US$80 (for a Terasic DE0-Nano) to maybe US$2,000 or more for a high end development board. For your extra money you not only get a larger and faster FPGA, but you also get RAM, Flash memory, Ethernet interface(s), Audio codecs, HDMI in/out and other goodies. The low-cost Terasic DE0-nano has too few onboard interfaces to be fun to learn on, and although the Basys2-100 has a VGA connector, PS/2 plug, LEDs and switches the FPGA is too small for anything but the most basic projects - for example it only has a 9KB of on-chip RAM. The Basys2-250 is a bit better, with 24KB of on-chip RAM - which is enough to implement a small 8 bit computer or a Text mode VGA display. The next step up is something like the Terasic DE0 or Digilent Nexys2, at around US$149, which includes a few MB of RAM and Flash and are aimed at "system on programmable chip" users. An inexpensive FPGA board is the US$50 Papilio One 250K from Gadget Factory (http://www.papilio.cc/index.php?n=Papilio.Hardware). If you are not adept with soldering you will also need something like an "Arcade Mega Wing" (http://www.papilio.cc/index.php?n=Papilio.ArcadeMegaWing) to allow plugging of standard peripherals such as a PS/2 keyboard or a VGA monitor, although a small amount of soldering may be still needed to install the headers. I've decided on the Digilent Basys2 as my reference board - it has all the items needed to have useful projects, no soldering required, and costs under $100. Also I find that the Xilinx toolset is also very friendly for first time designers. As I'm in New Zealand I ordered mine from their ANZ distributor - Black Box Consulting (http://www.blackboxconsulting.com.au/). They normally have everything in stock, so not only is it quicker than ordering from Digilent, the international shipping direct from Digilent is really, really, really high. Why is it you can get a Papilio FPGA board from Seeed Studios for $49.99 incl postage, but it costs US$36.66 to ship a $99 order from Digilent? Black Box Consulting charged a reasonable AU$10.00 for shipping. NOTE: The BASYS2's on-board oscillator is not very stable - it may pay to get something like SGR-8002DC-PCC-ND from Digikey to provide a reference clock that is stable enough to the FPGA's Digital Clock managers to reliably latch on to. This is only required if you want to use frequencies other than the 100MHz, 50MHz or 25MHz that is on the board. The part number in the reference manual is wrong - it is a SMD part! (秩名) |