COM282 COMPUTER ORGANIZATION
Note1: You have enough knowledge to do this project. You are on your own. Solve everything yourself. Assistance will not be provided.
Note2: Deadline is strict. It cannot be extended.
Note3: This project is for 1 student only. Groups are not allowed.
This project includes a MIPS processor simulator called MySPIM. It is taken from the link below:
You only need to know C programming and MIPS processor archotecture to understand how this simulator works and to improve it.
Create a new Project in Dev-C++, add all the files in the package and compile. Open a console by typing “cmd” to the folder where all your files and .exe is located:
Run the program by typing “MySPIM.exe input_file1.asc -r” in the console. The program will ask you your command (cmd). For example “s” commands executes a step in your program. “r” commend prints out all register contents, etc. A sample run is given below:
Microsoft Windows [Version 10.0.18363.900]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\agurh\OneDrive\Documents\SIMULATOR-OF-A-MIPS-PROCESSOR-IN-C-master>MySPIM.exe input_file1.asc -r
> cmd: s
> cmd: r
> $zero 00000000 $at 00000000 $v0 00000000 $v1 00000000
> $a0 00000000 $a1 00000000 $a2 00000000 $a3 00000000
> $t0 00000001 $t1 00000000 $t2 00000000 $t3 00000000
> $t4 00000000 $t5 00000000 $t6 00000000 $t7 00000000
> $s0 00000000 $s1 00000000 $s2 00000000 $s3 00000000
> $s4 00000000 $s5 00000000 $s6 00000000 $s7 00000000
> $t8 00000000 $t9 00000000 $k0 00000000 $k1 00000000
> $gp 0000c000 $sp 0000fffc $fp 00000000 $ra 00000000
> $pc 00004004 $stat 00000000 $lo 00000000 $hi 00000000
> cmd: m
> 00000-03ffc 00000000
> 04000 21080001
> 04004 21090002
> 04008 01095020
> 0400c afaa0000
> 04010 8fab0000
> 04014 016a602a
> 04018 012a682b
> 0401c 3c0e0020
> 04020 0800100b
> 04024 deadbeaf
> 04028 badabeaf
> 0402c 114bfffd
> 04030-0fffc 00000000
First instruction in “input_file1.asc” is given below:
21080001 # addi $8, $8, 1 r8 = 1 $t0 = 1
$t0 should become 1 after this instruction and as we see in the console view below it really becomes 1:
You have 3 assignmets:
1. (40 points) Write a programmer’s guide and explain everything about this MIPS processor simulator. This guide should be a separate file. Anyone who reads it should be able to
a. use the simulator easily
b. understand the usage of each C function in the simulator code.
c. easily hack the simulator to add new instructions or to improve the processor architecture.
2. (30 points) Add a multiply instruction: MUL. Result will need 2 registers. Use $hi and $lo registers for storing the result. Using “r” commend, print register contents before and after you execute the instruction and prove correct operation. Explain how you modified the simulator code in order to add the MUL instruction.
3. (30 points) Add “Branch if Not Equal’ instruction: BNE. This instruction should compare two registers. If their contents are not equal branch should take place. Otherwise the branch should not be taken. Using register contents show that your instruction works properly. Explain how you modified the simulator code in order to add the MUL instruction.
Files to submit:
1. Programmer’s Guide written by you
2. Report telling how you have added MUL and BNE instructions
3. Modified Source Codes
İşin Yapılacağı Konum: İSTANBUL
Görevin Başlangıç Tarihi: 07-07-2020
Görevin Bitiş Tarihi: 14-07-2020