CS211 Dr. Narahari SimpleScalar Install Guide (updated) This document is a guide for installing SimpleScalar, targeted for the PISA architecture, on a Linux system. This guide has been tested on Ubuntu 4.0. 1. Download SimpleScalar Tool Set You may find these files useful: install_guide_v2.txt, users_guide_v2.pdf These can be found on the SimpleScalar website, http://www.simplescalar.com/docs.html You need the following files before installing: simplesim-3v0d.tgz simpleutils-2v0.tgz simpletools-2v0.tgz gcc-2.7.2.3.ss.tar.gz They can be found at the following locations: simplesim, simpletools & simpleutils: http://www.simplescalar.com/tools.html gcc: http://arch.cs.ucdavis.edu/RAD/gcc-2.7.2.3.ss.tar.gz 2. Untar the source code Untar the source code into a simplesim directory mkdir simplesim (wherever you want to put this...you can name it whatever) tar xzvf (the z flag unzips a gzip file as well as untars it.... if you have straight tar files then use tar xvf ) In simpetools-2v0.tgz, there is a gcc-2.6.3 compiler. Since we don't need this, delete it. rm -rf gcc-2.6.3 Note: Before installing simple scalar package, make sure your system has the following packages installed: C library header: libc6-dev binutils flex bison In Ubuntu you can just say: sudo apt-get install 3. Install Setup environment variables for easy install. export HOST=i386-unknown-linux export IDIR=/home/your-login-name/simplescalar (or your install directory's name) Install simpleutils. cd $IDIR/simpleutils-990811 ./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR make --If errors show up during the process, apply the following fixes: insert a semi-colon (;) at line 77 of simpleutils-990811/binutils/arparse.y file. insert a semi-colon (;) at line 168 of simpleutils-990811/ld/ldgram.y file. --If error is about "yy_input", apply the following fix: find . -type f -print0 | xargs -0 sed -i -e 's,yy_current_buffer,YY_CURRENT_BUFFER,g' make install Install simplesim. cd $IDIR/simplesim-3.0 make config-pisa make make sim-tests Install gcc. cd $IDIR/gcc-2.7.2.3 ./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR make LANGUAGES="c c++" CFLAGS="-O3" CC="gcc" lots of errors will show up during this process, apply the following fixes: (from http://fdemesmay.dyndns.org/cs/hacks/SimpleScalarInstallation) - For insn-output.c error: In insn-output.c, add line breaks ('\') after each of the three FIXME (line 675, 750 and 823) - For decl.c "invalid increment"error: edit obstack.h (remember to 'chmod +w' this file) at line 341 and change "*((void **)__o->next_free)++=((void *)datum);\" to "*((void **)__o->next_free++)=((void *)datum);\" - For parse error in libgcc2.c: In libgcc2.c, add "#define BITS_PER_UNIT 8" to the 98th line. - For parse error in stdio.h: update the original cdefs.h (under $IDIR/sslittle-na-sstrix/include/sys) with patched one (under $IDIR/gcc-2.7.2.3/patched/sys) make install LANGUAGES="c c++" CFLAGS="-O3" CC="gcc" 4. Verify First verify that simplesim is installed correctly. cd $IDIR/simplesim-3.0 ./sim-outorder tests-pisa/bin.little/test-math If results are generated from this, simplesim is most likely installed correctly. Next verify that the cross-compiler is working. Create a basic C program (like the "hello world" program), name it test.c, and place it in a new directory called dev. cd $IDIR mkdir dev cd dev (create test.c and place in $IDIR/dev) cd $IDIR bin/sslittle-na-sstrix-gcc -o test dev/test.c simplesim-3.0/sim-outorder test If results are generated from this, the cross compiler is most likely installed correctly.