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.

IQ Math Fixed point conversion library

Other Parts Discussed in Thread: CCSTUDIO

Hello all,

                 We have a downloaded the IQMath library for C64x+ CPU.

We tried some samples on the CCS simulator. It worked fine.

 

But we are facing some problem on the PC side. We read that we need to use the IQmath_pc.lib while using it on the PC.

We have with us VS 2008 and 2005. There seems to unresolved symbols as mentioned below.

 

We read the readme file in <IQMath install dir>\lib\VC++ Objs\readme.txt. It has been mentioned that the lib was built using VS6.0, but if anyone is using it with other versions of VS, then we could use the OBJ files directly.

 

But as mentioned, we are getting some errors. Can you kindly let us know how to resolve these errors. We have some algorithms that we want to convert to Fixed point on the PC , test the reference code and then port them to the C64X+ platform (Simulator).

 

Can you kindly let us know how to resolve these errors and if there is a sample which  is available for the VS 2005 /2008.

 

Note: IQmath_pc.lib is from the IQMath lib folder, IQMathSample.obj: Is our sample application.

 

We have tried the following

1)      included the IQMath_PC.lib in the project properties, linker->input-> additional dependencies

2)     Copied all the obj’s provided with IQMath to debug directory of the VC++ project

3)     Provided the path to both include and lib folder in the VC settings

4)     Tried using IQMath_inline.h, but this throws other errors like “Unknown variable _abs(), _loll etc…

 

None of the above have helped in resolving the below issues

==========================================================

The code in the application is mentioned below.

 

#include "stdafx.h"

#ifdef _INLINE_IQMATH

# include "IQmath_inline.h"

#else

# include "IQmath.h"

#endif

//#include "typedef.h"

 

#define PI  3.14159F

_iq input, sine_out, y;

int _tmain(int argc, _TCHAR* argv[])

{

      double z,M;

      M = 1.23;

      z = M*1.26 + 2.345;

      z =_IQmpy(M, _FtoIQ(1.26)) + _FtoIQ(2.345);

      z =_IQ23mpy(M, _FtoIQ23(1.26)) +_FtoIQ23(2.345);

     

      input = _IQ29(0.25*PI);

      y = _FtoIQ(10.9);

      printf("%d", input);

      return 0;

}

==========================================================

 

error LNK2019: unresolved external symbol __imp__printf referenced in function _wmain

1>IQMathSample.obj : error LNK2001: unresolved external symbol __fltused

1>IQmath_pc.lib(FtoIQ.obj) : error LNK2001: unresolved external symbol __fltused

1>IQmath_pc.lib(C6xSimulator.obj) : error LNK2001: unresolved external symbol __fltused

1>IQMathSample.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _wmain

1>IQMathSample.obj : error LNK2019: unresolved external symbol __ftol2_sse referenced in function _wmain

1>IQMathSample.obj : error LNK2001: unresolved external symbol __RTC_Shutdown

1>IQMathSample.obj : error LNK2001: unresolved external symbol __RTC_InitBase

1>LINK : error LNK2001: unresolved external symbol _wmainCRTStartup

1>IQmath_pc.lib(IQNmpy.obj) : error LNK2019: unresolved external symbol __chkesp referenced in function __IQNmpy

1>IQmath_pc.lib(C6xSimulator.obj) : error LNK2001: unresolved external symbol __chkesp

1>IQmath_pc.lib(FtoIQ.obj) : error LNK2019: unresolved external symbol __ftol referenced in function __FtoIQN

1>IQmath_pc.lib(C6xSimulator.obj) : error LNK2001: unresolved external symbol __ftol

 

 

 

Thanks and regards

