SimpleScalar 3.0d Installation Guide for Ubuntu

Introduction:
This is a step-by-step installation guide for installing SimpleScalar 3.0d on Linux machines. The following steps were executed on Ubuntu 9.04, 8.10, 8.04and a few other Linux distros (with gcc-2.6.3).
Starting Up:
1. / Go to your Home folder and create a new folder: simplesim
2. / Download the following packages and place them inside simplesim(gcc compiler is included):
  • simplesim-3v0d.tgz
  • simpletools-2v0.tgz
  • simpleutils-2v0.tgz

3. / Extract them and delete the packages. This should leave the following inside simplesim:
  • binutils-2.5.2
  • f2c-1994.09.27
  • gcc-2.6.3
  • glibc-1.09
  • simplesim-3.0
  • ssbig-na-sstrix
  • sslittle-na-sstrix

4. / Open a terminal window and type:
> sudo apt-get install bison flex
> export HOST=i386-unknown-linux
> export IDIR=/home/<your_username>/simplesim
Don’t use IDIR=~/simplesim, it will raise errors later on.
binutils-2.5.2:
5. / First, configure and make binutils-2.5.2:
> cd $IDIR/binutils-2.5.2
> ./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld –-perfix=$IDIR
> make
6. / If you get any errors, fix them as follows, then ‘make’ again:
Error: / strerror.c error – conflicting types for `sys_errlist'
Solution: / gedit libiberty/functions.def
Line56: Comment the line DEFVAR(sys_errlist, char *sys_errlist[], sys_errlist[0] = 0)
Error: / ldlex.l error – ‘yy_current_buffer’ undeclared (first use in this function)
Solution: / gedit ld/ldlex.l
Line 476: Comment the line
Error: / ldmisc.c error
Solution: / > gedit ld/ldmisc.c
Line 24: use "#include <stdarg.h>" instead of "#include <varargs.h>"
Then add following 4 lines after line 35:
#define va_alist REST
#define va_dcl
#define va_start(ARGS) ARGS = &REST
#define va_end(ARGS)
If your error is not here, check the links in the references section.
7. / Once you’re done with no errors, type:
sudo make install
SimpleSim-3.0:
8. / Go to the simplesim-3.0 folder:
> cd ../simplesim-3.0
9. / Type the following:
> make config-pisa
> make
> make sim-tests
gcc-2.6.3:
10. / Go to the gcc-2.6.3 folder:
> cd ../gcc-2.6.3
11. / Type the following:
> ./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld –-perfix=$IDIR
> make LANGUAGE=c
12. / If you get any errors, fix them as follows, then ‘make’ again:
Error: / cccp.c error
Solution: / > gedit cccp.c
Add "#define HAVE_STRERROR" before line 189
Error: / sdbout.c error
Solution: / > gedit sdbout.c
Add "#undef USG" before line 56
Error: / insn-output.c error
Solution: / > gedit insn-output.c
Add ‘\’ to the end of the lines 675,750 and 823
Error: / gcc.c error
Solution: / > gedit gcc.c
Add "#define bsd4_4"before line 168
Error: / g++.c error
Solution: / > gedit cp/g++.c
Add "#define bsd4_4" atthe line 87
If your error is not here, check the links in the references section.
13. / Once you’re done with no errors, type:
> ../simplesim-3.0/sim-safe ./enquire -f >! float.h-cross
> sudo make install
Testing the cross-compiler:
14. / Type the following:
> cd $IDIR
> mkdir test
> cd test
> gedit hello.c
15. / A text editor will open up. Write this simple c program:
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
Save the file and close the editor.
16. / Now, type the following:
> cd ..
bin/sslittle-na-sstrix-gcc -o test/testHellotest/hello.c
> simplesim-3.0/sim-safe testHello
18. / You should see:
sim: ** starting functional simulation **
Hello World!
Now, you’re good to go – Congrats!
You can use sim-safe, sim-cache or sim-outorder with any SimpleScalar benchmark for your experiments. Refer to this document for more details about using each of them and their arguments.
One good benchmark to start with is Go. Usage:
> simplesim-3.0/sim-outorder go.ss 9 9 go.in
The benchmark Go.ss takes arguments “9 9 go.in”, where go.in is an empty file, and both go.ss and go.in are placed in the directory you are running in.
References:
1. /
2. /
3. /
4. /
5. /