# Cheapest FPGAs?

How cheap do FPGAs get? I know they're more expensive than microprocessors of comparable capability, but I wonder if there exist FPGAs that could contain a Microblaze soft core running Linux, while leaving gates available for implementing DSP functionality (media codecs, for example) at a cost competitive with, say, a Cortex A8 ($20-30 in qty. ~100). (Apologies if my terminology is non-idiomatic i.e. wrong. Please comment with corrections, or edit directly.) -  (shameless plug) the GNU radio (USRP2) uses an AEMB bundled with a bunch of DSP blocks. It does software-defined radio really well -- aeste.my/node/29 – sybreon Dec 2 '10 at 1:33 @sybreon Oddly enough I'm using USRP2 on my Senior Design project -- Nice – onaclov2000 Dec 2 '10 at 13:35 ## 10 Answers I recently attended an online conference on FPGA's with the keynote being "Should your next processor be an FPGA." The FPGA basically makes sense in any application that requires highly parallelizable work streams, an example being used was analyzing Full HD images to find pedestrians for instance. The thing you have to remember is that you have to initialize your FPGA every time it powers up, I think the FPGA's Xilinx is coming with (which have an on-chip ARM core) are a good option, but probably expensive. Looking into the Actel ones with on-chip flash may be useful too. As for performance, the company BDTI did a benchmark in highly parallel computations where they saw about 40x performance gain switching to an FPGA. The interesting thing is that they compared chips with similar costs (23$ vs 28$I believe). Here are the links that might interest you: Pocket guide to processor selection FPGA Conference Archives (Free registration, but only available for about 6 months after this answer) You cannot really compare performance of FPGA based systems based on MIPS or Mhz stats. The way an FPGA is used to process certain tasks is simply too different from a Microcontroller. The design of firmware for an FPGA is something you have to do using VHDL for instance, which is akin to Assembly. A register transfer level (RTL) of abstraction. Some environments are being produced to provide more abstraction, but these are still often vendor specific. Wikipedia has a decent overview of languages available to program FPGA code: Wikipedia: Programming FPGA Wikipedia: Digital Circuit Design If you have money to burn you can use the LabView systems to build FPGA based real time measurement systems for instance. These devices needed for this are in a completely different pricerange (1500$ and up), but open up te FPGA design to a much broader audience with graphic programming.

More and more vendors are providing boards which combine microcontrollers such as an ARM chip with an FPGA to provide specific additional features and parallel processing power. An example of such products can be found here: EmbeddedARM: FPGA series

-

How cheap do FPGAs get? According to Newark, the cheapest FPGAs are around $10 (the lowest-end Altera Cyclone and lowest-end Xilinx Spartan). They might have enough capacity to run a simple 8-bit CPU. As you might expect, even simple (i.e., without a MMU) 32-bit CPUs require about 4 times the FPGA resources of an 8 bit CPU. FPGAs with barely enough resources to run such a simple 32-bit CPU cost around$14. My understanding is that uCLinux has been ported to some of these FPGA soft CPUs (such as the NIOS II/e) -- you might find uClinux adequate for your purposes.

Full-fledged Linux requires a CPU with a MMU (such as the NIOS II/f). A 32-bit CPU with a MMU requires about 4 times the FPGA resources of a 32-bit CPU without a MMU -- the reasons for this are not so obvious.

As far as I can tell from the Xilinx Microblaze page, the Microblaze soft CPU only runs on Xilinx FPGAs.

Linux has already been ported to several other soft CPUs. If you want to run Linux on some other company's FPGAs, you might want to look at the Linux ports listed at "Soft CPU Cores for FPGA".

Several of these soft CPUs -- including a MMU -- will fit on a Xilinx Spartan XC3S400A ( $17 from Avnet ). I've heard that some 32-bit soft CPUs -- including a MMU -- are pretty easy to set up as "dual core" on a$20 FPGA chip. Those that follow "Jan's Razor" might attempt to squeeze in a dozen or so 8-bit CPUs on the same chip instead.

-
 Excellent information-- thanks. – pingswept Jun 15 '10 at 12:57 There are open source Microblaze implementations (like aeMB -- opencores.org/project,aemb) that should port to other (non-Xilinx) FPGAs. – mrkj Jun 24 '10 at 15:45 (shameless plug) the AEMB is known to run uC/OS-II in Altera FPGAs too -- aeste.my/node/7 – sybreon Dec 2 '10 at 1:31

Generally FPGA will cost a lot more than the same device implemented in silicon, because there's a lot of overhead due to the reconfigurability. So no, you wont find a FPGA for $20-30 that has the same power as an ARM CPU that's$20-30. Now, you may find a FPGA for $20-30 that can perform specific tasks much faster than that$20-30 ARM, but it wont be able to beat it in general computing tasks.

This is why it's common to see people sticking a microcontroller and a FPGA on the same board. ARM and PPC are the two most commonly combined with a FPGA.

