Search all of ASU

PS3-Linux-GCC: Experimental Setup for SMM

 

Preparing SPU-GCC toolchain

On Cell BE architecture, there are two different types of processor: PowerPC Processing Element (PPE), and Synergistic Processing Elements (SPEs). The PPE can run standard PowerPC applications with the general GCC, but the SPEs require a special compiler that supports SPE instruction set. In this section, we explore how to build a SPE cross-toolchain that will enable you to compile programs for spu-elf architecture.

Note: OS system should be Fedora 9 on i386 or i686.

binutils

Before we go to build the spu-gcc compiler, we need to prepare binutils on the system. Commands are as follows:

===========================================================================
1. wget ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.18.tar.gz
2. tar zxvf binutils-2.18.tar.gz
3. mkdir build/binutils
4. cd build/binutils
5. ../../binutils-2.18/configure –disable-werror –prefix=/home/your_account_name/COMPILER/ –program-prefix=spu- –target=spu-elf
6. change the “makeinfo” path in the Makefile
7. make
8. make install
9. cd ../..
===========================================================================

Note:
a. You can define the installed directory by specifying something like “–prefix=/wherever_you_want”.
b. Now add the installed path to the environment variable.

Finally, we can try assembling a SPU object:

echo ‘frest 0,1’ | spu-as –

– this should complete with no error messages.

SPU-GCC

This compiler is a modified version of spu-gcc 4.1.1, which can automatically insert _fci, _fco, _p2s and _s2p library function calls by using flag -llm-manage.

1. Get spu-gcc-4.1.1_0.9 from here: [SPU-GCC compiler]

2. Put the binary into your Fedora 9

3. chmod +x spu-gcc

newlib

Now that you have a spu-compiler, we can compile newlib. The upstream version 1.15.0 version should work nicely.

===========================================================================

1. wget ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz
2. tar zxvf newlib-1.15.0.tar.gz
3. mkdir build/newlib
4. cd build/newlib
5. ../../newlib-1.15.0/configure –target=spu –prefix=/home/your_account_name/COMPILER/
6. Modify Makefile, make sure the line “MAKEINFOR = ….”, the route is correct. In Fedora 10, it mostly like “/usr/bin/makeinfo”. Or else, use command “locate makeinfo” to find the right path.
7. make
8. make install
===========================================================================

To test, we can try a complete ‘hello world’ program:

echo -e ‘#include <stdio.h>\nint main(void)’ ‘{printf(“hello world!\\n”);return 0;}’ | spu-gcc -Wall -o/dev/null  -xc –

– this should also complete with no error messages.

Runtime Library

The runtime library includes stack data management functions, _fci and _fco, heap data management functions, _malloc and _free, and pointer management functions _p2s and _s2p.

It can be download from here: [Library Code]

Testsuit

Here are some benchmarks that we use in our experiments.
They can be downloaded from here: [TestSuit]

Leave a Reply