Main Content

Check safety-related code generation interface settings

mathworks.hism.hisl_0039

Dependencies: Simulink® Check™

Usage: High-Integrity System Modeling

Guideline: hisl_0039: Configuration Parameters > Code Generation > Interface

Description

This check verifies that the model configuration uses optimal parameter settings for generating code for a safety-related application.

Recommended Actions and Results

Review the violations that are flagged by the check and the recommended action for fixing the issue. After applying the changes, save the model and rerun the check analysis.

If you consider the flagged violation to either not be relevant or not feasible for your design, use the Justify button to provide rationale as to why the violation is either not relevant or not feasible for your design.

You can use the Fix button to allow the Model Advisor to fix all flagged violations. For this check, the Model Advisor configures model code generation settings that can impact safety.

Modeling ConditionRecommended Action
Code generation is configured to generate nonfinite data and operations. Support for nonfinite numbers is inappropriate for real-time safety-related systems.Clear Support: non-finite numbers (Simulink Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter SupportNonFinite to 'off'.
Code generation is configured to support blocks that use continuous time. Support for continuous time is inappropriate for real-time safety-related systems.Clear Support: continuous time (Embedded Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter SupportContinuousTime to 'off'.
Code generation is configured to support non-inlined S-functions. This option requires support of nonfinite numbers, which is inappropriate for real-time safety-related systems.Clear Support non-inlined S-functions (Embedded Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter SupportNonInlinedSFcns to 'off'.
Code generation is configured to generate model function calls compatible with the main program module of the pre-R2012a GRT target. This option is inappropriate for real-time safety-related systems.Clear Classic call interface (Simulink Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter GRTInterface to 'off'.
Code generation is not configured to generate the model_update function. Having a single call to the output and update functions simplifies the interface to the real-time operating system and simplifies verification of the generated code.Select Single output/update function (Simulink Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter CombineOutputUpdateFcns to 'on'.
Code generation is configured to generate the model_terminate function. This function deallocates dynamic memory, which is unsuitable for real-time safety-related systems.Clear Terminate function (Embedded Coder) on the Code Generation pane in the Configuration Parameters dialog box or set the parameter IncludeMdlTerminateFcn to 'off'.
Code generation is configured to not log or monitor the error status. If you do not select this option, Simulink Coder™ can generate extra code that is not reachable for testing.Select Remove error status field in real-time model data structure (Embedded Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter SuppressErrorStatus to 'on'.
Code generation is configured to log to a MAT-file. This option adds extra code for logging test points to a MAT-file, which is not supported by embedded targets. Use this option only in test harnesses.Clear MAT-file logging (Simulink Coder) on the Code Generation > Interface pane in the Configuration Parameters dialog box or set the parameter MatFileLogging to 'off'.

Capabilities and Limitations

  • Does not require model compilation

  • Does not run on library models

  • Does not allow exclusions of blocks or charts

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

Version History

Introduced in R2020a

expand all