Computer Systems Architecture I. CSE 560M Lecture 5 Prof. Patrick Crowley

Similar documents
Advanced issues in pipelining

There are different characteristics for exceptions. They are as follows:

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

Administrivia. CMSC 411 Computer Systems Architecture Lecture 6. When do MIPS exceptions occur? Review: Exceptions. Answers to HW #1 posted

Instruction Level Parallelism. ILP, Loop level Parallelism Dependences, Hazards Speculation, Branch prediction

Lecture 7: Pipelining Contd. More pipelining complications: Interrupts and Exceptions

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles. Interrupts and Exceptions. Device Interrupt (Say, arrival of network message)

ECE 486/586. Computer Architecture. Lecture # 12

Instruction Pipelining Review

Minimizing Data hazard Stalls by Forwarding Data Hazard Classification Data Hazards Present in Current MIPS Pipeline

Appendix C: Pipelining: Basic and Intermediate Concepts

Announcement. ECE475/ECE4420 Computer Architecture L4: Advanced Issues in Pipelining. Edward Suh Computer Systems Laboratory

Predict Not Taken. Revisiting Branch Hazard Solutions. Filling the delay slot (e.g., in the compiler) Delayed Branch

LECTURE 10. Pipelining: Advanced ILP

COSC4201. Prof. Mokhtar Aboelaze York University

CMCS Mohamed Younis CMCS 611, Advanced Computer Architecture 1

COMP 4211 Seminar Presentation

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Exception Handling. Precise Exception Handling. Exception Types. Exception Handling Terminology

Pipelining. Principles of pipelining. Simple pipelining. Structural Hazards. Data Hazards. Control Hazards. Interrupts. Multicycle operations

COSC 6385 Computer Architecture - Pipelining (II)

Complications with long instructions. CMSC 411 Computer Systems Architecture Lecture 6 Basic Pipelining 3. How slow is slow?

CS 252 Graduate Computer Architecture. Lecture 4: Instruction-Level Parallelism

Basic Pipelining Concepts

Instr. execution impl. view

Multi-cycle Instructions in the Pipeline (Floating Point)

Computer Systems Architecture I. CSE 560M Lecture 10 Prof. Patrick Crowley

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Page 1. Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

Lecture 4: Advanced Pipelines. Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)

Execution/Effective address

09-1 Multicycle Pipeline Operations

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation

CS 152 Computer Architecture and Engineering. Lecture 13 - Out-of-Order Issue and Register Renaming

Pipelining. Principles of pipelining. Simple pipelining. Structural Hazards. Data Hazards. Control Hazards. Interrupts. Multicycle operations

Appendix C. Instructor: Josep Torrellas CS433. Copyright Josep Torrellas 1999, 2001, 2002,

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Floating Point/Multicycle Pipelining in DLX

Computer Architecture

CMSC 411 Computer Systems Architecture Lecture 6 Basic Pipelining 3. Complications With Long Instructions

Complex Pipelining. Motivation

CPE 631 Lecture 11: Instruction Level Parallelism and Its Dynamic Exploitation

Spring 2014 Midterm Exam Review

EECS 470 Lecture 7. Branches: Address prediction and recovery (And interrupt recovery too.)

Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

MIPS An ISA for Pipelining

Complex Pipelining COE 501. Computer Architecture Prof. Muhamed Mudawar

POLITECNICO DI MILANO. Exception handling. Donatella Sciuto:

CMSC 611: Advanced Computer Architecture

EE 457 Unit 8. Exceptions What Happens When Things Go Wrong

Chapter3 Pipelining: Basic Concepts

High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

What are Exceptions? EE 457 Unit 8. Exception Processing. Exception Examples 1. Exceptions What Happens When Things Go Wrong

Lecture 2: Pipelining Basics. Today: chapter 1 wrap-up, basic pipelining implementation (Sections A.1 - A.4)

Overview. Appendix A. Pipelining: Its Natural! Sequential Laundry 6 PM Midnight. Pipelined Laundry: Start work ASAP

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1)

What is ILP? Instruction Level Parallelism. Where do we find ILP? How do we expose ILP?

Slide Set 8. for ENCM 501 in Winter Steve Norman, PhD, PEng

Appendix A. Overview

CMCS Mohamed Younis CMCS 611, Advanced Computer Architecture 1

Lecture 9: Case Study MIPS R4000 and Introduction to Advanced Pipelining Professor Randy H. Katz Computer Science 252 Spring 1996

Chapter 3. Pipelining. EE511 In-Cheol Park, KAIST

CS252 Graduate Computer Architecture Lecture 8. Review: Scoreboard (CDC 6600) Explicit Renaming Precise Interrupts February 13 th, 2010

ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 8 Instruction-Level Parallelism Part 1

Four Steps of Speculative Tomasulo cycle 0

Page 1. Recall from Pipelining Review. Lecture 15: Instruction Level Parallelism and Dynamic Execution

Handout 2 ILP: Part B

CSE 820 Graduate Computer Architecture. week 6 Instruction Level Parallelism. Review from Last Time #1

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

Improvement: Correlating Predictors

ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST *

LECTURE 3: THE PROCESSOR

Advanced Computer Architecture CMSC 611 Homework 3. Due in class Oct 17 th, 2012

Complex Pipelining: Out-of-order Execution & Register Renaming. Multiple Function Units

1 Hazards COMP2611 Fall 2015 Pipelined Processor

ECE 313 Computer Organization FINAL EXAM December 13, 2000

CS252 Graduate Computer Architecture Lecture 6. Recall: Software Pipelining Example

CPE 631 Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation

NOW Handout Page 1. Review from Last Time #1. CSE 820 Graduate Computer Architecture. Lec 8 Instruction Level Parallelism. Outline

MIPS Pipelining. Computer Organization Architectures for Embedded Computing. Wednesday 8 October 14

DLX Unpipelined Implementation

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 9 Instruction-Level Parallelism Part 2

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Pipelining: Basic and Intermediate Concepts

Anti-Inspiration. It s true hard work never killed anybody, but I figure, why take the chance? Ronald Reagan, US President

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

Lecture: Pipeline Wrap-Up and Static ILP

Course on Advanced Computer Architectures

Notes Interrupts and Exceptions. The book uses exception as a general term for all interrupts...

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard

ארכי טק טורת יחיד ת עיבוד מרכזי ת

Lecture 4 Pipelining Part II

Outline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar, VLIW. CPE 631 Session 19 Exploiting ILP with SW Approaches

Good luck and have fun!

Lecture 6 MIPS R4000 and Instruction Level Parallelism. Computer Architectures S

Very short answer questions. "True" and "False" are considered short answers.

Getting CPI under 1: Outline

Pipelining. CSC Friday, November 6, 2015

Transcription:

Computer Systems Architecture I CSE 560M Lecture 5 Prof. Patrick Crowley

Plan for Today Note HW1 was assigned Monday Commentary was due today Questions Pipelining discussion II 2

Course Tip Question 1: When you read, are you getting it? Question 2: How do you answer Question 1? Answer: Write a computer program to verify that you understand what s supposed to happen. The tables in appendix A indicate the required data structures and logic. 3

Pipelining Refresher How does it help? How much can it help? How does a program s structure affect the effectiveness of a pipelined processor? Is pipelining an easy or hard concept? 4

Terminology When an instruction moves From ID to EX it is said to issue From MEM to WB it is said to commit 5

The Story So Far The simple pipeline Basic idea is simple yet powerful First complication: detection and handling of hazards We next consider exceptions Then we will consider pipelines that support multicycle operations 6

Exceptions A.k.a: interrupts, faults Handle exceptional cases via dynamic control flow transfer Precise meanings are machine-specific Examples: External I/O requests OS pre-emption for thread scheduling Operating system calls User-requested breakpoints Memory access violations Page faults Integer arithmetic overflows Question: Why are exceptions a concern for pipelines? 7

Handling Exceptions Precise handling must: Accommodate the request e.g., branch to some handler code re-start the machine, as it was Do not lose any data Do not prematurely change state Roughly: 1. Insert trap instruction (a branch to trusted code, usually privileged) on next IF 2. Don t change state until trap takes effect 3. Trap target saves state (PC, regs if needed) and restarts when completed 8

Pipeline Exceptions Can happen in most stages IF: page fault, bad memory alignment, memory protection violation ID: Illegal opcode EX: Arithmetic exception (e.g., overflow) MEM: same as IF WB: None Must be treated in instruction order Instruction I starts at time t Exception in MEM stage at time t+3 (treat it first) Instruction I+1 starts at time t+1 Exc. in IF stage at time t+1 (occurs earlier but treated 2 nd ) 9

Treating Exceptions in Order Status vector of possible exceptions carried on with the instruction Once an exception is posted, no writing i.e., no change of state; easy in integer pipeline just prevent store in memory When an instruction leaves MEM, check for exception 10

Difficulties Due to instruction set ( complex instructions) String instructions (which use general regs to hold state) Instructions that change state before the last stage (need to be able to back up ) Delayed branches Need to keep 2 PC s Condition codes Must remember when they were changed last Multicycle stages 11

Multicycle Operations So far: EX stage lasts 1 cycle Not so for floating point operations! Assume four functional units (0) Integer: loads, stores, Int ALU ops, branches (3) FP and integer multiplier (6) FP adder (25) FP and integer divider 12

Adding floating-point units When a unit is pipelined, an operation can be initiated every cycle if not, pipeline must wait for latency duration The result of instruction I can be forwarded to instruction I+latency 13

Unpipelined Functional Units 14

Pipelined Functional Units 15

Hazards in Example Pipeline Structural: Yes Divide unit is not pipelined in this example. Any divides fewer than 25 cycles apart will stall the pipe WB conflict discussed next RAW: Yes Essentially handled as in integer pipe but with higher frequency of stalls WAW: Yes Out of order completion: Yes 16

Conflict at the WB Stage E.g., Multd issued at time t and Addd issued at time t+3 Solution: reserve the WB stage at ID stage (as in Cray-1) Keep track of WB stage usage in a shift register Reserve the right time slot. If busy, stall for a cycle and repeat Shift every clock cycle 17

WAW Hazards Instruction I writes F-P register Fx at time t, Instruction I+k writes F-P register Fx at time t-m. But no instruction I+1,I+2,,I+k uses Fx (otherwise there would be a stall) Only requirement is that I+k s result be stored Solutions: Squash I: difficult to track in the pipe At ID stage check that result register is not a result register in all subsequent stages of other units. If it is, stall appropriate number of times. 18

Out-of-order Completion Suppose Instruction I finishes at time t Instruction I+k finishes at time t-m No hazard, etc. What happens if instruction I causes an exception at a time in [t-m, t] and instruction I+k had written one of its source operands? 19

Exception Handling (Multicycle FP) Do nothing e.g., only support imprecise exceptions; hard to implement virtual memory Have a precise and imprecise mode which restricts concurrency of F-P operations Restrict concurrency of F-P operations and on an exception simulate in software the instructions in between the faulting and finished one Flag early those operations that might result in an exception and stall accordingly Buffer results until previous (in-order) instructions have completed Can be costly with large differences in latencies However, same technique is used for correct out-of-order (OOO) execution! 20

Assignment HW1 assigned Wednesday, due Sep 23 Readings For Monday H&P: Appendix A, sections A6- A.9 V&L: Ch. 4 For Wednesday (HW1 due) H&P: sections 2.1,2.4-2.5 V&L: Ch. 5 21