Analyze Models for Standards Compliance and Design Errors
During model development, you can check and analyze your model against standards such as MAB style guidelines and high-integrity system design guidelines such as DO-178 and ISO 26262. When you analyze your model, you identify errors, dead logic, and conditions that violate required properties. You can then use the analysis results to update your model and document exceptions and report the results using customizable templates.
This example shows how to use the Model Advisor to check a cruise control model for MathWorks® Advisory Board (MAB) style guideline violations and design errors. You select checks and run the analysis on the model and iteratively debug issues using the Model Advisor and rerun checks to verify that it is in compliance. When the model passes the selected checks, you report the results.
Check Model for MAB Style Guideline Violations
Check that your model complies with MAB guidelines by using the Model Advisor.
Open the example project.
openExample("shared_vnv/CruiseControlVerificationProjectExample"); pr = openProject("SimulinkVerificationCruise");
Open the
simulinkCruiseErrorAndStandardsExample
model.open_system("simulinkCruiseErrorAndStandardsExample");
In the Modeling tab, select Model Advisor.
From the System Selector dialog, select
simulinkCruiseErrorAndStandardsExample
and click OK.Check your model for MAB style guideline violations by using Simulink® Check™:
In the left pane, in the By Product > Simulink Check > Modeling Standards > MAB Checks folder, select:
Check Indexing Mode
Check model diagnostic parameters
Right-click the MAB Checks node and select Run Checks.
In the left pane, select Check model diagnostic parameters. The analysis results appear in the right pane, on the Report tab. The report displays the violation details and the recommended action.
To open the Configuration Parameters dialog box, click the parameter hyperlinks, update the model diagnostic parameters, and save the model.
To verify that your model passes, rerun the check. Repeat steps from
c
toe
, if necessary, until both checks pass.To generate a results report of the Simulink Check checks, select the MAB Checks node, and click Report in the toolstrip.
Check Model for Design Errors
In the Model Advisor, you can also check your model for hidden design errors by using Simulink Design Verifier™.
In the left pane, in the By Products > Simulink Design Verifier folder, click the check box for Design Error Detection. All checks in the folder are selected.
From the toolstrip, click Run Checks.
When the analysis is complete, generate an HTML report of the analysis. In the toolstrip, click Report.
In the generated report, click a Simulink Design Verifier Results Summary hyperlink. The dialog box helps you diagnose errors and warnings in your model. You can:
Review the analysis results for the model. Click the
Compute target speed
subsystem. 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 values.Review the harness model or create one if it does not already exist.
View tests and export test cases.
Review the analysis report. To see a detailed analysis report, click HTML or PDF.
Related Topics
- Check Model Compliance by Using the Model Advisor (Simulink Check)
- Collect Model Metrics Using the Model Advisor (Simulink Check)
- Analyze Models for Design Errors (Simulink Design Verifier)
- Prove Properties in a Model (Simulink Design Verifier)