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.

TMS320F28379D: Floating point operations time profiling question

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

I have used to work with fixed point MCUs. I am currently working with F28379D. It has Floating Point Unit in-built. I am testing time profiling using measured clock cycles in the debugger window between breakpoints. I have noticed that the following division takes 50 clk cycles for integer variables and 230 for float type (f28379D supports single precision floating point operations). Is this expected or should I enable floating point unit or CLA to achieve better performance?

int a=2, b=3;
int c, d;

.
.
.
.

for(;;) { c=a/b; }

  • you need to enable the FPU HW unit during compilation

     and as well in the device.

    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0;

    refer C2000ware example at C2000Ware_1_00_01_00\libraries\dsp\FPU\c28\examples\vector\2837x_complexabsvec 

    Regards

    Baskaran

  • Hi,

    Thanks for response.

    -FPU HW unit during compilation was already enabled.
    -I have added the following initialization routine based on the example that was mentioned:


    EALLOW;
    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0;
    EDIS;

    FPU_initSystemClocks();

    FPU_initEpie();

    I don't see any difference in # of clock cycles before and after.
    Also I have added same routine of a/b in one of the examples in \libraries\dsp\FPU\c28\examples\vector\2837x_complexabsvec and exactly same number of clock cycles is measures.

    Do I miss sth still?
  • Hi,

    I believe fp_mode needs to be set to "relaxed".

    Please set your project properties as shown below and try it out:

    I see 7 clock cycles for c = a/b; with this configuration.

    Hope this helps,

    Kevin