Computer Architecture Lecture 2 Abhinav Agarwal Veeramani V.

Slides:



Advertisements
Similar presentations
Machine cycle.
Advertisements

More Intel machine language and one more look at other architectures.
CMPE 421 Advanced Parallel Computer Architecture Pipeline datapath and Control.
Execution Cycle. Outline (Brief) Review of MIPS Microarchitecture Execution Cycle Pipelining Big vs. Little Endian-ness CPU Execution Time 1 IF ID EX.
Lecture 4: CPU Performance
PIPELINE AND VECTOR PROCESSING
Computer Architecture Lecture 3 – Part 2 15 th May, 2006 Abhinav Agarwal Veeramani V.
RISC and Pipelining Prof. Sin-Min Lee Department of Computer Science.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
CMPT 334 Computer Organization
ENGS 116 Lecture 41 Instruction Set Design Part II Introduction to Pipelining Vincent H. Berk September 28, 2005 Reading for today: Chapter 2.1 – 2.12,
Instruction-Level Parallelism (ILP)
1 RISC Pipeline Han Wang CS3410, Spring 2010 Computer Science Cornell University See: P&H Chapter 4.6.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University RISC Pipeline See: P&H Chapter 4.6.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
Computer ArchitectureFall 2007 © October 31, CS-447– Computer Architecture M,W 10-11:20am Lecture 17 Review.
Lec 9: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
Appendix A Pipelining: Basic and Intermediate Concepts
Instruction Sets and Pipelining Cover basics of instruction set types and fundamental ideas of pipelining Later in the course we will go into more depth.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
Lecture 8: Processors, Introduction EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
The Central Processing Unit (CPU) and the Machine Cycle.
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.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
E X C E E D I N G E X P E C T A T I O N S VLIW-RISC CSIS Parallel Architectures and Algorithms Dr. Hoganson Kennesaw State University Instruction.
How Computers Work Lecture 12 Page 1 How Computers Work Lecture 12 Introduction to Pipelining.
CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Simulator Outline of MIPS Simulator project  Write a simulator for the MIPS five-stage pipeline that does the following: Implements a subset of.
Electrical and Computer Engineering University of Cyprus
CS161 – Design and Architecture of Computer Systems
Computer Organization
CS 286 Computer Architecture & Organization
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
ELEN 468 Advanced Logic Design
Pipelining.
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
Single Clock Datapath With Control
Design of the Control Unit for Single-Cycle Instruction Execution
Pipelining.
Pipelining: Advanced ILP
Chapter 4 The Processor Part 2
Computer Architecture Lecture 3 – Part 1 11th May, 2006
Computer Architecture Lecture 3
Design of the Control Unit for One-cycle Instruction Execution
Serial versus Pipelined Execution
Pipelining in more detail
CSC 4250 Computer Architectures
CSCI206 - Computer Organization & Programming
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
The Processor Lecture 3.4: Pipelining Datapath and Control
Control unit extension for data hazards
An Introduction to pipelining
Pipeline control unit (highly abstracted)
Designing a Pipelined CPU
Pipelining: Basic Concepts
CS 286 Computer Architecture & Organization
Pipeline Control unit (highly abstracted)
Pipelining Appendix A and Chapter 3.
Introduction to Computer Organization and Architecture
Pipelining.
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

Computer Architecture Lecture 2 Abhinav Agarwal Veeramani V.

Quick Recap Various metrics in design of processor The interface & internal structure Instruction Set Architecture  Assembly instructions  Instruction encoding add r1, r2, r

Outline RISC Multi-cycle execution Pipelining

Reduced Instruction Set Computer (RISC) Limited no. of instructions Fixed Length Simple to decode Easier to implement in hardware Prevalent in all commercial processors at the core level Counterpart – C(omplex)ISC  Intel processors  Multi-operation instructions  Still Intel processors have switched to RISC at second level

Execution Cycle of a RISC Instruction Five main phases of Instruction Lifecycle 1. IF: Instruction Fetch Read Instruction Memory at PC Bring the instruction into the CPU 2. ID/RF: Instruction Decode/Register Fetch Translate the opcode of the instruction to appropriate control signals No. of operands Registers clearly specified in instruction code Fetch operand values from the registers

Execution Cycle of a RISC Instruction 3. EX: ALU computation  Activate appropriate functional unit – Adder, Multiplier, Divider, Logical Unit  Why no Subtracter? 4. MEM: Memory Operation Load/Store data from/to Data Memory 5. WR: Register Write Write the final result value into register

A Picture speaks a thousand words

Multi Cycle Execution Cycle Per Instruction (CPI) Kinds of Implementation: 1. One cycle for each stage  Cycle time determined by longest stage  CPI = ? 2. Combine all stages into a single cycle  Cycle time determined by worst case instruction  CPI = 1

Execution Snapshot: Cycle 1IF PC AddressInstr 00000Mov r2, 2A 00001Mov r3, Add r1,r2,r Store r1,0(r4) 00100XXXX 00101XXXX

Execution Snapshot: Cycle 2ID/RF Add r1, r2, r PC AddressInstr 00000Mov 00001Mov 00010add 00011Store 00100XXXX 00101XXXX RegData r112 H r22A H r312 H r400 H r501 H

Execution Snapshot: Cycle 3EX RegData r112 H r22A H r312 H r400 H r501 H PC AddressInstr 00000Mov 00001Mov 00010add 00011Store 00100XXXX 00101XXXX Adder 122A Add r1, r2, r3

Execution Snapshot: Cycle 4MEM PC AddressInstr 00000Mov 00001Mov 00010add 00011Store 00100XXXX 00101XXXX Adder 122A ?? RegData r112 H r22A H r312 H r400 H r501 H Add r1, r2, r3

Execution Snapshot: Cycle 5WB PC AddressInstr 00000Mov 00001Mov 00010add 00011Store 00100XXXX 00101XXXX Adder RegData r13C H r22A H r312 H r400 H r501 H Add r1, r2, r3

Execution Snapshot: Cycle 1IF PC AddressInstr 00000Mov 00001Mov 00010add 00011Store 00100XXXX 00101XXXX store r1, 0(r4)

Instruction Execution Timeline Sequential Execution Low utilization of functional units Alternative ? IFID/ RF EXME M WB IFID/ RF EXME M IFID/ RF EXME M WB Instruction Execution Timeline add r1, r2, r3 store r1, 0(r4)

Pipelining: Concept and Example Washing machine, Dryer, Iron source:

Pipelining Concept Remarkable Insight or Common Sense source: Time Savings: Per person0% Overall42%

Implementation of Pipelining in RISC Parallelism in all 5 stages New instruction every cycle Best case scenario IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB Inst Time

Hardware Requirements source:

Problems Data hazards  Dependent Instructions add r1, r2, r3 store r1, 0(r4) Control Hazards  Branches resolution bnz r1, label add r1, r2, r3 label: sub r1, r2, r3 Structural Hazards IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB IFID/RFEXMEMWB

References Wikipedia: CPU Parallelism