下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、lab3复杂流水线实验报告Lab3复杂流水化实验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 the program below and show forwarding with arrow. Test
2、 it 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 in
3、put of the 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) Write
4、 a sample program that forwards between EXE stage and MEM stage on lower input of the 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,R1IFIDEXEMEMWB其中
5、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 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.Instr
6、uction123456789ADD 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 the simulator and mention wha
7、t 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 the waiting instruction. Sh
8、ow 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 is ON and Forwarding is ON.
9、 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 registers if this program work is
10、 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, R1, 10ADDI R8, R2, 5ADDI R2,
11、 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跳转后面加3条ADD R0,R0,R0(iii)Run the same program with Predict NT option in Branch Policy. What difference do you seewhen
12、loop completes. Predict NT:循环执行完了顺序执行了剩下3条语句。Always Flush:循环执行完了依然将剩下3条语句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 = -6 (A) Processor Configurati
13、on. 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 _12345678910111213LW R1, 0(R2)IFIDEXEMEMWBADDI
14、 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)IFIFIFIDIDIDEXEMEMWBADDI R2,R2, #4IFIFIFIDEXE
15、MEMSUB 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, #1IFIDEXEEXEMEMWBIFIDEXESW R1,
16、 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, Loop1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026安徽六安市霍邱县融媒体中心招聘播音员(主持人)4人考试备考试题及答案解析
- 2026江苏南京市供销集团有限责任公司常务副总经理招聘1人考试参考题库及答案解析
- 2026年中山教育科技股份有限公司校园招聘笔试备考试题及答案解析
- 2026中国水利水电第八工程局有限公司社会招聘考试备考题库及答案解析
- 电商运营数据分析实战技巧培训资料
- 安全生产事故隐患排查治理管理制度
- 2026广场舞服装市场投资前景分析及供需格局研究研究报告
- 公司员工奖罚制度
- 2026北京一零一中实验幼儿园招聘备考题库附参考答案详解(巩固)
- 2026年4月浙江杭州市西湖区教育局所属事业单位招聘教师68人备考题库及答案详解(网校专用)
- 2026四川宜宾汇发产业新空间投资有限公司第一批员工招聘5人备考题库及答案详解(各地真题)
- 2026广东佛山市公安局三水分局警务辅助人员招聘49人(第一批)考试参考试题及答案解析
- 2026年江苏省南京第五高级中学高考地理一模试卷
- 2026年人教版八年级语文下册第四单元 阅读综合实践 大单元作业设计 教学课件
- 2026年春季统编版新教材八年级下册道德与法治教学计划
- 2026年从事基础研究人员长周期管理 节点奖励:科技人员激励双机制
- 2026年国家义务教育质量监测小学德育模拟测评估考试试题+答案
- 老年人日常生活健康指导
- 2023年山东司法警官职业学院招聘考试真题
- 操作监护管理制度范本
- 人工智能在智能冰箱中的应用
评论
0/150
提交评论