Main Content

Simulink Design Verifier Data Files

Data File Generation

Simulink® Design Verifier™ generates a data file when it completes its analysis. The data file is a MAT-file that contains a structure named sldvData. This structure stores all the data the software gathers and produces during the analysis. Although the software displays the same data graphically in the harness model and report, you can use the data file to conduct your own analysis or to generate a custom report.

Contents of sldvData Structure

When Simulink Design Verifier completes its analysis, it produces a MAT-file that contains a structure named sldvData. To explore the contents of the sldvData structure:

  1. Generate test cases for the sldvdemo_flipflop model:

    sldvdemo_flipflop;
    sldvrun('sldvdemo_flipflop');
  2. To load the data file, at the MATLAB® prompt, enter the following command:

    load('sldv_output\sldvdemo_flipflop\sldvdemo_flipflop_sldvdata.mat')

    The MATLAB software loads the sldvData structure into its workspace. This structure contains the Simulink Design Verifier analysis results of the sldvdemo_flipflop model.

  3. Enter sldvData at the MATLAB command line to display the field names that constitute the structure:

    sldvData = 
    
           ModelInformation: [1x1 struct]
        AnalysisInformation: [1x1 struct]
               ModelObjects: [1x2 struct]
                Constraints: []
                 Objectives: [1x12 struct]
                  TestCases: [1x4 struct]
                    Version: '2.1'

Model Information Fields in sldvData

The following sections describe the fields in the sldvData structure:

ModelInformation Field

In the sldvData structure, the ModelInformation field contains information about the model you analyzed. The following table describes each subfield of the ModelInformation field.

Subfield NameDescription
Name

The model name.

Version

The model number.

Author

The user name.

TimeStamp

The last date and time the model was updated.

SubsystemPath

The full path name of the subsystem (if any) that was analyzed.

ExtractedModel

The name of the model extracted (if any) to analyze the subsystem (if any) specified in SubsystemPath.

ReplacementModel

The name of the model (if any) that contains the block replacements.

HarnessOwnerModel

The name of the owner model of the Simulink Test™ test harness (if any) being analyzed.

AnalysisInformation Field

In the sldvData structure, the AnalysisInformation field lists settings of particular analysis options and related information. The following table describes each subfield of the AnalysisInformation field.

Subfield NameDescription
Status

The completion status of the Simulink Design Verifier analysis.

AnalysisTime

Double that specifies the length of the analysis in seconds.

Options

Deep copy of the Simulink Design Verifier options object used during the analysis.

InputPortInfo

Cell array of structures that specifies information about each Inport block in the top-level system.

OutputPortInfo

Cell array of structures that specifies information about each Outport block in the top-level system.

SampleTimes

For internal use only.

Parameters

For internal use only.

AbstractedBlocks

For internal use only.

Approximations

A structure that describes the approximations performed during the analysis. For more information about approximations, see Approximations.

ReplacementInfo

For internal use only.

PreProcessingTime

Double that specifies the time in seconds to build or reuse the model representation.

ModelRepresentationInfo

The date and time of the model representation that is used for analysis.

ModelObjects Field

In the sldvData structure, the ModelObjects field lists the model items and their associated objectives. The following table describes each subfield of the ModelObjects field.

Subfield NameDescription
descr

The full path to a model object, including objects in a Stateflow® chart.

typeDesc

The block type of the model object.

slPath

The full path to a Simulink model object.

sfObjType

The type of a Stateflow object. Example: S for state and T for transition.

sfObjNum

Integer that represents the unique identifier of a Stateflow object.

sid

For internal use only.

designSid

For internal use only.

replacementSid

For internal use only.

objectives

Vector of integers that represents the indices of objectives associated with a model object.

Constraints Field

In the sldvData structure, the Constraints field lists information about specified minimum and maximum values (if any) on input ports in your model. The following table describes the subfield of the Constraints field.

Subfield NameDescription
DesignMinMax

Cell array of structures that include the name and minimum and maximum values for each input port for which values are specified.

Objectives Field

In the sldvData structure, the Objectives field lists information about each objective, such as its type, status, and description. The following table describes each subfield of the Objectives field.

Subfield NameDescription
type

The type of an objective.

status

The status of an objective.

descr

The description of an objective.

label

The label of an objective.

outcomeValue

Integer that specifies an objective's outcome.

coveragePointIdx

Integer that represents the index of a coverage point with which an objective is associated.

