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.

TMS320F280049: Maths Compute Library calls problem

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi Team,

There's an issue from the customer need your help:

As shown in the figure above, I enabled the FPUfastRTS Quick Compute Library in the configuration tool, and I intended to use the function float32_t sqrtf() with the fast root number. In the figure on the right c2000_libraries.h, the header files fastrts.h, maths.h, fpu32/C28x_FPU_FastRTS.h, C28x_FPU_FastRTS.h are called respectively. So I called the resulting function in my program as shown in the figure below, if I have linked the desired header file and library functions into the project, as shown in the figure on the right. And I set the calling library to have priority mode 

Then I compiled the program and looked at the .map file to observe the function calls, as shown in the figure below, it can be seen that the rts2800_fpu32_fast_supplement fast library only uses div_F32.obj, and no sqrt_F32.obj. That is, fast division is used only (there is division in the code) instead of fast root-opening, why.?

You can also see that I output an ELF file, and when I output a COFF file, I get an error, which is displayed 

But no, because I call all the linked libraries, I should call the libraries in coff format myself, even if I call the libraries in coff format directly, I will get this error, why? It's urgent .

Are these two problems the reason why I set a non-specification?

Could you help check this case please?Thanks.

Best Regards,

Ben

  • Hello Ben,

    I cannot actually view your attached images properly, they're too small when I open them.

    Then I compiled the program and looked at the .map file to observe the function calls, as shown in the figure below, it can be seen that the rts2800_fpu32_fast_supplement fast library only uses div_F32.obj, and no sqrt_F32.obj.

    I created a project using C2000Ware 4.02 and I was able to get the map file to show sqrtf. I believe this should be the name of the function that shows up, since the FPUfastRTS library has the function within the sqrt_f32 source file named as "sqrtf". When you run the project, are you unable to step into the right function?

    You can also see that I output an ELF file, and when I output a COFF file, I get an error, which is displayed 

    I was able to properly build an example project using COFF, however to properly use the function you will have to make sure to include the COFF lib file by hand in place of the c2000ware_libraries.cmd.genlibs (the COFF lib file was not included for SysConfig since it is legacy for C2000Ware). You can find it in this path (C2000Ware_4_02_XX_XX\libraries\math\FPUfastRTS\c28\lib\rts2800_fpu32_fast_supplement_coff.lib).

    Best regards,

    Omer Amir

  • Hi Omer,

    Sorry for the inconvenience, I reedited the images and it should be clear now.

    Best Regards,

    Ben

  • The sqrtf is ok, but it should not be the library I want. It may be the library on the left side of the figure below. The most intuitive thing is that the calculation takes time. I want to use the quick calculation library on the right. I want to use the quick algorithm from the right quick compute library to speed up the computation time, so I can't call this algorithm that I can only write for this fast sqrtf right now. But I still want to look at how to call it. 

  • I was able to properly build an example project using COFF, however to properly use the function you will have to make sure to include the COFF lib file by hand in place of the c2000ware_libraries.cmd.genlibs (the COFF lib file was not included for SysConfig since it is legacy for C2000Ware). You can find it in this path (C2000Ware_4_02_XX_XX\libraries\math\FPUfastRTS\c28\lib\rts2800_fpu32_fast_supplement_coff.lib).

    I may have understood this, and it may have been due to a configuration tool problem, because my project was done with the C2000_ware4.01 release, and the C2000_ware4.02 was updated a few days ago, and there may have been a version compatibility issue 

  • Hello Ben,

    SysConfig should be pulling in the proper library file using c2000ware_libraries.cmd.genlibs. This will pull in the general rts2800_fpu32_fast_supplement.lib file, which is what it looks like you're asking for. Is it still not calling the proper function for you? Have you verified that the c2000ware_libraries.cmd.genlibs is included in the File Search Path of your C2000 Link Project Properties? If the c2000ware_libraries.cmd.genlibs file is included in the library file input option, then is it possible for you to run the program and show me what function your program does call for sqrtf? You can use the "assembly step into" button to get to the proper assembly function.

    Best regards,

    Omer Amir

  • Hello Omer,

    Although I don't understand it, I think it might be a problem. The assembly step into as far as this is concerned, I don't know if the program goes wrong once it runs here. 

    Best Regards,

    Ben

     

  • Hello Omer,

    I don't really understand what "assembly step into" can do. The results of my debugging are here. I click on "assembly step into" above, and my sqrf function is in control_task.C. When you run to sqrtf and click "assembly step into", you will jump to maths.h. I don't know if this is the result you want to see, and on the right is the time my own function (including sqrtf) runs, I don't know why, and I run it quite fast with its sqrtf, which requires 5.4166us. And what I wrote on my own, based on the Fast Open Root algorithm, it would require 6us, which I'm very puzzled. I think it shouldn't call the Fast Library, but it's a little bit faster, which is strange.

    Best Regards,

    Ben

  • Hello Ben,

    Because you're using SysConfig, you should have the following project settings, or at least their equivalents if you for some reason need direct paths.

    I don't really understand what "assembly step into" can do

    The reason I specified assembly step-into is because I thought you were trying to run the sqrtf function provided by the FPUfastRTS library, in which case the only way to verify is either looking at the function address in disassembly or simply stepping into the function to see where it goes. You cannot use the normal step-into action because this skips assembly code and only steps into C functions as far as I've tested.

    I click on "assembly step into" above, and my sqrf function is in control_task.C

    If you're trying to use the sqrtf function provided by the FPUfastRTS library, than this is not correct. It should be stepping into the sqrt_f32.asm file for the library function. This means that your program is for some reason not including the file with the proper paths. Verify that your settings are set up as I have in the images above, and you should be able to call the sqrtf function properly.

    And what I wrote on my own, based on the Fast Open Root algorithm, it would require 6us, which I'm very puzzled.

    Looking at the benchmarking for the sqrtf function, it should only take 29 system clock cycles. If it's running the right function, this should line up with the timing you see. I'm not sure what your question is about this.

    Best regards,

    Omer Amir