This is an old revision of the document!


Installing the Simplescalar compiler toolchain

Get the precompiled binaries ssgcc.tbz from here: SS Toolchains. Launch a cygwin32 terminal. Do the following:

cd /usr/local/; bunzip2 -c /pathto/ssgcc.tbz | tar xvf - This will unpack the binaries and libraries under /usr/local/ss. The binaries are under /usr/local/ss/v3/bin. Look for the files starting with sslittle-na-sstrix-.

For example, the gcc compiler for the PISA instruction set we will be using is the /usr/local/ss/v3/sslittle-na-sstrix-gcc.

Test that the compiler works:

cd ~ mkdir sstest cd sstest

Create a c file, say hello.c, containing a simple printf. Something like this:

#include <stdio.h> main() { printf (“hello\n”); }

Then compile it:

/usr/local/ss/v3/sslittle-na-sstrix-gcc -O hello.c -o hello' Check if things look alright: file hello Should return: hello: MIPSEL ECOFF executable (paged) not stripped - version 2.11 Also do this: /usr/local/ss/v3/sslittle-na-sstrix-gcc -S hello.c It should generate a file hello.s. Open it and it should be assembly for PISA (looks nearly identical to MIPS). Another very useful tool is ss…-objdump. It allows you to inspect binary files such as object files and executables. You can use it for example to find our which virtual address a function or a variable has been mapped. Try this command: /usr/local/ss/v3/bin/sslittle-na-sstrix-objdump –syms hello > hello.syms''

Look in hello.syms to find all the symbols that are defined. YOu should be able to find _main in there, the address where your main function has been compiled to.