Computer Architecture

Slides:



Advertisements
Similar presentations
Advanced Computer Architectures Laboratory on DLX Pipelining Vittorio Zaccaria.
Advertisements

COMP25212 Advanced Pipelining Out of Order Processors.
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 Instruction Level Parallelism Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides.
Lecture 6: Pipelining MIPS R4000 and More Kai Bu
Computer Architecture Pipelines & Superscalars. Pipelines Data Hazards Code: lw $4, 0($1) add $15, $1, $1 sub$2, $1, $3 and $12, $2, $5 or $13, $6, $2.
1 IF IDEX MEM L.D F4,0(R2) MUL.D F0, F4, F6 ADD.D F2, F0, F8 L.D F2, 0(R2) WB IF IDM1 MEM WBM2M3M4M5M6M7 stall.
Computer Architecture
CIS429/529 Winter 2007 Pipelining II- 1 Additional pipelining topics Why pipelining is so hard: exception handling ILP techniques: loop unrolling.
Data Hazards RAW Hazard ADD.D F3, F1, F2 SUB.D F5, F6, F3 No Solution, normal property of programs WAW Hazard DIV.D F3, F1, F2 SUB.D F3, F6, F5 This instruction.
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
1 Lecture 5: Pipeline Wrap-up, Static ILP Basics Topics: loop unrolling, VLIW (Sections 2.1 – 2.2) Assignment 1 due at the start of class on Thursday.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
EECC551 - Shaaban #1 Fall 2002 lec# Floating Point/Multicycle Pipelining in MIPS Completion of MIPS EX stage floating point arithmetic operations.
COMP381 by M. Hamdi 1 Pipelining (Dynamic Scheduling Through Hardware Schemes)
1 Recap (Scoreboarding). 2 Dynamic Scheduling Dynamic Scheduling by Hardware – – Allow Out-of-order execution, Out-of-order completion – – Even though.
EENG449b/Savvides Lec 4.1 1/22/04 January 22, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
EENG449b/Savvides Lec 4.1 1/25/05 January 25 and 25, 2005 Prof. Andreas Savvides Spring g449b EENG 449b/CPSC.
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
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:
EECC551 - Shaaban #1 Lec # 2 Winter Instruction Pipelining Review Instruction pipelining is CPU implementation technique where multiple.
1 Lecture 4: Advanced Pipelines Control hazards, multi-cycle in-order pipelines, static ILP (Appendix A.4-A.10, Sections )
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.
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.
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.
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
CSC 4250 Computer Architectures September 26, 2006 Appendix A. Pipelining.
Pipeline Extensions prepared and Instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University MIPS Extensions1May 2015.
CA406 Computer Architecture Pipelines... continued.
CSC 4250 Computer Architectures September 29, 2006 Appendix A. Pipelining.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
MS108 Computer System I Lecture 6 Scoreboarding Prof. Xiaoyao Liang 2015/4/3 1.
CSC 4250 Computer Architectures September 22, 2006 Appendix A. Pipelining.
CIS 662 – Computer Architecture – Fall Class 11 – 10/12/04 1 Scoreboarding  The following four steps replace ID, EX and WB steps  ID: Issue –
ECE/CS 552: Pipeline Hazards © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim.
COMP25212 Advanced Pipelining Out of Order Processors.
Data Hazards Dependent instructions add %g1, %g2, %g3 sub %l1, %g3, %o0 Forwarding helps, but not all hazards can be avoided.
CMSC 611: Advanced Computer Architecture
Instruction-Level Parallelism
Exceptions Another form of control hazard Could be caused by…
Lecture 07: Pipelining Multicycle, MIPS R4000, and More
Out of Order Processors
CS203 – Advanced Computer Architecture
Pipelining Wrapup Brief overview of the rest of chapter 3
Appendix C Pipeline implementation
Exceptions & Multi-cycle Operations
Pipelining: Advanced ILP
CS 5513 Computer Architecture Pipelining Examples
Out of Order Processors
Pipelining Multicycle, MIPS R4000, and More
Instruction Pipelining Review:
CS 704 Advanced Computer Architecture
CSCE430/830 Computer Architecture
Instruction Execution Cycle
Project Instruction Scheduler Assembler for DLX
Overview What are pipeline hazards? Types of hazards
Scoreboarding ENGS 116 Lecture 7 Vincent H. Berk October 5, 2005
Lecture 4: Advanced Pipelines
Pipeline Control unit (highly abstracted)
Control Hazards Branches (conditional, unconditional, call-return)
CMSC 611: Advanced Computer Architecture
Lecture 06: Pipelining Implementation
Lecture 5: Pipeline Wrap-up, Static ILP
Interrupts and exceptions
CS 3853 Computer Architecture Pipelining Examples
CMSC 611: Advanced Computer Architecture
Presentation transcript:

Computer Architecture Lecture 10 EXCEPTIONS AND INTERRUPTS

