EECS 370 Discussion 1 Calvin and Hobbes by Bill Watterson.

Slides:



Advertisements
Similar presentations
Lecture 19: Cache Basics Today’s topics: Out-of-order execution
Advertisements

CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
1 Lecture 17: Basic Pipelining Today’s topics:  5-stage pipeline  Hazards and instruction scheduling Mid-term exam stats:  Highest: 90, Mean: 58.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
Mary Jane Irwin ( ) [Adapted from Computer Organization and Design,
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 23 - Course.
Review CPSC 321 Andreas Klappenecker Announcements Tuesday, November 30, midterm exam.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
EECS 470 Pipeline Hazards Lecture 4 Coverage: Appendix A.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Pipelining Andreas Klappenecker CPSC321 Computer Architecture.
1 Stalling  The easiest solution is to stall the pipeline  We could delay the AND instruction by introducing a one-cycle delay into the pipeline, sometimes.
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?
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Caches!! Theory Design Examples 2.
Lecture 15: Pipelining and Hazards CS 2011 Fall 2014, Dr. Rozier.
Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 12 Overview and Concluding Remarks.
Pipelined Datapath and Control
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
Pipelining Enhancing Performance. Datapath as Designed in Ch. 5 Consider execution of: lw $t1,100($t0) lw $t2,200($t0) lw $t3,300($t0) Datapath segments.
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2012 Revised from original slides provided by MKP.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
CMPE 421 Parallel Computer Architecture
1 Designing a Pipelined Processor In this Chapter, we will study 1. Pipelined datapath 2. Pipelined control 3. Data Hazards 4. Forwarding 5. Branch Hazards.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Pipelining Basics.
1 COMP541 Pipelined MIPS Montek Singh Mar 30, 2010.
CECS 440 Pipelining.1(c) 2014 – R. W. Allison [slides adapted from D. Patterson slides with additional credits to M.J. Irwin]
Winter 2002CSE Topic Branch Hazards in the Pipelined Processor.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
Lecture 17 Final Review Prof. Mike Schulte Computer Architecture ECE 201.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Mid-semester Feedback Thanks! 2.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
Lecture 16: Basic Pipelining
1. Convert the RISCEE 1 Architecture into a pipeline Architecture (like Figure 6.30) (showing the number data and control bits). 2. Build the control line.
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.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
Introduction to Computer Organization Pipelining.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
EECS 370 Discussion 1 Sample Exam Questions. EECS 370 Discussion 2 Not Really… xkcd.com.
1 Pipelining CDA 3101 Discussion Section Question 1 – 6.1 Suppose that time for an ALU operation can be shortened by 25% in the following figure.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
EECS 322 April 10, 2000 EECS 322 Computer Architecture Pipeline Control, Data Hazards and Branch Hazards.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Control Hazards – Branch Prediction – Project 3 – stackoverflow Example 2.
1 Lecture 20: OOO, Memory Hierarchy Today’s topics:  Out-of-order execution  Cache basics.
EECS 370 Discussion smbc-comics.com.
Chapter Six.
CS2100 Computer Organization
CSCI206 - Computer Organization & Programming
Single Clock Datapath With Control
Computer Architecture
Pipelining in more detail
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
Data Hazards Data Hazard
Chapter Six.
The Processor Lecture 3.6: Control Hazards
Chapter Six.
Lecture 20: OOO, Memory Hierarchy
Lecture 20: OOO, Memory Hierarchy
November 5 No exam results today. 9 Classes to go!
MIPS Microarchitecture Multicycle Processor
Pipelining: Basic Concepts
Systems Architecture II
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:

EECS 370 Discussion 1 Calvin and Hobbes by Bill Watterson

EECS 370 Discussion Exam 7:00 – 8:30 Tuesday (Tomorrow!) Bring: Pencil Calculator Notes Sheet – letter-sized, double sided, 1 sheet 2

EECS 370 Discussion Exam Review Multi-cycle Datapath Pipeline Datapath Hazards! Caches 3

EECS 370 Discussion Multi-Cycle Datapath 4

EECS 370 Discussion Multi-Cycle Datapath 5

EECS 370 Discussion Multi-Cycle Datapath Frequency as compared to single-cycle? Do all instructions take the same amount of time? What is the CPI for a multi-cycle machine? 6

EECS 370 Discussion Multi-Cycle Datapath Frequency as compared to single-cycle? Higher Do all instructions take the same amount of time? No! (ADD, NAND, SW, BEQ: 4 cycles, LW: 5 cycles) What is the CPI for a multi-cycle machine? Depends on the instructions you run through it 7

EECS 370 Discussion Multi-Cycle Datapath Why doesn’t multi-cycle have data hazards or control hazards? What does the red Control circle on the diagram do? 8

EECS 370 Discussion Multi-Cycle Datapath Why doesn’t multi-cycle have data hazards or control hazards? Only one instruction is running at a time What does the red Control circle on the diagram do? Sets the control signals for muxes, ALU, Memory, and Reg 9

EECS 370 Discussion Multi-Cycle Datapath Let’s run an instruction through the datapath 10

EECS 370 Discussion Pipeline Datapath 11

EECS 370 Discussion Pipeline Datapath Frequency as compared to single-cycle? Do all instructions take the same amount of time? What is the CPI for a pipelined processor? 12

EECS 370 Discussion Pipeline Datapath Frequency as compared to single-cycle? Higher Do all instructions take the same amount of time? Yes What is the CPI for a pipelined processor? 1 (over many instructions) 13

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: What is the total execution time? (No Hazards) 14 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: What is the total execution time? (No Hazards) 10 * (4+1000) = ns 15 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Data Hazards Avoidance Detect and Stall Detect and Forward 16

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: 37% of ADD/NAND instructions followed by dependent instruction Detect and forward What is the total execution time? 17 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: 37% of ADD/NAND instructions followed by dependent instruction Detect and forward What is the total execution time? 10 * (4+1000) = ns 18 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Control Hazards No Branches Avoid Detect-and-stall Speculate-and-squash 19

EECS 370 Discussion Control Hazards In a 27 stage pipeline, if Branches are resolved in Stage 14: Which stages must be squashed? 20

EECS 370 Discussion Control Hazards In a 27 stage pipeline, if Branches are resolved in Stage 14: Which stages must be squashed? Stages 1 through 13 21

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: 10% of BEQ instructions are mispredicted Speculate-and-squash What is the total execution time? 22 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Pipeline Datapath Timing Example 1000 Instructions: 10% of BEQ instructions are mispredicted Speculate-and-squash What is the total execution time? 10 * ( *0.2*0.1*3) = ns 23 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Branch Predictors Pattern is: N N N T(Starting at Strongly Taken) What is the mispredict rate? 24 Weakly Taken Strongly Taken Taken Not Taken Strongly Not Taken Weakly Not Taken Taken Not Taken Taken Not Taken

EECS 370 Discussion Branch Predictors Pattern is: N N N T(Starting at Strongly Taken) What is the mispredict rate?25% 25 Weakly Taken Strongly Taken Taken Not Taken Strongly Not Taken Weakly Not Taken Taken Not Taken Taken Not Taken

EECS 370 Discussion Caches What are the types of Locality? What’s the calculation for Block Index bits? What’s the calculation for Set Index bits? 26

EECS 370 Discussion Caches What are the types of Locality? Spatial & Temporal What’s the calculation for Block Index bits? log 2 (block size) What’s the calculation for Set Index bits? log 2 (number of sets) 27

EECS 370 Discussion Types of Caches Fully Associative Blocks map to any cache line 28 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Types of Caches Direct Mapped Blocks map to one cache line 29 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Types of Caches Set Associative Blocks map to any line in a set 30 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Caches What are the Three C’s and how do we determine them? 31

EECS 370 Discussion Caches What are the Three C’s and how do we determine them? Compulsory – if we have never loaded it Capacity – misses in same size fully associative cache Conflict – any additional misses in actual cache 32

EECS 370 Discussion Caches What’s the difference between Write Allocate and No Write Allocate? What’s the difference between Write Through and Write Back? 33

EECS 370 Discussion Caches What’s the difference between Write Allocate and No Write Allocate? Write Allocate – add to cache on write miss No Write Allocate – don’t add to cache What’s the difference between Write Through and Write Back? Write Through – always write to memory Write Back – just write to cache 34

EECS 370 Discussion Caches Timing Example 1000 Instructions: 10% of BEQ instructions are mispredicted, Speculate-and-squash 20% of all memory accesses miss caches. Misses take 20 cycles What is the total execution time? 35 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access

EECS 370 Discussion Caches Timing Example 1000 Instructions: 10% of BEQ instructions are mispredicted, Speculate-and-squash 20% of all memory accesses miss caches. Misses take 20 cycles What is the total execution time? 10 * ( *0.2*0.1*3) + 10 * (1000*.2* *.25*.2* *.05*.2*20) = ns 36 25% lw 5% sw 50% add/nand 20% beq 6 ns – Register Read/Write 2 ns – ALU Operations 10 ns – Memory Access