Simple Scalar Installation Tips

Files Needed :

  1. simpletools-2v0.tgz  from
  2. simplesim-3vd.tgz  from
  3. simpleutils-2v0.tgz  from
  4.  from
  5. May need : ar  from
  6. May need : ranlib  from

Installation Instructions :

Follow the steps below. Common problems encountered during installation are listed. These should be sufficient to install simplescalar successfully the GCL machines (recent Ubuntu). In case simplescalar throws new errors at you, please mage Google search your friend.

Step 0 :

Find the basics of the system you are working on.
Use following command to check if it's a 64-bit system :
    uname -a
If it is a 64-bit system, it might need some changes in the installation procedure.

Unzip all the installation files. Delete the folder gcc-2.6.3

Create the folder where you want to install simplescalar. Move all the uncompressed installation files into it.

Set environment variables as follows:
    export IDIR=<your-simplesclar-installation-dir>
    export HOST=i686-pc-linux
    export TARGET=sslittle-na-sstrix
    cd $IDIR

Step 1 :

Ensure required dependencies are installed. You would need build-essential, flex, bison.
In some systems, an error of the sort of "cannot find output from lex" may be thrown in spite of flex being installed.
Come around this by creating a symbolic link :
    ln -s /usr/local/bin/flex-2.5.4 flex

If doing this after seeing an error in the next step, remove current simpleutils directory & restart Step 3 with a freshly uncompressed copy. In some extreme cases, this would get reflected only after a restart!

Step 2 :

Install SimpleUtils

    cd $IDIR/simpleutils-990811

Fix these errors in the source :

Execute following commands to complete installing :
    ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$IDIR
    make CFLAGS=-O
    make install

Step 3 :

Install the simulators

    cd $IDIR/simplesim-3.0
    make config-pisa

This should work without any errors. Test the installation by ;
    ./sim-safe tests/bin.little/test-math

Step 4 :

Install gcc cross-compiler

    cd $IDIR/gcc-
    ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$IDIR
    chmod -R +w .

Fix these errors in the source :
[The last three may not be needed in some systems. But are needed in the latest Ubuntu systems].

Now run :
    make LANGUAGES=c CFLAGS=-O CC="gcc -m32"

This should throw an error : "insn-output.c:xyz: missing terminating " character".
Insert \ at the end of lines 675, 750 & 823 of file insn-output.c. The lines should look like "return "FIXME\n\"

Now run :
    make LANGUAGES=c CFLAGS=-O CC="gcc -m32"
    make enquire
    $IDIR/simplesim-3.0/sim-safe ./enquire -f > float.h-cross
    make LANGUAGES=c CFLAGS=-O CC="gcc -m32" install

In the GCL machines, that should see you through. Other problems that you are likely to encounter are below :

Step 5 :

Try it out. Simplescalar is installed now.

In a new directory, create a simple hello world C program - hello.c
Compile it using the cross-compiler with the following command :
    $IDIR/bin/sslittle-na-sstrix-gcc -o hello hello.c

Run it using a simulator :
    $IDIR/simplesim-3.0/sim-safe hello

You should see some statistics after the lines "sim: **starting functional simulation** Hello World!" as the output.


If you want to really relax, try adding the simplescalar simulator & cross-compiler directories to your PATH so as to avoid typing the entire path each time :
    export PATH=$PATH:$IDIR/bin/:$IDIR/simplesim-3.0
Add this line to your ~/.bashrc file