WithSimulink® Check™, the Model Advisor can check for model conditions that cause generation of inefficient code or code unsuitable for safety-critical applications.
The Model Advisor produces a report that lists the suboptimal conditions or settings that it finds. The Model Advisor proposes better model configuration settings.
In the Model Advisor, you can check that your model complies with certain guidelines while you edit.
Create a copy of the example project in a working folder. At the command line, enter:
Open the model. At the command line, enter:
In the model window, turn on edit-time checking by selecting Analysis > Model Advisor > Display Advisor Checks in Editor. Alternatively, on the model editor toolbar, select Display Advisor Checks in Editor from the Model Advisor menu.
The highlighted subsystem block indicates a compliance issue. Place your cursor over the highlighted block and click the warning icon. A dialog box provides a description of the warning. For detailed documentation on the check that detected the issue, click the question mark. In this case, the warning indicates that the subsystem block name contains incorrect characters.
The subsystem block name,
Compute target speed,
contains incorrect spaces. To fix this violation, select
target speed and replace the name with
After renaming the block, you do not see a warning icon when you place your cursor over the subsystem block.
You can interactively check that your model complies with DO-178C/DO-331 guidelines by using the Model Advisor.
In the model window, select Analysis > Model Advisor > Model Advisor.
the System Hierarchy, click OK.
In the left pane, in the By Product > Simulink Check > Modeling Standards > DO-178C/DO-331 Checks folder, select:
Check safety-related optimization settings
Check safety-related diagnostic settings for solvers
Check safety-related diagnostic settings for sample time
Right-click the DO-178C/DO-331 Checks node, and then
Run Selected Checks.
To review the configuration parameters that are not set to the recommended values, click Check safety-related optimization settings.
To update the optimization parameters to the recommended values, click the Modify Settings button in the Action section of the right pane. The Model Advisor updates the parameters to the recommended value and details the results.
Repeat steps 1 and 2 for the other two checks: Check safety-related diagnostic settings for solvers and Check safety-related diagnostic settings for sample time.
To verify that your model now passes, rerun the selected checks.
To generate a results report of the Simulink Check checks, select the DO-178C/DO-331 Checks node, and then, in the right pane click Generate Report.