PIL Simulation Sequence
A processor-in-the-loop (PIL) simulation cross-compiles production source code, and then downloads and runs object code on your target hardware. The connectivity configuration that you create controls the way code is compiled and executed on the target. This table describes the sequence of stages in a PIL simulation.
Stage | Description | |
---|---|---|
1 | Start | For top-model PIL, on the Simulink® Editor toolbar, you select the
For
Model block PIL, you set the
Simulation mode parameter of the
Model block to
For the PIL block, you run a simulation of the harness model that contains the PIL block. |
2 | Validate target connectivity | The software verifies that a target connectivity configuration is registered for PIL. Otherwise, the software produces an error. |
3 | Generate production source code and build object code for target | The generated source code is identical to the code that is
produced when you run the
The software builds object code for the target by using the template makefile or toolchain that you specify. |
4 | Create instances of PIL API components | The software instantiates your |
5 | Generate PIL files | The generated PIL files are in the |
6 | Build target application | The software:
|
7 | Start target application | The software uses
|
8 | Simulink engine interacts with PIL S-function | The Simulink engine interacts with the PIL S-function in the same way that it interacts with a C S-function. From
the host-side, the PIL S-function communicates with the target
executable code through |
9 | Stop target application | The software uses
|
10 | End PIL simulation | For top-model PIL, at the end of the simulation, the
software destroys the For
Model block PIL and PIL block, the block
creates and owns the |
See Also
rtw.connectivity.Config
| rtw.connectivity.MakefileBuilder
| rtw.connectivity.Launcher
| rtw.pil.RtIOStreamApplicationFramework
| rtw.connectivity.RtIOStreamHostCommunicator
Related Examples
- Create PIL Target Connectivity Configuration for Simulink
- View SIL and PIL Files in Code Generation Report