Detect Dead Logic
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
Result | Recommended Action |
---|---|
Failed, model incompatible | Resolve the model incompatibility. See:
Also see Handle Incompatibilities 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. From
the Simulink Editor, select Apps > Design Verifier > Settings. In the Configuration Parameters
window, from Design Verifier > Design Error Detection pane, select Dead logic (partial) or
set DVDetectDeadLogic and
DVDetectActiveLogic to on . |
Dead logic not found in model | Simulink
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. From
the Simulink Editor, select Apps > Design Verifier > Settings. In the Configuration Parameters
window, from 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. By default, the input parameter Look under masks is set to
all
.Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to
on
.Does not support exclusions.
See Also
MISRA C:2012: Rule 2.1
CERT C, MSC07-C
CWE, CWE-561
Secure Coding (Embedded Coder)
Detect Dead Logic Caused by an Incorrect Value (Simulink Design Verifier)
Design Verifier Pane: Design Error Detection (Simulink Design Verifier)
hisl_0101: Prevent operations that result in dead logic to improve code compliance