CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W12-M

Similar documents
CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W9-W

Designing a Pipelined CPU

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M

Chapter 3 & Appendix C Pipelining Part A: Basic and Intermediate Concepts

Pipelined Datapath. One register file is enough

CSE 2021 COMPUTER ORGANIZATION

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

Pipelined Datapath. Reading. Sections Practice Problems: 1, 3, 8, 12 (2) Lecture notes from MKP, H. H. Lee and S.

CSE 2021 COMPUTER ORGANIZATION

ECE473 Computer Architecture and Organization. Processor: Combined Datapath

Pipelined Datapath. Reading. Sections Practice Problems: 1, 3, 8, 12

Assignment 1 solutions

Chapter Six. Dataı access. Reg. Instructionı. fetch. Dataı. Reg. access. Dataı. Reg. access. Dataı. Instructionı fetch. 2 ns 2 ns 2 ns 2 ns 2 ns

Pipelining. Chapter 4

cs470 - Computer Architecture 1 Spring 2002 Final Exam open books, open notes

ECS 154B Computer Architecture II Spring 2009

comp 180 Lecture 25 Outline of Lecture The ALU Control Operation & Design The Datapath Control Operation & Design HKUST 1 Computer Science

Chapter 4 (Part II) Sequential Laundry

Single-Cycle Examples, Multi-Cycle Introduction

COMP2611: Computer Organization. The Pipelined Processor

What do we have so far? Multi-Cycle Datapath (Textbook Version)

PS Midterm 2. Pipelining

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

ECE 313 Computer Organization EXAM 2 November 9, 2001

Pipelined Processor Design

Basic Instruction Timings. Pipelining 1. How long would it take to execute the following sequence of instructions?

EEC 483 Computer Organization

The Pipelined MIPS Processor

ECE 313 Computer Organization FINAL EXAM December 13, 2000

Unpipelined Machine. Pipelining the Idea. Pipelining Overview. Pipelined Machine. MIPS Unpipelined. Similar to assembly line in a factory

CS 251, Winter 2019, Assignment % of course mark

Improve performance by increasing instruction throughput

T = I x CPI x C. Both effective CPI and clock cycle C are heavily influenced by CPU design. CPI increased (3-5) bad Shorter cycle good

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

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

ECE232: Hardware Organization and Design

CS420/520 Homework Assignment: Pipelining

EEC 483 Computer Organization

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13

Pipeline Data Hazards. Dealing With Data Hazards

The Processor Pipeline. Chapter 4, Patterson and Hennessy, 4ed. Section 5.3, 5.4: J P Hayes.

Pipelined Processor Design

CSE Lecture 13/14 In Class Handout For all of these problems: HAS NOT CANNOT Add Add Add must wait until $5 written by previous add;

SI232 Set #20: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Chapter 6 ADMIN. Reading for Chapter 6: 6.1,

Pipelining. CSC Friday, November 6, 2015

EECS 322 Computer Architecture Improving Memory Access: the Cache

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Enhanced Performance with Pipelining

Pipelining: Overview. CPSC 252 Computer Organization Ellen Walker, Hiram College

CS 152 Computer Architecture and Engineering

Lecture Topics. Announcements. Today: Data and Control Hazards (P&H ) Next: continued. Exam #1 returned. Milestone #5 (due 2/27)

What do we have so far? Multi-Cycle Datapath

Lecture 6: Pipelining

Pipelining: Basic Concepts

Review: Computer Organization

Advanced Computer Architecture Pipelining

ECE331: Hardware Organization and Design

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University

Midnight Laundry. IC220 Set #19: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Return to Chapter 4

EC 413 Computer Organization - Fall 2017 Problem Set 3 Problem Set 3 Solution

Pipelining Analogy. Pipelined laundry: overlapping execution. Parallelism improves performance. Four loads: Non-stop: Speedup = 8/3.5 = 2.3.

Laboratory Pipeline MIPS CPU Design (2): 16-bits version

ECE260: Fundamentals of Computer Engineering

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

Exceptions and interrupts

