課堂筆記——計算機體系結構(1)
落了一節課,直接lecture3
Lecture3 Basic Pipeline
1、Single-cycle implementation: seldom used
取指 譯碼 執行 讀mem/cache 寫回WB
2、How to make it fast?
To decrease the clock cycle time? difficult!
What's the problem?資源浪費 序列 Start work ASAP
3、Multi-cycled implemention
4、Pipelining
why pipelining? decrease CPUtime improving the throughput
5、Pipeline hazard: the major hurdle
A hazard is a condition that prevents an instruction in the pipe from excuting its next scheduled pipe stage
Taxonomy of hazard:
Structrural hazards: These are comflicts over hardzards resources.
Data hazards: Instruction depends on result of prior computation which is not ready yet.
Control hazards: PC are not available in time to fetch an instruction on the next clock.
6、 Hazards can always be resolved by stall
7、浮點數運算:解決結構競爭(Structrural hazards)
方法1:fully pipelined adder:overhead(體積、執行時間)過大
方法2:multiple unpipelined adder:overhead(成本)過大
方法3:插入stall
8、coping with data hazards
方法1:增加資料通路(Forwarding Path)
方法2:Forwarding not always work,so implement load Interlock :load指令比較常見,這個方法開銷較大
方法3:編譯器端,進行程式碼排程,進行程式碼塊順序改變