Chapter 15 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.
15.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.
15.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.
- The Simulink Data Dictionary.
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 Modeling tab toolbar, select the Model Settings > 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.
15.1.2 Unsupported MATLAB Features
If any of the following MATLAB functions are used in the callbacks or mask
initializations of a model, then the Reactis “Propagate set_param"
setting must be enabled. 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. |
15.2 Simulink
Reactis currently supports Simulink releases R2013a through R2023a. 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 15.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. Reactis supports the fixed-step and variable-step discrete solvers for models
that do not contain any continuous-time blocks. For variable-step solvers,
the “Max step size” setting is supported.
15.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.
15.2.2 Lookup Tables
This section describes the settings for each of the standard Simulink
lookup table blocks that are supported by Reactis. Note that MathWorks
has changed the names of these blocks and their settings over different
releases. We use the R2023a terminology here. If you are using an older
version of MATLAB, your block names and settings may be slightly different.
15.2.2.1 1-D Lookup Table
Note that this block was previously named Lookup Table.
A 1-D lookup table is equivalent to an n-D Lookup Table with one dimension.
See Section 15.2.2.3 for details on which parameter
and type combinations are supported in Reactis.
15.2.2.2 2-D Lookup Table
Note that this block was previously named Lookup Table (2-D).
A 2-D lookup table is equivalent to an n-D Lookup Table with two dimensions.
See Section 15.2.2.3 for details on which parameter
and type combinations are supported in Reactis.
15.2.2.3 n-D Lookup Table
Note that 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.
An n-D Lookup Table is natively supported if it satisfies the following requirements:
-
The number of dimensions is at most four.
- The interpolation method is linear or flat.
- The extrapolation method is linear or clip.
- None of the inputs or outputs have enumerated types.
- If the intermediate type is set to Inherit via Internal Rule, then
all input, output, breakpoint, and table data types are either (1) a floating-point data type,
or (2) a fixed-point type with a binary-point scaling and a bias of zero.
- The Internal rule priority is set to Precision. It may also be set to Speed
if Reactis has been configured to allow it. The behavior of Reactis is controlled by the
setting If lookup table uses internal rule priority ’Speed’
in the General pane of the Reactis Info File Editor (see Section 5.8).
15.2.2.4 Lookup table support via S-function
Support via S-function requires MATLAB R2017b or earlier:
it is not available with R2018a and later.
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 with MATLAB R2007b to R2017b,
but not with R2018a and later. n-D lookup tables which meet the following 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.
15.2.2.5 Lookup Table Dynamic
All parameters and data type configurations listed for the 1-D Lookup Table in Section 15.2.2.1
are supported.
15.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 meet the following requirements: -
The breakpoint data specification is Explicit Values or Breakpoint Object.
- The breakpoint data source is Dialog or Input port.
- The extrapolation method is linear or clip.
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. The following data types are supported:
-
The breakpoint type is double or single.
- The index type is int32 or uint32.
- The fraction type is double or single.
15.2.2.7 Interpolation Using Prelookup
There are two levels of support for the Interpolation Using Prelookup 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 Using
Prelookup blocks which satisfy the following requirements are natively
supported in Reactis: -
The number of dimensions is at most four.
- The number of sub-table selection dimensions is less than or equal to the number of dimensions.
- The interpolation method is linear or flat.
- The extrapolation method is linear or clip.
- None of the inputs or outputs have enumerated types.
- If the intermediate type is set to Inherit via Internal Rule, then
all input, output, breakpoint, and table data types are either (1) a floating-point data type,
or (2) a fixed-point type with a binary-point scaling and a bias of zero.
- The Internal rule priority is set to Precision. It may also be set to Speed
if Reactis has been configured to allow it. The behavior of Reactis is controlled by the
setting If lookup table uses internal rule priority ’Speed’
in the General pane of the Reactis Info File Editor (see Section 5.8).
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. Blocks which satisfy the following requirements are supported:
-
Only floating-point (double and single) data types are supported for “fraction” inputs.
- All fraction types must be the same as the output data type.
- All index types must be int32 or uint32.
- Table data type must match output data type.
- Intermediate results data type must match output data type.
15.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 | |
Delay | R2011b | Y | Only supported if Input processing is set to Elements as channels (sample based) |
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 | |
Vector Concatenate | R14 | Y | |
Continuous |
Derivative | pre-R14 | N | |
Descriptor State-Space | R2018b | N | |
Entity Transport Delay | R2019b | N | |
First Order Hold | R2019b | 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 (2DOF) | 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 | |
PWM | R2020b | N | |
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 (2DOF) | R2009b | N | |
Discrete State-Space | pre-R14 | Y | |
Discrete-Time Integrator | pre-R14 | Y | |
Discrete Transfer Fcn | pre-R14 | Y | |
Discrete Zero-Pole | R14 | Y | |
Enabled Delay | pre-R2006 | Y | |
Memory | pre-R14 | Y | |
Propagataion Delay | R2022b | N | |
Resettable Delay | R2012b | 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 | |
Variable Integer Delay | R2012b | N | |
Zero-Order Hold | pre-R14 | Y | |
Logic and Bit Operations |
Bit Clear | pre-R14 | Y | |
Bit Set | pre-R14 | Y | |
Bit To Integer Converter | R2022a | 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 | |
Float Extract Bits | R2023a | N | |
Integer To Bit Converter | R2022a | Y | |
Interval Test | pre-R14 | Y | |
Interval Test Dynamic | pre-R14 | Y | |
Logical Operator | pre-R14 | Y | |
Relational Operator | pre-R14 | Y | |
Shift Arithmetic | pre-R14 | Y | |
Lookup Tables |
1-D Lookup Table | pre-R14 | Y | Previously named Lookup Table.
See Section 15.2.2.1 |
2-D Lookup Table | pre-R14 | Y | Previously named Lookup Table (2-D).
See Section 15.2.2.2 |
Cosine | pre-R14 | Y | Only output formula cos |
Direct Lookup Table (n-D) | pre-R14 | Y | |
Interpolation using Prelookup | pre-R14 | Y | See Section 15.2.2.7 |
Lookup Table Dynamic | R14 | Y | See Section 15.2.2.5 |
n-D Lookup Table | pre-R14 | Y | Previously named Lookup Table (n-D).
See Section 15.2.2.3 |
Prelookup | pre-R14 | Y | See Section 15.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 | Approximation method must be None |
Unary Minus | pre-R14 | Y | |
Vector Concatenate | R14 | Y | |
Weighted Sample Time Math | R14 | Y | |
Matrix Operations |
Concatenate | R2022a | Y | |
Create Diagonal Matrix | R2022a | Y | |
Cross Product | R2021b | Y | |
Extract Diagonal | R2022a | Y | |
Hermitian Transpose | R2021b | Y | |
IdentityMatrix | R2021b | Y | |
IsHermitian | R2022a | N | |
IsSymmetric | R2021b | Y | |
IsTriangular | R2021b | Y | |
MatrixSquare | R2021b | Y | |
Multiply | R2022a | Y | |
Permute Matrix | R2022a | Y | |
Submatrix | R2022a | Y | |
Transpose | R2021b | Y | |
Messages & Events |
Hit Crossing Probe | R2006a | Y | |
Message Merge | R2021a | N | |
Message Triggered Subsystem | R202a | N | |
Queue | R2016a | N | |
Receive | R2016a | N | |
Send | R2016a | N | |
Sequence Viewer | R2015b | N | |
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 and Triggered Subsystem | pre-R14 | Y | |
Enabled 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 | |
Out Bus Element | R2017a | Y | |
Outport | pre-R14 | Y | |
Resettable Subsystem | R2015a | Y | |
Subsystem | pre-R14 | Y | |
Switch Case | pre-R14 | Y | |
Switch Case Action Subsystem | pre-R14 | Y | |
Trigger | pre-R14 | Y | Except trigger type “message” |
Triggered Subsystem | pre-R14 | Y | Except trigger type “message” |
Variant Model | R2010b | Y | |
Variant Subsystem | R2010b | Y | Except Subsystem Reference as the variant |
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 | |
Unit Conversion | R2016a | N | |
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 | |
Connection Port | R2007a | N | |
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 | |
Manual Variant Sink | R2016b | Y | |
Manual Variant Source | R2016b | Y | |
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 | |
Parameter Writer | R2022a | N | |
Selector | pre-R14 | Y | |
State Reader | | Y | |
State Writer | | Y | |
Switch | pre-R14 | Y | |
Vector Concatenate | R14 | Y | |
Sinks |
Display | pre-R14 | Y | |
Floating Scope | pre-R14 | Y | |
Out Bus Element | R2017a | Y | |
Outport | pre-R14 | Y | |
Record | 2021a | N | |
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. |
XY Graph | pre-R14 | N | |
Sources |
Band-Limited White Noise | pre-R14 | N | |
Chirp Signal | pre-R14 | N | |
Clock | pre-R14 | Y | |
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 | |
In Bus Element | R2017a | Y | |
Inport | pre-R14 | 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 Editor | R2017b | N | |
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 | |
Waveform Generator | R2015b | N | |
String |
ASCII to String | R2018a | N | |
Compose String | R2018a | N | |
Scan String | R2018a | N | |
String Compare | R2018a | N | |
String Concatenate | R2018a | N | |
String Constant | R2018a | N | |
String Contains | R2020a | N | |
String Count | R2020a | N | |
String Ends With | R2020a | N | |
String Find | R2018a | N | |
String Length | R2018a | N | |
String Starts With | R2020a | N | |
String to ASCII | R2018a | N | |
String to Double | R2018a | N | |
String to Enum | R2018a | N | |
String to Single | R2018a | N | |
Substring | R2018a | N | |
To String | R2018a | N | |
User-Defined Functions |
C Caller | R2018b | Y | Supported in Reactis if using MATLAB R2019b or later |
C Function | R2020a | N | |
Function Caller | R2015a | Y | |
Initialize Function | R2016b | 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 15.4 for details.
|
MATLAB System | R2013b | N | |
Reset Function | R2018b | Y | |
S-function | pre-R14 | Y | |
S-function Builder | pre-R14 | Y | |
Simulink Function | R2014b | Y | |
Terminate Function | | N | |
Additional Discrete |
Fixed-Point State-Space | R14 | Y | |
Transfer Fcn Direct Form II | R14 | N | |
Transfer Fcn Direct Form II Time Varying | R14 | N | |
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 15.3. |
Truth Table | R14 | Y | See Section 15.4 for supported subset of the
underlying Embedded MATLAB language. |
15.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: | |
15.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
|
15.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: | |
15.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: | |
15.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: | |
15.2.9 TargetLink 3.5 to 22.1 (2022-B) Library Blocks
The table below lists the supported blocks from the
dSPACE TargetLink library versions 3.5 to 22.1 (2022-B).
Note that TargetLink 2022-B is not certified to work with
MATLAB R2023a.
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: | |
15.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 15.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 15.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).
15.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 18 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 18.4.
|