Automated Testing and Validation with Reactis®

 
 Reactis User's Guide   Contents  |  Index
 Chapters:  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | A | B | C

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:

  1. Load cruise.mdl into Simulink.
  2. From the Simulink window, select the File -> Model Properties menu item.
  3. In the resulting dialog, select the Callbacks tab.
  4. In the Model pre-load function entry box enter cruise_constants;.
  5. 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
ASSIGNINAssign variable in workspace.
EVALINEvaluate expression in workspace.
Model Construction/Modification
ADD_BLOCKAdd a block to a Simulink system.
ADD_LINEAdd a line to a Simulink system.
ADD_PARAMAdd a parameter to a Simulink system.
DELETE_BLOCKDelete a block from a Simulink system.
DELETE_LINEDelete a line from a Simulink system.
DELETE_PARAMDeletes a parameter from a Simulink system.
NEW_SYSTEMCreate a new empty Simulink system.
REPLACE_BLOCKReplace blocks in model.
SET_PARAMSet Simulink system and block parameters.

14.2  Simulink

Reactis currently supports Simulink releases R2006b through R2016a. Most features of Simulink are supported; but the following are not supported by Reactis:

  • Continuous-time blocks.
  • Simulink signals with more than 2 dimensions.
  • 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.

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 LUTOutput of LUT
doubledouble
singledouble
fixpointdouble
singlesingle
fixpointsingle
doublefixpoint
singlefixpoint
fixpointfixpoint
doubleboolean
singleboolean
fixpointboolean

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 LUT2nd Input of LUTOutput of LUT
doubledoubledouble
doublefixpointdouble
doublebooldouble
singlesingledouble
fixpointdoubledouble
fixpointfixpointdouble
booldoubledouble
singlesinglesingle
singlefixpointsingle
singleboolsingle
fixpointsinglesingle
fixpointfixpointsingle
boolsinglesingle
doubledoublefixpoint
singlesinglefixpoint
fixpointfixpointfixpoint
fixpointfixpointbool
doubledoublebool
singlesinglebool

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:

  1. 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.
  2. The interpolation and extrapolation methods are not cubic spline.
  3. 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:

  1. The input and output types are the same floating-point type.
  2. The fraction data type is set to Inherit via internal rule.
  3. The table data type is set to Inherit: same as output.
  4. The breakpoint data type is set to Inherit: same as corresponding input.
  5. All inputs are scalars.
  6. If the table has more than one dimension, then the intermediate data type is set to Inherit: same as output.

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.

Lookup Table Dynamic

All parameters and the data type configurations listed for the “Lookup Table” block above are supported.

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.

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:

  1. 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.
  2. The interpolation and extrapolation methods are not cubic spline.
  3. 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

BlockIntroducedReactis
Support
Notes
Commonly Used Blocks
Bus Creatorpre-R14Y 
Bus Selectorpre-R14Y 
Constantpre-R14Y 
Data-Type Conversionpre-R14Y 
Demuxpre-R14Y 
Discrete-Time Integratorpre-R14Y 
Gainpre-R14Y 
Groundpre-R14Y 
Inportpre-R14Y 
Integratorpre-R14N 
Logical Operatorpre-R14Y 
Muxpre-R14Y 
Outportpre-R14Y 
Productpre-R14Y 
Relational Operatorpre-R14Y 
Saturationpre-R14Y 
Scopepre-R14Y 
Subsystempre-R14Y 
Sumpre-R14Y 
Switchpre-R14Y 
Terminatorpre-R14Y 
Unit Delaypre-R14Y 
Vector ConcatenateR14Y 
Continuous
Derivativepre-R14N 
Integratorpre-R14N 
Integrator LimitedR2010aN 
Integrator Second-OrderR2010aN 
Integrator Second-Order LimitedR2010aN 
PID ControllerR2009bN 
PID Controller (2 DOF)R2009bN 
State-Spacepre-R14N 
Transfer Fcnpre-R14N 
Transport Delaypre-R14N 
Variable Time DelayR2007bN 
Variable Transport Delaypre-R14N 
Zero-Polepre-R14N 
Discontinuities
Backlashpre-R14Y 
Coulomb & Viscous Frictionpre-R14Y 
Dead ZoneR14Y 
Dead Zone DynamicR14Y 
Hit CrossingR14Y 
Quantizerpre-R14Y 
Rate Limiterpre-R14Y 
Rate Limiter DynamicR14Y 
Relaypre-R14Y 
Saturationpre-R14Y 
Saturation DynamicR14Y 
Wrap To ZeroR14Y 
Discrete
DelayR2011bYIn R2011b, the Integer Delay block was extended and renamed to the Delay block. Reactis requires:
  • Delay length source must be Dialog
  • Initial condition source must be Dialog
  • External reset must be None
  • Input processing must be Elements as channels (sample based) or Inherited
