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.

Tuesday, September 27, 2011

Spring Actionscript 2.0 beta

So I've begun to work with Roland Zwaga to try out the new Spring Actionscript 2.0 framework. I'm giving serious thought to whether I have time an energy what with all my 18 credit hours of school to help out with the project. I would probably start by just cleaning up code and commenting... The way I learn best.

Ultimate goal is to get projects at work fully integrated into a modern AOP and IOC framework.

Stay tuned!

Sunday, September 25, 2011

Maven 2 and 3 on the Same Windows Install

 

This is my first post! Forget the long-winded "welcome to my blog", let's get down to business.

Setting Up Maven 2 and 3 on the Same Machine

Requirements at work dictated I needed to set up my local machine to run both versions of Maven at the same time. Here is how to do this:

Step 1: Install Maven 2 and 3

I installed Maven 2 in C:\mvn and Maven 3.0.3 in C:\mvn3, using short names for easy memory.

Both can be downloaded at http://maven.apache.org/download.html.

Step 2: Rename Maven 3 Files

The problem in using both Maven 2 and 3 from command line is that they both have the same batch file name, executable file name, and use the same environment variables.

To remedy this, we need to swap all shared variable and file names in Maven 3 so that there are no collisions.

1) Rename [path to maven 3]/bin/mvn to mvn3.
2) Rename [path to maven 3]/bin/mvn.bat to mvn3.bat

Step 3: Replace variables in mvn3.bat

To set up your mvn3.bat, simply open it in a text editor and make the following replacements:

"M2_HOME" -> "M3_HOME"
"mvn.bat" -> "mvn3.bat"

Step 4: Environment Variables

Now you simply need to:

1) Add both maven 2's bin directory and maven 3's bin directory to your system PATH.
2) Add M2_HOME and M3_HOME to your system path, making sure they point to the different installation locations for both versions.

Finished!

There we go! Restart your command prompt / Cygwin and "mvn" will now run Maven 2 and "mvn3" will now run Maven 3.

Thanks to Shaun Husain for setting me on the right track with this process.