The CBE Software Development Kit
This book uses a hands-on approach to teach Cell programming, so the
development tools are very important. The most popular toolset is IBM's
Software Development Kit (SDK), which runs exclusively on Linux and
provides many different tools and libraries for building Cell
applications.
IBM provides the SDK free of charge, although some of the tools have
more restrictive licensing than others. For the purposes of this book,
the most important aspect of the SDK is the GCC-based toolchain for
compiling and linking code.
The two compilers, ppu-gcc and spu-gcc, compile code for the PPU and
SPU, respectively.They provide multiple optimization levels and can
combine scalar operations into more efficient vector operations.
The SDK also includes IBM's Full-System Simulator, tailored for Cell
applications. This impressive application runs on a conventional
computer and provides cycle-accurate simulation of the Cell processor,
keeping track of every thread and register in the PPU and SPUs. In
addition to basic simulation and debugging, it provides many advanced
features for responding to processing events.
The SDK contains many code libraries to ease the transition from
traditional programming to Cell development. It provides most standard
C/C++ libraries for both the PPU and SPU, POSIX commands for the PPU,
and a subset of the POSIX API on the SPU. Many of the libraries are
related to math, but others can be used to profile an SPU's operation,
maintain a software cache, and synchronize communication between
processing units.
All of these tools and libraries can be accessed through the Cell
SDK integrated development environment (IDE).This is an Eclipse-based
graphical user interface for managing, editing, building, and analyzing
code projects. It provides a powerful text editor for code entry,
point-and-click compiling, and a feature-rich interface to the Cell
debugger. With this interface, you can watch variables as you step
through code and view every register and memory location in the Cell.
Conclusion
Some time ago, I had the pleasure of programming assembly language on a
multicore digital signal processor, or DSP. The DSP performed matrix
operations much,much faster than the computer on my desk, but there
were two problems: I had to write all the routines for resource
management and event handling, and there was no file system to organize
the data.And without a network interface, it was hard to transfer data
in and out of the device.
The Cell makes up for these shortcomings and provides many
additional advantages. With SIMD processing, values can be grouped into
vectors and processed in a single cycle. With Linux running on the PPE,
memory and I/O can be accessed through a standard, reliable API. Most
important, when all the SPEs crunch numbers simultaneously, they can
process matrices at incredible speed.
The goal is to enable you to build applications with similar
performance. As with the DSP, however, it's not enough just to know the
C/C++ functions. You have to understand how the different processing
elements work, how they're connected, and how they access memory. But
first, you need to know how to use the tools.
Next in Part 2, Building Applications for the Cell Processor.
Matthew Scarpino lives in the San Franciso Bay area and
develops software to interface embedded devices. He has a master's
degree in electrical engineering and has spent more than a decade in
software development. His experience includes computing clusters,
digital signal processors, microcontrollers and fiedld programmable
gate arrays and, of course, the Cell Processor.
This series of articles is reproduced from the book "Programming
the Cell Processor", Copyright © 2009, by permission of
Pearson Education, Inc.. Written permission from Pearson Education,
Inc. is required for all other uses.
To read more about the Cell processor architecture on Embedded.com,
go to:
1) A
glimpse inside the Cell processor
2) Programming
the Cell Broadband Engine
3) Programming
the Cell Processor
4) Cell
Processor makes computing more connected