Main Content

Model Configuration Parameters: Simulation Target

The Simulation Target category includes parameters for configuring the simulation target for a model. In the Configuration Parameters dialog box, the following parameters are in the Simulation Target pane.

ParameterDescriptionLocation
GPU acceleration

Specify whether or not to accelerate MATLAB Function blocks on NVIDIA® GPUs. This option requires a GPU Coder™ license.

 
LanguageSpecify C or C++ code generation for simulation targets. 

Include headers

Specify interface header code containing types and function declarations to import into Simulink®.

Code information tab

Include directories

Specify directories containing header and source files.

Code information tab

Source files

Specify custom code source files.

Code information tab

Libraries

Specify a list of static and/or shared libraries that contain custom object code to link into the target.

Code information tab

Defines

Specify preprocessor macro definitions to be added to the compiler command line.

Code information tab

Compiler flags

Specify additional flags to be added to the compiler command line.

Code information tab

Linker flags

Specify additional flags to be added to the linker command line.

Code information tab

Initialize code

Specify C/C++ code to execute at the start of simulation.

Additional source code tab

Terminate code

Specify C/C++ code to execute at the end of simulation.

Additional source code tab

Additional code

Specify additional custom code to import into Simulink.

Additional source code tab
Simulate custom code in a separate processRun custom code in a separate process outside of MATLAB® during model simulation.Import settings tab
Enable custom code analysisSpecify whether or not to enable Simulink Coverage™ and Simulink Design Verifier™ support for custom code. Import settings tab
Automatically infer global variables as function interfacesSpecify the behavior of global variables in custom code called by the C Caller block.Import settings tab
Undefined function and variable handling

Specify undefined function behavior for all external C functions called by C Caller, MATLAB Function, MATLAB System blocks or Stateflow® charts.

Import settings tab
Deterministic functionsSpecify whether custom code functions are deterministic.Import settings tab
Specify by functionSpecify which custom code functions are deterministic.Import settings tab
Default function array layout

Specify the default array layout for all external C functions used by the C Caller block.

Import settings tab
Exception by function

Specify the array layout for each external C function used by the C Caller block.

Import settings tab

Target library (Simulink Coder)

Specify the target deep learning library to use for simulation.

MKL-DNN requires a Simulink Coder™ license.

cuDNN or TensorRT requires a GPU Coder license.

 

Auto tuning (Simulink Coder)

Use auto tuning for cuDNN library. Enabling auto tuning allows the cuDNN library to find the fastest convolution algorithms.

This parameter requires Simulink Coder and GPU Coder licenses.

 

These configuration parameters are in the Advanced parameters section.

ParameterDescription
Import custom codeSpecify whether or not to parse available custom code variables and functions and compile custom code into its own simulation target.

Block reduction

Reduce execution time by collapsing or removing groups of blocks.

Compiler optimization level

Sets the degree of optimization used by the compiler when generating code for acceleration.

Hardware acceleration

Select whether or not to use hardware acceleration and the level of hardware acceleration.

Conditional input branch execution

Improve model execution when the model contains Switch and Multiport Switch blocks.

Verbose accelerator builds

Select the amount of information displayed during code generation for Simulink Accelerator mode, referenced model Accelerator mode, and Rapid Accelerator mode.

Dynamic memory allocation in MATLAB functions

Use dynamic memory allocation (malloc) for variable-size arrays whose size (in bytes) is greater than or equal to the dynamic memory allocation threshold. This parameter applies to MATLAB code in a MATLAB Function block, a Stateflow chart, or a System object associated with a MATLAB System block.

Dynamic memory allocation threshold in MATLAB functions

Use dynamic memory allocation (malloc) for variable-size arrays whose size (in bytes) is greater than or equal to a threshold. This parameter applies to MATLAB code in a MATLAB Function block, a Stateflow chart, or a System object associated with a MATLAB System block.

Enable continuous-time MATLAB functions to write to initialized persistent variablesEnable continuous-time MATLAB functions to write to initialized persistent variables. If disabled, continuous-time MATLAB functions can only initialize and read persistent variables.

Enable memory integrity checks

Detects violations of memory integrity in code generated for MATLAB Function blocks and stops execution with a diagnostic.

Compile-time recursion limit for MATLAB functions

For compile-time recursion, control the number of copies of a function that are allowed in the generated code.

Enable run-time recursion for MATLAB functions

Allow recursive functions in code that is generated for MATLAB code that contains recursive functions.

Enable implicit expansion in MATLAB functions

Enable implicit expansion in code that is generated for MATLAB code that contains binary operations and functions.

Use precompiled libraries for MATLAB functions

Instruct the code generator to favor either usage of precompiled libraries or usage of alternative implementations.

Generate typedefs for imported bus and enumeration types

Determines typedef handling and generation for imported bus and enumeration data types in Stateflow and MATLAB Function blocks.

Break on Ctrl+C

Enables responsiveness checks in code generated for MATLAB Function blocks, Stateflow charts, and dataflow domains.

Echo expressions without semicolons

Enable run-time output in the MATLAB Command Window, such as actions that do not terminate with a semicolon.

Allow setting breakpoints during simulation

Enable adding breakpoints in MATLAB Function blocks, Stateflow charts, State Transition blocks, and Truth Table blocks during simulation.

Reserved names

Enter the names of variables or functions in the generated code that match the names of variables or functions specified in custom code for a model that contains MATLAB Function blocks, Stateflow charts, or Truth Table blocks.

Related Topics