Professional Documents
Culture Documents
Finite Impulse Response (FIR) filters are a typical DSP application requiring hardware implementation. Some of the issues that arise in the course of implementing such a system include designing the coefficients, quantizing and optimizing the number of bits required, implementing and simulating a HDL description, and finally synthesizing and testing it on hardware. In this lab, we will go through these steps. The software tools used here are not the only tools capable of being used here, but are fairly common. The process involves the following steps: Computing coefficients based on filter specifications Quantization of coefficients Verilog implementation and simulation Synthesis for FPGA target Testing on FPGA evaluation board
x = 0.5*sin(2*pi*75*t)+0.5*sin(2*pi*300*t); will generate a sum of two sine waves, one in the pass band (75 Hz) and other in the stop band (300 Hz). The 0.5 amplitude is used so that the final sum is still in the range (-1, +1). xq = round(x*2^7)/2^8; will quantize to 8 bits. y = filter(bq, 1, xq); will compute the filtered output. plot(t, xq, t, y) can be used to visualize the input and filtered output It is possible to play around with the number of taps, number of bits etc. In practical VLSI design, we would like to optimize both of these as much as possible, so that the overall size of the result can be minimized. For this lab session we will move on to the next stage, implementation.
Hardware Implementation
After the filter has been verified in simulation, it needs to be converted to hardware. We use the Xilinx ISE software for this. The command to start the tool is ise. A sample project has been provided that has all the files required for implementing on the FPGA eval board. The reason for the extra files is that the eval board we use in the lab uses serial ADC and DACs, so that some extra logic is required to collect the data and send out the data after filtering. The filter that was designed in the earlier section can be dropped into the project, provided that the input and outputs match what is used in the design (8 bit input, 8 bit output, 1 bit clock input). In this way, you can modify your filter in any way you want and plug it in to this design. The design must be first synthesized. This generates a synthesis report where you can identify certain important characteristics of the design. For example:
Are any hardware multipliers inferred, or is the Booth multiplier implemented using logic only? How are the adders implemented in hardware? How many flip-flops are inferred? Does this match what you expect from the filter implementation? What is the maximum speed at which the system can operate? After synthesis, the design needs to be converted into a programming file (bit file) that can be downloaded to the FPGA. Once this is done, the filter is actually operational, and can be tested by feeding in suitable input and verifying the output. Note that the filter cutoff frequency depends on the sampling frequency that is used. Because of the serial nature of the ADC, the actual sampling rate is 50MHz/(64*4) = 195 kHz. Hence the passband and stopband frequencies are also determined with respect to this sampling frequency.
Summary
The purpose of this lab exercise was to go through all the steps involved in the hardware implementation of a simple DSP application (FIR filter). All the main steps, starting from the mathematical modeling and refinement, through HDL modeling and simulation, to synthesis and implementation on hardware evaluation board, have been followed. The exercise can be modified in several ways, such as trying different types of filters, different types of implementations, multiplier and hardware changes, pushing the implementation so that it is close to the speed limits of the hardware and so on.