Developing code for the Cell Broadband Engine

There can be several types of programs, including PPE programs, SPE programs, and Cell Broadband Engine programs (PPE programs with embedded SPE programs).

The PPE and SPE programs use different compilers. The correct compiler, compiler flags, and libraries must be used for the intended processor and program type. The PPE typically sets up, starts, and stops an SPE. Communication between the PPE and SPEs is an important consideration.

To aid in simplifying the process of producing programs for the Cell Broadband Engine, the SDK's Samples (see The software development kit) provides a build environment based upon the make utility. For additional details on the SDK's build environment, consult the file README_build_env.txt located in /opt/cell/sdk/buildutils.

Programmers can declare the types of programs in the makefile, and the correct compiler, compiler options, and libraries will be used for the build. The most important target types are PROGRAM_ppu and PROGRAM_spu, for building PPE programs and SPE programs, respectively. To use makefile definitions supplied by the SDK for producing programs, include the following line at the bottom of the makefile:
include ../../../buildutils/make.footer
Insert as many instances of "../" as necessary to reach the top of the directory tree where buildutils resides. Alternatively, make.footer can be sourced directly (useful when working on projects within the Eclipse IDE framework), by defining CELL_TOP environment variable and sourcing the make.footer as follows:
include $(CELL_TOP)/buildutils/make.footer

The makefiles in the SDK Samples support both methods of importing the make.footer.

Figure 1 shows a sample directory structure and makefiles for a system with a PPE program and an SPE program. This sample project sampleproj has a project directory and two subdirectories. The ppu directory contains the source code and makefile for the PPE program. The spu directory has the source code and makefile for the SPE program. The makefile in the project directory executes the makefiles in the two subdirectories. This is only one of the possible project directory structures.
Figure 1. Sample project directory structure and makefilesstorage domains defined in the CBE