MATLAB Examples

Link to Requirements Modeled in Simulink

You can use Simulink to model your design requirements. For example, you can use verification blocks to specify desired system properties and model the design requirements. The Requirements Management Interface (RMI) allows you to create navigation links between the requirements modeled in Simulink, the associated Simulink objects, and related test cases. This example shows how to use the RMI to create and view links to requirements modeled in Simulink.


Open Example Model

Open the Power Window Controller model by typing the command:


Verification Subsystems for Power Window Controller Model

Open the verification model, 'Power Window Controller Temporal Property Specification'. This model specifies properties and requirements of the slvnvdemo_powerwindowController model.

Consider the following design requirements for the controller:

  1. Requirement 1 (Obstacle Response) - Whenever an obstacle is detected, the controller shall give the down command for one second. This requirement is modeled in Verification Subsystem2.
  2. Requirement 2 (Autodown feature) - If the driver presses the down button for less than 1 second, the controller keeps issuing the down command until the end has been reached, or the driver presses the up button. This requirement is modeled in Verification Subsystem3

See Design Verifier Temporal Properties example for more details.


Create RMI Link to a Simulink Object

Create an RMI link from Verification Subsystem2 to the emergencyDown state in the slvnvdemo_powerwindowController model.

  1. Open slvnvdemo_powerwindowController model.
  2. Right-click on emergencyDown state and select Requirements Traceability > Select for linking with Simulink.
  3. Right-click on Verification Subsystem2 and select Requirements Traceability > Add link to selected object.
  4. Right-click the Verification Subsystem2. The new RMI link appears at the top of Requirements Traceability submenu.
  5. Close slvnvdemo_powerwindowController model.
  6. Right-click on Verification Subsystem2. Navigate the new link at the top of the Requirements Traceability submenu. Model opens and emergencyDown state is highlighted.

Link Simultaneously to Multiple Simulink Objects

You can link to a multiple selection of Simulink objects. Use the Shift key to select all the following objects as in figure below.

  1. Right-click on this group of objects, select Requirements Traceability > Select for linking with Simulink. Be careful to not lose the selections when you right-click.
  2. Right-click on Verification Subsystem3 and select Requirements Traceability > Link to 4 selected objects.

Link to a Group of Simulink Objects

  1. Right-click on NAND block in Global Assumptions and select Requirements Traceability > Select for linking with Simulink.
  2. Drag the mouse across endstop and obstacle inputs in slvnvdemo_powerwindowController to select both inputs.
  3. Right-click on this group of objects and select Add link to selected object. Be careful to not lose the selection.
  4. Click on the background of slvnvdemo_powerwindowController to clear the group selection.
  5. Right-click each input and select Requirements Traceability to display new links. Click the new link, confirm that NAND is highlighted.

Create Links for Navigation in Both Directions

To create links for navigation in both directions:

  1. Open Requirements Settings dialog box.
  2. Select the Selection Linking tab.
  3. Enable Modify destination for bidirectional linking.

Now, when you create a link from one Simulink object to another, a corresponding "return" link is also created.

Highlight and Report RMI Links Between Simulink Objects

Create RMI links to Simulink objects in the same way as links to external documents:

  1. In the slvnvdemo_powerwindow_vs model window, select Analysis > Requirements Traceability > Highlight Model to highlight all RMI links in the model, including links to Simulink objects.
  2. In the slvnvdemo_powerwindow_vs model window, select Analysis > Requirements Traceability > Generate Report.
  3. In the generated report, click a hyperlink in any requirements table. This navigates to the corresponding object in Simulink diagram.


Close all open models. Do not save changes.

close_system('slvnvdemo_powerwindowController', 0);
close_system('slvnvdemo_powerwindow_vs', 0);