Support Limitations for Stateflow Software Features
Simulink® Design Verifier™ does not support the following Stateflow® software features. Avoid using these unsupported features in models that you analyze.
ml Namespace Operator, ml Function, ml Expressions
The software does not support calls to MATLAB® functions or access to MATLAB workspace variables, which the Stateflow software allows. See Access MATLAB Functions and Workspace Data in C Charts (Stateflow).
C or C++ Operators
The software supports the sizeof
operator in custom code, which the
Stateflow software allows.
C Math Functions
The software supports calls to the following C math functions:
abs
ceil
fabs
floor
fmod
labs
ldexp
pow
(only for integer exponents)
The software does not support calls to other C math functions, which the Stateflow software allows. If automatic stubbing is enabled, which it is by default, the software eliminates these unsupported functions during the analysis.
For information about C math functions in Stateflow, see Call C Library Functions in C Charts (Stateflow).
Note
For details about automatic stubbing, see Handle Incompatibilities with Automatic Stubbing.
Atomic Subcharts That Call Exported Graphical Functions Outside a Subchart
In test generation analysis, the software supports atomic subcharts calling graphical function but does not support extraction and analysis of atomic subchart when there are other dependencies.
Note
For information about exported functions, see Export Stateflow Functions for Reuse (Stateflow).
Atomic Subchart Input and Output Mapping
If an input or output in an atomic subchart maps to chart-level data of a different scope, the software does not support the chart that contains that atomic subchart.
For an atomic subchart input, this incompatibility applies when the input maps to chart-level data of output, local, or parameter scope. For an atomic subchart output, this incompatibility applies when the output maps to chart-level data of local scope.
Recursion and Cyclic Behavior
The software does not support recursive functions, which occur when a function calls itself directly or indirectly through another function call. Stateflow software allows you to implement recursion using graphical functions.
In addition, the software does not support recursion that the Stateflow software allows you to implement using a combination of event broadcasts and function calls.
Note
For information about avoiding recursion in Stateflow charts, see Avoid Unwanted Recursion in a Chart (Stateflow).
Stateflow software also allows you to create cyclic behavior, where a sequence of steps is repeated indefinitely. If your model has a chart with cyclic behavior, the software cannot analyze it.
Note
For information about cyclic behavior in Stateflow charts, see Detect Cyclic Behavior (Stateflow).
However, you can modify a chart with cyclic behavior so that it is compatible, as in the following example.
The following chart creates cyclic behavior. State A calls state
A1, which broadcasts a Clear
event to state B,
which calls state B2, which broadcasts a Set
event
back to state A, causing the cyclic behavior.
If you change the send
function calls to
use directed event broadcasts so that the Set and Clear events are
broadcast directly to the states B1 and A1, respectively, the cyclic
behavior disappears and the software can analyze the model.
Note
For information about the benefits of directed event broadcasts, see Broadcast Local Events to Synchronize Parallel States (Stateflow).
Custom C/C++ Code
If your model consists of custom C/C++ code, Simulink Design Verifier supports analysis based on these settings:
If you enable the custom code analysis option.
If you enable import custom code and custom code analysis options, the software supports custom C/C++ code for analysis. For more information, see Import custom code and Enable custom code analysis.
If you enable import custom code option and the custom code analysis option is set to
Off
, the model is compatible for analysis, but calls to the custom code are stubbed during analysis.If the import custom code option is set to
Off
, the custom code is not supported and the model is incompatible for analysis.
Textual Functions with Literal String Arguments
The software does not support literal string arguments to textual functions in a Stateflow chart.
Stateflow Charts Containing Ports
The software does not support export function and subsystem build for Stateflow charts that contain entry or exit ports.