SPIM

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
SPIM
DeveloperJames Larus
Stable release
9.1 / July 2011; 14 years ago (2011-07)[1]
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemLinux, Mac OS X, Unix and Windows
    LicenseBSD license
    Websitespimsimulator.sourceforge.net

    SPIM is a MIPS processor simulator, designed to run assembly language code for this architecture. The program simulates R2000 and R3000 processors, and was written by James R. Larus while a professor at the University of Wisconsin–Madison.[2] 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 (Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).).

    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-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 Qt UI framework and runs on Windows, Linux, and macOS. From this version, the project has also been moved to SourceForge for better maintenance. Precompiled versions of QtSpim for Linux (32-bit), Windows, and Mac OS X, as well as PCSpim for Windows are provided.

    The SPIM operating system

    [edit | edit source]

    The SPIM simulator comes with a rudimentary operating system, which allows the programmer usage of common used functions in a comfortable way. Such functions are invoked by the syscall-instruction. Then the OS acts depending on the values of specific registers.

    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 base = 10
    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 base = 10
    sbrk $v0 = 9 $a0 = number of bytes required $v0= address of allocated memory Allocates memory from the heap
    exit $v0 = 10
    file_open $v0 = 13 $a0 = full path, $a1 = flags, $a2 = UNIX octal file mode $v0 = file descriptor example; there are read/write/close functions, too

    The SPIM OS expects a label named main as a handover point from the OS-preamble.

    SPIM Alternatives/Competitors

    [edit | edit source]

    MARS (MIPS Assembler and Runtime Simulator)[3] is a Java-based IDE for the MIPS Assembly Programming Language and an alternative to SPIM. Its initial release was in 2005.[citation needed] However, as both of its maintainers have since retired,[4][5] the project is no longer under active development.

    Imperas is a suite of embedded software development tools for MIPS architecture which uses Just-in-time compilation emulation and simulation technology. The simulator was initially released in 2008 and is under active development. There are over 30 open source models of the MIPS 32 bit [6] and 64 bit [7] cores.

    Other alternative to SPIM for educational purposes is The CREATOR simulator.[8][9][10] CREATOR is portable (can be executed in current web browsers) and allow students to learn several assembly languages of different processors at the same time (CREATOR includes examples of MIPS32 and RISC-V instructions).

    See also

    [edit | edit source]
    • GXemul (formerly known as mips64emul), another MIPS emulator. Unlike SPIM, which focuses on emulating a bare MIPS implementation, GXemul is written to emulate full computer systems based on MIPS microprocessors—for example, GXemul can emulate a DECstation 5000 Model 200 workstation
    • OVPsim also emulates MIPS, and where all the MIPS models are verified by MIPS Technologies
    • QEMU also emulates MIPS
    • MIPS architecture

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    9. ^ CREATOR Web with MIPS32 example: https://creatorsim.github.io/creator/?example_set=default&example=e12
    10. ^ CREATOR source code on GitHub: https://github.com/creatorsim/creator
    [edit | edit source]