Exceptions and Interrupts Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of some condition that changes the normal flow of execution. The condition is called an exception. Alternative concepts are interrupt, signal and event handling. In general, current state will be saved in a predefined location and execution will switch to a predefined handler (subroutine/procedure). Depending on the situation, the handler may later resume the execution at the original location, using the saved information to restore the original state. For example, an exception which will usually be resumed is a page fault, while a division by zero usually cannot be resolved transparently. (Wikipedia)

Common Exceptions I/O Device Request Integer Arithmetic Overflow FP Arithmetic Anomaly Page Faults Memory Protection Violation Undefined Instruction Power Failure etc

Characterizing Exceptions Synchronous vs. Asynchronous User Requested (system calls)/Coerced (mouse click) Maskable vs. Non-maskable Within / Between Instructions Resume-able/Terminate

Resumable Shut pipeline by converting all instruction after the instruction causing exception to NOP Save processor state Call Handler Resume State Precise Exception ???

MIPS Interrupts IF – Page Fault, MPV ID – Undefined or Illegal Op Code EX – Arithmetic MEM – Same as IF WB – None

MULTIPLE CYCLE PIPELINES

Single Cycle Computer Single Clock Cycle IF ID EXE WB (One Big Clock Cycle to Accommodate Longest Latency) IF ID EXE WB Single Clock Cycle

Multiple Cycle Computers IF ID EX WB All Instruction Go through the Processing One-by-One

Classic 5-Stage Integer Pipeline IF ID EX Mem WB Almost 1 CPI except for LUD and Branch Hazards

A Multiple Cycle Pipeline Register File (Integer/FP) EX FP ADD IF ID Mem WB FP Multiply Register File (Integer/FP) Divide Register File

Multiple Cycle Floating Point Pipeline EX Mem WB IF ID A 1 2 3 4 M .. 7 Divide Function Unit Latency Initiation /Re-Issue Interval Integer ALU 1 Load/Store FP Add 3 FP/Int Multiply 6 FP/Int Divide 24 25

Forwarding ALU/FP Instructions EX Mem WB IF ID A 1 2 3 4 M .. 7 Divide

Example 1 Without Forwarding With Forwarding L.D F10,0(R2) IF ID EXE MEM WB ADD.D F0,F1,F10 A1 A2 A3 A4 With Forwarding L.D F10,0(R2) IF ID EXE MEM WB ADD.D F0,F1,F10 A1 A2 A3 A4

EXAMPLE 2 ADD.D F0,F1,F2 ADD.D F5,F6,F7 ADD.D F0,F1,F2 ADD.D F5,F6,F0 IF ID A1 A2 A3 A4 ME WB ADD.D F5,F6,F7 ADD.D F0,F1,F2 IF ID A1 A2 A3 A4 ME WB ADD.D F5,F6,F0 I D

EXAMPLE 3 DIV.D F0,F1,F2 ADD.D F5,F6,F7 IF ID D I V 1 D I V 2 D I V 3 o D I V 24 ME WB ADD.D F5,F6,F7 DIV Unit is not Pipelined. So second instruction waits in ID stage although it is independent.

Example 4 - Out Of Order Execution Note All Instructions Independent L.D F10,0(R2) IF ID EXE MEM WB ADD.D F0,F1,F2 A1 A2 A3 A4 ADDI R5, R5, 10 Mul.D F9,F6,F7 M1 M2 M3 M4 M5 M6 M7 Add R3,R9,R10 Sub R7,R8,R10 Out Of Order Completion

Example 5 Clock Cycle Number Structural Hazard 1 2 3 4 5 6 7 8 9 10 11 Mul.D IF ID M1 M2 M3 M4 M5 M6 M7 MEM WB o o o EX EXE Add.D A1 A2 A3 A4 L.D Structural Hazard

Example 6 - WAW MUL.D F3,F1,F2 IF ID M1 M2 M3 M4 M5 M6 M7 MEM WB 8 9 10 11 12 13 MUL.D F3,F1,F2 IF ID M1 M2 M3 M4 M5 M6 M7 MEM WB ADD.D F1,F5,F4 A1 A2 A3 A4 MUL.D F3,F9,F12 Reg Busy bit in Register File A particular processor – it waits in ID stage in case of WAW not in WB, Page A-54, Paragraph 2

Example 7 L.D F4, 0(R2) MUL.D F0,F4,F6 ADD.D F2,F0,F8 S.D F2,0(R2)

Example 8 - EXCEPTIONS DIV.D F0,F1,F2 ADD.D F10,F10,F8 SUB.D F12,F12,F14

Data Hazards RAW Hazard WAW Hazard WAR Hazard ADD.D F3, F1, F2 SUB.D F5, F6, F3 WAW Hazard DIV.D F3, F1, F2 SUB.D F3, F6, F5 WAR Hazard DIV.D F3, F1, F2 SUB.D F5, F6, F3 ADD.D F3, F6, F7

TOO MANY ID STAGE STALLS – SOLUTION?

THE SCOREBOARD Next Time