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.

TMS320F28069: Execution time of _IQ(A) function in IQmath library

Part Number: TMS320F28069


Hello,

When I pass constant float value to the _IQ() function, its execution time is much lower than the case when I pass same value through a float variable. As can be seen in the code snippet, when I pass 1.0 which is constant value ti _IQ(N) function, the execution time is 5 cycles. And when i pass float variable to the function, its execution time is 291 cycles. Why is so much difference between execution times of the two cases  and how to make execution time for the second case equivalent to the first case ? I need this because my application is time sensitive and I cannot use constant value as parameter to the _IQ() function.

//FIRST CASE

void IQ_CONV()
{
   _iq temp;
   temp = _IQ(1.0);
}

//SECOND CASE

void IQ_CONV()
{
   _iq temp;
   float val;
   val = 1.0;
   temp = _IQ(val);
}

Thanks,

Mayuri

  • HI Mayuri,

    _IQ() is a macro. If you take a look at the sampleC example provided and look at the disassembly, you can clearly see that the values are preprocessed and the execution time should not change. For example, the statement: 

    Step.Xsize = _IQ(0.314159265);

    translates to:

     MOVB         AH, #0x59
    SPM          #0
    MOV          AL, #0x652b

    Can you please share a screeenshot of your cycles measurement?

    -Shantanu

  • Hi Shantanu,

    I understand what you are saying but you try to pass the same value, in this case 0.314159265, through a float variable execution cycles increase drastically. I have attached snapshots of two cases. You can see in first image ( case1.png) I have measured execution time to execute following line:

    #define  STEP_X_SIZE  0.314159265

    Step.Xsize = _IQ(STEP_X_SiZE)

    This takes only 4 cycles as can be seen at bottom right corner of image.

    Execution time to execute following line as shown in image (case2.png) is 240 cycles as can be seen at bottom right corner of image.

    Float ff = STEP_X_SIZE;

    Step.Xsize = _IQ(ff);   --> This line takes 240 Cycles.

  • Hi Mayuri,

    Apologies for the delay. Itried to replicate your problem but was not successful. Perhaps it has something to do with your project settings, object file format, configurations, etc. Can you please share your .project files?