主要内容

分析包含变体块的模型中的变体配置

变体配置的概述

A model hierarchy may contain several variant blocks, each with many variant choices. You must associate each variant choice in a model with avariant control这用于确定选择是活动性还是无效。这些变体选择的组合代表了要建模的系统的特定实现。它也对应于模型中的特定变体路径。

A变体配置用于代表这种变体选择的组合。它包含一组变体控制变量及其值,您可以使用它们激活模型中的特定变体路径。模型的变体配置数量可能很高,具体取决于模型中使用的变体控制变量的数量。您可以使用变体管理器来创建和管理此类变体配置。您可以使用变体配置分析toolto compare and analyze these configurations.

Analyze Variant Configurations Using the Variant Configuration Analysis Tool

Note

您需要一个金宝app®设计验证器™license to use the Variant Configuration Analysis Tool.

变体配置分析工具使您可以:

  • 比较模型的不同变体配置。

  • 检查是否至少一次激活了所有变体选择,并且该模型被完全涵盖以用于模拟和代码生成。

  • 验证活动,实现的模型在不同的变体配置之间是否有所不同。

  • Get information on the dependent models and libraries used for a particular variant configuration.

您可以分析为模型创建的命名变体配置,或在为变体控制变量设置值后执行分析。该工具显示的报告:

  • The variant configurations analyzed.

  • 所有块的模型层次结构。

  • 每个变体配置中每个块的变体活化。

  • The propagated variant condition on a block for each variant configuration.

分析结果可帮助您确定不同变体配置中的哪些块。未使用的块以红色突出显示,该块代表了模型的未经测试和未覆盖的部分。热图视图可帮助您确定不同变体配置之间的活动,实现模型的相似性和差异。该信息可用于完善变体配置并更新模型,以在所有变体配置中提供完整的仿真覆盖范围。

如何运行模型的变体配置分析工具

  1. 打开一个包含变体块的模型。例如,变体配置分析

    模型with Variant Source and Variant Sink blocks

    该模型包含基于传感器输入的传感器和不同控制器实现的多个供应商选择。供应商传感器的选择是通过建模的变体源变体水槽blocks. The different controller choices is modeled using变体子系统block.

  2. Open Variant Manager. On the模型ingtab, open theDesign单击部分变体经理。Alternatively, right-click the variant badge on any variant block and selectOpen in Variant Manager

    变体块上的变体徽章

    变体管理器打开并显示预定义的配置。

  3. ClickAnalyze。“变体配置分析对话框”打开。

  4. 在里面Analysis mode,选择是否分析模型的预定义命名配置,还是是否需要为变体控制变量指定值。

    • 指定变体配置: Select from the list of named variant configurations under命名配置或选择命名配置to select all of them.

    • Specify variant control values: If you select this option, you can create multiple variable groups that correspond to different configurations. To create a new variable group, clickNew variable group并设置变体控制变量的值。您可以指定变体控制值或选择被忽略从下拉列表中。如果您选择被忽略, then that variant control variable is not considered while analyzing the model.

  5. ClickAnalyze。The report for analyzed variant configurations opens.

    Note

    在此示例中指定变体配置is selected inAnalysis mode

探索变体配置分析报告

变体configuration analysis report

The variant configuration analysis report displays a tree-table view of the model hierarchy and all of the analyzed variant configurations. This table explains the icons and formatting used in the report.

Rows and Columns

Each row in the table corresponds to a block in the model and each column represents a variant configuration.

复选标记

The在报告字段中检查标记symbol is for visual aid and indicates that the block is active in the corresponding variant configuration.

背景颜色

An entire row including the block name appears with red background color if it is not active in any of the variant configurations. Such a block indicates an untested path in the model. A table field with red background color indicates that a particular block is not active in a specific configuration.

例如,在此模型中,Vendor A块在变体配置中处于活动状态供应商,VendorACtrlFuzzy,VendorACtrlNonLinear和is inactive in the variant configurationsVendorBCtrlFuzzy,VendorBCtrlLinear,VendorBCtrlSecondOrder, 和VendorBCtrlNonLinear

Block activeness icons

Theblock is always active icon|块是部分活动图标|block is never active icon图标Activeness列指示一个块在所有配置中都处于活动状态,分别在某些配置中处于活动状态,或分别在所有配置中都没有活性。

变体condition annotations (c:#)

表字段中的注释代表块为特定配置收到的变体条件。块上的传播变体条件根据活动变体配置而变化。

You can refer the table in the注解窗格用于注释(C:#)与它们每个代表的传播变体条件之间的映射。传播变体条件可帮助您了解为什么一个给定变体配置的块是活动的(根据配置中定义的控制变量的值评估了变体条件)。单击表中的注释。所有具有注释的块出现在配置表中。

The controls on the变体配置分析window allow you to perform the following actions:

  • Search for blocks.

  • 根据块类型过滤结果。

    Select an option from theView Blocks列表:

    • 变体仅在模型中显示变体块。

    • 分层to display all hierarchical blocks (for example, Subsystem or模型blocks) in the model. This view allows you to explore subsystems or model references one-by-one instead of looking through the complete model.

    • 所有块to display all blocks in the model.

  • Filter the results based on block activeness.

    阻止活性复选框过滤器

    • 总是积极displays blocks that are always active in the model.

    • 部分活动显示在某些配置中活跃的块,并且在所选配置中有其他块。

    • 从不活跃显示模型中从未活动的块。这些块以红色突出显示,这表明它们未经测试和未发现模型的部分,并且需要一些更新以提供完整的仿真覆盖范围。

    例如,this image shows a model with several unused blocks.从不活跃option is selected to view the unused blocks.

    The blocks in theSecond ordercontroller inside theLinear_Controlf1_unsat过滤器未使用。要使这些未使用的块在至少一种变体配置中的活动模型的一部分,请修改模型或更新变体配置。

    This image shows a model with two identical variant configurations.部分活动选择选项以获得此结果。

    The variant configurationsVendorBCtrlLinearVendorBCtrlSecondOrderhave no differences between them. This indicates that the resulting active model for both these configurations will be same. To resolve this, update the variant configurations or update the model appropriately.

限制

变体配置分析tool does not support variant blocks with the变体activation time参数设置为startup

相关话题