DSPLIB User Guide
DSPLIB_fir_ci.cpp File Reference

Go to the source code of this file.

Macros

#define SE_PARAM_BASE   (0x0000)
 
#define SE_SE0_PARAM_OFFSET   (SE_PARAM_BASE)
 
#define SE_SE1_PARAM_OFFSET   (SE_SE0_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE_SA0_PARAM_OFFSET   (SE_SE1_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE_SA1_PARAM_OFFSET   (SE_SA0_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define FIR_MODE_SMALL_FIR   ( 0 )
 
#define FIR_MODE_LARGE_FIR   ( 1 )
 
#define FIR_MODE_SMALL_FIR_SS   ( 2 )
 
#define SMALL_FIR_LOOP_UNROLL_FACTOR   ( 4 )
 
#define LONG_FIR_OUT_SAMPLES_PER_BLOCK   ( 8 )
 
#define LONG_FIR_NUM_OUT_SAMP_GROUPS   ( 2 )
 
#define LONG_FIR_TOT_OUT_SAMPLES_PER_BLOCK    ( LONG_FIR_OUT_SAMPLES_PER_BLOCK * LONG_FIR_NUM_OUT_SAMP_GROUPS )
 

Functions

void DSPLIB_fir_perfEst (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, uint64_t *archCycles, uint64_t *estCycles)
 This is a utility function that gives an estimate of the cycles consumed for the kernel execution. More...
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_fir_getSizes (const DSPLIB_fir_InitArgs *pKerInitArgs, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut)
 This is a query function to calculate the sizes of input, filter and the output buffers. More...
 
template DSPLIB_STATUS DSPLIB_fir_getSizes< float > (const DSPLIB_fir_InitArgs *pKerInitArgs, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut)
 
template DSPLIB_STATUS DSPLIB_fir_getSizes< int16_t > (const DSPLIB_fir_InitArgs *pKerInitArgs, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut)
 
template DSPLIB_STATUS DSPLIB_fir_getSizes< int32_t > (const DSPLIB_fir_InitArgs *pKerInitArgs, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut)
 
template DSPLIB_STATUS DSPLIB_fir_getSizes< int8_t > (const DSPLIB_fir_InitArgs *pKerInitArgs, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_fir_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_fir_InitArgs *pKerInitArgs)
 This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_fir_init. More...
 
template DSPLIB_STATUS DSPLIB_fir_init_ci< int16_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_fir_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_fir_init_ci< int32_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_fir_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_fir_init_ci< int8_t > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_fir_InitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_fir_init_ci< float > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsFilter, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_fir_InitArgs *pKerInitArgs)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_fir_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
 This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_fir_exec. More...
 
template DSPLIB_STATUS DSPLIB_fir_exec_ci< int16_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_fir_exec_ci< int32_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_fir_exec_ci< int8_t > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
 
template DSPLIB_STATUS DSPLIB_fir_exec_ci< float > (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
 

Macro Definition Documentation

◆ SE_PARAM_BASE

#define SE_PARAM_BASE   (0x0000)

Definition at line 51 of file DSPLIB_fir_ci.cpp.

◆ SE_SE0_PARAM_OFFSET

#define SE_SE0_PARAM_OFFSET   (SE_PARAM_BASE)

Definition at line 52 of file DSPLIB_fir_ci.cpp.

◆ SE_SE1_PARAM_OFFSET

#define SE_SE1_PARAM_OFFSET   (SE_SE0_PARAM_OFFSET + SE_PARAM_SIZE)

Definition at line 53 of file DSPLIB_fir_ci.cpp.

◆ SE_SA0_PARAM_OFFSET

#define SE_SA0_PARAM_OFFSET   (SE_SE1_PARAM_OFFSET + SE_PARAM_SIZE)

Definition at line 54 of file DSPLIB_fir_ci.cpp.

◆ SE_SA1_PARAM_OFFSET

#define SE_SA1_PARAM_OFFSET   (SE_SA0_PARAM_OFFSET + SE_PARAM_SIZE)

Definition at line 55 of file DSPLIB_fir_ci.cpp.

◆ FIR_MODE_SMALL_FIR

#define FIR_MODE_SMALL_FIR   ( 0 )

Definition at line 58 of file DSPLIB_fir_ci.cpp.

◆ FIR_MODE_LARGE_FIR

#define FIR_MODE_LARGE_FIR   ( 1 )

Definition at line 59 of file DSPLIB_fir_ci.cpp.

◆ FIR_MODE_SMALL_FIR_SS

#define FIR_MODE_SMALL_FIR_SS   ( 2 )

Definition at line 60 of file DSPLIB_fir_ci.cpp.

◆ SMALL_FIR_LOOP_UNROLL_FACTOR

#define SMALL_FIR_LOOP_UNROLL_FACTOR   ( 4 )

Definition at line 63 of file DSPLIB_fir_ci.cpp.

◆ LONG_FIR_OUT_SAMPLES_PER_BLOCK

#define LONG_FIR_OUT_SAMPLES_PER_BLOCK   ( 8 )

Definition at line 66 of file DSPLIB_fir_ci.cpp.

◆ LONG_FIR_NUM_OUT_SAMP_GROUPS

#define LONG_FIR_NUM_OUT_SAMP_GROUPS   ( 2 )

Definition at line 67 of file DSPLIB_fir_ci.cpp.

◆ LONG_FIR_TOT_OUT_SAMPLES_PER_BLOCK

#define LONG_FIR_TOT_OUT_SAMPLES_PER_BLOCK    ( LONG_FIR_OUT_SAMPLES_PER_BLOCK * LONG_FIR_NUM_OUT_SAMP_GROUPS )

Definition at line 68 of file DSPLIB_fir_ci.cpp.

Function Documentation

◆ DSPLIB_fir_getSizes< float >()

template DSPLIB_STATUS DSPLIB_fir_getSizes< float > ( const DSPLIB_fir_InitArgs pKerInitArgs,
DSPLIB_bufParams2D_t bufParamsIn,
DSPLIB_bufParams2D_t bufParamsFilter,
DSPLIB_bufParams2D_t bufParamsOut 
)

◆ DSPLIB_fir_getSizes< int16_t >()

template DSPLIB_STATUS DSPLIB_fir_getSizes< int16_t > ( const DSPLIB_fir_InitArgs pKerInitArgs,
DSPLIB_bufParams2D_t bufParamsIn,
DSPLIB_bufParams2D_t bufParamsFilter,
DSPLIB_bufParams2D_t bufParamsOut 
)

◆ DSPLIB_fir_getSizes< int32_t >()

template DSPLIB_STATUS DSPLIB_fir_getSizes< int32_t > ( const DSPLIB_fir_InitArgs pKerInitArgs,
DSPLIB_bufParams2D_t bufParamsIn,
DSPLIB_bufParams2D_t bufParamsFilter,
DSPLIB_bufParams2D_t bufParamsOut 
)

◆ DSPLIB_fir_getSizes< int8_t >()

template DSPLIB_STATUS DSPLIB_fir_getSizes< int8_t > ( const DSPLIB_fir_InitArgs pKerInitArgs,
DSPLIB_bufParams2D_t bufParamsIn,
DSPLIB_bufParams2D_t bufParamsFilter,
DSPLIB_bufParams2D_t bufParamsOut 
)

◆ DSPLIB_fir_init_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_fir_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsFilter,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_fir_InitArgs pKerInitArgs 
)

