Main Content


Generate simulation or execution options for sldvruntest or sldvruncgvtest



runOpts = sldvruntestopts generates a runOpts structure for sldvruntest.

runOpts = sldvruntestopts('cgv') generates a runOpts structure for sldvruncgvtest.


collapse all

Create runOpts for the sldvdemo_cruise_control model. Then, analyze the model by using sldvruntest.

Open the sldvdemo_cruise_control example model.

'supportingFile', 'sldvdemo_cruise_control');

Set the sldvoptions and create runOpts for sldvruntest.

opts = sldvoptions;
opts.Mode = 'TestGeneration';
opts.SaveHarnessModel = 'on';
opts.SaveReport = 'off';
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts);
runOpts = sldvruntestopts;

Analyze the model by using the runOpts.

[ outData ] = sldvruntest('sldvdemo_cruise_control',...
    files.DataFile, runOpts);

Input Arguments

collapse all

Generates a default runOpts structure for sldvruncgvtest.

Example: runcgvtest_options = sldvruntestopts('cgv');

Output Arguments

collapse all

A structure whose fields specify the configuration of sldvruntest or sldvruncgvtest. If you do not specify a field name, sldvruncgvtest or sldvruntest uses the default value. runOpts can contain the fields listed in the table.

Field NameDescription

Test case index array to simulate or execute from dataFile.

If testIdx = [], all test cases are simulated or executed.


Available only for sldvruntest.

Specifies the format of signal logging data for signals that connect to the outport of the model and for intermediate signals that are configured for logging.

If you specify Dataset, data is stored in the Simulink.SimulationData.Dataset objects.

Default: 'Dataset'


Available only for sldvruntest.

If true, the Simulink® Coverage™ software collects model coverage data during simulation.

Default: false


Available only for sldvruntest.

cvtest object to use for collecting model coverage.

If coverageSetting is [], sldvruntestopts returns the coverage settings for the model specified in the call to sldvruntest.

Default: []


Available only for sldvruncgvtest.

If you have not configured sldvruncgvtest to execute test cases with the CGV API, allowCopyModel specifies creating and configuring the model.

If true and you have not configured the model to execute test cases with the CGV API, sldvruncgvtest copies the model, fixes the configuration, and executes the test cases on the copied model.

If false (the default), an error occurs if the tests cannot execute with the CGV API.


If you have not configured the top-level model or any referenced models to execute test cases, sldvruncgvtest does not copy the model, even if allowCopyModel is true. An error occurs.


Available only for sldvruncgvtest.

Defines the software-in-the-loop (SIL) or processor-in-the-loop (PIL) approach for CGV:

  • 'topmodel' (default)

  • 'modelblock'


Available only for sldvruncgvtest.

Specifies mode of execution for CGV:

  • 'sim' (default)

  • 'sil'

  • 'pil'


Available only for sldvruntest.

If true, Simulink Design Verifier™ uses fast restart mode for model simulation.

Default: true


Available only for sldvruntest.

If true, Simulink Design Verifier simulates test cases with parallel computing. This option requires a Parallel Computing Toolbox™ license.

Default: false


Create a runOpts object for sldvruntest from the MATLAB® Command Window.

Version History

Introduced in R2010b