Spim Mips Simulator
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Spim Mips Simulator

on

  • 12,288 views

A brief introduction on SPIM simulator, install instructions and first run

A brief introduction on SPIM simulator, install instructions and first run

Statistics

Views

Total Views
12,288
Views on SlideShare
12,268
Embed Views
20

Actions

Likes
1
Downloads
100
Comments
1

2 Embeds 20

http://www.slideshare.net 19
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Spim Mips Simulator Presentation Transcript

  • 1. SPIM: a MIPS simulator Michele Chinosi michele.chinosi@uninsubria.it University of Insubria - Varese (IT) 26.11.2008 Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 1 / 22
  • 2. Outline 1 Introduction Getting started with SPIM SPIM installation Documentation 2 XSPIM Getting started with xspim Load and execute programs 3 Conclusions Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 2 / 22
  • 3. The SPIM simulator SPIM SPIM is a MIPS R2000/R3000 RISC computer simulator Website http://www.cs.wisc.edu/∼larus/spim.html Version The current version of SPIM is 7.3 (August 2006) Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 3 / 22
  • 4. A screenshot of SPIM Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 4 / 22
  • 5. Some features SPIM: can read and immediately execute files containing assembly language provides a simple debugger and minimal set of operating system services does not execute binary (compiled) programs implements almost the entire MIPS32 assembler-extended instruction set comes with complete source code and documentation implements both a simple, terminal-style interface and a grafical user interface Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 5 / 22
  • 6. User interfaces Unix, Linux, Mac OS X On Unix, Linux and Mac OS X the spim program provides a simple terminal interface and the xspim program provides the windowing interface Microsoft Windows On Microsoft Windows the spim program provides a console interface and the PCSpim program provides a Windows interface Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 6 / 22
  • 7. Terminal-style interface Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 7 / 22
  • 8. Xspim interface Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 8 / 22
  • 9. PCSpim interface Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 9 / 22
  • 10. How to install SPIM on Microsoft Windows It’s very simple! 1 Download SPIM from http://www.cs.wisc.edu/∼larus/SPIM/pcspim.zip and save it on your machine 2 Unzip the file 3 Click on the setup.exe program Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 10 / 22
  • 11. How to install SPIM on Unix, Linux and Mac OS X It’s not so simple... 1 Download SPIM from http://www.cs.wisc.edu/∼larus/SPIM/spim.tar.gz 2 Move the file spim.tar.gz to the directory in which you want to build spim and decompress it: $ tar -zxvf spim.tar.gz 3 It will create a directory named spim-7.3 (or the most recent version number) 4 The simple terminal interface is contained in the spim-7.3/spim directory and the X-window interface is in the spim-7.3/xspim directory Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 11 / 22
  • 12. How to install SPIM on Unix, Linux and Mac OS X (2) It’s not so simple... 5 You must set the directories in which spim will be installed by editing the Makefile (the file that contains instructions on building spim). xspim → xspim/Imakefile spim → spim/Makefile. 3 pathnames: EXCEPTION DIR, BIN DIR, MAN DIR. 6 If you are using Imakefile file, change to the spim-7.3/xspim dir and type: $ xmkmf $ make 7 If you do not have X-windows, change to the spim-7.3/spim dir and type: $ make 8 To run spim or xspim, you have to install the exception handler (exceptions.s). Thus, become root and type: # make install 9 To test that spim is correctly build, from spim-7.3/spim type: $ make test Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 12 / 22
  • 13. How to install SPIM on Unix, Linux and Mac OS X (3) But... If you are using a Debian-based distribution (like Ubuntu, Mepis, Xandros, Knoppix), it is enough to run: user@system:$ sudo apt-get install spim or the equivalent package management system for your Linux distro: synaptic aptitude ... Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 13 / 22
  • 14. How to install SPIM That’s it! For further information, please visit: http://www.cs.wisc.edu/∼larus/spim.html Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 14 / 22
  • 15. Documentation Where to find some other references Patterson & Hennessy, Computer Organization and Design: The hardware/software interface, Appendix A MIPS32 Architecture for Programmers Volume I,II,III, the official documentation provided by MIPS Inc. Other two books edited by Morgan Kaufmann: See MIPS run, written by Dominic Sweetman The MIPS programmer’s handbook, written by Erin Farquhar and Philip Bunce Getting started with [spim|xspim|PCSpim], a simple overview of these three alternatives SPIM Command-Line Options, a simple tutorial http://www.google.com Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 15 / 22
  • 16. Let’s start using xspim How to start xspim To start xspim go to spim-7.3/xspim directory and type: $ xspim When xspim starts up, it pops up a large window on your screen. This window is divided into five panes: Register display Control buttons text segment data and stack segment SPIM messages Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 16 / 22
  • 17. Xspim window Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 17 / 22
  • 18. Xspim window (ctd.) Register display This pane shows the values of all registers in the MIPS CPU and FPU. This display is updated whenever your program stops running Control buttons These buttons let us interact with simulator. We will discuss more in details about them later on. Text segments This pane displays instructions from both your program and the system code that is loaded automatically when xspim starts running. Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 18 / 22
  • 19. Xspim window (ctd.) Data and Stack segments This pane displays the data loaded into your program’s memory and the data on the program’s stack. SPIM messages The bottom pane is used by xspim to write messages. This is where error messages appear. Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 19 / 22
  • 20. Load and Run Load program into xspim Once you have started xspim, you can load a new program simply clicking on Load button. Then select the file you want to execute and confirm. SPIM loads your program into text segment, and redraws panes to see program data. Run program To run your program, simply click on Run button. If you don’t see your instruction in the text segment click on the scrollbar on the left of panes. Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 20 / 22
  • 21. spim and PCSpim The instructions for command-line version and Microsoft Windows version are on documents already presented. It is recommended that you read carefully all the documentation provided with SPIM simulator in order to execute properly your programs. Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 21 / 22
  • 22. Conclusions Which of the three version of SPIM you have to use? You are free to use simple command-line spim version rather than PCSpim version or xspim verson. It is suggested to use xspim. And now... let’s play with SPIM! Michele Chinosi (Univ. Insubria) SPIM: a MIPS simulator 26.11.2008 22 / 22