FPGAs: What are they? - Page 1
Forum section: electronics / general

author: FenderBender
author_rank: Super Contributor
timestamp: November 09, 2011, 03:13:27 am
content: I hear a lot of talk about FPGAs around EE communities, but I don't really understand them. At first, I thought they were simply just faster MCUs, like an ARM chip or an ATMega, But now I learn that they are a bit different.So this is my completely dumb-ified understanding...FPGAs can be 'programmed' to an extent where the physical silicon is modified to adapt to the application instead of simply a code being read off of RAM or flash. I also know that they are pretty pricey.If I'm understanding them right, you use FPGAs when designingotherintegrated circuits. But I'm pretty sure we've seen FPGAs in production products like o-scopes, right?ASICs are essentially custom chips, right? FPGAs can be programmed to act like ASICs but without actually having to produce the chips themselves? So I guess you really have to know what you are doing to mess around with FPGAs?Just confused. I might sound like a complete idiot, and thats because I am.Thanks for any input.

author: amspire
author_rank: Super Contributor
timestamp: November 09, 2011, 04:18:20 am
content: Sounds like you have got it right.ASIC is a general term for a custom IC made for one specific purpose (often just for one board design), but in practice, most ASICS are built from uncommitted gate arrays. This is basically lots of simple logic gates with no interconnections.Once the customer has a design, the fabricator has to make photographic masks for the conductive layers, and then they complete the chips with the customers interconnects. It was an expensive and fairly slow process, especially when you got the first batch chips back, and started to find bugs.If the quantity is big enough, it can still be the cheapest solution.FPGA is programmable and use various methods to store the design. Some FPGA's are reprogrammable, and some are one time programmable. So minutes after the design is finished, you can have a programmed chip. Much more convenient and cheap during the design stage, and it works out economically for small to medium production runs.You are right in that if you were designing for a big production run today, you might first get the design working using FPGAs, and when everyone is happy, take the same design files and convert it to an ASIC design.Richard

author: sub
author_rank: Regular Contributor
timestamp: November 09, 2011, 04:22:49 am
content: They have logic blocks and interconnection networks that can be configured. Each logic block will have one or more lookup-tables (LUTs) that can implement any function of some number of input bits, as well as a few flip-flops. Seehttp://en.wikipedia.org/wiki/FPGA#Architecture.As well as those building blocks, FPGAs will include multipliers, blocks of RAM, DSP slices, serial transceivers, etc. They also tend to have much more IO than a microcontroller (this is aided by the level of parallelism). The result of this is that you can chuck down three processors, each with their own custom instructions, one connected to a PCIe transceiver, another to an ethernet controller, with the other having with six SPI I/Os. Long story short: lots of IO, lots of configurability, and everything runs in parallel.FPGAs tend to be slower than implementing the same functionality with an ASIC, but the capital costs are extremely high for the latter, and they cannot be reconfigured if there is a problem. FPGAs are thus used in production. They're not all that expensive---the low-end is less than $10 single unit.They are normally programmed in Verilog or VHDL if you want to experiment in simulation.

author: wd5gnr
author_rank: Regular Contributor
timestamp: November 09, 2011, 12:33:38 pm
content: I really enjoy FPGA development and I've even done two complete CPUs in FPGA more or less just for the experience of doing it.I just started a series about Verilog:http://drdobbs.com/blogs/embedded-systems/231901934I think this is week 2 out of 5 or 6 (depending on the US holiday).

