When it came to learning an HDL, I got in contact with several people who worked on FPGAs and learned that most of the experience people seemed to be gaining is how to navigate the development environments. Each FPGA manufacturer has their own environment that only works for their own chips and only supports their own (or partner's) JTAG controllers. Each development environment is completely different and often a design-by-committee mess to navigate, let alone use.
So I continued like most in the direction of my first purchase and messed with Xilinx ISE. I could write pages about this tool (Doesn't support spaces in installation path, 15 gigabyte install, matlab-level licensing even for the free version, on linux first command to run before you use ISE is source settings64.sh, etc.).
Above all that, my primary issue is that while the synthesizing/place-and-route (FPGA form of compiling) work on linux, in the newer versions of ISE that no longer require broken kernel drivers, they incorrectly load libusb, so you have to LD_PRELOAD the library, and even then it only seems to correctly load a third of the time.
(shameless plug time)
I don't think anyone else should have to deal with this crap. I called BS, and started a project I (for now) call "Adapt" to make a tool that runs on all POSIX systems to be able to support all FPGA chips and all JTAG controllers with an easily-extensible code base.
Do note that this project does not synthesize or route for chips, only load the bit files onto the chips. Other work is being done on that.
I am currently working on re-implementing some JTAG controller firmware so the tool can be distributed without proprietary software, and after that I will get back to the core of the project, add testing, and finish the ability to support multiple chips.
This project is very much in progress so this is just a heads up for now. However if anyone would like to contribute support for their favorite controller or chip, it would be greatly appreciated.
The only project I'm aware of that has made progress on reverse engineering the Xilinx bitstream is fpgatools:
It only works with a Spartan-6 LX9, and then only has partial support (e.g. no block RAM). I'd be interested in hearing about other projects like this if you're aware of them.
For this reason, go with Xilinx or Altera who both offer free versions of their development kits. Also, make sure that the particular part you have is supported by the free kit. Often only the smallest and simplest parts are supported.
Form a quick scan of the website, it seems that Lattice-Semi still does not offer free licenses of development tools. Years ago I bought a cheap ($99) Lattice-Semi PCIe/1G FPGA board, this board is still useless as I can't get the software without a $1000 license for the software kits. Although the board was cheap, it's nothing without the software.
Also Altera and Xilinx (I think) provides a free version of Mentor Graphics simulation tool ModelSim that supports up to moderate size designs.
Has anyone made a similar comparative study of my biggest gripe with FPGAs: the quality of the (more or less mandatory) development software? In my experience, it's pretty horrendously terrible :(
Sadly I don't have much time to use them from day to day any more, but still help people out when they email.
The comparison of development environments is a great idea which I'll definitely work on! They have a baffling range of paid editions with different featured and it's difficult to know what they all mean and why you'd want them. Thanks for the idea :)
Weeeell debugging is difficult by nature. No such thing as code stepping, all you can really do is examine waveforms.
If you want to interface with the real world it is great to get something where the analog part is done well. All the low level stuff already works.
Yet with all these mentions here I fear that I may become unemployable as a software developer if I don't keep up.
I can think of a few uses for FPGA:
* Pedagogical. When I was an undergrad, I took a computer architecture course. We wired up a simple computer with breadboards and discrete logic. The computer was microcoded to execute a variant of a modern ISA. The computer was useless and slow, but you learned a lot about computer architecture. I think this exercises is properly done with FPGAs these days.
* High-speed VLSI design simulation. You can simulate large designs at partial speed in circuit with FPGAs before you fab. I have no personal experience with this, but I'm guessing big chip design companies like Intel buy a lot of FPGAs for this purpose.
* Interfacing to high-speed data interfaces. Say you're building a hardware board with SATA, HDMI, or a high-speed ADC, but the microprocessor on your board doesn't support that interface natively. You can use an FPGA to connect that interface to the rest of the system.
For example, bunnie's Novena laptop has an FPGA with a high-speed IO connector. He has connected this to a high-speed DAC to create a homemade oscilloscope.
* High-speed DSP. Modern FPGAs have distributed DSP blocks. For example, the Xilinx Artix-7 100T can do nearly 1TMAC/s. So if you want to do video or audio processing, an FPGA might be a good solution.
I briefly looked into building a board to combine two video streams into one with barrel distortion for the Oculus Rift. An FPGA is perfect for an application like this.
Actually an interesting arch for me would be small FPGAs together w/ an ARM system, where the FPGA would handle the fast interrupts, buffering things, and communicate w/ the processor when its ready.
What kinds of things can you really do better/faster/cheaper on an FPGA vs, say, STM32 F4 series?
You know how you start a microcontroller project with a "dream shopping list" of timers, I/O devices, memory, whatever features, then all the mfgrs have a giant table you scroll thru and then you trade off, "well, I need at least 3 SPI and 128K of ram, but they don't sell 128K ram with 3 SPI I need to buy a 192K to get my 3 hardware SPI, of course I could do two in hardware and bit-bang in software the 3rd...". Or even worse "I need at least three hardware PWM timers although they only need to be 24 bit, but the entire F4 series has exactly two 32 bit timers, oh knoes what am I going to do?" Even worse as the project changes over time.
With a FPGA you skip all that garbage and just synthesize in what you need. Oh I need 3 PWM timers, well, include three of them, no big deal. Wanna HDMI, if you can wire it in, you're good.
Ideally you'd put the "boring" parts of your software in the FPGA I/O device. If you're building a thermostat, why write the state machine in assembly or C, just use some mag comps and timers. Put the UI in the softcore processor.
If you're doin' it right, your UI soft processor need run no faster than a human, say 100 KHz clock speed. How fast can a human being hit a hardware debounced up arrow and read the LCD? If you're doing it wrong, you've got a softcore processor running multiply-add in software at 80 MHz and wishing for higher CPU performance.
There was an era of a couple decades which ends with FPGAs where its cheaper to throw in software than hardware, even throw in multiple microcontrollers. Why put in hardware schmidt trigger gates and resistors/caps to hardware debounce a switch if you can write 10 lines of code to do it in software? The hardware of the future will be a FPGA with exactly what you need and a very smart/advanced peripheral library. Why write 10 lines of buggy code to soft debounce a switch when you can just include some FPGA library code to get a perfect debounce with no race conditions or interrupt collision problems in the software, its just perfect.
The Parallella board contains one I believe (http://www.parallella.org/)
Very similar to Zynq but from altera rather than xilinx
Talking about ASICs, I'm surprised no one mentioned how the public heard of FPGAs in the last few years: bitcoin mining.
Basically if you need to interface with any digital hardware that isn't natively supported by your microcontroller/CPU/DSP, you'll probably want an FPGA to do it unless you have enough resources to write a bit-banged interface in the micro.
This wiki is a great resource for setting up a fpga tool chain on Xilinx.
Naturally I say my only goal is learning, but... I wouldn't mind finding a development board that's small and cheap enough that it could be pushed into small run production as a component in a pinch.
Give up on free tools...
You can check it out, it's in portuguese but the figures/names/prices are in english/dollars.
FPGAs should be used more often then they are. If you are doing a lot of things (or can do) in parallel, that's what you want a FPGA for.
So you are in a quandary about which of several PLL designs to implement. Its not 1990 anymore, you've probably got space on the chip to put them all in, and select which operates in real time using the switches. Then you wire up your spectrum analyzer or scope or whatever exotic test gear you require, fire it up, and instantly flip between implementations while its running. You figured it out in theory, now in practice which one actually has the fastest lock up, or the lowest noise performance, or the least noise spurs at critical freqs? Just flip the switches and find out.
And on the LED side, there's a lot of testing patterns that boil down to "and when the state machine hits this state, aside from entering state 8, it also fires the LED on a little timer" Again hook up all your real world hardware and see what happens.
True, you could implement a VGA display and PS/2 keyboard without much hardware work, but then you have to drive them probably with an embedded processor, a little picoblaze or whatever running the UI... and all that screwing around to basically re-implement LEDs and switches, just slower and harder to do.
There are in circuit analysis tools, some of them pretty cool, and some of them are actually reliable, but fundamentally you're always going to find some LEDs and switches, its just too easy and convenient.
There is also the "hello world" test proving your hardware and dev system aren't screwed up, everyone has their personal favorite, what I always use is a simple 3-input switch / 2 output LED full adder.
I've also been known to do things like output the version number of my project on the LEDs. Hey, they're just sitting there and everyone who's actually done labwork has had the amusing experience of thinking they're testing version 12 but finding out they uploaded version 11 or whatever.
Finally when the analog / hardware side isn't ready, if theres no timeouts and its a strict state machine, I've been known to flip switches as inputs, many millions of times slower than the real hardware works. Hand toggling switches to talk to an I2C slave or SPI is a little tedious, but sometimes the best option. Once you get past layer 2/3 type problems there's higher level protocol tools, some are even cheap like the "bus pirate" or you can send $375K to Agilent for slightly more advanced test equipment.
Should I go ahead and get the DE1-SoC since I already have experience with Quartus II or should I go for one of the Spartans (which I know nothing about). If I go with Altera is a DE2 worth the investment (it's 2x the price)?
The article appears a little outdated because I bought this board last year as a student for $69.
Tragically -- as is the case with FPGAs -- the development environment only runs on Windows.
I really think these companies are missing out on a large market segment of software developers who are increasingly interested in hardware, but who work exclusively on Linux or OSX.
There is a lot of good information if you dig through the archive, but no big 'real world' projects to share yet.
For example, here is a crash course in FPGAs: