Main Content



生成コードが使用する RAM、ROM およびスタック領域の削減

コード ジェネレーターが変数をローカルとグローバルのどちらで定義するのかおよびサブシステム関数へのデータの受け渡し方法を指定することにより、メモリ消費量を制御します。コンフィギュレーション設定を変更してデータを保存するメモリの量を削減します。

コード ジェネレーターでは、制御フロー構造を結合し、デッド コード パスおよび計算結果に影響しないブロックのコードを削除して ROM の消費を低減します。初期化コード、関数 reset と関数 disable、防御的なコードなど、必要のないコードを削除して ROM の消費をさらに低減できます。



Customize Stack Space Allocation

Control the maximum allowable stack size to provide some control over whether data is defined locally or globally in the generated code.

Reduce Memory Usage for Signals

Enable parameters that provide the capability to reuse memory allocated for signals.

Enable and Reuse Local Block Outputs in Generated Code

Where possible, the code generator declares block outputs as local variables, so that it can potentially reuse these variables.

生成コードでのグローバル ブロック出力の再利用

コード ジェネレーターはグローバル変数を再利用しようとします。



Optimize Generated Code By Passing Reusable Subsystem Outputs as Individual Arguments

The code generator eliminates data copies from local variables back to global block I/O structures by passing reusable subsystem outputs as individual arguments instead of as a pointer to a structure stored in global memory.

Reduce Global Variables in Nonreusable Subsystem Functions

To reduce global RAM for a nonreusable subsystem, generate a function interface that passes data through arguments instead of global variables.

コード サイズの削減

Remove Zero Initialization Code

Control whether to initialize internal data (blocks states and block outputs) and external data (root inports and outports whose value is zero) in the generated code.

Remove Reset and Disable Functions from the Generated Code

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

Inline Invariant Signals

Use the numerical values of invariant signals instead of their symbolic names in the generated code.

Inline Numeric Values of Block Parameters

Reduce global RAM usage by inlining the literal numeric values of block parameters.

Optimize Generated Code by Consolidating Redundant If-Else Statements

The code generator optimizes the generated code by combining if-else statements that share the same condition.

Eliminate Dead Code Paths in Generated Code

The code generator eliminates dead (that is, unused) code paths from the generated code.

Remove Code for Blocks That Have No Effect on Computational Results

The code generator increases execution speed and reduces ROM consumption by removing code that does not impact computational results.

Optimize Generated Code by Combining Multiple for Constructs

The code generator uses data dependency analysis to combine for constructs to reduce static code size and runtime branching.


Reuse Buffers of Different Sizes and Dimensions

Reuse buffers for matrices that have different sizes and shapes.

Reduce Memory Usage for Boolean and State Configuration Variables

Reduce the amount of memory that stores state configuration variables and Boolean variables.

Optimize Memory Usage for Time Counters

Optimize memory that the code generator allocates for elapsed time or absolute time.

Optimize Generated Code Using Boolean Data for Logical Signals

The code generator optimizes the generated code by storing logical signals as Boolean data types.

Optimize Generated Code By Packing Boolean Data Into Bitfields

The code generator reduces RAM consumption by packing boolean data into 1-bit bitfields.

Vector Operation Optimization

The code generator reduces stack memory by replacing temporary local arrays with local variables.

Specify Single-Precision Data Type for Embedded Application

Generate code whose floating-point data types are only single precision, for example, for targeting a single-precision processor.

Generate Efficient Code by Specifying Data Types for Block Parameters

To generate more efficient code, match parameter data types with signal data types or store parameters in smaller data types.

Control Operator Type in Generated Code

Generate code with Logical or Bitwise Operators or a combination of both operators.