ECE260: Fundamentals of Computer Engineering

EE 457 Unit 6a. Basic Pipelining Techniques

ECE232: Hardware Organization and Design

CSE140: Components and Design Techniques for Digital Systems

Solutions for Chapter 6 Exercises

CS 251, Winter 2018, Assignment % of course mark

Computer Science 141 Computing Hardware

Processor: Multi- Cycle Datapath & Control

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

CS 152 Computer Architecture and Engineering Lecture 4 Pipelining

1048: Computer Organization

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

Processor (II) - pipelining. Hwansoo Han

In-order vs. Out-of-order Execution. In-order vs. Out-of-order Execution

Lecture 8: Data Hazard and Resolution. James C. Hoe Department of ECE Carnegie Mellon University

ECE473 Computer Architecture and Organization. Pipeline: Data Hazards

Instruction word R0 R1 R2 R3 R4 R5 R6 R8 R12 R31

CPE 335 Computer Organization. Basic MIPS Architecture Part I

Pipelining. lecture 15. MIPS data path and control 3. Five stages of a MIPS (CPU) instruction. - factory assembly line (Henry Ford years ago)

Designing a Pipelined CPU

Instruction Pipelining

Full Datapath. Chapter 4 The Processor 2

Instruction Pipelining

Merging datapaths: (add,lw, sw)

The University of Alabama in Huntsville Electrical & Computer Engineering Department CPE Test II November 14, 2000

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Static, multiple-issue (superscaler) pipelines

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

CS/CoE 1541 Mid Term Exam (Fall 2018).

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

Multi-cycle Datapath (Our Version)

ECE 331 Hardware Organization and Design. UMass ECE Discussion 10 4/5/2018

Transcription:

CSE 22 Computer Organization Hugh Chesser, CSEB 2U W2-

Graphical Representation Time 2 6 8 add $s, $t, $t IF ID E E Decode / Execute emory Back fetch from / stage into the instruction register file. Shading in each block indicates the element is used for in the instruction. Since is not accessed in an add instruction, it is not shaded. 2. Shading on the left half of the block indicates that the element is being written. During instruction fetch, the instruction is read so the right half of IF block is shaded. 3. Shading on the right half of the block indicates that the element is being read. During write back stage, the register file is written so the left half of the block is shaded. W2-2

Activity 2 Using the graphical representation, show that the following swap procedure has a pipeline hazard. Reorder the instructions to avoid pipeline stalls. lw $t, ($t) lw $t2, ($t) sw $t2, ($t) sw $t, ($t) lw $t, ($t) lw $t2, ($t) $t loaded $t2 loaded sw $t2, ($t) $t2 stored sw $t, ($t) $t stored W2-3

Agenda Topics:. Pipeline path and Control Patterson:.5 W2-

Pipelined path () IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress IF: Fetch ID: Decode / file read E: Execute / W2- ress Calculation E: emory Access : back 5

Pipelined path (2) In pipelined path, each instruction is broken in five steps: IF ( Fetch), ID ( Decode and register file read), E (Execution or address calculation), E ( emory Access), and ( Back). Each of the above step takes one clock cycle. s and advance forward by from left to right. flows from right to left only in two cases. back stage placing the in the register file 2. Selection of the value for between ( + ) and branch target address s in between different stages store the store values to be used by next stage Name of registers are based on the two pipelined stages that the registers separate Each pipelining register has a different size: IF/ID register is 6 bits wide; ID/E register is 28 bits wide; E/E register is 97 bits wide; and E/ is 6 bits wide There are no pipeline registers at the end of the write-back stage as is written directly into or register file or the. W2-6

How pipelining works (): Example lw $s, ($s2) path for Fetch (IF) IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress IF: Fetch W2-7

How pipelining works (2): Example lw $s, ($s2) path for Decode and File (ID) IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress ID: Decode / file read W2-8

How pipelining works (3): Example lw $s, ($s2) path for Execute / ress Calculation (E) IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress E: Execute / W2- ress Calculation 9

How pipelining works (): Example lw $s, ($s2) path for emory Access (E) IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress W2- E: emory Access

