2.1.9 HWAFFT Data and Scratch Pointers Copied as 16-Bit Instead of 23-Bit
On silicon revision 2.0, the HWAFFT uses two data buffers, data and scratch, to pass data to the FFT
coprocessor, to store intermediate results, and to store the FFT output. The hwafft_Npts routines available
in ROM use pointers to access the data and scratch buffers. These pointers are copied as 16-bit
addresses instead of 23-bit addresses when copying from AR0 to AR3 and from AR1 to AR2. The upper
bits are not copied which can lead to incorrect FFT results and potential corruption of data incorrectly
addressed by the hwafft_Npts routine.
The user is responsible for following one of the following workarounds:
• Execute hwafft_Npts from RAM using the updated hwafft.asm with bug fixes. The hwafft.asm file
included with SPRABB6.zip incorporates bug fixes for this errata. The HWAFFT routines stored in
ROM cannot be updated and do not incorporate these bug fixes. For reference, hwafft_rom.asm is
included in SPRABB6.zip and contains the HWAFFT routines exactly as they exist in the ROM of the
affected revisions.
• Execute hwafft_Npts from RAM or from ROM while passing duplicate pointers to the scratch and data
buffers to correctly initialize the upper bits of AR0, AR1, AR2, and AR3. The data and scratch buffers
can be located in word addresses greater than 0x10000, but the buffers must not cross 16-bit address
boundaries (that is, address bits 22–16 must not change). Additionally, if hwafft_512pts is used, data
and scratch must not reside at the beginning of a page boundary (that is, word address 0x10000 or
0x20000). This workaround initializes the most significant bits of internal registers AR2 and AR3 such
that when the 16-bit address is copied from AR0 and AR1, and provided the assumptions above are
satisfied, the full 23-bit address remains correct throughout HWAFFT execution.
In the user program wherever hwafft_Npts is called, replace:
out_sel = hwafft_Npts(data, scratch, fft_flag, scale_flag);
With:
out_sel = hwafft_Npts(data, scratch, scratch, data, fft_flag, scale_flag);
In hwafft.h, replace:
Uint16 hwafft_Npts(
Int32 *data,
Int32 *scratch,
Uint16 fft_flag,
Uint16 scale_flag
);
With:
Uint16 hwafft_Npts(
Int32 *data,
Int32 *scratch,
Int32 *duplicate_scratch,
Int32 * duplicate_data,
Uint16 fft_flag,
Uint16 scale_flag
);
怎么理解这段话,如何实现FFT,折腾了两个周了,还是无法解决问题,请教各位这个到底该如何实现?
希望能提供源码,万分感谢