17
votes
\$\begingroup\$

I need to do digital signal processing on 8 analog lines at 10 kHz. This is quite a demanding task, and I was thinking that an FPGA might be the right approach. I am currently looking at dev kits from Xilinx, and since I have no experience with FPGA, I find it really hard to know how to choose the right chip. I imagined using a dev kit and expanding it using the I/O pins to connect to an 8-channels A/D chip and 8-channel D/A chip.

What are the differences between using Spartan, Virtex, Altera, etc.? I don't even know how to estimate how many gates I will need. Are there any rules of thumb for that? How do I make sure the clock speed will be enough (as a function of the number of adds and multiplies). Is it difficult to do floating-point processing on an FPGA, should I stick to fixed point math? What's the best way to get started?

I require a solution that's programmable using Linux. Xilinx provides this, but I'm not sure what the limitations are.

\$\endgroup\$

locked by Dave Tweed Dec 15 '14 at 22:55

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.

Read more about locked posts here.

  • 5
    \$\begingroup\$ It would help a lot to know what kind of algorithms you need to implement. Chances are that you don't need an FPGA at all, which will save you a lot of development time ;-) \$\endgroup\$ – geschema Apr 9 '10 at 18:39
  • \$\begingroup\$ I agree with geschema; you may not need an FPGA. Maybe a DSP is a better solution. In any case they're easier to get started with if you only have experience in uCs. FPGAs are very different! \$\endgroup\$ – stevenvh Nov 26 '10 at 9:48
13
votes
\$\begingroup\$

I would not use an FPGA.

You mention you have no experience with FPGA's, and yet you are interested in doing digital signal processing on an FPGA... numerical manipulation + signal processing are difficult enough to get right on a computer/DSP/microprocessor, where the programming tools are conventional programming. It seems to me that using a digital signal processing project for a first FPGA project is likely a recipe for frustration.

If you want to learn FPGAs, try doing something more suited to the development tools, like state machines or communications packet processing.

For a DSP project like what you've described, I'd recommend a DSP or a Cypress PSOC or an Analog Devices Microconverter (=microcontroller with ADC+DAC builtin) instead.

