Computer Architecture Experiment

Similar documents
Computer Architecture Experiment

Computer Architecture Experiment Lab2

Computer Architecture Experiment

1 Hazards COMP2611 Fall 2015 Pipelined Processor

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

Advanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017


ECE473 Computer Architecture and Organization. Pipeline: Control Hazard

Computer Architecture CS372 Exam 3

CS3350B Computer Architecture Quiz 3 March 15, 2018

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

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

Pipelining. CSC Friday, November 6, 2015

ECEC 355: Pipelining

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

Computer Architecture

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

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

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

Pipeline Overview. Dr. Jiang Li. Adapted from the slides provided by the authors. Jiang Li, Ph.D. Department of Computer Science

EXERCISE 3: DLX II - Control

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

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

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

ECE 154B Spring Project 4. Dual-Issue Superscalar MIPS Processor. Project Checkoff: Friday, June 1 nd, Report Due: Monday, June 4 th, 2018

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 5 Solutions

Pipelined Processor Design

Computer Organization and Structure

CS61C : Machine Structures

Chapter 7. Microarchitecture. Copyright 2013 Elsevier Inc. All rights reserved.

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

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

ECE260: Fundamentals of Computer Engineering

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

EN2910A: Advanced Computer Architecture Topic 02: Review of classical concepts

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

CSE 490/590 Computer Architecture Homework 2

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

Advanced Instruction-Level Parallelism

CSE 378 Midterm 2/12/10 Sample Solution

Very Simple MIPS Implementation

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

Chapter 3. Instructions:

Pipelined CPUs. Study Chapter 4 of Text. Where are the registers?

CS 230 Practice Final Exam & Actual Take-home Question. Part I: Assembly and Machine Languages (22 pts)

CS61C Midterm 2 Review Session. Problems Only

Orange Coast College. Business Division. Computer Science Department. CS 116- Computer Architecture. Pipelining

CS420/520 Homework Assignment: Pipelining

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

2B 52 AB CA 3E A1 +29 A B C. CS120 Fall 2018 Final Prep and super secret quiz 9

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Pipelining. Maurizio Palesi

The MIPS Processor Datapath

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

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

Pipelining and Caching. CS230 Tutorial 09

CprE 381 Computer Organization and Assembly Level Programming

EE320 Computer Organization. Project: Single Cycle Processor

L19 Pipelined CPU I 1. Where are the registers? Study Chapter 6 of Text. Pipelined CPUs. Comp 411 Fall /07/07

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

CISC 662 Graduate Computer Architecture Lecture 6 - Hazards

Processor (IV) - advanced ILP. Hwansoo Han

ECE473 Computer Architecture and Organization. Pipeline: Data Hazards

Very Simple MIPS Implementation

第三章 Instruction-Level Parallelism and Its Dynamic Exploitation. 陈文智 浙江大学计算机学院 2014 年 10 月

CS Basic Pipeline

Processor Architecture

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

EI338: Computer Systems and Engineering (Computer Architecture & Operating Systems)

Processor (II) - pipelining. Hwansoo Han

What is Pipelining? RISC remainder (our assumptions)

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.

ELE 655 Microprocessor System Design

1 /10 2 /16 3 /18 4 /15 5 /20 6 /9 7 /12

Alexandria University

ECE/CS 552: Pipeline Hazards

CS61C Midterm 2 Review Session. Problems + Solutions

Chapter 4. The Processor

14:332:331 Pipelined Datapath

ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Project Team TWO Objectives

Full Datapath. Chapter 4 The Processor 2

Processor Design Pipelined Processor (II) Hung-Wei Tseng

Instruction Frequency CPI. Load-store 55% 5. Arithmetic 30% 4. Branch 15% 4

Static, multiple-issue (superscaler) pipelines

Final Exam Fall 2007

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

ECE331: Hardware Organization and Design

Lecture 2: Processor and Pipelining 1

Chapter 2. Instructions:

4. The Processor Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

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

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

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

COMPUTER ORGANIZATION AND DESI

CS 2506 Computer Organization II

Pipelining! Advanced Topics on Heterogeneous System Architectures. Politecnico di Milano! Seminar DEIB! 30 November, 2017!

Transcription:

Computer Architecture Experiment Jiang Xiaohong College of Computer Science & Engineering Zhejiang University

Topics 0 Basic Knowledge 1 Warm up 2 simple 5-stage of pipeline CPU Design 3 Pipelined CPU with stall 4 Pipelined CPU with forwarding 5 Pipelined CPU resolving control hazard and support execution 31 MIPS Instructions 1.2

