![]() |
Demo program for FFT/IFFT IP Core.
The Usage() function shows how to execute the test program, options available and default values set for different configuration variables. The Variables section specifies variables used in the test program, what they specify, the values it holds and can take. The main() function specifies sequence of api calls executed and tested.
Functions | |
| void | FFTUsage () |
| int | main (int argc, char *argv[]) |
Variables | |
| fpgawb_ipcore_t | ip_core |
| fpgawb_ipcore_t struct which stores useful information about the IP Core after executing get IP Info api call. Check fpgawb_lib.h or api call documentation for more information | |
| fpgawb_ipcore_fft_config_t | enable_config |
| fpgawb_ipcore_fft_config_t struct which stores enable/activate information about all channels of the IP Core. Check fpgawb_lib.h or api call documentation for more information | |
| fpgawb_ipcore_fft_direction_t | direction_config |
| fpgawb_ipcore_fft_direction_t struct which stores configuration information about all channels of the IP Core. Check fpgawb_lib.h or api call documentation for more information | |
| void FFTUsage | ( | ) |
Usage:
./fpgawb_ipcore_fft [-b BoardNumber] [-c channelNumber and direction]
| Options | Default value |
|---|---|
| -b Board Number | 0 |
| -C channel Number (0-(Numchans-1)) and direction (0-FFT,1-IFFT) | 0 |
Examples:
./fpgawb_ipcore_fft -b0 -c0@1 -c1@0
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Step 1: OPEN DEVICE
ccrtNGFC_Open(&handle,board_no,oflags)
Before using any API calls, the user needs to open the device and get a handle. This handle is then used as the first argument in most of the following APIs.
Step 2: GET DRIVER INFO
ccrtNGFC_Get_Driver_Info(handle, &binfo)
This call returns useful driver information and saves in the ccrtngfc_driver_info_t structure for later use.
Step 3: GET LIBRARY INFO
ccrtNGFC_Get_Library_Info(handle, &linfo)
This call returns useful library information and saves in the ccrtngfc_library_info_t structure for later use.
Step 4: GET IP INFO
fpgawb_FFT_Get_Ip_Info(handle, &ip_core)
This call returns useful IP Core information and saves in the fpgawb_ipcore_t structure for later use.
Step 5: ACTIVATE FFT/IFFT CHANNELS
fpgawb_FFT_Activate_Ch(handle, &enable_config) This call activates the FFT/IFFT IP Core Channels. Note to set activate to 0 because we will be using the Config api calls which requires the activate mask in this config struct to be 0. Each actived channel is set to 1 at the end.
Step 6: CONFIGURE/SETUP CHANNEL DIRECTION
C_fpgawb_FFT_Set_Direction_Ch(handle, &direction_config) This call sets the direction of each FFT/IFFT channel. Note that the direction of each channel must match the direction in the FPGAWB project to function properly. Each bit in the mask corresponds to a channel with 0-FFT and 1-IFFT
Step 7: ACTIVATE FFT/IFFT CHANNELS
fpgawb_FFT_Activate_Ch(handle, &enable_config) This call activates the FFT/IFFT IP Core Channels. Setting each channel's bit in the enable and activate mask to 1 will cause the channel to start running. Set the activate bit to 1 after configuring the direction.
Step 8: CLOSE DEVICE
ccrtNGFC_Close(handle)
Closes the device with the handle.