Main Content

Requirements in block comments

Include requirement descriptions in generated comments

Model Configuration Pane: Code Generation / Comments


Specify whether to include requirement descriptions assigned to Simulink® blocks in generated code as comments.


  • This parameter only appears for ERT-based targets.

  • This parameter requires Embedded Coder® and Requirements Toolbox™ licenses when generating code.


off (default) | 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


In the main header file model.h

Nonvirtual 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.h.

Nonsubsystem 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.


Suppresses the generation of comments for block requirement descriptions.


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

Safety precaution

No recommendation

Programmatic Use

Parameter: ReqsInCode
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced before R2006a