Requirements in block comments
Include requirement descriptions in generated comments
Model Configuration Pane: Code Generation / Comments
Description
Specify whether to include requirement descriptions assigned to Simulink® blocks in generated code as comments.
Dependencies
This parameter only appears for ERT-based targets.
This parameter requires Embedded Coder® and Requirements Toolbox™ licenses when generating code.
Settings
off
(default) | on
- On
Inserts the requirement descriptions that you assign to Simulink blocks into the generated code as comments. The code generator includes the requirement descriptions in the generated code in the following locations.
Model Element
Requirement Description Location
Model
In the main header file
model
.hNonvirtual subsystems
At the call site for the subsystem
Virtual subsystems
At the call site of the closest nonvirtual parent subsystem. If a virtual subsystem does not have a nonvirtual parent, requirement descriptions are located in the main header file for the model,
.model
.hNonsubsystem blocks
In the generated code for the block
For information on code generator treatment of strings that are unrepresented in the character set encoding for the model, see Internationalization and Code Generation.
- Off
Suppresses the generation of comments for block requirement descriptions.
Tips
If you use an external .slmx
file to store your requirement links, to avoid stale comments in generated code, before code generation, you must save any change in your requirement links.
Recommended Settings
Application | Setting |
---|---|
Debugging | On |
Traceability | On |
Efficiency | Noimpact |
Safety precaution | No recommendation |
Programmatic Use
Parameter: ReqsInCode |
Type: character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced before R2006a