This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cfft_offplace() missing from 55xdsp.lib; .asm won't build without serious warnings

Other Parts Discussed in Thread: TMS320VC5505

I have code compiling with cfft_NOSCALE(), but I would like to use cfft_offplace().  The former is provided in dsplib.h and 55xdspx.lib, but the latter is not.  When I attempt to build cfft_noscale.asm, there are many warnings, including CPU_75, CPU_85, CPU_92, and CPU_116.  If 55xdspx.lib uses the faster off-place code, then it's not documented, and there doesn't seem to be any way to locate the twiddle memory table for the off-place storage.

Apart from disassembling the machine code in 55xdspx.lib, I do not see any clues which give the full story here on my options.  The DSPLib documentation seems to make it clear that cfft_offplace() uses fewer cycles than cfft(), but how do I take advantage of that in my code?

  • Hi Brian,

     

    1) There is no cfft_offplace() routine in the dsplib. However, you can perform the complex bit-reversal with the cbrev() routine in either in-place mode or off-place mode.

     

    Usage:    void cbrev (DATA *x, DATA *r, ushort n)

    * If x==r, in-place bit reversal is performed.

    * Input vector x[ ] and output vector r[ ] must be aligned on 32−bit boundary

    E.g.

    #pragma DATA_ALIGN(r, 4);             // aligns r to 32-bit boundary

    DATA r[2*NX];                                  // contains bit-reversed version of x

    * The DSPLIB documentation says that in-place bit-reversal has better performance.

    * Make sure you have the current C55x DSPLIB source and documentation:
    http://focus.ti.com/docs/toolsw/folders/print/sprc100.html

     

     

    2) The types of warnings (or remarks) you are seeing are only problematic for specific silicon revisions under the conditions described in the warning. Depending on your DSP, many of these warnings may disappear if you specify a Custom Target to Code Composer. I can help you figure out what to put in the Custom Target field if you tell me what C55x part you are using and what revision it is.

     

    To set the custom target field: Open the Project Build Options > Click on “Compiler” tab > Click on “Basic” under Category > Enter “custom target string” into the Custom Target (-v) field.

     

    For example, the TMS320VC5505 should use custom target “cpu:3.3”.

     

     

    3) You can access the twiddle memory table by including twiddle.asm with the project source code (located at <dsplib_dir>\twiddle\twiddle.asm).

     

    Remove 55xdsp.lib from the list of included libraries so that your project links to your twiddle.asm instead of the library: Open the Project Build Options > Click on “Linker” tab > Click on “Libraries” under Category > Delete “55xdsp.lib” and any excess semicolons.

     

    You can then place the twiddle code anywhere in memory by specifying
    .sect ".twiddle"   (in twiddle.asm) and

    .twiddle : {} > SARAM3 PAGE 0  (in the “SECTION” block of linker command file –  cfft.cmd)

     

    Note that the twiddle table must be located in internal memory since it is accelerated by the C55x coefficient bus.

    For the best performance:

    * Input data in DARAM block.

    * Twiddle table in SARAM block or DARAM block different than the DARAM block that contains the input data.

     

     

    4) If you are looking for significant speed-up with the FFT routine, I recommend trying the TMS320VC5505 (http://focus.ti.com/docs/prod/folders/print/tms320vc5505.html) for its FFT hardware accelerator. The FFT accelerator is 4 ~ 6x more energy efficient and 2.2 ~ 3.8x faster than CPU alone.

     

    Hope this helps,

    Mark

  • Thanks for the information.

    1) For convenience, I have been referencing the Help Contents in CCS3, of which I have the latest release. In the Help Contents, a function named cfft_offplace() is documented, along with benchmarks in terms of cycle counts. Look in the section C55x DSP Reference, C55x Libraries, C55x DSP Library, DSPLib.  My guess is that someone should update the Help for the next release of CCS3 so that it no longer references this nonexistent function. Thanks for reminding me that I should be looking at SPRU422J, which I had already downloaded, but wasn't using yet.

    2) My DSP is the C5506, which does not seem to be supported by the custom target as you describe. Any suggestions for the 5506 would be appreciated.

    3) Thanks. If I get rid of 55xdspx.lib, then I assume I'll have to include the .asm source instead? It would seem somewhat important for performance that I hand-place twiddle.

    4) My application needs to calculate multiple 128-point FFTs at a rate of 15,625 times per second.  That seems like a lot, but I just realized that it probably only requires less than 25% of the capabilities of the C5506 running at it's maximum 108 MHz. Impressive! I don't think I need to switch to the C5505, which doesn't seem to be available yet from my suppliers.

  • Hi Brian,

    C5506 is a variant of C5509A. It uses the cpu:2.2. When you leave the "Custom Target" empty, it will use core 2.2 as default. At this point, only C5505/04 use the cpu:3.3.

    Ming   

  • Brian,

    I now see the cfft_offplace documentation you came across. I will check into correcting the Help documentation for Code Composer 3.3. Thanks for bringing that to our attention.

    You’ll have to include the asm source for each routine you need that was in the removed 55xdspx.lib, right. Probably: cbrev.asm, twiddle.asm, and cfft_noscale.asm.

    Sounds like a fun project.

    Thanks, Mark