Simulate and return model coverage results for test objects
cvdo = cvsim(modelName)
cvdo = cvsim(cvto)
[cvdo,simOut]
= cvsim(cvto,Name1,Value1,Name2,Value2,...)
[cvdo,simOut]
= cvsim(cvto,ParameterStruct)
[cvdo1,cvdo2,...]
= cvsim(cvto1,cvto2,...)
simulates
the model and returns the coverage results for the model. cvdo
= cvsim(modelName
)cvsim
saves
the coverage results in the cvdata
object, cvdo
.
However, when recording coverage for multiple models in a hierarchy, cvsim
returns
the coverage results in a cv.cvdatagroup
object.
simulates
the model and returns the coverage results for the cvdo
= cvsim(cvto
)cvtest
object, cvto
. cvsim
saves
the coverage results in the cvdata
object, cvdo
.
However, when recording coverage for multiple models in a hierarchy, cvsim
returns
the coverage results in a cv.cvdatagroup
object.
[
specifies
the model parameters and simulates the model. cvdo
,simOut
]
= cvsim(cvto
,Name
1,Value
1,Name
2,Value
2,...)cvsim
returns
the coverage results in the cvdata
object, cvdo
,
and returns the simulation outputs in the
object, Simulink.SimulationOutput
simOut
.
[
sets
the model parameters specified in a structure cvdo
,simOut
]
= cvsim(cvto
,ParameterStruct
)ParameterStruct
,
simulates the model, returns the coverage results in cvdo
,
and returns the simulation outputs in simOut
.
[
simulates the model and returns the coverage results for the test
objects, cvdo
1,cvdo
2,...]
= cvsim(cvto
1,cvto
2,...)cvto1, cvto2, ...
. cvdo1
contains
the coverage results for cvto1
, cvdo2
contains
the coverage results for cvto2
, and so on.
Even if you have not enabled coverage recording for the model,
you can execute the cvsim
command to record coverage
for your model.
|
Name of model specified as a character vector or string |
|
|
|
Model parameters specified as a structure |
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
|
Name of the model parameter to be specified for simulation |
|
Value of the model parameter |
|
|
|
A |
Open the sldemo_engine
example model, create
the test object, set the model parameters, and simulate the model. cvsim
returns
the coverage data in cvdo
and the simulation outputs
in the Simulink.SimulationOutput
object, simOut
:
model = 'sldemo_engine'; open_system(model); testObj = cvtest(model); % Get test data testObj.settings.decision = 1; paramStruct.AbsTol = '1e-5'; paramStruct.SaveState = 'on'; paramStruct.StateSaveName = 'xoutNew'; paramStruct.SaveOutput = 'on'; paramStruct.OutputSaveName = 'youtNew'; [cvdo,simOut] = cvsim(testObj,paramStruct); % Get coverage cvhtml('CoverageReport.html', cvdo); % Create HTML Report
cv.cvdatagroup
| cvtest
| sim