Grad-ProbAsk 板


LINE

这题拿来复习FGMT很棒,有一些FGMT和thread的观念就可以了 回顾thread组成,有自己的 1.PC 2.stack 3.reg. 4.thread ID,... 回顾一下FGMT特性 1.类似RR 2.CPU必须在每个Cycle替换另一个thread 由上面两点得到一优点一缺点 pros:thread够多,可以隐藏stall cons:平均turnaround time上升(对於Hard Real time OS可能是不适用的) a.考虑thread1执行到branch, th1=thread1 stl=stall IF │ID │EX │MEM│WB cycle1 th1│ cycle2 stl│th1│ cycle3 stl│stl│th1 cycle4 th1│stl│stl│th1 此图表示只有一个thread时遇到branch的情形 cycle1 th1 cycle2 th2 th1 cycle3 th3 th2 th1 cycle4 th1 th3 th2 th1 th2 th1 th3 th2 th1 正常来说,th1会有control hazard,但因为这题的设计,IF只要遇到branch就会stall, 所以stall刚好被th2,th3盖住了。 每一个pipeline stage都是满的,故最少需要3个 b. 考虑th1有以下instruction add $1,$2,$3 or $2,$1,$3 发生RAW IF │ ID│ EX│MEM│WB cycle1 th1 cycle2 th1 th1 cycle3 th1 stl th1 cycle4 th1 stl stl th1 cycle5 th1 stl stl stl th1 此图表示只有一个thread遇到data hazard的时候,会一直stall到把结果写回 register为止(instruction走到WB) cycle1 th1 cycle2 th2 th1 cycle3 th3 th2 th1 cycle4 th4 th3 th2 th1 cycle5 th1 th4 th3 th2 th1 正常来说,在IF&ID时会检查(与hazard detection设计不同)到同一个thread的reg而产生 stall,直到写回去为止, 顺带一提的是,这边的reg.没有先写後读,因此同上需要总共四个thread保证 no flow dependence。 c.Yes, 与(a)解释一样 d.No IF │ ID │EX0~EX7│MEM0~MEM1│WB th1 stl0 stl 1~8 stl 9~10 th1 th1 th2 th3~10 th11~12 th1 需要共12个thread保证 no flow dependence。 结论:由单一时脉图(详看张凡课本图示)可以看到,原本由其中一个thread造成的stall ,可以切换另一个thread隐藏起来,而这个优点原本课本不清晰的解说,这题可以很清楚表 达出来。 --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.161.164.94
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Grad-ProbAsk/M.1546166700.A.4C0.html
1F:推 wacheck: 想请问一下,thread在IF阶段就有了吗?拍谢一直想到os的部12/30 19:49
thread也会翻译成instruction
2F:→ wacheck: 份,但一直连接不上来12/30 19:49
3F:→ wacheck: 然後d小题我觉得是11个@@ 因为ex阶段到wb阶段有8+2+1个th12/30 19:52
图应该很明显了
4F:→ wacheck: 要移除,但不确定是不是我想法太简陋 ORZ12/30 19:52
5F:推 wacheck: 第b小题只有4个stage@@ 而且分支也要考虑?个人认为因为没12/30 19:57
a小题已经说明3thread可以保证不会有control hazard了,所以b的4可以包含a
6F:→ wacheck: forward所以decode阶段到wb阶段都要停 所以两个thread12/30 19:58
7F:→ wacheck: 若再考虑branch的话就3+2=5 总共五个12/30 19:58
※ 编辑: b10007034 (1.161.164.94), 12/30/2018 20:26:45 ※ 编辑: b10007034 (223.140.232.129), 12/31/2018 10:24:22 ※ 编辑: b10007034 (223.140.232.129), 12/31/2018 10:43:23 ※ 编辑: b10007034 (1.161.165.108), 12/31/2018 10:49:18 ※ 编辑: b10007034 (1.161.165.108), 12/31/2018 10:51:18
8F:推 jojoboy0115: 好猛,感谢大大的解说! 12/31 22:06
9F:推 wacheck: 感谢回覆 01/01 09:39
10F:推 dumpling1234: 推 01/25 14:35
11F:推 Kanaheipapa: 谢谢大大!! 02/08 12:34
12F:推 ff00662299: 受益匪浅,谢谢! 11/20 17:22
13F:推 j12345453: 请问C小题 12/21 14:56
14F:→ j12345453: 因为有明讲了Ex stage是占8个Stage 12/21 14:56
15F:→ j12345453: 大家怎麽会直接认定Machine2也是在第三Stage就做完Br 12/21 14:56
16F:→ j12345453: anch? 12/21 14:56
17F:→ j12345453: 我一开始就误以为是要整个Ex阶段结束8个Stage Branch 12/21 14:56
18F:→ j12345453: 才完成? 12/21 14:56
19F:→ j12345453: 有人跟我想法一样吗 12/21 14:56







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:e-shopping站内搜寻

TOP