As described above, we have provided you with a simulator that simulates the same ISA, but which is not cycle accurate because it does not account for pipelining. The source code for this simulator is in mips-small.c. You can use this simulator to develop assembly language programs prior to getting the pipelined simulator working.
If you haven't done so already, build the unpipelined simulator by
typing ``make sim'' in the directory where you've copied the
files we have provided. This will produce an executable sim
which you can run. Try running this simulator on the program we have
provided, mult.s. This program multiplies two numbers,
specified in memory at the labels mcand and mplier, and
stores the result at the label answer. Be sure to assemble the
program before running the simulator. The sequence of commands you
should give are:
make sim asm mult.s mult.out sim mult.out
When you run the simulator, a ton of messages will spew onto your terminal. The simulator we have provided dumps the state of the machine (including the contents of registers and memory) at every simulated cycle. You can examine this output to see what the simulator is doing. To put these messages in a file so that you can actually read them, redirect the output of the simulator to a file by saying ``sim mult.out > sim.output''. Your pipelined simulator will spew similar messages, except it will also include the state of pipeline registers. The output of your pipelined simulator will be compared to the correct output to grade your project.
In addition to using the unpipelined simulator to develop assembly programs, you should also look at the code in mips-small.c. The code is very simple, but you should make sure you understand it before moving on to building the pipelined simulator.