주요 콘텐츠

Handle Model Complexities with Automatic Stubbing

Stubbing in Simulink® Design Verifier™ is the process of replacing certain parts of a model with simpler representations, or stubs, to enable analysis. Automatic stubbing enables analysis of models that contain complex elements. Simulink Design Verifier stubs elements for the duration of the analysis or only during specific phases in the analysis. For example, the Float Extract Bits block is stubbed for the entire analysis, whereas trigonometric function blocks may be stubbed only during certain phases, such as when Simulink Design Verifier analyzes model to identify dead logic. Simulink Design Verifier analysis assumes that the output of a stubbed block can take any value within its full possible range when evaluating downstream blocks.

The analysis results obtained with automatic stubbing may be affected by the use of stubs. Stubbing can prevent the analysis from fully exploring the behavior of block, which may result in some objectives being undecided or not covered. The objectives that are impacted due to stubbing are indicated by the Undecided due to Stubbing status. For more information, see Objectives Status Chapter.

How Automatic Stubbing Works

Automatic stubbing may restrict analysis for certain parts of the model, Simulink Design Verifier continues to analyze the remaining components. The table summarizes the effects of stubbing on the analysis results.

AnalysisEffects of Stubbing on Results

Design error detection

  • If a design error objective that depends on an output of the stubbed block that is proven valid, that objective is valid for all simulations. In this case, the stubbing does not affect the results of the analysis.

  • If a design error objective that depends on an output of the stubbed block that is falsified, the analysis cannot create a test case. The analysis cannot determine which input to the stubbed block produces the output that falsifies the objective.

Test case generation

  • If a test objective that depends on an output of the stubbed block that is satisfied, the analysis cannot create a test case. The analysis cannot determine which input to the stubbed block produces the output that satisfies the objective.

  • If a test objective that depends on an output of the stubbed block that is unsatisfiable, there is no simulation that can satisfy that objective. In this case, the stubbing does not affect the results of the analysis.

Property proving

  • If a proof objective that depends on an output of the stubbed block that is proven valid, that objective is valid for all simulations. In this case, the stubbing does not affect the results of the analysis.

  • If a proof objective that depends on an output of the stubbed block that is falsified, the analysis cannot create a counterexample. The analysis cannot determine which input to the stubbed block produces the output that falsifies the objective.

Review Automatic Stubbing Analysis Results

Simulink Design Verifier stubs blocks and provides analysis results based on the abstracted behavior of those blocks.

Analysis Completes Without Undecided Objectives

The Simulink Design Verifier analysis determines the status of all objectives, even when stubbing is applied. In this case, you can view the results as usual, and the software does not display a notification indicating that stubbing occurred.

Consider this model with a Switch block whose output depends on a Sqrt block. The output for each switch position is determined by a 1-D Lookup Table block. When you run test generation analysis, Simulink Design Verifier stubs the Sqrt block. The stubbed behavior does not impact other blocks, the analysis produces complete results, and all six objectives are satisfied. The results are complete and the analysis report does not show any details about the stubbed Sqrt block.

Simulink model named sldvdemo_sqrt_block showing a 1-D Lookup Table block,a Sqrt block, a Switch block, a min max block, and a Relational Operator block. Results window highlights that all the objectives are satisfied, indicating complete results. Below, a snippet from Simulink Design Verifier report listing the objectives for the analysis.

Analysis Completes With Undecided due to Stubbing Objective Status

When stubbing impacts the objective status, Simulink Design Verifier analysis report indicates that the block is not supported or that objective status is Undecided due to Stubbing. The Diagnostic Viewer displays warnings about all stubbed blocks, regardless of whether Simulink Design Verifier can abstract their behavior.

Consider the model that contains a Math Function block that is stubbed during analysis. If you run design error detection analysis, the Diagnostic Viewer shows a warning that the analysis is impacted by the Math Function block. This is because some conditions inside the blocks are triggered based on the inputs to the block. When a block is stubbed during analysis, Simulink Design Verifier may be able to reach certain conditions through the available inputs, while other conditions may not be reachable.

The Results dialog box indicates that one out of two objectives has an Undecided due to Stubbing status. The analysis report contains a table of unsupported blocks encountered during analysis.

Simulink model named mStubbed_block showing a Math Function block. Results window highlights that one out of two objectives is undecided due to stubbing, indicating incomplete results. Below the Diagnostic Viewer displays a warning that the Math Function block is configured to operate as a function exp, which may impact analysis. On the right, a snippet from Simulink Design Verifier report listing the Math Function as an unsupported block of type Math explaining that unsupported blocks can cause partial analysis.

Achieve Complete Results

You can define custom block replacements to give a more precise definition of the unsupported blocks. For more information, follow the steps in Template for Block Replacement Rules.

For additional guidance, see the workarounds in Resolve Undecided Objective Statuses Resulting from Model Complexity for stubbing.

Note

Automatic stubbing does not affect the code generation process or the resulting generated code. The generated code reflects the interpretation of the model.

See Also

|

Topics