Requirements in block comments
Description
Specify whether to include requirement descriptions assigned to Simulink® blocks in generated code as comments.
Category: Code Generation > Comments
Settings
Default: Off
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.
Dependency
This parameter only appears for ERT-based targets.
This parameter requires Embedded Coder® and Requirements Toolbox™ licenses when generating code.
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.
Command-Line Information
Parameter:
ReqsInCode |
Type: character vector |
Value:
'on' | 'off' |
Default:
'off' |
Recommended Settings
Application | Setting |
---|---|
Debugging | On |
Traceability | On |
Efficiency | Noimpact |
Safety precaution | No recommendation |