Computer Architecture - Quiz 3, answers Answer 1  IF: Read instruction from memory (1.2ns or 2*0.7ns), compute PC+4 (0.6ns). The super-pipeline has 2.

Slides:



Advertisements
Similar presentations
CMPE 421 Advanced Parallel Computer Architecture Pipeline datapath and Control.
Advertisements

Pipeline Exceptions & ControlCSCE430/830 Pipelining in MIPS MIPS architecture was designed to be pipelined –Simple instruction format (makes IF, ID easy)
CSC 370 (Blum)1 Instruction-Level Parallelism. CSC 370 (Blum)2 Instruction-Level Parallelism Instruction-level Parallelism (ILP) is when a processor has.
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
1 A few words about the quiz Closed book, but you may bring in a page of handwritten notes. –You need to know what the “core” MIPS instructions do. –I.
MIPS Pipelined Datapath
1 Quiz 3, Answers 1,3 The CPI is: 0.22* * * *12 = = 5.42 In the 2nd case the CPI is 1.0. Every instruction.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University RISC Pipeline See: P&H Chapter 4.6.
EECS 470 Pipeline Hazards Lecture 4 Coverage: Appendix A.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Goal: Reduce the Penalty of Control Hazards
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
DLX Instruction Format
Lecture 16: Basic CPU Design
Computer ArchitectureFall 2007 © October 31, CS-447– Computer Architecture M,W 10-11:20am Lecture 17 Review.
Computer Architecture - Superscalar Processors Exceptions and Interrupts  When an exception (overflow, page-fault) occurs there are several instructions.
Lecture 24: CPU Design Today’s topic –Multi-Cycle ALU –Introduction to Pipelining 1.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
CSC 4250 Computer Architectures September 15, 2006 Appendix A. Pipelining.
Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
CSC 4250 Computer Architectures September 26, 2006 Appendix A. Pipelining.
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.
Chapter 4 The Processor. Chapter 4 — The Processor — 2 Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
Sample Code (Simple) Run the following code on a pipelined datapath: add1 2 3 ; reg 3 = reg 1 + reg 2 nand ; reg 6 = reg 4 & reg 5 lw ; reg.
Chapter 6 Pipelined CPU Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides Pipelined operation – laundry analogy Text Fig. 6.1.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
CSIE30300 Computer Architecture Unit 05: Overcoming Data Hazards 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.
Introduction to Computer Organization Pipelining.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
MIPS Processor.
Simulator Outline of MIPS Simulator project  Write a simulator for the MIPS five-stage pipeline that does the following: Implements a subset of.
Interstage Buffers 1 Computer Organization II © McQuain Pipeline Timing Issues Consider executing: add $t2, $t1, $t0 sub $t3, $t1, $t0 or.
CS 352H: Computer Systems Architecture
Pipeline Timing Issues
Computer Organization
Exceptions Another form of control hazard Could be caused by…
CS2100 Computer Organization
CS 286 Computer Architecture & Organization
CSCI206 - Computer Organization & Programming
Basic Pipeline Datapath
Pipelining.
CDA 3101 Spring 2016 Introduction to Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
Pipelining.
Pipelining: Advanced ILP
Current Design.
Design of the Control Unit for One-cycle Instruction Execution
Computer Architecture
Systems Architecture II
MIPS Processor.
CSCI206 - Computer Organization & Programming
Data Hazards Data Hazard
The Processor Lecture 3.6: Control Hazards
Pipelining: Basic Concepts
CS 286 Computer Architecture & Organization
Pipelining (II).
CSC3050 – Computer Architecture
MIPS Pipelined Datapath
Problem ??: (?? marks) Consider executing the following code on the MIPS pipelined datapath: add $t5, $t6, $t8 add $t9, $t5, $t4 lw $t3, 100($t9) sub $t2,
MIPS Processor.
9/13/
CS 111 – Sept. 16 Machine language examples Instruction execution
Pipelining Hazards.
Presentation transcript:

Computer Architecture - Quiz 3, answers Answer 1  IF: Read instruction from memory (1.2ns or 2*0.7ns), compute PC+4 (0.6ns). The super-pipeline has 2 IF stages of 0.7ns.  ID: Registers can be read from the RF in 0.7ns. The branch target is computed in 0.6ns (PC + 16-bit offset), both can be done in parallel. However comparing both operands (by XOR) is done in 0.5ns after the register are read. This stage must be split as well. Thus we have 1 stage of 0.7ns and 1 stage of 0.5n.  EX: Adding two 32-bit numbers can be broken down into adding a 32-bits with the lower 16-bits, and adding the 32-bit result and carry with the higher 16-bits. 2 stages of 0.6ns.  MEM: 2 stages of 0.6ns.  WB: Write to the RF in 0.7ns.  Total: 9 stages (IF1,IF2,ID1,ID2,EX1,EX2,MEM1,MEM2,WB) of 0.7ns each.

Computer Architecture - Quiz 3, answers Answer 2 ld$1,0($gp)ld$2,4($gp)ld$3,8($gp) addi$6,$6,1subi$7,$7,1addi$gp,$gp,12 add$4,$1,$2slt$8,$6,$7add$9,$9,$3 bne$8,$zero,loopadd$9,$9,$4  The CPI is 4/11 = 0.36

Computer Architecture - Quiz 3, answers Answer 3 Unrolled Version addi$t7,$zero,100 addi$t8,$zero,1 Do:ld$t1,0($s0) ld$t10,4($s1)addi$t0,$t0,2 add$t5,$t1,$t1 addi$s0,$s0,8 add$t15,$t10,$t10 slt$t2,$t0,$t7 sw$t5,0($s1)addi$s0,$s0,8 sw$t15,-4($s1)beq$t2,$t8,Do The IPC of the loop is 11/6 = 1.83

Computer Architecture - Quiz 3, answers Answer 4 lw$t0,0($gp) add$t1,$t2,$t3 sub$t3,$t1,$t0  There is no imprecise exception in this case.  The lw might cause a segmentation fault, but sub won’t be executed before it because of a dependency on $t0.  add might be executed out-of-order but the value in $t1 will be the same thing every time. It will be $t2+$t3.