Main / CoursesAASS
          Install Instructions for SimpleScalar to Run on Windows XP Under Cygwin
By: Ed PatakyFriday, 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-cygwinexport 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 $IDIRtar xzvf simplesim-3v0d.tgztar xzvf slmpletools-2v0.tgztar xzvf simpleutils-990811.tar.gztar 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.0make config-pisamakemake 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 $IDIRmkdir byacccp byacc.1.9.tar.gz byacccd byacctar xvfz byacc.1.9.tar.gzrm -rf byacc.1.9.tar.gz./configure --prefix=$HOME/byaccmakeexport PATH=$HOME/byacc/:$PATH
 
Step 12
- download and install flex
 - http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
cd $IDIRtar xvfz flex-2.5.4a.tar.gzcd $IDIR/flex-2.5.4./configure --prefix=$HOME/flex-2.5.4makemake installexport PATH=$HOME/flex-2.5.4/bin/:$PATHexport PATH=$HOME/flex-2.5.4/:$PATH
 
Step 13
- Installlng simpleutils
cd $IDIR/simpleutils-990811export HOST=i386-*-linux./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIRmake all installexport 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.3export 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-crossmake install
 
Step 17
- verify compiler
cd $IDIRmkdir devcd dev - (create a file test.c and place in $IDIR/dev)
 - test.c should contain: int main() { return 0; }
 cd $IDIRbin/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=$HOMEexport PATH=$PATH:$HOMEexport PATH=$HOME/byacc/:$PATHexport PATH=$HOME/flex-2.5.4/bin/:$PATHexport PATH=$HOME/flex-2.5.4/:$PATHexport HOST=i386-*-linuxexport PATH=$IDIR/simpleutils-990811:$PATHexport PATH=$PATH:$IDIR/sslittle-na-sstrix/bin
 

