SLSlicerAPI.SLSlicer Class
Namespace: 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
Input Arguments
model
— Name or handle of model
string
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
opts
— Options you attach to a model or save to a file
structure
Structure containing the options for the Model Slicer configuration.
slsliceroptions
defines the options object
opts
.
Data Types: struct
Properties
Name
— Configuration name
preconfigured values (default) | character vector
The name of the Model Slicer configuration.
Description
— Configuration description
empty (default) | character vector
A description of the Model Slicer configuration.
SignalPropagation
— Direction of dependency analysis
empty (default) | upstream
| downstream
bidirectional
The direction of the dependency analysis.
Color
— Highlight color
preconfigured (default) | R
| B
G
The color of a functional dependency highlight.
DeadLogicFile
— slslicex
file location
empty (default) | character vector
The location of the slslicex
file containing the dead logic
data.
UseDeadLogic
— Specify dead logic analysis
false
(default) | boolean
A flag for specifying whether the analysis should exclude elements of dead logic.
CoverageFile
— slslicex
file location
empty (default) | character vector
The location of the slslicex
file containing simulation
data.
UseTimeWindow
— Specify simulation time window analysis
false
(default) | Boolean
A flag for specifying whether the analysis should use simulation time window information.
SliceComponent
— Specify slice components
empty
(default) | Struct
Model blocks or subsystems that you add as slice components.
Constraint
— Constraint model elements
empty
(default) | Struct
Model elements that you add as constraints.
ExclusionPoint
— Exclusion point model elements
empty
(default) | Struct
Model elements that you specify as exclusion points.
StartingPoint
— Starting point model elements
empty
(default) | Struct
Model elements that you add as starting points.
InlineOptions.Libraries
— Inline model elements inside sliced libraries
True
(default) | Boolean
Specify whether to inline model items inside sliced libraries within the sliced model and maintain the library links.
InlineOptions.ModelBlocks
— Inline model elements from referenced model within sliced model
True
(default) | Boolean
Specify whether to inline model items from the model referenced by the Model block within the sliced model and remove the Model block.
InlineOptions.Masks
— Inline model elements inside sliced masked subsystems within sliced model
True
(default) | Boolean
Specify whether to inline model elements inside sliced masked subsystems within the sliced model and retain the mask in the sliced model.
InlineOptions.Variants
— Inline model elements to the sliced model from active variants
True
(default) | Boolean
Specify whether to inline model items to the sliced model from the active variant and remove the variants.
InlineOptions.SubsystemReferences
— Inline subsystem reference contents
True
(default) | Boolean
Specify whether to inline contents of subsystem references in sliced models.
SliceOptions.ExtendSubsystems
— Expand trivial subsystem in sliced model
True
(default) | Boolean
Expand trivial subsystem in sliced model and set subsystem boundary.
SliceOptions.RootLevelInterfaces
— Retain root-level ports in sliced model
True
(default) | Boolean
Retain root-level input and output ports in sliced model.
SliceOptions.SignalObservers
— Retain signal observers in sliced model
False
(default) | Boolean
Retain signal observer, such as scopes, displays, and test condition blocks in the sliced model.
Methods
Public Methods
ActiveBlocks | Returns the active non-virtual block handles |
activate | Activates the model for analysis |
addConstraint | Adds the constraint on Switch or Multiport switch blocks, and Stateflow state or transition |
addExclusionPoint | Adds block handles, block paths, or Simulink Identifiers (SID) as slice exclusion point |
addSliceComponent | Adds a model or a subsystem as a slice component |
addStartingPoint | Add block handles, block paths, bus elements, or Simulink Identifiers (SID) as starting point |
highlight | Updates the model highlighting |
refineDeadLogic | Updates the model highlighting with dead logic refinement |
removeConstraint | Removes the constraint from the model slice |
removeDeadLogic | Removes the dead logic refinement |
removeExclusionPoint | Removes the exclusion point from the model slice |
removeSliceComponent | Removes the slice component from the model slice |
removeStartingPoint | Remove starting point for model slice |
report | Generate web report for the model |
simulate | Simulates a test case for dynamic slicing from time "t1" to time "t2" |
slice | Creates a sliced model from the model highlight |
terminate | Discards the analysis data and reverts the model highlighting (invoked when the object goes out of scope) |
unlock | Discards the analysis data while retaining model highlights |
Examples
Add Starting Point and Highlight the Model Slice
Add a new starting point to the active Model Slicer configuration, and then highlight the model.
1. Open the sldvSliceClimateControlExample
example model.
open_system('sldvSliceClimateControlExample');
2. Create a Model Slicer configuration object for the model by using slslicer
.
obj = slslicer('sldvSliceClimateControlExample');
3. Activate the slice highlighting mode of Model Slicer to compile the model and prepare the model slice for dependency analysis.
activate(obj);
Consider turning on Fast Restart before launching Model Slicer for simulation based workflows. Do not show again.
4. 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.
5. Terminate the model highlighting mode and discard the analysis data.
terminate(obj);
Version History
Introduced in R2015b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)