Example: Correlator

Top  Previous  Next

The Correlator example introduces the FPGA as a significant processor. The DSP generates a noisy sine wave that is sent to a task that calculates an auto-correlation. The original sine wave and its autocorrelation are displayed on host PC 'oscilloscope' windows. From the host PC you can change the parameters used to generate the sine wave while the application is running.

 

The auto-correlation task can be either C code running on the DSP or VHDL executing in the FPGA. We have used the ImpulseC toolset to design the Correlator in C and compile it VHDL.

 

The system

The demonstration needs six tasks, arranged as shown in the diagram below.

 

 

The black lines represent the channels the tasks use to communicate.  

 

Running the Example

Make sure you have set the default processor type corresponding to the hardware you have as explained here.

 

You can build the application by typing Ctrl+B and then execute it by clicking run.  Note that building this application takes a few minutes as it involves launching the Xilinx tools.

 

We have provided two implementations for task correlator:

 


C

used when the addone task is placed on a DSP


VHDL

used when the addone task is placed on an FPGA. Designed using the ImpulseC toolset.

 

Because you have these two implementations, you can move the correlator task from the FPGA to the DSP by dragging and dropping. Press run to re-build and execute the modified example.

 

The building blocks

The following tasks are used to build the example.

 

Display

The Display task is responsible for displaying graphic data on the host PC.  A host graphics window is created for each instance of this task in the DSP.

 

The source code for this task is not provided;  it is distributed as a pre-built .tsk file.

 

 

The task has two inputs. Channel 0 is the data to display and channel 1 receives control information to configure the properties of the graphic display.

 

Correlator

The correlator task expects 2048 floating point values and calculates the auto-correlation of the data.  This task is provided in two forms, one for the DSP and one for the FPGA (generated using the Impulse-C toolset).

 

 

MainCtrl

The MainCtrl task serves a main dialog for the example.  The dialog takes as input a text string that it displays. The output of the task is a shutdown command that is sent when you click the 'Terminate' button.

 

 

UI

The UI task presents a dialog that allows you to select frequency and amplitude information. These values are sent to channel 0. The task can accept a shutdown command to allow it to terminate cleanly.

 

 

Example2

The Example2 task is the central control point for the application. It receives parameters you put in from the host and uses them to generate a sine wave to be sent to other tasks. It accepts the auto-correlation results and sends them to the disp_cor task for display on the host.

 

Disp_cor

This task is responsible for displaying the results from the auto-correlation calculation.

 

 

Prerequisites

You  need the following components to be able to run this example:

 


Hardware

Quantity


At least one DSP and one FPGA

-


3L Diamond DSP licence

1


3L Diamond FPGA licence

1