Main / CoursesAASS
Install Instructions for SimpleScalar to Run on Windows XP Under Cygwin
By: Ed Pataky
Friday, October 05, 2007
----
Step 1
- Download cygwin http://www.cygwin.com and install it
- Follow these directions: http://www.eecg.utoronto.ca/-aamodt/ece242/cygwin.html
- ... but also add the "flex" package when you install
- I suggest installing under C:\cygwin
Step 2
- run cygwin
Step 3
- check where the $HOME variable points to by using:
echo $HOME
Step 5
- setup variables
export HOST=i386-pc-cygwin
export IDIR=$HOME
Step 6
- Update your PATH variable
export PATH=$PATH:$HOME
Step 7
- Download the files below and put them in $HOME
- http://www.eecs.umich.edu/mirv/software/simpleutils-990811.tar.gz
- http://simplescalar.com/
- http://arch.cs.ucdavis.edu/RAD/
- File 1: simplesim-3v0d.tgz
- File 2: simpletools-2v0.tgz
- File 3: simpleutils-990811.tar.gz
- File 4: gcc-2.7.2.3.ss.tar.gz
Step 8
- untar the files
cd $IDIR
tar xzvf simplesim-3v0d.tgz
tar xzvf slmpletools-2v0.tgz
tar xzvf simpleutils-990811.tar.gz
tar xzvf gcc-2.7.2.3.ss.tar.gz
Step 9
- remove gcc-2.6.3
rm -rf gcc-2.6.3
Step 10
- Install simplesim.
cd $IDIR/simplesim-3.0
make config-pisa
make
make sim-tests
Step 11
- If you did not download and install flex durinq the cygwin setup, you can install flex separately, but first you need byacc.
- ftp://ftp.cs.berkeley.edu/pub/4bsd/byacc.1.9.tar.Z
- convert byacc.1.9.tar.Z to byacc.1.9.tar.gz
- (you may need to unzip then zip, use free program 7-ZIP if needed)
cd $IDIR
mkdir byacc
cp byacc.1.9.tar.gz byacc
cd byacc
tar xvfz byacc.1.9.tar.gz
rm -rf byacc.1.9.tar.gz
./configure --prefix=$HOME/byacc
make
export PATH=$HOME/byacc/:$PATH
Step 12
- download and install flex
- http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
cd $IDIR
tar xvfz flex-2.5.4a.tar.gz
cd $IDIR/flex-2.5.4
./configure --prefix=$HOME/flex-2.5.4
make
make install
export PATH=$HOME/flex-2.5.4/bin/:$PATH
export PATH=$HOME/flex-2.5.4/:$PATH
Step 13
- Installlng simpleutils
cd $IDIR/simpleutils-990811
export HOST=i386-*-linux
./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR
make all install
export PATH=$IDIR/simpleutils-990811:$PATH
- you should get some errors ... follow http://www.comp.nus.edu.sg/-panyu/simplesim.htm to fix:
- Fix 1. In insn-output.c, delete all the line breaks ('\'s) that cause a problem.
- Fix 2. Cover the original cdefs.h (under $IDIR/sslittle-na-sstrix/include/sys) with patched one under "patched" directory (which redefined _NORETURN);
- Fix 3. In objc/sendmsg.c, add "#define STRUCT VALUE 0" at line 35;
- Fix 4. In protoize.c, replace "#include <varargs.h>" at line 60 with "#include <stdarg.h>".)
Step 14
- verify simplescalar (you should get some statistical output)
cd $IDIR/simplesim-3.0
./sim-outorder tests-pisa/bin.little/test-math
Step 15
- install gcc
cd $IDIR/gcc-2.7.2.3
export HOST=i386-*-linux
- next line very important
export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin
- enable-languages option very important
./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --preflx=$IDIR --enable-languages=c,c++
make LANGUAGES="c c++"
make install
Step 16
- I really don't know what this is, but do it
- see http://www.owlnet.rice.edu/-elec525/handouts/simplescalar_readme.txt for some notes
make enquire
../simplesim-3.0/sim-safe ./enquire -f > float.h-cross
make install
Step 17
- verify compiler
cd $IDIR
mkdir dev
cd dev
- (create a file test.c and place in $IDIR/dev)
- test.c should contain: int main() { return 0; }
cd $IDIR
bin/sslittle-na-sstrix-gcc -o test dev/test.c
- (you should not get any errors)
Step 18
- run simplesim against your custom program
- If results are qenerated from this, the cross compiler is most likely installed correctly.
cd $IDIR
- example
simplesim-3.0/sim-outorder test
- [:o]>-<
- TIP: use "> out.txt 2>&1" after any command to direct to file out.txt
- Add all of the following lines to the end of the .bashrc file in $HOME
export HOME=/home/<your username>
export IDIR=$HOME
export PATH=$PATH:$HOME
export PATH=$HOME/byacc/:$PATH
export PATH=$HOME/flex-2.5.4/bin/:$PATH
export PATH=$HOME/flex-2.5.4/:$PATH
export HOST=i386-*-linux
export PATH=$IDIR/simpleutils-990811:$PATH
export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin