main content

justify model advisor violations from check analysis -凯发k8网页登录

when you run checks using the model advisor app or the modeladvisor.run function, model advisor analyzes your design for adherence to modeling guidelines. the results from analysis show which checks pass, fail, are incomplete, are justified, or return a warning. model advisor checks that fail or return a warning are considered violations because the results do not comply with the modeling guidelines checked by the model advisor check.

if you review a violation and consider the violation to either not be relevant or not feasible for your design, you can justify the result. when you justify a result, you provide a rationale for why you are allowing the violation to exist in your design. justified checks have a check result status of justified in model advisor and the model advisor report.

justifications allow you to add a rationale for violations in the model advisor analysis results. if you want model advisor to not analyze specific blocks, use exclusions instead. exclusions can save time during model development and verification, since model advisor does not analyze what you exclude. for more information, see .

this example shows how to:

  • justify a violation for check results in model advisor.

  • justify an edit-time violation from the simulink® canvas.

  • load, view, edit, and delete justifications in model advisor.

  • create different justifications files for different sets of justifications.

justify violation using model advisor

after you run a model advisor check, you can justify violations in the results in model advisor. for information about how to run model advisor checks, see check model compliance by using the model advisor.

1. open the example model sldemo_fuelsys.

open_system("sldemo_fuelsys")

2. open model advisor. in the simulink editor, click the modeling tab and select model advisor. when the system selector dialog box opens, click ok to analyze the model.

3. in the check selector pane, select the checks that you want to run on the model. for this example, navigate to the folder model advisor > by product > simulink and select the check named check optimization settings.

4. run the check by clicking run checks in the toolstrip. the model advisor results show a warning for the check check optimization settings.

5. in the toolstrip, click justify. the result inspector pane opens, and the result details tab shows the results for each violation of the check check optimization settings.

6. in the result inspector pane, enter a rationale in the justifications field and click add justification. the justification applies to the violation that you select in the result details tab. by default, model advisor automatically selects the first result.

since you are justifying a check for the first time, model advisor prompts you with a save as dialog box that allows you to create a justifications file with your specified file name and in your specified directory.

7. specify the file name and directory where you want to save the justifications file. by default, the file name is modelname_justifications.json and the directory is your current working directory in matlab®.

when you click save, a banner on the simulink canvas shows the path to the justifications file that you saved, and model advisor shows the result as justified.

justify violation during edit-time checking

after you enable edit-time checks for a model, you can justify violations directly from the simulink canvas. for information on edit-time checks, see check model compliance using edit-time checking.

1. enable edit-time checking for the model. in the simulink editor, click the modeling tab and select model advisor > edit-time checks. when the configuration parameters dialog box opens, select the check box for edit-time checks and click ok.

in the simulink canvas, model advisor highlights blocks in the model that violate checks in the default model advisor configuration.

2. point to a highlighted block and click the icon above the block. for this example, point to the engine speed block and click the warning icon .

model advisor displays a violation summary and the title of the violated check or sub-check. the engine speed block violates the sub-check characters allowed for block names.

3. click suppress and enter your rationale for the justification in the comment field.

4. click add justification.

since you already created a justifications file for the model, model advisor adds the justification to that file.

the violation no longer appears in the simulink canvas.

if you justify other results, model advisor automatically adds those justifications to the current justifications file.

manage justifications

you can load, view, edit, and delete your justifications by using model advisor.

load justifications

after you save a justifications file for a model, model advisor automatically loads that justifications file the next time that you open the model.

if you want to load a specific justifications file, open model advisor on the model and, in the toolstrip, select open > load justifications file.

to see which justifications file is currently loaded for a model, open model advisor and, in the check selector pane, select model advisor. the configurations section shows the currently loaded justifications file.

if you want to create a different justifications file for a different set of justifications, see create multiple justifications files.

view justifications

view the justifications that you added in model. results that you justify have a check result status of justified and the justified icon appears next to the results in model advisor and the model advisor report.

note that to view justifications that you add during edit-time checking, you must re-run the checks from the model advisor app. for information on how to run checks and view results, see check model compliance by using the model advisor.

edit justifications

to edit the rationale for an existing justification:

1. open model advisor.

2. make sure the current justifications file is the file containing the justification you want to edit. in the check selector pane, click model advisor to view the current justifications file.

3. select the result for which you want to edit the justification. in the check selector pane, select the check and in the result details tab, select the justified result.

4. click edit in the result inspector pane to edit the rationale in the justifications field.

5. click add justification to update the justification with the new rationale.

delete justifications

to delete an existing justification:

1. open model advisor.

2. make sure the current justifications file is the file containing the justification you want to delete. in the check selector pane, click model advisor to view the current justifications file.

3. select the result for which you want to delete the justification. in the check selector pane, select the check and in the result details tab, select the justified result.

4. click delete in the result inspector pane to delete the justification from the currently loaded justifications file. the check result status returns to its original status of error or warning.

create multiple justifications files

if you already have a justifications file and you want to create a set of justifications in a new file, you must unload your current file. to unload your current file, move or rename it. when you add a justification for the model, model advisor prompts you to save a new justifications file.

note that you can also use the justifications argument in to perform a model advisor analysis with a specific justifications file.

see also

related topics

网站地图