Main Content

Model Configuration Parameters: Code Generation Interface

The Code Generation > Interface category includes parameters for configuring the interface of the generated code. These parameters require a Simulink® Coder™ license. Additional parameters available with an ERT-based target require an Embedded Coder® license. Generating code for deep learning models using NVIDIA® CUDA® deep neural network library (cuDNN) or TensorRT™ high performance inference libraries for NVIDIA GPUs requires a GPU Coder™ license.

On the Configuration Parameters dialog box, the following configuration parameters are on the Code Generation > Interface pane.

ParameterDescription

Code replacement library

Specify a code replacement library the code generator uses when producing code for a model.

Code replacement libraries

Specify multiple code replacement libraries the code generator use when producing code for a model.

Shared code placement

Specify the location for generating utility functions, exported data type definitions, and declarations of exported data with custom storage class.

Support: floating-point numbers (Embedded Coder)

Specify whether to generate floating-point data and operations.

Support: non-finite numbers

Specify whether to generate non-finite data and operations on non-finite data.

Support: complex numbers (Embedded Coder)

Specify whether to generate complex data and operations.

Support: absolute time (Embedded Coder)

Specify whether to generate and maintain integer counters for absolute and elapsed time values.

Support: continuous time (Embedded Coder)

Specify whether to generate code for blocks that use continuous time.

Support: variable-size signals (Embedded Coder)

Specify whether to generate code for models that use variable-size signals.

Code interface packaging

Select the packaging for the generated C or C++ code interface.

Multi-instance code error diagnostic

Select the severity level for diagnostics displayed when a model violates requirements for generating multi-instance code.

Pass root-level I/O as (Embedded Coder)

Control how root-level model input and output are passed to the reusable model_step function.

Remove error status field in real-time model data structure (Embedded Coder)

Specify whether to log or monitor error status.

Include model types in model class (Embedded Coder)

Specify whether to generate model type definitions in a model class.

Array layout

Specify layout of array data for code generation as column-major or row-major

External functions compatibility for row-major code generation

Select diagnostic action if Simulink encounters a function that has no specified array layout

Parameter visibility (Embedded Coder)

Specify whether to generate the block parameter structure as a public, private, or protected data member of the C++ model class.

Parameter access (Embedded Coder)

Specify whether to generate access methods for block parameters for the C++ model class.

External I/O visibility (Embedded Coder)

Specify whether to generate the root-level I/O structure as a public, private, or protected data member of the C++ model class.

External I/O access (Embedded Coder)Specify whether to generate access methods for root-level I/O signals for the C++ model class.
Configure C++ Class Interface (Embedded Coder)Customize the C++ class interface for your model code.

Generate C API for: signals

Generate C API data interface code with a signals structure.

Generate C API for: parameters

Generate C API data interface code with parameter tuning structures.

Generate C API for: states

Generate C API data interface code with a states structure.

Generate C API for: root-level I/O

Generate C API data interface code with a root-level I/O structure.

ASAP2 interface

Generate code for the ASAP2 data interface.

External mode

Generate code for the external mode data interface.

Transport layer

Specify the transport protocol for communications.

MEX-file arguments

Specify arguments to pass to an external mode interface MEX-file for communicating with executing targets.

Static memory allocation

Control memory buffer for external mode communication.

Static memory buffer size

Specify the memory buffer size for external mode communication.

Target library

Specify the target deep learning library used during code generation.

cuDNN or TensorRT requires a GPU Coder license.

ARM Compute Library version

Specify the version of ARM® Compute Library.

ARM Compute Library architecture

Specify the ARM architecture supported in the target hardware.

Auto tuning

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

This parameter requires a GPU Coder license.

These configuration parameters are under the Advanced parameters.

ParameterDescription

Standard math library

Specify the standard math library for your execution environment. Verify that your compiler supports the library you want to use; otherwise compile-time errors can occur.

C89/C90 (ANSI) - ISO®/IEC 9899:1990 C standard math library
C99 (ISO) - ISO/IEC 9899:1999 C standard math library
C++03 (ISO) - ISO/IEC 14882:2003 C++ standard math library

Support non-inlined S-functions (Embedded Coder)

Specify whether to generate code for non-inlined S-functions.

Maximum word length

Specify a maximum word length, in bits, for which the code generation process generates system-defined multiword type definitions.

Buffer size of dynamically-sized string (bytes)

Number of bytes of the character buffer generated for dynamic string signals without maximum length.

Multiword type definitions (Embedded Coder)

Specify whether to use system-defined or user-defined type definitions for multiword data types in generated code.

Classic call interface

Specify whether to generate model function calls compatible with the main program module of the GRT target in models created before R2012a.

