| Version 4.5 (R2006b) Real-Time Workshop® Embedded Coder™ Software Release Notes | ![]() |
This table summarizes what's new in Version 4.5 (R2006b):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility Considerations, below. See also Summary. | Bug
Reports Includes fixes | No |
New features and changes introduced in this version are
Fixed-Point Code Generation Support for Enhanced N-Dimensional Lookup Table Blocks
New General-Purpose OSEK/VDX Real-Time Operating System (RTOS) Example
Maximum Length Enforced for Auto-Generated Identifiers in Generated Code
New Default Value for IncludeERTFirstTime Model Configuration Parameter
Use of firstTime Argument to model_initialize Function to Be Discontinued
"Source of initial values" Option for MPT Data Objects Removed
Real-Time Workshop Embedded Coder V4.5 (R2006b) provides the following efficiency enhancements in code generated from Simulink models:
Element-by-element optimized code for vector operations
Improved efficiency and readability of for loops generated for wide signals that have multiple sources
Unnecessary temporary variables no longer generated for muxed signals
Real-Time Workshop Embedded Coder V4.5 (R2006b) supports fixed-point code generation for the following new Simulink N-dimensional lookup table blocks:
The new blocks provide fixed-point arithmetic and more efficient code generation than the blocks they replace, PreLookup Index Search and Interpolation (n-D) Using PreLookup.
The new Code Style pane in the Configuration Parameters dialog box allows you to control optional parentheses in generated code, including generating code that meets MISRA requirements. The default behavior is to generate code similar to that of previous releases.
For more information, see Code Style Pane in the Real-Time Workshop Embedded Coder documentation.
If you select the Generate HTML report check box on the Real-Time Workshop pane of the Configuration Parameters dialog box, Real-Time Workshop Embedded Coder automatically produces a code generation report in HTML format. In R2006b, the performance associated with producing the code generation report has improved significantly. In addition, the reports no longer display the names of hidden blocks, such as automatically inserted Rate Transition blocks, as hyperlinks.
Real-Time Workshop Embedded Coder V4.5 (R2006b) adds a new demo, rtwdemo_osek, that illustrates techniques for interfacing to the OSEK/VDX® real-time operating system (RTOS). The demo model includes:
Example Simulink block implementations of OSEK functions SetAlarm and ActivateTask
Function-call subsystems that are generated as separate OSEK tasks, which can execute based on assigned priority using the OSEK scheduler
Additional files related to the demo are provided in matlabroot/toolbox/rtw/rtwdemos/osektgt_demo. These include:
Real-Time Workshop Embedded Coder file customization template osek_file_process.tlc, which generates a generic OSEK main program and an OSEK Implementation Language (OIL) file
OSEK library file oseklib.tlc, which contains functions called by osek_file_process.tlc
C and C-mex files for the S-functions oseksetalarm and osektask
After launching rtwdemo_osek, you can save the model file rtwdemo_osek.mdl to a work directory. You can use the model file and the related files in matlabroot/toolbox/rtw/rtwdemos/osektgt_demo as a starting point to target specific OSEK implementations. The demo model provides examples of implementing Simulink blocks for OSEK APIs, and you can modify oseklib.tlc and osek_file_process.tlc to provide detailed information about your OSEK implementation.
Note
|
As of V4.5 (R2006b), the STF_make_rtw_hook.m hook file, which you can use to customize the target build process, supports a new 'error' hook method. If used, Real-Time Workshop calls the 'error' hook method when an error occurs during code generation or the build process. For example, you might use the new hook method to clean up any static or global data used by the hook file after an error occurs. Valid arguments include the hook method and model name.
For more information about the 'error' hook method or the STF_make_rtw_hook.m hook file, see Customizing the Target Build Process with the STF_make_rtw Hook File.
In previous releases, some auto-generated identifiers in generated code were allowed to exceed the Maximum identifier length specified on the Real-Time Workshop/Symbols pane of the Configuration Parameters dialog box. Generated identifiers that exceeded the Maximum identifier length did not honor the user setting and potentially were inconsistent with ANSI-C or MISRA guidelines requiring identifiers to be unique within a prescribed length (31 characters).
In R2006b, the user-specified Maximum identifier length is more rigorously enforced for auto-generated identifiers in generated code.
For limitations that apply, see Identifier Format Control Parameters Limitations in the Real-Time Workshop Embedded Coder documentation. For upgrade and compatibility considerations, see Compatibility Considerations.
For more information about the Real-Time Workshop Embedded Coder parameters for Identifier format control and their use, see Customizing Generated Identifiers and its subsection Specifying Identifier Formats in the Real-Time Workshop Embedded Coder documentation.
The following considerations for identifier format control apply when upgrading a Simulink model from an earlier release to this release:
Some identifiers that were allowed to exceed the Maximum identifier length (on the Real-Time Workshop/Symbols pane of the Configuration Parameters dialog box) in earlier releases are mangled in this release to conform to the maximum length. The mangling is most likely to occur in models with long names.
To preserve the identifiers, you can increase the value of the Maximum identifier length parameter for the model.
For models that use model referencing, some models that built successfully in previous versions might get build warnings or errors in R2006b, due to potential collisions between truncated identifier names that are exported by sibling models. To avoid name clashes in models that use model referencing, do one of the following:
Increase the Maximum identifier length for top and referenced models until the warnings or errors disappear. In this case, uniqueness of model names ensures that the exported identifier names do not clash.
Define a unique identifier naming scheme for each model. For example, you might define the Identifier format control string m1$R$N$M for the first model, m2$R$N$M for the second model, and so forth. In this case, uniqueness of Identifier format control strings ensures that the exported identifier names do not clash.
The identifier format control enhancements in this release introduce some naming differences in the auto-generated identifiers for
Stateflow and Embedded MATLAB temporary variables
Subsystem and model reference global identifiers and types
In R2006a, Real-Time Workshop Embedded Coder introduced the IncludeERTFirstTime model configuration parameter, which specifies whether Real-Time Workshop Embedded Coder is to include the firstTime argument in the model_initialize function generated for an ERT-based Simulink model.
In R2006b, the default value of this parameter has changed from on (include the firstTime argument) to off (do not include the firstTime argument). As a result, for ERT-based Simulink models newly created in R2006b, the code generated for the model_initialize function by default will no longer include the firstTime argument.
To include the firstTime argument in generated code, change the value of the IncludeERTFirstTime parameter to on. However, see the release note Use of firstTime Argument to model_initialize Function to Be Discontinued.
Note In R2006b, it is no longer required that the setting for IncludeERTFirstTime must be consistent throughout a model reference hierarchy. |
For ERT-based Simulink models newly created in R2006b, the code generated for the model_initialize function by default will no longer include the firstTime argument. As a result, existing custom static main programs that invoke model_initialize with the firstTime argument will need to be reconciled with the code generated for the model_initialize function. For example, you can
Modify the invoking main program to remove code related to the firstTime argument (recommended).
Change the value of the IncludeERTFirstTime model configuration parameter to on and regenerate code for the Simulink model.
Modify the invoking main program to conditionally include or suppress the firstTime argument for the Simulink model. In the generated header file autobuild.h, the macro INCLUDE_FIRST_TIME_ARG will be set to 0 if the IncludeERTFirstTime parameter is set to off or 1 if the parameter is set to on. Inside the static main program, make sure to #include autobuild.h and then conditionally compile declarations and calls to the model_initialize function, based on the value of the INCLUDE_FIRST_TIME_ARG macro.
In a future release, Real-Time Workshop Embedded Coder will no longer use the firstTime argument in a model's generated model_initialize function. For more information about this change, use the form at http://www.mathworks.com/contact_TS.html to contact The MathWorks Technical Support.
In R2006b, the Source of initial values option for MPT data objects has been removed from the Data Placement pane of the Configuration Parameters dialog box. Although this option was visible in R2006a, it was obsolete and the setting had no effect.
Use Simulink.Signal objects to initialize signal values, as explained in Initializing Signals and Discrete States in the Simulink documentation.
The following demos have been added:
| Demo... | Shows How You Can... |
|---|---|
| rtwdemo_importstruct | Import externally defined parameters into Simulink. This model demonstrates how to generate code that accesses the fields of a data structure. The data structure is defined in legacy (hand-written) code and accessed via a pointer. This technique enables users to easily switch between complete sets of parameters at run time (for example, between reference and working versions). |
| rtwdemo_osek | Interface to the OSEK/VDX real-time operating system. For more information, see New General-Purpose OSEK/VDX Real-Time Operating System (RTOS) Example. |
| rtwdemo_parentheses | Set the style of parenthesization in generated code to be Minimum (only parentheses required by C syntax), Nominal (parentheses added to optimize readability), or Maximum (parentheses obviate C precedence, as required by MISRA). |
R2006b adds HTML and PDF reference documentation for Real-Time Workshop Embedded Coder functions and blocks.
![]() | Version 4.6 (R2007a) Real-Time Workshop Embedded Coder Software | Version 4.4.1 (R2006a+) Real-Time Workshop Embedded Coder Software | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |