Main Content

Check for dead logic

R2026b

Check ID: mathworks.sldv.deadlogic

Identify logic that stays inactive during simulation.

Description

This check identifies portions of your model that stay inactive during simulation.

You can run a more detailed analysis that identifies both dead logic and active logic using Simulink® Design Verifier™ design error detection. For more information, see Detect Dead Logic Caused by an Incorrect Value (Simulink Design Verifier).

Following the recommendations of this check increases the likelihood of generating MISRA™ C:2012 compliant code for embedded applications, as well as code that complies with the CERT® C and CWE™ standards.

Results and Recommended Actions

ResultRecommended Action
Failed, model incompatible

Resolve the model incompatibility. See:

Also see Handle Model Complexities with Automatic Stubbing (Simulink Design Verifier).

Dead logic found in model

Simulink Design Verifier proved that these decision and condition outcomes cannot occur and are dead logic in the model. Dead logic can also be a side effect of specified constraints on parameters or specified minimum and maximum constraints on input ports. In rare cases, dead logic can result from approximations performed by Simulink Design Verifier. It is possible that there are objectives that this analysis did not decide.

To extend the results of this analysis, use Simulink Design Verifier design error detection to also identify active logic. In the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane, select Dead logic (partial). Alternatively, set DVDetectDeadLogic and DVDetectActiveLogic to "on".

Dead logic not found in modelSimulink Design Verifier did not find dead logic in the model. It is possible that there are objectives that this analysis did not decide. To extend the results of this analysis, use Simulink Design Verifier design error detection to also identify active logic. In the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane, select Dead logic (partial) or set DVDetectDeadLogic and DVDetectActiveLogic to "on".

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content in masked subsystems. The input parameter Look inside masks is always set to all. You can use a filter to exclude specific subsystems. For more information, see Filter Objectives by Using Simulink Design Verifier Filter Explorer (Simulink Design Verifier).

  • Analyzes content of library-linked blocks. The input parameter Follow links is always set to on.

  • Does not support exclusions.

Tips

If a dead logic warning results from a parameter that is intended to be tunable (for example, a parameter with an enumerated data type), configure that parameter for tuning in Simulink Design Verifier. When the parameter is tunable, the dead logic check considers alternative parameter values and can determine whether a previously dead branch is reachable. To configure parameters, use the Automatically infer parameter specification setting or the Parameter table in the Configuration Parameters dialog box to specify possible enumerated values. Then, run the Check for dead logic analysis on the model. For more information, see Create Parameter Configuration for Simulink Design Verifier Analysis (Simulink Design Verifier).

See Also