|
Choosing DSP or FPGA for your ApplicationIntroductionThe HERON range of modular DSP systems supports processing in either FPGA or DSP. The two approaches are markedly different. Here we look at when to use FPGA, and when to use DSP. See also the useful article from Xilinx on FPGA for DSP The Two SolutionsThe DSP is a specialised microprocessor - typically programmed in C, perhaps with assembly code for performance. It is well suited to extremely complex maths-intensive tasks, with conditional processing. It is limited in performance by the clock rate, and the number of useful operations it can do per clock. As an example, a TMS320C6201 has two multipliers and a 200MHz clock so can achieve 400M multiplies per second. In contrast, an FPGA is an uncommitted "sea of gates". The device is programmed by connecting the gates together to form multipliers, registers, adders and so forth. This is done at a block-diagram level. Many blocks can be very high level ranging from a single gate to an FIR or FFT. Their performance is limited by the number of gates they have and the clock rate so for example, a 200K-gate Virtex device with a 200MHz clock could implement ten 16-bit multipliers. This offers huge performance especially as the 200K-gate device is considered small, with 1-M gate devices available. Where they ExcelBeyond a sampling rate of a few MHz, a DSP can only implement a very simple operation on the data. Implementing that simple operation using the FPGA would be easy, with the option of far higher sampling rates. At low sampling rates, that situation is reversed the DSP can implement massively complex programs, which would be hard to replicate in the FPGA. With low-rate events, the DSP scores. It can queue these, ensuring that they all get processed but there may be some latency before they are handled. In contrast, the FPGA cannot handle as many events each one must have dedicated hardware but each event can be handled at the same time as all the others. If a major context switch is required, the DSP can implement this by branching to a new part of the program. In contrast, an FPGA needs to build dedicated resources for each configuration. If the configurations are small, then several can exist in the FPGA at the same time. Larger configurations mean the FPGA needs to be reconfigured a process which can take some time. The DSP can take a standard C program and run it. This C code can have a high level of branching and decision making for example, the protocol stacks of communications systems. This is difficult to implement within an FPGA. Finally, an FPGA is programmed in a "block-diagram" style, where it is easy to see the dataflow. A DSP is programmed with a sequential flow of instructions. Most signal processing systems start life as a block diagram of some sort. Actually translating the block diagram to the FPGA may well be simpler than converting it to C code for the DSP. Making a ChoiceThere are a number of elements to the design of most signal processing systems, not least the expertise and background of the engineers working on the project. These all have an impact on the best choice of implementation. In addition, consider the resources available in many cases, HERON I/O modules have FPGAs on board. Using these with a DSP processor may provide an ideal split. As a rough guideline, try answering these questions:
In reality, most systems are made up of many blocks. Some of those blocks are best implemented in FPGA, others in DSP. Lower sampling rates and increased complexity suit the DSP approach; higher sampling rates, especially combined with rigid, repetitive tasks, suit the FPGA. Some ExamplesHere are a few examples of signal processing blocks, along with how we would implement them:
SummaryFPGA and DSP represent two very different approaches to signal processing each good at different things. There are many high sampling rate applications that an FPGA does easily, while the DSP could not. Equally, there are many complex software problems that the FPGA cannot address. As a result, the ideal system is often to split the work between FPGAs and DSPs. This is easily accomplished using the HERON system, and in many cases can be done simply using I/O and processor modules without any dedicated FPGA resource. |
|