lab3復雜流水線實驗報告_第1頁
lab3復雜流水線實驗報告_第2頁
lab3復雜流水線實驗報告_第3頁
lab3復雜流水線實驗報告_第4頁
lab3復雜流水線實驗報告_第5頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

lab3復雜流水線實驗報告lab3復雜流水線實驗報告lab3復雜流水線實驗報告xxx公司lab3復雜流水線實驗報告文件編號:文件日期:修訂次數:第1.0次更改批準審核制定方案設計,管理制度Lab3復雜流水化實驗Experiment1:Tostudythebasicsofforwarding.ForalltheprogramspleaseselectStallDetectionandForwardingshouldbeON.WriteasampleprogramthatforwardsbetweenEXEstageandMEMstageonupperinputofthetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBSUBR5,R1,R4IFIDEXEMEMWB 其中ADD指令中在MEM階段的ALUout-555(R2+R3)前遞到SUB指令的EXE階段的upperinput。WriteasampleprogramthatforwardsbetweenEXEstageandWBstageonupperinputofthetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUBR5,R1,R4IFIDEXEMEMWB其中ADD指令中在WB階段的輸出555(R2+R3)前遞到SUB指令的EXE階段的upperinput。WriteasampleprogramthatforwardsbetweenEXEstageandMEMstageonlowerinputofthetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBSUBR5,R4,R1IFIDEXEMEMWB 其中ADD指令中在MEM階段的ALUout-555(R2+R3)前遞到SUB指令的EXE階段的upperinput。(d)WriteasampleprogramthatforwardsbetweenEXEstageandWBstageonlowerinputofthetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUBR5,R4,R1IFIDEXEMEMWB其中ADD指令中在WB階段的輸出555(R2+R3)前遞到SUB指令的EXE階段的upperinput。(e)WriteasampleprogramthatforwardsbetweenMEMstageandWBstage.Writetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.Instruction123456789LWR1,0(R2)IFIDEXEMEMWBSWR3,0(R1)IFIDEXEMEMWB 其中ADD指令在WB階段的輸出555(R2+R3)前遞到SW指令的MEM階段。(f)WriteaprogramthatcausesLoadUseDelayStall.SeewhatdataistobemovedandnoticeexactlywhentherequiredDataispassedontothewaitinginstruction.Showitasanarrowonthefollowingdiagram.Instruction123456789LWR1,0(R3)IFIDEXEMEMWBADDR2,R1,R3IFIDEXEEXEMEMWBBRANCHHAZARDS.(LabExperiment2)(a)Letusnowstudysomebranchhazard.FirstofallmakesurethattheAggressivebranchingoptionisOFF,StallDetectionisONandForwardingisON.SelectAlwaysFlushoptionfromthebranchPolicyandwritethefollowingprogram.Doesthisprogramworkproperly.Ifnotmodifytheprogramsothatitworksproperly.Itfills10memorylocationsmemorywithavalue222.Checkwhatshouldbethevaluesofalltheregistersifthisprogramworkistoproperly(nousefulinstructionturningintoNOPorgettingflushed).CarefullynotetheuseofSLTIinstructioninthefollowingloop.ADDIR3,R0,0ADDIR1,R0,0ADDIR2,R0,222Loop:AddiR1,R1,4SWR2,100(R1)ADDIR3,R3,1SLTIR5,R3,10BNEQR5,R0,loopADDIR7,R1,10ADDIR8,R2,5ADDIR2,R2,100(i)CalculatetheCPIforthisprogram.61/65(ii)Whatchangescanwemaketothisprogramsothatitworksproperly(usefulinstructionsaftertheprogramdonotflush)可以在BNEQ跳轉后面加3條ADDR0,R0,R0(iii)RunthesameprogramwithPredictNToptioninBranchPolicy.Whatdifferencedoyouseewhenloopcompletes.PredictNT:循環(huán)執(zhí)行完了順序執(zhí)行了剩下3條語句。AlwaysFlush:循環(huán)執(zhí)行完了依然將剩下3條語句flush掉了。(b)ThisproblemissimilartoproblemA-1attheendofthebook.(ExerciseA-1.)Notethatyouneedtocalculatetheoffsetintheactualprogramintermsofnumberofinstructions.Offset=-6ProcessorConfiguration.StallDetectionON.,Forwarding:OFF,AggressiveBranching:YES,BranchPolicy:AlwaysFlush.Runtheaboveprogramandfillthefollowingtablefortheinstructionsintheloopbodyforfirst2or3iterations.TotalClockcyclestoruntheprogram____12345678910111213LWR1,0(R2)IFIDEXEMEMWBADDIR1,R1,#1IFIDIDIDEXEMEMWBSWR1,0(R2)IFIFIFIDIDIDEXEMEMWBADDIR2,R2,#4IFIFIFIDEXEMEMWBSUBR4,R3,R2IFIDIDIDEXEBNEZR4,Loop1IFIFIFIDADDIR2,R0,0IFADDIR3,R0,014151617181920212223242526LWR1,0(R2)IFIDEXEMEMWBADDIR1,R1,#1IFIDIDIDEXEMEMWBSWR1,0(R2)IFIFIFIDIDIDEXEMEMWBADDIR2,R2,#4IFIFIFIDEXEMEMSUBR4,R3,R2MEMWBIFIDIDBNEZR4,Loop1IDIDEXEMEMWBIFIFADDIR2,R0,0IFIDEXEMEMWBADDIR3,R0,0(b)Redothepart(a)withforwardingONandotherprocessorconfigurationissame.Totalclockcycles___12345678910111213LWR1,0(R2)IFIDEXEMEMWBIFIDEXEMEMADDIR1,R1,#1IFIDEXEEXEMEMWBIFIDEXESWR1,0(R2)IFIDIDEXEMEMWBIFIDADDIR2,R2,#4IFIFIDEXEMEMWBIFSUBR4,R3,R2IFIDEXEMEMWBBNEZR4,Loop1IFIDIDEXEMEMWBADDIR2,R0,0IFIFIDEXEMEMWBADDIR3,R0,014151617181920212223242526LWR1,0(R2)WBIFIDEXEMEMWBADDIR1,R1,#1EXEMEMWBIFIDEXEEXEMEMWBSWR1,0(R2)IDEXEMEMWBIFIDIDEXEMEMWBADDIR2,R2,#4IFIDEXEMEMWBIFIFIDEXEMEMSUBR4,R3,R2IFIDEXEEXEWBIFIDEXEBNEZR

溫馨提示

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

評論

0/150

提交評論