Dead Logic Detection

Before you simulate a model, use dead logic detection to analyze the model for dead logic. In Simulink® Design Verifier™, design error detection for dead logic consists of two analysis options:

  • Dead logic (partial): If you select this option, Simulink Design Verifier analyzes your model without making any approximations, such as rational approximation for floating points, or while loop approximation. For more information, see Approximations. With this option, Simulink Design Verifier does not report active logic or undecided objectives and it may not identify some dead logic in your model.

    This option is available in:

  • Run exhaustive analysis: With this option, Simulink Design Verifier reports active logic in addition to dead logic as well as undecided objectives. This option may in some cases identify or find additional dead logic. The analysis may use approximations and are reported accordingly.

    This option is available in the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane.

Run a Partial Check for Dead Logic

If you are not using the Model Advisor, to detect dead logic:

  1. On the Design Verifier tab, in the Mode section, select Design Error Detection.

  2. Click Error Detection Settings.

  3. In the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane:

    1. Enable the Dead logic (partial) option.

    2. Clear the Run exhaustive analysis option, if it is selected.

  4. To apply these settings, click OK and close the Configuration Parameters dialog box.

  5. Click Detect Design Errors.

Run an Exhaustive Analysis for Dead Logic

  1. On the Design Verifier tab, in the Mode section, select Design Error Detection.

  2. Click Error Detection Settings.

  3. In the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane, enable the Dead logic (partial) and Run exhaustive analysis options.

  4. To apply these settings, click OK and close the Configuration Parameters dialog box.

  5. Click Detect Design Errors.

Run a Dead Logic Analysis and Review Results

This example shows how to detect dead logic in the sldvSlicerdemo_dead_logic example model. Dead logic detection finds the unreachable objectives in the model that cause the model element to remain inactive.

  1. Open the sldvSlicerdemo_dead_logic model.

    open_system('sldvSlicerdemo_dead_logic');
  2. On the Design Verifier tab, in the Mode section, select Design Error Detection.

  3. Click Error Detection Settings.

  4. In the Configuration Parameters dialog box, on the Design Verifier > Design Error Detection pane, enable Dead logic (partial) option and clear Run exhaustive analysis option.

  5. Click Detect Design Errors.

    The software analyzes the model for dead logic and displays the results in the Results Summary window. The result indicates that seven of the 24 objectives were found to be dead logic.

  6. Click Highlight analysis results on model. The dead logic model elements are highlighted in red.

  7. Open the Controller subsystem, and click the OR block highlighted in red. The Result Inspector displays the summary of the dead logic.

    The set input is equal to 1, so the input port 1 of the OR block can only be true. The status implies that the input port 1 false condition is dead logic. Similarly, the input port 2 is unreachable, as the objective never executes and is dead logic.

  8. To view the detailed analysis report, in the Results Summary window, click HTML.

    The report displays the summary of all the results that are dead logic in the model.

    Dead Logic

    The software stores the detailed analysis results in the DeadLogic field in the Simulink Design Verifier Data Files. You can use the data file for further analysis of the results.

Related Topics