How to disable the display of coverage report once the simulation is stopped

조회 수: 9 (최근 30일)
Prasad
Prasad 2025년 1월 16일
답변: Epsilon 2025년 1월 17일
I am in a situation where I need to collect cumulative coverage after multiple simulation restarts. Right now, whenever I hit the stop button, the coverage report is getting generated and it consumes some time, instead am wondering if I can disable the coverage report geneartion and instead save it to a workspace variable and generate the reports at once after all my runs?

답변 (1개)

Epsilon
Epsilon 2025년 1월 17일
Hi Prasad,
It is not possible to disable coverage report in the model configuration settings or in the Simulink Coverage app as far as I know. However, you can store the coverage data in the workspace for each run if the coverage analysis is done via a script. This data can then be used to generate the report at the end of the iterations.
Here is an example of the implementation:
load_system('slvnvdemo_ratelim_harness');
%Set up the coverage parameters
paramStruct.CovEnable = 'on';
paramStruct.CovScope = 'Subsystem';
paramStruct.CovPath = '/Adjustable Rate Limiter';
paramStruct.StartTime = '0.0';
paramStruct.StopTime = '2.0';
%setup a test
load within_lim.mat;
%loop to simulate and store coverage data
for i = 1:5
% Generate a unique coverage data name for each iteration
covSaveName = sprintf('covData%d', i);
% Set the coverage save name parameter
paramStruct.CovSaveName = covSaveName;
% Simulate the model using |sim| with |paramStruct| as an additional input
% to collect coverage data using the specified parameters.
simOut = sim('slvnvdemo_ratelim_harness',paramStruct);
% Use |cvsave| to save the coverage results. The first input is the name of
% the coverage data file, and the second input is the |cvdata| object.
cvsave(covSaveName,covData);
end
%generate the report
cvhtml('covReport',covData1,covData2,covData3,covData4,covData5,'-sRT=1');
For further information please refer to the following documentation:
Hope it helps.

카테고리

Help CenterFile Exchange에서 Collect Coverage for Models에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by