资源描述:
《lab3复杂流水线实验报告.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Lab3复杂流水化实验Experiment1:Tostudythebasicsofforwarding.ForalltheprogramspleaseselectStallDetectionandForwardingshouldbeON.(a)WriteasampleprogramthatforwardsbetweenEXEstageandMEMstageonupperinputoftheALU.Writetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwha
2、tvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBSUBR5,R1,R4IFIDEXEMEMWB其中ADD指令中在MEM阶段的ALUout-555(R2+R3)前递到SUB指令的EXE阶段的upperinput。(b)WriteasampleprogramthatforwardsbetweenEXEstageandWBstageonupperinputoftheALU.Writetheprogrambelowandshowforw
3、ardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUBR5,R1,R4IFIDEXEMEMWB其中ADD指令中在WB阶段的输出555(R2+R3)前递到SUB指令的EXE阶段的upperinput。(c)WriteasampleprogramthatforwardsbetweenEXEstageandM
4、EMstageonlowerinputoftheALU.Writetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBSUBR5,R4,R1IFIDEXEMEMWB其中ADD指令中在MEM阶段的ALUout-555(R2+R3)前递到SUB指令的EXE阶段的upperinput。(d)
5、WriteasampleprogramthatforwardsbetweenEXEstageandWBstageonlowerinputoftheALU.Writetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.DONOTUSELWINSTRUCTION.Instruction123456789ADDR1,R2,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUBR5,R4,R1IFIDEXEME
6、MWB其中ADD指令中在WB阶段的输出555(R2+R3)前递到SUB指令的EXE阶段的upperinput。(e)WriteasampleprogramthatforwardsbetweenMEMstageandWBstage.Writetheprogrambelowandshowforwardingwitharrow.Testitonthesimulatorandmentionwhatvalueisbeingforwarded.Instruction123456789LWR1,0(R2)IFIDEXEMEMWBSWR3,0(R1)IFIDEXEMEM
7、WB其中ADD指令在WB阶段的输出555(R2+R3)前递到SW指令的MEM阶段。(f)WriteaprogramthatcausesLoadUseDelayStall.SeewhatdataistobemovedandnoticeexactlywhentherequiredDataispassedontothewaitinginstruction.Showitasanarrowonthefollowingdiagram.Instruction123456789LWR1,0(R3)IFIDEXEMEMWBADDR2,R1,R3IFIDEXEEXEMEMW
8、BBRANCHHAZARDS.(LabExperiment2)(a)Letusn