Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Real-Time Workshop Dialog Box for Embedded MATLAB Coder

Real-Time Workshop Dialog Box Overview

Specifies parameters for embeddable C code generation using Embedded MATLAB Coder.

Displaying the Dialog Box

To display the Real-Time Workshop dialog box for Embedded MATLAB Coder, follow these steps at the MATLAB command prompt:

  1. Define a configuration object variable for embeddable C code generation in the MATLAB workspace by issuing a constructor command like this:

    codegen_cfg=emlcoder.RTWConfig('system_target');

    Set system_target to:

    • grt for GRT-based targets (default)

    • ert for ERT-based targets

        Note   ERT-based targets require a Real-Time Workshop Embedded Coder license when generating code.

  2. Open the property dialog box using one of these methods:

    • Double-click the configuration object variable in the MATLAB workspace

    • Issue the open command from the MATLAB prompt, passing it the configuration object variable, as in this example:

      open codegen_cfg;

    The dialog box displays on your desktop.

See Also

Configuring Your Environment for Code Generation

General Tab

Specifies general parameters for embeddable C code generation using Embedded MATLAB Coder.

Parameters

The following table describes the general parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

General ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Compiler optimization levelRTWCompilerOptimization
string, 'Off' , 'On', 'Custom'
Specify level of compiler optimization for generating code. Turning optimizations off shortens compile time; turning optimizations on minimizes run time.
Custom compiler optimization flagsRTWCustomCompilerOptimizations
string, ''
Specify compiler optimization flags to apply to the generated code.

    Note   Requires that you select Custom for Compiler optimization level

Generate makefileGenerateMakefile
true, false
Specify whether to generate a makefile during the build process.
Make commandMakeCommand
string, 'make_rtw'
Specify a make command (if Generate makefile is selected).
Template makefileTemplateMakeFile
string, 'grt_default_tmf'
Specify a template makefile (if Generate makefile is selected).
Enable variable-sizingEnableVariableSizing
true, false
Enable support for variable-sized arrays.
Saturate on integer overflowSaturateOnIntegerOverflow
true, false
Add checks in the generated code to detect integer overflow or underflow.
Generated C-file partitioning methodFilePartitionMethod
string, MapMFileToCFile, SingleFile
Specify whether to generate one C-file for each M-file or generate all C functions into a single file.

Report Tab

Controls the report that is created for embeddable C code generation using Embedded MATLAB Coder.

Parameters

The following table describes the report parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Report ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Create code generation reportGenerateReport
true, false
Document generated code in an HTML report.
Launch report automaticallyLaunchReport
true, false
Specify whether to automatically display HTML reports after code generation completes.

    Note   Requires that you select Create code generation report

Symbols Tab

Specifies parameters for selecting automatically generated naming rules for identifiers in embeddable C code generation using Embedded MATLAB Coder.

The Symbols tab appears as follows for GRT-based targets:

The Symbols tab appears as follows for ERT-based targets:

Parameters

The following table describes the symbols parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Symbols ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Global variablesCustomSymbolStrGlobalVar
string, '$M$N'

For more details, see Settings

Customize generated global variable identifiers.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

Global typesCustomSymbolStrType
string, '$M$N'

For more details, see Settings

Customize generated global type identifiers.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

Local functionsCustomSymbolStrFcn
string, 'm_$M$N'

For more details, see Settings

Customize generated local function identifiers.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

Local temporary variablesCustomSymbolStrTmpVar
string, 'eml_$M$N'

For more details, see Settings

Customize generated local temporary variable identifiers.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

Constant macrosCustomSymbolStrMacro
string, '$M$N'

For more details, see Settings

Customize generated constant macro identifiers.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

Maximum identifier lengthMaxIdLength
integer, 31
Specify maximum number of characters in generated function, type definition, and variable names. Minimum is 31.
Reserved namesReservedNameArray
string, ''
Enter the names of variables or functions in the generated code that match the names of variables or functions specified in custom code.

Settings.   Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include valid C-identifier characters and a combination of the following format tokens:

