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

5 ビュー (過去 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 Center および File ExchangeCollect 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