(full disclosure, which provides some context for my advice: I do not use FPGAs myself. I have used programmable logic = PLDs on rare occasions. My officemate does use FPGAs frequently, and I've seen enough VHDL/Verilog code looking over his shoulder to know that it is well suited for bit manipulations. He is a seasoned engineer with lots of experience with FPGAs; in a recent conversation with him where he was doing some fairly simple math on integers with different bit widths, I told him he needed to do sign-extending on the shorter bit width number in order to subtract it properly, and he got this look on his face, like "oh man, I don't want to have to do sign extension..." Adding and subtracting is not very hard in an FPGA. Beyond addition and subtraction, you really need to know the tools and libraries. And floating-point processing??!?!!??!?!!?)

\$\endgroup\$
  • 2
    \$\begingroup\$ MyHDL tries to fix some of those problems. \$\endgroup\$ – Shawn J. Goff Nov 28 '09 at 19:02
  • \$\begingroup\$ I don't think FPGAs are any more difficult to use than micros, they simply have a different set of caveats. \$\endgroup\$ – Connor Wolf Nov 5 '10 at 5:53
10
votes
\$\begingroup\$

They're all pretty much good. You won't need too much out of the FPGA to do something simple like that, so any beginner FPGA (like the Spartan-3 line) should suffice.

Just a word of warning though, programming an FPGA is a LOOOOTTTTTT different than something like C++, C, perl... I'd suggest starting out with verilog because it's probably the easier to transition into... VHDL is very COBOL like but verilog is more similar to modern programming languages.

About the clock speed: don't worry about it. The advantage to using FPGAs is that they are massively parallel, so while a 50MHz clock may seem ridiculously slow by today's standards, keep in mind that they can do hundreds of things at once, whereas a "normal" CPU at 3GHz has to queue things up one at a time. This is the advantage to using FPGA: parallelism. So for something specialized, you don't need to worry about speed so much.

But like the other comment, it's a whole different paradigm. The learning curve is steep, but once you grasp the language, it all makes sense (just make sure you understand the building blocks).

Happy FPGA'ing :)

\$\endgroup\$
  • 2
    \$\begingroup\$ VHDL is actually based on Ada! Leon \$\endgroup\$ – Leon Heller Dec 21 '09 at 23:02
  • 2
    \$\begingroup\$ Also, in choosing Verilog or VHDL, consider the language in light of it being an investment in your future marketability. In the US, Verilog is more popular in IC/chip development than VHDL so knowing Verilog (and its enhanced version, System Verilog) will likely be a better longterm investment. It also seems that all the big EDA companies are investing in verilog and system verilog, whereas VHDL is not getting much attention. ( witness VCS mixed simulation with vhdl vs VCS verilog simulator performance differences ). (que the flaming ) Yes you can learn both, but why not prioritize. \$\endgroup\$ – Ross Rogers Nov 3 '10 at 16:58
  • \$\begingroup\$ You can write it in either language. I think the Xilinx tools can take Verilog and VHDL, even in the same project. FWIW, I'm in the US and I've never used Verilog. \$\endgroup\$ – ajs410 Nov 3 '10 at 17:19
  • 1
    \$\begingroup\$ "VHDL is very COBOL like". Not by a million miles! \$\endgroup\$ – stevenvh Jun 13 '11 at 14:39
9
votes
\$\begingroup\$

A while back I put together a comparison chart of entry level FPGA boards, from the two FPGA vendors Xilinx and Altera. They're the two major players in FPGAs, sort of like PIC vs AVR or Sony vs Nintendo. They provide the best bang-for-buck. There are other vendors that provide specific features, but you usually end up either paying more, or losing features/processing power.

I know this doesn't directly answer your specific question, but it should be helpful to anybody who is looking to get started with a FPGA board.

\$\endgroup\$
7
votes
\$\begingroup\$

So many questions; let's try try to answer them in order:

  1. Resource requirement for signal processing: In order to determine what hardware you need to use/build you need an idea of the amount of processing you want to do on the signals in question. 8 channels @ 10 kHz is not a very high data rate, so unless your requirements are very special most FPGAs and DSPs should be able to process the data.
  2. How do I choose the right device? Based on the requirements of your signal processing you should be able to figure out which device is required for your application. Key points are memory requirement, are hard multipliers required, special IO considerations, etc. Most FPGA vendors have tools (web based) that let you search their portfolio based on such factors.
  3. How do I get started with DSP? DSPs are just ordinary computers that usually have SIMD[Single Instruction, Multiple Data] instructions relevant for signal processing. To get started you just need to understand the limitations of "embedded" hardware and a C compiler so that you can test your code on an ordinary PC.
  4. How do I get started with FPGAs? FPGAs are programmed in a Hardware Description Language. These are significantly different from sequential languages such as C or Java. In order to develop for FPGA you need to understand the concurrent nature of real hardware. The tools you need to get started is a HDL simulator such as Simili (free for small designs) or Modelsim. This lets you simulate your code on PC. After that you need a vendor specific synthesis tool which compiles you HDL-code into a bit-file which is used to configure the FPGA. If you get a starter kit from Altera, Actel or Xilinx all the tools you need is part of the kit.
  5. Linux support: FPGA tools from most vendors run on Linux, but in the DSP field you are usually forced to use Windows-only compiles unless your DSP is supported by GCC (Blackfin from Analog and several models from Texas Instruments are).
\$\endgroup\$
  • \$\begingroup\$ +1 for "8 channels @ 10 kHz is not a very high data rate" - I can't believe no one has said that yet. \$\endgroup\$ – Kevin Vermeer Nov 3 '10 at 15:15
  • \$\begingroup\$ Not if he's doing 8-channel FFT... \$\endgroup\$ – ajs410 Nov 3 '10 at 17:21
  • \$\begingroup\$ DSPs are often single-threaded parallel processing units each capable of executing a different instruction (unlike SIMD where all units share the same instruction). \$\endgroup\$ – Ben Voigt Nov 5 '10 at 4:21
4
votes
\$\begingroup\$

A fellow named Anthony Burch has put together a descent series of videos about FPGAs. One of the free ones includes information about how to choose an FPGA.

\$\endgroup\$
4
votes
\$\begingroup\$

Just about any FPGA vendor will do. It's like Intel vs AMD...there are differences between Xilinx and Altera, but they're remarkably similar in terms of functionality. Buy whatever development kit is in your price range - I personally liked Spartan 3's from Xilinx - and run with it.

Regarding gate count, the dev kit will typically be very large, hopefully much larger than you need. When you get ready to move to your own PCB, the synthesis tools will estimate for you how many gates your design requires. You can use this to select a smaller FPGA, though you may find out that package constraints (QFP vs BGA) play an important role too.

With proper design techniques, the clock speed won't be an issue. In fact, you can typically use a relatively low speed crystal, like 12 MHz, and the FPGA can synthesize a much faster clock (or many faster clocks!) If you're really worried about multiply-adds, I know the Virtex4 series has dedicated DSP slices that can accelerate those calculations. But FPGAs are massively parallel, so you don't need too many MHz to do a ton of work.

I would definitely stick with fixed point if you can. It's possible to do floating point, and Xilinx even has a Core Generator that will provide you with a floating point core, but fixed point will be way, way faster, and will require far fewer gates. Another advantage is that you can do some odd fixed point; you can use as many bits as you want, it doesn't have to be a power-of-2 bit count, and/or you can use larger fixed points for intermediate stages.

The best way to get started with FPGAs? Find a class or a seminar or something. If you are unfamiliar with the technology, the development tools will be very confusing, because there is a lot that can go wrong. Tools for MCUs are much more forgiving and require less intimacy with the underlying architecture.

Oh, and you should read the FPGA's datasheet, front to back.

\$\endgroup\$
0
votes
\$\begingroup\$

Have a look at XMOS

They may be used to replace FPGAs in many applications.

\$\endgroup\$
0
votes
\$\begingroup\$

If you want to estimate gate count you don't need to buy hardware yet - the main FPGA makers have free software, and many will have appnotes on doing dsp. You can design and simulate stuff without hardware, and the software will tell you what resources are used. However for signal processing, a dsp would normally be the first step, and FPGA only if you run out of processing power.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.