Reference no: EM132163643
Project: MIPS mini SIM
For this project, you will implement a python program, which takes as input a text file
1. Result of run: end content of PC, $1 - $7, and Dynamic Instruction Count
2. Cycle number details, in the following cases:
a. a multi-cycle MIPS CPU:
i. total # of cycles, breakdown of the 3 / 4 / 5 cycle instructions
ii. instruction by instruction information
b. a pipelined MIPS CPU (assuming branches are resolved at the 2nd ID stage, and all the forwarding paths supported to solve data hazard):
i. total # of cycles, breakdown on the total # of stalls inserted to deal with control & data hazards
ii. instruction by instruction information
3. Cache access behavior of lw instructions: provide cache access log, hit / miss info for each lw instruction, and hit rate of the program.
a. with a directly mapped cache with block size of 4 words, a total of 2 blocks.
b. with a directly mapped cache with block size of 2 words, a total of 4 blocks.
c. with a fully-associated cache, with block size of 2 words, a total of 4 blocks.
d. with a 2-way set-associative cache with block size of 2 words, 4 sets, (therefore a total of 16 blocks)
4. Extra credit: supporting any set-associative cache configurations by allowing the user to input block size (# of words), # of ways, and # of sets.
Assume the following limited support / subset of MIPS ISA for your program:
- Instructions: add, sub, xor, addi, beq, bne, slt, lw, sw
- Registers: $0 (always = 0), $1 - $7
- data memory address range: [0x2000, 0x3000)
- instruction memory address range: [0x0000, 0x1000)
- All the registers / data memory content are initialized to be 0
- The program will end at a dead loop "label: beq $0, $0, label" the machine code of which is 0x1000FFFF
Your python code should be able to read the file containing a valid MIPS program in hex, simulates its running, and correctly output the relevant information.
You should be able to use MARS to partially help verifying your code. For example, the behavior of the following code can be checked by MARs.
Attachment:- Project assignment.rar