Analyze an Export-Function Model with Function-Call Subsystems
This example shows how you can analyze a model which consists of periodic
function-call subsystems. This example uses the AUTOSAR example model sldvExportFunction_autosar_multirunnables
.
Add the example folder to the search path.
addpath(fullfile(docroot,'toolbox','sldv','examples'));
Open the
sldvExportFunction_autosar_multirunnables
model.open_system('sldvExportFunction_autosar_multirunnables');
To run the test generation analysis, on the Design Verifier tab, click Generate Tests.
The Simulink® Design Verifier™ Results Summary window indicates that a scheduler model
sldvExportFunction_autosar_multirunnables_SldvScheduler.slx
is created. You can also generate a scheduler model by usingsldvextract
.The scheduler model consists of a MATLAB function block
_SldvExportFcnScheduler
. The function calls are called periodically as the model consists of periodic function-call subsystem.The MATLAB code specifies the order in which the periodic function-call execute.
Runnable1
andRunnable2
executes first because the time period is1
for both of them. After10
time steps,Runnable3
executes.If the model consists of aperiodic function-call subsystems, the scheduler consists of an additional inport
FcnTriggerPort
. The value ofFcnTriggerPort
indicates whether to invoke the function-call in a time step.For example, if
Runnable1
is an aperiodic function-call subsystem, theFcnTriggerPort
Inport block invokes the scheduler model. This graphic shows the Timing Legend window and the scheduler model for an aperiodic function-call.After the test generation analysis, in the Simulink Design Verifier Results Summary window, you see the results that
7/7
objectives areSatisfied
.To simulate the test cases and generate a coverage report, click Simulate tests and produce a model coverage report in the Simulink Design Verifier Results Summary window.
The software simulates the test cases, collects model coverage information, and displays a coverage report.
To view the detailed analysis report, click HTML in the Simulink Design Verifier Results Summary window.
The Schedule for Export Function Analysis section in the Analysis Information chapter lists the schedule for invoking the export functions.
Schedule for Export Function Analysis