| Contents | Index |
| On this page… |
|---|
Selecting Blocks for Accelerator Mode Selecting Blocks for Rapid Accelerator Mode Controlling S-Function Execution Accelerator and Rapid Accelerator Mode Data Type Considerations |
The Accelerator simulation mode runs the following blocks as if you were running Normal mode because these blocks do not generate code for the accelerator build. Consequently, if your model contains a high percentage of these blocks, the Accelerator mode may not increase performance significantly. All of these Simulink blocks use interpreted code.
Note In some instances, Normal mode output might not precisely match the output from Accelerator mode because of slight differences in the numerical precision between the interpreted and compiled versions of a model. |
Blocks that do not support code generation (such as SimEvents®), or blocks that generate code only for a specific target (such as vxWorks), cannot be simulated in Rapid Accelerator mode.
Additionally, Rapid Accelerator mode does not work if your model contains any of the following blocks:
Device driver S-functions, such as blocks from the xPC Target product, or those targeting Freescale™ MPC555
Note In some instances, Normal mode output might not precisely match the output from Rapid Accelerator mode because of slight differences in the numerical precision between the interpreted and compiled versions of a model. |
Inlining S-functions using the Target Language Compiler increases performance with the Accelerator mode by eliminating unnecessary calls to the Simulink application program interface (API). By default, however, the Accelerator mode ignores an inlining TLC file for an S-function, even though the file exists. The Rapid Accelerator mode always uses the TLC file if one is available.
A device driver S-Function block written to access specific hardware registers on an I/O board is one example of why this behavior was chosen as the default. Because the Simulink software runs on the host system rather than the target, it cannot access the targets I/O registers and so would fail when attempting to do so.
To direct the Accelerator mode to use the TLC file instead of the S-function MEX-file, specify SS_OPTION_USE_TLC_WITH_ACCELERATOR in the mdlInitializeSizes function of the S-function, as in this example:
static void mdlInitializeSizes(SimStruct *S)
{
/* Code deleted */
ssSetOptions(S, SS_OPTION_USE_TLC_WITH_ACCELERATOR);
}
Accelerator mode supports fixed-point signals and vectors up to 128 bits.
Rapid Accelerator mode does not support fixed-point signals or vectors greater than 32 bits.
Rapid Accelerator mode supports fixed-point parameters up to 128 bits.
Rapid Accelerator mode supports fixed-point root inputs up to 32 bits
Rapid Accelerator mode supports root inputs of Enumerated data type
Rapid Accelerator mode does not support fixed-point data for the From Workspace block.
Rapid Accelerator mode supports bus objects as parameters.
The Accelerator mode and Rapid Accelerator mode store integers as compactly as possible.
Simulink Fixed Point does not collect min, max, or overflow data in the Accelerator or Rapid Accelerator modes.
Running the simulation from the command line or the menu determines the behavior of scopes and viewers in Rapid Accelerator mode.
| Scope or Viewer Type | Simulation Run from Menu | Simulation Run from Command Line |
|---|---|---|
| Simulink Scope blocks | Same support as Normal mode |
|
| Simulink signal viewer scopes | Graphics are updated, but logging is not supported | Not supported |
| Other signal viewer scopes | Support limited to that available in External mode | Not supported |
| Signal logging | Not supported | Not supported |
| Multirate signal viewers | Not supported | Not supported |
| Stateflow Chart blocks | Same support for chart animation as Normal mode | Not supported |
Rapid Accelerator mode does not support multirate signal viewers such as the DSP System Toolbox spectrum scope or the Communications System Toolbox™ scatterplot, signal trajectory, or eye diagram scopes.
Note Although scopes and viewers do not update when you run Rapid Accelerator mode from the command line, they do update when you use the menu. Running Acceleration Mode from the User Interface shows how to run Rapid Accelerator mode from the menu. Interacting with the Acceleration Modes Programmatically shows how to run the simulation from the command line. |
You cannot use the Accelerator or Rapid Accelerator mode if your model:
Passes array parameters to MATLAB S-functions that are not numeric, logical, or character arrays, are sparse arrays, or that have more than two dimensions
Uses Fcn blocks containing trigonometric functions having complex inputs
Rapid Accelerator mode does not support targets written in C++.
For Rapid Accelerator mode, model parameters must be one of these data types:
boolean
uint8 or int8
uint16 or int16
uint32 or int32
single or double
fixed-point
Enumerated
Certain words are reserved for use by the Simulink Coder code language and by Accelerator mode and Rapid Accelerator mode. These keywords must not appear as function or variable names on a subsystem, or as exported global signal names. Using the reserved keywords results in the Simulink software reporting an error, and the model cannot be compiled or run.
The keywords reserved for the Simulink Coder product are listed in Configuring Generated Identifiers. Additional keywords that apply only to the Accelerator and Rapid accelerator modes are:
| muDoubleScalarAbs | muDoubleScalarCos | muDoubleScalarMod |
| muDoubleScalarAcos | muDoubleScalarCosh | muDoubleScalarPower |
| muDoubleScalarAcosh | muDoubleScalarExp | muDoubleScalarRound |
| muDoubleScalarAsin | muDoubleScalarFloor | muDoubleScalarSign |
| muDoubleScalarAsinh | muDoubleScalarHypot | muDoubleScalarSin |
| muDoubleScalarAtan, | muDoubleScalarLog | muDoubleScalarSinh |
| muDoubleScalarAtan2 | muDoubleScalarLog10 | muDoubleScalarSqrt |
| muDoubleScalarAtanh | muDoubleScalarMax | muDoubleScalarTan |
| muDoubleScalarCeil | muDoubleScalarMin | muDoubleScalarTanh |
![]() | Choosing a Simulation Mode | Performing Acceleration | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |