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 Condition | Recommended 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
. | Include comments for names of parameter variables and source blocks as comments
in the model parameter structure declaration in
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 R2018bSee Also
Model Configuration Parameters: Comments (Simulink Coder)
Topics
- Check Your Model Using the Model Advisor
- Address Model Check Results
- Save and View Model Advisor Check Reports
- Improve Simulation Performance Using Performance Advisor
- Upgrade Models Using Upgrade Advisor
- Use Model Advisor Configuration Editor to Customize Model Advisor
- Exclude Blocks from Model Advisor Check Analysis
- Justify Model Advisor Violations from Check Analysis
- Check Model Compliance Using Edit-Time Checking
- Configure Code Comments (Simulink Coder)