User`s guide
3 Project Generator
Optimizing Embedded Code with Target Function Libraries
In this section...
“About Target Function Libraries and Optimization” on page 3-70
“Using a Processor-Specific Target F unction Library to O ptimize Code”
on page 3-72
“Process of Determining Optimization Effects Using Real- T i me Profiling
Capability” on page 3-73
“Reviewing Processor-Specific Target Function Library Changes in
Generated Code” on page 3-74
“Reviewing Target Function Library Operators and Functions” on page 3-76
“Creating Your Own Target Function Library” on page 3-76
About Target Function Libraries and Optimization
A target function library is a set of one or more function tables that define
processor- and compiler-specific impleme nta t io ns of functions and arithmetic
operators. The code generation process uses these tables when it generates
code from your Simulink model.
The Embedded IDE Link CC software registers processor-specifictarget
function libraries d uring installation. To use one of the libraries, select the set
of tables that correspond to functions implemen t ed by in trinsics or assembly
code for your processor from the Target function library list in the model
configuration parameters.
After y ou select the p rocess or-speci fic library, the model build process u ses the
library contents to optimize generated code for that processor. The generated
code includes processor-specific implementations fo r
sum, sub, mult,anddiv,
and various functions, such as
tan or abs, instead of the default ANSI
®
C instructions and functions. The optimized code enables your embedded
application to run more efficiently and quickly, and in many cases, reduces the
size of the code. For more information about target function libraries, refer
to “Introduction to T arget Function Libraries” in the Real-Time Workshop
Embedded Coderdocumentation.
3-70