author: deephaven
author_rank: Frequent Contributor
timestamp: November 09, 2011, 04:31:07 pm
content: The truly wonderful thing about FPGAs is that you can 'add hardware' after a design is done without having to get new PCBs made. I've added many features to my designs purely by adding more stuff to the FPGA. There are also some great simulators so you can try out a lot of the design before getting a board made. If you don't like the thought of learning VHDL or similar, you can just enter the design as a schematic, adding counters, adders and many other functions, and it will look just like you have made it out of seperate chips.Making a CPU out of one is something I haven't tried, but that sounds way cool. Imagine having an instruction set that is your own!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 09, 2011, 06:14:18 pm
content: A few quick comparison between FPGAs and MCUs for those only familar with the latter.MCUs can only do one thing at a time - they can give the illusion of multitasking via interrupts but can only execute one instruction at any one time.An FPGA is just a big bunch of logic gates, that can do multiple things simultaneously, using dfferent parts of the device. These parts can be completely independent or interconnected.You can if you want create one or more processors within an FPGA, although this is generally more expensive in terms of silicon area than a dedicated CPU chip, but it can be useful sometimes. A few FPGAs have hard-coded CPUs on-chip.FPGAs generally have lots of pins, the minimum is generally 100, the maximum a couple of thousand in big hairy BGA packages. FPGAs do not come in DIL packages!FPGAs generally support a wide range of I/O voltages and standards, including differential standards like LVDS, typically used for >100MHz signals.FPGAs are typically programmed using VHDL and Verilog. These are NOT programming languages, but hardware description languages, which describe how things are connected together.For example in C a=b; generates code to copy the value of b to a. In VHDL a<=b; tells it to physically connect signal b to signal a.Designing with FPGAs is done at a much lower level than MCUs. You need to work out how to design the logic to achieve the functionality you want. The software will abstract some of this to a higher level, for example creating adders, counters etc from syntax similar to arithmatic, and creating state machines from a collection of If/then or Case type constructs.An MCU will always run any program you give it as long as the clock rate is within the datasheet specs.With FPGAs, the internal timings depend on the logic of your design, and how it is physically routed on the chip, so you have to tell it what speed things need to run at, and the tools will attempt to arrange the logic to achieve this, and will tell you if it can't. In practice if you are nowhere near the performance limits of the chip you may not need to worry too much about the details of this, but if you are pushing things in terms of speed and/or high utilisation of the chip, it can get very involved indeed, and can mean hand-placing and routing critical parts of the design.In terms of the development process, FPGAs are typically SRAM based, and use an external configuration memory to hold the design data, which is loaded automatically at power-up - these days this is typically a cheap SPI flash chip. There are a few FPGAs with onboard nonvolatile memory, but these are generally more expensive.Programming is done via a JTAG interface - these are generally manufacturer-specific, but clones of most of the common ones are available cheap on ebay.While developing you typically download the code direct to SRAM, as this is faster than programming the flash. To make the design load on power-up, you program it into the external configuration device - this can typically be done via the same JTAG port.Why/when to use an FPGA?Basically when a microcontroller isn't up to the job, either due to lack of speed (either overall throughput or realtime latency), or the need to handle multiple tasks simultaneously. Also if you need large numbers of IO pins, or multiple IO standards, an FPGA may be preferable to an MCU.For tasks where a microcontroller could do the job, you wouldn't normally use an FPGA, as in most cases the design process is a lot more work.

author: Neilm
author_rank: Super Contributor
timestamp: November 09, 2011, 07:09:19 pm
content: One thing that has not been mentioned so far is that FPGAs can be reprogrammed - not just once but actually during use.For example, imagine you had an FPGA on a PCB that was doing task A. At some point, task A comes to an end - then the FPGA can be reprogrammed to start to do task B. You have just changed the functionality of the PCB with it still connected in the system and possibly doing other things.YoursNeil

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 09, 2011, 09:07:58 pm
content: Quote from: Neilm on November 09, 2011, 07:09:19 pmDoes any FPGA manufacturer actually support partial reconfiguration - ISTR them talking about it for a long time, but get the impression that although theoretically possible, it's too hard to do in practice.There are FPGAs that can have multiple images stored in flash and initiate a reload of a new image under its own control, but this is a complete reprogram.

author: Neilm
author_rank: Super Contributor
timestamp: November 09, 2011, 09:58:51 pm
content: Quote from: mikeselectricstuff on November 09, 2011, 09:07:58 pmIt was a complete reload of a new image I was talking about.Neil

author: sub
author_rank: Regular Contributor
timestamp: November 09, 2011, 10:03:43 pm
content: Quote from: mikeselectricstuff on November 09, 2011, 09:07:58 pmThis suggests that the Stratix-5 supports partial reconfiguration:http://www.altera.com/literature/wp/wp-01137-stxv-dynamic-partial-reconfig.pdf

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2011, 12:31:29 am
content: QuoteNearer $5 nowadays in 100x volumes.The highest end ones however cost more than a care.g.http://search.digikey.com/uk/en/products/EP4S100G5F45I1/EP4S100G5F45I1-ND/2287759

author: slburris
author_rank: Frequent Contributor
timestamp: November 10, 2011, 03:42:17 am
content: The Xilinx Spartan 3A 50K gate chip is $6.12 qty 1. That's almost halfthe price a previous msg mentioned.http://search.digikey.com/us/en/products/XC3S50A-4VQG100CThere's a whole community working on open source Verilog and/or VHDL designs for peopleto use. Check out:http://opencores.com/Scott

