I can no longer perform coverage analysis, what could be the problem?

Hello Matlab Gurus,
I am running a bunch of tests using Simulink Test tool. I have the Enable coverage analysis switched on for the models configuration. I have it enabled for the Test file, but no coverage analysis is carried out. Is there some setting somwhere else that is stopping the analysis? Will it work in Accelerated mode? If it won't work in anything except Normal mode surely a warning or an error message would be nice?
Cheers
Richard

 Accepted Answer

Apart from selecting "Enable coverage analysis", it is needed to specify one out of: Entire System, Referenced Models, Subsystems. From documentation see that:
Entire System (default): Coverage data is collected for the top-level model, as well as all supported subsystems and model references.
Referenced Models: Coverage data is collected for one or more referenced models. To specify the referenced models, use the parameter Select Models. You can also specify the top-level model itself.
Subsystem: Coverage data is collected for a specific subsystem. To specify a subsystem, use the parameter Select Subsystem.
You then run the model, and then should see a Coverage tab as part of the toolstrip, where you can get access to a report of the coverage details, generate a report, highlight coverage on the model.
Please have a look at the following example in the documentation:https://se.mathworks.com/help/slcoverage/ug/cumulative-coverage-analysis.html
Hope it helps!

6 Comments

Hi Jesus,
Thanks for your reply. I had all those things switched on. The issue was to do with my test cases specifying accelerator and fast restart being incompatible with coverage analysis. I guess that's ok if Simulink Test tells you this, but it doesn't it merely leaves out the coverage results. My problem is I have a ton of tests. If I run them in accelerated mode it takes 1.5 hours to run them all. If I want the coverage I have to switch mode to Normal, which looks like it would take > 20 hours which is not ideal!
Cheers
Richard
When selectig "Referenced Models" > "Select Models", it opens a new window named "Select Models for Coverage Analysis", it says: you can record model coverage for models that operate in Normal mode or code coverage for models that operate in Software-in-the-Loop (SIL) or Processor-in-the-Loop (PIL) modes. You cannot enable coverage for models whose Simulation mode parameter specifies 'Accelerator'.
I'm sure you're right, but that's not the point I'm making. If you select an option and Simulink Test cannot fulfill the request it should produce a helpful error message, it doesn't produce the coverage and doesn't tell you why. The help you refer to is one level down from where I was looking, because I want to produce coverage for the full system not just selected reference models. Took a long while for me to figure out the problem setting. The Simulink Test tool knows that accelerator and coverage are incompatible if it knows that then it can produce a warning/ error message.
My comment involves top-level and reference models. This is to answer your original question.
Now, I take your feedback about the message one should get. Thank you very much!
specifying this as the answer as a combination of the comments and the answer may help someone else ;-)
Absolutely! I think you made a good point. We really appreciate it. Thanks again!

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2020b

Community Treasure Hunt

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

Start Hunting!