Team Members Matt Fuller Vineetha Ayarpulli Robert Lundine
Programming Language: C++ Number of Instructions: New Instructions implemented : EXIT and along with slt, slti was also implemented. Number of Registers: 8 Formats Used: R-type, I-type, J-type Falling Edge Triggered
Instruction Name Mnemonic OperationOpcodeFunctionFormat Addadd add $s3, $s2, $s1; $s3 = $s2 + $s R Subtractsubsub $s3, $s2, $s1; $s3 = $s2 - $s R Andandand $s3, $s2, $s1; $s3 = $s2 & $s R Nornornor $s3, $s2, $s1; $s3 = ~($s2 | $s1) R Ororor $s3, $s2, $s1; $s3 = $s2 | $s R Set Less Thansltslt $s3, $s2, $s1; $s3 = ($s2 < $s1)?1: R Shift Leftsllsll $s3, $s2, $s1; $s3 = $s2 << $s10110 I Shift Rightsrlsrl $s3, $s2, $s1; $s3 = $s2 >> $s10111 I Add Immediateaddi addi $s1, $s2, 100; $s1 = $s I exit 1001 J Set Less Than Immediate slti slti $s1, $s2, 100; $s1 = ($s2 < 100)?1: I Load Wordlw lw $s1, 100($s2); $s1 = [$s2] + (100*4) 1011 I Store Wordsw sw $s1, 100($s2); $s1 = [$s2] + (100*4) 1100 I Branch on Equalbeq beq $s1, $s2, L1; ($s1==$s2)? PC = PC+4+address L I Branch on Not Equal bne bne $s1, $s2, L1; ($s1!=$s2)? PC = PC+4+address L I Jumpj J L1; PC = address L J
Forwarding and Hazard detection worked fine, but it in turn resulted in infinite loops. Branch prediction was not functioning as desired, led to stalls more often. Getting the pipelined version to run properly due to forwarding and hazard detection errors.
Forwarding and Hazard detection units were rectified and it gave desired results. The errors which led to infinite loops were corrected. Branch prediction was tackled in a different way : Code was reordered to minimize the stalls, thus Branch prediction gave expected results and fewer stalls. Voila !!! The pipelined version is up and working perfectly !!!