Main Content

ExecutionInfo

Retrieve execution coverage information fromCVDATA目的

句法

coverage = executionInfo(cvdo,对象)
coverage = executionInfo(CVDO,对象,模式)
coverage = executionInfo(cvdo,对象,ignore_descendants)
[覆盖范围,描述] = executionInfo(cvdo,对象)

描述

覆盖范围= executioninfo(CVDO,,,,目的returns execution coverage results from theCVDATA目的CVDO对于由目的

覆盖范围= executioninfo(CVDO,,,,目的,,,,modereturns execution coverage results from theCVDATA目的CVDO对于由目的for the simulation modemode

覆盖范围= executioninfo(CVDO,,,,目的,,,,ignore_descendants返回执行覆盖结果目的,,,,depending on the value ofignore_descendants

[[覆盖范围,,,,描述] = executionInfo(CVDO,,,,目的returns execution coverage results and text descriptions of execution points associated with目的

输入参数

CVDO

CVDATA目的

目的

目的参数在模型或状态流中指定对象®收到执行覆盖的图表。有效值目的包括以下这些:

对象规范 描述

区块路

通往模型或块的完整路径

块手

Handle to a model or block

Slobj

处理模拟金宝app®API对象

SFID

状态流ID

sfobj

从单独实例化的状态流图中处理状态流API对象

{BlockPath, sfID}

带有状态流图或原子子图的路径的单元格数组以及该图中包含的对象的ID

{blockpath,sfobj}

单元阵列与路径Stateflow图表或年代ubchart and a Stateflow object API handle contained in that chart or subchart

{blockhandle,sfid}

Cell array with a handle to a Stateflow chart or atomic subchart and the ID of an object contained in that chart or subchart

指定s功能块时,目的包括以下这些:

对象规范 描述

{BlockPath,fname}

带有通往路径的单元阵列S功能块和源文件的名称。

{blockhandle,fname}

带有一个细胞阵列S功能块句柄和源文件的名称。

{BlockPath, fName, funName}

带有通往路径的单元阵列S功能块,源文件的名称和函数名称。

{blockhandle,fname,funname}

带有一个细胞阵列S功能块句柄,源文件的名称a函数名称。

对于在循环(SIL)模式或处理器中收集的覆盖范围数据(pil)模拟模式,有效值目的包括以下这些:

对象规范 描述

{fileName, funName}

带有源文件名称和函数名称名称的单元格数组。

{型号,文件名}

具有模型名称(或模型句柄)和源文件的名称的单元格数组。

{Model, fileName, funName}

具有模型名称(或模型句柄)的单元格数组,源文件的名称和函数名称。

mode

mode参数指定覆盖范围的仿真模式。有效值mode包括以下这些:

对象规范 描述

'普通的'

Model in Normal simulation mode.

'SIL' (or 'PIL')

Model in Software-in-the-Loop (SIL) or Processor-in-the-Loop (PIL) simulation mode.

'ModelRefSIL' (or 'ModelRefPIL')

在循环中(SIL)或处理器中的模型(PIL)模拟模式中的模型参考。

'ModelRefTopSIL' (or 'ModelRefTopPIL')

在循环中的模型参考(SIL或处理器在循环(PIL)仿真模式中,代码接口将代码接口设置为顶部模型。

ignore_descendants

Specifies to ignore the coverage of descendant objects ifignore_descendantsis set to1

输出参数

覆盖范围

这value of覆盖范围是表格的两元素向量[coving_outcomes total_outcomes]覆盖范围is empty ifCVDOdoes not contain execution coverage results for目的。这两个元素是:

coving_outcomes 满足执行结果的数量目的
total_outcomes 执行结果的数量目的

描述

描述是包含以下字段的结构数组:

决策。文本 Structure array describing block execution counts
置换 是否过滤块
过滤器 这filtering rationale
合理的规范 合理的决策条件
设置 Whether the block is justified

例子

打开slvnvdemo_cv_small_controller建模并创建测试规范对象testobj。Enable execution coverage forslvnvdemo_cv_small_controller并执行testobj使用CVSIM。利用ExecutionInfo要检索饱和块的执行覆盖结果,并确定涵盖的执行结果百分比:

mdl ='SLVNVDEMO_CV_SMALL_CONTROLLER';open_system(mdl)testobj = cvtest(mdl)data = cvSim(testobj)blk_handle = get_param([mdl,'/Saturation'],'处理');cov = executionInfo(data,blk_handle)percon_cov = 100 * cov(1) / cov(2)

备择方案

使用覆盖范围设置收集和显示执行覆盖范围结果:

  1. 打开模型。

  2. In the Model Editor, select模型设置造型标签。

  3. 覆盖范围配置参数对话框的窗格,选择启用覆盖范围分析

  4. 在下面覆盖范围指标, 选择块执行as the structural coverage level.

  5. 点击OK关闭“配置参数”对话框并保存更改。

  6. 单击模拟模型按钮并查看结果。

在R2006b中引入