Version 5.2 (R2008b) Real-Time Workshop Embedded Coder Software

This table summarizes what's new in Version 5.2 (R2008b):

New Features and ChangesVersion Compatibility ConsiderationsFixed Bugs and Known ProblemsRelated Documentation at Web Site
Yes
Details below
Yes—Details labeled as Compatibility Considerations, below. See also SummaryBug Reports
Includes fixes

Printable Release Notes: PDF

Current product documentation

New features and changes introduced in this version are

New Option to Generate Encapsulated C++ Class Interfaces for Model Data and Functions

The Real-Time Workshop® language option C++, introduced in R14SP2, generates a C++ compatible interface to code generated from Simulink models. However, code generated using the C++ option has the limitation that model data and functions are not encapsulated into C++ class attributes and methods.

With the addition of the language option C++ (Encapsulated) in R2008b, the Real-Time Workshop® Embedded Coder™ software can generate a C++ class interface to model code, in which all required model data is encapsulated into C++ class attributes and all model entry point functions are encapsulated into C++ class methods. The benefits of encapsulation include

C++ encapsulation also can be applied to right-click builds of nonvirtual subsystems.

For more information, see Generating and Controlling C++ Encapsulation Interfaces in the Real-Time Workshop Embedded Coder documentation.

For a demonstration of the C++ encapsulation capability, see the demo model rtwdemo_cppencap.

New CPPClassGenCompliant Target Configuration Parameter

In conjunction with the C++ encapsulation feature described in the previous section, this release introduces the CPPClassGenCompliant target configuration parameter. This parameter is set in the SelectCallback function for an ERT-based target to indicate whether the target supports the ability to generate and configure C++ encapsulation interfaces to model code. The default is off for custom and non-ERT targets and on for ERT (ert.tlc) targets.

To make an ERT-based target compliant, use the SelectCallback function to set CPPClassGenCompliant to on. This enables the feature infrastructure and user interface.

When the language option C++ (Encapsulated) is selected, code generation always generates an example main program, ert_main.cpp, demonstrating how the generated code can be deployed. The generated example main file has been updated to declare model data and call the C++ encapsulation interface configured model step method appropriately.

New Processor-in-the-Loop (PIL) Model Block Simulation Mode and API

Real-Time Workshop Embedded Coder now provides Processor-in-the-Loop (PIL) Model block simulation mode and API for verification of embedded code on your target processor.

For more information see Verifying Generated Code with Processor-in-the-Loop in the Real-Time Workshop Embedded Coder documentation.

See the following new demos for step-by-step examples:

AUTOSAR Enhancements

AUTOSAR support has been enhanced to include the following functionality:

For information, see Generating Code That Complies with AUTOSAR Standards in the Real-Time Workshop Embedded Coder User's Guide documentation.

New functions also provide command-line access to all new AUTOSAR options. For more information, see Configuring AUTOSAR Options Programmatically in the Real-Time Workshop Embedded Coder User's Guide documentation.

Also, a new AUTOSAR demo is provided, rtwdemo_autosar_mutirunnables_script, and the existing two demos are updated.

Flexible Configuration Options for Referenced Models in TLC-Based Custom Targets

In R2008b, you can specify that a configuration option for a TLC-based custom target need not have the same value in a referenced model that it has in the parent model. By default, the values must be the same in both models. See Controlling Configuration Option Value Agreement for information about overriding this default.

Generated Code Enhancements

In R2008b, code generation is enhanced to:

Target Function Library Enhancements

Functions pow, power, and memcpy Now Supported for Function Replacement

This release adds pow, power, and memcpy to the list of functions that you can replace with custom or target-specific implementations using target function libraries (TFLs). This allows you to replace default implementations of pow, power, or memcpy that may be insufficient for your application or your target environment.

For a demonstration of pow, power, and memcpy function replacements, see the demo model rtwdemo_tflmath. For detailed information about TFLs, see Target Function Libraries in the Real-Time Workshop Embedded Coder documentation.

Improved Fixed-Point Multiplication and Division Operator Replacement

In previous releases, TFL support for fixed-point multiplication and division operator replacement did not provide a generalized net slope matching capability. This limited the ability to generate the same TFL replacement function for a range of different input slopes in the model. This release adds a new Net Slope TFL entry, which allows you to match fixed-point slope information between a multiplication or division operator and the TFL entry in a more general and intuitive way.

Enhanced emlc Support for Target Function Libraries

Support for Embedded Real-Time (ERT) Target Function Libraries

You can now configure emlc to use ERT target function libraries (TFLs) when generating C code. You enable this feature by defining a configuration object for C code generation using a new ert parameter at the MATLAB command prompt, as in this example:

rtwcfg = emlcoder.RTWConfig('ert')

When you open the properties dialog box for the configuration object, the ERT TFLs will appear in the drop-down list for the Target function library field.

This feature requires a Real-Time Workshop Embedded Coder license.

New API for Customizing Target Function Libraries

This release introduces an API for registering custom embedded real-time (ERT) target function libraries (TFLs) for use with emlc. You register one or more custom TFLs in a file called rtwTargetInfo.m that emlc reads on the MATLAB path. This feature requires a Real-Time Workshop Embedded Coder license.

New Code Interface Report Details Generated Code Architecture

A new Code Interface Report section has been added to the standard Real-Time Workshop Embedded Coder HTML code generation report. The Code Interface Report section provides documentation of the generated code interface, including model entry point functions and interface data, for consumers of the generated code. The information in the report can help facilitate code review and code integration.

