Main Content

PIL Execution with ARM Cortex-A at the Command Line

This example shows how to set up a PIL execution to verify generated code at the command line.

You can use processor-in-the-loop (PIL) executions to verify generated code that you deploy to target hardware by using a MATLAB® Coder™ procedure. You can profile algorithm performance and speed for your generated code. To verify generated code with the MATLAB Coder app, you must have an Embedded Coder® license.

This PIL execution is available with these hardware support packages. To use the PIL execution, install one of these support packages.

  • Embedded Coder Support Package for BeagleBone® Black Hardware

  • Embedded Coder Support Package for ARM® Cortex®-A Processors

In the Command Window, select the hardware for PIL execution.

hw = coder.hardware('ARM Cortex-A9 (QEMU)')
hw = 

  Hardware with properties:

            Name: 'ARM Cortex-A9 (QEMU)'
    CPUClockRate: 1000

When using the BeagleBone hardware, more hardware properties are supported (Username, Password, and DeviceAddress). Set these properties based on your specific hardware or application.

hw = coder.hardware('BeagleBone Black')
hw = 

  Hardware with properties:

             Name: 'BeagleBone Black'
     CPUClockRate: 1000
         Password: 'root'
         Username: 'admin'
    DeviceAddress: ''

Add the hardware to the MATLAB Coder configuration object.

cfg = coder.config('lib','ecoder',true); 
cfg.VerificationMode = 'PIL'; 
cfg.Hardware = hw; 

Generate PIL code for a function, averaging_filter.

codegen -config cfg averaging_filter -args {zeros(1,16)}

For more information on the averaging_filter function, see Generate C/C++ Code from a MATLAB Function.

For another example of PIL verification, see the Processor-in-the-Loop Verification of MATLAB Functions page in the documentation of the Embedded Coder Support Package for ARM Cortex-A Processors. To install the Embedded Coder Support Package for ARM Cortex-A Processors, see Embedded Coder Supported Hardware.