Quantcast

Documentation Center

  • Trial Software
  • Product Updates

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 modelPower Window Controller model by typing the command:

open_system('slvnvdemo_powerwindowController');
Loading RMI data from /mathworks/devel/bat/R2014ad/build/matlab/toolbox/slvnv/rmidemos/powerwin_reqs/slvnvdemo_powerwindowRequirements.req

Verification Subsystems for Power Window Controller Model

Open the verification model, 'Power Window Controller Temporal Property Specification''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 Subsystem2Verification 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 Subsystem3Verification Subsystem3

See Design Verifier Temporal Properties exampleDesign Verifier Temporal Properties example for more details.

open_system('slvnvdemo_powerwindow_vs');

Create RMI Link to a Simulink Object

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

  1. Open slvnvdemo_powerwindowController modelOpen slvnvdemo_powerwindowController model.

  2. Right-click on emergencyDown stateemergencyDown state and select Requirements > Select for linking with Simulink.

  3. Right-click on Verification Subsystem2Verification Subsystem2 and select Requirements > Add link to selected object.

  4. Right-click the Verification Subsystem2Verification Subsystem2. The new RMI link appears at the top of Requirements submenu.

  5. Close slvnvdemo_powerwindowController modelClose slvnvdemo_powerwindowController model.

  6. Right-click on Verification Subsystem2Verification Subsystem2. Navigate the new link at the top of the Requirements 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 > Select for linking with Simulink. Be careful to not lose the selections when you right-click.

  2. Right-click on Verification Subsystem3Verification Subsystem3 and select Requirements > Link to 4 selected objects.

Link to a Group of Simulink Objects

  1. Right-click on NAND blockNAND block in Global Assumptions and select Requirements > Select for linking with Simulink.

  2. Drag the mouse across endstopendstop and obstacleobstacle 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 to display new links. Click the new link, confirm that NANDNAND is highlighted.

Create Links for Navigation in Both Directions

To create links for navigation in both directions:

  1. Open Requirements SettingsOpen Requirements Settings dialog box.

  2. Select the Selection Linking tab.

  3. Enable Modify destination for bi-directional 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 windowslvnvdemo_powerwindow_vs model window, select Analysis > Requirements > Highlight Model to highlight all RMI links in the model, including links to Simulink objects.

  2. In the slvnvdemo_powerwindow_vs model windowslvnvdemo_powerwindow_vs model window, select Analysis > Requirements > Generate Report.

  3. In the generated report, click a hyperlink in any requirements table. This navigates to the corresponding object in Simulink diagram.

Cleanup

Close all open models. Do not save changes.

close_system('slvnvdemo_powerwindowController', 0);
close_system('slvnvdemo_powerwindow_vs', 0);
Was this topic helpful?