Main Content

CVSIM

Simulate and return model coverage results for test objects

描述

CVDO= cvsim(模型姓名模拟模型并返回覆盖范围导致CVDATAobject,CVDO。When called using模型姓名,,,,CVSIM使用模型配置参数中指定的覆盖范围度量设置。

笔记

CVSIM即使在模型配置参数中未启用覆盖范围,也会记录覆盖范围。

CVDO= cvsim(testobjSIMulates the model and returns the coverage results for thecvtestobject,testobj

笔记

testobj在模型配置参数中指定的覆盖范围度量设置。

[[CVDO,,,,模拟] = cvSim(__,名称,价值指定模型参数,模拟模型并返回覆盖范围导致CVDATAobject,CVDO,以及模拟输出金宝appsimulink.simulationOutputobject,模拟

[[CVDO,,,,模拟] = cvSim(testobj,,,,参数设置在结构中指定的模型参数参数

例子

[[CVDO1,...,,,CVDOn] = cvSim(testobj1,...,,,testobjn)模拟模型n测试对象,并返回的结果报道each object.

例子

全部收缩

此示例显示了如何使用CVSIMcvtest对象输入和模型参数的结构。

Load theslvnvdemo_cv_small_controller示例模型。

模型姓名='SLVNVDEMO_CV_SMALL_CONTROLLER';load_system(modelName)

创建一个cvtestobject and turn on decision coverage.

testObj = cvtest(modelName);testobj.settings.decision = 1;

创建一个定义以下模型参数的结构:

  • Set the absolute tolerance,Abstol, 到1E-5

  • Enable the simulation to save states to the workspace withSavestate

  • 声明可变名称以保存状态信息Savestate姓名

  • 启用S​​im金宝appulink®可以将模拟输出数据保存到工作空间保存输出

  • 声明将模拟输出数据存储的变量名称OutputSavename

paramStruct.abstol ='1e-5';参数。Savestate='在';paramStruct.StatesAvename ='xoutnew';paramStruct.saveOutput ='在';paramStruct.outputsavename ='Youtnew';

模拟模型CVSIMand generate a coverage report withCVHTML

[covdata,simout] = cvSim(testobj,paramStruct);CVHTML('CoverageReport.html',covdata,'-sRT=0');

输入参数

全部收缩

Simulink模型金宝app的名称,指定为字符数组或字符串数​​组。CVSIM使用当前的覆盖范围设置模拟模型。

数据类型:char|细绳

覆盖测试设置,,,,specified as acvtest目的。CVSIM使用指定的设置收集覆盖范围testobj

testobj覆盖模型配置参数中指定的覆盖范围度量设置。例如,如果结构覆盖范围parameter in your model is set to修改条件决策覆盖范围(MCDC),,,,but yourtestobj.settings.mcdcproperty is0, 然后covData = cvsim(testObj)will不是记录MCDC覆盖范围。

数据类型:cvtest

模型参数,指定为结构。您可以将模型参数指定为结构,并使用结构而不是名称值对参数来设置多个参数。

参数字段是模型参数的名称,值是相应的参数值。

Example:paramStruct.abstol ='1e-5';

数据类型:结构

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen, 在哪里姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:[cvdo,simout] = cvSim(testobj,'abstol','1e-5');指定模型使用的绝对公差模拟1E-5具有指定的覆盖范围设置testobj

CVSIM金宝app支持所有支持的模型参数SIM,,,,except for parameters in the覆盖范围pane of the Configuration Parameters window.

姓名of a model parameter, specified as a character array or string array. The value of the parameter is specified as the next argument.

数据类型:char|细绳

输出参数

全部收缩

CVDO,返回CVDATA目的。当在层次结构中记录多个模型的覆盖范围时,CVDO是一个CV.CVDATAGROUP对象。CVDO包含来自模拟系统的覆盖范围数据。

CVDATA对于对象结构。

模拟,返回金宝appsimulink.simulationOutput目的。

版本历史记录

Introduced before R2006a