author: A-sic Enginerd
author_rank: Regular Contributor
timestamp: November 10, 2011, 05:58:05 am
content: Most of what's said here is accurate, although I personally don't agree with some of the comparisons and some of the descriptions of an FPGA kind of dance around what they really are.Here's my summary:- There really isn't a comparison between an MCU and FPGA. They are different animals to solve 2 different problems. There may be some overlap in being able to solve a particular problem with either, but how you go about it is very different.- MCU is a fixed CPU with some functional blocks built around it all sitting on one die and in one package. Everything you make it do involves writing some software to have the cpu drive the blocks on board.- FPGA is simply a sea of logic units that can be configured to provide the designed logic function. The tools to configure an FPGA begin with doing some digital design in one form or another. (HDL or schematic capture). Take note that there are readily available "off the shelf" soft macros to implement many common functions, including things like custom CPU's, USB, Ethernet, etc.- ASICs are: Application Specific Integrated Circuits, and I beg to differ with an earlier reply stating they are mostly done with uncommitted gate arrays.So trying to compare an FPGA to an MCU is an unfair comparison. They are different animals intended to solve different problems. The closer comparison is between ASICs and FPGAs. They are both all about doing a custom digital design to solve a particular problem. The differences between the two and why one would choose one over the other is: speed, size, cost, and volume needed. All of the chips I have worked on simply can't be done in an FPGA. There isn't an FPGA in existence that is big enough or can run at the speed needed for our ASICs. However, if you have a low volume design that is small enough and doesn't require high clock speeds an FPGA is certainly the better option (considering the millions....yes....millions of dollars required to develop an ASIC and put it into production).

author: amspire
author_rank: Super Contributor
timestamp: November 10, 2011, 06:35:18 am
content: Quote from: A-sic Enginerd on November 10, 2011, 05:58:05 amI will bow my head to you on this one. At the time I wrote that, I was thinking historically back to when people had to use Asics because the FPGA's were not very good at all. I am also think back to a time when an Asic design was tens of thousands of dollars, but usually not millions.What can be done now is really only limited by product designers imagination and the limits of the software designer tools. This is what happens when I think back to when it was simple.Listen to A-sic Enginerd, not me!!QuoteI figured that was true, so it is good to hear you confirm it. As I understand it, the idea in a FPGA design is to get as much functionality our of a minimum of programmed links. So you have a structure of macrocells where only part of the functionality per cell is in use, and you have big over-designed data busses capable of handling whatever the programming designer comes up with. A bus might be connecting 100 cells of spread across the chip, or two adjacent cells. There is a lot of waste, and a lack of true optimization. A FPGA is an intelligent compromise that often works well enough for the job.Asic designs allow for true optimization, and from what you say, that makes a huge difference.If I can ask one question, using modern design tools, how easy is it to take a logic design from one device (lets say a FPGA) to a different device (say an ASIC)? Or to move a design from one foundry to another?Richard.

author: Balaur
author_rank: Unknown
timestamp: November 10, 2011, 07:57:50 am
content: Quote from: A-sic Enginerd on November 10, 2011, 05:58:05 amEh, your mileage may vary obviously.The development costs (including EDA & IP licenses, man power, etc) may be very high indeed in a lot of cases, that's for sure.However, ASIC design (I'm an ASIC designer myself as well) can be much more affordable than that.Through the last 12 years, my company produced and was involved in the design and manufacturing of specific test vehicles from 0.35u down to 40nm (bulk CMOS), with more to come.The manufacturing was done through a multi-project/shared scheme where a specialized company gather several designs in order to fill a wafer and acts as an intermediary to the foundry. In this setting, the prices per sq. mm are surprisingly low: from around 1000 euros for 0.35u to 15000 euros for 28nm + ~ 2000 euros for dicing/packaging/etc for 25 circuits.As an indication, the man-power involved in such a project (design, test) in my case was around 1-3 man-years.Obviously, all these costs may be very different from project to project. You may easily reach multi-millions costs for complex, high-profile designs but on the other hand, the company is also expected to have comparable profits.Cheers,Dan

author: deephaven
author_rank: Frequent Contributor
timestamp: November 10, 2011, 11:21:04 am
content: There's an Electronics Weekly article about such devices here:http://www.electronicsweekly.com/components/fpgas-asics/

author: slateraptor
author_rank: Frequent Contributor
timestamp: November 10, 2011, 01:48:17 pm
content: Quote from: A-sic Enginerd on November 10, 2011, 05:58:05 amLet's not forget time to market, and power consumption, and data throughput, and field upgradeability, and...ok, I'm out.P.S.*cough Dave hint* I think this thread should be moved to the dedicated "Programmable Logic Devices" section. Wait a minute... *hint Dave cough*

