lab3復(fù)雜流水線實(shí)驗(yàn)報(bào)告_第1頁(yè)
lab3復(fù)雜流水線實(shí)驗(yàn)報(bào)告_第2頁(yè)
lab3復(fù)雜流水線實(shí)驗(yàn)報(bào)告_第3頁(yè)
lab3復(fù)雜流水線實(shí)驗(yàn)報(bào)告_第4頁(yè)
lab3復(fù)雜流水線實(shí)驗(yàn)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩2頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Lab3復(fù)雜流水化實(shí)驗(yàn)Experiment1: To study the basics of forwarding. For all the programs please select Stall Detection and Forwarding should be ON.(a) Write a sample program that forwards between EXE stage and MEM stage on upper input of the ALU.Write the program below and show forwarding with arrow. Test it

2、 on the simulator and mention what value is being forwarded. DO NOT USE LW INSTRUCTION.Instruction123456789ADD R1,R2,R3IFIDEXEMEMWBSUB R5,R1,R4IFIDEXEMEMWB其中ADD指令中在MEM階段的ALUout-555(R2+R3)前遞到SUB指令的EXE階段的upper input。(b) Write a sample program that forwards between EXE stage and WB stage on upper input

3、 of the ALU.Write the program below and show forwarding with arrow. Test it on the simulator and mention what value is being forwarded. DO NOT USE LW INSTRUCTION.Instruction123456789ADD R1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUB R5,R1,R4IFIDEXEMEMWB其中ADD指令中在WB階段的輸出555(R2+R3)前遞到SUB指令的EXE階段的upper input。(c

4、) Write a sample program that forwards between EXE stage and MEM stage on lower input of the ALU.Write the program below and show forwarding with arrow. Test it on the simulator and mention what value is being forwarded. DO NOT USE LW INSTRUCTION.Instruction123456789ADD R1,R2,R3IFIDEXEMEMWBSUB R5,R4

5、,R1IFIDEXEMEMWB其中ADD指令中在MEM階段的ALUout-555(R2+R3)前遞到SUB指令的EXE階段的upper input。(d) Write a sample program that forwards between EXE stage and WB stage on lower input of the ALU.Write the program below and show forwarding with arrow. Test it on the simulator and mention what value is being forwarded. DO N

6、OT USE LW INSTRUCTION.Instruction123456789ADD R1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUB R5,R4,R1IFIDEXEMEMWB其中ADD指令中在WB階段的輸出555(R2+R3)前遞到SUB指令的EXE階段的upper input。(e) Write a sample program that forwards between MEM stage and WB stage. Write the program below and show forwarding with arrow. Test it on th

7、e simulator and mention what value is being forwarded.Instruction123456789LW R1,0(R2)IFIDEXEMEMWBSW R3,0(R1)IFIDEXEMEMWB其中ADD指令在WB階段的輸出555(R2+R3)前遞到SW指令的MEM階段。(f) Write a program that causes Load Use Delay Stall. See what data is to be moved and notice exactly when the required Data is passed on to

8、the waiting instruction. Show it as an arrow on the following diagram.Instruction123456789LW R1,0(R3)IFIDEXEMEMWBADD R2,R1 ,R3IFIDEXEEXEMEMWBBRANCH HAZARDS. (Lab Experiment 2)(a) Let us now study some branch hazard. First of all make sure that the Aggressive branching option is OFF, Stall Detection

9、is ON and Forwarding is ON. Select Always Flush option from the branch Policy and write the following program. Does this program work properly. If not modify the program so that it works properly. It fills 10 memory locations memory with a value 222. Check what should be the values of all the regist

10、ers if this program work is to properly (no useful instruction turning into NOP or getting flushed). Carefully note the use of SLTI instruction in the following loop.ADDI R3, R0, 0ADDI R1, R0, 0ADDI R2, R0, 222Loop: Addi R1, R1, 4SW R2, 100(R1)ADDI R3, R3, 1SLTI R5, R3, 10BNEQ R5, R0, loopADDI R7, R

11、1, 10ADDI R8, R2, 5ADDI R2, R2, 100(i)Calculate the CPI for this program. 61/65 (ii)What changes can we make to this program so that it works properly (useful instructionsafter the program do not flush) 可以在BNEQ跳轉(zhuǎn)后面加3條ADD R0,R0,R0(iii)Run the same program with Predict NT option in Branch Policy. What

12、 difference do you seewhen loop completes. Predict NT:循環(huán)執(zhí)行完了順序執(zhí)行了剩下3條語(yǔ)句。Always Flush:循環(huán)執(zhí)行完了依然將剩下3條語(yǔ)句flush掉了。(b) This problem is similar to problem A-1 at the end of the book. (Exercise A-1.)Note that you need to calculate the offset in the actual program in terms of number of instructions.Offset = -

13、6 (A) Processor Configuration. Stall Detection ON., Forwarding: OFF, Aggressive Branching: YES, Branch Policy: Always Flush. Run the above program and fill the following table for the instructions in the loop body for first 2 or 3 iterations. Total Clock cycles to run the program _12345678910111213L

14、W R1, 0(R2)IFIDEXEMEMWBADDI R1,R1, #1IFIDIDIDEXEMEMWBSW R1, 0(R2)IFIFIFIDIDIDEXEMEMWBADDI R2,R2, #4IFIFIFIDEXEMEMWBSUB R4,R3,R2IFIDIDIDEXEBNEZ R4, Loop1IFIFIFIDADDI R2, R0, 0IFADDI R3, R0, 014151617181920212223242526LW R1, 0(R2)IFIDEXEMEMWBADDI R1,R1, #1IFIDIDIDEXEMEMWBSW R1, 0(R2)IFIFIFIDIDIDEXEMEM

15、WBADDI R2,R2, #4IFIFIFIDEXEMEMSUB R4,R3,R2MEMWBIFIDIDBNEZ R4, Loop1IDIDEXEMEMWBIFIFADDI R2, R0, 0FLUSHEDIFIDEXEMEMWBADDI R3, R0, 0(b) Redo the part (a) with forwarding ON and other processor configuration is same. Total clock cycles _12345678910111213LW R1, 0(R2)IFIDEXEMEMWBIFIDEXEMEMADDI R1,R1, #1I

16、FIDEXEEXEMEMWBIFIDEXESW R1, 0(R2)IFIDIDEXEMEMWBIFIDADDI R2,R2, #4IFIFIDEXEMEMWBIFSUB R4,R3,R2IFIDEXEMEMWBBNEZ R4, Loop1IFIDIDEXEMEMWBADDI R2, R0, 0IFIFIDEXEMEMWBADDI R3, R0, 014151617181920212223242526LW R1, 0(R2)WBIFIDEXEMEMWBADDI R1,R1, #1EXEMEMWBIFIDEXEEXEMEMWBSW R1, 0(R2)IDEXEMEMWBIFIDIDEXEMEMWBADDI R2,R2, #4IFIDEXEMEMWBIFIFIDEXEMEMSUB R4,R3,R2IFIDEXEEXEWBIFIDEXEBNEZ R4, Loop1IFIDIDEXEMEMWBIFIDADD

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論