Hi,
I've been trying to run simple c6accel call for several days with poor results. Bellow is the shortest part of my code based on the example included in the c6accel package. It produces no output for the pTwiddle buffer. Could You please point me out what am I doing wrong? This code is very short and as readable as possible. It's just simple C6accel_DSP_gen_twiddle_fft16x16 function call. Thanks for any help. Konrad.
#include <stdio.h>
#include <xdc/std.h>
#include <ti/sdo/ce/Engine.h>
#include <ti/sdo/ce/CERuntime.h>
#include <ti/sdo/ce/osal/Memory.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <c6accelw.h>
#define ENGINENAME "omap3530"
#define ALGNAME "c6accel"
#define N 8192
C6accel_Handle hC6accel = NULL;
int main() {
UInt32 i;
CERuntime_init();
hC6accel = C6accel_create(ENGINENAME, NULL, ALGNAME, NULL);
C6Accel_setSync(hC6accel);
Memory_AllocParams memParams = Memory_DEFAULTPARAMS;
memParams.flags = Memory_CACHED;
memParams.type = Memory_CONTIGHEAP;
UInt32 framesize = (2*N * sizeof(Int16) );
Int16 *pTwiddle=NULL;
pTwiddle = Memory_alloc(framesize, &memParams);
if (pTwiddle == NULL) {
printf("Memory allocation error\n");
return(EXIT_FAILURE);
}
else {
Memory_cacheWbInv(pTwiddle, framesize);
}
memset(pTwiddle, 0x00, framesize);
C6accel_DSP_gen_twiddle_fft16x16(hC6accel, pTwiddle, N);
for (i=0 ; i<2*N; i++) {
printf("%X\n",*(pTwiddle + i));
}
if(pTwiddle)
Memory_free(pTwiddle, framesize, &memParams);
if (hC6accel)
C6accel_delete(hC6accel);
return(EXIT_SUCCESS);
}