Main Content

Configuration Settings

hisl_0060: Configuration parameters that improve MISRA C:2012 compliance

ID: Titlehisl_0060: Configuration parameters that improve MISRA C:2012 compliance
Description

Set these model configuration parameters as specified:

  • System target file as an ERT-based target

  • Use division for fixed-point net slope computation to On or Use division for reciprocals of integers only.

  • Inf or NaN block output to warning or error.

  • Model Verification block enabling to Disable All

  • Undirected event broadcasts to error.

  • Wrap on overflow to warning or error.

  • Production hardware signed integer division rounds to to Zero or Floor

  • Compile-time recursion limit for MATLAB functions to 0.

  • Casting Modes to Standards Compliant.

  • Code replacement library to None or AUTOSAR 4.0

  • Maximum identifier length to the implementation dependent limit. The default is 31.

  • Parentheses level to Standards(Parentheses for Standards Compliance) or Maximum(Specify precedence with parentheses).

  • Shared code placement to Shared location.

  • Language standard to C89/C90 (ANSI) or C99 (ISO), depending on the toolchain.

  • Bitfield declarator type specifier to uint_T when any of these parameters are selected:

    • Pack Boolean data into bitfields

    • Use bitsets for storing state configuration

    • Use bitsets for storing Boolean data

Select (on) these configuration parameters:

  • Include Comments

  • MATLAB user comments

  • Preserve static keyword in function declarations (Select only when configuration parameter File packaging format is set to Compact or CompactWithDataFile.)

Deselect (off) these configuration parameters:

  • Shift right on a signed integer as arithmetic shift

  • Dynamic memory allocation in MATLAB functions

  • Enable run-time recursion for MATLAB functions

  • External mode

  • Generate shared constants

  • MAT-file logging

  • Replace multiplications by powers of two with signed bitwise shifts

  • Support complex numbers (Only if you do not need complex number support)

  • Support continuous time

  • Support non-finite numbers

  • Support non-inlined S-functions

  • Suppress generation of default cases for switch statements if unreachable

  • Use dynamic memory allocation for model initialization (Keep this parameter selected only when configuration parameter Code Interface Packaging is set to Reusable Function.

RationaleImprove MISRA C:2012 compliance of the generated code.
Model Advisor Checks

Check configuration parameters for MISRA C:2012 (Simulink Check).

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

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

  • Table 6 (1b) - 'No dynamic objects or variables, or else online test during their creation'

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

  • MISRA C:2012

  • EXP33-C. Do not read uninitialized memory

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

    DO-331, Section MB.6.3.2.c ‘Low-level requirements are compatible with target computer

    DO-331, Section MB.6.3.2.e – ‘Low-level requirements conform to standards’

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

    DO-331, Section MB.6.3.3.b – Software architecture is consistent

    DO-331 MB.6.3.3.c ‘Compatibility with Target Computer’

    DO-331, Section MB.6.3.3.d 'Software architecture is verifiable'

    DO-331, MB.6.3.3.e 'Software architecture conforms to standards’

Last ChangedR2024a