Main Content

SLSlicerAPI.SLSlicer class

Package: SLSlicerAPI

Class representing a set of Model Slicer functionality

Description

The SLSlicerAPI.SLSlicer class provides a 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.

Creation

Description

example

slslicer(model) creates a Model Slicer configuration object for the model model by exposing the methods for invoking the Model Slicer.

slslicer(model, opts) creates a Model Slicer configuration object for the 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.

Data Types: string

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

Data Types: struct

Properties

expand all

The name of the Model Slicer configuration.

A description of the Model Slicer configuration.

The direction of the dependency analysis.

The color of a functional dependency highlight.

The location of the slslicex file containing the dead logic data.

A flag for specifying whether the analysis should exclude elements of dead logic.

The location of the slslicex file containing simulation data.

A flag for specifying whether the analysis should use simulation time window information.

Model blocks or subsystems that you add as slice components.

Model elements that you add as constraints.

Model elements that you specify as exclusion points.

Model elements that you add as starting points.

Specify whether to inline model items inside sliced libraries within the sliced model and maintain the library links.

Specify whether to inline model items from the model referenced by the Model block within the sliced model and remove the Model block.

Specify whether to inline model elements inside sliced masked subsystems within the sliced model and retain the mask in the sliced model.

Specify whether to inline model items to the sliced model from the active variant and remove the variants.

Specify whether to inline contents of subsystem references in sliced models.

Expand trivial subsystem in sliced model and set subsystem boundary.

Retain root-level input and output ports in sliced model.

Retain signal observer, such as scopes, displays, and test condition blocks in the sliced model.

Methods

expand all

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);

Version History

Introduced in R2015b