Justification rules in coverage report are no longer recognized in new model version

6 views (last 30 days)
I have a Simulink model built from a frame and core.The core consists of several library functions and for each library function there is a coverage filter. The core is copied in the frame each time a new frame is to be used in the project. The problem here is that the justification rules defined in the old version of the coverage filter are no longer recognized in the new model version. you need to copy the justifications from the old coverage report and paste them into a new coverage filter in the new model.
Why are the justification rules from the older version not automatically recognized by the coverage filter? How to solve this problem?
  3 Comments
Ibrahim Tawbe
Ibrahim Tawbe on 14 Apr 2023
Hello Canny,
The justification rules is stored in "Abweichungsbegruendung.cvf". The problem here is that the justifications are assigned to the block-id. when we have a new version of the model, the block ids are also changed, for example:
id = Simulink.ID.getSID('TPT_VDFE_FCA_testframe/VDFE_FCA/FZB_FCA_Frct/WhlBrk/and') has the value 'TPT_VDFE_FCA_testframe:2943' in the old model version.
But in the new model version the same block has the ID 'TPT_VDFE_FCA_testframe:3034'.
For this reason, the justification rules from the old version cannot be recognized in the new model version, even though the old and new model versions have the same structure.
Thanks for your help!
Pat Canny
Pat Canny on 14 Apr 2023
I am working on a potential solution for you, but wanted to see if this preliminary idea made sense.
The proposed workflow below is just meant to show the functions you could use, but it would require some updates to make it scalable (for instance, this just shows how to apply a filter to a block with a given name).
If the names are kept the same, you could try something with Simulink.findBlocks and slcoverage.BlockSelector, like so (for a given block):
openExample('slcoverage/CreatingAndUsingCoverageFiltersExample');
blockName = 'protected division';
blockHandle = Simulink.findBlocks(gcs,'Name','protected division'); % name must match
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance,blockHandle);
rule = slcoverage.FilterRule(bl,'defensive modeling',slcoverage.FilterMode.Exclude);
filt = slcoverage.Filter;
filt.addRule(rule);

Sign in to comment.

Answers (0)

Categories

Find more on Verification, Validation, and Test in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!