Contents

Optimizations

hisl_0045: Configuration Parameters > Optimization > Implement logic signals as Boolean data (vs. double)

ID: Titlehisl_0045: Configuration Parameters > Optimization > Implement logic signals as Boolean data (vs. double)
Description

To support unambiguous behavior when using logical operators, relational operators, and the Combinatorial Logic block,

ASelect Implement logic signals as Boolean data (vs. double) in the Optimization pane of the Configuration Parameters dialog box.
Notes

Selecting the Implement logic signals as Boolean data (vs. double) parameter, enables Boolean type checking, which produces an error when blocks that prefer Boolean inputs connect to double signals. This checking results in generating code that requires less memory.

RationaleAAvoid ambiguous model behavior and optimize memory for generated code.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

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

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

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

  • DO-331, MB.6.3.1.e 'High-level requirements conform to standards'
    DO-331, MB.6.3,2.e 'Low-level requirements conform to standards'

  • MISRA-C:2004, Rule 12.6

Last ChangedR2013b

hisl_0046: Configuration Parameters > Optimization > Block reduction

ID: Titlehisl_0046: Configuration Parameters > Optimization > Block reduction
Description

To support unambiguous presentation of the generated code and support traceability between a model and generated code,

 AClear the Block reduction parameter on the Optimization pane of the Configuration Parameters dialog box.
Notes

Selecting Block reduction might optimize blocks out of the code generated for a model. This results in requirements without associated code and violates traceability objectives.

RationaleASupport unambiguous presentation of generated code.
 ASupport traceability between a model and generated code.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

References
  • IEC 61508-3, Clauses 7.4.7.2, 7.4.8.3, and 7.7.2.8 which require to demonstrate that no unintended functionality has been introduced

  • DO-331, Section MB.6.3.4.e ‘Source code is traceable to low-level requirements'

See AlsoBlock reduction in the Simulink® documentation
Last ChangedR2012b

hisl_0048: Configuration Parameters > Optimization > Application lifespan (days)

ID: Titlehisl_0048: Configuration Parameters > Optimization > Application lifespan (days)
Description

To support the robustness of systems that run continuously, in the Configuration Parameters dialog box, on the Optimization pane:

ASet Application lifespan (days) to inf.
Notes

Embedded applications might run continuously. Do not assume a limited lifespan for timers and counters. . When you set Application lifespan (days) to inf, the simulation time is less than the application lifespan.

RationaleASupport robustness of systems that run continuously.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

References
  • IEC 61508-3, Table A.4 (3) 'Defensive Programming'

  • ISO 26262-6, Table 1 (d) 'Use of defensive implementation techniques'

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

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

See Also
Last ChangedR2013b

hisl_0051: Configuration Parameters > Optimization > Signals and Parameters > Loop unrolling threshold

ID: Titlehisl_0051: Configuration Parameters > Optimization > Signals and Parameters > Loop unrolling threshold
Description

To support unambiguous code, set the minimum signal or parameter width for generating a for loop. In the Configuration Parameters dialog box, on the Optimization > Signals and Parameters pane,

ASet Loop unrolling threshold to 2 or greater.
BIf Pack Boolean data into bitfields is selected, set Bitfield declarator type specifier to uint_T.
Notes

The Loop unrolling threshold parameter specifies the array size at which the code generator begins to use a for loop, instead of separate assignment statements, to assign values to the elements of a signal or parameter array. The default value is 5.

RationaleASupport unambiguous generated code.
References
  • IEC 61508-3, Table A.3 (3) 'Language Subset'

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

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

  • MISRA-C:2004, Rule 6.4

See Also

Loop unrolling threshold in the Simulink documentation

Last ChangedR2013b

hisl_0052: Configuration Parameters > Optimization > Data initialization

ID: Titlehisl_0052: Configuration Parameters > Optimization > Data initialization
Description

To support complete definition of data and initialize internal and external data to zero, in the Configuration Parameters dialog box, on the Optimization pane,

AClear Remove root level I/O zero initialization.
BClear Remove internal data zero initialization.
Note

Explicitly initialize all variables. If the run-time environment of the target system provides mechanisms to initialize all I/O and state variables, consider using the initialization of the target as an alternative to the suggested settings.

