주요 콘텐츠

sldvcompat

R2026b

Check model compatibility with Simulink Design Verifier analysis

Description

status = sldvcompat(model) checks whether model is compatible with Simulink® Design Verifier™ analysis using the saved configuration settings of model. Returns 1 if compatible, 0 otherwise.

example

[status,errmsgs] = sldvcompat(model) also returns errmsgs, a structure array of incompatibility and warning messages. When status is 0, errmsgs contains at least one entry describing the incompatibility.

example

status = sldvcompat(subsystem) extracts the atomic subsystem into a temporary Simulink model, checks its compatibility, and closes the temporary model.

example

status = sldvcompat(subsystem,options) checks the atomic subsystem using the specified options.

example

[status,errmsgs] = sldvcompat(model,options,showUI,startCov) checks the compatibility of the model with Simulink Design Verifier. If showUI is true, errors appear in the Diagnostic Viewer. Otherwise, errors appear at the MATLAB® command line. The analysis ignores all model coverage objectives satisfied in startCov.

example

Examples

collapse all

Check the model for compatibility with Simulink® Design Verifier™ analysis and inspect any incompatibility messages.

Open the sldvdemo_flipflop example model and check for compatibility.

open_system("sldvdemo_flipflop");
[status, errmsgs] = sldvcompat('sldvdemo_flipflop');
17-Aug-2026 16:31:09
Checking compatibility for test generation: model 'sldvdemo_flipflop'
Compiling model...done
Building model representation...done

17-Aug-2026 16:31:17

'sldvdemo_flipflop' is compatible for test generation with Simulink Design Verifier.

Inspect the results by checking the compatibility status returned by sldvcompat. If status is 1, the model is compatible with sldvrun. Otherwise, display the number of incompatibility messages and examine the errmsgs structure array to view the type, source, and details of each incompatibility.

if status == 1
    disp('Model is compatible. Proceed to sldvrun.');
else
    fprintf('%d incompatibility message(s):\n', numel(errmsgs));
    for k = 1:numel(errmsgs)
        fprintf('  [%s] %s: %s\n', errmsgs(k).type, ...
            errmsgs(k).sourceFullName, errmsgs(k).msg);
    end
end
Model is compatible. Proceed to sldvrun.

Check an atomic subsystem for compatibility with test generation analysis.

Open the model and configure Simulink® Design Verifier™ analysis options.

open_system("sldvexControllerSubsystem");
opts = sldvoptions;

In this example, sldvexControllerSubsystem is configured to generate test cases for the subsystem.

opts.Mode = "TestGeneration";

Check the subsystem for compatibility.

[status,errmsgs] = sldvcompat("sldvexControllerSubsystem/Controller",opts);
Creating a new model from the contents of Atomic Subsystem "Controller".

New Model File:/tmp/Bdoc26b_3362262_762230/tpe5ff1471/sldv-ex51726310/sldv_output/Controller/Controller.slx

17-Aug-2026 16:31:26
Checking compatibility for test generation: model 'Controller'
Compiling model...done
Building model representation...done

17-Aug-2026 16:31:30

'sldvexControllerSubsystem/Controller' is compatible for test generation with Simulink Design Verifier.

Inspect the results by checking the compatibility status returned by sldvcompat. If status is 1, the subsystem is compatible with the specified opts.Mode. Otherwise, display the incompatibility messages and examine the errmsgs structure array to view the type and details of each incompatibility.

if status == 1
    fprintf('Subsystem is compatible with %s mode.\n', opts.Mode);
else
    fprintf('Subsystem has incompatibilities:\n');
    for k = 1:numel(errmsgs)
        fprintf('  [%s] %s\n', errmsgs(k).type, errmsgs(k).msg);
    end
end
Subsystem is compatible with TestGeneration mode.

Input Arguments

collapse all

Simulink model to check, specified as a character vector, string scalar, or numeric model handle. The model must be loaded in the current MATLAB session before calling sldvcompat.

Atomic subsystem to check, specified as a character vector, string scalar, or numeric handle representing the full path to an atomic subsystem within an open Simulink model. The subsystem must have Is Atomic check enabled in the context menu. Simulink Design Verifier extracts the subsystem into a temporary model, and checks its compatibility.

Simulink Design Verifier analysis options, specified as Sldv.Options object. When provided, the compatibility check reflects the constraints of the specified analysis mode and settings. When omitted, Simulink Design Verifier uses the saved configuration settings of the model.

Option to display the steps of the compatibility check and corresponding information in the Results Summary dialog box, specified as a numeric or logical 1 (true) or 0 (false). When true, diagnostic messages are displayed in the Simulink Design Verifier log window. When false, messages are displayed in the MATLAB command window.

Existing coverage data to guide compatibility check, specified as a cvdata (Simulink Coverage) object from a prior simulation, or [] for no prior coverage. When provided, the compatibility check accounts for already-satisfied objectives when evaluating the model representation.

Output Arguments

collapse all

Compatibility result, returned as one of these values:

  • 1— No incompatibilities detected. Model is compatible with Simulink Design Verifier analysis.

  • 0— One or more incompatibilities detected. Inspect errmsgs for details.

Data Types: double

Incompatibility and warning messages, returned as a structure array. Returns empty [] when no issues are found. The fields are:

FieldDescription

source

Short name of the block or construct that triggered the incompatibility.

sourceFullName

Full hierarchical path of the source block.

objH

Handle to the source object. Use open_system(errmsgs(k).objH) to navigate to it.

reportedBy

Software component that reported the issue.

msg

Incompatibility description.

msgid

Message identifier for programmatic filtering or lookup.

msgargs

Arguments used to construct the message text.

type

Message severity: "Error" (prevents analysis) or "Warning" (degrades analysis quality).

Note

When status is 1 but errmsgs is non-empty, warnings are present. Review them before proceeding to sldvrun.

Limitations

  • sldvcompat detects known incompatibility patterns but does not guarantee full coverage.

  • For a complete list of unsupported constructs and model configurations, see Unsupported Simulink Blocks in Analysis.

More About

collapse all

Tips

  • Run sldvcompat before calling sldvrun when you have a complex or large model.

  • The model must be open in Simulink before calling sldvcompat. An error occurs if the model is not loaded.

  • Running sldvcompat builds or refreshes the internal model representation used by subsequent Simulink Design Verifier analysis. After a successful sldvcompat call, sldvrun should start analysis faster because the model representation is already current. For more information, see Set Model Representation Build Options.

  • sldvcompat does not modify the model structure, parameters, or saved state. It does not write output files to disk.

  • Only atomic subsystems with Is Atomic enabled can be checked for compatibility directly. Nonatomic subsystems must be checked as part of the containing model.

Alternatives

To check if a model is compatible with Simulink Design Verifier, on the Design Verifier tab, in the Analyze section, click Check Compatibility.

To check compatibility of a Subsystem, right-click the Subsystem and add the Design Verifier app options to the menu by pointing to Select Apps and clicking the Design Verifier button . Then, from the Design Verifier app menu, click the Check Subsystem Compatibility button .

Version History

Introduced in R2007a

expand all