author: A-sic Enginerd
author_rank: Regular Contributor
timestamp: November 21, 2011, 11:02:50 pm
content: Quote from: amspire on November 10, 2011, 06:35:18 amASIC to FPGA and vice versa...depends on design size and clock speeds, but in general very do-able. Most ASIC designs I've worked on have been prototyped in FPGA's and usually involves having a person on the team be dedicated to figuring out how to divide up the design to spread it across multiple FPGA's, as well as working out the clocking schemes. Clocks are almost always required to be slowed WAY down as the routing in FPGA's just can't handle it.On the flip side, if you have an FPGA design that's been working for you and want to drive some cost out, that's actually one service the FPGA vendors offer directly. They can take your design and can generate a "fixed" design. It's not a true ASIC, but rather something in between. But because the silicon isn't required to be reconfigurable, it uses a cheaper technology. I've never actually done this, but every time we talk to the FPGA vendors they're always sure to point out they have the service available.As to porting across foundries, that's a bit more sticky, not to mention can be a bit more complicated depending on how you interface to the foundry. (ie: deal with foundry directly and have a customer-owned-tools methodology, or if you use a third party like what I've typically worked with). In the best of worlds it means you at least have to go through the timing closure process with your design. Actually experienced that once at my former job. The vendor we were using was bringing a new fab online and wanted to requal our chip in the new foundry.Quote from: Balaur on November 10, 2011, 07:57:50 amInteresting. Have never heard of this being done before. Then again, all the chips I've worked on (and have peers at other companies worked on) have sufficient volumes that something like that is counter-productive.I know this much - when I started this career some 15 years ago, if you had to spin the ASIC a new mask set alone would buy you a nice house in the bay area. Now days in the smaller geometries, the mask sets alone start at about a million bucks (US), not including all the NRE.Quote from: slateraptor on November 10, 2011, 01:48:17 pmTrue, but since now days the general cost of doing an ASIC is so prohibitive that all those considerations typically become secondary. In general it usually boils down to: If you can fit it in an FPGA and still run it at the clock speed you need, that's your better option. But if you need the speed or the design is too large, you better be able to justify it with enough volume and product life to make it worth the investment.

author: Unknown
author_rank: Unknown
timestamp: November 21, 2011, 11:10:17 pm
content: Quote from: A-sic Enginerd on November 21, 2011, 11:02:50 pmIt's still very rare to see a piece of consumer electronics with an FPGA. Apparently ASICs are still cheaper if you're called Sony or Apple.

author: gregariz
author_rank: Frequent Contributor
timestamp: November 21, 2011, 11:18:35 pm
content: Quote from: alm on November 21, 2011, 11:10:17 pmIts important to distinguish between analog and digital asic's. Digital asics have come down alot so you can now spin them for 100 -200K. It depends on complexity but It can def be the cheaper option if you have volume as price per part is usually alot more attractive than FPGA's. Analog asics start at around 500K +. Around 1Mil is the norm. To keep the costs down you want to be doing as much of the specification as possible. You need to be seriously crunching test vectors and getting your circuit working in an FPGA first if you are on the digital side. On the analog side you want to be characterizing & simulating your systems performance as far as possible first... and then you need to pray.

author: slateraptor
author_rank: Frequent Contributor
timestamp: November 22, 2011, 03:05:33 am
content: Quote from: alm on November 21, 2011, 11:10:17 pmThe products that Sony, Apple and like corporations which contain custom ASICs are the products that they happen to sell in the millions (or at the very least expect to sell in the millions). In general, ASICs require high volume in order to turn a profit due to the relatively large NRE associated with developing the silicon.

author: Unknown
author_rank: Unknown
timestamp: November 22, 2011, 08:44:16 am
content: Quote from: gregariz on November 21, 2011, 11:18:35 pmOn the other hand the alternatives for an analog ASIC are much more limited, since I don't think there are any high-performance analog FPGA-like devices available, so you can't just avoid the ASIC costs by spending $50 each and slapping an FPGA in there.

author: slateraptor
author_rank: Frequent Contributor
timestamp: November 22, 2011, 10:04:44 am
content: Quote from: alm on November 22, 2011, 08:44:16 amI suppose this guy doesn't count:http://www.actel.com/products/fusion/default.aspxI feel like mixed-signal via instantiated IP will be as far as FPGAs will tread into the analog domain. Recall a time in the past when vendors hadrealsynthesizable tri-state buffers embedded in their fabric and the chaos that caused.

author: chscholz
author_rank: Regular Contributor
timestamp: November 23, 2011, 12:20:33 am
content: Yes, there are a few FPGAs in modern scopes (and a bunch of ASICS, too).Quote from: FenderBender on November 09, 2011, 03:13:27 am