Main Content

Link to Requirements Modeled in Simulink

This example shows how to link between verification subsystems and models. You can use verification subsystems to model functional requirements and verify them in simulation. Traceability between the verification and implementation models allow you to summarize analysis and test results in the Requirements Editor .

The Verification and Design Models

At the command line, enter


The verification model specifies properties and requirements for slvnvdemo_powerwindowController. The verification subsystems include logic that verifies system behavior when an obstacle is detected:

  • Obstacle Response: When an obstacle is detected, the controller shall give the down command for 1 second.

The requirement is modeled in Verification Subsystem2.

open_system('slvnvdemo_powerwindow_vs/Verification Subsystem2')

  • In the design model, the obstacle response is implemented in the emergencyDown state:

Link from Verification to Design Model

Link from Verification Subsystem2 to the emergencyDown state:

  1. Double-click on the Model block to open slvnvdemo_powerwindow.

  2. In the control chart, right-click the emergencyDown state and select Requirements > Select for Linking with Simulink.

  3. In the slvnvdemo_powerwindow_vs model, right click Verification Subsystem2 and select Requirements > Add Link to Selected Object.

  4. In the slvnvdemo_powerwindow_vs model, open the Requirements Manager app. A badge appears on Verification Subsystem2, indicating a link, and the link appears in the Property Inspector.

  5. Change the link type to Verifies. Next to the link in the Property Inspector, click the Show in Links View icon. Select the link in the table, then change the link property Type from Implements to Verifies.


These commands unload requirements sets and close open models.

slreq.clear; % Closes open requirements sets without saving changes