Main Content

Model Configuration Parameters: Code Generation

The Code Generation category includes parameters for defining the code generation process including target selection. It also includes parameters for inserting comments and pragmas into the generated code for data and functions. These parameters require a Simulink® Coder™ license. Additional parameters available with an ERT-based target require an Embedded Coder® license. Generating CUDA® C++ code for NVIDIA® GPUs requires a GPU Coder™ license.

These configuration parameters appear in the Configuration Parameters > Code Generation general category.

ParameterDescription

System target file (Simulink Coder)

Specify which target file configuration will be used.

Browse (Simulink Coder)

Browse file configuration options.

Shared coder dictionary (Embedded Coder)

Shared coder dictionary that contains code interface configuration.

Language (Simulink Coder)

Specify C or C++ code generation.

Language standard (Simulink Coder)

Specify the language standard for your execution environment.

Generate GPU code (Simulink Coder)

Use GPU Coder for CUDA code generation.

This parameter requires a GPU Coder license.

Generate Halide code (Embedded Coder)

Generate Halide code for faster array computation.

Description (Simulink Coder)

A description of the target file.

Generate code only (Simulink Coder)

Specify code generation versus an executable build.

Package code and artifacts (Simulink Coder)

Specify whether to automatically package generated code and artifacts for relocation.

Zip file name (Simulink Coder)

Specify the name of the .zip file in which to package generated code and artifacts for relocation.

Compiler optimization level (Simulink Coder)

Control compiler optimizations for building generated code.

Custom compiler optimization flags (Simulink Coder)

Specify custom compiler optimization flags.

Toolchain (Simulink Coder)

Specify the toolchain to use when building an executable or library.

Build configuration (Simulink Coder)

Specify compiler optimization or debug settings for toolchain.

Toolchain details (Simulink Coder)

Display or customize build configuration settings.

Generate makefile (Simulink Coder)

Enable generation of a makefile based on a template makefile.

Make command (Simulink Coder)

Specify a make command and optionally append makefile options.

Template makefile (Simulink Coder)

Specify the template makefile from which to generate the makefile.

Select objective (Simulink Coder)

Select a code generation objective to use with the Code Generation Advisor.

Prioritized objectives (Embedded Coder)

List of prioritized code generation objectives.

Set Objectives (Embedded Coder)

Open Configuration Set Objectives dialog box.

Set Objectives — Code Generation Advisor Dialog Box (Embedded Coder)

Select and prioritize code generation objectives.

Check model before generating code (Simulink Coder)

Choose whether to run Code Generation Advisor checks before generating code.

Check Model (Simulink Coder)

Check whether the model meets code generation objectives.

These configuration parameters are under the Advanced parameters.

ParameterDescription

Built-in FFTW library callback (Simulink Coder)

Use the built-in callback for FFTW library usage in code generated for FFT functions in MATLAB® code.

Custom FFT library callback (Simulink Coder)

Specify a callback class for FFTW library calls in code generated for FFT functions in MATLAB code.

Custom BLAS library callback (Simulink Coder)

Specify BLAS library callback class for BLAS calls in code generated from MATLAB code.

Custom LAPACK library callback (Simulink Coder)

Specify LAPACK library callback class for LAPACK calls in code generated from MATLAB code.

Verbose build (Simulink Coder)

Display code generation progress.

Retain .rtw file (Simulink Coder)

Specify model.rtw file retention.

Profile TLC (Simulink Coder)

Profile the execution time of TLC files.

Enable TLC assertion (Simulink Coder)

Produce the TLC stack trace.

Start TLC coverage when generating code (Simulink Coder)

Generate the TLC execution report.

Start TLC debugger when generating code (Simulink Coder)

Specify use of the TLC debugger

Show Custom Hardware App in Simulink Toolstrip (Simulink Coder)

Read-only internal parameter for Simulink toolstrip.

Show Embedded Hardware App in Simulink Toolstrip (Simulink Coder)

Read-only internal parameter for Simulink toolstrip.

Package (Embedded Coder)

Specify a package that contains memory sections you want to apply to model-level functions and internal data.

Refresh package list (Embedded Coder)

Add user-defined packages that are on the search path to list of packages.

Initialize/Terminate (Embedded Coder)

Specify whether to apply a memory section to Initialize/Start and Terminate functions.

Execution (Embedded Coder)

Specify whether to apply a memory section to execution functions.

Shared utility (Embedded Coder)

Specify whether to apply memory sections to shared utility functions.

Constants (Embedded Coder)

Specify whether to apply a memory section to constants.

Inputs/Outputs (Embedded Coder)

Specify whether to apply a memory section to root input and output.

Internal data (Embedded Coder)

Specify whether to apply a memory section to internal data.

Parameters (Embedded Coder)

Specify whether to apply a memory section to parameters.

Validation results (Embedded Coder)

Display the results of memory section validation.

The following parameters under Advanced parameters are infrequently used and have no other documentation.

ParameterDescription
PostCodeGenCommand
character vector - ''
Add the specified post code generation command to the model build process.
TLCOptions
character vector - ''

Specify additional TLC command-line options.

When you use Embedded Coder for a component model that is configured with a service interface, you cannot specify -aInlineSetEventsForThisBaseRateFcn=TLC_FALSE, -aSuppressMultiTaskScheduler=TLC_FALSE, -aRateBasedStepFcn=TLCFALSE, - (wrapper function)

The following parameters are for MathWorks use only.

ParameterDescription
CommentFor MathWorks use only.
PreserveNameFor MathWorks use only.
PreserveNameWithParentFor MathWorks use only.
SignalNamingFcnFor MathWorks use only.
TargetTypeEmulationWarnSuppressLevel
int - 0

For MathWorks use only.

When greater than or equal to 2, suppress warning messages that the code generator displays when emulating integer sizes in rapid prototyping environments.

The Configuration Parameters dialog box also includes other code generation parameters:

Related Topics