Comparison of the characteristics of DSP and FPGA
Время публикации: 2020-07-27 11:10:25
The rapid development of digital signal processing technology and large-scale integrated circuit technology has provided us with new ideas and new methods for designing digital circuits. The current digital system design is developing in the direction of fast speed, large capacity, small size and light weight. The development of DSP and FPGA technology makes this trend possible and inevitable.
Like computers, the theory of digital signal processing has evolved from the 1960s to the emergence of DSP in the 1980s. Its rapid development has changed the face of signal processing. Today DSP has been widely used in voice, image, communications, radar, electronic countermeasures, instrumentation and other fields. DSP played a very critical role and became the main method of digital circuit design.
Since the 1980s, the emergence of a class of advanced gate arrays—FPGAs has produced another digital circuit design method with very good application prospects. The advantages of FPGA-based digital circuit design in terms of reliability, volume, and cost are huge.
In addition to the above two schemes, there are also DSP+FPGA schemes, as well as schemes for implementing the system by choosing an FPGA embedded with DSP modules.
1. Structural characteristics of DSP and FPGA
1.1 Structural characteristics of DSP
DSP is a kind of microprocessor with special structure. The inside of the DSP chip adopts the Harvard structure with separate program and data, has a dedicated hardware multiplier, widely adopts pipeline operation, and provides special DSP instructions, which can be used to quickly implement various digital signal processing algorithms. According to the requirements of digital signal processing, DSP chips generally have the following main features:
(1) One multiplication and one addition can be completed in one instruction cycle;
(2) Program memory and data memory are two mutually independent memories, each memory is independently addressed, and instructions and data can be accessed at the same time;
(3) There is fast RAM on-chip, which can usually be accessed simultaneously in two blocks through an independent data bus;
(4) Hardware support with low or no overhead loops and jumps;
(5) Fast interrupt processing and hardware I/O support;
(6) With multiple hardware address generators operating in a single cycle;
(7) Multiple operations can be performed in parallel;
(8) Support pipeline operation, so that operations such as fetching, decoding, and execution can be performed overlapped.
1.2 The structural characteristics of FPGA
The structure of FPGA is derived from the design idea based on semi-custom gate array. In essence, FPGA is a more convenient ASIC design technology than semi-custom.
The structure of FPGA is mainly divided into three parts: programmable logic block, programmable I/O module, programmable internal wiring. There are two main types of structures for programmable logic blocks and programmable interconnect resources: look-up table type and multiplexer type.
The programmable logic unit of a look-up table FPGA is a function generator composed of SRAM (StaTIc Random Access Memory) whose function is a look-up table, which controls the logic of executing FPGA application functions. The output of the SRAM is the value of the logic function, from which the output state controls the on and off of the transmission gate or the multiplexer signal, and realizes the programmable connection with other functional blocks. The basic structure of a multiplex switch type programmable logic block is a multiplex switch configuration. Using the characteristics of the multiplexer, when each input of the multiplexer is connected to a fixed level or input signal, different logic functions can be realized. A large number of multiplexers and logic gates are connected to form a logic block that implements a large number of functions.
FPGA is divided into two categories by its configuration mechanism: reconfigurable type and one-time programming type. In recent years, FPGA has been widely used in the design of digital systems because of its high integration, fast processing speed and high execution efficiency.
2. Performance comparison between DSP and FPGA
The internal structure of DSP gives it the advantages that: the execution time of all instructions is a single cycle, the instructions are pipelined, the internal data, address, instructions and DMA (Direct Memory Access) bus are separated, and there are more register.
Compared with general-purpose microprocessors, the general-purpose functions of DSP chips are relatively weak. DSP is a specialized microprocessor, suitable for conditional processes, especially more complex multi-algorithm tasks. In operation, it is subject to the clock rate, and the number of useful operations done in each clock cycle is also limited. For example, TMS320C6201 has only two multipliers and a 200 MHz clock, so it can only complete 400M multiplications per second.
The simulation algorithm and specific index requirements are mapped to the general-purpose DSP, and the more typical DSP is programmed through assembly or high-level language such as C language to realize the solution in real time. If the DSP uses standard C programs, this C code can implement high-level branch logic and judgment. For example, the protocol stack of the communication system is difficult to implement on FPGA. In terms of effect, the advantages of using DSP devices are: the software update speed is fast, which greatly improves the reliability, versatility, replaceability and flexibility of the system, but the shortcomings of DSP are restricted by the serial instruction stream.
FPGA has many free gates. By connecting these gates, multipliers, registers, address generators, etc. are formed. As long as these are completed at the block diagram level, many blocks can be completed at a very high level from simple gates to FIR (Finite Impulse Response) or FFT (Fast Fourier Transform). But its performance is limited by the number of all its gates and clock speed. For example, a Virtex device with 200,000 gates can implement 10 16-bit multipliers with a 200MHz clock.
FPGA contains a large number of resources to implement combinational logic, which can complete the design of larger-scale combinational logic circuit; at the same time, it also contains a considerable number of flip-flops, with the help of these flip-flops, FPGA can complete complex sequential logic functions. By using various EDA (Electronic Design AutomaTIc) tools, designers can easily implement complex circuits in FPGAs. Like microprocessors, many FPGAs can be reprogrammed indefinitely, and it only takes a few hundred milliseconds to load a new design. Even on-site products can be implemented very simply and quickly. In this way, the use of reconfiguration can reduce hardware overhead.
With a sampling rate of more than a few MHz, a DSP can only perform very simple calculations on the data. And such a simple operation can be easily realized with FPGA, and can reach a very high sampling rate. When the sampling rate is relatively low, the overall complex program can use DSP, which is very difficult for FPGA.
For lower speed events, DSP has advantages. You can queue them and ensure that they can be executed, but there may be some delay before they are processed. And FPGA cannot handle multiple events, because each event has dedicated hardware, but the way of implementing each event using this dedicated hardware can make each event execute simultaneously.
If the main working environment needs to be switched, the DSP can be completed by dividing a new subroutine in the program, and dedicated resources need to be established for each configuration FPGA. If these configurations are relatively small, there can be several configurations in the FPGA at the same time; if the configuration is large, it means that the FPGA needs to be reconfigured, and this method can only be used at certain times.
Finally, FPGA is programmed in block diagram mode, so it is easy to see the data flow. DSP is programmed according to the sequential flow of instructions. Most single-processing systems are designed from a block diagram. In fact, most system designers think that it is easier to transplant block diagrams to FPGAs than to convert them to DSP C code.
3. How to choose DSP and FPGA solutions
3.1 Principles of Scheme Selection
There are many factors to consider when choosing the core processing part of the digital system. For example, how to make full use of existing resources (including software and hardware), the operating clock rate required by the system, and the characteristics of algorithms or working methods, etc., have a great influence on the selection of the best solution.
Specifically, in the initial program demonstration stage, the program can be selected based on the answers to the following questions:
(1) What is the sampling rate of the system?
If it is higher than a few MHz, FPGA is the natural choice.
(2) Has the system been programmed in C language? If so, DSP can be implemented directly. It may not reach the optimal realization of the scheme, but it is easy to develop further.
(3) What is the data rate of the system?
If it is higher than 20～30Mbyte/second, it is better to use FPGA for processing.
(4) How many conditional operations are there?
If not, FPGA is good; if there are many, software implementation, that is, DSP implementation is a better choice.
(5) Does the system use floating point?
If so, it is better to use a programmable DSP. So far, some FPGA developers, such as Xilinx's cores, do not support floating point, although they can design by themselves.
(6) Are the required libraries available?
Both DSP and FPGA provide basic building blocks such as FIR or FFT. However, more complex or specialized components may not be available, which will determine the choice.
3.2 Scheme selection example
Several digital circuit design examples are provided below to help understand the principle of program selection introduced earlier.
(1) Sampling filter for wireless data receiver.
A typical CIC filter works at a sampling rate of 50 to 100 MHz, and a 5-step CIC has 10 registers and 10 adders. The acceleration is required to be 500～1000MHz.
Any DSP processor will be difficult to achieve at this rate. However, CIC has only a very simple structure, so it will be very simple to implement with FPGA. The sampling rate of 100MHz can be reached, and even some types of FPGA can have some remaining resources for further processing.
(2) Realize the communication stack protocol-ISDN.
IEEE1394 has a very complex and large amount of C code, which is completely unsuitable for FPGA implementation; but it is very simple to implement with DSP. Not only that, a signal encoding base can be reserved, so that the code stack can be implemented on a DSP of a certain product, or implemented by a separate protocol processor on another DSP. This will give an opportunity for vendors who specifically provide authorization for the code stack.
(3) The baseband processor of the digital radio frequency receiver.
Some types of receivers require FFT to obtain the signal, and then the matched filter obtains the signal at a time. These two modules can be easily implemented with either scheme. However, if the work mode conversion/signal acquisition and signal reception conversion are required, the DSP solution is more suitable. Because the FPGA solution needs to complete two modules at the same time.
It should be noted here that RF is better implemented with FPGA, because this is a hybrid, multitasking system. If a larger FPGA is used, two modules can be implemented with one FPGA at the same time.
(4) Image processor.
Most of the image processing procedures are simple and repetitive, so it is very suitable for FPGA implementation. However, an imaging process is often used to identify "spots" or "regions of interest" in the observed target. These "spots" may be of different sizes, making the judgment and processing process of the back end more complicated. At the same time, the algorithms used are often adaptive, depending on what the spots are like. So it is appropriate to use DSP to form the back-end processing part of the image processing pipeline.
In short, DSP and FPGA represent the signal processing process of two digital systems, each with its own strengths and weaknesses. For many high-speed sampling frequency applications, especially when tasks are relatively fixed or repetitive, FPGA solutions are suitable; similarly, DSP solutions are suitable for lower sampling rates and software problems with high complexity.
4. New design ideas
4.1 DSP+FPGA structure
The biggest feature of the DSP+FPGA structure is its flexible structure, strong versatility, suitable for modular design, which can improve algorithm efficiency; at the same time, its development cycle is short, and the system is easy to maintain and expand.
For example, in a real-time signal processing system implemented by the DSP+FPGA structure, the low-level signal preprocessing algorithm processes a large amount of data and requires high processing speed, but the calculation structure is relatively simple and suitable for hardware implementation with FPGA. This can balance speed and flexibility at the same time. The characteristic of the high-level processing algorithm is that the amount of data processed is less than the lower-level algorithm, but the control structure of the algorithm is complex, and it is suitable for implementation with a DSP chip with high computing speed, flexible addressing mode, and powerful communication mechanism.
FPGA can complete module-level tasks and act as a co-processor of DSP. Its programmability makes it both the speed of an application-specific integrated circuit and its high flexibility.
DSP has the flexibility of software; and FPGA has the high speed of hardware, from the perspective of the device, it can meet the requirements of processing complex algorithms. In this way, the structure of DSP+FPGA provides a better solution for how to deal with the relationship between software and hardware in the design. At the same time, the system has a flexible processing structure, and has strong adaptability to algorithms of different structures, and is especially suitable for real-time signal processing tasks.
4.2 FPGA embedded in DSP module
The application of FPGA chips that embed some DSP modules that can realize basic digital signal processing functions is another major trend in digital circuit design.
Some companies have or plan to integrate ASIC-based microprocessors or DSP cores with programmable logic arrays on a single chip. The performance of DSP provided by FPGA has exceeded 128 billion MACs per second, which is much higher than the performance of traditional DSP provided by mainstream suppliers.
Among them, Xilinx, as the world's leading manufacturer of programmable logic devices, has advanced FPGA technology and advanced development tools. In November 2000, Xilinx XtremeDSP was launched to try to enter this market. Virtex-II can provide 600 billion MAC (multiply accumulate operations) performance per second. Using this parallel structure, each sample in the 256-order FIR filter can be processed in one clock cycle, thus greatly improving the performance and efficiency of the DSP.
The goal of Xilinx XtremeDSP action is to meet the high-performance challenges of the broadband revolution. Other features include optimizing DSP design based on, for example, chip area (corresponding to the resources used) and system frequency. The XtremeDSP action also introduced some development tools to bridge the gap between traditional DSP and FPGA design methods.
The enhanced structure of the new Virtex-II series gives it unique advantages when implementing algorithms that require calculations. The test data provided by Xilinx shows that Xilinx FPGAs run 100 times faster than the industry's fastest DSP. Therefore, a single FPGA can replace the traditional so-called DSP processor array.
At present, many mobile phone base station products in the world use Xilinx's Virtex-E FPGA. In order to establish a large number of connections, mobile base stations need to process a large amount of data, most of which are implemented using a certain DSP.
It can be predicted that in the near future, a digital system implemented by a single DSP or FPGA will be replaced by a DSP+FPGA structure or an FPGA design structure embedded in a DSP module.Тег: FPGA