1 README FILE FOR SPIM, XSPIM, and PCSPIM 2 ======================================= 3 4This directory contains SPIM--an assembly language MIPS R2000/R3000 5simulator. SPIM is covered by a BSD license. 6 7Copyright (c) 1990-2010, James R. Larus. 8All rights reserved. 9 10Redistribution and use in source and binary forms, with or without modification, 11are permitted provided that the following conditions are met: 12 13Redistributions of source code must retain the above copyright notice, 14this list of conditions and the following disclaimer. 15 16Redistributions in binary form must reproduce the above copyright notice, 17this list of conditions and the following disclaimer in the documentation and/or 18other materials provided with the distribution. 19 20Neither the name of the James R. Larus nor the names of its contributors may be 21used to endorse or promote products derived from this software without specific 22prior written permission. 23 24THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 28LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 30GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 35 36 37 BUILDING SPIM 38 ============= 39 40These instructions explain how to compile and install spim and xspim. 41 42It is not necessary to compile PCSpim (the Microsoft Windows version), as 43the spim web site contains a precompiled version. 44 45To build spim (the terminal version) or xspim (the X-windows and Mac 46version): 47 481. Change to the directory "spim" to build spim. Change to the directory 49"xspim" to build xspim 50 512. If necessary, edit the first few non-comment lines of the Makefile (or 52the Imakefile if you are building xspim) to set the pathnames for your 53system: 54 55 EXCEPTION_DIR -- The full pathname of the directory in which to 56 install the SPIM exception handler. 57 58 BIN_DIR -- The full pathname of the directory in which spim and 59 xspim should be installed. 60 61 MAN_DIR -- The full pathname of the directory in which the manual 62 pages for spim and xspim should be installed. 63 64In general, the remaining parameters need not be changed. 65 66 673. If you are building spim type: 68 69 % make 70 71 724. If you are building xspim, type: 73 74 % xmkmf 75 % make 76 775. To run spim or xspim, the exception handler code must be installed in the 78directory specified by the variable EXCEPTION_DIR in the Makefile. If the 79file "exceptions."s is not installed, spim and xspim fail with a message 80before they start running. You can either install this file by hand or by 81typing 82 83 % make install 84 85which also installs spim, xspim, and the manual pages in the directories 86that you set (above). If you use the default paths, then you will need root 87permissions to install the files, so instead type: 88 89 % sudo make install 90 91This will prompt you for the root password. 92 93 946. To test that spim builds correctly, in the "spim" directory type 95 96 % make test 97 98and examine the output of the test. (Note: the exception handler must be 99installed before running the test.) 100 101 102 BUILDING SPIM ON MICROSOFT WINDOWS 103 ================================== 104 105spim (the terminal version) works well on Microsoft Windows. You can easily 106build it using the Cygwin port of the GNU tools (see www.cygwin.com). 107 108The Microsoft Windows version of spim is called PCSpim and is built using 109Microsoft Visual Studio. You can get the files separately from 110www.cs.wisc.edu/~larus/spim.html 111 112 113 114 NEW VERSIONS OF SPIM 115 =================== 116 117I generally release new version of SPIM once a year, before a semester 118boundary (late August or early January). The new version are available on: 119 120 www.cs.wisc.edu/~larus/spim.html 121 122 123 124This directory contains several files and subdirectories: 125 126README This file. 127 128VERSION 129 Version number of system. 130 131ChangeLog 132 Record of changes to spim code. 133 134Documentation/TeX 135 TeX document that describes SPIM. 136 137Documentation/H_P_AppendixA 138 Copy of Appendix A from Hennessey & Patterson's book "Computer 139Organization and Design". This more up-to-date than the TeX documentation. 140 141PCSpim 142 Microsoft Windows interface to SPIM 143 144Setup 145 Installer code for PCSpim. 146 147spim 148 Terminal interfaces to spim (Microsoft Windows, Unix, and Mac). 149 150Tests 151 Subdirectory contain torture tests to verify that SPIM works. 152 153xspim 154 X-Windows interface to spim (Unix and Mac). 155 156 157 158 WHAT ABOUT SPIM ON SYSTEM XYZ? 159 ============================== 160 161SPIM should run without many changes on many Unix systems. Obviously, 162I have not tested SPIM on many system, nor can I port SPIM to systems 163that I don't have. However, I would like to hear about the changes 164necessary to run SPIM on your favorite system. 165 166James Larus 167Microsoft Research 168(larus@microsoft.com) 169