How pipelining works (5): Example lw $s, ($s2) path for Back () IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress W2- : back

How pipelining works (6): Example lw $s, ($s2) Complete path for lw instruction IF/ID ID/E E/E E/ ress Regsiter 2 2 32 ress IF: Fetch ID: Decode / file read E: Execute / W2- ress Calculation E: emory Access : back 2

ultiple Clock Cycle Pipeline Diagram Time (in clock cycles) Program execution order CC CC 2 CC 3 CC CC 5 CC 6 lw $s, ($s2) I Reg D Reg IF/ID ID/E E/E E/ fetch decode Execution access back Activity 3: Using the graphical representation, show that the multiple clock cycle pipeline diagram of the following two instructions lw $t,($t) sub $s,$s,$s2 W2-3

Pipelined Control () Src Control ID/E E/E E/ IF/ID E ress register register 2 s 2 register Reg Src Branch em ress emtoreg [5 ] 6 32 6 control em [2 6] [5 ] W2- RegDst Op

Pipelined Control (2) Control lines in pipelined implementation is divided into five groups according to the pipeline stage. Fetch: No control needed as the write control of and read control of instruction is always asserted. 2. Decode/ File : No controls needed as the register file in being read during each instruction. 3. Execution/ress Calculation: Control signals are Src, RegDst, and Op. For lw/sw instructions, Src =, RegDst = and Op =. For R-type instructions, Src =, RegDst =, and Op =.. emory Access: Control signals are Branch, em, and em. For lw instruction, em = and Branch = em =. For sw instruction, em = and Branch = em =. For branch instructions, Branch = and emwrite = em =. For R-type instructions, Branch = em = em =. 5. Back: Control signals are emtoreg. For lw instructions, emtoreg =. For R-type instructions, emtoreg =. Pipeline registers are ed to include the control signals for each stage of an instruction. W2-5

Activity Show the following instructions going through the pipeline: lw $, 2($) sub $,$2,$3 and $2,$,$5 or $3,$6,$7 and $,$8,$9 W2-6

Activity : Clock Cycle # IF : lw $, 2($) ID : before< > E : before< 2> E : be fore< 3> W B: before < > IF/ID ID/E E/E E/ Control E ress register register 2 s 2 register Reg Src Branch ress em emtoreg [5 ] control em C lo ck [2 6] [5 ] RegDst W2- Op 7

Activity : Clock Cycle # 2 IF : sub $, $2, $3 ID : lw $, 2($ ) E : before < > E : be fore<2> W B : be fore < 3> IF/ID ID/E E/E E/ lw Control E ress Reg register register 2 s 2 register $ $ Src Branch em ress emtoreg 2 [5 ] 2 control em C lo c k 2 [2 6] [5 ] RegDst W2- Op 8

Activity : Clock Cycle # 3 IF : and $2, $, $ 5 ID : sub $, $ 2, $3 E : lw $,... E : before< > W B : be fore< 2> IF/ID ID/E E/E E/ sub Control E ress 2 3 register register 2 s 2 register Reg $2 $3 $ Src Branch em ress emtoreg [5 ] 2 control em C lock 3 [2 6] [5 ] RegDst W2- Op 9

Activity : Clock Cycle # IF : or $ 3, $6, $7 ID : and $ 2, $2, $3 E : sub $,... E : lw $,... W B: be fore< > IF/ID ID/E E/E E/ and Control E ress 5 Reg register register 2 $ $2 s $5 $3 2 register Src Branch em ress emtoreg [5 ] control em C lo ck 2 [2 6] [5 ] 2 RegDst W2- Op 2

Activity : Clock Cycle # 5 IF: add $, $8, $9 ID: or $3, $6, $7 E: and $2,... E: sub $,... : lw $,... IF/ID ID/E E/E E/ or Control E ress 6 7 register register 2 s 2 register Reg $6 $7 $ $5 Src Branch em ress emtoreg [5 ] control em Clock 5 3 [2 6] [5 ] 3 2 RegDst W2- Op 2