Lecture 07: Pipelining Multicycle, MIPS R4000, and More

Slides:



Advertisements
Similar presentations
Tor Aamodt EECE 476: Computer Architecture Slide Set #6: Multicycle Operations.
Advertisements

Advanced Computer Architectures Laboratory on DLX Pipelining Vittorio Zaccaria.
COMP 4211 Seminar Presentation Based On: Computer Architecture A Quantitative Approach by Hennessey and Patterson Presenter : Feri Danes.
Instruction Set Issues MIPS easy –Instructions are only committed at MEM  WB transition Other architectures are more difficult –Instructions may update.
Lecture 6: Pipelining MIPS R4000 and More Kai Bu
Instruction-Level Parallelism (ILP)
1 IF IDEX MEM L.D F4,0(R2) MUL.D F0, F4, F6 ADD.D F2, F0, F8 L.D F2, 0(R2) WB IF IDM1 MEM WBM2M3M4M5M6M7 stall.
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed., Sep 24, 2003 Topic: Pipelining -- Intermediate Concepts (Multicycle Operations;
EECS 470 Pipeline Hazards Lecture 4 Coverage: Appendix A.
COMP381 by M. Hamdi 1 Pipelining Control Hazards and Deeper pipelines.
DLX Instruction Format
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
Appendix A Pipelining: Basic and Intermediate Concepts
EENG449b/Savvides Lec 5.1 1/27/04 January 27, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
ENGS 116 Lecture 51 Pipelining and Hazards Vincent H. Berk September 30, 2005 Reading for today: Chapter A.1 – A.3, article: Patterson&Ditzel Reading for.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Lecture 7: Pipelining Review Kai Bu
Lecture 5: Pipelining Implementation Kai Bu
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
1 Appendix A Pipeline implementation Pipeline hazards, detection and forwarding Multiple-cycle operations MIPS R4000 CDA5155 Spring, 2007, Peir / University.
CSC 4250 Computer Architectures September 26, 2006 Appendix A. Pipelining.
Pipeline Extensions prepared and Instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University MIPS Extensions1May 2015.
EE524/CptS561 Jose G. Delgado-Frias 1 Processor Basic steps to process an instruction IFID/OFEXMEMWB Instruction Fetch Instruction Decode / Operand Fetch.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
CSC 4250 Computer Architectures September 22, 2006 Appendix A. Pipelining.
CIS 662 – Computer Architecture – Fall Class 11 – 10/12/04 1 Scoreboarding  The following four steps replace ID, EX and WB steps  ID: Issue –
Instruction-Level Parallelism
Images from Patterson-Hennessy Book
CDA3101 Recitation Section 8
/ Computer Architecture and Design
Pipelining.
Out of Order Processors
Single Clock Datapath With Control
Appendix C Pipeline implementation
\course\cpeg323-08F\Topic6b-323
Exceptions & Multi-cycle Operations
Pipelining.
Pipelining: Advanced ILP
Morgan Kaufmann Publishers The Processor
CS 5513 Computer Architecture Pipelining Examples
Lecture 6: Advanced Pipelines
Pipelining Multicycle, MIPS R4000, and More
Pipelining review.
Pipelining in more detail
CSC 4250 Computer Architectures
CS 704 Advanced Computer Architecture
\course\cpeg323-05F\Topic6b-323
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
Control unit extension for data hazards
The Processor Lecture 3.5: Data Hazards
Instruction Execution Cycle
Project Instruction Scheduler Assembler for DLX
Overview What are pipeline hazards? Types of hazards
Pipelining Multicycle, MIPS R4000, and More
Scoreboarding ENGS 116 Lecture 7 Vincent H. Berk October 5, 2005
Pipeline control unit (highly abstracted)
Extending simple pipeline to multiple pipes
Lecture 4: Advanced Pipelines
Pipeline Control unit (highly abstracted)
Control unit extension for data hazards
Control unit extension for data hazards
CMSC 611: Advanced Computer Architecture
Lecture 5: Pipeline Wrap-up, Static ILP
CS 3853 Computer Architecture Pipelining Examples
Conceptual execution on a processor which exploits ILP
MIPS Pipelined Datapath
Pipelining Hazards.
Presentation transcript:

Lecture 07: Pipelining Multicycle, MIPS R4000, and More Kai Bu kaibu@zju.edu.cn http://list.zju.edu.cn/kaibu/comparch2016fall

Lab 2 Demo due November 06 Report due November 17 Final Exam: 2017.01.15 14:00 – 16:00

Integer Op in 1 CC IF ID EX MEM WB

floating-point operation? What about floating-point operation?

FP Operation Floating-point (FP) operations take more time than integer operations do To complete an FP op in 1 cc: a slow clock? many logic in FP units?

Multicycle FP Operation FP pipeline allow for a longer latency for op; two changes over integer pipeline: repeat EX; use multiple FP functional units;

FP Pipeline

Preview Multicycle FP Operations Hazards and Forwarding Example: MIPS R4000 Pipeline

Appendix C.5-C.7

How FP operations pipeline?

FP Pipeline loads and stores integer ALU operations branches use multiple FP units FP and integer multiplier repeat EX FP add FP subtract FP conversion FP and integer divider

FP Pipeline EX is not pipelined Until the previous instruction leaves EX, no other instruction using that functional unit may issue If an instruction cannot proceed to EX, the entire pipeline behind that instruction will be stalled

Latency & Ini/Repeat Interval the number of intervening cycles between an instruction that produces a result and an instruction that uses the result Initiation/Repeat Interval the number of cycles that must elapse between issuing two operations of a given type

Latency & Ini/Repeat Interval Essentially, pipeline latency is 1 cycle less than the depth of the execution pipeline, which is the number of stages from the EX stage to the stage that produces the result

Generalized FP Pipeline EX is pipelined (except for FP divider) Additional pipeline registers e.g., ID/A1 FP divider: 24 CCs

Generalized FP Pipeline Example italics: stage where data is needed bold: stage where a result is available

Generalized FP Pipeline Example italics: stage where data is needed bold: stage where a result is available Intervening cycles

Any FP pipeline hazards?

Structural Hazard Divider is not fully pipelined – structural hazard

Structural Hazard Instructions have varying running times, maybe >1 register write in a cycle - structural hazard

Structural Hazards

Structural Hazards Interlock Detection Method 1: track the use of the write port in the ID stage and stall an instruction before it issues ::a shift register tracks when already-issued instructions will use the register file; if the instruction in ID needs to use the register file at the same time, stall

Structural Hazards Interlock Detection Method 2: stall a conflicting instruction when it tries to enter MEM/WB ::could stall either issuing or issued one; give priority to the unit with the longest latency; more complicated: stall arises from MEM/WB

WAW Hazard Instructions no longer reach WB in order – Write after write (WAW) hazard

WAW Hazards If L.D were issued one cycle earlier L.D would write F2 one cycle earlier than ADD.D – WAW hazard what if another instruction using F2 between them? --- No WAW

RAW Hazard Longer latency of operations – more frequent stalls for read after write (RAW) hazards

RAW Hazards

Hazard: Exceptions Instructions may complete in a different order than they were issued – exceptions

How to detect and solve pipeline hazards?

Hazard Detection in ID 1. Check for structural hazards wait until the required functional unit is not busy (only for divides); make sure the register write port is available when it will be needed;

Hazard Detection in ID 2. Check for RAW data hazards wait until source registers are available when needed --- when they are not pending destinations of issued instructions

Hazard Detection in ID 3. Check for WAW data hazards determine if any instruction in A1 – A4, D, M1-M7 has the same register destination as this instruction; if so, stall the issue of the instr in ID

Forwarding Generalized with more sources EX/MEM, A4/MEM, M7/MEM, D/MEM, MEM/WB -> source registers of an FP instruction

Out-of-order Completion ADD and SUB complete before DIV Out-of-order completion: instructions are completing in a different order than they were issued

Out-of-order Completion How to deal with out-of-order? 1. ignore the problem 2. buffer the results of an operation until all the operations issued earlier complete 3. tracking what operations were in the pipeline and their PCs 4. issue an instruction only if it is certain that all previous instructions will complete without exception

All in MIPS R4000

MIPS R4000: 5-stage -> 8-stage Higher clock rate

MIPS R4000: IF IF: first half of instruction fetch; PC selection; initiation of instruction cache access;

MIPS R4000: IS IS: second half of instruction fetch; completion of instruction cache access;

MIPS R4000: RF RF: instruction decode and register fetch; hazard checking; instruction cache hit detection;

MIPS R4000: EX EX: execution effective address calculation; ALU operation; branch-target computation and condition evaluation;

MIPS R4000: DF DF: data fetch first half of data access;

MIPS R4000: DS DS: second half of data fetch completion of data cache access;

MIPS R4000: TC TC: tag check determine whether the data cache access hit;

MIPS R4000: WB WB: write back for loads and register-register operations;

Load Delay 2-cycle load delay

Load Delay 2-cycle load delay

Branch Delay 3-cycle branch delay: predicted-not-taken

Branch Delay 3-cycle branch delay: predicted-not-taken taken branch untaken branch

Forwarding Forwarding ALU/MEM or MEM/WB -> EX/DF, DF/DS, DS/TC, TC/WB

FP Operations FP Pipeline FP unit with three functional units: FP divider, FP multiplier, FP adder 2 cycles to 112 cycles

Stage vs FP Unit FP unit with eight different stages

Latency & Ini Interval FP operations: latency and initiation interval

FP Ops: Example 1 FP multiply + FP add

FP Ops: Example 2 FP add + FP multiply

FP Ops: Example 3 divide + add

FP Ops: Example 4 FP add + FP divide

?

#What’s More What Matters More than Your Talents? by Jeff Bezos The Power of Vulnerability by Brené Brown