




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上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 ALU.Write the program below and show forwarding with a
2、rrow. Test 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 o
3、n upper 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,R3IFIDEXEMEMWBNOPIFIDEXEMEMWBSUB R5,R1,R4IFIDEXEMEMWB其中ADD指令中在WB阶段的输出555(R2+R3)前递到SUB指令的EXE阶段的u
4、pper input。(c) 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,R3IFIDEXEM
5、EMWBSUB R5,R4,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 fo
6、rwarded. DO NOT 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.
7、Test it on the 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
8、passed on to 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, Sta
9、ll Detection 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 a
10、ll the registers 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, l
11、oopADDI R7, R1, 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跳转后面加3条ADD R0,R0,R0(iii)Run the same program with Predict NT option in Branch
12、 Policy. What difference do you seewhen 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 instructio
13、ns.Offset = -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 _12345
14、678910111213LW 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)IFIFI
15、FIDIDIDEXEMEMWBADDI 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)IFIDEXEMEMWBIFIDEXEMEMAD
16、DI R1,R1, #1IFIDEXEEXEMEMWBIFIDEXESW 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, Loop1IFIDI
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024自考专业(护理)经典例题带答案详解(综合卷)
- 2024年施工员高分题库附参考答案详解【培优B卷】
- 2024执业药师考前冲刺试卷(培优B卷)附答案详解
- 中国邮政2025沈阳市秋招人力资源管理岗位高频笔试题库含答案
- 中国邮政2025黄山市秋招数据分析岗位高频笔试题库含答案
- 达标测试自考专业(小学教育)试卷附参考答案【黄金题型】
- 永清教师考试题库及答案
- 劳动合同履行问题防范
- 2025年医疗健康大数据分析在医疗旅游服务中的应用可行性研究报告
- 教师资格考试初级中学体育与健康学科知识与教学能力试题与参考答案2025年
- GB/T 5023.1-2008额定电压450/750 V及以下聚氯乙烯绝缘电缆第1部分:一般要求
- 企业突发环境事件隐患排查与治理工作指南课件
- 小区门岗值班登记表
- 《计算机操作系统(第4版)》配套教学课件
- 哈尔滨市城市规划管理技术规定
- 大学语文课件(完整版)
- 液压与气压传动完整版课件
- 国家教学示范中心-电子科学与技术中心-国防科技大学
- 实名制管理台账资料规范模板内容
- 沥青拌和站设备租赁合同参考
- 《关键对话》读书笔记-PPT课件
评论
0/150
提交评论