The "stub" directory has some ARXML files, some C files and some H files. The content of this directory is normally the output of industry RTE generators. It is the infrastructure necessary to build the generated AUTOSAR code. Building the code allows for SIL and PIL simulations.
To understand why these files are necessary to build the AUTOSAR code, we must understand the 3 layers of the AUTOSAR stack:
- Application Layer (top): contains software components (SWCs). These SWCs are the generated code from the Simulink model (the algorithm).
- Runtime Environment (RTE, middle): Communication between components of the Application Layer and from components to the BSW (bottom). The RTE represents the full interface for applications.
- Basic Software (BSW, bottom): Services and hardware abstraction.
When you generate code for an AUTOSAR model, C code and ARXML file(s) are produced. The generated C code for an AUTOSAR model contains function calls to the RTE layer such as Rte_Read (inport) and Rte_Write (outport). The RTE is generated by an outside generator using the ARXML that describes the interface of the SWC. We generate "stub" or spoof implementations of the necessary RTE functions to build the model because the RTE may not yet exist or could be costly to constantly regenerate and reimport.