piltest - Verify custom target connectivity configuration for Simulink PIL simulation - MATLAB (original) (raw)

Verify custom target connectivity configuration for Simulink PIL simulation

Syntax

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 from config:

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

piltest([config](#bveyx1b-config),'ConfigParams',[additionalParameterList](#bveyx1b-additionalParameterList)) extracts additional parameters from config for the PIL simulation.

example

piltest([config](#bveyx1b-config),'TestPoint',[testName](#bveyx1b-testName)) runs a specific test from the test suite.

Examples

collapse all

This example uses piltest to verify a target connectivity configuration for PIL simulations on your development computer.

Create a target connectivity implementation in your current working folder.

% Make a local copy of the connectivity classes. src_dir = ... fullfile(matlabroot,'toolbox','coder','simulinkcoder',... '+coder','+mypil'); if exist(fullfile('.','+mypil'),'dir') rmdir('+mypil','s') end mkdir +mypil copyfile(fullfile(src_dir,'Launcher.m'), '+mypil'); copyfile(fullfile(src_dir,'TargetApplicationFramework.m'), '+mypil'); copyfile(fullfile(src_dir,'ConnectivityConfig.m'), '+mypil');

% Make the copied files writable. 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 an sl_customization.m file. This example uses a supplied file.

sl_customization_path = fullfile(matlabroot,... 'toolbox',... 'rtw',... 'rtwdemos',... 'pil_demo'); addpath(sl_customization_path); sl_refresh_customizations;

Open the model and specify the PIL simulation mode.

openExample('ecoder/SILPILVerificationExample', ... supportingFile='SILTopModel.slx') set_param('SILTopModel','SimulationMode',... 'processor-in-the-loop (pil)');

Specify the manufacturer and test hardware type. For example, PIL simulation on a 64-bit Windows® development computer requires:

set_param('SILTopModel','TargetHWDeviceType',... 'Intel->x86-64 (Windows64)'); set_param('SILTopModel','TargetLongLongMode',true);

Run piltest.

piltest('SILTopModel', 'ConfigParam', {'ProdLongLongMode'} )

Input Arguments

collapse all

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

Extract additional parameters from config for PIL simulation.

Version History

Introduced in R2016b