DSPLIB

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   


Contents

Overview

The DSP Library (DSPLIB) is a collection of high-level optimized DSP function modules for the C55x DSP platform. This source-code library includes C-callable functions (ANSI-C language compatible) for general signal processing math and vector functions that have been ported to C55x DSPs. The functions listed in the features section are specifically optimized for the C55x DSPs.

Functions

Please check the product documentation or DSPLIB#Manuals for a detailed list of functions. Functions included are:

Download

Roadmap

Manuals

FAQ

Q: Can the DSPLIB implementation of FFT algorithms support 2048 or 4096 point complex FFTs?

Q: Does the DSPLib use the FFT Coprocessor found in the 55x? =

Q: How do get a 2048 or 4096 FFT using the HW accelerator?


Q: Why does DSPLIB Add function give incorrect results?

The add.asm file of DSPLIB v2.40.00 incorrectly sets circular addressing mode for the Auxillary Register AR1. Circular addressing is not required for this function and causes AR1 to be set to zero for use as offset pointer for a circular buffer implementation.


The routines in the DSPlib are tested using test routines which come with the library. The file add.asm passes these test routines, because the registers BSA01, which is used for the computation of the start address of the circular buffer, and BK03, which determines the buffer size, were set to zero. This setting effectively disables the circular "wrapping" of the addresses, and has a linear addressing scheme as a consequence. If registers BSA01 and BK03 are non-zero then the test will fail.


To correct this situation change add.asm statement:

ST2mask    .set  0000000000010010b to 
ST2mask    .set  0000000000010000b


This bug has been reported for C55x DSPLIB v2.40.00.

How can I rebuild the DSPLIB v2.40.00 library for a newer CPU rev. 3.x?


Here is how to rebuild the DSP library package for CPU rev. 3.3 with options to choose memory model:

  1. Copy and rename Blt55xx.bat in the dsplib_2.40.00 folder. Open with a text editor.
  2. Comment out c:\ti\dosrun.bat (CCS3.3 relic). REM is the CMD line comment (remark)
  3. Specify the path to the most current Code Gen Tools (CGT)
    Download Latest C55x Code Gen Tools here
  4. Add OPTIONS for C5505/15 (cpu:3.3, 5505, 5515 are equivalent) and desired memory model (use --ptrdif_size=32 for huge mem model only)
  5. Change the name of the output library to represent memory model (DSPLIB=55xdsph)
  6. Either double click the batch file or run it from Windows CMD line to see the output...
  7. Include the newly created library file in your project and test it with the DSPLIB examples


Here is how the Blt55xh.bat file should look for C5505/15(cpu:3.3) & huge mem model:

REM this file is for building DSPLIB in huge memory module on C5505/15
REM call c:\ti\dosrun.bat
set CGT_BIN=C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C5500 Code Generation Tools 4.3.8/bin
set PATH=%PATH%;%CGT_BIN%
REM Equivalent OPTIONS for C5505/15, huge memory model:
set OPTIONS= -g -vcpu:3.3 --memory_model=huge --ptrdiff_size=32
REM set OPTIONS= -g -v5515 --memory_model=huge --ptrdiff_size=32
REM set OPTIONS= -g -v5505 --memory_model=huge --ptrdiff_size=32
REM Equivalent OPTIONS for C5505/15, large memory model:
REM set OPTIONS= -g -vcpu:3.3 --memory_model=large
REM set OPTIONS= -g -v5515 --memory_model=large
REM set OPTIONS= -g -v5505 --memory_model=large
REM set OPTIONS= -g -v5505 -ml
set DSPLIB=55xdsph
set SRC=55x_src
set FILES= *.asm
set EXT=asm
REM built library in SRC dir  and then copy to root
del %DSPLIB%.src
del %DSPLIB%.lib
cd %SRC%
del *.obj
cl55 %OPTIONS% %FILES%
ar55 -r %DSPLIB%.src *.%EXT% ..\include\*.h
ar55 -r %DSPLIB%.lib *.obj
copy %DSPLIB%.src ..
copy %DSPLIB%.lib ..
del *.src
del *.lib
dir *.obj >> ..\junk.txt
del *.obj
cd ..

Related E2E Forum Post

v2.40.00 Errata

Rather than post the full code diffs, these notes are intended as brief documentation of errors that have been confirmed in the latest release of DSPLIB.

add alters 3 status registers without save and restore

The vector add() routine modifies ST0_55, ST1_55, and ST2_55 without saving the original values. Although an attempt is made to reverse the flag changes in one or two status registers, there's no guarantee that the original settings are restored. This could be fixed by pushing the original status register values on the stack.

mul32 alters T3 and AR5 without saving

The C language ABI for the C5000 requires that the callee preserve T2, T3, AR5, AR6 and AR7. mul32() alters T3 and AR5 without saving and restoring the initial value. PSH T3, PSHBOTH XAR5 and POPBOTH XAR5, POP T3 are all that need to be added to fix this.

sqrt_16 has off-by-one error and is coded inefficiently

The vector square root routine incorrectly rounds the results by adding 1, such that the square root of zero is one, and all results are off by the same amount. This can be repair by changing the bit shift count in the final instruction. In addition, the code does not make use of the ROUND instruction or the Round modifier for any other instruction, and thus the code is more complex than it needs to be. If optimizations are made, then no stack space is needed for intermediate values.

unpack writes outside the stack 50% of the time

The unpack() routine that is part of the rfft() macro uses AADD #-2, SP and MOV pair(T2), dbl(*SP(#0)) to save T2 and T3, following by MOV dbl(*SP(#0)), pair(T2) and AADD #2, SP to restore them. However, if the stack pointer happens to be odd, then T3 will be written outside the stack where it can be trashed by any hardware interrupt. The single instruction PSH T2, T3 accomplishes the required task in half the cycles and one fifth the code size, including the matching POP T2, T3.

twiddle table is not aligned

The documentation for cfft() states that the twiddle table must be aligned on a 32-bit word boundary, and yet the twiddle.asm source does nothing to ensure that this happens. Adding a single line with " .align 1024" between the .sect and twiddle: label makes everything kosher.

Support

Related


Leave a Comment

Comments

Latest version and download location

What is the latest version of dsplib? 2.40.00? 3.3?

Where can we find a download link for dsplib?

Searching for dsplib on the main Texas Instruments site produces 106 results, but no master page seems to collect the relevant information in one place. I thought perhaps that this page would hold some information along these lines. Rsdio 22:07, 26 July 2010 (UTC)

open source community participation and contributions

dsplib is open source, but have there been any external improvements or additions? Is there a community for dsplib outside of Texas Instruments? If so, where do I find out more? Rsdio 22:58, 5 July 2010 (UTC)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox