Version 5.0 (R2007b) Real-Time Workshop® Embedded Coder™ Software

This table summarizes what's new in Version 5.0 (R2007b):

New Features and ChangesVersion Compatibility ConsiderationsFixed Bugs and Known ProblemsRelated Documentation at Web Site
Yes
Details below
NoBug Reports
Includes fixes
No

New features and changes introduced in this version are

New Target Function Library (TFL) API for Mapping Math Functions and Operators to Target-Specific Code

In previous releases, the Target floating-point math environment parameter on the Interface pane of the Configuration Parameters dialog box allowed you to select a math library (ANSI, ISO, or GNU) to which function calls would be generated for appropriate/supported functions within the generated code for your model. However, no general mechanism was provided for creating and registering generic target-specific function libraries.

This release provides the target function library (TFL) API, which allows you to create and register function replacement tables. When selected for a model, these TFL tables provide the basis for replacing default math functions and operators in your model code with target-specific code. The ability to control function and operator replacements in this manner potentially allows you to optimize target performance (speed and memory) and better integrate model code with external and legacy code.

The general steps for creating and using a target function library are as follows:

  1. Create one or more TFL tables containing replacement entries for math operators (+, –, *, /) and functions using a MATLAB-based API. (The demo rtwdemo_tfl_script provides example tables that can be used as a starting point for customization.)

  2. Register a target function library, consisting of one or more replacement tables, using a Simulink sl_customization API.

  3. Open your model and select the desired target function library from the Target function library drop-down list, located on the Interface pane in the Configuration Parameters dialog box.

  4. Build your model.

For more information, see Target Function Libraries in the Real-Time Workshop® Embedded Coder™ documentation.

Additionally, see the new demo rtwdemo_tfl_script, which illustrates how to use TFLs to replace operators and functions in generated code. With each example model included in this demo, a separate TFL is provided to illustrate the creation of operator and function replacements and how to register the replacements with Simulink.

Bidirectional Traceability Now Supported Through Automated Block-to-Code and Code-to-Block Highlighting

In previous releases, Real-Time Workshop Embedded Coder software provided traceability from generated code back to model source blocks through the Include hyperlinks to model option on the Real-Time Workshop pane of the Configuration Parameters dialog box.

This release provides bidirectional traceability between model source blocks and generated code by

To use Block-to-code highlighting,

  1. Open an ERT-based model and go to the Real-Time Workshop pane of the Configuration Parameters dialog box. Select the options Generate HTML report, Launch report automatically, and Block-to-code highlighting. (Selecting Block-to-code highlighting also enables the Configure button, which you can click to select a build directory to be traced.)

  2. Build your model. This will launch an HTML code generation report.

  3. In the model window, right-click any block. In the right-click menu, select Real-Time Workshop > Highlight Code.

  4. This selection highlights the generated code for the block in the HTML code generation report. The total number of highlighted lines is displayed next to each source file name in the left panel of the HTML report. Previous and Next buttons help you navigate through the highlighted lines.

For more information, see Creating and Using a Code Generation Report in the Real-Time Workshop Embedded Coder documentation.

Additionally, see the enhanced demo rtwdemo_hyperlinks, which walks you through using Code-to-block highlighting, Block-to-code highlighting, and the traceability report discussed in the next section.

HTML Code Generation Report Adds Traceability Report

In previous releases, HTML code generation reports did not provide information to help explain why some model blocks do not generate corresponding code. In this release, when you select the Block-to-code highlighting parameter discussed in the previous section, the generated HTML report contains a traceability report. The traceability report contains sections that allow you to account for Eliminated / Virtual Blocks versus Traceable Blocks, providing a complete mapping between blocks and code.

For more information, see Creating and Using a Code Generation Report in the Real-Time Workshop Embedded Coder documentation.

Additionally, see the enhanced demo rtwdemo_hyperlinks, which walks you through using the new traceability report.

Elimination of Wrapper Generated by R2007a model_step Function Prototype Control Feature

In R2007a, function prototype control generated a wrapper function to implement the model_step function. In R2007b, function prototype control modifies the model_step function directly, reducing execution time.

Optimized External I/O Data Structures with Function Prototype Control

In R2007b, function prototype control optimizes external I/O data structures in the following ways:

For more information, see Controlling model_step Function Prototypes in the Real-Time Workshop Embedded Coder documentation.

MISRA-C Compliance Enhanced for Enabled Subsystem Code

R2007b improves MISRA-C compliance of generated code by:

User-Defined Data Classes Can Reference Custom Storage Classes from Other Packages

In previous releases, the custom storage classes and memory section definitions contained in a package were unique to that package, and could not be used directly by other packages. The only recourse was to create a duplicate definition in every package that needed it. If a global change was needed in the definition of the class or section, each local copy had to be updated separately.

Any package can access and use custom storage classes and memory sections that are defined in any other package, including both user-defined packages and predefined packages such as Simulink and mpt. Only one copy of the class or section exists, in the package that first defined it; other packages refer to it by pointing to it in its original location. Thus any changes to the class or section, including changes to a predefined class/section in later MathWorks product releases, are available in every referencing package.

To configure a package to use a custom storage class or memory section that is defined in another package:

  1. Type cscdesigner to launch the Custom Storage Class Designer. The relevant part of the designer window looks like this:

  2. Select the Custom Storage Class or Memory Section tab as appropriate. Th following example assumes Custom Storage Class. Memory section references work the same way.

  3. Use Select Package to select the package in which you want to reference a class (or section) defined in some other package.

  4. In the Custom storage class definitions pane, select the existing definition below which you want to insert the reference.

  5. Click New Reference.

    A new reference with a default name and properties appears below the previously selected definition. The new reference is selected, and a Reference tab appears that shows the reference's initial properties. This tab appears whenever a reference is selected, allowing reference properties to be viewed and changed. A typical appearance is:

  6. Use the Name field to enter a name for the new reference. The name must be unique in the importing package, but can duplicate the name in the source package.

  7. Set Refer to custom storage class in package to specify the package that contains the custom storage class you want to reference.

  8. Set Custom storage class to reference to specify the custom storage class to be referenced. Trying to create a circular reference generates an error and leaves the package unchanged.

  9. Click OK or Apply.

If you had worked under the Memory Section tab rather than the Custom Storage Class tab, the sequence would have been essentially the same, with appropriate differences in the dialog box labels and the set of items available to be chosen.

You can use Custom Storage Class Designer capabilities to copy, reorder, validate, and otherwise manage classes and sections that have been added to a class by reference. However, you cannot change the underlying definitions. You can change a custom storage class or memory section only in the package where it was originally defined.

For more information, see Using Custom Storage Class References and Using Memory Section References.

Data Type Assistant Support for MPT Objects

Simulink now provides a standardized user interface, the Data Type Assistant, for specifying data types associated with Simulink blocks and data objects, as well as Stateflow data. See Using the Data Type Assistant for details.

The Data Type Assistant appears on the dialogs of a variety of blocks and data objects, including MPT data objects, which are specific to the Real-Time Workshop Embedded Coder software:

Information about MPT objects appears in Real-Time Workshop® Embedded Coder™ Module Packaging Features.

New Target Configuration Parameter for Enabling Real-Time Workshop Compiler Optimization Level Control

V5.0 (R2007b) Real-Time Workshop Embedded Coder introduces a new target configuration parameter, CompOptLevelCompliant. This parameter indicates whether a target supports the new Real-Time Workshop configuration parameter Compiler Optimization Level. (Compiler Optimization Level controls the compiler optimization level for building generated code; for more information, see Controlling Compiler Optimization Level and Specifying Custom Optimization Settings in the Real-Time Workshop documentation.)

When the CompOptLevelCompliant target configuration parameter is set to on, the Compiler Optimization Level parameter is displayed in the Real-Time Workshop pane of the Configuration Parameters dialog box for your model. If the CompOptLevelCompliant parameter is not set to on, the Compiler Optimization Level parameter does not appear.

By default, the CompOptLevelCompliant parameter is set to off for custom targets and on for targets provided by Real-Time Workshop and Real-Time Workshop Embedded Coder.

To make a target compliant, use the SelectCallback function to set CompOptLevelCompliant to on, and then modify the target makefile to honor the setting for Compiler Optimization Level, in the manner of the targets provided by Real-Time Workshop and Real-Time Workshop Embedded Coder.

New Interactive Guided Introduction Demo

An interactive demo of Real-Time Workshop Embedded Coder is available. This demo shows you how to apply MathWorks products to the basic steps that are common to most projects that design and implement a control algorithm. To view the demo:

  1. Launch MATLAB Online Help.

  2. Configure File > Preferences > Help > Enable product filter so that Help information appears for Simulink, Real-Time Workshop, and Real-Time Workshop Embedded Coder.

  3. Select the Demos tab.

  4. Navigate to and expand Simulink > Real-Time Workshop > Guided Introductions > Real-Time Workshop Embedded Coder.

Help displays the names of the modules that comprise the Real-Time Workshop Embedded Coder Guided Introduction. To begin viewing the demo, click the name of the first module, Introduction, then proceed through subsequent modules in order, or jump directly to any that are of particular interest.

New and Enhanced Demos

The following demos have been added:

Demo...Shows How You Can...
rtwdemo_pcgd_introApply MathWorks products to the basic steps that are common to most projects that design and implement a control algorithm. For more information, see New Interactive Guided Introduction Demo.
rtwdemo_tfl_scriptUse Target Function Libraries (TFLs) to replace operators and functions in generated code. With each example model included in this demo, a separate Target Function Library is provided to illustrate the creation of operator and function replacements using a MATLAB based API, and how to register the replacements with Simulink.

The following demo has been enhanced to illustrate code traceability improvements in R2007b, including block-to-code highlighting and traceability report enhancements:

  


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