Texas Memory Systems XP-15 manual Null

Page 13

status = vmov((TMS_FLOAT *)signal, (TMS_FLOAT *)cu, fft_size * 2); if (status < 0)

sam_error(status);

/*

 

 

* Perform the CFFT

 

 

*/

 

 

printf("Performing CFFT\n");

 

 

status = cfft(cu,

/* input buffer

*/

NULL,

/* Twids not needed by XP-15

*/

cy,

/* output/scratch buffer

*/

1,

/* repeat value - 1 this time

*/

1.0,

/* forward FFT scaled by 1.0

*/

fft_size);

/* one million complex points */

if (status < 0)

 

 

sam_error(status);

 

 

/*

*Move the FFT results back to host memory

*(returned status indicates which buffer holds the final results)

*/

if (status == 1)

status = vmov((TMS_FLOAT *)cu, (TMS_FLOAT *)results, fft_size * 2); else

status = vmov((TMS_FLOAT *)cy, (TMS_FLOAT *)results, fft_size * 2); if (status < 0)

sam_error(status);

/*

*Synchronize with the XP-15

*/

printf("Wait for all XP-15 functions to complete\n"); status = viper_sync(xp15, -1);

if (status < 0) sam_error(status);

/*

*Print values

*/

printf ("First 10 values of CFFT results:\n"); for (ii=0; ii<10; ii++)

printf ("%02d: [%8.4f, %8.4f]\n",

ii, results[ii].real, results[ii].imag);

/*

*Check result vector

*/

ecount = 0;

printf ("Checking result vector..\n"); for (ii=0; ii<fft_size; ii++)

{

if ((results[ii].real != real_val) (results[ii].imag != imag_val))

{

if (ecount < 5)

{

printf ("Error in element

%d", ii);

 

printf ("

ShB: [%8.4f,

%8.4f] ", real_val, imag_val);

 

printf ("Is: [%8.4f, %8.4f]\n",

 

 

results[ii].real,

 

 

 

 

XP-15 User Guide

Texas Memory Systems, Inc. (8/6/01)

A-3

Image 13
Contents User Guide XP-15 Vector ProcessorTable of Contents Related Texts IntroductionTypographical Conventions Overview Installing the XP-15 Hardware InstallationInstalling the XP-15 Software Running the XP-15 Confidence Test Diagnostic Confidence TestMake Gcc -I$TMS/include -o cfft cfft.c -L$TMS/lib -lvp -lsam XP-15 User Guide Texas Memory Systems, Inc /6/01 Overview Midas Programming Example XtmicRunning the Xtmic Example XP-15 User Guide Texas Memory Systems, Inc /6/01 Cfft Appendix a XP-15 Confidence TestXP-15 User Guide Texas Memory Systems, Inc /6/01 Null XP-15 User Guide Texas Memory Systems, Inc /6/01 Specification Appendix B PCI Local Bus SpecificationsReserved Appendix C XP-15 Hardware Control and Status RegistersEcho