Friday, October 7, 2011

Archlab Y86 Simulator ssim on Cygwin in Windows

This guide will help you get the simulator for:

http://csapp.cs.cmu.edu/public/simguide.pdf

Installed and running on Windows.

 

1) Install Cygwin from http://www.cygwin.com/

When prompted with the huge list of libraries / sources to install, make sure to search for and include the binaries for:

a) gcc binary

b) g++ binary

c) tcl/tk binary(ABSOLUTELY NECESSARY)

d) vim or emacs (Optional, but recommended)

e) flex (lexical analyzer)

f) bison (parser generator like yacc)

g) libX11 (source) and libX11-devel

h) make (the cygwin version of make)

i) perl (Larry Wall's Practical Extracting and Report Language)

If downloading all of these takes a while, stop downloading, rerun setup.exe and try a different mirror.

2) Learn Vim (optional but highly recommended)

3) Download archlab-handout and extract on your windows machine

4) Open cygwin and navigate to the location of archlab-handout.tar

5) Extract archlab-handout.tar (tar -xvf archlab-handout.tar)

6) Extract sim.tar

7) Edit the 'Makefile' in the newly created 'sim' directory:

Uncomment out the line about GUI.

8) Run 'make clean; make' in the archlab-handout/sim directory. If all goes well, it should compile everything wihout any errors.

9) Update tcl path.

Okay, this part is going to require a little explanation. Basically, to run the GUI you have to have some special libraries for Cygwin call TCL/TK. Okay, you've already downloaded those, but if you try to run the ssim.exe file you'll get it bombing complaining that it can't find "init.tcl" because it is trying to look for the 'share/tcl8.4' directory in the wrong place.

So, in Windows Explorer, navigate to the [cygwin install directory]/usr folder and copy the "share" directory.

Paste the 'share' directory in the [cygwin install directory].

10) Navigate to archlib-handout/sim/seq

11) Run "./ssim -g <your yo file>"

Viola, it should startup :)

I tested this out on my Windows 7 x64 machine, using the latest version of Cygwin. You cannot ssh into bert and then do this, you must run ssim.exe from your local windows machine.

No comments:

Post a Comment