This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_fir_init.

This function determines the configuration for the streaming engine and MMA hardware resources based on the function call parameters, and the configuration is saved in bufPBlock array. In the kernel call sequence, DSPLIB_fir_exec_ci would be called later independently by the application. When DSPLIB_fir_exec_ci runs, it merely retrieves the configuration from the bufPBlock and uses it to set up the hardware resources. This arrangement is so that DSPLIB_fir_exec_ci does not lose cycles to determine the hardware configuration.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsFilter: Pointer to the structure containing dimensional information of filter buffer
[out]bufParamsOut: Pointer to the structure containing dimensional information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

Definition at line 128 of file DSPLIB_fir_ci.cpp.

◆ DSPLIB_fir_init_ci< int16_t >()

template DSPLIB_STATUS DSPLIB_fir_init_ci< int16_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsFilter,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_fir_InitArgs pKerInitArgs 
)

◆ DSPLIB_fir_init_ci< int32_t >()

template DSPLIB_STATUS DSPLIB_fir_init_ci< int32_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsFilter,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_fir_InitArgs pKerInitArgs 
)

◆ DSPLIB_fir_init_ci< int8_t >()

template DSPLIB_STATUS DSPLIB_fir_init_ci< int8_t > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsFilter,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_fir_InitArgs pKerInitArgs 
)

◆ DSPLIB_fir_init_ci< float >()

template DSPLIB_STATUS DSPLIB_fir_init_ci< float > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsFilter,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_fir_InitArgs pKerInitArgs 
)

◆ DSPLIB_fir_exec_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_fir_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pFilter,
void *restrict  pOut 
)

This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_fir_exec.

The function uses MMA hardware accelerator to perform the convolution computation. Filter data is loaded into B panel of the MMA from memory using one streaming engine, while the input data is loaded into A vectors of the MMA using the other streaming engine. Result of the compute from MMA C panel is stored into memory using a stream address generator.

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to buffer holding the input data
[in]pFilter: Pointer to buffer holding the filter data
[out]pOut: Pointer to buffer holding the output data
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.
Performance Considerations:
For best performance,
  • the input and output data buffers are expected to be in L2 memory
  • the buffer pointers are assumed to be 64-byte aligned

Definition at line 424 of file DSPLIB_fir_ci.cpp.

◆ DSPLIB_fir_exec_ci< int16_t >()

template DSPLIB_STATUS DSPLIB_fir_exec_ci< int16_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pFilter,
void *restrict  pOut 
)

◆ DSPLIB_fir_exec_ci< int32_t >()

template DSPLIB_STATUS DSPLIB_fir_exec_ci< int32_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pFilter,
void *restrict  pOut 
)

◆ DSPLIB_fir_exec_ci< int8_t >()

template DSPLIB_STATUS DSPLIB_fir_exec_ci< int8_t > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pFilter,
void *restrict  pOut 
)

◆ DSPLIB_fir_exec_ci< float >()

template DSPLIB_STATUS DSPLIB_fir_exec_ci< float > ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pFilter,
void *restrict  pOut 
)