1
.\" $Header: /Software/SPIM/src/spim.man 4 12/24/00 1:37p Larus $
5
spim \- A MIPS R2000/R3000 Simulator
12
\fI-mapped_io/-nomapped_io\fP
14
\fI-delayed_branches\fP
26
\fI-file file <args>\fP \fI-execute file <args>\fP \|]
29
SPIM S20 is a simulator that runs programs for the MIPS R2000/R3000
30
RISC computers. (For a description of the real machines, see Gerry
31
Kane and Joe Heinrich, \fIMIPS RISC Architecture,\fP Prentice Hall,
32
1992.) SPIM can read and immediately execute files containing assembly
33
language or MIPS executable files. SPIM is a self-contained system
34
for running these programs and contains a debugger and interface to a
35
few operating system services.
37
SPIM comes in two versions. The plain version is called \fIspim\fP.
38
It runs on any type of terminal. It operates like most programs of
39
this type: you type a line of text, hit the \fIreturn\fP key, and
40
\fIspim\fP executes your command. The fancier version of SPIM is
41
called \fIxspim\fP. It uses the X-window system, so you must have a
42
bit-mapped display to run it. \fIxspim\fP, however, is a much easier
43
program to learn and use because its commands are always visible on
44
the screen and because it continually displays the machine's
48
\fIspim\fP has many options:
51
Simulate the virtual MIPS machine provided by the assembler. This is
55
Simulate a bare MIPS machine without pseudo-instructions or the
56
additional addressing modes provided by the assembler. Implies
60
Load the standard exception handler and startup code. This is the default.
63
Do not load the standard exception handler and startup code. This
64
exception handler handles exceptions. When an exception occurs, SPIM
65
jumps to location 0x80000080, which must contain code to service the
66
exception. In addition, this file contains startup code that invokes
67
the routine \fImain\fP. Without the startup routine, SPIM begins
68
execution at the instruction labeled \fI__start\fP.
71
Print a message when an exception occurs. This is the default.
74
Do not print a message at exceptions.
76
.IP \fB-mapped_io\fP 10
77
Enable the memory-mapped IO facility. Programs that use SPIM syscalls
78
to read from the terminal \fBcannot\fP also use memory-mapped IO.
80
.IP \fB-nomapped_io\fP 10
81
Disable the memory-mapped IO facility.
83
.IP \fB-delayed_branches\fP 10
84
Simulate MIPS's delayed control transfers by executing the instruction after
85
a branch, jump, or call before transferring control. SPIM's default is to
86
simulate non-delayed transfers, unless the -bare flag is set.
88
.IP \fB-delayed_loads\fP 10
89
Simulate MIPS's original, non-interlocked load instructions. SPIM's default
90
is to simulate non-delayed loads, unless the -bare flag is set.
92
.IP "\fB-stext size\fP \fB-sdata size\fP \fB-sstack size\fP \fB-sktext size\fP \fB-skdata size\fP" 10
93
Sets the initial size of memory segment \fPseg\fP to be \fIsize\fP
94
bytes. The memory segments are named: \fItext\fP, \fIdata\fP,
95
\fIstack\fP, \fIktext\fP, and \fIkdata\fP. The \fItext\fP segment
96
contains instructions from a program. The \fIdata\fP segment holds
97
the program's data. The \fIstack\fP segment holds its runtime stack.
98
In addition to running a program, SPIM also executes system code that
99
handles interrupts and exceptions. This code resides in a separate
100
part of the address space called the \fIkernel\fP. The \fIktext\fP
101
segment holds this code's instructions and \fIkdata\fP holds its data.
102
There is no \fIkstack\fP segment since the system code uses the same
103
stack as the program. For example, the pair of arguments \fI-sdata
104
2000000\fP starts the user data segment at 2,000,000 bytes.
106
.IP "\fB-ldata size\fP \fB-lstack size\fP \fB-lkdata size\fP" 10
107
Sets the limit on how large memory segment \fIseg\fP can grow to be
108
\fIsize\fP bytes. The memory segments that can grow are \fIdata\fP,
109
\fIstack\fP, and \fIkdata\fP.
111
.IP "\fB-file file <args>\fP" 10
112
Load and execute the assembly code in the file with arguments \fB<args>\fP.
114
.IP "\fB-execute file <args>\fP" 10
115
Load and execute the MIPS \fIexecutable\fP (a.out) file with arguments
116
\fB<args>\fP. Only works on systems using a MIPS processors.
119
Instruction opcodes cannot be used as labels.
124
James R. Larus, ``SPIM S20: A MIPS R2000 Simulator,''
125
included with SPIM distribution.
128
James R. Larus (larus@cs.wisc.edu), Computer Sciences Department,
129
University of Wisconsin\-Madison.
130
Current address: James R Larus (larus@microsoft.com), Microsoft Research.