Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop Embedded Coder   

setTflCFunctionEntryParameters - Set specified parameters for function entry in TFL table

Syntax

void setTflCFunctionEntryParameters(hEntry, varargin)

Arguments

hEntry

Handle to a TFL table entry previously returned by hEntry = RTW.TflCFunctionEntry.

varargin

Parameter/value pairs for the function entry. See varargin Parameters.

varargin Parameters

The following function entry parameters can be specified to the setTflCFunctionEntryParameters function using parameter/value argument pairs. For example,

setTflCFunctionEntryParameters(..., 'Key', 'sqrt', ...);
Key

String specifying the name of the function to be replaced. The name must match one of the functions supported for replacement:

Floating-Point Math Functions
abscoslog10tan
acoscoshpow (Simulink)/power (Embedded MATLAB)tanh
asinexpsin 
atanfloorsinh 
ceillogsqrt 
Copy Utility Function
memcpy   
Nonfinite Support Utility Functions
getInfgetMinusInfgetNaN 

GenCallback

String specifying '' or 'RTW.copyFileToBuildDir'. The default is ''. If you specify 'RTW.copyFileToBuildDir', and if this function entry is matched and used, the function RTW.copyFileToBuildDir will be called after code generation to copy additional header, source, or object files that you have specified for this function entry to the build directory. For more information, see Specifying Build Information for Function Replacements in the Real-Time Workshop Embedded Coder documentation.

Priority

Positive integer specifying the function entry's search priority, 0-100, relative to other entries of the same function name and conceptual argument list within this table. Highest priority is 0, and lowest priority is 100. The default is 100. If the table provides two implementations for a function, the implementation with the higher priority will shadow the one with the lower priority.

ImplType

Specifies the type of entry: FCN_IMPL_FUNCT for function or FCN_IMPL_MACRO for macro. The default is FCN_IMPL_FUNCT.

ImplementationName

String specifying the name of the implementation function, for example, 'sqrt', which can match or differ from the Key name. The default is ''.

ImplementationHeaderFile

String specifying the name of the header file that declares the implementation function, for example, '<math.h>'. The default is ''.

ImplementationHeaderPath

String specifying the full path to the implementation header file. The default is ''.

ImplementationSourceFile

String specifying the name of the implementation source file. The default is ''.

ImplementationSourcePath

String specifying the full path to the implementation source file. The default is ''.

AcceptExprInput

Boolean value used to flag the code generator that the implementation function described by this entry should accept expression inputs. The default value is true if ImplType equals FCN_IMPL_FUNCT and false if ImplType equals FCN_IMPL_MACRO.

If the value is true, expression inputs are integrated into the generated code in a form similar to the following:

 rtY.Out1 = mySin(rtU.In1 + rtU.In2);

If the value is false, a temporary variable is generated for the expression input, as follows:

real_T rtb_Sum;

rtb_Sum = rtU.In1 + rtU.In2;
rtY.Out1 = mySin(rtb_Sum);
SideEffects

Boolean value used to flag the code generator that the implementation function described by this entry should not be optimized away. This parameter applies to implementation functions that return void but should not be optimized away, such as a memcpy implementation or an implementation function that accesses global memory values. For those implementation functions only, you must include this parameter and specify the value true. The default is false.

Description

The setTflCFunctionEntryParameters function sets specified parameters for a function entry in a TFL table.

Example

In the following example, the setTflCFunctionEntryParameters function is used to set specified parameters for a TFL function entry for sqrt.

fcn_entry = RTW.TflCFunctionEntry;
fcn_entry.setTflCFunctionEntryParameters( ...
                               'Key',                      'sqrt', ...
                               'Priority',                 100, ...
                               'ImplementationName',       'sqrt', ...
                               'ImplementationHeaderFile', '<math.h>' );

See Also

Example: Mapping Math Functions to Target-Specific Implementations in the Real-Time Workshop Embedded Coder documentation

Creating Function Replacement Tables in the Real-Time Workshop Embedded Coder documentation

Replacing Math Functions and Operators Using Target Function Libraries in the Real-Time Workshop Embedded Coder documentation

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS