Recent Changes
Search:

:: Personal ::

E

Main / CoursesAASS

Install Instructions for SimpleScalar to Run on Windows XP Under Cygwin

By: Ed Pataky
Friday, October 05, 2007
----

Step 1

  1. Download cygwin http://www.cygwin.com and install it
  2. Follow these directions: http://www.eecg.utoronto.ca/-aamodt/ece242/cygwin.html
  3. ... but also add the "flex" package when you install
  4. I suggest installing under C:\cygwin

Step 2

  1. run cygwin

Step 3

  1. check where the $HOME variable points to by using:
    echo $HOME

Step 5

  1. setup variables
    export HOST=i386-pc-cygwin
    export IDIR=$HOME

Step 6

  1. Update your PATH variable
    export PATH=$PATH:$HOME

Step 7

  1. Download the files below and put them in $HOME
  2. http://www.eecs.umich.edu/mirv/software/simpleutils-990811.tar.gz
  3. http://simplescalar.com/
  4. http://arch.cs.ucdavis.edu/RAD/
  5. File 1: simplesim-3v0d.tgz
  6. File 2: simpletools-2v0.tgz
  7. File 3: simpleutils-990811.tar.gz
  8. File 4: gcc-2.7.2.3.ss.tar.gz

Step 8

  1. 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

  1. remove gcc-2.6.3
    rm -rf gcc-2.6.3

Step 10

  1. Install simplesim.
    cd $IDIR/simplesim-3.0
    make config-pisa
    makemake sim-tests

Step 11

  1. If you did not download and install flex durinq the cygwin setup, you can install flex separately, but first you need byacc.
  2. ftp://ftp.cs.berkeley.edu/pub/4bsd/byacc.1.9.tar.Z
  3. convert byacc.1.9.tar.Z to byacc.1.9.tar.gz
  4. (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

  1. download and install flex
  2. 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

  1. 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
  2. you should get some errors ... follow http://www.comp.nus.edu.sg/-panyu/simplesim.htm to fix:
  3. Fix 1. In insn-output.c, delete all the line breaks ('\'s) that cause a problem.
  4. Fix 2. Cover the original cdefs.h (under $IDIR/sslittle-na-sstrix/include/sys) with patched one under "patched" directory (which redefined _NORETURN);
  5. Fix 3. In objc/sendmsg.c, add "#define STRUCT VALUE 0" at line 35;
  6. Fix 4. In protoize.c, replace "#include <varargs.h>" at line 60 with "#include <stdarg.h>".)

Step 14

  1. verify simplescalar (you should get some statistical output)
    cd $IDIR/simplesim-3.0
    ./sim-outorder tests-pisa/bin.little/test-math

Step 15

  1. install gcc
    cd $IDIR/gcc-2.7.2.3
    export HOST=i386-*-linux
  2. next line very important
    export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin
  3. 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

  1. I really don't know what this is, but do it
  2. 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

  1. verify compiler
    cd $IDIR
    mkdir dev
    cd dev
  2. (create a file test.c and place in $IDIR/dev)
  3. test.c should contain: int main() { return 0; }
  4. cd $IDIR
    bin/sslittle-na-sstrix-gcc -o test dev/test.c
  5. (you should not get any errors)

Step 18

  1. run simplesim against your custom program
  2. If results are qenerated from this, the cross compiler is most likely installed correctly.
    cd $IDIR
  3. example
    simplesim-3.0/sim-outorder test
  4. [:o]>-<
  5. TIP: use "> out.txt 2>&1" after any command to direct to file out.txt
  6. 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