Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Verification and Validation   

cvsimref - Simulate and return model coverage results for referenced models

Syntax

cvdg = cvsimref(topModelName)
cvdg = cvsimref(topModelName, cvtg)
[cvdg,t,x,y] = cvsimref(topModelName, cvtg)
[cvdg,t,x,y] = cvsimref(topModelName, cvtg, timespan, options)
[cvdg1, cvdg2, ...] = cvsimref(topModelName, cvtg1, cvtg2, ...)

Description

cvdg = cvsimref(topModelName) simulates the top model and all referenced models in the hierarchy, collects model coverage data, and returns the results in the cv.cvdatagroup object cvdg. You do not have to enable model coverage reporting for any of the models in a model hierarchy to use the cvsimref command.

cvdg = cvsimref(topModelName, cvtg) simulates topModelName and collects model coverage data by executing the cv.cvtestgroup object cvtg. cvtg contains cvtest specifications for the top-level model and all the referenced models in the hierarchy. cvsimref returns the model coverage results in cvdg.

[cvdg,t,x,y] = cvsimref(topModelName, cvtg) returns the time vector t, matrix of state values x, and matrix of output values y from the simulation.

[cvdg,t,x,y] = cvsimref(topModelName, cvtg, timespan, options) overrides default simulation values with the values in timespan and options.

[cvdg1, cvdg2, ...] = cvsimref(topModelName, cvtg1, cvtg2, ...) executes multiple cv.cvtestgroup objects and returns the results in a set of cv.cvdatagroup objects.

Inputs

cvtg

cv.cvtestgroup object that contains test specifications for the referenced models in the hierarchy

options

Optional simulation parameters specified as a structure created by the simset command.

timespan

Simulation start and stop time:

tFinalSpecify the stop time. The start time is 0.
[tStart tFinal]Specify the start and stop times.
[tStart OutputTimes tFinal]Specify that cvsimref return the start and stop times and time points in t. Generally, t includes more time points. OutputTimes is equivalent to specifying Configuration Parameters > Data Import/Export > Output options > Produce specified output only.

topModelName

Name of the top-level model in the hierarchy

Outputs

cvdg

cv.cvdatagroup object

t

The simulation time vector

x

The simulation state matrix consisting of continuous states followed by discrete states

y

The simulation output matrix. Each column contains the output of a root-level Outport block, in port number order. If any Outport block has a vector input, its output takes the appropriate number of columns.

Examples

Open and simulate the slvnvdemo_ratelim_harness model and its two subsystems:

topModel = 'slvnvdemo_cv_mutual_exclusion';
load_system(topModel);
% Make sure coverage is off for this run for the entire tree
set_param(topModel,'RecordCoverage','off');
set_param(topModel,'CovModelRefEnable','Off');
[T1, X1, Y1] = sim(topModel);                  % Normal data
[allData, T2, X2, Y2] = cvsimref(topModel);    % cvsimref data

See Also

cv.cvdatagroup | cv.cvtestgroup | cvsim | cvtest | simset

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS