Computer Architecture Lecture 3

Slides:



Advertisements
Similar presentations
Computer Architecture Lecture 3 – Part 2 15 th May, 2006 Abhinav Agarwal Veeramani V.
Advertisements

Computer Architecture Lecture 2 Abhinav Agarwal Veeramani V.
Dynamic Branch PredictionCS510 Computer ArchitecturesLecture Lecture 10 Dynamic Branch Prediction, Superscalar, VLIW, and Software Pipelining.
1 Advanced Computer Architecture Limits to ILP Lecture 3.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
1 Lecture 18: Pipelining Today’s topics:  Hazards and instruction scheduling  Branch prediction  Out-of-order execution Reminder:  Assignment 7 will.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying 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.
Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.
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.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
CMPE 421 Parallel Computer Architecture
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
PROCESSOR PIPELINING YASSER MOHAMMAD. SINGLE DATAPATH DESIGN.
CS 352H: Computer Systems Architecture
Computer Organization CS224
CSL718 : Superscalar Processors
CS2100 Computer Organization
Pipelining Chapter 6.
Multilevel Memories (Improving performance using alittle “cash”)
CS203 – Advanced Computer Architecture
Instructor: Justin Hsia
Single Clock Datapath With Control
Pipeline Implementation (4.6)
Pipelining: Advanced ILP
Chapter 4 The Processor Part 3
Morgan Kaufmann Publishers The Processor
CS 5513 Computer Architecture Pipelining Examples
Morgan Kaufmann Publishers The Processor
Computer Architecture Lecture 3 – Part 1 11th May, 2006
Pipelining review.
Pipelining Chapter 6.
The processor: Pipelining and Branching
Lecture 19: Branches, OOO Today’s topics: Instruction scheduling
Computer Architecture Lecture 4 17th May, 2006
Lecture 11: Memory Data Flow Techniques
Pipelining in more detail
CSCI206 - Computer Organization & Programming
Computer Architecture
Lecture 19: Branches, OOO Today’s topics: Instruction scheduling
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
Advanced Computer Architecture
Control unit extension for data hazards
Lecture 20: OOO, Memory Hierarchy
Lecture 20: OOO, Memory Hierarchy
Instruction Level Parallelism (ILP)
Daxia Ge Friday February 9th, 2007
Instruction Execution Cycle
Pipeline control unit (highly abstracted)
CS203 – Advanced Computer Architecture
Pipelining: Basic Concepts
pipelining: data hazards Prof. Eric Rotenberg
Pipeline Control unit (highly abstracted)
Reducing pipeline hazards – three techniques
Pipelining (II).
Control unit extension for data hazards
CSC3050 – Computer Architecture
ARM ORGANISATION.
Dynamic Hardware Prediction
Control unit extension for data hazards
Guest Lecturer: Justin Hsia
CS 3853 Computer Architecture Pipelining Examples
Conceptual execution on a processor which exploits ILP
Pipelining Hazards.
Presentation transcript:

Computer Architecture Lecture 3 Abhinav Agarwal Veeramani V.

Quick recap – Pipelining source: http://cse.stanford.edu/class/sophomore-college/projects-00/risc/pipelining/

Quick recap – Problems Data hazards Control Hazards Structural Hazards Dependent Instructions add r1, r2, r3 store r1, 0(r4) Control Hazards Branches resolution bnz r1, label label: sub r1, r2, r3 Structural Hazards IF ID/RF EX MEM WB IF ID/RF EX MEM WB IF ID/RF EX MEM WB IF ID/RF EX MEM WB IF ID/RF EX MEM WB

Data Hazards RAW hazard – Read after Write add r1, r2, r3 store r1, 0(r4) WAW hazard – Write after Write div r1, r3, r4 … add r1, r10, r5 WAR hazard – Write after Read Generally not relevant in simple pipelines IF ID/RF EX MEM WB IF ID/RF EX MEM WB

Remedies Bypass values (Data forwarding) RAW hazards are tackled this way Not all RAW hazards can be solved by forwarding. E.g.: Load delay, What about divide? What is the solution? Static compiler techniques IF ID/RF EX MEM WB IF ID/RF EX MEM WB

Can we do better? Execute independent executions out-of-order? What do we require for this? lw r4, 0(r6) #Cache miss - Takes time addi r5, r4, 0x20 and r10, r5, r19 xor r26, r2, r7 sub r20, r26, r2 Fetch more instructions... Instructions should be commited in-order Memory instructions? Is dependency clear?

The WAW hazard Is it unavoidable? What is the reason for such hazard? Register renaming More physical registers Logical registers mapped to physical registers available when the instruction is decoded

Control Hazard Branch delay slot bnz r1, label add r1, r2, r3 label: sub r1, r2, r3 Save one cycle stall. Fetch in the negative edge to save another. Deeper pipelines. Such static compiler techniques would not work. IF ID/RF EX MEM WB IF ID/RF EX MEM WB IF ID/RF EX MEM WB

What can be done? Predict if the branch will be taken or not History of each branch saved and prediction done accordingly. Example: Bimodal predictor Branch prediction is very important and complex these days due to some architectural innovations and some bottlenecks.

Bimodal predictor Entry: 2-bit saturating counters Index: least significant bits of the instruction address Prediction: Combinatorial Update: When branch is resolved

Remedies to Structural hazards Simplest solution: Increase resources, functional units (Silicon allows us to do this) Another solution: Pipeline the functional units Pipelining is not always possible/feasible.

Superscalar execution! Execute more than one instruction every cycle. Make better use of the functional units Fetch, commit more instructions every cycle.

Memory Organization in processors Caches inside the chip Faster – ‘Closer’ SRAM cells They contain recently-used data They contain data in ‘blocks’

Rational behind caches Principle of spatial locality Principle of temporal locality Replacement policy (LRU, LFU, etc.) Principle of inclusivity

References http://en.wikipedia.org/wiki/Hazard_(computer_architecture) http://www.csee.umbc.edu/~plusquel/611/slides/chap3_3.html