← กลับหน้าหลัก
บทที่ 6

การเพิ่มสมรรถนะด้วย Pipeline

Pipelining for Performance

เนื้อหาหลัก Key Topics

สูตรสำคัญ Key Formulas

Pipeline Speedup (อุดมคติ)
\[ \text{Speedup} = N \quad \text{(N = จำนวน Pipeline Stages)} \]
Speedup จริง (มี Stall)
\[ \text{CPI}_{\text{pipeline}} = 1 + \text{Stall cycles per instruction} \] \[ \text{Speedup} = \frac{N}{1 + \text{Stall}_{\text{avg}}} \]
ประเภท Data Hazard

RAW (Read After Write) — พบบ่อยที่สุด, ต้องการ Forwarding

WAW (Write After Write) — เกิดในสถาปัตยกรรมที่มีหลาย functional unit

WAR (Write After Read) — พบในสถาปัตยกรรมที่ reorder instructions

คำสำคัญ Key Terms

ไปป์ไลน์ · Pipeline ขั้นตอน · Stage (IF/ID/EX/MEM/WB) อุปสรรค · Hazard Structural Hazard Data Hazard Control / Branch Hazard การหยุด · Stall / Bubble การส่งต่อตรง · Forwarding / Bypassing ช่องหน่วง · Branch Delay Slot ลงทะเบียน Pipeline · Pipeline Register RAW / WAW / WAR