User`s guide
3 Code Generation and the Build Process
3-40
Function Splitting
Sometimes a file may not be too large, but a single function contained in the file
might be too long. Because of this, your compiler may not be able to perform
code optimizations. To solve this problem, you can use function splitting to
create smaller functions.
You can control function splitting by using the
Code Generation Options
dialog box.
The function size threshold is specified by the TLC variable
FunctionSizeThreshold, which by default is set to zero.
Functions will only be split at block boundaries or at
ssIsSampleHit calls at
the base scope level. If
ssIsSampleHit or a block boundary is not found at the
function split threshold, the next line that satisfies either of these conditions
becomes the location where the function is split.
A Perl script performs function splitting by text-based post-processing of the
generated source code.
Function splitting will only split functions that begin with the characters
Mdl,
Sys, or the name of the model. The naming convention for split functions takes
the original function name and appends an integer, starting with 1 and
Select Function Splitting from the
Function Management pull-down
menu.
Specify the
Function Split Threshold.
This can be any positive integer.
The
Local block outputs check box is
disabled when file splitting occurs. Local
variable declarations in a function are
not copied over to split functions.