Source:
http://www.cs.wisc.edu/~larus/spim.html

21 Dec 2005
Just got the XSPIM working on the Cygwin Linux Shell I have on my computer.
This will allow me to compile the MIPS programs I have on my computer. I noticed
the name account as well as my class account for EE 122 (Networking
Communication) do not have XSPIM installed.
Unix, Linux, or Mac OS X
(Note: the directions changed slightly for version 7.2, to reflect a new
directory structure. Please read carefully.)
Installation is a bit more complex for a Unix or Linux system, as you need to
compile the program for your particular computer and operating system.
Download either the file http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z or
http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz.
Decompress the file, using either the program uncompress for the first file or
gzip for the second file:
% uncompress spim.tar.Z
or
% gzip -d spim.tar.gz
Move the file spim.tar to the directory in which you want to build spim and
untar it:
% tar xf spim.tar
It will create a directory named spim-7.2 (or the most recent version number).
The simple terminal interface is contained in the spim-7.2/spim directory and
the X-windows interfaces is in the spim-7.2/xspim directory. The other
directories are described in the README file.
Next, you must set the directories in which spim will be installed by editing
the Makefile (the file that contains instructions on building spim). In general,
if you are installing spim and want the windowing version (xspim), edit the file
xspim/Imakefile. If you don't want xspim or are running on a system without
X-windows installed, you use the file spim/Makefile.
Set these pathnames to the appropriate locations for your system:
EXCEPTION_DIR -- The full pathname of the directory in which to install the spim
exception handler (exceptions.s).
BIN_DIR -- The full pathname of the directory in which spim and xspim should be
installed.
MAN_DIR -- The full pathname of the directory in which the manual pages for spim
and xspim should be installed.
In general, the remaining parameters in a Makefile need not be changed.
Then, if you are using Imakefile file, change to the spim-7.2/xspim directory
and type:
% xmkmf
% make
If you do not have a copy of xmkmf, you can use the Makefile in the xspim
directory, but beware that it may not work on your system because the paths to
the X windows libraries could be different.
If you do not have X-windows, change to the spim-7.2/spim directory, edit
Makefile, and type:
% make
To run spim or xspim, the exception handler must be installed in the directory
specified by the variable EXCEPTION_DIR in the Makefile. If the file exception.s
is not installed, spim and xspim fail before they start running. You can either
install this file by hand or by typing
% make install
which also installs spim or xspim, and the manual pages in the directories that
you set (above).
To test that spim is correctly built, change to the spim-7.2/spim directory and
type:
% make test
and examine the output of the test. (Note: the exception handler must be
installed before running the test.)
//Go to http://www.cs.wisc.edu/~larus/spim.html
and download source code depending on the platform you wish to use. Windows
user’s download the executable file pcspim.zip. Unzip the file and run setup.exe.
Unix users download the (.gz) file.
$ gunzip spim.tar.gz
$ tar -xvf spim.tar
$ cd spim-7.2.1/spim
$ Configure
//Skip xmkmf, not using Imakefile
$ make
$ make spim
//Need external programs
//bison - a parser generator
//flex - A fast lexical analyzer generator
//maybe I don't really need to compile spim,
//because I am only using xspim
$ cd ..
$ cd xspim/
$ make
$ make install
|