Main Content

Model Slicer Considerations and Limitations

When you work with the Model Slicer, consider these behaviors and limitations:

Model Compilation

When you open Model Slicer, the model is compiled. To avoid a compilation error, before you open Model Slicer, make sure that the model is compilable.

Model Highlighting and Model Editing

When a slice highlight is active, you cannot edit the model. You can switch to model edit mode and preserve the highlights. When you switch back to slice mode, the slice configuration is recomputed and the highlight is updated.

Standalone Sliced Model Generation

Sliced model generation requires one or more starting points for highlighting your model. Sliced model generation is not supported for:

  • Forward-propagating (including bidirectional) dependencies

  • Constraints

  • Exclusion points present in active highlight

Sliced model generation requires a writable working folder in MATLAB®.

Sliced Model Considerations

When you generate a sliced model from a model highlight, simplifying your model can change simulation behavior or prevent the sliced model from compiling. For example:

  • Model simplification can change the sorted execution order in a sliced model compared to the original model, which can affect the sliced model simulation behavior.

  • If you generate a sliced model containing a bus, but not the source signal of that bus, the sliced model can contain unresolved bus elements.

  • If you generate a sliced model that inlines a subset of the contents of a masked block, make sure that the subsystem contents resolve to the mask parameters. If the contents and mask do not resolve, it is possible that the sliced model does not compile.

  • If the source model uses a bus signal, ensure that the sliced model signals are initialized correctly. Before you create the sliced model, consider including an explicit copy of the bus signal in the source model. For example, you can include a Signal Conversion block with the Output option set to Signal Copy.

  • For solver step sizes set to auto, Simulink® calculates the maximum time step in part based on the blocks in the model. If the sliced model removes blocks that affect the time step determination, the time step of the sliced model can differ from the source model. The time step difference can cause simulation differences. Consider setting step sizes explicitly to the same values calculated in the source model.

Port Attribute Considerations

You can use blocks that the Model Slicer removes during model simplification to determine compiled attributes, such as inherited sample times, signal dimensions, and data types. The Model Slicer can change sliced model port attributes during model simplification to resolve underspecified model port attributes. If the Model Slicer cannot resolve these inconsistencies, you can resolve some model port attribute inconsistencies by:

  • Explicitly specifying attributes in the source model instead of relying on propagation rules.

  • Including in the sliced model the blocks that are responsible for the attribute propagation in your source model. Before you slice the model, add these blocks as additional starting points in the source model highlighting.

  • Not inlining the model blocks that are responsible for model port attributes into the sliced model. For more information on model items that you can inline into the sliced model, see Inline Content Options.

Because of the way Simulink handles model references, you cannot simultaneously compile two models that both contain a model reference to the same model. When you generate a sliced model, the Model Slicer enters the Slicer Locked (for attribute checking) mode if these conditions are true:

  • The parent model contains a referenced model.

  • The highlighted portion of the parent model contains the referenced model.

  • The referenced model is not inlined in the sliced model due to one of the following

    • You choose not to inline model blocks in the Inline content options pane of the Model Slicer options.

    • The Model Slicer cannot inline the referenced model. For more information on model items that Model Slicer cannot inline, see Inline Content Options.

To continue refining the highlighted portion of the parent model, you must first activate the slice highlight mode .

Simulation Time Window Considerations

Depending on the step size of your model and the values that you enter for the start time and stop time of the simulation time window, Model Slicer might alter the actual simulation start time and stop time.

  • If you enter a stop or start time that falls between time steps for your model solver, the Model Slicer instead uses a stop or start time that matches the time step previous to the value that you entered. For more information on step sizes in Simulink, see Compare Solvers.

  • The stop time for the simulation time window cannot be greater than the total simulation time.

Simulation-based Sliced Model Simplifications

When you slice a model by using a simulation time window, some blocks in the source model, such as switch blocks, logical operator blocks, and others, can be replaced when creating the simplified standalone model. For example, a switch block that always passes one input is removed, and the active input is directly connected to the output destination. The unused input signal is also removed from the standalone model.

This table describes the blocks that the Model Slicer can replace during model simplification.

Block in Source ModelSimplification

Switch

Multiport Switch

If only one input port is active, the switch is replaced by a signal connecting the active input to the block output.

Enabled Subsystem or Model

If the subsystem or model is always enabled, remove the control input and convert to a standard subsystem or model.

If the subsystem is never enabled, replace the subsystem with a constant value defined by the initial condition.

Triggered Subsystem or Model

If the subsystem or model is always triggered, remove the trigger input and convert to a standard subsystem or model.

If the subsystem is never triggered, replace the subsystem with a constant value defined by the initial condition.

Enabled and Triggered Subsystem or Model

If the subsystem is always executed, convert to a standard subsystem or model

If the subsystem is never executed, replace the subsystem with a constant value defined by the initial condition.

