2.3.2
Calling a DSPLIB Function From C
Code Composer Studio Users
2.3.3
Calling a DSP Function From Assembly
2.3.4
How DSPLIB is Tested - Allowable Error
In addition to correctly installing the DSPLIB software, you must follow these
steps to include a DSPLIB function in your code:
-
Include the function header file corresponding to the DSPLIB function
-
Link your code with dsp67x.lib
-
Use a correct linker command file for the platform you use. Remember
most functions in dsp67x.lib are written assuming little-endian mode of op-
eration.
For example, if you want to call the Autocorrelation DSPLIB function, you
would add:
#include <dspf_sp_autocor.h>
in your C file and compile and link using
cl6x main.c –z –o autocor_drv.out –lrts6700.lib -
ldsp67x.lib
Assuming your C_DIR environment is correctly set up (as mentioned in
section 2.2), you would have to add DSPLIB under the Code Composer Studio
environment by choosing dsp67x.lib from the menu Project → Add Files to
Project. Also, you should make sure that you link with the run-time support li-
brary, rts6700.lib.
The C67x DSPLIB functions were written to be used from C. Calling the func-
tions from assembly language source code is possible as long as the calling
function conforms to the Texas Instruments C6x C compiler calling conven-
tions. Here, the corresponding .h67 header files located in the 'include' directo-
ry must be included using the '.include' directive. For more information, refer to
section 8 (Runtime Environment) of the TMS320C6000 Optimizing C Compil-
er User's Guide (SPRU187).
DSPLIB is tested under the Code Composer Studio environment against a ref-
erence C implementation. Because of floating point calculation order change
for these two implementations, they differ in the results with an allowable toler-
ance for that particular kernel. Thus every kernel's test routine (in the driver
file) has error tolerance variable defined that gives the maximum value that is
acceptable as the error difference.
Installing and Using DSPLIB
Using DSPLIB
2-5
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers