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.


System target file

Specify which target file configuration will be used.


Browse file configuration options.


Specify C or C++ code generation.

Generate GPU code

Use GPU Coder for CUDA code generation.

This parameter requires a GPU Coder license.


A description of the target file.

Generate code only

Specify code generation versus an executable build.

Package code and artifacts

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

Zip file name

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

Compiler optimization level

Control compiler optimizations for building generated code.

Custom compiler optimization flags

Specify custom compiler optimization flags.


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

Build configuration

Specify compiler optimization or debug settings for toolchain.


Display or customize build configuration settings.

Generate makefile

Enable generation of a makefile based on a template makefile.

Make command

Specify a make command and optionally append makefile options.

Template makefile

Specify the template makefile from which to generate the makefile.

Select objective

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

Prioritized objectives

List of prioritized code generation objectives.

Set Objectives

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

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

Check Model

Check whether the model meets code generation objectives.

These configuration parameters are under the Advanced parameters.


Custom FFT library callback

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

Custom BLAS library callback

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

Custom LAPACK library callback

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

Verbose build

Display code generation progress.

Retain .rtw file

Specify model.rtw file retention.

Profile TLC

Profile the execution time of TLC files.

Enable TLC assertion

Produce the TLC stack trace.

Start TLC coverage when generating code

Generate the TLC execution report.

Start TLC debugger when generating code

Specify use of the TLC debugger

Show Custom Hardware App in Simulink Toolstrip

Read-only internal parameter for Simulink toolstrip.

Show Embedded Hardware App in Simulink Toolstrip

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.

character vector - ''
Add the specified post code generation command to the model build process.
character vector - ''
Specify additional TLC command-line options.

The following parameters are for MathWorks use only.

CommentFor MathWorks use only.
PreserveNameFor MathWorks use only.
PreserveNameWithParentFor MathWorks use only.
SignalNamingFcnFor MathWorks use only.
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