This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to use dsp library function "DSPF_sp_convol"

Hi,

Dear all:

I'm now trying to test performance of TI DSP C6747.

 

I found some strange issues:

1) Description of DSPLIB function "DSPF_sp_convol" is very difficult to understand and doesn't pairs with one example.

 

DSPF_sp_convol (Convolution)

The DSPF_sp_convol kernel convolves input array x with coefficient array h. The result is stored in output array y.

Function void DSPF_sp_convol(const float *x, const float *h, float *restrict y, const short nh,

const short ny)

Parameters x Pointer to input array. Must have ny + nh - 1 elements. Typically contains nh - 1 zero values at the beginning and

end of the array. Must be double word aligned.

h Pointer to coefficient array. Must have nh elements.

y Pointer to output array. Must have ny elements. Must be double word aligned.

nh Length of coefficient array. Must be an even number and greater than 0.

ny Length of input and output arrays. Must be an even number and greater than 0.

 

I can't understand how to fill input array and output array. You may better to give me a example.

 

2) Despite of this, I write some test functions to observe performance of this function in both EVM board and C6747 cycle simulator.

Finally I found:

1) For 81*31 float convolution, the final image can works and below is result:

[C674X_0] dsplib_convolution_test cycle = 116621

2) For 4096*8 float convolution, the image would block in some place and trap in dead loop.

 

So would you please help me to find out why (in simulator or EVM board).

 

Attached is CCS project file for C6747 which can run in both simulator and EVM board.

Thanks very much.

C6747_SIM_cpp_test.zip
  • What version of DSPLIB are you using? You will find sample code for that function under packages/ti/dsplib/src/DSPF_sp_convol. Are the results on the simulator and the EVM the same? I would imagine that they are different. The performance mentioned in the DSPLIB test report is obtained from the simulator environment and not on actual hardware.

    The simulator environment assumes flat memory architecture and assumes all memory space is internal to the device. However on actual hardware, if you place the data in the external memory(SDRAM or DDR) then you need to enable cache(L1P, L1D and L2) or move data using DMA to internal memory and do the processing on buffers defined in internal memory. Instead of placing the buffers in the external memory,  I would advice you to define sections for the the input and output buffers in internal memory in the linker command file and then place the data in those sections using #PRAGMA statements.

    For the issue of image being trapped in dead loop, I suspect you have an array alignment issue. The function requires the input and output array to be double word aligned in memory. You are likely to see issues like these if you do not follow the alignment requirements. I would recommend that you see the usage of the function from the test projects provided in DSPLIB and then post here if you have any further questions.

    Regards,

    Rahul

  • Thanks very much.