Coding Phase Implementation
Mohamed Amine ZOUHRI
Ingénieur en modélisation MIL chez SHERPA Engineering | Modélisation MIL, Véhicules hybrides
The process of coding in the C language can generate errors, and the behavior of a C-coded model may differ from its behavior when coded in Matlab. In order to detect and correct these errors before they can impact the testing phase on real hardware, it is necessary to establish two operating configurations: Software in the Loop (SIL) and Processor in the Loop (PIL).
Software in the Loop ( SIL )
A portion of the model is replaced with C code that will be executed in Matlab. This allows for verifying that the generation of the C code has not introduced any errors in terms of translating the C code to Matlab code.
Processor in the loop ( PIL )
This configuration helps to avoid runtime errors in the C code. Indeed, the execution conditions of the C code heavily depend on the capabilities and performance of the hardware target on which it runs. In software-in-the-loop mode, the code executes on the computer's processor, while in processor-in-the-loop mode, the code runs on the hardware target that will embed the code under real operating conditions. These two processors may handle the execution of the same program differently. The modeled controller is then replaced by C code that will be directly executed on the control board