Main Content

Check usage of Abs blocks

mathworks.hism.hisl_0001

Dependencies: Simulink® Check™

Usage: High-Integrity System Modeling

Guideline: hisl_0001: Usage of Abs block

Description

Use this check to inspect usage of the Abs block.

Check Parameters

Use the Model Advisor Configuration Editor to define the scope of the analysis by specifying the input parameters.

ParameterDescription
Follow links

Specify whether to include content of library-linked blocks in the analysis.

on (default) | off

Look under masks

Specify whether to include masked model elements in the analysis.

all (default) | none | graphical | functional

  • all — Check analysis includes all masked model elements.

  • none — Check analysis excludes masked model elements.

  • graphical — Check analysis includes only the graphical masked model elements.

  • functional — Check analysis includes only the functional masked model elements.

Recommended Actions and Results

Review the violations that are flagged by the check and the recommended action for fixing the issue. After applying the changes, save the model and rerun the check analysis.

Modeling ConditionRecommended Action

The model or subsystem contains an Abs block that is operating on one of the following:

  • A boolean or an unsigned input data type. This condition results in unreachable simulation pathways through the model and might result in unreachable code

  • A signed integer value with Saturate on integer overflow check box cleared. For signed data types, the absolute value of the negative value furthest from zero is problematic because it is not representable by the data type. This condition results in an overflow in the generated code.

If the identified Abs block is operating on a boolean or unsigned data type, do one of the following:

  • Change the input of the Abs block to a signed input type.

  • Remove the Abs block from the model.

If the identified Abs block is operating on a signed data type, in the Block Parameters dialog box, on the Signal Attributes tab, select Saturate on integer overflow.

Capabilities and Limitations

  • Does not run on library models

  • Allows exclusions of blocks and charts

  • Analyzes only active variant choices

  • Performs model compilation

Version History

Introduced in R2020a