During model development, check and analyze your model to increase confidence in its quality. Check your model against standards such as MAAB style guidelines and high-integrity system design guidelines such as DO-178 and ISO 26262. Analyze your model for errors, dead logic, and conditions that violate required properties. Using the analysis results, update your model and document exceptions. Report the results using customizable templates.
This example shows how to use the Model Advisor to check a cruise control model for MathWorks® Automotive Advisory Board (MAAB) style guideline violations and design errors. Select checks and run the analysis on the model. Iteratively debug issues using the Model Advisor and rerun checks to verify that it is in compliance. After passing your selected checks, report results.
In Model Advisor, you can check that your model complies with MAAB modeling guidelines.
Create a copy of the project in a working folder. On the command line, enter
path = fullfile(matlabroot,'toolbox','shared','examples',... 'verification','src','cruise') run(fullfile(path,'slVerificationCruiseStart'))
Open the model. On the command line, enter
In the Modeling tab, select Model Advisor.
Click OK to choose
the System Hierarchy.
Check your model for MAAB style guideline violations using Simulink® Check™.
In the left pane, in the By Product > Simulink Check > Modeling Standards > MAAB 3.0 Checks folder, select:
Check for indexing in blocks
Check for prohibited blocks in discrete controllers
Check model diagnostic parameters
Right-click on the MAAB 3.0 Checks node
Click Check model diagnostic parameters to review the configuration parameter settings that violate MAAB style guidelines.
In the right pane, click the parameter links to update the values in the Configuration Parameters dialog box.
To verify that your model passes, rerun the check. Repeat
necessary, to reach compliance.
To generate a results report of the Simulink Check checks, select the MAAB 3.0 Checks node, and then, in the right pane click Generate Report....
While in Model Advisor, you can also check your model for hidden design errors using Simulink Design Verifier™.
In the left pane, in the By Product > Simulink Design Verifier folder, select Design Error Detection. All the checks in the folder are selected.
In the right pane, click Run Selected Checks.
After the analysis is complete, expand the Design Error Detection folder, then select checks to review warnings or errors.
In the right pane, click Simulink Design Verifier Results Summary. The dialog box provides tools to help you diagnose errors and warnings in your model.
Review the results on the model. Click Highlight
analysis results on model. Click the
speed subsystem, outlined in red. The Simulink Design Verifier
Results Inspector window provides derived ranges that can help you
understand the source of an error by identifying the possible signal
Review the harness model. The Simulink Design Verifier Results Inspector window displays information that an overflow error occurred. To see the test cases that demonstrate the errors, click View test case.
Review the analysis report. In the Simulink Design Verifier Results Inspector window, click Back to summary. To see a detailed analysis report, click HTML or PDF.