/prasanna

  • Prasanna, We will look at the issue and suggest a fix soon. For now, please let me recommend that you use the provided source directly. Note, with the IQMath release we provide source for common kernels as well. The source is provided primarily to help get better performance on the 6x DSP by allowing inlining. You can see the source in the file:

    C:\CCStudio_v3.3\c64plus\IQmath_v213\include\IQmath_inline.h

    The file includes source for kernels that you are trying to use. You can directly use this source in your PC application.

    Regards,

    Gagan

  • Hello Gagan Maur,

                                    Thanks for the reply, we had earlier tried using the IQMath_Inline.h too...

    we have seen the source code, but we get the following errors,

    1>------ Build started: Project: IQMathSample, Configuration: Debug Win32 ------
    1>Compiling...
    1>IQMathSample.cpp
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(108) : warning C4244: '=' : conversion from 'float' to 'I32_IQ', possible loss of data

    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(141) : error C3861: '_abs': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(339) : error C3861: '_mpy32ll': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(340) : error C3861: '_hill': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(341) : error C3861: '_loll': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(362) : error C3861: '_sadd': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(389) : error C3861: '_norm': identifier not found
    1>d:\projectssemco\cognitiveradio\documents\ti\iqmath_floating_to_fixed_c64x+\include\iqmath_inline.h(632) : error C3861: '_ssub': identifier not found

    The above errors occur many more times, it totally comes to about 63 errors but all of them fall into the above category itself. I searched windows MSDN, there is a function for abs() but others are not there.

    I am not sure if i am using the inline functions properly. Can you let if these errors below are due to some mistake in using it or some other errors.

    thanks and regards

  • The functions use 6x specific intrinsics. You will need C implementation of these intrinsics for the code to compile correctly. You can download the C implementation of intrinsics from:

    https://www-a.ti.com/downloads/sds_support/applications_packages/index.htm

    Regards,

    Gagan

  • Hello Gagan,

                           Thanks for the reply. The following has been done. Kindly let me know if we are correct.

    1. Install IQMath Library
    2. Install Windows Port for C64x+ C intrinsics
    3. Create a sample project in Visual Studio 2005 (Ex., a Win32 Console app)
    4. Add all C & H files from c6xsim folder of the Windows port of Intrinsics
    5. Add all H files from include folder of the IQMATH installation
    6. Add the path of C6xSim folder in project properties->C/C++->General->additional include directory
    7. Add the following changes in below mentioned files
      _C6xSimulator_priv.h
       #define SIMULATION
       #define LITTLE_ENDIAN_HOST
      C6xSimulator.h
       #define SIMULATION
       #define TMS320C64PX
      C6xSimulator_base_types.h
       #define SIMULATION
      C6xSimulator_type_modifiers.h
       #define SIMULATION
    8. In file containing main() add #include "IQmath_inline.h" instead of IQmath.h
    9. In C6xSimulator.cpp add #include "stdafx.h“
    10. Add  #include "C6xSimulator.h“ in Iqmath_inline.h

    After this we notice that only the Format conversion utility, Arithmetic operations, Mis functions are working. But the Mathematical and Trigonometric functions are not working. All are unresolved symbols, no definition.

    But the same works fine on VS 6.0 with IQMath_PC.lib.

    eg., _IQNsqrt, _IQsinPU... etc

    thanks and regards

  • Prasanna,

     

    The Iqmath_inline.h file includes source only for common kernels. It doesn't include the source for mathematical and trigonometric functions. Thus, if you need to use these functions on the PC, you need to use the IQMath_PC.lib. Can you also include the IQMath_PC.lib in your application and see if that resolves the errors that you see? If not I'll try to create a PC library for your version of dev tool and provide as short term fix.

     

    Thanks,

    Gagan

     

  • Hello gagan,

                         We tried including the lib. Steps mentioned below. But we encountered the same problem.

    Projects Properties ->Linker->Input->Additional Directories->IQmath_pc.lib

    It would be good if you could compile the PC lib using VS_2005 & 2008 and share it.

    Also If possible, share some samples which you would try, to check, the build for Arithmetic, mathemetical, trignometry, formt conversion & misc api's of the PC Lib.

    Just wanted to check, i presume the PC lib source files are C/C++ files right, any porting issues from VS6.0 to VS2005/2008 ?

    regards

    prasanna

  • Prasanna, We will work on this and try to provide the requested libs soon. The PC lib uses all C files. Thus, no issues porting.

    Gagan

  • Hello Gagan

                            It would be of great help, as we need to start some fixed point conversion activity on the PC side and parallely on the TI processor too...

    Is the library source code sharable  to customer who have TI DSP platforms ? does it come with the package when we buy it ? (Either for LInux (GCC) or WIndows (CCS) )

    Or is the code sharable under any seperate license.

    thanks and regards

    prasanna

  • Prasanna, We can definately work on enabling you with you the most eficient solution. Do you have a local TI contact that you can raise your request to?

    Thanks,

    Gagan

     

  • Hello Gagan,

                          We are located in Bangalore India. We do interact with the OMAP team in bangalore for some technical queries, and we do have two TI platforms with us, OMAP 2430 & 3430. I am not sure, but i guess we will have a DM6446 platform in the near future.

    We shall try posting the request for the source code to the OMAP team. Shall keep you posted.

    Meanwhile, could you kindly compile the PC lib using VS 2005 & 2008 and share the lib files, so that we could continue with our activitiy.

     

    thanks and regards