|
|||
Basics | |
Please read this document completely before starting.
|
Project Goal | |
The goal of this programming project is to write a functional simulator for a subset of the MIPS instructions. This project will help you understand how each instruction in the MIPS processor behaves. To successfully complete this project, you will need to understand the following items:
|
Part 1: Executing An Instruction | |
In this part, you will write C code that executes one instruction on the MIPS processor. The function has the following prototype:
The arguments to this function are as follows:
opcodes.h , containing a list of the opcodes for the
instructions you are supposed to implement, as well as some helpful #define
s for the output parameters.
A good way to implement this function is to split the instructions into three categories:
opcodes.h
file. The file also names all the instructions you have to implement.
Memory can be accessed only by reading or writing an entire word at a time. There are two functions provided:
exec.c
. Always check address alignment before performing a load or store operation.
Generate an executable program by running
This creates a proj2 executable, which is similar to gmipc
except it uses your function to execute code. You might want to use gmipc
as a "reference implementation" to find errors in your own implementation.
Remarks.
|
Part 2: Testing | |
In this part, you will write functional tests for your processor simulator. The purpose of these tests is to check that you have correctly implemented individual instructions. There are three classes of instructions:
Create your test cases in the You should also run the sample Note that your MIPS code from Project 1 may not run on your simulator if it uses multiply or divide instructions and you haven't implemented them. |
Extra Credit | |
Overflow Detection (5 pts)This extra credit feature is simple in principle: your Using the interface we have provided, it is not possible for you to faithfully
simulate an overflow exception. So how do you test your code? There are many
possibilities. For example, you might temporarily modify Multiply and Divide (5 pts)The MIPS multiply and divide operations manipulate 64-bit quantities. If you are C-literate, you can declare 64-bit integers in C and do these operations directly. This solution will enable you to run theputs and puti
routines, but to get the full extra credit you should implement the operations
using 32-bit C operations. As above, describe your testing strategy in your README
file.
|
Submitting Your Project | |
Submission will be done using
CMS. Remember you must be logged in to Sidecar to access CMS. (From a
CSL machine, type In your
username1 and username2
should be the CSL login ids of you and your partner � your netids. Your README
file must contain information about how you tested your simulator, and
which test files you used. If you have any special instructions or anything
you'd like us to know about your project, please let us know by typing it into
the README
file.
For this project, the only file that you will edit is "exec.c". You will also add the test files(.s) in the /test directory, nothing else will get submitted. There is a script available that will tar these up for you, and check that all the files are present, so that you can submit them to CMS. Once you have finish the project, simply type: proj2tar.314
from your There is no written report (other than your |
![]() |