Main Content

Fix Design Errors in Model

For this model, the design error detection analysis found integer overflow and division-by-zero errors. The errors were caused due to a mismatch in the integer data type. You fix these design errors by modifying the model parameters, rerun the analysis and view the results.

Modify Model Parameter to Fix Errors

To fix the errors, change the Accumulator data type and Output data type parameters to uint16 to handle the range of possible signal values.

Open the sldvexDetectDesignErrorsExample model:

open_system("sldvexDetectDesignErrorsExample");

Double-click the Sum block, and in the Block Parameters dialog box, set Accumulator data type and Output data type to uint16.

Click Apply and OK to save the changes.

fix_design_errors_fix_parameters.png

Rerun the Analysis

Run design error detection analysis to see if you resolved the errors. On the Design Verifier tab, click Detect Design Errors. The Results Summary window reports that six out of six objectives are valid.

fixed_model_ded_results.png

When you simulate the test case for the Sum block, observe that the test case resolves the error.

fix_design_errors_results.png

In the Results Summary window, click HTML to see detailed analysis report. The software generates a detailed analysis report that opens in the MATLAB® Editor. For the sldvexDetectDesignErrorsExample model, the Design Error Detection Objectives Status chapter of the report provides detailed results for objectives valid showing model objects that did not produce errors.

objectives_statuses_design_error_detection.png

See Also

| | |

Topics