Chapter 14 Preparing Models for Use with Reactis
To use Reactis on a Simulink / Stateflow model, you must ensure
that the model satisfies certain constraints. This chapter
describes what these constraints are. Please note that,
while every effort is made to maintain the accuracy of the
following list of supported and unsupported features, due to
the complexity and continual evolution of the Simulink / Stateflow
notation, this description may not be complete. For example,
some blocks listed as supported do not support all
parameters for the block. A block or feature not listed as
either supported or unsupported should be assumed to be
unsupported. We encourage all potential customers to take advantage of a free evaluation
license for Reactis to determine if the subset of Simulink / Stateflow supported by
Reactis is adequate for your models. If it’s not, please let us know
what features or blocks you would like to see Reactis support. Reactive
Systems uses such feedback to prioritize enhancements to Reactis.
14.1 MATLAB
Reactis can process Simulink / Stateflow models that contain MATLAB code in callbacks
or mask initializations, provided that certain conventions are observed. On the
one hand, files that define workspace data items referred to in a model must be
“connected” to the model appropriately, and certain MATLAB functions should
be avoided. The remainder of this section elaborates on these points.
14.1.1 Workspace Data Items
Reactis invokes MATLAB to evaluate many MATLAB expressions, but it does
not directly interact with an executing MATLAB session in the same way that
Simulink does. For this reason, any workspace data items that a model uses
must be initialized within one of the following locations : -
Any Simulink model callback or block callback that is executed when
loading or running the model (PreLoadFcn, PostLoadFcn, InitFcn, StartFcn).
- A “startup.m” file located in the folder where the model file is located.
When using this method, make sure that the “Execute startup.m and pathdef.m scripts
in model folder” is checked in the “General” tab of the Reactis Info File Editor.
- The “Callbacks” tab of the Reactis Info File Editor. If in your environment
the MATLAB workspace for your model is set up via some external script or graphical
user interface prior to loading the model, you can add the initialization code here
so Reactis knows how to set up the workspace. Reactis will automatically execute
the “Pre-Load Function” code prior to loading the model and the “Post-Load Function”
code after loading the model. This method allows you to use Reactis in such an
environment without having to modify your model.
For the cruise-control example, the
file
cruise_constants.m
defines two workspace variables that are used in
cruise.mdl. One attaches
cruise_constants.m
to cruise.mdl as
follows: -
Load cruise.mdl into Simulink.
- From the Simulink window, select the File > Model Properties
menu item.
- In the resulting dialog, select the Callbacks tab.
- In the Model pre-load function entry box enter
cruise_constants; .
- Save the model.
In general, using the PreLoadFcn callback in this manner is good modeling
practice, since once the .m files are attached to a model file, loading the
model file into Simulink (and not just Reactis) will automatically load
the .m files as well.
14.1.2 Unsupported MATLAB Features
While Reactis supports most of MATLAB, the following exceptions may not be
used in Simulink / Stateflow models, e.g. in callbacks or mask initializations. Note, that a
feature added in V2010.2 adds partial support for these commands. To enable the
feature for a model, load the model, select menu item Edit > General, and then
check the box “Propagate set_param changes by saving the model to a temporary
file”. To enable this feature for all models, select File > Model Defaults...
and then check the box “Propagate set_param changes by saving the model to a temporary
file” in the General tab. If this setting is enabled, Reactis
will cause Simulink to apply all the changes to the model, then automatically
save them to a temporary file. Reactis then imports the temporary model
to see the applied changes.
Expression Evaluation |
ASSIGNIN | Assign variable in workspace. |
EVALIN | Evaluate expression in workspace. |
Model Construction/Modification |
ADD_BLOCK | Add a block to a Simulink system. |
ADD_LINE | Add a line to a Simulink system. |
ADD_PARAM | Add a parameter to a Simulink system. |
DELETE_BLOCK | Delete a block from a Simulink system. |
DELETE_LINE | Delete a line from a Simulink system. |
DELETE_PARAM | Deletes a parameter from a Simulink system. |
NEW_SYSTEM | Create a new empty Simulink system. |
REPLACE_BLOCK | Replace blocks in model. |
SET_PARAM | Set Simulink system and block parameters. |
14.2 Simulink
Reactis currently supports Simulink releases R2011a through R2021a. Most features
of Simulink are supported; but the following are not supported by Reactis:
-
Continuous-time blocks.
- The use of complex values (i.e. values with real
and imaginary parts).
- Models containing corresponding DataStoreWrite/DataStoreRead
blocks whose execution order is not explicitly defined by either the model
logic or priorities.
For the subset of Simulink blocks supported by Reactis please refer to
Section 14.2.3. For blocks that can be either continuous- or
discrete-time, only the discrete-time version is supported. For some blocks
identified as supported, not all settings are supported.
14.2.1 S-Functions
Reactis supports both C-Coded and M-File S-functions, with some
restrictions. For C-Coded S-functions, the following
are not supported by Reactis:
-
Port-based sample times.
- Multiple sample times.
- Complex number signals.
- Zero-crossing detection.
- Output of function-calls.
- Level 1 S-functions (For a guide on how to convert Level 1 S-functions
to Level 2 S-functions — which are supported by Reactis - please consult
the MathWorks documentation)
- Calling any function from MATLAB’s “mex” library (including
mexCallMATLAB, mexEvalString and mexGetVariable) from an S-Function.
For M-File S-functions, the following are not supported by Reactis:
-
Multiple sample times.
- Complex number signals.
- Level 2 S-functions.
In addition to the above restrictions, care must be taken about any internal
data that is stored by S-functions. In order to work properly,
Reactis must be able to retrieve and reset the values of all internal
states of any S-function occurring within a model. The best way to make
internal states visible to
Reactis (and Simulink) is to declare the appropriate number of discrete
states in the
mdlInitializeSizes() function and then use the state vector that
Reactis and
Simulink will provide. Reactis will also save and restore
memory that an S-function allocates as a result of calling the
ssGetNumRWork() and
ssGetNumIWork() during mdlInitializeSizes . Reactis has no way of knowing about any other persistent data that an
S-function maintains by other means, such as:
-
global or static variables in C-code;
- memory allocated by malloc() or mxMalloc() functions
in C-code;
- Use of workspace variables in M-File S-functions.
Reactis will also not save and restore memory requested by
ssGetNumPWork() , since otherwise pointers stored in this vector by your
S-function might get lost or mangled, resulting in memory leaks or crashes. If an S-function stores internal states in any of the unsupported ways
described above, Reactis will seem to work properly, but the test
suites generated by Tester may include wrong outputs. One sign of
this can be if you run a test suite in Simulator and get an error
message saying “Model fails test”. Another problem of such
invalid use of internal states may be invalid outputs after using the
“back” buttons in Simulator.
In general, Reactis passes S-Function parameters as fixed values at the time
the S-Function is first initialized (i.e. when Tester or Simulator is
started). Therefore, if a configuration variable is used as a parameter to an
S-Function, the S-Function will not see any changes to the configuration
variable unless the S-Function is designed to process such updates. To have an
S-Function be updated on changes to its parameters, define a mdlProcessParameters function (see Simulink documentation) within the
S-Function code. If this function is present, then Reactis will propagate the
parameter changes into the S-Function by calling the S-Function’s mdlProcessParameters function at each step with the new parameter values. In the mdlProcessParameters function, the S-Function can then take appropriate actions
if any parameters have changed.
14.2.2 Lookup Tables
This section describes the settings for each of the standard Simulink Lookup
Table blocks that are supported by Reactis. Some settings might not be relevant
depending on the version of MATLAB used. For example, many data type settings
for the “Lookup Table (n-D)” block were only introduced in MATLAB R2009b and
therefore are not relevant when using Reactis with MATLAB R2009a or earlier.
14.2.2.1 1-D Lookup Table
Note that this block was previously named Lookup Table.
All block settings and the data type combinations listed below are supported
(note that fixpoint includes all fixed-point data types and integer
data types int8, uint8, int16, uint16, int32 and uint32).
Supported Data Type Combinations |
Input of LUT | Output of LUT |
double | double |
single | double |
fixpoint | double |
single | single |
fixpoint | single |
double | fixpoint |
single | fixpoint |
fixpoint | fixpoint |
double | boolean |
single | boolean |
fixpoint | boolean |
14.2.2.2 2-D Lookup Table
Note this block was previously named Lookup Table (2-D).
All block settings are supported.
Supported data type combinations are listed in the table
below (note that fixpoint includes all fixed-point data types and integer
data types int8, uint8, int16, uint16, int32 and uint32).
Supported Data Type Combinations |
1st Input of LUT | 2nd Input of LUT | Output of LUT |
double | double | double |
double | fixpoint | double |
double | bool | double |
single | single | double |
fixpoint | double | double |
fixpoint | fixpoint | double |
bool | double | double |
single | single | single |
single | fixpoint | single |
single | bool | single |
fixpoint | single | single |
fixpoint | fixpoint | single |
bool | single | single |
double | double | fixpoint |
single | single | fixpoint |
fixpoint | fixpoint | fixpoint |
fixpoint | fixpoint | bool |
double | double | bool |
single | single | bool |
14.2.2.3 n-D Lookup Table
This block was previously named Lookup Table (n-D). Reactis supports a wide
variety of n-D lookup tables, subject to restrictions which depend on the number
of table dimensions. There are two levels of support, native and via
S-function. Native support means Reactis will natively execute the n-D lookup table
block and track coverage for it. Only n-D lookup tables which satisfy the
following requirements are natively supported in Reactis: -
The number of table dimensions is at most three, or the number dimensions is four
and all input, output and internal data types are the same floating-poing data type.
Note that coverage tracking is only supported for n-D Lookup Table blocks with table dimensions
two or less.
- The interpolation and extrapolation methods are not cubic spline.
- The types used in the table are restricted to the following:
fixed-point types with a bias of zero
and a slope that is a (negative) power of two, integer types,
single- or double-precision floating-point types, Boolean.
Support via S-function means Reactis can execute the n-D lookup block
but not track coverage. In order to execute the block,
Reactis requires the sfun_lookupnd.mexw32 S-Function that
comes with MATLAB R2007a or earlier. Starting with MATLAB R2007b,
this S-Function is no longer included in the MATLAB distribution.
However, if a sfun_lookupnd.mexw32 from R2007a
or earlier is placed in Reactis’ search path,
Reactis can use that S-Function even with R2007b
and later. n-D lookup tables which meet the following six requirements are supported via S-function
in Reactis: -
The input and output types are the same floating-point type.
- The fraction data type is set to Inherit via internal rule.
- The table data type is set to Inherit: same as output.
- The breakpoint data type is set to Inherit: same as corresponding input.
- All inputs are scalars.
- If the table has more than one dimension,
then the intermediate data type is set to Inherit: same as output.
14.2.2.4 Direct Lookup Table (n-D)
Only floating-point (double and single) data types are supported. This table is supported in Reactis via the sfun_nddirectlook.mexw32 S-Function that comes
with MATLAB R2009a and earlier. Starting with MATLAB R2009b, this S-Function is no
longer included in the MATLAB distribution. However, if a sfun_lookupnd.mexw32 from R2009a
or earlier is placed in Reactis’ search path, Reactis can use that S-Function even with R2009b
and later.
14.2.2.5 Lookup Table Dynamic
All parameters and the data type configurations listed for the “Lookup Table” block above
are supported.
14.2.2.6 Prelookup
There are two levels of support for the Prelookup block in Reactis, native and
via S-function. Native support means Reactis will natively execute the Prelookup
block and track coverage for it.
Reactis natively supports Prelookup blocks which use the following types:
fixed-point types with a bias of zero
and a slope that is a (negative) power of two, integer types,
single- or double-precision floating-point types, Boolean. Support via S-function means Reactis can execute the Prelookup block
but not track coverage. In order to execute the block,
Reactis requires the sfun_idxsearch.mexw32 S-Function that
comes with all versions of MATLAB. All parameters are supported. The following data type restrictions apply:
-
Only floating-point (double and single) input data types are supported.
- Only “int32” and “uint32” are supported as the data type of the “index” output.
- Only “single” and “double” are supported as the data type of the “fraction” output.
14.2.2.7 Interpolation using Prelookup
There are two levels of support for the Interpolation block in Reactis,
native and via S-function. Native support means Reactis will natively execute the Interpolation
block and track coverage for it. Only Interpolation blocks which satisfy the following
requirements are natively supported in Reactis: -
The number of table dimensions is at most three. Note that coverage tracking is
only supported for n-D Lookup Table blocks with table dimensions two or less.
- The interpolation and extrapolation methods are not cubic spline.
- The types used in the table are restricted to the following:
fixed-point types with a bias of zero
and a slope that is a (negative) power of two, integer types,
single- or double-precision floating-point types, Boolean.
Support via S-function means Reactis can execute the Interpolation block
but not track coverage. In order to execute the block,
Reactis requires the sfun_kflookupnd.mexw32 S-Function that
comes with all versions of MATLAB. All parameters are supported. The following data type restrictions apply:
-
Only floating-point (double and single) data types are supported for “fraction” inputs.
- Data types of all “fraction” inputs must be the same as the output data type.
- Only “int32” and “uint32” are supported as the data type of the “index” input.
- Table data type must match output data type
- Intermediate results data type must match output data type.
14.2.3 Table of Supported Blocks
Block | Introduced | Reactis
Support | Notes
|
Commonly Used Blocks |
Bus Creator | pre-R14 | Y | |
Bus Selector | pre-R14 | Y | |
Constant | pre-R14 | Y | |
Data-Type Conversion | pre-R14 | Y | |
Demux | pre-R14 | Y | |
Discrete-Time Integrator | pre-R14 | Y | |
Gain | pre-R14 | Y | |
Ground | pre-R14 | Y | |
Inport | pre-R14 | Y | |
Integrator | pre-R14 | N | |
Logical Operator | pre-R14 | Y | |
Mux | pre-R14 | Y | |
Outport | pre-R14 | Y | |
Product | pre-R14 | Y | |
Relational Operator | pre-R14 | Y | |
Saturation | pre-R14 | Y | |
Scope | pre-R14 | Y | |
Subsystem | pre-R14 | Y | |
Sum | pre-R14 | Y | |
Switch | pre-R14 | Y | |
Terminator | pre-R14 | Y | |
Unit Delay | pre-R14 | Y | |
Vector Concatenate | R14 | Y | |
Continuous |
Derivative | pre-R14 | N | |
Integrator | pre-R14 | N | |
Integrator Limited | R2010a | N | |
Integrator Second-Order | R2010a | N | |
Integrator Second-Order Limited | R2010a | N | |
PID Controller | R2009b | N | |
PID Controller (2 DOF) | R2009b | N | |
State-Space | pre-R14 | N | |
Transfer Fcn | pre-R14 | N | |
Transport Delay | pre-R14 | N | |
Variable Time Delay | R2007b | N | |
Variable Transport Delay | pre-R14 | N | |
Zero-Pole | pre-R14 | N | |
Discontinuities |
Backlash | pre-R14 | Y | |
Coulomb & Viscous Friction | pre-R14 | Y | |
Dead Zone | R14 | Y | |
Dead Zone Dynamic | R14 | Y | |
Hit Crossing | R14 | Y | |
Quantizer | pre-R14 | Y | |
Rate Limiter | pre-R14 | Y | |
Rate Limiter Dynamic | R14 | Y | |
Relay | pre-R14 | Y | |
Saturation | pre-R14 | Y | |
Saturation Dynamic | R14 | Y | |
Wrap To Zero | R14 | Y | |
Discrete |
Delay | R2011b | Y | Only supported if Input processing is set to Elements as channels (sample based) |
Difference | R14 | Y | |
Discrete Derivative | R14 | Y | |
Discrete Filter | pre-R14 | Y | |
Discrete FIR Filter | R2008a | Y | |
Discrete PID Controller | R2009b | N | |
Discrete PID Controller (2 DOF) | R2009b | N | |
Discrete State-Space | pre-R14 | Y | |
Discrete Transfer Fcn | pre-R14 | Y | |
Discrete Zero-Pole | R14 | Y | |
Discrete-Time Integrator | pre-R14 | Y | |
First-Order Hold | R14 | N | |
Memory | pre-R14 | Y | |
Tapped Delay | R14 | Y | |
Transfer Fcn First Order | R14 | Y | |
Transfer Fcn Lead or Lag | R14 | Y | |
Transfer Fcn Real Zero | R14 | Y | |
Unit Delay | pre-R14 | Y | |
Zero-Order Hold | pre-R14 | Y | |
Logic and Bit Operations |
Bit Clear | pre-R14 | Y | |
Bit Set | pre-R14 | Y | |
Bitwise Operator | pre-R14 | Y | |
Combinatorial Logic | pre-R14 | Y | |
Compare To Constant | pre-R14 | Y | |
Compare To Zero | pre-R14 | Y | |
Detect Change | pre-R14 | Y | |
Detect Decrease | pre-R14 | Y | |
Detect Fall Negative | pre-R14 | Y | |
Detect Fall Nonpositive | pre-R14 | Y | |
Detect Increase | pre-R14 | Y | |
Detect Rise Nonnegative | pre-R14 | Y | |
Detect Rise Positive | pre-R14 | Y | |
Extract Bits | R14 | Y | |
Interval Test | pre-R14 | Y | |
Interval Test Dynamic | pre-R14 | Y | |
Logical Operator | pre-R14 | Y | |
Relational Operator | pre-R14 | Y | |
Resettable Delay | R2012b | Y | |
Shift Arithmetic | pre-R14 | Y | |
Variable Integer Delay | R2012b | N | |
Lookup Tables |
1-D Lookup Table | pre-R14 | Y | Previously named Lookup Table.
See Section 14.2.2.1 |
2-D Lookup Table | pre-R14 | Y | Previously named Lookup Table (2-D).
See Section 14.2.2.2 |
Cosine | pre-R14 | Y | Only output formula cos |
Direct Lookup Table (n-D) | pre-R14 | Y | See Section 14.2.2.4 |
Interpolation using Prelookup | pre-R14 | Y | See Section 14.2.2.7 |
Lookup Table Dynamic | R14 | Y | See Section 14.2.2.5 |
n-D Lookup Table | pre-R14 | Y | See Section 14.2.2.3 |
Prelookup | pre-R14 | Y | See Section 14.2.2.6 |
Sine | pre-R14 | Y | Only output formula sin |
Math Operations |
Abs | pre-R14 | Y | |
Add | pre-R14 | Y | |
Algebraic Constraint | pre-R14 | N | |
Assignment | pre-R14 | Y | |
Bias | R14 | Y | |
Complex to Magnitude-Angle | pre-R14 | N | |
Complex to Real-Imag | pre-R14 | N | |
Divide | pre-R14 | Y | |
Dot Product | pre-R14 | Y | |
Find Nonzero Elements | R2010a | N | |
Gain | pre-R14 | Y | |
Magnitude-Angle to Complex | pre-R14 | N | |
Math Function | pre-R14 | Y | Except Hermitian |
Matrix Concatenate | pre-R14 | Y | |
MinMax | pre-R14 | Y | |
MinMax Running Resettable | pre-R14 | Y | |
Permute Dimensions | R2007a | Y | 2 dimensions only |
Polynomial | pre-R14 | Y | |
Product | pre-R14 | Y | |
Product of Elements | pre-R14 | Y | |
Real-Imag to Complex | pre-R14 | N | |
Reciprocal Sqrt | R2010a | Y | |
Reshape | pre-R14 | Y | |
Rounding Function | pre-R14 | Y | |
Sign | pre-R14 | Y | |
Signed Sqrt | R2010a | Y | |
Sine Wave Function | pre-R14 | Y | Using simulation time |
Slider Gain | pre-R14 | Y | |
Sqrt | R2010a | Y | |
Squeeze | R2007a | N | |
Subtract | pre-R14 | Y | |
Sum | pre-R14 | Y | |
Sum of Elements | pre-R14 | Y | |
Trigonometric Function | pre-R14 | Y | |
Unary Minus | pre-R14 | Y | |
Vector Concatenate | R14 | Y | |
Weighted Sample Time Math | R14 | Y | |
Model Verification |
Assertion | pre-R14 | N | |
Check Discrete Gradient | pre-R14 | N | |
Check Dynamic Gap | pre-R14 | N | |
Check Dynamic Lower Bound | pre-R14 | N | |
Check Dynamic Range | pre-R14 | N | |
Check Dynamic Upper Bound | pre-R14 | N | |
Check Input Resolution | pre-R14 | N | |
Check Static Gap | pre-R14 | N | |
Check Static Lower Bound | pre-R14 | N | |
Check Static Range | pre-R14 | N | |
Check Static Upper Bound | pre-R14 | N | |
Model-Wide Utilities |
Block Support Table | R2007a | N | |
DocBlock | pre-R14 | Y | |
Model Info | pre-R14 | Y | |
Time-Based Linearization | pre-R14 | N | |
Trigger-Based Linearization | pre-R14 | N | |
Ports & Subsystems |
Atomic Subsystem | pre-R14 | Y | |
CodeReuse Subsystem | R14 | N | |
Configurable Subsystem | pre-R14 | Y | |
Enable | pre-R14 | Y | |
Enabled Subsystem | pre-R14 | Y | |
Enabled and Triggered Subsystem | pre-R14 | Y | |
For Each Subsystem | R2010a | Y | |
For Iterator Subsystem | pre-R14 | Y | |
Function-Call Feedback Latch | R2011a | Y | |
Function-Call Generator | pre-R14 | Y | |
Function-Call Split | R2010a | Y | |
Function-Call Subsystem | pre-R14 | Y | |
If | pre-R14 | Y | |
If Action Subsystem | pre-R14 | Y | |
In Bus Element | R2017a | Y | |
Inport | pre-R14 | Y | |
Model | R14 | Y | |
Model Variant | R2009b | Y | |
Out Bus Element | R2017a | Y | |
Outport | pre-R14 | Y | |
Subsystem | pre-R14 | Y | |
Switch Case | pre-R14 | Y | |
Switch Case Action Subsystem | pre-R14 | Y | |
Trigger | pre-R14 | Y | |
Triggered Subsystem | pre-R14 | Y | |
Variant Subsystem | R2010b | Y | |
While Iterator Subsystem | pre-R14 | Y | |
Signal Attributes |
Bus to Vector | R2007b | Y | |
Data Type Conversion | pre-R14 | Y | |
Data Type Conversion Inherited | pre-R14 | Y | |
Data Type Duplicate | pre-R14 | Y | |
Data Type Propagation | pre-R14 | Y | |
Data Type Scaling Strip | pre-R14 | Y | |
IC | pre-R14 | Y | |
Probe | pre-R14 | Y | |
Rate Transition | pre-R14 | Y | |
Signal Conversion | pre-R14 | Y | |
Signal Specification | pre-R14 | Y | |
Weighted Sample Time | R14 | Y | |
Width | pre-R14 | Y | |
Signal Routing |
Bus Assignment | R14 | Y | |
Bus Creator | pre-R14 | Y | |
Bus Selector | pre-R14 | Y | |
Data Store Memory | pre-R14 | Y | |
Data Store Read | pre-R14 | Y | |
Data Store Write | pre-R14 | Y | |
Demux | pre-R14 | Y | |
Environment Controller | R14 | Y | |
From | pre-R14 | Y | |
Goto | pre-R14 | Y | |
Goto Tag Visibility | pre-R14 | Y | |
Index Vector | pre-R14 | Y | |
Manual Switch | pre-R14 | N | |
Merge | pre-R14 | Y | |
Multiport Switch | pre-R14 | Y | ’Data port for default case’ must be ’Last data port’ and
’Diagnostic for default case’ must be ’Error’ |
Mux | pre-R14 | Y | |
Selector | pre-R14 | Y | |
Switch | pre-R14 | Y | |
Vector Concatenate | R14 | Y | |
Sinks |
Display | pre-R14 | Y | |
Floating Scope | pre-R14 | Y | |
Manual Variant Sink | R2016b | Y | |
Outport | pre-R14 | Y | |
Scope | pre-R14 | Y | |
Stop Simulation | pre-R14 | N | |
Terminator | pre-R14 | Y | |
To File | pre-R14 | N | You can configure Reactis to ignore
To File blocks from the Settings dialog. |
To Workspace | pre-R14 | N | You can configure Reactis to ignore
To Workspace blocks from the Settings dialog. |
Variant Sink | R2016b | Y | |
XY Graph | pre-R14 | N | |
Sources |
Band-Limited White Noise | pre-R14 | N | |
Chirp Signal | pre-R14 | N | |
Clock | pre-R14 | N | |
Constant | pre-R14 | Y | |
Counter Free-Running | pre-R14 | Y | |
Counter Limited | pre-R14 | Y | |
Digital Clock | pre-R14 | Y | |
Enumerated Constant | R2009b | Y | |
From File | pre-R14 | Y | .mat file must be in ’Array’ format, not ’MATLAB timeseries object’ format.
Linear interpolation and extrapolation must be used. |
From Workspace | pre-R14 | Y | |
Ground | pre-R14 | Y | |
Inport | pre-R14 | Y | |
Manual Variant Source | R2016b | Y | |
Pulse Generator | pre-R14 | Y | ’Pulse type’ must be ’sample based’ and ’Time (t)’ must be ’Use simulation time’ |
Ramp | pre-R14 | Y | |
Random Number | pre-R14 | Y | This block may only be used in virtual sources. |
Repeating Sequence | pre-R14 | Y | |
Repeating Sequence Interpolated | R14 | Y | |
Repeating Sequence Stair | R14 | Y | |
Signal Builder | pre-R14 | Y | |
Signal Generator | pre-R14 | Y | ’Wave form’ of ’random’ not supported |
Sine Wave | pre-R14 | Y | ’Time (t)’ must be ’Use simulation time’ |
Step | pre-R14 | Y | |
Uniform Random Number | pre-R14 | N | |
Variant Source | R2016b | Y | |
User-Defined Functions |
Fcn | pre-R14 | Y | |
Interpreted MATLAB Function | pre-R14 | N | Previously named MATLAB Fcn |
Level-2 MATLAB S-Function | pre-R14 | N | |
MATLAB Function | pre-R14 | Y | Previously named Embedded MATLAB Function. Only
a subset of the Embedded MATLAB language is supported.
See Section 14.4 for details.
|
MATLAB System | R2013b | N | |
S-function | pre-R14 | Y | |
S-function Builder | pre-R14 | Y | |
Additional Discrete |
Fixed-Point State-Space | R14 | Y | |
Transfer Fcn Direct Form II | R14 | N | |
Transfer Fcn Direct Form II Time Varying | R14 | N | |
Unit Delay Enabled | pre-R14 | Y | |
Unit Delay Enabled External IC | pre-R14 | Y | |
Unit Delay Enabled Resettable | pre-R14 | Y | |
Unit Delay Enabled Resettable External IC | pre-R14 | Y | |
Unit Delay External IC | pre-R14 | Y | |
Unit Delay Resettable | pre-R14 | Y | |
Unit Delay Resettable External IC | pre-R14 | Y | |
Unit Delay With Preview Enabled | pre-R14 | Y | |
Unit Delay With Preview Enabled Resettable | pre-R14 | Y | |
Unit Delay With Preview Resettable External RV | pre-R14 | Y | |
Unit Delay With Preview Resettable | pre-R14 | Y | |
Unit Delay With Preview Enabled Resettable External RV | pre-R14 | Y | |
Additional Math |
Decrement Real World | pre-R14 | Y | |
Decrement Stored Integer | pre-R14 | Y | |
Decrement Time To Zero | pre-R14 | Y | |
Decrement To Zero | pre-R14 | Y | |
Increment Real World | pre-R14 | Y | |
Increment Stored Integer | pre-R14 | Y | |
Stateflow |
Chart | pre-R14 | Y | See Section 14.3. |
Truth Table | R14 | Y | See Section 14.4 for supported subset of the
underlying Embedded MATLAB language. |
14.2.4 Simulink Extras
The following table lists the supported blocks from the
“Simulink extras” library which is available in all MATLAB
versions:
Additional Discrete |
Supported: |
Discrete Transfer Fcn (with initial outputs),
Discrete Transfer Fcn (with initial states),
Discrete Zero-Pole (with initial outputs),
Discrete Zero-Pole (with initial states),
Idealized ADC Quantizer
|
Unsupported: | |
Additional Linear |
Supported: | |
Unsupported: |
State-Space (with initial outputs),
Transfer Fcn (with initial outputs),
Transfer Fcn (with initial states),
Zero-Pole (with initial outputs),
Zero-Pole (with initial states)
|
Additional Sinks |
Supported: | |
Unsupported: |
Auto Correlator,
Averaging Power Spectral Density,
Averaging Spectrum Analyzer,
Cross Correlator,
Floating Bar Plot,
Power Spectral Density,
Spectrum Analyzer
|
Flip Flops |
Supported: |
D Flip-Flop,
D Latch,
J-K Flip-Flop,
S-R Flip-Flop
|
Unsupported: |
Clock
|
Linearization |
Supported: | |
Unsupported: |
Switched derivative for linearization,
Switched transport delay for linearization
|
Transformations |
Supported: |
Cartesian to Polar,
Cartesian to Spherical,
Celsius to Fahrenheit,
Degrees to Radians,
Fahrenheit to Celsius,
Polar to Cartesian,
Radians to Degrees,
Spherical to Cartesian
|
Unsupported: | |
14.2.5 HDL Coder Blockset
The following table lists the supported blocks from the
HDL Coder blockset:
Discontinuities |
Supported: |
Backlash,
Coulomb and Viscous Friction,
Dead Zone,
Dead Zone Dynamic,
Hit Crossing,
Relay,
Saturation,
Saturation Dynamic,
Wrap To Zero
|
Unsupported: | |
Discrete |
Supported: |
Delay,
Discrete FIR Filter,
Discrete-Time Integrator,
Discrete Transfer Fcn,
Enabled Delay,
Enabled Resettable Delay,
Memory,
Resettable Delay,
Unit Delay,
Unit Delay Enabled Resettable Synchronous,
Unit Delay Enabled Synchronous,
Unit Delay Resettable Synchronous,
Zero-Order Hold
|
Unsupported: |
Discrete PID Controller,
Tapped Delay
|
HDL Floating Point Operations |
Supported: |
Abs, Acos, Acosh, Add, Asin, Asinh, Atan, Atan2, Atanh, Bias, Ceil, Conjugate, Cos, Cosh,
Data Type Conversion, Discrete FIR Filter, Discrete-Time Integrator, Discrete Transfer Fcn,
Divide, Exp, Fix, Floor, Gain, Hypot, Log, Log10, Magnitude Square, Math Reciprocal, Max,
Min, Mod, Pow, Pow10, Product, Product of Elements, Reciprocal, Reciprocal Sqrt, Relational Operator,
Rem, Round, Sign, SignedSqrt, Sin, Sincos, Sinh, Sqrt, Square, Subtract, Sum of Elements, Tan, Tanh,
Transpose, Unary Minus
|
Unsupported: |
cos+jsin,
Discrete PID Controller,
Float Typecast,
Hermitian,
Magnitude-Angle to Complex
|
HDL Operations |
Supported: |
Multiply-Accumulate,
Multiply-Add
|
Unsupported: |
Deserializer1D,
Serializer1D
|
HDL RAMs |
Supported: |
Dual Port RAM,
Simple Dual Port RAM
Single Port RAM,
|
Unsupported: |
Dual Port RAM System,
Dual Rate Dual Port RAM,
HDL FIFO
Simple Dual Port RAM System,
Single Port RAM System
|
HDL Subsystems |
Supported: | |
Unsupported: |
Enabled Synchronous Subsystem,
Resettable Synchronous Subsystem,
State Control,
Synchronous Subsystem
|
Logic and Bit Operations |
Supported: |
Bit Clear, Bit Slice (R2020b and later),
Bitwise Operator, Compare To Constant, Compare To Zero, Detect Change,
Detect Decrease, Detect Increase, Extract Bits, Logical Operator, Relational Operator,
Shift Arithmetic
|
Unsupported: |
Bit Concat, Bit Reduce, Bit Rotate, Bit Shift, Bit Slice (before R2020b)
|
Lookup Tables |
Supported: |
1-D Lookup Table, 2-D Lookup Table, Direct Lookup Table (n-D), n-D Lookup Table, Prelookup
|
Unsupported: |
Cosine HDL Optimized, Sine HDL Optimized
|
Math Operations |
Supported: |
Abs, Add, Assignment, Bias, Decrement Real World, Decrement Stored Integer, Divide,
Dot Product, Gain, Increment Real World, Increment Stored Integer, Math Function,
Matrix Concatenate, MatrixMultiply, MinMax, Product, Product of Elements, Reciprocal,
Reciprocal Sqrt, Reshape, Sign, Sqrt, Subtract, Sum, Sum of Elements, Trigonometric Function,
Unary Minus, Vector Concatenate
|
Unsupported: |
Complex to Real-Imag,
HDL Reciprocal,
Real-Imag to Complex
|
Model Verification |
Supported: | |
Unsupported: |
Assertion, Check Dynamic Gap, Check Dynamic Range, Check Static Gap, Check Static Range,
Check Dynamic Lower Bound, Check Input Resolution, Check STatic Lower Bound,
Check Static Upper Bound, Check Discrete Gradient
|
Model-Wide Utilities |
Supported: |
DocBlock, Model Info
|
Unsupported: | |
Ports & Subsystems |
Supported: |
Atomic Subsystem, Enable, Enabled Subsystem, For Each Subsystem, In Bus Element, In,
Model, Out Bus Element, Out, Subsystem, Trigger, Triggered Subsystem, Variant Subsystem
|
Unsupported: | |
Signal Attributes |
Supported: |
Bus to Vector, Data Type Conversion, Data Type Duplicate, Data Type Propagation, Probe,
Rate Transition, Signal Specification, Signal Conversion
|
Unsupported: | |
Signal Routing |
Supported: |
Bus Element In, Bus Element Out, Bus Assignment, Bus Creator, Bus Selector, Demux, From,
Goto, Index Vector, Multiport Switch, Mux, Selector, Switch, Vector Concatenate
|
Unsupported: | |
Sinks |
Supported: |
Display, Floating Scope, Out Bus Element, Out, Scope, Terminator, To File, To Workspace
|
Unsupported: |
Stop Simulation, XY Graph
|
Sources |
Supported: |
Constant, Counter Free-Running, Counter Limited, Enumerated Constant, Ground, HDL Counter, In Bus Element, In
|
Unsupported: | |
User Defined Functions |
Supported: |
MATLAB Function
|
Unsupported: |
MATLAB System
|
14.2.6 TargetLink 2.2.1 Library Blocks
The following table lists the supported blocks from the
dSPACE TargetLink library (version 2.2.1), if installed:
Main TargetLink Library |
Supported: |
Inport,
Outport,
Constant,
Sum,
Gain,
Product,
Logical Operator,
Relational Operator,
Fcn,
Look-Up Table,
Look-up Table (2-D),
Direct Look-up Table (n-D),
PreLook-Up Index Search,
Interpolation (n-D) using PreLook-Up,
Saturation,
MinMax,
Abs,
Sign,
Relay,
Trigonometric Function,
Math,
Unit Delay,
Discrete Transfer Fcn,
FIR Filter,
Discrete-Time Integrator,
Discrete State-Space,
Data Store Write,
Data Store Memory,
Data Store Read,
Merge,
Sink,
Bus Inport,
Bus Outport,
Switch,
Multiport Switch,
Unit Delay (Reset Enabled),
|
Unsupported: | Rate Limiter
|
Non-Linear |
Supported: |
Dead Zone Positive,
Dead Zone Negative,
Saturation Dynamic,
Backlash
|
Unsupported: | Dead Zone,
Dead Zone Dynamic |
Math |
Supported: |
Rounding Function,
Transport Delay
|
Unsupported: | |
Extras |
Supported: |
D Flip-Flop,
D Latch,
J-K Flip-Flop,
S-R Flip-Flop,
Preprocessor IF
|
Unsupported: | |
Bit Operations |
Supported: |
U8 Bit Set,
U16 Bit Set,
U32 Bit Set ,
U8 Bit Clear,
U16 Bit Clear,
U32 Bit Clear,
Split U16,
Split U32,
Combine U16,
Combine U32,
8Bit Decoder,
8Bit Encoder,
16Bit Decoder,
16Bit Encoder,
Bitwise Logical Operator
|
Unsupported: | |
TargetLink-Supported Simulink Blocks |
Supported: |
Please see list of Reactis-Supported Simulink Blocks |
Unsupported: | |
14.2.7 TargetLink 2.3.1 Library Blocks
The following table lists the supported blocks from the
dSPACE TargetLink library (version 2.3.1), if installed:
Main TargetLink Library |
Supported: |
Inport,
Outport,
Constant,
Sum,
Gain,
Product,
Logical Operator,
Relational Operator,
Fcn,
Look-Up Table,
Look-up Table (2-D),
Direct Look-up Table (n-D),
PreLook-Up Index Search,
Saturation,
MinMax,
Abs,
Sign,
Relay,
Trigonometric Function,
Math,
Unit Delay,
Discrete Transfer Fcn,
FIR Filter,
Discrete-Time Integrator,
Discrete State-Space,
Data Store Write,
Data Store Memory,
Data Store Read,
Merge,
Sink,
Bus Inport,
Bus Outport,
Switch,
Multiport Switch,
Unit Delay (Reset Enabled),
|
Unsupported: | Interpolation (n-D) using PreLook-Up,
Rate Limiter
|
Non-Linear |
Supported: |
Dead Zone Positive,
Dead Zone Negative,
Saturation Dynamic,
Backlash
|
Unsupported: | Dead Zone,
Dead Zone Dynamic |
Math |
Supported: |
Rounding Function,
Transport Delay
|
Unsupported: | |
Extras |
Supported: |
D Flip-Flop,
D Latch,
J-K Flip-Flop,
S-R Flip-Flop,
Preprocessor IF
|
Unsupported: | |
Bit Operations |
Supported: |
U8 Bit Set,
U16 Bit Set,
U32 Bit Set ,
U8 Bit Clear,
U16 Bit Clear,
U32 Bit Clear,
Split U16,
Split U32,
Combine U16,
Combine U32,
8Bit Decoder,
8Bit Encoder,
16Bit Decoder,
16Bit Encoder,
Bitwise Logical Operator
|
Unsupported: | |
TargetLink-Supported Simulink Blocks |
Supported: |
Please see list of Reactis-Supported Simulink Blocks |
Unsupported: | |
14.2.8 TargetLink 3.0 to 3.4 Library Blocks
The following table lists the supported blocks from the
dSPACE TargetLink library (versions 3.0 to 3.4), if installed:
Main TargetLink Library |
Supported: |
Inport,
Outport,
Constant,
Sum,
Gain,
Product,
Logical Operator,
Relational Operator,
Fcn,
Look-Up Table,
Look-up Table (2-D),
Direct Look-up Table (n-D),
PreLook-Up Index Search,
Interpolation (n-D) using PreLook-Up,
Saturation,
MinMax,
Abs,
Sign,
Rate Limiter,
Relay,
Trigonometric Function,
Math,
Unit Delay,
Discrete Transfer Fcn,
FIR Filter,
Discrete-Time Integrator,
Discrete State-Space,
Data Store Write,
Data Store Memory,
Data Store Read,
Merge,
Sink,
Bus Inport,
Bus Outport,
Switch,
Multiport Switch,
Unit Delay (Reset Enabled),
|
Unsupported: | |
Non-Linear |
Supported: |
Backlash,
Dead Zone Positive,
Dead Zone Negative,
Saturation Dynamic,
Dead Zone,
Dead Zone Dynamic
|
Unsupported: | |
Math |
Supported: |
Rounding Function,
Transport Delay
|
Unsupported: | |
Extras |
Supported: |
D Flip-Flop,
D Latch,
J-K Flip-Flop,
S-R Flip-Flop,
Preprocessor IF
|
Unsupported: | |
Bit Operations |
Supported: | U8 Bit Set,
U16 Bit Set,
U32 Bit Set ,
U8 Bit Clear,
U16 Bit Clear,
U32 Bit Clear,
Split U16,
Split U32,
Combine U16,
Combine U32,
8Bit Decoder,
8Bit Encoder,
16Bit Decoder,
16Bit Encoder,
Bitwise Logical Operator |
Unsupported: | |
TargetLink-Supported Simulink Blocks |
Supported: |
Please see list of Reactis-Supported Simulink Blocks |
Unsupported: | |
14.2.9 TargetLink 3.5 to 5.1 Library Blocks
The following table lists the supported blocks from the
dSPACE TargetLink library (versions 3.5 to 5.1), if installed:
Main TargetLink Library |
Supported: |
Inport,
Outport,
Constant,
Sum,
Gain,
Product,
Logical Operator,
Relational Operator,
Fcn,
Look-Up Table,
Look-up Table (2-D),
Direct Look-up Table (n-D),
PreLook-Up Index Search,
Interpolation (n-D) using PreLook-Up,
Saturation,
MinMax,
Abs,
Sign,
Rate Limiter,
Relay,
Trigonometric Function,
Math,
Unit Delay,
Discrete Transfer Fcn,
Discrete-Time Integrator,
Discrete State-Space,
Data Store Write,
Data Store Memory,
Data Store Read,
Merge,
Sink,
Bus Inport,
Bus Outport,
Switch,
Multiport Switch,
Unit Delay (Reset Enabled)
|
Unsupported: | FIR Filter
|
Non-Linear |
Supported: |
Backlash,
Dead Zone Positive,
Dead Zone Negative,
Saturation Dynamic,
Dead Zone,
Dead Zone Dynamic
|
Unsupported: | |
Math |
Supported: |
Rounding Function
|
Unsupported: | Transport Delay |
Extras |
Supported: |
D Flip-Flop,
D Latch,
J-K Flip-Flop,
S-R Flip-Flop,
Preprocessor IF
|
Unsupported: | |
Bit Operations |
Supported: | U8 Bit Set,
U16 Bit Set,
U32 Bit Set ,
U8 Bit Clear,
U16 Bit Clear,
U32 Bit Clear,
Split U16,
Split U32,
Combine U16,
Combine U32,
8Bit Decoder,
8Bit Encoder,
16Bit Decoder,
16Bit Encoder,
Bitwise Logical Operator |
Unsupported: | |
TargetLink-Supported Simulink Blocks |
Supported: |
Please see list of Reactis-Supported Simulink Blocks |
Unsupported: | |
14.3 Stateflow
Reactis supports most of Stateflow. Some exceptions are the
following unsupported features:
-
Charts with the action language set to MATLAB are currently
supported if they use the language subset described in Section 14.4.
Charts with “C” action language are supported.
- Implicit “enter”, “exit” and “change” events
- Range limits for variables.
- “ml.” name-space operator and “ml()” function call.
- Embedded MATLAB code. Reactis supports the language subset
described in Section 14.4.
- Using Stateflow keywords as variable names. The Stateflow
keywords are:
at, after, before, change, du, during, enter, en, entry,
every, ex, exit, in, on, ml, send, abs, acos, asin,
atan, atan2, ceil, cos, cosh, exp, fabs, floor,
fmod, labs, ldexp, log, log10, min, max, pow,
rand, rem, sin, sinh, sqrt, tan, tanh, int8,
int16, int32, uint8, uint16, uint32, double,
boolean.
- The explicit type cast function (“cast”).
- The address operator (
& ) is supported only in calls to external
C functions.
- The pointer operator (
* ) is supported only inside a literal C code
section.
- Charts without trigger or sample time are supported only if the
model has a fixed sample time.
- In some cases, the detection of inner transitions fails for
odd-shaped transitions (for example, single transition segments which
leave and reenter a state).
- The
temporalCount operator.
- Atomic Subcharts (introduced in R2010b).
14.4 Embedded MATLAB
Reactis V2012 introduced black-box support for Embedded MATLAB. This includes:
Simulink
• MATLAB Function block
• Truth Table block
Stateflow
• MATLAB functions
• Truth Table functions with MATLAB language option
• MATLAB action language in Stateflow
Note that a subset of the full Embedded MATLAB language is supported. To use
models containing Embedded MATLAB in Reactis, your model must only use the
language subset supported by Reactis. Note that the same language restrictions
apply no matter which of the five model constructs listed above are used
to incorporate Embedded MATLAB into your model. To avoid confusion, we use the
following abbreviations in the following discussion:
-
Embedded MATLAB (EML)
- the subset of MATLAB supported by MathWorks for code generation.
- Reactis Embedded MATLAB (REML)
- the subset of EML supported by Reactis.
REML is under active development towards the ultimate goal of supporting a
very large subset of EML. Please send requests to Reactive Systems
(help@reactive-systems.com) if there are unsupported EML features you would
like to use. The V2015 release of Reactis included a new product: the Reactis for EML Plugin. It integrates
with Reactis to offer white-box testing of the EML portions of a model. See
Chapter 17 for a description of the Reactis for EML Plugin. If not using the
new product, you can still test models containing EML; however, exercising coverage
targets within the EML will not be an objective of test generation and tracking
this coverage will not be available. Whether in white-box or black-box mode
for EML, Reactis supports the same subset of EML. This subset is defined
in Section 17.4.
|