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|
A workflow that uses SIL and PIL execution to verify the numerical behavior of generated MATLAB code.
Use the MATLAB Coder app to verify the numerical behavior of generated C/C++ code.
Use MATLAB commands to verify the numerical behavior of generated C/C++ code.
Use a debugger to understand the behavior of generated code.
Customize PIL execution for your target environment.
rtiostream API for communication
between your development computer and target during PIL execution.
Specify a hardware timer using the Code Replacement Tool.
Specify compiler directives for building PIL application that supports code execution profiling.
Use the MATLAB Coder app to verify the numerical behavior of cross-compiled object code.
Use MATLAB commands to verify the numerical behavior of cross-compiled object code.
This example shows how to set up a PIL execution to verify generated code at the command line.
PIL Execution with App.
PIL execution checks Hardware tab settings.
Configure code generation parameters to turn off constant input checking or global data synchronization for SIL or PIL executions.
SIL and PIL execution support for code generation features.
Visualize the mapping between the MATLAB code and the generated C/C++ code.
Include MATLAB source code as comments in the generated code. Include function help text and function signature in function banner.
Check for run-time errors or defects in generated C/C++ code.