TokenDescription
$M

Insert name mangling string to avoid naming collisions.

Required.

$N

Insert name of parameter (global variable, global type, local function, local temporary variable or constant macro) for which identifier is being generated.

Recommended to ensure readability of generated code.

$R

Insert root project name into identifier, replacing any unsupported characters with the underscore (_) character.

Custom Code Tab

Creates a list of custom C code, directories, source and header files, and libraries to be included in files generated by Embedded MATLAB Coder.

Configuration

  1. Select the type of information to include from the list on the left side of the pane.

  2. Enter a string to identify the specific code, directory, source file, or library.

  3. Click Apply.

Parameters

The following table describes the custom code parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Custom Code ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Source fileCustomSourceCode
string, ''
Specify code appearing near the top of the generated .c or .cpp file, outside of any function.
Header fileCustomHeaderCode
string, ''
Specify code appearing near the top of the generated .h file.
Initialize functionCustomInitializer
string, ''
Specify code appearing in the initialize function of the generated .c or .cpp file.
Terminate functionCustomTerminator
string, ''
Specify code appearing in the terminate function of the generated .c or .cpp file.
Include directoriesCustomInclude
string, ''
Specify a space-separated list of include directories to add to the include path when compiling the generated code.

    Note   If your list includes any Windows path strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'C:\Project "C:\Custom Files"'

Source filesCustomSource
string, ''
Specify a space-separated list of source files to compile and link with the generated code.

    Note   If your list includes any Windows file name strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'algs.c "div alg.c"'

LibrariesCustomLibrary
string, ''
Specify a space-separated list of static library files to link with the generated code.

    Note   If your list includes any Windows file name strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'mathutil.lib "op utils.lib"'

Debug Tab

Specifies parameters for debugging the Embedded MATLAB Coder build process.

Parameters

The following table describes the debug parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Debug ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Verbose buildRTWVerbose
true, false
Display code generation progress.

Interface Tab

Specifies parameters for selecting the target software environment for the code generated by Embedded MATLAB Coder.

The Interface tab appears as follows for GRT-based targets:

The Interface tab appears as follows for ERT-based targets:

Parameters

The following table describes the interface parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Interface ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Target function libraryTargetFunctionLibrary
string, 'ANSI_C'

Specify a target-specific math library for your model.

Supports target function libraries (TFLs) for GRT system target files.

If you have a Real-Time Workshop Embedded Coder license, you can configure Embedded MATLAB Coder to use ERT TFLs when generating C code. You enable this feature by defining a configuration object for C code generation using an ert parameter at the MATLAB command prompt, as in this example:

rtwcfg = emlcoder.RTWConfig('ert')
Support: floating-point numbersPurelyIntegerCode
string, 'on'

Specify whether to generate floating-point data and operations.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

  • Selecting this parameter enables Support: non-finite numbers and clearing this parameter disables Support: non-finite numbers.

Support: non-finite numbersSupportNonFinite
string, 'on'

Specify whether to generate nonfinite data and operations.

Dependencies:

  • This parameter only appears for ERT-based targets.

  • This parameter requires a Real-Time Workshop Embedded Coder license when generating code.

  • This parameter is enabled by Support: floating-point numbers.

Advanced Tab

Specifies parameters for fine-tuning the behavior of the compiler.

Parameters

The following table describes the advanced parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:

Advanced ParameterEquivalent Command-Line Property and Values
(default in bold)
Description
Inline ThresholdInlineThreshold
integer, 10
Specify the maximum size of functions to be inlined.
Inline Threshold MaxInlineThresholdMax
integer, 200
Specify the maximum size of functions after inlining.
Inline Stack LimitInlineStackLimit
integer, 4000
Specify the stack size limit on inlined functions.
Stack Usage MaxStackUsageMax
integer, 200000
Specify the maximum stack usage per function.
Constant Folding TimeoutConstantFoldingTimeout
integer, 10000
Specify the maximum number of instructions to be executed by the constant folder.

Generate code only

Specify code generation versus an executable build. See Generate code only.

  


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