CMSC 611: Advanced Computer Architecture

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Computer Organization and Architecture (AT70.01) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: Based.
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.
CMSC 611: Advanced Computer Architecture Scoreboard Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Computer Organization and Architecture
CMSC 611: Advanced Computer Architecture Instruction Level Parallelism Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides.
Computer Organization and Architecture
Computer Organization and Architecture
CIS429/529 Winter 2007 Pipelining II- 1 Additional pipelining topics Why pipelining is so hard: exception handling ILP techniques: loop unrolling.
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed., Sep 24, 2003 Topic: Pipelining -- Intermediate Concepts (Multicycle Operations;
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
EENG449b/Savvides Lec 4.1 1/22/04 January 22, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
ENGS 116 Lecture 61 Pipelining Difficulties and MIPS R4000 Vincent H. Berk October 6, 2008 Reading for today: A.3 – A.4, article: Yeager Reading for Wednesday:
CIS429.S00: Lec12- 1 Miscellaneous pipelining topics Why pipelining is so hard: exception handling Advanced pipelining techniques: loop unrolling.
EECC551 - Shaaban #1 Lec # 4 winter Data Hazards Requiring Stall Cycles In some code sequence cases, potential data hazards cannot be handled.
Computer Architecture
1 Manchester Mark I, This was the second (the first was a small- scale prototype) machine built at Cambridge. A production version of this computer.
CH12 CPU Structure and Function
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Lecture 5: Pipelining Implementation Kai Bu
Implementing Precise Interrupts in Pipelined Processors James E. Smith Andrew R.Pleszkun Presented By: Ravikumar Source:
Spring 2003CSE P5481 Precise Interrupts Precise interrupts preserve the model that instructions execute in program-generated order, one at a time If an.
F00: 1 CS/EE 5810 CS/EE 6810 Exceptions. F00: 2 CS/EE 5810 CS/EE 6810 Exceptions Just when you thought pipelines were not that hard… Pipeline benefit.
Implementing Precise Interrupts in Pipelined Processors James E. Smith Andrew R.Pleszkun Presented By: Shrikant G.
Appendix A. Pipelining: Basic and Intermediate Concept
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.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Data Hazards Dependent instructions add %g1, %g2, %g3 sub %l1, %g3, %o0 Forwarding helps, but not all hazards can be avoided.
Chapter Six.
Dynamic Scheduling Why go out of style?
CMSC 611: Advanced Computer Architecture
CMSC 611: Advanced Computer Architecture
Instruction-Level Parallelism
Computer Organization CS224
Lecture 15: Pipelining: Branching & Complications
Interrupts and signals
Basic Processor Structure/design
William Stallings Computer Organization and Architecture 8th Edition
Pipelining Wrapup Brief overview of the rest of chapter 3
Module: Handling Exceptions
Exceptions & Multi-cycle Operations
Pipelining: Advanced ILP
The processor: Exceptions and Interrupts
CMSC 611: Advanced Computer Architecture
Lecture 6: Advanced Pipelines
The processor: Pipelining and Branching
Superscalar Pipelines Part 2
Lecture 8: ILP and Speculation Contd. Chapter 2, Sections 2. 6, 2
How to improve (decrease) CPI
Chapter Six.
Architectural Support for OS
Project Instruction Scheduler Assembler for DLX
Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
Overview What are pipeline hazards? Types of hazards
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
ECE 445 – Computer Organization
Control Hazards Branches (conditional, unconditional, call-return)
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
CMSC 611: Advanced Computer Architecture
Lecture 06: Pipelining Implementation
Chapter 11 Processor Structure and function
Interrupts and exceptions
Presentation transcript:

CMSC 611: Advanced Computer Architecture Instruction Level Parallelism Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / © 2003 Elsevier Science

Floating-Point Pipeline Impractical for FP ops to complete in one clock (complex logic and/or very long clock cycle) More complex hazards Structural Data

Multi-cycle FP Pipeline Integer ALU 7-stage pipelined FP multiply Non-pipelined DIV operation stalling the whole pipeline for 24 cycles 4-stage pipelined FP addition Example: blue indicate where data is needed and red when result is available

Exception Types I/O device request Breakpoint Integer arithmetic overflow FP arithmetic anomaly Page fault Misaligned memory accesses Memory-protection violation Undefined instruction Privilege violation Hardware and power failure

Exception Requirements Synchronous vs. asynchronous I/O exceptions: Asyncronous Allow completion of current instruction Exceptions within instruction: Synchronous Harder to deal with User requested vs. coerced Requested predictable and easier to handle User maskable vs. unmaskable Resume vs. terminate Easier to implement exceptions that terminate program execution

Exceptions in MIPS Multiple exceptions might occur since multiple instructions are executing (LW followed by DIV might cause page fault and an arith. exceptions in same cycle) Exceptions can even occur out of order IF page fault before preceeding MEM page fault Pipeline exceptions must follow order of execution of faulting instructions not according to the time they occur

Stopping & Restarting Execution Some exceptions require restart of instruction e.g. Page fault in MEM stage When exception occurs, pipeline control can: Force a trap instruction into next IF stage Until the trap is taken, turn off all writes for the faulting (and later) instructions OS exception-handling routine saves faulting instruction PC

Stopping & Restarting Execution Precise exceptions Instructions before the faulting one complete Instructions after it restart As if execution were serial Exception handling complex if faulting instruction can change state before exception occurs Precise exceptions simplifies OS Required for demand paging

Precise Exception Handling The MIPS Approach: Hardware posts all exceptions caused by a given instruction in a status vector associated with the instruction The exception status vector is carried along as the instruction goes down the pipeline Once an exception indication is set in the exception status vector, any control signal that may cause a data value to be written is turned off Upon entering the WB stage the exception status vector is checked and the exceptions, if any, will be handled according the time they occurred Allowing an instruction to continue execution till the WB stage is not a problem since all write operations for that instruction will be disallowed

Instruction Set Complications Early-Write Instructions MIPS only writes late in pipeline Machines with multiple writes usually require capability to rollback the effect of an instruction e.g. VAX auto-increment, Instructions that update memory state during execution, e.g. string copy, may need to save & restore temporary registers Branching mechanisms Complications from condition codes, predictive execution for exceptions prior to branch Variable, multi-cycle operations Instruction can make multiple writes

Maintaining Precise Exceptions Pipelining FP instructions can cause out-of-order completion Exceptions also a problem: DIVF F0, F2, F4 ADDF F10, F10, F8 SUBF F12, F12, F14 No data hazards What if DIVF exception occurs after ADDF writes F10?

Four FP Exception Solutions Settle for imprecise exceptions Some supercomputers still uses this approach IEEE floating point standard requires precise exceptions Some machine offer slow precise and fast imprecise exceptions Buffer the results of all operations until previous instructions complete Complex and expensive design Most modern processors store results in a Reorder Buffer (ROB) and commit in order.

Four FP Exception Solutions Allow imprecise exceptions and get the handler to clean up any miss Save PC + state about the interrupting instruction and all out-of-order completed instructions The trap handler will consider the state modification caused by finished instructions and prepare machine to resume correctly Issues: consider the following example Instruction1: Long running, eventual exception Instructions 2 … (n-1) : Instructions that do not complete Instruction n : An instruction that is finished The compiler can simplify the problem by grouping FP instructions so that the trap does not have to worry about unrelated instructions

Four FP Exception Solutions Allow instruction issue to continue only if previous instruction are guaranteed to cause no exceptions: Mainly applied in the execution phase Used on MIPS R4000 and Intel Pentium