RationaleA, BSupport fully defined data in generated code.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

References
  • IEC 61508-3, Table A.4 (3) 'Defensive Programming'

  • ISO 26262-6, Table 1 (d) 'Use of defensive implementation techniques'

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

  • MISRA-C:2004, Rule 9.1

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

See Also

Information about the following parameters in the Simulink documentation:

Last ChangedR2013b

hisl_0053: Configuration Parameters > Optimization > Remove code from floating-point to integer conversions that wraps out-of-range values

ID: Titlehisl_0053: Configuration Parameters > Optimization > Remove code from floating-point to integer conversions that wraps out-of-range values
Description

To support verifiable code, In the Configuration Parameters dialog box, on the Optimization pane,

AConsider selecting Remove code from floating-point to integer conversions that wraps out-of-range values.
Notes

Avoid overflows as opposed to handling them with wrapper code. For blocks that have the parameter Saturate on overflow cleared, clearing Remove code from floating-point to integer conversions that wraps out-of-range values might add code that wraps out of range values, resulting in unreachable code that cannot be tested.

RationaleASupport generation of code that can be verified.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

References
  • IEC 61508-3, Table A.4 (3) 'Defensive Programming'

  • ISO 26262-6, Table 1 (d) 'Use of defensive implementation techniques'

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

  • MISRA-C:2004, Rule 14.1

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

See AlsoRemove code from floating-point to integer conversions that wraps out-of-range values in the Simulink documentation
Last ChangedR2013b

hisl_0054: Configuration Parameters > Optimization > Remove code that protects against division arithmetic exceptions

ID: Titlehisl_0054: Configuration Parameters > Optimization > Remove code that protects against division arithmetic exceptions
Description

To support the robustness of the operations, in the Configuration Parameters dialog box, on the Optimization pane,

AClear Remove code that protects against division arithmetic exceptions.
Note

Avoid division-by-zero exceptions. If you clear Remove code that protects against division arithmetic exceptions, the code generator produces code that guards against division by zero for fixed-point data.

RationaleAProtect against divide-by-zero exceptions for fixed-point code.
Model Advisor Checks

By Task > Modeling Standards for DO-178C/DO-331 > Check safety-related optimization settings

References
  • IEC 61508-3, Table A.3 (3) 'Language Subset'
    IEC 61508-3 Table A.4 (3) 'Defensive Programming'

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

  • EN 50128, Table A.4 (11) 'Language Subset'
    EN 50128, Table A.3 (1) 'Defensive Programming'

  • MISRA-C:2004, Rule 21.1

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

See AlsoRemove code that protects against division arithmetic exceptions in the Simulink documentation
Last ChangedR2013b

hisl_0055: Prioritization of code generation objectives for high-integrity systems

ID: Titlehisl_0055: Prioritized configuration objectives for high-integrity systems
DescriptionPrioritize objectives for high-integrity systems using the Code Generation Advisor by:
AAssigning the highest priority to the high-integrity and traceability objectives (Safety precaution and Traceability)
BConfiguring the Code Generation Advisor to run before generating code by setting Check model before generating code to On (proceed with warnings) or On (stop for warnings).
Notes

Model configuration parameters provide control over many aspects of generated code. The prioritization of objectives specifies how configuration parameters are set when conflicts between objectives occur.

Including the ROM, RAM, and Execution efficiency objectives with a lower priority in the list enables efficiency optimizations that do not conflict with Safety precaution and Traceability in the active configuration.

Review the resulting parameter configurations to verify that safety requirements are met.

RationaleA, B

When you use the Code Generation Advisor, configuration parameters conform to the objectives that you want and they are consistently enforced.

References
  • DO-331, Section MB.6.3.4.e 'Source code is traceable to low-level requirements'

  • IEC61508–3, Table A.3 (3) 'Language Subset'
    IEC 61508–3, Table A.4 (3) 'Defensive Programing'

  • ISO 26262–6, Table 1(b) 'Use of language subsets'
    ISO 26262–6, Table 1(d) 'Use of defensive implementation techniques'

  • EN 50128, Table A.4 (11) 'Language Subset'
    EN 50128, Table A.3 (1) 'Defensive Programming'

See also

Last ChangedR2014a

Was this topic helpful?