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: FPU RTS Library

Part Number: TMS320F28379D

1. Is the following way correct for using FPUfastRTS library in a project. Though I refered FASTRTS_SW_LIB_UG.pdf and some examples I didn't get clarity hence kindly help on it.

  • Adding the required header file in project 

#include "fastrts.h"
#include "fpu32/C28x_FPU_FastRTS.h"

  • Adding the above header file path in properties---->Include Options
  • Adding rts2800_fpu32_fast_supplement.lib in properties--->flile search path

2. In the following TI Example file (div_f32), I coudn't understand what is the use of "float32u_t" since it doesn't seem to be a datatype.

void FastRTS_runTest(void)
{
    // Locals
    uint16_t i, j;
    float32u_t in1, in2, out, gold, err;

    //<<VC160921: cant check ulp error as this only applies to
    // fixed point representation of the same set of numbers
    //
    //float32u_t errulp;
    //
    // VC160921>>

    for(i = 0U, j = 0U; i < TEST_SIZE; i++, j = j + 2U)
    {
        out.f32  = FLT_MAX;
        in1.f32  = test_input[j];
        in2.f32  = test_input[j + 1U];

        // Run the calculation function
        out.f32  = in1.f32/in2.f32;

        test_output[i] = out.f32;
        gold.f32 = test_golden[i];
        err.f32  = fabsf(out.f32 - gold.f32);
        if(err.f32 < tolerance)
        {
            pass++;
        }
        else
        {
            fail++;
        }
        test_error[i] = err.f32;
    }
}

3. During execution of the following line, will compiler transfer control to div_f32.asm file and execute function FS$$DIV present in the assembly file automatically? am I correct?  If it is wrong give me a correct guidance please.

out.f32  = in1.f32/in2.f32;

4. What is the differences between various library files mentioned below and their usage

rts2800_fpu32_fast_supplement.lib

rts2800_fpu32_fast_supplement_coff.lib

rts2800_fpu32_fast_supplement_eabi.lib

rts2800_fpu64_fast_supplement.lib

  • Hello,

    1) Yes. The files you have included is correct. Make sure you include the library in properties->linker options-> include files and include path. If you are not sure, you can compare with the settings in the example files.

    2) Please check fastrts.h where the following is defined:

    typedef union
    {
        uint32_t    ui32; //!< Unsigned long representation
        int32_t     i32;  //!< Signed long represntaion 
        float       f32;  //!< Single precision (32-bit) representation
    }float32u_t;

    3) Yes. In processor options under properties, if you enable --fpu32, it will use the FASTRTS instructions to leverage the FPU and use the library. Use --tmu0 if you are using trigonometric operations.

    4)rts2800_fpu32_fast_supplement.lib: 1 KB file is an index library. Consult to compilers handbook to figure out how it works.

       rts2800_fpu32_fast_supplement_coff.lib: FASTRTS lib for FPU32 in COFF format

       rts2800_fpu32_fast_supplement_eabi.lib: FASTRTS lib for FPU32 in EABI format

       rts2800_fpu64_fast_supplement.lib: FASTRTS lib for FPU64 in EABI format

    I hope I answered your questions.

    Thanks,

    Shantanu

  • Thank you for fast and clear response Shanty. 

    1. Before knowing about COFF format and EABI format I have worked in many example files and debugged in which .out file will be generated. How to find under which format this .out file generated?

  • Check out the setting "Output Format" in properties -> General

    Thanks,

    Shantanu

  • Thank you