《Computer Organization and Design》Chap.4 筆記
阿新 • • 發佈:2019-01-01
摘要:
- 怎樣建立datapath?需要哪些elements?如何連線這些elements?
- 怎樣控制datapath?8bits的control linel包含了哪些signals?
- pipeline!
- 其他提高效能的方法,如並行、迴圈展開。
4.7-4.9、4.11待看。
內容:
elements盤點——
1.Instruction memory——a memory unit to store the instructions of a program and supply instructions given an address.
2.PC(Program Counter)——a register that holds the address of the current instruction.
3. An adder to increment the PC to the address of the next instruction.
以上三個elements組成了instruction fetch的datapath。
4.Register file——A register file is a collection of registers in which any register can be read or written by specifying the number of the register in the file.
5.ALU
6.Data memory unit——A state element with inputs for the address and the write data, and a single output for the read result.
7.Immediate generation unit——sign-extend the 12-bit offset field in the instruction to a 64-bit signed value.
8.Control unit——2bits ALUOp、RegWrite、ALUSrc、PCSrc、MemRead、MemWrite和MemtoReg。
以上8個elements組成一個麻雀雖小五臟俱全的datapath——
一圖說明pipeline如何起作用:
Pipeline Hazards: structural hazard, data hazard and control hazard.
Figure 4.17 之 single-cycle——
Figure 4.31 之 pipeline version——
在pipeline中加入control之後——
4.10講instruction-level parallelism (ILP)的技巧,還建議去看Computer Architecture: A Quantitative Approach,這部分看得似懂非懂還有待琢磨。迴圈展開的技巧在CSAPP Chap.5中剛看過。
4.12用了迴圈展開去優化Matrix Multiply程式。