|Old Address||Current Address|
|Computer Sciences Department
1210 West Dayton Street
University of Wisconsin
Madison, WI 53706
One Microsoft Way
Redmond, WA 98052
spim is a self-contained simulator for running MIPS R2000/R3000 assembly language programs. It reads and immediately executes assembly language code for this processor. spim provides a simple debugger and simple set of operating system services.
spim implements almost the entire MIPS assembler-extended instruction set for the R2000/R3000 (It omits some of the complex floating point comparisons and details of the memory system page tables.) The MIPS architecture has evolved considerably since then (in particular, from 32 to 64 bits), which means that spim will not run programs compiled for recent MIPS or SGI processors.
spim comes with complete source code and documentation. It also include a torture test to verify a port to a new machine.
spim implements both a simple, terminal-style interface and a visual windowing interface. On Unix, the spim program provides a terminal interface and the xspim program provides an X window interface. On PCs, the spim program provides a DOS interface or console interface and PCSpim provides a Windows interface..
|Unix or Linux system||spim
(Windows 95, 98, NT, 2000)
To run spim or xspim on a Unix or Linux system, copy either the compressed tar file (http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z) or the gzip'ed tar file (http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz). Both files contains source and must be compiled for a particular platform.
To run PCspim on a PC under Microsoft Windows, download the file http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip, unzip it, and run setup.exe (instructions: postscript.).
Source for the PC version (both PCspim and spim) is available separately in the file ftp://ftp.cs.wisc.edu/pub/spim/pcspim_src.zipTo run spim on a PC under MS/DOS, copy the file http://www.cs.wisc.edu/~larus/SPIM/spimdos.exe
There is no Macintosh version of spim (Yes, there should be).
Morgan Kaufmann has generously provided an on-line version of Appendix A from Hennessy & Patterson, Computer Organization and Design: The Hardware/Software Interface (as a Adobe PDF file). This is a more complete and up-to-date version of spim documentation included with spim.
The documentation included with spim is also online (as a postscript or Adobe PDF file). However Appendix A of Hennessy & Patterson, Computer Organization and Design: The Hardware/Software Interface, is a more complete and accurate description of the MIPS architecture and spim software.
There is some documentation for the Windows interface to spim: postscript or Adobe PDF file.
The reference manual for the MIPS architecture (including processors later than the R2000/R3000) is: Gerry Kane and Joe Heinrich, MIPS RISC Architecture, Prentice Hall, Englewood Cliffs, N.J. 07632 ISBN 0-13-1059254.
Another good book for MIPS R2000 and R3000 programmers is: Erin Farquhar and Philip Bunce, The MIPS Programmer's Handbook, Morgan Kaufmann, San Francisco, CA, 1994, ISBN 1-55860-297-6.
However, the best book for MIPS programmers is: Dominic Sweetman, See MIPS Run, Morgan Kaufmann, San Francisco, CA, 1999, ISBN 1-55860-410-3.
The current version of spim is 6.4, which contains the following changes from version 6.3:
PCSpim no longer shifts the focus of the register and data segments when values change.
Fixed bug in the expansion of USH pseudo-op.
Add system calls for open, close, read, and write.
Fixed the Configure file to work with Mac OSX.
Made the REM pseudo-op require 3 arguments.
Fixed PCSpim dumping code to dump contents of console window.
Treat LUI's immediate value as unsigned, as it is not sign extended.
More error checking for malformed programs.
Make symbol "main" as global.
Avoid clearing last few bytes of data segments when they expand.
Check that high-order 4 bits in jump instruction's PC match bits in target PC.
The previous version of spim is 6.3, which contains the following changes from version 6.2:
PCSpim interface simplified to 4 fixed panes, similar to xspim, which permit cut and paste.
PCSpim console stays on the screen after assembly program terminates.
Comments in assembly source displayed in text segment.
NOP is standardized to sll $0 $0 0 (= 0x00000000)
Fixed several bugs and missed optimization in computing immediate values in lw/sw instruction sequences.
High 2 bits in negative branch offsets were incorrect.
Display floating point registers with up to 18 digits of precision.
New spim command (print_all_regs) prints all registers.
Minor changes to compile spim under cygwin for Windows.
Validate the range of immediate values in MIPS (but not pseudo) instructions.
Fixed display of stack with non-word aligned $sp.
-delayed-branches Simulate MIPS delayed control transfers for branches, jumps, and calls
-delayed-loads Simulate MIPS non-interlocked loads.
spim is copyrighted by James Larus. The DOS and Windows ports were done by David A. Carley and are copyrighted by Morgan Kaufmann Publishers. spim can be freely used and distributed for non-commercial purposes (see the README file for details).
spimsal is an old version of spim that ran on PCs running Windows 3.1 and Macintoshes. spimsal implements an extended version of the MIPS instruction set and is based on an old version of spim. It also does NOT run under Windows '95 or Windows NT. If you used this program on PCs and do not need the SAL instructions, you should get the new version.