linkInfo

For internal use only.

range

For internal use only.

detectability

The detectability status of an objective.

This field appears in the data file when the analysis Mode is set to Test Generation and Model coverage objectives is set to Enhanced MCDC.

detectionSites

Array of Simulink Identifier (SID) of the detection sites for a detectable objective. The objective is detectable at any one of the detection sites.

This field appears in the data file when the analysis Mode is set to Test Generation and Model coverage objectives is set to Enhanced MCDC.

modelObjectIdx

Integer that represents the index of a model object with which an objective is associated.

analysistime

Integer that represents the analysis time for an object.

testCaseIdx

Integer that represents the index of a test case or counterexample that addresses an objective.

TestCases Field / CounterExamples Field

In the sldvData structure, this field can have two names, depending on the type of check:

  • If you set the Mode parameter to Design error detection, the CounterExamples field lists information about each test case that results in an integer overflow or division-by-zero error.

  • If you set the Mode parameter to Test generation, the TestCases field lists information about each test case, such as its signal values and the test objectives it achieves.

  • If you set the Mode parameter to Property proving, the CounterExamples field lists information about each counterexample and the proof objective it falsifies.

The following table describes each subfield of the TestCases / CounterExamples field.

Subfield NameDescription
timeValues

Vector that specifies the time values associated with signals in a test case or counterexample.

dataValues

Cell array that specifies the data values associated with signals in a test case or counterexample.

paramValues

Structure that specifies the parameter values associated with a test case or counterexample. Its fields include:

name — The name of a parameter.

value — Number that specifies the value of a parameter.

noEffect — Logical value that specifies whether a parameter's value affects an objective.

stepValues

Vector that specifies the number of time steps that comprise signals in a test case or counterexample.

objectives

Structure that specifies objectives that a test case or a counterexample addresses. Its fields include:

objectiveIdx — Integer that represents the index of an objective that a test case achieves or a counterexample falsifies.

atTime — Time value at which either a test case achieves an objective or a counterexample falsifies an objective.

atStep — Time step at which either a test case achieves an objective or a counterexample falsifies an objective.

dataNoEffect

Cell array of logical vectors that specifies whether a signal's data values affect an objective. The vector uses 1 to indicate that a signal's data value does not affect an objective; otherwise, it uses 0.

expectedOutput

Cell array of vectors that specifies the output values that result from simulating the model using the test case signals. Each cell represents the output values associated with a different Outport block in the top-level system. This subfield is populated if you select Include expected output values.

Version Field

In the sldvData structure, the Version field specifies the version of Simulink Design Verifier that analyzed the model.

DeadLogic Field

If you analyze your model for dead logic, in the sldvData structure, the DeadLogic field lists information about each dead logic objective.

This table describes each subfield of the DeadLogic field.

Subfield NameDescription
label

The description of the dead logic objective.

descr

The full path to a model object, including objects in a Stateflow chart.

modelObjIdx

Integer that represents the index of a model object that is associated with an objective.

coverageType

The type of coverage objective.

coverageIdx

Integer that represents the index of a coverage point that is associated with an objective.

ObjectiveIdx

Integer that represents the index of an objective that is associated with a model object.

Simulate Models with Data Files

The sldvruntest function simulates a model by using test cases or counterexamples that reside in a Simulink Design Verifier data file:

  1. Simulate the sldvdemo_flipflop model and generate test cases:

  2. Save the location of the data file generated after analyzing the model:

    sldvDataFile = 'sldv_output\sldvdemo_flipflop\sldvdemo_flipflop_sldvdata.mat'
  3. Use the sldvruntest function to simulate the sldvdemo_flipflop model using test case 2 in the data file:

    [ outdata ] = sldvruntest('sldvdemo_flipflop', sldvDataFile, 2)

    The output from sldvruntest is an array of Simulink.SimulationOutput objects.

  4. Examine the output data from the first test case using the methods of the Simulink.SimulationOutput object:

    tout_sldvruntest = outdata(1).find('tout_sldvruntest');
    xout_sldvruntest = outdata(1).find('xout_sldvruntest');
    yout_sldvruntest = outdata(1).find('yout_sldvruntest');
    logsout_sldvruntest = outdata(1).find('logsout_sldvruntest');

Load Results from Data Files

You can load previous analysis results for a model from a data file. For more information, see Load Previous Results and sldvloadresults.