Initial Installation

  1. You'll need a modest amount of disk space (roughly 3MB per tree). You can set up subdirectories under /projects/cecil11/501/students; there is about 1.3 GB of free space on this partition, which should be sufficient for the project. Or you can use your own disk space if you want.
  2. The initial distribution can be found here. cd to the directory where you want to install tiger and use tar (tar xf /project/cecil11/501/tiger.tar) to extract the source code. If you downloaded before the afternoon of Jan 21, you will want to get the new version of src/Mips/MipsFrame.java.
  3. After extracting the initial version, you'll want to put the src and testcases subdirectories under some form of source control. I'd recommend using CVS, but do whatever you want.
  4. You'll need to modify the tops of .../tiger/src/makefile and ..../tiger/testcases/makefile to have the correct path information (or set up the appropriate symlink from your home directory to make the makefiles work as is).
  5. Please look here for improvements made to the Tiger compiler from the version described in the book and the documentation.

Building Tiger

  1. You'll have to have a working Java development environment. Java is installed on most of the platforms in the department, so hopefully this won't be an issue.
  2. The makefiles rely on features of gmake (found in /uns/bin); on most platforms vanilla make will not work.
  3. Typing 'gmake' in .../tiger/src will build the Tiger compiler. The initial installation includes precompiled .class files.
  4. Typing 'gmake clean' in .../tiger/src removes all generated .class, JLex, and JavaCUP files (do this if you want to ensure a rebuild from scratch).

Running Tiger

The file .../tiger/testcases/makefile contains rules for using Tiger to compiler .tig source files into .s files and for compiling/linking the .s files into executables. This year, the creation of native executables will not be the main, supported way of testing generated code. We recommend that you use SPIM to run your .s files. Right now, spim and xspim have been compiled only for linux machines. We will try to get it running on other platforms. After creating the .s file with the tiger compiler, you must concatenate this file with the runtime.s file to create a .s file that spim can read and run. For example, here's a transcript of me building the spim-readable rqueens.s from the queens.tig source file. Tolt is a Sparc/Solaris box with Java; saba is a linux box.
9 tolt:testcases >make queens.s
java -classpath /uns/lib/netscape/java/classes/java40.jar:/usr/java/lib/classes.zip:/projects/cecil8/nowitz/tiger/classes:/projects/cecil8/nowitz/tiger/JavaCUP:/projects/cecil8/nowitz/tiger/classes/JLex:/uns/share/lib/netscape:/uns/lib/netscape3.0b6:/usr/java/lib/classes.zip:/projects/cecil8/nowitz/tiger/classes:/projects/cecil8/nowitz/tiger/JavaCUP:/projects/cecil8/nowitz/tiger/classes/JLex:/uns/share/lib/netscape:/uns/lib/netscape3.0b6:.:.:/homes/fish/nowitz/501/tiger/JavaCUP:/homes/fish/nowitz/501/tiger:/homes/fish/nowitz/501/tiger/classes:/usr/java/lib/classes.zip Main.Main queens.tig

...<switch machines>...

17 saba:testcases >cat queens.s /projects/cecil11/501/SPIM/share/runtime.s > rqueens.s
18 saba:testcases >/projects/cecil11/501/linux/bin/spim
SPIM Version 6.2 of January 11, 1999
Copyright 1990-1998 by James R. Larus (larus@cs.wisc.edu).
All Rights Reserved.
See the file README for a full copyright notice.
Loaded: /projects/cecil11/501/linux/trap.handler
(spim) load "rqueens.s"
(spim) run
The following symbols are undefined:
Lruntempty

 O . . . . . . .
 . . . . O . . .
 . . . . . . . O
 . . . . . O . .
 . . O . . . . .
 . . . . . . O .
 . O . . . . . .
 . . . O . . . .

...<lots more output>...

The undefined symbol message does not seem to affect the simulation; we will let you know if a fix is made to eliminate the message.


chambers@cs.washington.edu