SLSlicerAPI.SLSlicer class

Package: SLSlicerAPI

Class representing a set of Model Slicer functionality

Description

The SLSlicerAPI.SLSlicer class provides set of methods to access Model Slicer functionality from the MATLAB command line. Use an instance of SLSlicerAPI.SLSlicer class to:

  • Activate or terminate slice simulation.

  • Add or remove starting point, exclusion point, constraints, slice component and configuration.

  • Highlight the functional dependencies.

  • Set time window and simulate slice.

  • Refine slice for dead logic analysis.

Construction

slslicer(model) creates an API object for the model model by exposing the methods for invoking Model Slicer. Uses the Model Slicer configurations associated with model, as defined by slsliceroptions.

slslicer(model, opts) creates an API object model model by using the options object opts, as defined by slsliceroptions.

Input Arguments

expand all

Name of the model whose Model Slicer options object you configure. slslicer uses the Model Slicer configurations associated with the model, as defined by slsliceroptions.

Example: sldvSliceClimateControlExample

Data Types: char | string

Structure containing the options for the Model Slicer configuration. slsliceroptions defines the options object opts.

Example: slsliceroptions

Data Types: struct

Properties

Name

Name of the configuration.

Type: character vector

Default: Preconfigured values

Description

Description of the configuration.

Type: character vector

Default: Empty

Signal Propagation

Direction of the dependency analysis.

Type: character vector

Allowed Values: upstream | downstream | bidirectional

Default: upstream

Color

Color of the highlight.

Type: 3x1 double vector

Allowed Values: R | B | G

Default: pre-configured

deadlogic file

Location of slslicex file containing dead logic data.

Type: char vector

Default: Empty

use dead logic

Flag to specify if analysis should exclude elements dead logic

Type: boolean

Default: False

coverage file

Location of slslicex file containing simulation data.

Type: char vector

Default: Empty

usetimewindow

Flag to specify if the analysis should use simulation time window information.

Type: boolean

Default: False

slicecomponent

Model blocks or subsystems that are added as slice component.

Type: Struct

Default: Empty

Constraint

Model elements that are added as constraints.

Type: Struct

Default: Empty

Exclusion Point

Model elements that are added as exclusion point.

Type: Struct

Default: Empty

Starting Point

Model elements that are added as starting point.

Type: Struct

Default: Empty

Methods

ActiveBlocksReturns the active non-virtual block handles
activateActivates the model for analysis
addConstraintAdds the constraint on Switch or Multiport switch blocks, and Stateflow state or transition
addExclusionPointAdds block handles, block paths, or Simulink Identifiers (SID) as slice exclusion point
addSliceComponentAdds a model or a subsystem as a slice component
addStartingPointAdd block handles, block paths, or Simulink Identifiers (SID) as the slice starting point
highlightUpdates the model highlighting
refineDeadLogicUpdates the model highlighting with dead logic refinement
removeConstraintRemoves the constraint from the model slice
removeDeadLogicRemoves the dead logic refinement
removeExclusionPointRemoves the exclusion point from the model slice
removeSliceComponentRemoves the slice component from the model slice
removeStartingPointRemoves the starting point from the model slice
simulateSimulates a test case for dynamic slicing from time "t1" to time "t2"
sliceCreates a sliced model from the model highlight
terminateDiscards the analysis data and reverts the model highlighting (invoked when the object goes out of scope)
unhighlightRemoves the model highlighting without changing the activation status
unlockDiscards the analysis data while retaining model highlights

Object Functions

slslicerCreate API object for invoking Model Slicer

Examples

collapse all

Add a new starting point to the active Model Slicer configuration, and then highlight the model.

Open the sldvSliceClimateControlExample example model.

addpath(fullfile(docroot,'toolbox','simulink','examples'));
open_system('sldvSliceClimateControlExample');

Create a Model Slicer configuration object for the model by using slslicer.

obj = slslicer('sldvSliceClimateControlExample');

To compile the model and prepare the model slice for dependency analysis, activate the slice highlighting mode of Model Slicer.

activate(obj);

Add the Out1 outport block as the starting point and highlight the model slice.

addStartingPoint(obj,'sldvSliceClimateControlExample/Out1');
highlight(obj);

The area of the model upstream of the starting point and which is active during simulation is highlighted.

Terminate the model highlighting mode and discard the analysis data.

terminate(obj);
Introduced in R2015b