Main Content

Check safety-related code generation settings for comments

Check ID: mathworks.hism.hisl_0038

Check model configuration for code generation settings that can impact safety.

Description

This check verifies that model configuration parameters for code generation are set optimally for a safety-related application.

This check requires Simulink® Check™ license.

Results and Recommended Actions

ConditionRecommended Action
The option to include comments in the generated code is cleared. Comments provide good traceability between the code and the model.Select configuration parameter Include comments (Simulink Coder).
The option to include comments that describe the code for blocks is cleared. Comments provide good traceability between the code and the model. Select configuration parameter Simulink block comments (Simulink Coder).
The option to include comments that describe the code for blocks eliminated from a model is cleared. Comments provide good traceability between the code and the model. Select configuration parameter Show eliminated blocks (Simulink Coder).
The option to include the names of parameter variables and source blocks as comments in the model parameter structure declaration in model_prm.h is cleared. Comments provide good traceability between the code and the model. Select configuration parameter Verbose comments for 'Model default' storage class (Simulink Coder).
The option to include requirement descriptions assigned to Simulink blocks as comments is cleared. Comments provide good traceability between the code and the model. Select configuration parameter Requirements in block comments (Embedded Coder).
The option to include Stateflow® object comments is cleared. Comments provide good traceability between the code and the model. Requires Stateflow license.Select configuration parameter Stateflow object comments (Simulink Coder).
The option to include MATLAB® source code as comments is cleared. Comments provide good traceability between the code and the model. Requires Stateflow license.Select configuration parameter MATLAB source code as comments (Simulink Coder)

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 without Embedded Coder®.

Revision History

R2024a - Added configuration parameters Stateflow object comments (Simulink Coder) and MATLAB source code as comments (Simulink Coder).

See Also