PPU and SPU Executable Organization
Typically, a Cell executable file is organized in one of the following ways:
*The PPU executable file contains all code that runs on the PPU and SPUs. That is, the SPU executables are embedded within a PPU executable file or shared library.
*The PPU executable file contains only the code that runs on the PPU. The SPU executable file is opened at runtime by a PPU thread using a libspe/libspe2 function. The opened file is then loaded into the SPU using the same functions that load an embedded SPU image.
*A combination of the previous two methods.
In general, executing an SPU thread is a multi-step process. The PPU begins by creating an SPE context. This context can be thought of as a thread that is not running: it has an address space, registers, MFC state, and so on. This thread has all memory, registers, and such set to zero.
The second step is to load the executable into the SPE context. The final step is to run the SPU executable.