Outline Experiment Purpose Experiment Task Basic Principle Operating Procedures Precaution 1.3

Experiment Purpose Understand the principles of Pipelined CPU Bypass Unit Master the method of Pipelined Pipeline Forwarding Detection and Pipeline Forwards. Master the Condition In Which Pipeline Forwards. Master the Condition In Which Bypass Unit doesn t Work and the Pipeline stalls. master methods of program verification of Pipelined CPU with forwarding 1.4

Experiment Task Design the Bypass Unit of Datapath of 5- stages Pipelined CPU Modify the CPU Controller Conditions in Which Pipeline Forwards. Conditions in Which Pipeline Stalls. Verify the Pipeline CPU with program and observe the execution of program 1.5

Data Hazard Stalls Minimizing Data Hazard Stalls by Forwarding: In most cases, the problem can be resolved by forwarding, also called bypassing, short-circuiting. Data Hazards Requiring Stalls: In some cases, data hazards can not be handled by bypassing. 1.6

Instruction Demo time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 ADD $1,$2,$3 SUB $4,$1,$5 AND $6,$1,$7 OR $8,$1,$9 XOR $10,$1,$11 1.7

Data Hazard Causes Stalls time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 ADD $1,$2,$3 NOP DOUBLE BUMP CAN DO! BUBBLE BUBBLE BUBBLE BUBBLE BUBBLE NOP No hazard. BUBBLE BUBBLE BUBBLE BUBBLE SUB $4,$1,$5 AND $6,$1,$7 1.8

Pipeline Forward to Avoid the Data hazard time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 ADD $1,$2,$3 SUB $4,$1,$5 AND $6,$1,$7 OR $8,$1,$9 XOR $10,$1,$11 1.9

Move the Forwarding path to ID stage What we can do? Move the forwarding control logic to ID stage 1.10

Condition in Which Bypass Unit doesn t work time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 LW R10,0(R4) R10 ADD R12,R10,R11 R10 needs the value of R10 at the beginning of Clock Cycle 4, but at the end of Clock Cycle 4 outputs the R10 1.11

Pipeline Stalls time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 LW R1,0(R2) SUB R4,R1,R6 BUBBLE AND R1,R6,R7 BUBBLE OR R8,R1,R9 BUBBLE 1.12

Pipeline stalls at ID Stage time CYCLE 1 CYCLE 2 CYCLE 3 CYCLE 4 CYCLE 5 CYCLE 6 LW R1,0(R2) SUB R4,R1,R6 BUBBLE AND R1,R6,R7 OR R8,R1,R9 1.13

Pipelined CPU Top Module module top (input wire CCLK, BTN3, BTN2, input wire [3:0]SW, output wire LED, LCDE, LCDRS, LCDRW, output wire [3:0]LCDDAT); assign pc [31:0] = if_npc[31:0]; if_stage x_if_stage(btn3, rst, pc, mem_pc, mem_branch, id_wpcir, IF_ins_type, IF_ins_number,ID_ins_type,ID_ins_number); id_stage x_id_stage(btn3, rst, if_inst, if_pc4, wb_destr,, EX_ins_type, EX_ins_number, id_fwa, id_fwb); ex_stage x_ex_stage(btn3, id_imm, id_ina, id_inb, id_wreg,.. id_fwa, id_fwb,mem_alur, wb_dest,, MEM_ins_number); mem_stage x_mem_stage(btn3, ex_destr, ex_inb, ex_alur, mem_alur,..., WB_ins_type, WB_ins_number); wb_stage x_wb_stage(btn3, mem_destr, mem_alur, wb_dest,, OUT_ins_type, OUT_ins_number); 1.14

Observation Info Input West Button: Step execute South Button: Reset 4 Slide Button: Register Index Output 0-7 Character of First line: Instruction Code 8 of First line : Space 9-10 of First line : Clock Count 11 of First line : Space 12-15 of First line : Register Content Second line : stage name /number/type stage name: 1- f, 2- d, 3- e, 4- m, 5- w 1.15

Test code lw r1, $21(r0) add r2,r1,r1 sub r3,r1,r2 beq r1,r1,2 andi r4,r2,0 addi r5,r4,1 ori r6,r3,0 bne r6,r3,2 lw r7,$20(r0) sw r7,$21(r0) addi r8,r7,1 j 0 andi r9,r8,1 8c010015 00211020 00221822 10210002 30440000 20850001 34660000 14c30002 8c070014 Ac070015 20e80001 08000000 31090001 SF CA_2013Spring_Lab

Thanks! 1.17