XP-15 User Guide Texas Memory Systems, Inc. (8/6/01) A-2
*/
while ((cc = getopt(argc, argv, "hx:")) != EOF)
{
switch (cc)
{
case 'x':
xp15 = atoi(optarg);
break;
case 'h':
case '?':
default :
help();
}
}
/*
* Print some useful information
*/
printf("XP-15 Confidence test performing a %d point CFFT on XP-15 #%d\n",
fft_size,
xp15);
/*
* Allocate host memory for a test signal
*/
printf("Allocate memory for test signal and FFT results\n");
signal = (TMS_COMPLEX *)malloc(fft_size * sizeof(TMS_COMPLEX));
if (signal == NULL)
{
printf("Failed to allocate signal buffer memory\n");
exit(-1);
}
results = (TMS_COMPLEX *)malloc(fft_size * sizeof(TMS_COMPLEX));
if (results == NULL)
{
printf("Failed to allocate results buffer memory\n");
exit(-1);
}
/*
* Create a test signal, a single spike, and clear results buffer
*/
printf("Clearing results buffer\n");
memset(results, 0, fft_size * sizeof(TMS_COMPLEX));
printf("Creating test signal\n");
memset(signal, 0, fft_size * sizeof(TMS_COMPLEX));
signal[0].real = 16.0;
real_val = signal[0].real;
imag_val = 0.0;
/*
* Allocate XP-15 buffers
*/
cu = (TMS_COMPLEX *)vb_pointer(xp15, VP_RAM_A_MEM, 0);
cy = (TMS_COMPLEX *)vb_pointer(xp15, VP_RAM_B_MEM, 0);
/*
* Move the input signal into XP-15 local memory
*/