Main Content

sldvrun

Description

status = sldvrun analyzes the current model to generate the test cases that provide the model coverage or prove the model properties.

status = sldvrun(model) analyzes model to generate the test cases that provide the model coverage or prove the model properties. It uses configuration options referenced by model to select analysis mode.

status = sldvrun(subsystem) converts the atomic subsystem subsystem into a new model and runs a design verification analysis on the new model.

status = sldvrun(model, options) analyzes model by using the sldvoptions object options.

example

[status, filenames, msg] = sldvrun(model, options) analyzes model and returns the filenames that the software creates during the analysis, and information on errors and warnings in the structure msg.

[status, filenames, msg] = sldvrun(model, options, showUI, startCov) opens the log window during the analysis if you set showUI to true. If you set showUI to false, sldvrun directs output to the MATLAB® command line.

Examples

collapse all

This example shows how sldvrun uses configuration options referenced by model to select analysis mode.

Open model sldvdemo_cruise_control.

openExample('simulinktest/GenerateAndImportTestCasesFromSLDVExample', ...
'supportingFile','sldvdemo_cruise_control')

Perform analysis on sldvdemo_cruise_control without choosing any analysis mode

model = ('sldvdemo_cruise_control')
sldvrun(model)

sldvrun uses the Generate Tests option referenced by the model and performs test generation analysis.

Set sldvoptions parameters and analyze the model by using the specified options.

Set sldvoptions parameters:

opts = sldvoptions;
opts.Mode = 'TestGeneration';              % Perform test-generation analysis
opts.ModelCoverageObjectives = 'MCDC';     % MCDC coverage
opts.SaveHarnessModel = 'off';             % Don't save harness as model file
opts.SaveReport = 'on';                    % Save the HTML report

Open the sldvdemo_cruise_control model and analyze the model by using the specified options:

openExample('sldv/CruiseControlTestGenerationExample',...
'supportingFile', 'sldvdemo_cruise_control');
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts);

Input Arguments

collapse all

Name or handle of a Simulink® model, specified as a character vector or string scalar.

Name or handle of an atomic subsystem in a Simulink model, specified as a character vector or string scalar.

Analysis options, specified as a character vector or string scalar that contains the name of an sldvoptions object.

Option to display messages during analysis in the log window, specified as:

Numeric or logical 1 (true) — Display the messages in the log window.
Numeric or logical 0 (false) — Display the messages in the Command Window.

Model coverage objects, specified as a character vector or string scalar that contains the name of a cvdata (Simulink Coverage) object.

Output Arguments

collapse all

Names of files that Simulink Design Verifier™ generates during analysis, returned as a structure with these fields:

FieldDescription

DataFile

MAT file with raw input data

HarnessModel

Simulink harness model

Report

HTML report of the simulation results

ExtractedModel

Simulink model extracted from subsystem

BlockReplacementModel

Simulink model obtained after block replacements

Analysis status, returned as one of these values:

FieldDescription

'-1'

Analysis exceeded the maximum processing time

'0'

Error

'1'

Processing completed normally

Error and warning information, specified as a structure with these fields:

FieldDescription

sourceFullName

Full path of the model element that caused the error or warning

objH

Handle to the model object that caused the error or warning

reportedBy

Name of the component or module that generated the error or warning message

msg

Error or warning message text

msgid

Unique identifier for the error or warning message

msgargs

Array of arguments that are used to construct the error or warning message

Alternatives

To run an analysis with Simulink Design Verifier, on the Design Verifier tab, in the Mode section, use any of these options:

  • Select Design Error Detection, then click Detect Design Errors.

  • Select Test Generation, then click Generate Tests.

  • Select Property Proving, then click Prove Properties.

Version History

Introduced in R2007a

expand all