Use software-in-the-loop (SIL) and processor-in-the-loop (PIL) execution to check the numerical behavior of the code that you generate from MATLAB functions. A software-in-the-loop (SIL) execution compiles generated source code and executes the code as a separate process on your development computer. A PIL execution, which requires a target connectivity configuration, cross-compiles generated source code, and then downloads and runs object code on your target hardware. You can verify the numerical behavior by comparing the results from the SIL or PIL execution against the results from the original MATLAB functions.
You can generate traceable code, which helps you to check the absence of unintended functionality, understand how the generated code implements your algorithm, and evaluate the quality of the generated code.
|Provide parameters for each target connectivity component|
|Define connectivity implementation that comprises builder, launcher, and communicator components|
|Register connectivity configuration|
|Control downloading, starting, and resetting of a target application|
|Configure toolchain-based build process|
|Configure development computer communications with target processor|
|Configure target-side communications|
Code Generation Parameters
SIL and PIL Testing
- Code Verification Through Software-in-the-Loop and Processor-in-the-Loop Execution
A workflow that uses SIL and PIL execution to verify the numerical behavior of generated MATLAB code.
- Software-in-the-Loop Execution with the MATLAB Coder App
Use the MATLAB Coder app to verify the numerical behavior of generated C/C++ code.
- Software-in-the-Loop Execution From Command Line
Use MATLAB commands to verify the numerical behavior of generated C/C++ code.
- Software-in-the-loop Execution For MATLAB Function with Multiple Signatures
Generate a SIL MEX file for multiple signatures.
- Debug Generated Code During SIL Execution
Use a debugger to understand the behavior of generated code.
- Create PIL Target Connectivity Configuration for MATLAB
Customize PIL execution for your target environment.
- Host-Target Communication for MATLAB PIL Execution
rtiostreamAPI for communication between your development computer and target during PIL execution.
- Specify Hardware Timer for MATLAB
Specify a hardware timer using the Code Replacement Tool.
- Custom Toolchain Directives Required for Code Execution Profiling
Specify compiler directives for building PIL application that supports code execution profiling.
- Processor-in-the-Loop Execution with the MATLAB Coder App
Use the MATLAB Coder app to verify the numerical behavior of cross-compiled object code.
- Processor-in-the-Loop Execution From Command Line
Use MATLAB commands to verify the numerical behavior of cross-compiled object code.
- 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.
- PIL Execution with ARM Cortex-A by Using the MATLAB Coder App
PIL Execution with App.
- Verification of Code Generation Assumptions
PIL execution checks Hardware tab settings.
- Speed Up SIL/PIL Execution by Disabling Constant Input Checking and Global Data Synchronization
Configure code generation parameters to turn off constant input checking or global data synchronization for SIL or PIL executions.
- SIL/PIL Execution Support and Limitations
SIL and PIL execution support for code generation features.
- Interactively Trace Between MATLAB Code and Generated C/C++ Code
Visualize the mapping between the MATLAB code and the generated C/C++ code.
- Include Comments in Generated C/C++ Code
Include MATLAB source code as comments in the generated code. Include function help text and function signature in function banner.
- Polyspace Verification of C/C++ Code Generated by MATLAB Coder
Check for run-time errors or defects in generated C/C++ code.