| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Verification and Validation |
| Contents | Index |
| Learn more about Simulink Verification and Validation |
After you simulate your model and verify its performance against the requirements, you can generate code from the model for an embedded real-time application.
The Real-Time Workshop® Embedded Coder™ software generates code for Embedded Real-Time (ERT) targets. If the model has any links to requirements, while generating the code, the software also inserts hyperlinks to any linked requirements documents in the code comments.
For example, if a block has a requirement, the Real-Time Workshop Embedded Coder software generates code for that block. In the code comments for that block, the software inserts a hyperlink to the requirements document that contains the requirement associated with that block.
Note You must have a license for Real-Time Workshop Embedded Coder to generate code for an embedded real-time application. |
Generated code includes requirements descriptions and hyperlinks to the requirements documents in the following locations.
Model Object | Requirements Location |
|---|---|
Model | 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 appear in the main header file for the model, <model>.h. |
Nonsubsystem blocks | In the generated code for the block |
To specify that generated code of an ERT target include requirements:
In the Configuration Parameters dialog box, on the Select pane, select the Real-Time Workshop node.
The currently configured system target must be an ERT target.

In the Custom comments section on the right, select the Requirements in block comments check box.
Under Real-Time Workshop, select Report.
On the Report pane, select:
Create code generation report
Launch report automatically
On the Real-Time Workshop pane, click Build.
In the code-generation report, open rtwdemo_requirements.c.
Scroll to the code for the Pulse Generator block, clock, for the hyperlink to the requirement linked to that block.

Click the link to open the requirements document.
![]() | Using the System Requirements Block in a Model | Managing Requirements with DOORS Software | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |