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.

TMS320F28P650DK: code execution efficiency difference between F28P65 and F28374

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

Tool/software:

Hi Expert

Customer is migrating their control code from F28374 to F28P65, they find the same CPU interrupt can finish in 50us interrupt in F28374 but cannot finish in F28P65, the interrupt is for invertor control mainly floating point plus, floating point *, sin and cos, below shows the optimizer setting:

Customer want to know why with the same setting, F28P65 code execution efficiency is lower than F28374

Also is there any workaround to improve the F28P65 code execution efficiency but keep the optimization level -off.

F28P65DK

F28374

thanks

Joe

  • Hi Joe,

    It sounds like the device migration might be not have gone successfully. Can you have the customer migrate the code using one of the C2000Ware examples as a starting point. I suspect some of the project properties and device settings might not be properly computed. For instance, the floating point and cla support is incorrectly defined. it should be cla2 and fpu64.

    If they use an empty project, they should be able to copy paste their code and begin optimization from there.

    Regards,

    Ozino

  • Hi Ozino

    Thanks for your reply. I also have several questions want to clarify below:

    1. I find in the demo project, although CLA set to cla2, but in sysconfig setting and initCLA() function, still use CLA1.

    2. Want to confirm should customer change the cla1_math_library_datarom_fpu32_eabi.lib to fpu64? Should customer change f28P65xCPU1_CLADATAROM_Symbols_fpu32.lib to fpu64?

    3.Is there any documents to point out why I need to set the project processor options to cla2 and fpu64 with F28P65 and what's the meaning of those settings?

    Thanks

    Joe

  •  Hi Joe,

    Please check out the CLAmath User's Guide section 4.1 Library Build Configurations for more information on what libraries to use for the selected CLA and FPU. 

    E2E that explains more in detail: (+) TMS320F28P650DH: CLA Math Library not working in C2000 Ware Version 5.00 - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    For more information on the FPU support available on F28P65x, please see this document that summarizes the device features supported.

    2.3.11 TMS320F28P65x Peripherals https://www.ti.com/lit/ug/spru566t/spru566t.pdf 

    This document offers more of an explanation in the architecture differences between the two FPU types: https://www.ti.com/lit/ug/spruhs1c/spruhs1c.pdf 

  • Hi Ozino

    After changing the processor option setting to FPU64 and CLA2, the CPU execution efficiency is improved but still cannot reaches to F28374 level with the same C statement code in --opt_level off. I think CLA2 has no relationship on CPU interrupt execution so I has below questions:

    1. Is there any other settings to improve the F28P65 code execution efficiency with the --opt_level off?

    2. why should set FPU to FPU64? I see in the documents that F28P65 FPU is 32bit and 64bit compatible and customer use 32bit floating point calculation in their practice.

    thanks

    Joe

      

  • Hi Ozino

    Could you please kindly help to look into this thread?

    Thanks

    Joe

  • Joe,

    Since the code comes from fpu32 device, I suggest

    1. Processor options:
      1. float_support = fpu32
      2. tmu_support = tmu2
    2. Optimization
      1. fp_mode = relaxed
      2. fp_reassoc = on
    3. under advanced options, language options 
      1. set --float_operations_allowed = 32
      2. check the box for "treat floating-point constants as single precision"

    The items under (3) will help make sure everything is 32-bit float. This can be an issue if the project was ported from COFF to EABI.  If it catches any issues, the customer should fix based on the COFF to EABI porting guide.

    (https://software-dl.ti.com/ccs/esd/documents/C2000_c28x_migration_from_coff_to_eabi.html)

  • Hi Lori

    According to your guidance, there are 2 issues reported by customer:

    1.  the compiler report issue once customer makes the change

    2. there is no TMU2 only TMU0 and TMU1:

    Have you ever met this issue and any workaround?

    Thanks

    Joe

  • Hi Joe, 

    For (1) 

    I can not reproduce this with compiler v22.6.2.LTS. What version are they using?

    The math for a #define like this occurs during compile time, not during runtime, so it will not introduce additional cycles.

    For (2) I misspoke, the TMU is type 1 on 28002x, 28003x, 28P55x, 28P65x devices

    (3) I should have mentioned, P65 also has the enhanced integer division (--idiv_support = idiv0)