Model Configuration Parameters: Code Generation Optimization
The Code Generation > Optimization category includes parameters for improving the simulation speed of your models and improving the performance of the generated code. Model configuration parameters to improve the generated code require Simulink® Coder™ or Embedded Coder®.
Parameter | Description |
---|---|
Transform numeric block parameters into constant inlined values in the generated code. | |
Leverage target hardware instruction set extensions | Select instruction sets to generate SIMD (single instruction, multiple data) code for target hardware. |
Optimize reductions | Generate single instruction, multiple data (SIMD) code for reduction operation loops. |
Pass reusable subsystem outputs as (Embedded Coder) | Specify how a reusable subsystem passes outputs. |
Remove root level I/O zero initialization (Embedded Coder) | Specify whether to generate initialization code for root-level inports and outports set to zero. |
Remove internal data zero initialization (Embedded Coder) | Specify whether to generate initialization code for internal work structures, such as block states and block outputs, to zero. |
Level (Embedded Coder) | Choose the optimization level that you want to apply to the generated code. |
Priority (Embedded Coder) | Optimize the generated code for increased execution efficiency, decreased RAM consumption, or a balance between the two. |
Specify custom optimizations (Embedded Coder) | Instead of applying an optimization level, select this parameter to select the optimization parameters in the Details section. |
Optimize code generated for vector assignment by replacing
| |
Specify the minimum array size in bytes for which
| |
Specify whether block signals are declared locally or globally. | |
Specify whether Simulink Coder software reuses signal memory. | |
Collapse block computations into single expressions. | |
Reuse global block outputs (Embedded Coder) | Reuse global memory for block outputs. |
Reuse output buffers of Model blocks (Embedded Coder) | Reuse referenced model buffers if possible. |
Perform in-place updates for Assignment and Bus Assignment blocks (Embedded Coder) | Reuse the input and output variables of Bus Assignment and Assignment blocks if possible. |
Reuse buffers for Data Store Read and Data Store Write blocks (Embedded Coder) | Remove temporary buffers for Data Store Read and Data Store Write blocks. Use the Data Store Memory block directly if possible. |
Simplify array indexing (Embedded Coder) | Replace multiply operations in array indices when accessing arrays in a loop. |
Pack Boolean data into bitfields (Embedded Coder) | Specify whether Boolean signals are stored as one–bit bitfields or as a Boolean data type. |
Bitfield declarator type specifier (Embedded Coder) | Specify the bitfield type when selecting configuration parameter Pack Boolean data into bitfields (Embedded Coder). |
Reuse buffers of different sizes and dimensions (Embedded Coder) | Reduce memory consumption by reusing buffers to store data of different sizes and dimensions. |
Optimize global data access (Embedded Coder) | Select global variable optimization. |
Optimize block operation order in generated code (Embedded Coder) | Reorder block operations in the generated code for improved code execution speed. |
Use bitsets to reduce the amount of memory required to store state configuration variables. | |
Use bitsets for storing Boolean data | Use bitsets to reduce the amount of memory required to store Boolean data. |
Specify the maximum stack size in bytes for your model. | |
Specify the minimum signal or parameter width for which a
| |
Optimize using the specified minimum and maximum values (Embedded Coder) | Optimize generated code using the specified minimum and maximum values for signals and parameters in the model. |
Maximum number of arguments for subsystem outputs | Set maximum number of subsystem outputs to pass individually. |
Transform symbolic names of invariant signals into constant values. | |
Remove code from floating-point to integer conversions with saturation that maps NaN to zero | Remove code that handles floating-point to integer conversion
results for |
Specify whether to generate code that explicitly initializes floating-point data to 0.0. | |
Remove code from floating-point to integer conversions that wraps out-of-range values | Remove wrapping code that handles out-of-range floating-point to integer conversion results. |
Remove Code from Tunable Parameter Expressions That Saturate Out-of-Range Values (Embedded Coder) | Remove wrapping code of tunable parameters. |
Remove code that protects against division arithmetic exceptions (Embedded Coder) | Specify whether to generate code that guards against division
by zero and |
Buffer for reusable subsystems | Improve reuse by inserting buffers at reusable subsystem boundaries. |
Disable incompatible optimizations | Specify whether to disable optimizations that are incompatible with Simulink Code Inspector. |
Base storage type for automatically created enumerations | Set the storage type and size for enumerations created with active state output. |
Use signal labels to guide buffer reuse (Embedded Coder) | For signals with the same label, the code generator attempts to use the same signal memory. |
Generate parallel for-loops (Embedded Coder) | Specify whether for-loops in the generated code shall be implement in parallel for Matlab Function, Matlab System or a For Each block. |
Automatically schedule for-loops (Embedded Coder) | Specify whether for-loop nests in the generated code are automatically scheduled for Neighborhood Processing blocks. |
Signal storage reuse | Specify reuse of memory buffers allocated to store block input and output signals thereby reducing the memory requirement of real-time program |
Operator to represent Bitwise and Logical Operator blocks (Embedded Coder) | Specify whether the generated code contains bitwise or logical operators or both. |