Other Parts Discussed in Thread: FFTLIB
Tool/software:
Hello Team,
I am implementing a standardized/generic FFT wrapper on top of FFTLIB (from AM275-FREERTOS-SDK v11.00.00.16) kernels FFTLIB_fft1d_i32f_c32fc_o32fc for real-to-complex FFT and FFTLIB_ifft1d_i32fc_c32fc_o32f for complex to real IFFT computations to be run on C7x core. I have followed the implemented test driver/harness in fftlib/test/fft_c7x/FFTLIB_fft1d_i32f_c32fc_o32fc/FFTLIB_fft1d_i32f_c32fc_o32fc_d.c and fftlib/test/fft_c7x/FFTLIB_ifft1d_i32fc_c32fc_o32f/FFTLIB_ifft1d_i32fc_c32fc_o32f_d.c as a reference for my wrappers. Accordingly, I have allocated the process buffers within my wrappers with 128-byte alignment as needed. However, I notice that even the buffers external to the library are needing a 128-byte alignment which seems like a subtle requirement. When I don't do that, i.e., if I allocate external buffers using simple malloc(), the execution stalls and my target board (AM275-EVM) freezes and goes to an irrecoverable/bad state and I need to do a power-cycle again. Please note that all these external, internal buffers are allocated to the heap. I have tried to reproduce this and tried out a few approaches to fix this in 4 separate CCS projects attached here in the .zip file:
# | CCS Project | Implementation Details | Observation | Implication |
1 | ti-fft | malloc() usage for external buffer, not aligned and minimal buffer copies used | Board freezes during execution | Desirable way |
2 | ti-fft-expt1 | No malloc() usage, all external buffers and library process buffers are 12-byte aligned | Successful execution | Expectation too impractical |
3 | ti-fft-expt2 | Same as 1, except that the wrapper uses a couple more buffers | Board freezes during execution | Not desirable with added buffers |
4 | ti-fft-expt3 | Same as 3, except that the extra buffer allocation is managed based on the operation | Board freezes during execution | Still acceptable |
It would be good to hear expert advise on this issue that I'm facing and looking forward to understand why this observation is seen and a possible solution to the problem.
PS: The projects contain copies of the dependent kernels for building the test applications. The dependencies may need to be adjusted for a successful build.
Regards,
Sreeekanth