Main Content

Analyze Export-Function Models

Simulink® Design Verifier™ supports design error detection, test generation, and property proving for export-function models. The software creates schedulers that invoke the export-function models, and then performs the analysis on the scheduler model. You can analyze export-function models with periodic and aperiodic function-call groups. The scheduler invokes the function calls based on the sample times and priorities set in the top model. For more information, see Export-Function Models Overview.

Analyze an Export-Function Model with Function-Call Subsystems

When you invoke Simulink Design Verifier analysis on a model that consists of export-function models, the software creates a scheduler model and then performs the analysis. By default, the scheduler model that the software creates is saved in this location <current_folder>\sldv_output\<model_name>\<model_name>_SldvScheduler.slx

This example shows how to analyze an AUTOSAR example model sldvExportFunction_autosar_multirunnables that consists of periodic function-call subsystems.

  1. Add the example folder to the search path.

  2. Open the sldvExportFunction_autosar_multirunnables model.

  3. To run the test generation analysis, on the Design Verifier tab, click Generate Tests.

    The Results Summary window indicates that a scheduler model sldvExportFunction_autosar_multirunnables_SldvScheduler.slx was created. You can also generate a scheduler model by using sldvextract.

    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 executes. The Runnable1 and Runnable2 executes first because the time period is 1 for both of them. After 10 time steps, the Runnable3 executes.

    If the model consists of aperiodic function-call subsystems, the scheduler consists of an additional inport AsyncCallCount. The value of AsyncCallCount indicates whether to invoke the function-call or not in a time step.

    For example, if the Runnable1 is an aperiodic function-call subsystem, the scheduler consists of AsyncCallCount inport to invoke the scheduler. The Sample Time Legend and the scheduler model for the aperiodic function-call is shown in the graphic.

    After the test generation analysis, in the summary window, you see the results that 7/7 objectives are Satisfied.

  4. To generate a coverage report by simulating the test cases, in the Results Summary window, click Simulate tests and produce a model coverage report.

    The software simulates all the test cases, collects model coverage information, and displays a coverage report.

  5. To view the detailed analysis report, click HTML in the 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


  • Simulink Design Verifier analysis does not support a model that consists of export-functions with multiple function-call initiators.

  • A masked model block that exports a Simulink Function block is not supported.

Related Topics