Including Requirements with Generated Code

Once you finish simulating your model and verifying its performance against the requirements, you might want to use it to generate code for an embedded real-time application. The Simulink Verification and Validation software can include the requirements that you assign to Simulink blocks in generated code for Embedded Real-Time (ERT) targets of the Real-Time Workshop® Embedded Coder™ software.

To specify that requirements be included in the generated code of an ERT target, do the following:

  1. Load the model.

  2. From the Simulink Simulation menu, select Configuration Parameters.

  3. In the Select pane of the Configuration Parameters dialog box, select the Real-Time Workshop node.

    The currently configured system target must be an ERT target, as shown.

  4. In the Select pane, under Real-Time Workshop, select Comments.

  5. In the Custom comments section on the right, select the Requirements in block comments check box, as shown.

Requirement descriptions are included with generated code in the following locations.

Model Element

Requirement Description 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 has no 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

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS