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.
At the command line, enter
open_system('slvnvdemo_powerwindow_vs')
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 Subsystem2
to the emergencyDown
state:
Double-click on the Model block to open slvnvdemo_powerwindow
.
In the control
chart, right-click the emergencyDown state and select Requirements > Select for Linking with Simulink.
In the slvnvdemo_powerwindow_vs
model, right click Verification Subsystem2
and select Requirements > Add Link to Selected Object.
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.
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 close_system('slvnvdemo_powerwindow_vs',0)