-
I understand that I won't find an FPGA that beats a micro on cost and performance, but it seems like there might exist an FPGA that beats the cost of micro + FPGA, while providing similar performance, all in one chip. Does that make sense? – pingswept May 14 '10 at 18:55

Xilinx has recently done a deal with ARM, which will enable them to put ARM cores on FPGAs. Unfortunately, they will only be available for the top-of-the-range Virtex devices.

-
Very interesting. – pingswept May 14 '10 at 18:57
I think you're mistaken about the ARM cores only appearing in Virtex devices. The press release doesn't say as much, and I don't think you can infer that from the fact that PPC cores only appear in V2P, V4FX, and V5FXT parts. Xilinx's website mentions the devices being optimized for "performance, cost, and power" (see xilinx.com/technology/roadmap/processing-platform.htm); you'll notice cost is never an optimization vector for the Virtex series. – mrkj Jun 24 '10 at 15:41
Also, ARM is never mentioned in the 7-series FPGAs announcement (xilinx.com/technology/roadmap/7-series-fpgas.htm), and there's no V6 or V7 part with a PPC. My take on all this is that they're moving away from embedded processors in the high-performance parts. – mrkj Jun 24 '10 at 15:43
I guess the result of this deal is the Zynq? – Janus Troelsen Apr 18 at 21:26

My best guess so far is something like a Xilinx XC3S400A, which costs around \$16, but I'm not sure that it could handle a MicroBlaze.

-
From a quick look online, a microblaze core would use about half of the logic cells in a XC3S400A. In addition, the Cortex A8 would run at 600MHz - 800MHz, whereas microblaze on the FPGA would run at 200MHz - 300MHz. – davr May 14 '10 at 18:03
So it would be ~3x slower (assuming your system is processor-bound), but comparable cost, while leaving excess gates for something else. – pingswept May 14 '10 at 18:56
That's just comparing frequency, the most basic way of comparing actual processing speed. I don't have enough knowledge about it, but it's possible for example that at the same clock speed, an ARM is twice as fast as a Microblaze – davr May 14 '10 at 22:00
Yeah, fair enough. A first approximation, I guess. – pingswept May 14 '10 at 22:38

When purchasing an FPGA, do not forget to factor in the cost of the Flash memory that holds the FPGA program. That's easy to forget.

As a PCB designer, FPGAs are a million times easier to lay out, because you can rearrange the pinout however you want even after the board is made. There are potential cost savings associated with the fewer layers needed to route an FPGA.

To the others who poo-poo FPGA vs. CPU performance, I agree to a certain extent. An actual processor will be faster at doing actual processor-y things than an FPGA that's programmed to act like a processor.

That's not really fair to an FPGA, though. CPUs are "time-limited"; if you want to do more work, you need more time, or a faster processor. FPGAs are usually "area-limited"; if you want to do more work, you need a bigger FPGA.

For instance, let's say you make a spectral analyzer that handles a mono audio signal. Let's say it takes 70% of CPU time, and you're already as fast as the CPU can go. You can't add stereo support, because the CPU just isn't fast enough to do the second channel before it must handle the first channel again. But if you're using 70% of the FPGA, you can just buy a bigger FPGA and drop the second channel in. It doesn't need to go faster.

Now, if you ported the problem into the Digital Design domain, using Finite State Machines and Datapaths instead of a CPU, I would bet dollars to pesos that the FPGA will crush the CPU, at the expense of increasing complexity in the design.

-
 There are also flash-based FPGAs (ACTEL) and some SRAM-based ones with built-in flash (Xilinx Spartan3AN, LatticeXP). – sybreon Dec 2 '10 at 1:37

It depends a lot on your application. The ideal application here would consist of a tiny control part (which fits on a microblaze/NIOS) but a computational part that can benefit from the huge parallelism of custom hardware. In these cases, even a modest-sized FPGA (Spartan or equivalent) can easily outperform any general-purpose CPU. But that's best-case (although very much achievable in a lot of real-world apps), if your app does have a significant control part or doesn't easily map to hardware, spending your money on fixed hardware (i.e. an ARM) is probably better.

-

FPGA pricing is odd - once you get talking to a franchised disti you find that prices quoted at Digikey, Mouser etc. can be several times higher than what they can be got for. Cheapest I'm aware of is Lattice EC1 in QFP100 for a little under GBP3 in tray qtys. Add GBP0.40 or so for an SPI flash memory.

Putting CPUs in FPGA fabric is generally not good value in terms of silicon cost, but other factors like tight coupling between CPU and FPGA, and reduced number of packages may alter the optimum tradeoff against using a seperate CPU.

-

Since many Altera's current CPLDs are FPGAs with built-in configuration memory, you can get them for http://www.altera.com/products/devices/cpld/max2/mx2-index.jsp

-

If you need a board rather than just the chip, here are two recent options from 2013:

-