Main Content

Check safety-related optimization settings for data type conversions

Check ID: mathworks.hism.hisl_0053

Check model configuration for optimization settings that can impact safety.


This check verifies that model optimization configuration parameters are set optimally for generating code for a safety-related application. Although highly optimized code is desirable for most real-time systems, some optimizations can have undesirable side effects that impact safety.

Available with Simulink® Check™.

Results and Recommended Actions

ConditionRecommended Action
The optimization that suppresses generation of code resulting from floating-point to integer conversions that wrap out-of-range values is cleared. You must avoid overflows for safety-related code. When this optimization is off and your model includes blocks that disable the Saturate on overflow parameter, the code generator wraps out-of-range values for those blocks. This can result in unreachable and, therefore, untestable code. If you have a Simulink Coder™ license, select Configuration Parameter Remove code from floating-point to integer conversions that wraps out-of-range values (Simulink Coder) or set the parameter EfficientFloat2IntCast to on.

Action Results

Clicking Modify Settings configures model optimization settings that can impact safety.

Subchecks depend on the results of the subchecks noted with D in the results table in the Model Advisor window.

Capabilities and Limitations

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

  • Does not highlight parameter names in report without Embedded Coder®.

See Also