主要内容

hisl_0017: Usage of blocks that compute relational operators (2)

R2026b

Configure relational operator blocks to produce unambiguous behavior in generated code

Usage: High-Integrity System Modeling

Guideline ID: hisl_0017

Rules

hisl_0017: Usage of blocks that compute relational operators (2)
A

To support unambiguous behavior in the generated code, when using blocks that compute relational operators, including Relational Operator, Compare To Constant, Compare to Zero, and Detect Change, set block parameter Output data type to Boolean.

Rationale

Support generation of code that produces unambiguous behavior.

Verification

Check usage of Relational Operator blocks (Simulink Check)

B

For Relational Operator blocks, verify that input signals are of the same data type.

Rationale

Support generation of code that produces unambiguous behavior.

Verification

Check usage of Relational Operator blocks (Simulink Check)

Industry Standards

  • IEC 61508-3, Table A.3 (2) 'Strongly typed programming language'

    IEC 61508-3, Table A.3 (3) 'Language subset'

    IEC 61508-3, Table A.4 (3) 'Defensive programming'

  • IEC 62304, 5.5.3 - Software Unit acceptance criteria

  • ISO 26262-6, Table 1 (1b) 'Use of language subsets'

    ISO 26262-6, Table 1 (1c) 'Enforcement of strong typing'

  • EN 50128, Table A.4 (11) 'Language Subset'

    EN 50128, Table A.4 (8) 'Strongly Typed Programming Language'

    EN 50128, Table A.3 (1) 'Defensive Programming'

  • EN 50657, Table A.4 (11) 'Language Subset'

    EN 50657, Table A.4 (8) 'Strongly Typed Programming Language'

    EN 50657, Table A.3 (1) 'Defensive Programming'

  • EN 50716, Table A.3 (1) 'Defensive Programming'

  • DO-331, Section MB.6.3.2.g 'Algorithms are accurate'

  • MISRA C:2012, Rule 10.1

  • MISRA C:2023, Rule 10.1

Version History

Introduced in R2010a

expand all