Code Verification Through Software-in-the-Loop and Processor-in-the-Loop Execution
MATLAB® Coder™ supports software-in-the-loop (SIL) and processor-in-the-loop (PIL) execution, which enables you to verify production-ready source code and compiled object code. With these execution modes, you can reuse test vectors developed for your MATLAB functions to verify the numerical behavior of library code.
In SIL execution, through a MATLAB SIL interface, the software compiles and runs library code on your development computer. In PIL execution, through a MATLAB PIL interface, the software cross-compiles and runs production object code on a target processor or an equivalent instruction set simulator. Before you run a PIL execution, you must set up a PIL connectivity configuration for your target.
The workflow for generating and verifying code is:
Set up MATLAB Coder.
Fix errors detected at design time.
Generate MEX function.
Test MEX function.
Generate C/C++ library code.
Verify generated C/C++ code through SIL or PIL execution — requires Embedded Coder® license.
In step 4, you verify code that is generated for execution within MATLAB. However, this code is different from the standalone code generated for libraries. In step 6, with an Embedded Coder license, you use SIL or PIL execution to verify the standalone code.
For more information, use the following table.
|PIL target connectivity configuration
|Code generation, MEX functions, and libraries