As the subject says ,I don't know how to process floating-point data on DSP side. can anybody help?
Thanks
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.
DM6446 has a C64x+ DSP core; however, this DSP core does not support floating point operations in hardware; floating point operations on this platform will take place in software such as a C program.
As Juan mentions there is no hardware support for floating point so any floating point operations will be done in software, however we do already provide floating point software support. The standard run time support library will allow you to do floating point operations in C code as it is, though if you are looking for additional performance beyond the standard RTS there is an IQMath library for the C64x+ available here that may be of some help.
I believe the following document mught be helpful: http://focus.ti.com/lit/ug/spru198i/spru198i.pdf
The standard RTS is already included by default in a C64x+ application, more specifically it is linked in by the auto generated linker command file by DSP/BIOS as it is a dependency. If you did not have the RTS included already there would be many standard C functions that would not work; moreover at build time you would get linker errors regarding missing objects.
Essentially you should be able to perform such operations in your C code without including any libraries yourself.
As to RTS documentation, section 8 of SPRU187 should be of some help.
I want to use IQMath lib to verify my alg in PC (linux system), I rename IQmath_pc.lib to IQmath_pc.a, and then I try:
-------------------------------------------------------------------
#define GLOBAL_Q 24
#include <IQmath.h>
int main()
{
_iq a;
a = _FtoIQ(2.5);
return 0;
}
-------------------------------------------------------------------
# gcc -c -g -Wall -I. -otest.o test.c
# gcc -otest -lm test.o IQmath_pc.a
test.o: In function `main':
/tmp/tmp/test.c:64: undefined reference to `_FtoIQN'
collect2: ld returned 1 exit status
Can "IQmath_pc.lib" be used in linux? How can I compile it?
thanks.
I believe IQMath is strictly a 64x+ library; therefore, it has to be built/linked with 64x+ tool chains (compiler, linker,...) as opposed to gcc; the 64x+ tool chains are provided for Linux in DM6446 DVSDK; therefore, theoretically, you should be able to build a DSP algorithm which uses IQMath from Linux command line (similar to building a codec which uses other DSP libraries). Therefore, I do believe it can be used within Linux, but not used with Linux tool chains.
Thanks Juan,
While I revise my question, Gagan has answered it. So I'm very sorry about that.
And here is my another questions:
Juan, As your recommendation, I should use a command existed in "../dvevm_x_xx/cg6x_x_x_xx/bin" to build the "test" program for Linux based on x86. is that right?
Lorry,
You are right. The PC Lib is provided so that users can test their application that has been modified to use IQMath on PC host. This may help resolve issue quickly and provide more flexibility in development. For now, I suggest the below solution:
With the IQMath library release, there is source provided for some of the most commonly used kernels. The intent of providing the source is so that customers can inline the code in their embedded application and improve perfromance. You can use the provided source in your linux environment. The source includes FtoIQN API that you have been trying to use. See the source at: C:\CCStudio_v3.3\c64plus\IQmath_v213\include\IQmath_inline.h
Note, some of the kernels use device intrinsics. You can use the C equivalent provided for these intrinsics. You can get that here: https://www-a.ti.com/downloads/sds_support/applications_packages/index.htm
For next release version of the Library, we will include the lib that can be used in linux environment as well.
Regards,
Gagan
I'm sorry Gagan, I'm revising my question, and I don't know you've answered it.
After reading your post, I sitll have questions:
Here I quote from IQmath:
---------------------------------------------------------------------------
... ... ... ..
Additionally, an x86-based host library is also provided for host (PC) testing of the IQmath code. This is
functionally equivalent to the target library:
IQmath_pc.lib
The code generation tool version used to create the IQmath libraries is v6.0.16.
---------------------------------------------------------------------------
1.if "IQmath_pc.lib" is built by code generation tools, I think my test program based on pc x86 should use these tools to build, otherwise the lib file can not be linked properly. is that right?
2. After consideration, I think I should not use VC++ to compile my test program, because the compiler that VC++ has is not related with cgtools.
3. Do you mean that this lib does not support linux system x86 currently?
Thanks.
Laura,
> 1.if "IQmath_pc.lib" is built by code generation tools, I think my test program based on pc x86 should use these tools to build, otherwise the lib file can not be linked properly. is that right?
The IQMath_pc.lib is built using VC++ tools. The comment about 'code generation tool version used to create the IQmath libraries is v6.0.16.' is for the IQMath.lib that is compiled using TI compiler version 6.0.16 and is meant to be used for execution on TI 64x+ based DSPs.
> 2. After consideration, I think I should not use VC++ to compile my test program, because the compiler that VC++ has is not related with cgtools.
What are you trying to do? If you are trying to build your code for execution on TI 6x DSP, use the IQmath_c64x+.lib. If you are trying to build your code on windows and execute for ex on VC environment, you can use IQmath_pc.lib. If you are planning to build and test your application on Linux machine, please follow the syeps I suggested in previous post.
> 3. Do you mean that this lib does not support linux system x86 currently?
Yes. Such support is not provided today.
Regards,
Gagan