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 does not support the
sizeof operator, which the
Stateflow software allows.
C Math Functions
The software supports calls to the following C math functions:
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).
For details about automatic stubbing, see Handle Incompatibilities with Automatic Stubbing.
Atomic Subcharts That Call Exported Graphical Functions Outside a Subchart
The software does not support atomic subcharts that call exported graphical functions, which the Stateflow software allows.
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.
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.
For information about cyclic behavior in Stateflow charts, see 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
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.
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 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.
The software does not support machine-parented data (i.e., defined at the level of the Stateflow machine), which the Stateflow software allows.
For more information, see Best Practices for Using Data in Charts (Stateflow).
Textual Functions with Literal String Arguments
The software does not support literal string arguments to textual functions in a Stateflow chart.