Use dynamic memory allocation for model initialization (Embedded Coder)

Control how the generated code allocates memory for model data.

Single output/update function

Specify whether to generate the model_step function.

Terminate function required (Embedded Coder)

Specify whether to generate the model_terminate function.

Combine signal/state structures (Embedded Coder)

Specify whether to combine global block signals and global state data into one data structure in the generated code

Generate separate internal data per entry-point function (Embedded Coder)Generate a model's block signals (block I/O) and discrete states (DWork) acting at the same rate into the same data structure.

MAT-file logging

Specify MAT-file logging.

MAT-file variable name modifier (Embedded Coder)

Select the text to add to MAT-file variable names.

Existing shared code (Embedded Coder)

Specify folder that contains existing shared code

Remove disable function (Embedded Coder)

Remove unreachable (dead-code) instances of the disable functions from the generated code for ERT-based systems that include model referencing hierarchies.

Remove reset function (Embedded Coder)

Remove unreachable (dead-code) instances of the reset functions from the generated code for ERT-based systems that include model referencing hierarchies.

LUT object struct order for even spacing specification

Change the order of the fields in the generated structure for a lookup table object whose specification parameter is set to even spacing.

LUT object struct order for explicit value specification

Change the order of the fields in the generated structure for a lookup table object whose specification parameter is set to explicit value.

Generate destructor (Embedded Coder)

Specify whether to generate a destructor for the C++ model class.

Internal data access (Embedded Coder)

Specify whether to generate access methods for internal data structures, such as Block I/O, DWork vectors, Run-time model, Zero-crossings, and continuous states, for the C++ model class.

Internal data visibility (Embedded Coder)

Specify whether to generate internal data structures such as Block I/O, DWork vectors, Run-time model, Zero-crossings, and continuous states as public, private, or protected data members of the C++ model class.

Use dynamic memory allocation for model block instantiation (Embedded Coder)

Specify whether generated code uses the operator new, during model object registration, to instantiate objects for referenced models configured with a C++ class interface.

Code replacement library

Create custom Code Replacement libraries using code replacement tool.

Ignore custom storage classes (Embedded Coder)

Specify whether to apply or ignore custom storage classes.

Ignore test point signals (Embedded Coder)

Specify allocation of memory buffers for test points.

Implement each data store block as a unique access point (Embedded Coder)

Create unique variables for each read/write operation of a Data Store Memory block.

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

ParameterDescription
GenerateSharedConstants

Control whether the code generator generates code with shared constants and shared functions. Default is on. When turned off, the code generator does not generate shared constants.

InferredTypesCompatibility

For compatibility with legacy code including tmwtypes.h, specify that the code generator creates a preprocessor directive #define_TMWTYPES_ inside rtwtypes.h

TargetLibSuffix
character vector - ''

Control the suffix used for naming a target's dependent libraries (for example, _target.lib or _target.a). If specified, the character vector must include a period (.). (For generated model reference libraries, the library suffix defaults to _rtwlib.lib on Windows® systems and _rtwlib.a on UNIX® systems.).

Note

This parameter does not apply for model builds that use the toolchain approach, see Library Control Parameters

TargetPreCompLibLocation
character vector - ''

Control the location of precompiled libraries. If you do not set this parameter, the code generator uses the location specified in rtwmakecfg.m.

IsERTTarget

Indicates whether or not the currently selected target is derived from the ERT target.

CPPClassGenCompliant

Indicates whether the target supports the ability to generate and configure C++ class interfaces to model code.

ConcurrentExecutionCompliant

Indicates whether the target supports concurrent execution

UseToolchainInfoCompliant

Indicate a custom target is toolchain-compliant.

ModelStepFunctionPrototypeControlCompliant

Indicates whether the target supports the ability to control the function prototypes of initialize and step functions that are generated for a Simulink model.

ParMdlRefBuildCompliant

Indicates if the model is configured for parallel builds when building a model that includes referenced models.

CompOptLevelCompliant
off, on

Set in SelectCallback for a target to indicate whether the target supports the ability to use the Compiler optimization level parameter to control the compiler optimization level for building generated code.

Default is off for custom targets and on for targets provided with the Simulink Coder and Embedded Coder products.

ModelReferenceCompliant
character vector - off, on
Set in SelectCallback for a target to indicate whether the target supports model reference.
GenerateFullHeader

Generate full header including time stamp.

For ERT targets, this parameter is on the Code Generation > Templates pane.

The following parameters are for MathWorks use only.

ParameterDescription
ExtModeTestingFor MathWorks use only.
ExtModeIntrfLevelFor MathWorks use only.
ExtModeMexFileFor MathWorks use only.

Related Topics