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.

LAUNCHXL-F28379D: FPUFastRTS library

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Hello,

I tried to use the FPUfastRTS library.

SysConfig tool describes available functions:

when looking at the library contents, we can seen that sinf is not declared, but defined as the intresics function __sin().

So, to calculate a sine, I personnaly do not use this library, but directly the intrisics function.

But I wonder what is the asinf function.

- Sysconfig says that there is a TMU support

- as sinf, asinf is not declared in the library

- but there is no intrisic function for asin

- the execution of the asinf function is very long

- when clicking on the name of the function in my code, I only have a declaration in the standard library math.h (I don t know anything about this function, except what I saw when disassembling my code)

So my question is:

is there actually a TMU support for the function asin ?

thank you for you answers (if there is no mean to accelerate the calculation of asinf, I can use the __sin() intrisic finction in a algorithm)

  • Hello Vincent,

    But I wonder what is the asinf function.

    This function calculates arc sine.

    - Sysconfig says that there is a TMU support

    - as sinf, asinf is not declared in the library

    - but there is no intrisic function for asin

    - the execution of the asinf function is very long

    - when clicking on the name of the function in my code, I only have a declaration in the standard library math.h (I don t know anything about this function, except what I saw when disassembling my code)

    The function is supposed to be pulled from the FPUfastRTS source file (there are assembly files for each of these functions such as sinf and asinf), however it looks like for some reason the compiler's version is what's being used instead. I'm not sure why this is (I developed this SysConfig interface and when I test it, it called the library functions not the compiler's intrinsics), so I'll try to confirm with the compiler team with what's going on.

    is there actually a TMU support for the function asin ?

    It looks like it, yes. If you want to double-check, you can look at the TMU section in the C28x Extended Instruction Set.

    If you see these instructions either in the disassembly or the source files for the FPUfastRTS functions (C2000Ware_5_00_00_00\libraries\math\FPUfastRTS\c28\source\fpu32), then the function supports using the TMU.

    (if there is no mean to accelerate the calculation of asinf, I can use the __sin() intrisic finction in a algorithm)

    In SysConfig the performance of the different functions are included in the (?) at the top of the functions drop-down:

    I will get back to you once I have a response from the compiler team why the proper library functions are not being included.

    Best regards,

    Omer Amir

  • It looks like it, yes. If you want to double-check, you can look at the TMU section in the C28x Extended Instruction Set.

    Hello,

    The extended instructions set, as well as the Compiler Manual Reference, shows that the sine function is supported by the TMU, not the asin function.

    Did I miss something ?

    Thank you for your help. I wait for your compiler team .

    Vincent

  • Hi Vincent,

    I see what you mean now; no, there is no TMU operation for arc sine, only arc tangent. I had thought you were talking about the asinf function used in the FPUfastRTS library, which uses TMU/FPU instructions to speed up the operation.

    Best regards,

    Omer Amir

  • That's why I meant actually.

    I was just surprised you showed me this table, because it does not prove that FPUFastRTS uses this TMU intrisics functions to optimize the asin or acos calculation.

    So, I look forward to receiving your response about the asin function proposed in the library, but still grayed out

    Also its execution is more than 50 cycles (performance proposed by the math.h) or 30 cycles (perfromance proposed by the TMU support)

    Again, thank you for helping me.

    Vincent

  • edit:

    I did a test to show you the performance I have:

    I made a simple example to meseaure the calculation time of the asin function:

    It takes 30µs !

    When disassembling the code, it does not seem that the generated code uses characteric instructions of the TMU:

  • Hello Vincent,

    That's why I meant actually.

    I was just surprised you showed me this table, because it does not prove that FPUFastRTS uses this TMU intrisics functions to optimize the asin or acos calculation.

    So, I look forward to receiving your response about the asin function proposed in the library

    The asinf function in the FPUfastRTS library does use the TMU-optimized assembly functions, as seen in the asin_f32.asm file:

    If you're not seeing this sort of function in Disassembly, then it may be that the compiler intrinsic function is being called instead of the FPUfastRTS version. I'm already asking some others about this, so I will get back to you once I determine I have a working solution on my side.

    Best regards,

    Omer Amir

  • Hello Vincent,

    I was able to create a working example using the Universal Project example provided for SysConfig on another device and migrating it to the F2837xD. I was able to run the code from the FPUfastRTS example with the proper assembly functions being called. I'm not sure what example (if any) you based your program off, but it may be a good idea to use the Universal Project as a starting point.

    To clarify, I believe the issue that you were seeing with the compiler intrinsic function being called instead of the library's function was actually caused by some file paths or include options not being included properly (specifically relating to the c2000ware_libraries.cmd.genlibs file); however, the universal project has all the valid paths and so I was able to run it properly on my side. There is already a working action to migrate examples to the universal-format, however because of how many this is a future update.

    Best regards,

    Omer Amir

  • Hello.

    Thank you for coming back to me.

    I tested it with several projects provided by TI. But let's get the example for the 49C (it doeas have the TMU):

    I add the library, the build the project:

    The library can be seen in the project, but arcsin or arccos function are not declared

    So I load a project which contains this library:

    I can see the same thing in the included files:

    But there are several asm files in the project

    So, I think it is normal not to use the functions in the FPUFastRTS functions, because these are defined in assembly language in the project.

    When adding the library with SysConfig, I expect that this asm function would be added in the project.

    Am I wrong ?

    Does your universal project include the asm functions ?

  • Hello Vincent,

    When adding the library with SysConfig, I expect that this asm function would be added in the project.

    Am I wrong ?

    How exactly are you including the .syscfg SysConfig file into the empty_project example? There is no SysConfig file in this example by default, so I don't believe it has the proper include paths/file search options configured.

    Does your universal project include the asm functions ?

    It's not necessarily about including the asm functions, it's more about having the correct file paths and resources included. The universal project has this, so that's why I pointed to it for this device (since this project is specifically made to easily migrate from one device to another). I recommend using this project if you're trying to use an exampled for the F2837xD device, since not many of the provided examples for that device have SysConfig enabled. (You can just import the universal project from another device and migrate it - refer to the C2000 SysConfig video on One Click Migration).

    Best regards,

    Omer Amir

  • How exactly are you including the .syscfg SysConfig file into the empty_project example? There is no SysConfig file in this example by default, so I don't believe it has the proper include paths/file search options configured.

    Yes it has (for the 49C)

    Or directly by importin the project in this folder:

  • Hello Vincent,

    Looking at the empty_project example I don't see a problem, everything looks to be included/declared.

    The same holds for the universal project. What version of C2000Ware are you using?

    Best regards,

    Omer Amir

  • That's odd.

    as you can see on a previous screen shot I use the 5.0 Release

  • I re installed C2000Ware. ANd this still does not work. Please tell me what we can check to verify every paths are OK

  • the functions are declared only within the macro (FOR_DOXYGEN_ONLY)

    If I click on one of these function, it opens math.h (so actually, I don't want to use these functions)

  • Hi Vincent,

    Omer is currently traveling, so please allow until Monday for a follow-up response. In the mean time, as one item to confirm, could you please check that the library file path Omer mentioned earlier in this thread is included in the project specifications? To do so, right-click on the project, go to 'Properties' > 'C2000 Linker' > 'File Search Path' and check that 'c2000ware_libraries.cmd.genlibs' appears listed in the first box there. And perhaps it may be helpful if you could provide a screenshot of the other paths that are listed there to make sure we align on that.

    Regards,

    Allison

  • Hello, thank you for helping me.

    Down here a sreen shot pf the properties of the project:

    ( 'c2000ware_libraries.cmd.genlibs' does appear)

  • Hello Vincent,

    the functions are declared only within the macro (FOR_DOXYGEN_ONLY)

    This conditional should be removed (I have made this fix for the next C2000Ware release).

    Down here a sreen shot pf the properties of the project:

    Can you show the Products tab under the General option for Project Properties? It should look something like the below image:

    If this is correct, can you try to create a project using the universal project from another device? You can migrate it to the F2837xD within the SysConfig tool, and all the file paths/linked resources should be correct for including the FPUfastRTS library via SysConfig itself (I have verified this on my side).

    Best regards,

    Omer Amir

  • Hello Omer,

    If I removed the conditional, the trigonometric functions are defined in math.h. So they don't use the TMU

    Down here the screen shot you asked for:

    I must say that I prefer to have examples that work rather than to migrate someting an other project.

    I don't want to recreate the project I am working on

  • Hello Vincent,

    I must say that I prefer to have examples that work rather than to migrate someting an other project.

    I don't want to recreate the project I am working on

    The alternative to using the universal project is to import it and find any differences in your Linked Resources, Include Options, and File Search Path settings for both projects. I have verified that the universal project works, so the paths should be correct. If you can verify these paths/options on your project and still see an error let me know. Make sure that the Processor Options is using FPU32 and the FPU support option.

    Best regards,

    Omer Amir

  • is to import it and find any differences in your Linked Resources

    Hello. Can you do that for me with the empty project provided as example for the 49C ? (not my project, the project provided by TI, that people should use to be sure to not have any problems)

    Make sure that the Processor Options is using FPU32 and the FPU support option.

    I checked FPU32 but did not find the FPU support option. But since I use intrinsics function for the TMU, I think that everything is OK

  • Hello Vincent,

    I checked FPU32 but did not find the FPU support option. But since I use intrinsics function for the TMU, I think that everything is OK

    Yes, I meant the float support option. That should be fine.

    Hello. Can you do that for me with the empty project provided as example for the 49C ? (not my project, the project provided by TI, that people should use to be sure to not have any problems)

    I compared the settings I mentioned and I actually didn't find any significant differences. I imported the empty_driverlib_project for F28004x, added the FPUfastRTS module in SysConfig, and added some test code that called the functions. When I stepped through the code, I had no issue calling the library function for acosf and asinf. I checked the "Includes" folder in the project directory and saw that there was nothing excluded function-wise.

    I'm not able to replicate your issue on my side, have you verified that this issue occurs with a brand new empty project?

    Best regards,

    Omer Amir

  • have you verified that this issue occurs with a brand new empty project?

    Yes I did. That's what I saud since the begening of this post. If I had not done that, I would not allowed myself you to check that.

    But You re right: everything seems to be fine with the empty project when stepping into the disassembly code. But not in my 379D project

    1) new workspace:

    2) Import the empty project for 49C

    3) Adding the library with sysconfig

    4) build the project

    5) See that the asin function is not declared/defined in the library

    6) add a code using the asin:

    7) set the launchpad confog as the active configuration

    8) enter in the debug mode and step into the disassembly code.

    9) Compare with my 379D project:

    I have to compare the included files into the project options. Do you have any idea where I have to check ?

    Thank you for your help

  • Hello, again.

    that's fine.

    My error was to step into code only on the 379D. A path for included files was missing.

    Since I had not a 49C till today, I was not able to step into the code on that harware. So, seeing that the asin function was also grayed out, I thought that there were the same problem.

    Thank you for your help and the time you spent for the tests.

    Vincent

  • Hi Vincent,

    Am I okay to close this thread or were there any other questions?

    Best regards,

    Omer Amir

  • I gonna click on "resolved"

    Thankx a lot, I learned much during this conversation