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