The Texas Instruments MATHLIB library is an optimized floating-point math function library for C programmers using TI floating point devices. These routines are typically used in computationally intensive real-time applications where optimal execution speed is critical. By using these routines instead of the routines found in the existing run-time-support libraries, you can achieve execution speeds considerably faster without rewriting existing code. The MATHLIB library includes all floating-point math routines currently provided in existing run-time-support libraries. These new functions can be called with the current run-time-support library names or the new names included in the MATHLIB library.
The TI c66x MATHLIB contains commonly used floating point math routines, as well as source code that allows you to modify functions to match your specific needs.
ANSI C source code models
C-callable routines fully compatible with the TI C6000 compiler
Host library to enable PC based development and testing
CCS v5 projects to rebuild library or individual routines unit test.
Unless otherwise specified, the MATHLIB package installs under C:\ti\ in directory mathlib_c66x_3_1_2_1. The directory structure of the installed package will look similar to that displayed below in Figure 1, though the release notes will match the installation version.
Figure 1. c66x MATHLIB Directory Structure
The files that comprise the MATHLIB installation can be categorized into the following five categories:
The installation creates a Components directory in the MATHLIB root folder. This directory serves as a repository for all packages included in the MATHLIB installation. Each package in this repository is compressed.
The installation also creates a Packages directory in the MATHLIB root folder. This directory holds all kernels contained within the MATHLIB library. This directory follows the standard TI directory structure. As an example, the files that comprise the MATHLIB kernel atandp will be located, relative to the MATHLIB root installation directory, at packages/ti/mathlib/src/atandp/.
Each Kernel is delivered with a pre-compiled CCSv5 project that illustrates the kernel API and performs several validation tests. Each project provides an estimate of kernel cycle and program memory requirements.
The Eclipse directory contains all files required for MATHLIB to be recognized by Eclipse (CCS Version 4) as a plug-in. This is a support directory and can be safely ignored.
The MATHLIB installation creates a Package directory. This directory contains meta information required by the TI packaging tools. This is a support directory and can be safely ignored.
Since MATHLIB is a collection of individual kernels, any combination of the kernels that comprise MATHLIB may be integrated into a system individually. Integration, for single or multiple kernels, requires four simple steps:
Compile MATHLIB for c66x (optional)
Add API calls within system code
Compile system code
Link MATHLIB
The sections that follow provide details regarding the above four steps.
On installation, the MATHLIB libraries are built and ready to link. Therefore, this step is only required when the original kernel source code has been refined or contributions have been added. See MATHLIB Build Process for details regarding re-building MATHLIB .
Add calls to MATHLIB kernels within the system source code as necessary. Any system source file that contains calls to an MATHLIB kernel will require that the MATHLIB header file mathlib.h is included. See the MATHLIB Function Reference for details on individual kernel APIs.
To re-compile the system code, the path to the packages directory will need to be added to the compiler's include path search list. This path will depend on the MATHLIB root installation directory. This allows the main MATHLIB header file to be moved from within the installation directory and still recognize the individual kernel headers.