The Code Interface Report section is automatically included in every Real-Time Workshop Embedded Coder HTML code generation report, so to generate it, you need only select the model option Create code generation report. To view the code interface report for a model, build the model, go to the Contents pane of the code generation report, and click the Code Interface Report link.

For more information, see Using the Code Interface Report to Analyze the Generated Code Interface in the Real-Time Workshop Embedded Coder documentation.

Scheduling Code Now Separated from Model Application Code

In previous releases, algorithmic code and rate-monotonic scheduling code were interleaved in multirate model code generated by Real-Time Workshop Embedded Coder software. This could make it difficult to deploy multirate algorithmic code independently of the Real-Time Workshop Embedded Coder scheduling code.

In R2008b, scheduling code has been moved from the generated file model.c to the example main program, creating a clean separation of algorithmic code and scheduling code. This has the following benefits:

Code generation assumes the same run-time environment, with a rate-monotonic scheduler in use, as in previous releases.

Compatibility Considerations

In R2008b, Real-Time Workshop Embedded Coder no longer generates rate-monotonic scheduling code that is interleaved with multirate algorithmic code in model.c. Code for controlling the execution of subrate tasks now resides exclusively in ert_main.

Multirate code generated using R2008b will be compatible with previously existing models, except when both of the following conditions are true:

If both of the listed conditions apply, and if you want to continue to work with your existing static main program and system target file, you must add an if statement to your static main program. In the section of your static main that updates event flags and checks for subrate overrun conditions, add the two lines shown in bold below:

    for (i = FIRST_TID+1; i < NUMST; i++) {
        if (rtmStepTask(RT_MDL,i) && eventFlags[i]++) {
            OverrunFlags[0]--;
            OverrunFlags[i]++;
            /* Sampling too fast */
            rtmSetErrorStatus(RT_MDL, "Overrun");
            return;
        }
        if (++rtmTaskCounter(RT_MDL,i) == rtmCounterLimit(RT_MDL,i))
            rtmTaskCounter(RT_MDL, i) = 0;
    }

Model Initialization Function Prototype Control

Previously, nonreentrant code supported control of the model step function prototype. In R2008b, function prototype control includes control for initialization functions, simplifying code integration and testing, and reducing global RAM usage.

As part of this enhancement, the Model Interface dialog box has the following changes:

Previous Model Interface Dialog BoxNew Model Interface Dialog Box
Function Specification parameter options:
  • Default model-step function

  • Model Specific C prototype

Function Specification parameter options:
  • Default model initialize and step functions

  • Model Specific C prototypes

Preview subpaneStep function preview subpane
Configure function arguments subpaneConfigure model initialize and step functions subpane
N/AInitialize function name parameter
Function name parameterStep function name parameter
Function argument tableStep function arguments table

See Controlling Model Function Prototypes for more information.

Compatibility Considerations

Previously, if your model included a Stateflow chart that has the chart property Execute (enter) Chart At Initialization selected and the chart was connected to model inports or outports, during the build process a Stateflow diagnostic referenced this construct, but code was always generated.

In R2008b, if this construct is in your model and you are controlling the model function prototypes, the build process results in an error and code is not generated. To avoid this error, you can:

  1. Place a Signal Conversion block between the root inport or outport and the Stateflow chart.

  2. Select the Override optimizations and always copy signal parameter of the Signal Conversion block.

Support for Model-Level Control of Test Points

Previously, disabling test points set during debugging required you to disable each test point individually. Not disabling test points can lead to suboptimal generated code. In R2008b, the Real-Time Workshop software provides a single option to ignore all test points during code generation, facilitating transition from prototyping to deployment and avoiding accidental degradation of generated code due to workflow artifacts. See Ignore test point signals in the Real-Time Workshop documentation.

Custom Storage Class Enumerated Type Name Misspelling Fixed

The enumerated type name BuiltinCSCAttributes_IncludeDelimeter has been renamed BuiltinCSCAttributes_IncludeDelimiter.

Custom Storage Class File Type Changed in R2008a

Up until R2007b, The MathWorks released built-in custom storage class definitions only in M-files. In R2008a and R2008b (the current release) The MathWorks released built-in custom storage class definitions in both M-files and P-files, creating a possible incompatibility. No R2008a release note appeared that described this change, but a note now appears in its correct location. See the R2008a release note Custom Storage Class File Type Changed for information about the change and the possible Compatibility Considerations that it introduced.

Minimize Local Variables in Code Generation Using New Configuration Parameter

R2008b introduces a new configuration parameter to eliminate copies between local and global variables, reducing stack size and data copy operations. See Minimize data copies between local and global variables in the Simulink documentation for more information.

Simulink Configuration Parameters

In R2008b, the following Simulink Configuration Parameters dialog box button label is updated:

LocationPrevious Parameter LabelNew Parameter Label
Real-Time Workshop > InterfaceConfigure Step FunctionConfigure Model Functions

New and Enhanced Demos

The following demos have been added:

Demo...Shows How You Can...
rtwdemo_autosar_multirunnables_scriptConfigure and generate AUTOSAR-compliant code and export AUTOSAR software component description XML files for a Simulink model with multiple runnable entities.
rtwdemo_cppencapGenerate a customizable C++ encapsulation interface to code generated by the Real-Time Workshop Embedded Coder software.
rtwdemo_custom_pilCreate a custom processor-in-the-loop (PIL) configuration using target connectivity APIs.
rtwdemo_iec61508_scriptUse Model Advisor checks to help you develop a model and code that comply with the IEC 61508 standard (uses Simulink® Verification and Validation™ software).
rtwdemo_pilCompare results from Normal mode simulation and PIL mode execution for the same referenced model.

The following demo has been enhanced in R2008b:

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS