SPIM
Encyclopedia
SPIM is a MIPS
MIPS architecture
MIPS is a reduced instruction set computer instruction set architecture developed by MIPS Technologies . The early MIPS architectures were 32-bit, and later versions were 64-bit...

 processor simulator, designed to run assembly language
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 code for this architecture. The program simulates R2000
R2000 (microprocessor)
The R2000 is a microprocessor chip set developed by MIPS Computer Systems that implemented the MIPS I instruction set architecture . Introduced in January 1986, it was the first commercial implementation of the MIPS architecture and the first merchant RISC processor available to all companies...

 and R3000
R3000
The R3000 is a microprocessor chip set developed by MIPS Computer Systems that implemented the MIPS I instruction set architecture . Introduced in June 1988, it was the second MIPS implementation, succeeding the R2000 as the flagship MIPS microprocessor...

 processors, and was written by James R. Larus while a professor at the University of Wisconsin-Madison. The MIPS machine language is often taught in college-level assembly courses, especially those using the textbook Computer Organization and Design: The Hardware/Software Interface by David A. Patterson and John L. Hennessy
John L. Hennessy
John LeRoy Hennessy is an American computer scientist and academician. Hennessy is one of the founders of MIPS Computer Systems Inc. and is the 10th President of Stanford University.-Background:...

 (ISBN 1-55860-428-6).

The name of the simulator is a reversal of the letters "MIPS".

SPIM simulators are available for Windows (PCSpim), Mac OS X and Unix/Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

-based (xspim) operating systems. As of release 8.0 in January 2010, the simulator is licensed under the standard BSD license.

In January, 2011, a major release version 9.0 features QtSpim that has a new user interface built on the cross-platform
Cross-platform
In computing, cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms...

  Qt UI framework
Qt (toolkit)
Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface , and also used for developing non-GUI programs such as command-line tools and consoles for servers...

 and runs on Windows, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

. From this version, the project has also been moved to SourceForge
SourceForge
SourceForge Enterprise Edition is a collaborative revision control and software development management system. It provides a front-end to a range of software development lifecycle services and integrates with a number of free software / open source software applications .While originally itself...

 for better maintenance. Precompiled versions of QtSpim for Linux (32-bit), Windows, and Mac OS X, as well as PCSpim for Windows are provided.
Examples of system calls (used by SPIM)
service Trap code Input Output Notes
print_int $v0 = 1 $a0 = integer to print prints $a0 to standard output
print_float $v0 = 2 $f12 = float to print prints $f12 to standard output
print_double $v0 = 3 $f12 = double to print prints $f12 to standard output
print_string $v0 = 4 $a0 = address of first character prints a character string to standard output
read_int $v0 = 5 integer read from standard input placed in $v0
read_float $v0 = 6 float read from standard input placed in $f0
read_double $v0 = 7 double read from standard input placed in $f0
read_string $v0 = 8 $a0 = address to place string, $a1 = max string length reads standard input into address in $a0
sbrk $v0 = 9 $a0 = number of bytes required $v0= address of allocated memory Allocates memory from the heap
exit $v0 = 10
print_char $v0 = 11 $a0 = character (low 8 bits)
read_char $v0 = 12 $v0 = character (no line feed) echoed
file_open $v0 = 13 $a0 = full path (zero terminated string with no line feed), $a1 = flags, $a2 = UNIX octal file mode (0644 for rw-r--r--) $v0 = file descriptor
file_read $v0 = 14 $a0 = file descriptor, $a1 = buffer address, $a2 = amount to read in bytes $v0 = amount of data in buffer from file (-1 = error, 0 = end of file)
file_write $v0 = 15 $a0 = file descriptor, $a1 = buffer address, $a2 = amount to write in bytes $v0 = amount of data in buffer to file (-1 = error, 0 = end of file)
file_close $v0 = 16 $a0 = file descriptor

Flags:

Read = 0x0, Write = 0x1, Read/Write = 0x2

OR Create = 0x100, Truncate = 0x200, Append = 0x8

OR Text = 0x4000, Binary = 0x8000

SPIM Alternatives/Competitors

MARS (MIPS Assembler and Runtime Simulator) is a Java-based IDE for the MIPS Assembly Programming Language and an alternative to SPIM. Its initial release was in 2005, and is under active development.

See also

  • GXemul
    GXemul
    GXemul is a computer architectureemulator being developed by Anders Gavare. It isavailable as free software under a revised BSD-style license.In 2005, Gavare changed the name of the software project...

     (formerly known as mips64emul), another MIPS emulator. Unlike SPIM, which focuses on emulating a bare MIPS instruction set implementation, GXemul is written to emulate full computer systems based on MIPS microprocessors—for example, GXemul can emulate a DECstation 5000 Model 200 workstation.
  • QEMU
    QEMU
    QEMU is a processor emulator that relies on dynamic binary translation to achieve a reasonable speed while being easy to port on new host CPU architectures....

     also emulates MIPS.
  • MIPS architecture
    MIPS architecture
    MIPS is a reduced instruction set computer instruction set architecture developed by MIPS Technologies . The early MIPS architectures were 32-bit, and later versions were 64-bit...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK