Computer Sciences Dept.

CS/ECE 354 Machine Organization and Programming

Fall 2008 Section 1
Instructor Mark D. Hill
TAs Mark Liu & Somayeh Sardashti

Invocation of simulator (simple MIPS assembly language programs)

For Fall 2008, invoke the simulator with the command:

/p/course/cs354-common/public/bin/sim354 -file source.s

The third command-line argument is the name of a MAL source code file; it is source.s in this sample command line. It is conventional for assembly language source code files to have the suffix .s on Unix machines.

You will be able to invoke the simulator with

sim354 -file source.s
if you (again) change your path to add
/p/course/cs354-common/public/bin

Invocation of simulator (kernel plus MIPS assembly language program)

For the last assignment of the semester, we use the simulator while substituting its implied kernel with our own. To do this, the command-line arguments change. Assuming that your path is set, invoke the simulator with

sim354 -notrap -quiet -memio -file source.s
Note that the file source.s (or whatever file name used for this argument) must have both the kernel code and the user application code.

Note that the simulator is compiled to execute on a Linux machine. For this Fall 2008 semester, we are using the instructional Centos 4 Linux machines that are given the names emperorXX and royalXX, where XX is substituted with the number of one of these machines. There are 40 emperor machines, numbered 01 to 40, and there are 30 royal machines, numbered 01 to 30.

What you see

There are 5 portions (panes) of the window that the simulator displays.

  1. Registers. Each register's value is displayed (in hexadecimal).
  2. Control Buttons. Place the cursor over a button, and click to activate.
  3. Text segment. For each instruction, the address (given in hexadecimal within square brackets), machine code (again given in hexadecimal), and assembly language version of the instruction are displayed. You will also see (as a comment) the MAL version of a pseudoinstruction that needed to be synthesized into one or more actual MIPS RISC R2000 instructions. The simulator simulates MIPS R2000 instructions. To see portions that are not currently displayed, left click over this pane, and move the cursor in the direction that you wish to be further displayed.
  4. Data and Stack segments. For Fall 2008, contents of words are given in big endian order.
  5. Messages. When the assembler encounters errors, it displays them within this pane.

User Interface

Click on buttons to perform desired simulation operations. Many of the operations require further information that is obtained with the use of a dialog box.

  • quit
    Exit from the simulator. A dialog box requests confirmation to quit.
  • load
    Read a source or executable file into the simulated computer's memory. As a side effect, the PC is set to the starting address within the text segment.
  • run
    Begin simulating instructions, starting with the instruction currently specified by the PC. Address 0x00400000 is the normal starting address at which code is placed.
  • step
    Simulate a single instruction, the one currently specified by the PC.
  • clear
    Clear the contents of registers or clear both registers and memory (stack and text sections).
  • set value
    Set the value of a register or memory location. The user specifies which register with one of the following syntax:
    3   $3   r3   R3  v1   $v1
    
    Note that the literal form implies the register number. A memory location is specified by giving a hexadecimal address. The prefix 0x is the required syntax.
  • print
    Display the contents of one or more memory locations within the messages window. User specifies starting and ending addresses in hexadecimal. If no value is entered as an ending address, then only the contents at the starting address are displayed.
  • breakpoint
    Set, delete, or list all breakpoints.
  • help
    Display a short list of each of the commands.
  • halt
    Stop the simulator from executing code.
  • terminal
    Show or hide the console or terminal 2 windows.
  • mode
    Set the mode to bare, quiet, or memio.

 
Computer Sciences | UW Home