Real-Time Workshop Embedded Coder Major Bug Fixes

This document describes major bug fixes in this release. Click on a problem area listed below to read how it has been fixed.

ASAP2 File Generation Failure When Using Custom Storage Classes
Block Reduction for Blocks with Output Signal of Non-Auto Storage Class
Code Generation with Masked Subsystem Parameters of Non-Auto Storage Class
Delay Block Code Generation with Expression Folding Enabled
Disallow simultaneous use of 'MAT-file logging' and 'Generate reusable code' options
ERT Target Now Supports Sample Time Offsets
Fixed Incompatibility Between Block Reduction and Custom Storage Classes
Generating ERT S-Function with Parameters Having Custom Storage Class
If Model Logs Final States, Output and Update Functions Are Not Combined
Initial Value of Data Store Memory Is Now Tunable
Model Stop Time Ignored By ERT Generated Applications
Parameter Structure Passed In Correctly to Generated Functions
Reduced Blocks That Are Connected to Merge Block Input
Restriction on 'Suppress error status in real-time model data structure' Option
Selecting "MAT-file logging" Simultaneously with "External mode" or "Suppress error status"
Start Function for Reusable Stateflow Charts
Subsystem Build Failure When Simulink Data Objects Used With Fixed-Point Data Types
Type Qualifiers Supported for Data with Custom Storage Class
Use of Global Variables for Block Outputs

ASAP2 File Generation Failure When Using Custom Storage Classes

Failures occurred in ASAP2 file generation when custom storage classes were used in the model. This problem has been fixed.

Block Reduction for Blocks with Output Signal of Non-Auto Storage Class

Block reduction is not performed for blocks that meet the following conditions: (1) the storage class of the output signal is not set to Auto and (2) the width of the signal entering the block's input port at its origin is not equal to the output port width. This fixes a problem where the width of the signal in generated code could differ, depending on whether or not Block reduction was enabled.

Code Generation with Masked Subsystem Parameters of Non-Auto Storage Class

Code generation failures occurred for models containing masked subsystems with fixed-point parameters having either a custom storage class, or any storage class other than Auto. Such failures occurred when generating the parameter tuning API (see "C API for Parameter Tuning" in the Real-Time Workshop documentation). This problem has been fixed.

Delay Block Code Generation with Expression Folding Enabled

With expression folding enabled, it was possible that the code generated for the Delay block could be invalid. This was a regression from Release 12.1 and has been corrected.

Disallow simultaneous use of 'MAT-file logging' and 'Generate reusable code' options

When MAT-file logging is enabled, static data structures are declared and used to log data. Static data is incompatible with the 'Generate reusable code' option, because that option implies that the generated code must be reentrant. Therefore, the ERT options 'MAT-file logging' and 'Generate reusable code' are no longer permitted to be selected simultaneously. If both options are selected, a diagnostic or error action is taken. The action taken (none/warning/error) is determined by the 'Reusable code error diagnostic' option.

ERT Target Now Supports Sample Time Offsets

Prior to Release 14, the ERT target silently ignored sample time offsets. The behavior has been corrected. Now the ERT target generates code to support sample time offsets, matching Simulink simulation behavior. However, RTW does NOT support sample time offset for base rate. If model is sigle rate and the rate has non-zero sample offset, RTW issues error message. Customer can work around this by setting base rate is the gcd of this rate and its offset.

Fixed Incompatibility Between Block Reduction and Custom Storage Classes

Code generation could fail with a segmentation fault when a model simultaneously contained custom storage classes and had the Block reduction option enabled. This problem has been fixed.

Generating ERT S-Function with Parameters Having Custom Storage Class

Starting in Release 12.1, generation of S-functions with the ERT target could fail for models containing parameters with Custom storage class. This problem has been fixed.

If Model Logs Final States, Output and Update Functions Are Not Combined

If a model was logging final states, but not logging states, and the "Single output/update function" option was selected, the final state could differ between simulation and execution of the ERT target executable. To fix this problem, output and update functions will no longer be combined if final states are being logged.

Initial Value of Data Store Memory Is Now Tunable

The Initial value parameter of the Data Store Memory block is now a tunable parameter. In previous releases, Initial value was statically initialized and therefore not tunable. This limitation has been removed.

Model Stop Time Ignored By ERT Generated Applications

Under certain circumstances, the ERT target optimizes certain timing- related fields out of the real-time mode (rtM) data structure. For example, when the 'MAT-file logging' option is deselected, the Timing.tFinal field is optimized out, and the generated program runs indefinitely and effectively ignores the model's 'Stop time' parameter. This behavior is intentional, and will be preserved as a default.

However, it has caused problems for ERT-based targets that need to honor the stop time. To solve this problem, the TLC variable 'ForceAbsoluteTime' has been created to allow target developers to override the default behavior. When 'ForceAbsoluteTime' is set to 1 in the system target file, the relevant timing fields of the rtM structure are always generated. This enables the generated application to honor the model stop time. The following are the fields affected:

Timing.taskTime0
Timing.stepSize0
Timing.tFinal
Timing.stopRequestedFlag

Parameter Structure Passed In Correctly to Generated Functions

The parameter structure was not passed in properly to functions generated by Real-Time Workshop Embedded Coder 3.0. This problem has been fixed.

Reduced Blocks That Are Connected to Merge Block Input

Previously, if a block connected to an input of a Merge block inport is reduced (e.g., removed by Block Reduction optimization), a segmentation fault occurred during code generation. To fix this problem, blocks connected to the inputs of Merge blocks are no longer reduced.

Restriction on 'Suppress error status in real-time model data structure' Option

The code generation option 'Suppress error status in real-time model data structure' cannot be selected when either of the following code generation options are selected: (1) MAT-file logging (2) External mode. When 'Suppress error status in real-time model data structure' is selected in combination with either of these options, an error message is displayed and code generation is aborted.

Selecting "MAT-file logging" Simultaneously with "External mode" or "Suppress error status"

Errors could result when the "MAT-file logging" option was selected at the same time as either the "Suppress error status" or "External mode" options. This problem has been fixed.

Start Function for Reusable Stateflow Charts

Real-Time Workshop Embedded Coder generated an invalid start function for Stateflow charts in reusable subsystems. Library charts have their start code called before the chart Instance code is run to initialize the pointers. This caused null pointer exception segmentation faults. This problem has been fixed.

Subsystem Build Failure When Simulink Data Objects Used With Fixed-Point Data Types

The Build Subsystem command could fail when the subsystem used Simulink data objects and fixed-point data types simultaneously. This problem has been fixed.

Type Qualifiers Supported for Data with Custom Storage Class

Compiler warnings could occur when compiling code generated for temporary (local) variables to point to parameters or signals with custom storage class. To fix this problem, an access method was added for custom storage classes that returns the type qualifier (e.g., "const", "volatile" or "const volatile"). This information is used when generating temporary (local) variables to point to parameters or signals that correspond to a particular custom storage class.

Use of Global Variables for Block Outputs

Some block outputs that could have been declared as local variables were defined as global, non-reusable storage. This problem is fixed, improving code efficiency.
 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS