CS420/520 Homework Assignment: Pipelining

Similar documents
CS61C : Machine Structures

CS3350B Computer Architecture Quiz 3 March 15, 2018

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

How to design a controller to produce signals to control the datapath

Pipeline design. Mehran Rezaei

COMP303 Computer Architecture Lecture 9. Single Cycle Control

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

ECE4680 Computer Organization and Architecture. Designing a Pipeline Processor

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes

CS152 Computer Architecture and Engineering Lecture 10: Designing a Single Cycle Control. Recap: The MIPS Instruction Formats

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards

Updated Exercises by Diana Franklin

Lecture 7 Pipelining. Peng Liu.

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

Advanced Computer Architecture CMSC 611 Homework 3. Due in class Oct 17 th, 2012

Pipelining. CSC Friday, November 6, 2015

CPS104 Computer Organization and Programming Lecture 19: Pipelining. Robert Wagner

Pipeline Control Hazards and Instruction Variations

Computer Architecture Practical 1 Pipelining

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

CS2100 Computer Organisation Tutorial #10: Pipelining Answers to Selected Questions

CPSC614: Computer Architecture

CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25

PS Midterm 2. Pipelining

ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller. Review of a Multiple Cycle Implementation

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

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

Final Exam Spring 2017

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering

CS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin. School of Information Science and Technology SIST

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

CENG 3420 Lecture 06: Datapath

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition. Chapter 4. The Processor

Advanced Computer Architecture Pipelining

CS61C : Machine Structures

Lecture 6 Datapath and Controller

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

EXAM #1. CS 2410 Graduate Computer Architecture. Spring 2016, MW 11:00 AM 12:15 PM

ECS 154B Computer Architecture II Spring 2009

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

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2)

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

ECE473 Computer Architecture and Organization. Pipeline: Control Hazard

Designing a Pipelined CPU

CISC 662 Graduate Computer Architecture Lecture 6 - Hazards

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

CS61C : Machine Structures

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

1 Hazards COMP2611 Fall 2015 Pipelined Processor

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor

CSE 490/590 Computer Architecture Homework 2

RISC Pipeline. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 4.6

ECE154A Introduction to Computer Architecture. Homework 4 solution

Lecture #17: CPU Design II Control

UC Berkeley CS61C : Machine Structures

CS 614 COMPUTER ARCHITECTURE II FALL 2004

Computer Organization and Structure

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

ECE232: Hardware Organization and Design

Department of Electrical Engineering and Computer Sciences Fall 2003 Instructor: Dave Patterson CS 152 Exam #1. Personal Information

Chapter 4. The Processor

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

Pipelined Processor Design

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

CPU Design Steps. EECC550 - Shaaban

361 multipath..1. EECS 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

Computer Hardware Engineering

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

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 6 Pipelining Part 1

Final Exam Fall 2007

CENG 3531 Computer Architecture Spring a. T / F A processor can have different CPIs for different programs.

Working on the Pipeline

CS433 Homework 2 (Chapter 3)

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


Outline Marquette University

Please state clearly any assumptions you make in solving the following problems.

COSC 6385 Computer Architecture - Pipelining

Recap: The MIPS Subset ADD and subtract EEL Computer Architecture shamt funct add rd, rs, rt Single-Cycle Control Logic sub rd, rs, rt

Very Simple MIPS Implementation

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

CS61C : Machine Structures

Very Simple MIPS Implementation

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

Review: Abstract Implementation View

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction

ECE232: Hardware Organization and Design

CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

Transcription:

CS42/52 Homework Assignment: Pipelining Total: points. 6.2 []: Using a drawing similar to the Figure 6.8 below, show the forwarding paths needed to execute the following three instructions: Add $2, $3, $4 Add $4, $5, $6 Add $5, $3, $4 6.3 [5] How could we modify the following code to make use of a Delayed Branch Slot (DBS)? Loop: lw $2, ($3) Addi $3, $3, 4 Beq $3, $4, Loop * Note that reordering the code sequence aside, you may have to modify some instruction(s). 6.4 [] First please identify all of the data dependencies in the following code. Then, assume the simultaneous reading and writing, which dependencies are data hazards that will be resolved via data forwarding? Please draw a diagram to show the backward data dependencies as that shown in the lecture notes. Add $2, $5, $4 Add $4, $2, $5 Sw $5, ($2) Add $3, $2, $4

6.5 [5] For each pipeline register in the following diagram (also refer to the detailed view of the execution unit), label each portion of the pipeline latch register with the name of the value that is loaded into the register and determine the length of each field in bits. For example: the IF/ID pipeline register holds ( bits) and the instruction ( bits) for a total of 64 bits. A Pipelined Datapath Ifetch Reg/Dec Wr RegWr ExtOp Op Branch PC AIUnit I IF/ID Register Imm6 Rs Ra Rb Rt RFile Rt Rw Di Rd Imm6 Unit Ex/ Register Data RA Do WA Di /Wr Register RegDst Src Wr toreg CS42/52 pipeline.25 UC. Colorado Springs Adapted from UCB97 & UCB3 A Detail View of the ution Unit (Integrated) You are here! imm6 6 Extender << 2 Adder Target 3 Control out ctr Ex/: Load s ory Address ExtOp= Src= 3 Op=Add CS42/52 pipeline.3 UC. Colorado Springs Adapted from UCB97 & UCB3

6.7 [] Using the Figure 6.25 below as a guide, use colored pens or markers to show which portions of the datapath are actually used in each of the five stages of the add instruction. We suggest that you use five copies of the figure to do so.

6. [5] Consider executing the following code on the pipelined datapath of Figure below: add $, $2, $3 add $4, $5, $6 add $7, $8, $9 add $, $, $2 add $3, $4, $5 At the end of the fifth cycle of execution, which registers are being read from the Register File and which register is written to the Register File? 6.2 [] With regard to the program in Exercise 6., explain what the forwarding unit is doing during the fifth cycle of execution, if any comparisons of register numbers are being made, mention them. Refer to Load Interlock Control on Pipeline II Power Point Slides for the clue.

6.3 [] Following five MIPS instructions go into the pipelined datapath below (the first one, Load, goes into the datapath in cycle ). Set the control signal values in the end of clock cycle 5. Load $, $() Add $3, $4, $5 SW $6, $7(2) Beq $8, $9, Add $, $2, $3 A Pipelined Datapath Ifetch Reg/Dec Wr RegWr ExtOp Op Branch PC AIUnit I IF/ID Register Imm6 Rs Ra Rb Rt RFile Rt Rw Di Rd Imm6 Unit Ex/ Register Data RA Do WA Di /Wr Register RegDst Src Wr toreg CS42/52 pipeline.25 UC. Colorado Springs Adapted from UCB97 & UCB3 A Detail View of the ution Unit (Integrated) You are here! imm6 6 Extender << 2 Adder Target 3 Control out ctr Ex/: Load s ory Address ExtOp= Src= 3 Op=Add CS42/52 pipeline.3 UC. Colorado Springs Adapted from UCB97 & UCB3

6. 5 [25] Use the following code fragment Loop: LD R, (R2) ;load R from memory at address +R2 DADDI R, R, # ; R = R + SD R, (R2) ; store R to memory at address +R2 DADDI R2, R2, #4 ; R2 = R2 + 4 DSUB R4, R3, R2 ; R4 = R3 R2 BNEZ R4, Loop ; branch to Loop if R4!=. Note BNEZ ; outcomes and targets are not known until ; the end of the execute stage. Assume that the initial value of R3 is R2 + 396. Assume using the classic five-stage integer pipeline and assume that all memory accesses take clock cycle. Clue: using the following pipeline timing chart for your solution: 2 3 4 5 6 7 8 9... LD R, (R2) F D X M W DADDI R, R, # F s s D X M W F = IF (instruction fetch stage) D = ID/RF (instruction decoding and register fetch stage) X = (execution stage) M = (memory access stage, be reading or writing) W = WriteBack (write the register) a. Show the timing of this instruction sequence for the RISC pipeline without any forwarding or bypassing hardware but assuming simultaneous register reading and writing in the same clock cycle. Furthermore, assume that the branch is handled by flushing the pipeline. Please draw a pipeline timing chart for the instruction sequence, like the example above. And, if all memory references take cycle, how many cycles does this loop take to execute? b. Show the timing of this instruction sequence for the RISC pipeline with forwarding and bypassing hardware, assuming simultaneous register reading and writing in the same clock cycle. Furthermore, assume that the branch is handled by predicting it as not taken. Please draw a pipeline timing chart for the instruction sequence, like the example above. And, if all memory references take cycle, how many cycles does this loop take to execute?