Question: Intro: For this project, you will build a MIPS simulator in Python, which: reads in a text file containing a valid MIPS program in machine

Intro: For this project, you will build a MIPS simulator in Python, which: reads in a text file containing a valid MIPS program in machine code (hex) and simulates its running; should be able to run your project 1s machine code, part A and B. supports one special instruction (that is not included in MIPS) to reduce significantly the Dynamic Instruction Count of your project 1s code (part A and B). Simulator I/O: Input: Output: a text file containing a valid MIPS programs machine code (in hex). You can get such a file from MARS -> File -> memory dump. on screen, nicely formatted: mode 1: if the user types 1 after executing an instruction, the simulator will step through the next instruction, showing detailed information including: the instructions machine code, the break down of all the components (rs, rt, imm, etc), the assembly instruction, which registers are read, written, with what values, or which memory location is read / written with what value, how PC is updated. Mode 2: if the user types 2 after executing an instruction, the simulator will finish running all the remaining part of the program. Here, you can skip the detailed output, and show only the final results of: a) The final content of all the registers ever used b) The content of PC c) Data memory content d) Instruction Count and Statistics (similar to MARS Tool -> Instruction Statistics) Your simulator should support: {addi, slt, beq, sw, lw}, plus any instruction you used for project 1 part A, B. A special instruction with opcode =111111. It is not in the standard MIPS but should help reduce the dynamic instruction count of your project 1 part B. Restrictions: this special instruction can read at most 2 registers content, write at most 1 register, either read or write 1 word in memory. But you can decide what kind of operation it does. registers: o $0(always =0) to $31 o PC: starting at 0, increment by 4 for normal instructions Instruction memory: o Starting at address 0. o read from a text file (containing MIPS machine code in hex) Data memory address range: o 0x2000-0x2100 You can assume all the registers / data memory content are initialized to be 0. You should provide MIPS programs in hex and use your simulator to run them: Small sample programs with {addi, slt, beq, sw, lw} Your project 1 code (original version, V1). Your project 1 code modified with the special instruction (V2) which should have lower dynamic instruction count this version can only run on your simulator but not MARS, because MARS does not support your customized special instruction.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!