Main Content

Check safety-related code generation settings for comments

mathworks.hism.hisl_0038

Dependencies: Simulink® Check™

Usage: High-Integrity System Modeling

Guideline: hisl_0038: Configuration Parameters > Code Generation > Comments

Description

This check verifies that model configuration parameters are set optimally to generate comments in 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.

Modeling ConditionRecommended Action
The code generator does not include comments in the generated code.Include comments for traceability between the code and the mode. Interactively select model configuration parameter Include comments or programmatically set GenerateComments to "on".
The code generator does not include comments for blocks in the generated code.Include block comments for traceability between the code and the model. Interactively select model configuration parameter Simulink block comments or programmatically set "SimulinkBlockComments" to "on".
The code generator does not include comments for eliminated blocks in the generated code.Include comments for eliminated blocks for traceability between the code and the model. Interactively select model configuration parameter Show eliminated blocks or programmatically set ShowEliminatedStatement to "on".
The code generator does not include comments for names of parameter variables and source blocks in the model parameter structure declaration in model_prm.h. Include comments for names of parameter variables and source blocks as comments in the model parameter structure declaration in model_prm.h for traceability between the code and the model. Interactively select model configuration parameter Verbose comments for 'Model default' storage class or programmatically set ForceParamTrailComments to "on".
The code generator does not include comments for requirement descriptions assigned to Simulink blocks in the generated code.Include requirement descriptions assigned to Simulink blocks as comments for traceability between the code and the mode. Interactively select model configuration parameter Requirements in block comments or programmatically set ReqsInCode to "on".
The code generator does not include comments for Stateflow® objects in the generated code. Include Stateflow object comments in the generated code for traceability between the code and the model. Interactively select model configuration parameter Stateflow object comments or programmatically set SFDataObjDesc to "on".
The code generator does not include MATLAB user comments in the generated code.Include MATLAB user comments in generated code for traceability between code and the model. Interactively select model configuration parameter MATLAB user comments or programmatically set MATLABFcnDesc to "on".

Capabilities and Limitations

  • Does not run on library models

  • Does not allow exclusions of blocks or charts

  • Provides auto fix option

  • Does not highlight parameter names in report unless you have an Embedded Coder® license

  • Does not require model compilation

Version History

Introduced in R2018b

expand all