Delayed Load What will happen if lw $6 $0($1) add $4 $6 $1

Slides:



Advertisements
Similar presentations
Datorteknik DelayedBranch bild 1 Delayed Branch All problems solved? NO, what will happen if b loop add $4 $6 $1... loop sub.
Advertisements

Morgan Kaufmann Publishers The Processor
COMP381 by M. Hamdi 1 (Recap) Pipeline Hazards. COMP381 by M. Hamdi 2 I n s t r. O r d e r add r1,r2,r3 sub r4,r1,r3 and r6,r1,r7 or r8,r1,r9 xor r10,r1,r11.
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
Datorteknik DataHazard bild 1 Data Hazards 0x30 sub $6 $0 $1 0x34 add $7 $6 $
Datorteknik DelayedLoad bild 1 Delayed Load. Datorteknik DelayedLoad bild 2 All problems solved? NO, what will happen if lw $6 $0($1) add $4 $6.
Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?
Datorteknik Pipeline1 bild 1 No Assembly line. Datorteknik Pipeline1 bild 2 Assembly line - start up ChassisAxelsMotorSeatsBody Start up waste.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Pipeline Hazards See: P&H Chapter 4.7.
Pipeline Hazards Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell University See P&H Appendix 4.7.
Review: MIPS Pipeline Data and Control Paths
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
©UCB CS 162 Computer Architecture Lecture 3: Pipelining Contd. Instructor: L.N. Bhuyan
Pipelining Andreas Klappenecker CPSC321 Computer Architecture.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Computer ArchitectureFall 2007 © October 22nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Lec 9: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
CSCE 212 Quiz 9a – 4/1/11 For the following questions, assume the clock cycle times given above and the following set of instructions: lw $5, -16($5) sw.
Pipeline Data Hazards: Detection and Circumvention Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly.
CPE432 Chapter 4B.1Dr. W. Abu-Sufah, UJ Chapter 4B: The Processor, Part B-2 Read Section 4.7 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CMPE 421 Parallel Computer Architecture
Pipeline Data Hazards Warning, warning, warning! Read 4.8 Peer Instruction Lecture Materials for Computer Architecture by Dr. Leo Porter is licensed under.
CSE431 L07 Overcoming Data Hazards.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 07: Overcoming Data Hazards Mary Jane Irwin (
HazardsCS510 Computer Architectures Lecture Lecture 7 Pipeline Hazards.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
CSIE30300 Computer Architecture Unit 05: Overcoming Data Hazards Hsin-Chou Chi [Adapted from material by and
EE524/CptS561 Jose G. Delgado-Frias 1 Processor Basic steps to process an instruction IFID/OFEXMEMWB Instruction Fetch Instruction Decode / Operand Fetch.
CSE431 L06 Basic MIPS Pipelining.1Irwin, PSU, 2005 MIPS Pipeline Datapath Modifications  What do we need to add/modify in our MIPS datapath? l State registers.
CSE 340 Computer Architecture Spring 2016 Overcoming Data Hazards.
Computer Organization
Exceptions Another form of control hazard Could be caused by…
Stalling delays the entire pipeline
Example Addiu $t1 $r0 3 Addiu $t1 $t1 5 Addiu $t1 $t1 7.
Pipelining: Hazards Ver. Jan 14, 2014
Pipelining Chapter 6.
CSCI206 - Computer Organization & Programming
Basic Pipeline Datapath
Single Clock Datapath With Control
Chapter 4 The Processor Part 3
Review: MIPS Pipeline Data and Control Paths
SOLUTIONS CHAPTER 4.
Pipelining review.
Pipelining Chapter 6.
Pipelining in more detail
CSCI206 - Computer Organization & Programming
CSC 4250 Computer Architectures
CSCI206 - Computer Organization & Programming
\course\cpeg323-05F\Topic6b-323
Data Hazards Data Hazard
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
The Processor Lecture 3.5: Data Hazards
Daxia Ge Friday February 9th, 2007
Access the Instruction from Memory
Pipeline control unit (highly abstracted)
Pipelining: Basic Concepts
Reading and writing to data memory
Assembly line - start up
Pipeline Control unit (highly abstracted)
Pipelining (II).
CSC3050 – Computer Architecture
Data Path Diagrams.
Acceleration How to improve speed? At what costs?.
Introduction to Computer Organization and Architecture
Throughput = #instructions per unit time (seconds/cycles etc.)
MIPS Pipelined Datapath
Problem ??: (?? marks) Consider executing the following code on the MIPS pipelined datapath: add $t5, $t6, $t8 add $t9, $t5, $t4 lw $t3, 100($t9) sub $t2,
Presentation transcript:

Delayed Load What will happen if...... lw $6 $0($1) add $4 $6 $1

Critical path “DM” to “EX” ? 0x30 lw $6 $0($1) IM Reg DM Reg IM Reg DM Reg 0x34 add $4 $6 $1 0x38 add $7 $6 $2 IM Reg DM Reg

The Model We Use Zero ext. = = Branch logic A ALU 4 B + = = 31 + A ALU 4 B + = = 31 + Sgn/Ze extend

Fix or Not? The Critical path would be 2T (ALU+DM) Clockspeed only half WE CHOOSE NOT TO FIX

“DM” to “DE” 0x30 lw $6 $0($1) 0x34 add $4 $6 $1 0x38 add $7 $6 $2 IM Reg DM Reg IM Reg DM Reg 0x34 add $4 $6 $1 0x38 add $7 $6 $2 IM Reg DM Reg

Delayed Load One “delayed load” slot Still better than NO forward lw $6 $0($1) other useful operation, or nop add $4 $6 $1 add $7 $6 $4 Still better than NO forward

Pipeline Efficiency Critical path cut to 1/4 Can we do the same with only three stages?

4 Stage Pipe IM Reg DM Reg 3 Stage Pipe IM Reg Reg DM

4 Stage Pipe Zero ext. = = Branch logic A ALU 4 B + = = 31 + Sgn/Ze A ALU 4 B + = = 31 + Sgn/Ze extend

Zero ext. = = Branch logic A ALU 4 B + = = 31 + Sgn/Ze extend

Critical Path? ALU + DM No, it’s too long, no can do!

Zero ext. = = Branch logic A ALU 4 B + = = 31 + Sgn/Ze extend

What about the instruction set? lw $t2 4($t4)? NO, ALU is not in path lw $t2 $t4? OK, No need for ALU

Avoid Delayed Load? Yes, by moving DM to EX, we can forward the result

Different Pipelength/depth Is it possible to implement both version in one structure (MIPS pipe). NO! There might be collisions, both EX, and DM accesses memory at the same time.

Pipeline Efficiency Did we change the critical path? NO!, ALU and DM are not in sequence