主要内容

piltest

Verify custom target connectivity configuration for万博1manbetxPIL模拟

Description

皮尔特(Piltest)(config)runs a suite of tests that verify your custom processor-in-the-loop (PIL) target connectivity configuration. In the tests, the function runs various normal, software-in-the-loop (SIL), and PIL simulations. The function compares results and produces errors if it detects differences between simulation modes. For the PIL simulations, the function extracts these parameters fromconfig:

  • SystemTargetFile

  • TargetHWDeviceType

  • Toolchain

In the current working folder, the function creates thepiltestfolder, which contains subfolders with test results.

example

皮尔特(Piltest)(config,'ConfigParams',additionalParameterList)extracts additional parameters fromconfigfor the PIL simulation.

皮尔特(Piltest)(config,“测试点”,testname)从测试套件中运行特定的测试。

Examples

collapse all

This example usespiltestto verify a target connectivity configuration for PIL simulations on your development computer.

在当前的工作文件夹中创建目标连接实现。

% Make a local copy of the connectivity classes.src_dir =。。。fullfile(matlabroot,'工具箱',“编码器”,'simulinkcoder',。。。'+编码器','+mypil');if存在(fullfile('.','+mypil'),'dir') rmdir('+mypil','s')endmkdir+mypilcopyfile(fullfile(src_dir,,'启动器.m'),'+mypil');copyfile(fullfile(src_dir,,“ targetApplicationFramework.m'),'+mypil');copyfile(fullfile(src_dir,,'ConnectivityConfig.m'),'+mypil');%使复制的文件可写。fileattrib(fullfile('+mypil','*'),'+w');% Update the package name to reflect the new location of the files.coder.mypil.Utils.UpdateClassName(。。。'./+mypil/ConnectivityConfig.m',。。。'coder.mypil',。。。'mypil');

Register a target connectivity configuration using ansl_customization.mfile. This example uses a supplied file.

sl_customization_path = fullfile(matlabroot,。。。'工具箱',。。。'rtw',。。。'rtwdemos',。。。'PIL_DEMO');addpath(sl_customization_path);sl_refresh_customizations;

Specify the PIL simulation mode for the model.

CLOSS_SYSTEM('rtwdemo_sil_topmodel') open_system('rtwdemo_sil_topmodel') set_param('rtwdemo_sil_topmodel',“SimulationMode”,。。。'processor-in-the-loop (pil)');

指定制造商和测试硬件类型。例如,在64位窗口上的PIL模拟®开发计算机需要:

set_param('rtwdemo_sil_topmodel','TargetHWDeviceType',。。。'Intel->x86-64 (Windows64)');set_param('rtwdemo_sil_topmodel',“ targetLonglongmode”,true);

Runpiltest

皮尔特(Piltest)('rtwdemo_sil_topmodel','configparam',{'ProdLongLongMode'} )

Input Arguments

collapse all

A configuration set, configuration set reference, or Simulink®model.

Extract additional parameters fromconfigfor PIL simulation.

  • 'verifypilblock'- 对于正常模式结果,运行具有子系统的Simulink模型的模拟。万博1manbetx对于PIL,请用PIL块替换子系统,然后重新运行模拟。该功能比较正常和PIL模式结果。如果该函数检测到差异,则会产生错误。

  • 'verifyModelBlock'- 对于正常模式结果,运行模拟模型万博1manbetx模型block in normal mode.

    对于PIL模式结果,运行模拟循环与模型block in PIL mode. The function varies these settings:

    • 模型block parameterCode interface- 调成Top model(独立代码接口)或模型reference

    • Configuration Parameters>Code Generation>Language- 调成C或者C++。为了C++情况,功能集Code Generation>Interface>Code interface packagingtoC++ class

    该功能比较正常和PIL模式结果。如果该函数检测到差异,则会产生错误。

  • 'verifyTopModel'— Run simulations of a Simulink top-model in normal and PIL modes. The function compares normal and PIL mode results. If the function detects differences, it produces an error.

  • 'verifyExecutionOnTarget'- 运行使用Simulink模型的模拟万博1manbetx模型block in normal and PIL modes. For each mode, the模型块使用独立和模型参考代码接口。对于PIL模式,该功能引入了故意的不匹配。该功能比较正常和PIL模式结果。如果未检测到故意的不匹配,则会产生错误。

  • 'verifyTopModelSILPILSwitching'— For a Simulink top model:

    • 当功能在SIL和PIL模拟模式之间切换时,验证生产代码不会再生。该功能在每种模式下比较生产代码的时间戳。

    • Compares results from SIL and PIL mode simulations to results from a normal mode simulation.

    如果该函数检测到时间戳或仿真结果的差异,则会产生错误。

  • “验证modelblocksilpilswitching'— For a Simulink模型block:

    • Verify that production code is not regenerated when the模型块仿真模式在SIL和PIL模式之间开关。该功能在每种模式下比较生产代码的时间戳。

    • 运行模拟循环与模型块银and PIL modes. The function varies theCode interface模型block parameter, setting this parameter toTop model或者模型reference。The function compares results from SIL and PIL mode simulations to results from a normal mode simulation.

    如果该函数检测到时间戳或仿真结果的差异,则会产生错误。

  • 'all'— Run all tests from the test suite.

Version History

Introduced in R2016b