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 s 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 s code part A and B Simulator IO: 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 : if the user types 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 : if the user types 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 part A B A special instruction with opcode It is not in the standard MIPS but should help reduce the dynamic instruction count of your project part B Restrictions: this special instruction can read at most registers content, write at most register, either read or write word in memory. But you can decide what kind of operation it does. registers: o $always to $ o PC: starting at increment by for normal instructions Instruction memory: o Starting at address o read from a text file containing MIPS machine code in hex Data memory address range: o xx You can assume all the registers data memory content are initialized to be 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 code original version, V Your project code modified with the special instruction V 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
