Project Page

 

 

For this project you will create a simple MIPS simulator. Your MIPS simulator will be capable of loading a specified MIPS binary file (or text file) and outputting the assembly code equivalent and the cycle-by-cycle simulation of the MIPS binary code.

This project is split into three parts.

  • Part I will be to create the disassembler. Your program will be capable of loading a provided binary file (or text file) and displaying the MIPS assembly code equivalent along with the binary code.
  • Part II will be to create the pipeline simulator.
  • Part III will be assigned later

 

Developing Environment

            Operating System: Solaris or Linux (encourage to use), Windows

            Programming Language: C/C++, Java or other languages

           

Submission

You must also provide a README containing your full name, the ID you specified, e-mail address, and any special instructions or notes about any assumptions you made about the project. You must submit these files, along with all the files necessary to build and run your project, in a single .tar file or .zip to me by email. You should make a separate directory to work on your project and then use “tar -cvf project.tar *” to create your .tar file if you worked on Solaris or Linux. If working on Windows, you should use winzip to add all files into a .zip file then rename it to a .Z file before you email it out (because LSU email system will reject any .zip files.).

Send your .tar or .Z file to lpeng.lsu@gmail.com and lpeng@lsu.edu.

You need to include the honor code in your README: On my honor, I have neither given nor received unauthorized aid on this assignment.”

The deadline will be by 11:59PM on the date that the project is due. Each day late will make you lose 20% (by 11:59pm). After five days no credit will be given.

Unless otherwise specified, each part is to be done individually. That is, there must be one project turned in for each student in the class.

 

Grading

Each student will have 10-15 minutes to demonstrate his/her project at my office. During demonstration, you need run your program on my terminal. You also need briefly introduce your source code. Therefore, adding some comments into your source code will be helpful. Correct handling of the sample code (with possible different data values) will be used to determine 60% of credit awarded. The remaining 40% will be determined from other test cases that you will not have access to prior to grading. If you cannot roughly explain your program source code correctly on demonstration, you will lose 50% point on the project.

 

Instructions

For reference, please use the MIPS Instruction Set Architecture PDF to see the format for each instruction.

Your disassembler/simulator will need to support the following MIPS instructions:

  • J, JR, BEQ, BNE, BGEZ, BGTZ, BLEZ, BLTZ
  • ADDI, ADDIU
  • BREAK
  • SLT
  • SW, LW
  • SLL, SRL, SRA
  • SUB, SUBU, ADD, ADDU
  • AND, OR, XOR, NOR
  • SLTI
  • NOP

Floating point instructions (only required for Part III):

  • DIV.S, MUL.S, SUB.S, ADD.S
  • MOV.S
  • SWC1, LWC1

 

Input

Your program will be given a text input file. This file will contain a sequence of 32-bit instruction words which begin at address "496". The final instruction in the sequence of instructions is always BREAK. The data section is followed the BREAK instruction and begins at address "700". Following that is a sequence of 32-bit 2’s complement signed integers for the program data up to the end of file. Note that the instruction words always start at address "496". If the instructions occupy beyond address "700", the data region will be followed the BREAK instruction immediately.

Your MIPS simulator (MIPSsim) should provide the following options to users:

MIPSsim inputfilename outputfilename operation [-Tm:n] 

  • Inputfilename - The file name of the binary input file.
  • Outputfilename - The file name to which to print the output.
  • Operation - Either"dis" or"sim" to specify disassembly or simulation.
  • -Tm:n - Optional argument to specify the start (m) and end (n) cycles of simulation tracing output. Tracing should be done in a single-step fashion with the contents of registers and memory shown after every processor cycle. -T0:0 indicates that no tracing is to be performed; eliminating the argument specifies that every cycle is to be traced.

Your program should output a simple help text describing proper usage if the user fails to specify valid arguments.

 

Project Assignment

Part I - Disassembler (25%)

Part II – Pipeline Simulator (50%)

Part III (25%)