Simulate model by using input data
simulates outData
= slvnvruntest(model
, dataFile
)model
by
using all the test cases in dataFile
. outData
is
an array of
objects. Each
array element contains the simulation output data of the corresponding
test case.Simulink.SimulationOutput
[
simulates outData
, covData
]
= slvnvruntest(model
, dataFile
, runOpts
)model
by
using the test cases in dataFile
. When the runOpts
field coverageEnabled
is true
,
the Simulink®
Coverage™ software collects model
coverage information during the simulation. slvnvruntest
returns
the coverage data in the cvdata
object covData
.
% Analyze the sldemo_mdlref_basic model and log the input signals to the CounterA Model block: open_system('sldemo_mdlref_basic'); loggedData = slvnvlogsignals('sldemo_mdlref_basic/CounterA'); % Using the logged signals, simulate the model referenced in the Counter block (sldemo_mdlref_counter): runOpts = slvnvruntestopts; runOpts.coverageEnabled = true; open_system('sldemo_mdlref_counter'); [ outData ] = slvnvruntest('sldemo_mdlref_counter',... loggedData, runOpts); % Examine the output data from the first test case using the Simulation Data Inspector: Simulink.sdi.createRun('Test Case 1 Output', 'namevalue',... {'output'}, {outData(1).find('logsout_slvnvruntest')}); Simulink.sdi.view;
The dataFile
that you create with a Simulink
Design Verifier analysis
or by running slvnvlogsignals
contains time values
and data values. When you simulate a model by using these test cases,
you might see missing coverage. This issue occurs when the time values
in the dataFile
are not aligned with the current
simulation time step due to numeric calculation differences. You see
this issue more frequently with multirate models—models that
have multiple sample times.
For useParallel
, the following points must be considered
when simulating test cases using parallel computing:
Starting a parallel pool can take time, which impacts the overall analysis time. To reduce the analysis time:
Make sure that the parallel pool is already running before you run a test generation analysis. By default, the parallel pool shuts down after being idle for a specified number of minutes. To change the setting, see Specify Your Parallel Preferences (Parallel Computing Toolbox).
Load Simulink on all the parallel pool workers.
The simulation occurs sequentially when:
The cluster is not local
. Configure
parallel preferences to use the local
cluster only. See Specify Your Parallel Preferences (Parallel Computing Toolbox).
The model is in dirty state
prior
to launching the SLDV analysis.
The model has ToFile
blocks.
The model in Software-in-the-loop (SIL) simulation mode.
The model is an internal harness.
cvsim
| cvtest
| sim
| slvnvruntestopts