Merge

If only one input port is active, the merge is replaced by a signal connecting the active input to the block output.

If

If Action

If only one action subsystem is active, convert to a standard subsystem or model and remove the If block.

Switch Case

Switch Case Action

If only one action subsystem is active, convert to a standard subsystem or model and remove the Switch Case block.

Logical operator

Replace with constant when the block always outputs true or always outputs false.

Replace the input signal with a constant if the input signal is always true or always false.

Model Slicer Support Limitations for Simulink Software Features

The Model Slicer does not support these features:

  • Analysis of Simulink Test™ test harnesses

  • Models that contain Simscape™ physical modeling blocks

  • Models that contain algebraic loops

  • Loading initial states from the source model for sliced model generation, such as data import/export entries. Define initial states explicitly for the sliced model in the sliced model configuration parameters.

  • Component slicing of the subsystems and referenced models that have multiple rates.

  • Component based slice generation of Function call triggered subsystems and model blocks.

Model Slicer Support Limitations for Simulation Stepper

When using Model Slicer with Simulation Stepper, the slice highlight after a Step Back may not be limited to a single step. The highlight can be influenced by the Simulation Stepping Options > Interval between stored back steps. For more information, see Interval between stored back steps.

Model Slicer Support Limitations for Simulink Blocks

The table lists the Model Slicer support limitations for Simulink Blocks.

BlockLimitation

For Each Subsystem block

The simulation impact is ignored for blocks in a For Each subsystem. Therefore, applying a simulation time window returns the same dependency analysis result as a dependency analysis that does not use a simulation time window.

MATLAB Function block

Model Slicer assumes that any output depends on all inputs in the upstream direction and any input affects all outputs in the downstream direction.

Merge block

If you generate a slice by using a simulation time window, Merge blocks are removed in the standalone model if only a single path is exercised.

Model block

Model Slicer does not resolve data dependencies generated by global data store memory in Model blocks with Simulation mode set to Accelerator.

Model Slicer does not analyze the contents within a reference to a Reference Protected Models from Third Parties. When you slice a model that contains a protected model reference, the Model Slicer includes the entire model reference in the sliced model.

S-function block

Model Slicer assumes that any output depends on all inputs in the upstream direction and any input affects all outputs in the downstream direction.

Model Slicer does not determine dependencies that result from an S-function block accessing model information dependent on a simulation time window.

Simulink Functions

The dependency propagates from a Simulink Function definition to all its Function Callers.

The dependency propagates from a Function Callers to its Simulink Function definition and all the other Function Callers.

Model reference inlining is not supported during slice generation for models containing port-scoped Simulink Function.

Model Slicer Support Limitations for Stateflow

  • When you highlight models containing a Stateflow® chart or state transition table, Model Slicer assumes that any output from the Chart block or State Transition Table block depends on all inputs to the Chart block or State Transition Table block.

  • When you slice a model with a Stateflow chart or a state transition table, Model Slicer does not simplify the chart or table. The chart or table is included in its entirety in the sliced model.

  • If you do not Define a Simulation Time Window when you highlight functional dependencies in a Stateflow chart or state transition table, Model Slicer assumes that all elements of the chart or table are active. Model Slicer highlights the entire contents of such charts and tables.

  • When you highlight functional dependencies in a Stateflow chart or state transition table for a defined simulation time window, Model Slicer does not highlight only the states and transitions that affect the selected starting point. Instead, the Model Slicer highlights elements that are active in the time window that you specify.

  • The Model Slicer does not determine dependencies between Stateflow graphical functions and function calls in other Stateflow charts.

  • Graphical functions and their contents that were not active during the selected time window can potentially remain highlighted in some cases.

  • Entry into states that are preempted due to events can potentially remain highlighted in some cases. For example, after a parent state is entered, an event action can exit the state and preempt entry into the child state. In such a case, the Model Slicer highlights the entry into the child state.

Activity-Based Time Slicing Considerations for Stateflow

As measured by the 'Executed Substate' decision coverage, state activity refers to these during/exit actions:

  • Entry into a state does not constitute activity.

  • The active time interval for a state or transition includes the moment in which the selected state exits and the subsequent state is entered.

  • Indirect exits from a state or transition do not constitute activity. For example, if a state C exits because its parent state P exits, state C is not considered active.

For more information on decision coverage for Stateflow charts, see Decision Coverage for Stateflow Charts (Simulink Coverage).

When you Highlight Active Time Intervals by Using Activity-Based Time Slicing, you can select states and transitions only as activity constraints. You cannot select these Stateflow objects as constraints:

  • Parallel states

  • Transitions without conditions, such as unlabeled transitions which do not receive decision coverage

  • States or transitions within library-linked charts

  • XOR states without siblings. For example, if a state P has only one child state C, you cannot select state C as an activity constraints because state P does not receive decision coverage for the executed substate

See Also

|