For requirements reviews, design reviews, traceability analysis, or project documentation, you can create links to requirements documents from your model with the Simulink® Requirements™ software. If your model has links to requirements documents, you can also view the links from the generated code.
Note
The requirement links must be associated with a model object. If requirements links are associated with the code in a MATLAB® Function block, they do not appear in generated code comments.
To view requirements from generated code:
From your model, create links to requirements documents.
See, Requirements Management Interface (Simulink Requirements).
For the subsystem for which you want to generate code, specify the following configuration parameters.
Option | Purpose |
---|---|
Include comments | Model information must appear in code comments. |
Generate traceability report | After code is generated, a Code Generation Report must be produced. |
Generate code.
The Code Generation Report opens. The links to requirements documents appear in generated code comments. When you view the code in the Code Generation Report, you can open the links from the comments.