DifferenceR14Y 
Discrete DerivativeR14Y 
Discrete Filterpre-R14Y 
Discrete FIR FilterR2008aNIn R2008a, replaced the Weighted Moving Average block.
Discrete PID ControllerR2009bN 
Discrete PID Controller (2 DOF)R2009bN 
Discrete State-Spacepre-R14Y 
Discrete Transfer Fcnpre-R14Y 
Discrete Zero-PoleR14Y 
Discrete-Time Integratorpre-R14Y 
First-Order HoldR14N 
Memorypre-R14Y 
Tapped DelayR14Y 
Transfer Fcn First OrderR14Y 
Transfer Fcn Lead or LagR14Y 
Transfer Fcn Real ZeroR14Y 
Unit Delaypre-R14Y 
Zero-Order Holdpre-R14Y 
Logic and Bit Operations
Bit Clearpre-R14Y 
Bit Setpre-R14Y 
Bitwise Operatorpre-R14Y 
Combinatorial Logicpre-R14Y 
Compare To Constantpre-R14Y 
Compare To Zeropre-R14Y 
Detect Changepre-R14Y 
Detect Decreasepre-R14Y 
Detect Fall Negativepre-R14Y 
Detect Fall Nonpositivepre-R14Y 
Detect Increasepre-R14Y 
Detect Rise Nonnegativepre-R14Y 
Detect Rise Positivepre-R14Y 
Extract BitsR14Y 
Interval Testpre-R14Y 
Interval Test Dynamicpre-R14Y 
Logical Operatorpre-R14Y 
Relational Operatorpre-R14Y 
Resettable DelayR2012bY 
Shift Arithmeticpre-R14Y 
Variable Integer DelayR2012bN 
Lookup Tables
1-D Lookup Tablepre-R14YPreviously named Lookup Table. See Section 14.2.2.1
2-D Lookup Tablepre-R14YPreviously named Lookup Table (2-D). See Section 14.2.2.2
Cosinepre-R14YOnly output formula cos
Direct Lookup Table (n-D)pre-R14YSee Section 14.2.2.4
Interpolation using Prelookuppre-R14YSee Section 14.2.2.7
Lookup Table DynamicR14YSee Section 14.2.2.5
n-D Lookup Tablepre-R14YSee Section 14.2.2.3
Prelookuppre-R14YSee Section 14.2.2.6
Sinepre-R14YOnly output formula sin
Math Operations
Abspre-R14Y 
Addpre-R14Y 
Algebraic Constraintpre-R14N 
Assignmentpre-R14Y 
BiasR14Y 
Complex to Magnitude-Anglepre-R14N 
Complex to Real-Imagpre-R14N 
Dividepre-R14Y 
Dot Productpre-R14Y 
Find Nonzero ElementsR2010aN 
Gainpre-R14Y 
Magnitude-Angle to Complexpre-R14N 
Math Functionpre-R14YExcept Hermitian
Matrix Concatenatepre-R14Y 
MinMaxpre-R14Y 
MinMax Running Resettablepre-R14Y 
Permute DimensionsR2007aN 
Polynomialpre-R14Y 
Productpre-R14Y 
Product of Elementspre-R14Y 
Real-Imag to Complexpre-R14N 
Reciprocal SqrtR2010aY 
Reshapepre-R14Y 
Rounding Functionpre-R14Y 
Signpre-R14Y 
Signed SqrtR2010aY 
Sine Wave Functionpre-R14YUsing simulation time
Slider Gainpre-R14Y 
SqrtR2010aY 
SqueezeR2007aN 
Subtractpre-R14Y 
Sumpre-R14Y 
Sum of Elementspre-R14Y 
Trigonometric Functionpre-R14Y 
Unary Minuspre-R14Y 
Vector ConcatenateR14Y 
Weighted Sample Time MathR14Y 
Model Verification
Assertionpre-R14N 
Check Discrete Gradientpre-R14N 
Check Dynamic Gappre-R14N 
Check Dynamic Lower Boundpre-R14N 
Check Dynamic Rangepre-R14N 
Check Dynamic Upper Boundpre-R14N 
Check Input Resolutionpre-R14N 
Check Static Gappre-R14N 
Check Static Lower Boundpre-R14N 
Check Static Rangepre-R14N 
Check Static Upper Boundpre-R14N 
Model-Wide Utilities
Block Support TableR2007aN 
DocBlockpre-R14Y 
Model Infopre-R14Y 
Time-Based Linearizationpre-R14N 
Trigger-Based Linearizationpre-R14N 
Ports & Subsystems
Atomic Subsystempre-R14Y 
CodeReuse SubsystemR14N 
Configurable Subsystempre-R14Y 
Enablepre-R14Y 
Enabled Subsystempre-R14Y 
Enabled and Triggered Subsystempre-R14Y 
For Each SubsystemR2010aY 
For Iterator Subsystempre-R14Y 
Function-Call Feedback LatchR2011aY 
Function-Call Generatorpre-R14Y 
Function-Call SplitR2010aY 
Function-Call Subsystempre-R14Y 
Ifpre-R14Y 
If Action Subsystempre-R14Y 
Inportpre-R14Y 
ModelR14Y 
Model VariantR2009bY 
Outportpre-R14Y 
Subsystempre-R14Y 
Switch Casepre-R14Y 
Switch Case Action Subsystempre-R14Y 
Triggerpre-R14Y 
Triggered Subsystempre-R14Y 
Variant SubsystemR2010bY 
While Iterator Subsystempre-R14Y 
Signal Attributes
Bus to VectorR2007bY 
Data Type Conversionpre-R14Y 
Data Type Conversion Inheritedpre-R14Y 
Data Type Duplicatepre-R14Y 
Data Type Propagationpre-R14Y 
Data Type Scaling Strippre-R14Y 
ICpre-R14Y 
Probepre-R14Y 
Rate Transitionpre-R14Y 
Signal Conversionpre-R14Y 
Signal Specificationpre-R14Y 
Weighted Sample TimeR14Y 
Widthpre-R14Y 
Signal Routing
Bus AssignmentR14Y 
Bus Creatorpre-R14Y 
Bus Selectorpre-R14Y 
Data Store Memorypre-R14Y 
Data Store Readpre-R14Y 
Data Store Writepre-R14Y 
Demuxpre-R14Y 
Environment ControllerR14Y 
Frompre-R14Y 
Gotopre-R14Y 
Goto Tag Visibilitypre-R14Y 
Index Vectorpre-R14Y 
Manual Switchpre-R14N 
Mergepre-R14Y 
Multiport Switchpre-R14Y’Data port for default case’ must be ’Last data port’ and ’Diagnostic for default case’ must be ’Error’
Muxpre-R14Y 
Selectorpre-R14Y 
Switchpre-R14Y 
Vector ConcatenateR14Y 
Sinks
Displaypre-R14Y 
Floating Scopepre-R14Y 
Manual Variant SinkR2016bY 
Outportpre-R14Y 
Scopepre-R14Y 
Stop Simulationpre-R14N 
Terminatorpre-R14Y 
To Filepre-R14NYou can configure Reactis to ignore To File blocks from the Settings dialog.
To Workspacepre-R14NYou can configure Reactis to ignore To Workspace blocks from the Settings dialog.
Variant SinkR2016bY 
XY Graphpre-R14N 
Sources
Band-Limited White Noisepre-R14N 
Chirp Signalpre-R14N 
Clockpre-R14N 
Constantpre-R14Y 
Counter Free-Runningpre-R14Y 
Counter Limitedpre-R14Y 
Digital Clockpre-R14Y 
Enumerated ConstantR2009bY 
From Filepre-R14Y.mat file must be in ’Array’ format, not ’MATLAB timeseries object’ format. Linear interpolation and extrapolation must be used.
From Workspacepre-R14Y 
Groundpre-R14Y 
Inportpre-R14Y 
Manual Variant SourceR2016bY 
Pulse Generatorpre-R14Y’Pulse type’ must be ’sample based’ and ’Time (t)’ must be ’Use simulation time’
Ramppre-R14Y 
Random Numberpre-R14YThis block may only be used in virtual sources.
Repeating Sequencepre-R14Y 
Repeating Sequence InterpolatedR14Y 
Repeating Sequence StairR14Y 
Signal Builderpre-R14Y 
Signal Generatorpre-R14Y’Wave form’ of ’random’ not supported
Sine Wavepre-R14Y’Time (t)’ must be ’Use simulation time’
Steppre-R14Y 
Uniform Random Numberpre-R14N 
Variant SourceR2016bY 
User-Defined Functions
Fcnpre-R14Y 
Interpreted MATLAB Functionpre-R14NPreviously named MATLAB Fcn
Level-2 MATLAB S-Functionpre-R14N 
MATLAB Functionpre-R14YPreviously named Embedded MATLAB Function. Only a subset of the Embedded MATLAB language is supported. See Section 14.4 for details.
MATLAB SystemR2013bN 
S-functionpre-R14Y 
S-function Builderpre-R14Y 
Additional Discrete
Fixed-Point State-SpaceR14Y 
Transfer Fcn Direct Form IIR14N 
Transfer Fcn Direct Form II Time VaryingR14N 
Unit Delay Enabledpre-R14Y 
Unit Delay Enabled External ICpre-R14Y 
Unit Delay Enabled Resettablepre-R14Y 
Unit Delay Enabled Resettable External ICpre-R14Y 
Unit Delay External ICpre-R14Y 
Unit Delay Resettablepre-R14Y 
Unit Delay Resettable External ICpre-R14Y 
Unit Delay With Preview Enabledpre-R14Y 
Unit Delay With Preview Enabled Resettablepre-R14Y 
Unit Delay With Preview Resettable External RVpre-R14Y 
Unit Delay With Preview Resettablepre-R14Y 
Unit Delay With Preview Enabled Resettable External RVpre-R14Y 
Additional Math
Decrement Real Worldpre-R14Y 
Decrement Stored Integerpre-R14Y 
Decrement Time To Zeropre-R14Y 
Decrement To Zeropre-R14Y 
Increment Real Worldpre-R14Y 
Increment Stored Integerpre-R14Y 
Stateflow
Chartpre-R14YSee Section 14.3.
Truth TableR14YSee 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  TargetLink 2.2.1 Library Blocks

The following table lists the supported blocks from the dSPACE TargetLink 2.2.1 library, 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.6  TargetLink 3.0 Library Blocks

The following table lists the supported blocks from the dSPACE TargetLink 3.0 library, 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.3  Stateflow

Reactis supports most of Stateflow. Some exceptions are the following unsupported features:

  • Charts with their action language set to MATLAB are currently not supported. 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
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 four 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.3.