Main Content

Manage Simulink Design Verifier Data Files

Simulink® Design Verifier™ generates a data file after completing the analysis. The data file is a MAT-file that contains the sldvData structure. 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 for further custom analysis or to generate a custom report.

Generate sldvData Structure

Complete these steps to explore the contents of the sldvData structure.

  1. Generate test cases for the sldvdemo_flipflop model.

    openExample('sldv/FlipFlopTestGenerationExample', ...
    'supportingFile', 'sldvdemo_flipflop');
    sldvrun('sldvdemo_flipflop');
  2. Load the sldvData structure for the sldvdemo_flipflop model to the MATLAB® workspace.

    load('sldv_output\sldvdemo_flipflop\sldvdemo_flipflop_sldvdata.mat')
  3. Display the names of the fields in 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:

Model Information

The ModelInformation field contains information about the model you analyze in Simulink Design Verifier. This table describes the subfields in the ModelInformation field.

Subfield NameDescription
Name

Model name.

Version

Model number.

Author

User name.

TimeStamp

Date and time of last update.

SubsystemPath

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

ExtractedModel

Name of model extracted to analyze subsystem in SubsystemPath.

ReplacementModel

Name of model containing block replacements.

HarnessOwnerModel

Name of owner of analyzed Simulink Test™ harness model.

Analysis Information

The AnalysisInformation field lists the analysis options and related information. The table describes the AnalysisInformation field.

Subfield NameDescription
Status

Status of analysis.

AnalysisTime

Duration in seconds of analysis

Options

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

InputPortInfo

Cell array of structures with information about every Inport block in top level of system.

OutputPortInfo

Cell array of structures with information about every Outport block in top level of system.

SampleTimes

For internal use only.

Parameters

For internal use only.

AbstractedBlocks

For internal use only.

Approximations

Structure describing approximations performed during analysis. For more information, see Role of Approximations During Model Analysis.

ReplacementInfo

For internal use only.

PreProcessingTime

Time in seconds to build or reuse model representation.

ModelRepresentationInfo

Date and time of model representation used in analysis.

Model Objects

The ModelObjects field lists the model items and their associated objectives. The table describes the ModelObjects field.

Subfield NameDescription
descr

Full path to model object, including objects in Stateflow® chart.

typeDesc

Type of model object, returned as S for a state object and T for a transition object.

slPath

Full path to Simulink model object.

sfObjType

Type of Stateflow object. Example: S for state and T for transition.

sfObjNum

Integer representing a unique identifier for Stateflow object.

sid

For internal use only.

designSid

For internal use only.

replacementSid

For internal use only.

objectives

Vector of integers representing indices of objectives related to model object.

Constraints

The Constraints field lists information about specified minimum and maximum values (if any) on input ports in your model. The table describes the Constraints field.

Subfield NameDescription
DesignMinMax

Cell array of structures containing name and minimum and maximum values of each input port.

Objectives

The Objectives field lists information about each objective, such as its type, status, and description. The table describes the Objectives field.

Subfield NameDescription
type

Type of objective.

status

Status of objective.

descr

Description associated with objective.

label

Label of objective.

outcomeValue

Integer representing outcome of objective.

coveragePointIdx

Integer representing index of coverage point associated with objective.

linkInfo

For internal use only.

range

For internal use only.

detectability

Detectability status of objective.

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

detectionSites

Simulink Identifier (SID) array of detection sites for detectable objectives.

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

modelObjectIdx

Integer representing index of model object associated with objective.

analysistime

Analysis time of objective.

testCaseIdx

Integer representing index of test case or counterexample addressed in objective.

Test Cases or Counterexamples

This field name depends on the type of check:

  • If you set the Mode parameter to Design error detection, the CounterExamples field provides information on 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 test objectives.

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

The table describes the TestCases and CounterExamples fields.

Subfield NameDescription
timeValues

Vector of time values associated with signals in test case or counterexample.

dataValues

Vector of data values associated with signals in test case or counterexample.

paramValues

Structure representing details of parameters associated with test case or counterexample containing these fields:

name— Parameter name.

value — Parameter value.

noEffect — Logical to signify if parameter 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

The Version field lists the Simulink Design Verifier version used in the analysis.

Dead Logic Field

If you analyze your model for dead logic by using the Run a Partial Check for Dead Logic option, the DeadLogic field in the sldvData structure lists information about each dead logic objective.

This table describes each subfield of the DeadLogic field.

Subfield NameDescription
label

Description of dead logic objective.

descr

Full path to model object, including objects in Stateflow chart.

modelObjIdx

Integer representing index of model object associated with objective.

coverageType

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 Using Data Files

You can use the sldvruntest function to simulate a model by using test cases or counterexamples that reside in a Simulink Design Verifier data file. Complete these steps to simulate the sldvdemo_flipflop model using a test case in its data file.

  1. Simulate the sldvdemo_flipflop model and generate test cases:

    openExample('sldv/FlipFlopTestGenerationExample', ...
    'supportingFile', 'sldvdemo_flipflop');
    sldvrun('sldvdemo_flipflop');
  2. Save the location of the data file that Simulink Design Verifier generates 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 the second test case in the data file:

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

    The sldvruntest outputs is an array of Simulink.SimulationOutput objects.

  4. Examine the output data from the first test case using 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 the results of a previous analysis of a model from a data file. For more information, see Load Previous Results and sldvloadresults.

See Also

| |