Main Content

hisl_0061: Unique identifiers for clarity

R2026b

Use unique identifiers for signals and across scopes within a chart

Usage: High-Integrity System Modeling

Guideline ID: hisl_0061

Rules

hisl_0061: Unique identifiers for clarity
A

When developing a model, use unique identifiers for Simulink® signals.

Rationale

Improve readability of a graphical model and mapping between identifiers in the model and generated code.

Verification

Check Stateflow charts for uniquely defined data objects (Simulink Check)

B

When developing a model, define unique identifiers across multiple scopes within a chart.

Rationale

Improve readability of a graphical model and mapping between identifiers in the model and generated code.

Verification

Check Stateflow charts for uniquely defined data objects (Simulink Check)

Example — Correct

To clarify the model, create unique identifiers. In the following example, state Scope_1 uses local identifier IntCounter_Scope_1. State Scope_2 uses local identifier IntCounter_Scope_2.

States showing unique, local identifiers.

The identifier IntCounter_Scope_1 is defined for state Scope_1. Identifier IntCounter_Scope_2 is defined for Scope_2.

Definition of local identifier IntCounter_Scope_1 in Scope_1

Definitions of local identifier IntCounter_Scope_2 in Scope_2

Example — Incorrect

In the following example, two states Scope_1 and Scope_2 use local identifier IntCounter.

Two states that use the same local identifier.

The identifier IntCounter is defined for two states, Scope_1 and Scope_2.

Definition of local identifier IntCounter in Scope_1

Definition of local identifier IntCounter in Scope_2

Tips

  • The code generator resolves conflicts between identifiers so that symbols in the generated code are unique. The process is called name mangling.

Industry Standards

  • DO-331, Section MB.6.3.2.b 'Low-level requirements are accurate and consistent'

  • 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 (5) - Design and coding standards

  • IEC 62304, 5.5.3 - Software Unit acceptance criteria

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

  • ISO 26262-6, Table 1 (1e) - 'Use of well-trusted design principles'

  • ISO 26262-6, Table 1 (1f) - 'Use of unambiguous graphical representation'

  • ISO 26262-6, Table 1 (1g) - 'Use of style guides'

  • ISO 26262-6, Table 1 (1h) - 'Use of naming conventions'

  • ISO 26262-6, Table 6 (1d) - 'No multiple use of variable names'

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

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

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

  • EN 50128, Table A.12 (1) 'Coding Standard'

  • EN 50128, Table A.12 (2) 'Coding Style Guide'

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

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

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

  • EN 50657, Table A.12 (1) 'Coding Standard'

  • EN 50657, Table A.12 (2) 'Coding Style Guide'

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

  • EN 50716, Table A.12 (1) 'Coding Standard'

  • EN 50716, Table A.12 (2) 'Coding Style Guide'

Version History

Introduced in R2010b

expand all

See Also

(Embedded Coder)