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: How use sine and cos math tables in boot rom

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Hi 

Where can i find a complete guide of how use boot rom sine and cosine math tables (NOT IQ MATH) in my code, instead of C sinf library function. 
Will this create a significant performance improvement?

Thank you

  • If you're using the F28069, it has an FPU, but no TMU. With the TMU, you would've been able to use its Hardware instructions for sin and cos instead of the library function. Without the TMU, but with the FPU, you can use the FPUFastRTS library provided in C2000Ware. The FPUFastRTS is not as fast as the TMU but is definitely much faster than the RTS library function. 

    Refer to its user guide and associated examples for details. It also has benchmarks.

    C:\ti\c2000\C2000Ware_4_03_00_00\libraries\math\FPUfastRTS\c28\docs

    C:\ti\c2000\C2000Ware_4_03_00_00\libraries\math\FPUfastRTS\c28\examples

    Thanks,

    Sira

  • Thank you.

    Whoever wrote examples in that library assumes we already know about fastRTS.very poor documentation. 
    For ex,in the attached file which i have found in the examples,  i cannot find what is the meaning of Gold. and other variables also. Can you please explain this code to me. 

    //#############################################################################
    //
    //! \file   fastrts_sine.c
    //!
    //! \brief  Runs the sine routine
    //! \author Vishal Coelho
    //! \date   Sep 21, 2016
    //
    //  Group:          C2000
    //  Target Device:  TMS320F28004x
    //
    //#############################################################################
    //
    //
    // $Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
    //             http://www.ti.com/ ALL RIGHTS RESERVED $
    //#############################################################################
    
    
    //*****************************************************************************
    // the includes
    //*****************************************************************************
    #include "fastrts_examples_setup.h"
    #include "fastrts.h"
    #include "fpu32/C28x_FPU_FastRTS.h"
    
    //*****************************************************************************
    // the defines
    //*****************************************************************************
    #define TEST_SIZE   (512U)
    //*****************************************************************************
    // the globals
    //*****************************************************************************
    // The global pass, fail values
    uint16_t pass = 0U, fail = 0U;
    // The absolute error between the result and expected values
    float32_t tolerance = 2.5e-7;
    
    
    float32_t test_output[TEST_SIZE];
    float32_t test_error[TEST_SIZE];
    //*****************************************************************************
    // the function definitions
    //*****************************************************************************
    void FastRTS_runTest(void)
    {
        // Locals
        uint16_t i;
        float32u_t in, 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; i < TEST_SIZE; i++)
        {
            out.f32  = FLT_MAX;
            in.f32   = test_input[i];
            
            // Run the calculation function
            out.f32  = sinf(in.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;
        }
    }
    
    // End of File
    

  • Appreciate your feedback and noted.

    However, I can answer a specific question if you have one.

    The code takes an input, generates an output, and compares it a golden reference to determine Pass/Fail.