Function Definition

The function interface defines the entry points into the library, as a function or set of functions that can be called in user code to target the IP. The function definitions can contain empty function bodies since the SDSoC compilers will replace them with API calls to execute data transfers to/from the IP block. The implementation of these calls depend upon the data motion network created by the SDSoC system compilers. The function definition must #include stdlib.h and stdio.h, which are used when the function body is replaced and compiled.

For example:
// FILE: fir.c
#include "fir.h"
#include <stdlib.h> 
#include <stdio.h>
void fir(signed char X[N], short Y[N])
{
    // SDSoC replaces function body with API calls for data transfer
} 
IMPORTANT!: Application code that links to the library must also #include stdlib.h and stdio.h, which are required by the API calls in the stubs generated by the SDSoC system compilers.

When using the sdx_pack utility, there is no need to create function definition files. The sdx_pack utility automatically generates the function definition files from the declarations in the header file.