Perform multiple slicer simulations and streamline model debugging workflows by using Model Slicer in fast restart mode. For more information, see Get Started with Fast Restart.
If you enable fast restart mode, you can:
Perform multiple slicer simulations efficiently with different inputs, without recompiling the model.
Debug a simulation by stepping through the major time steps of a simulation and inspecting how a slice changes. For more information, see Use Simulation Stepper.
This example shows how the fast restart mode performs slicer simulations with different test case inputs, without recompiling the model. You can simulate a sliced harness model with a test case input and highlight the dependency analysis in the model.
Analyze the highlighted slice by stepping through the time steps. You use the simulation stepper to analyze how the slice changes at each time step.
sldvoptions parameters and analyze the model by
using the specified options.
opts = sldvoptions; opts.Mode = 'TestGeneration'; % Perform test-generation analysis opts.ModelCoverageObjectives = 'MCDC'; % Specify type of model coverage opts.SaveHarnessModel = 'on'; % Save harness as model file [ status, files ] = sldvrun('sldvdemo_cruise_control', opts);
After the analysis, the software opens a harness model
sldvdemo_cruise_control_harness and saves it in the
For more information, see Simulink Design Verifier Harness Models (Simulink Design Verifier).
To enable the fast restart mode, click Enable Fast Restart button .
On the Apps tab, under Model Verification, Validation, and Test gallery, click Model Slicer. Model Slicer compiles the model.
Optionally, you can enable fast restart after opening the Model Slice Manager. Select Simulation time window and click the run simulation button . To enable fast restart, in the Record simulation time window, click the here link.
To add Starting Points, in the Model Slice Manager, click Add all outports..
outports are added as the Starting
You can simulate a test case and analyze the highlighted dependencies in the slice.
In the Signal Builder block, select
To simulate the test case, click Start simulation button, .
Optionally, you can simulate the model by using the Run button in the Simulink® editor. You can also simulate by using the Simulation time window in the Model Slice Manager.
The slice shows the highlighted dependencies for the
Case 4 inputs.
You can simulate a slice for different test case inputs and analyze the dependency analysis.
Debug a slicer simulation by using a simulation stepper. For more information see, Simulation Stepper Access.
To debug the simulation for the test case, in the Simulink Editor for the
sldvdemo_cruise_control_harness model, click
Step Forward button. You can view the
signal values and the highlighted slice at each time step. For more
information, see Simulation Stepping Options. The signal values and the
To debug the slice at
T=0.030, step forward and
view the signal values and the highlighted slice.
To complete the simulation stepping, click the Run button.