ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

Similar documents
ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

Fundamentals of Computer Systems

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

Processor (I) - datapath & control. Hwansoo Han

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Chapter 4. The Processor

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Chapter 4. The Processor

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Computer Hardware Engineering

Computer Hardware Engineering

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

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.

Systems Architecture

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Chapter 4. The Processor Designing the datapath

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

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

CPE 335 Computer Organization. Basic MIPS Architecture Part I

ECE232: Hardware Organization and Design

Computer Hardware Engineering

Chapter 4 The Processor 1. Chapter 4A. The Processor

Computer Organization and Components

Chapter 4. The Processor

CENG 3420 Lecture 06: Datapath

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

LECTURE 5. Single-Cycle Datapath and Control

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

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

The MIPS Processor Datapath

ECE260: Fundamentals of Computer Engineering

Chapter 4. The Processor

Introduction. Datapath Basics

CSEN 601: Computer System Architecture Summer 2014

Computer Science 141 Computing Hardware

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

LECTURE 3: THE PROCESSOR

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

COMPUTER ORGANIZATION AND DESIGN

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

Topic #6. Processor Design

COMP303 Computer Architecture Lecture 9. Single Cycle Control

ECS 154B Computer Architecture II Spring 2009

RISC Design: Multi-Cycle Implementation

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

Computer Hardware Engineering

Systems Architecture I

Processor (multi-cycle)

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

CHW 362 : Computer Architecture & Organization

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

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

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

The overall datapath for RT, lw,sw beq instrucution

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions

RISC Processor Design

Single Cycle Datapath

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

CC 311- Computer Architecture. The Processor - Control

Single Cycle Datapath

CPU Organization (Design)

The Processor: Datapath & Control

CPE 335. Basic MIPS Architecture Part II

Review: Abstract Implementation View

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

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

COMPUTER ORGANIZATION AND DESIGN

Design of Digital Circuits Lecture 13: Multi-Cycle Microarch. Prof. Onur Mutlu ETH Zurich Spring April 2017

Chapter 5: The Processor: Datapath and Control

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

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Computer Architectures

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

ENE 334 Microprocessors

Pipelined Processor Design

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

ECE369. Chapter 5 ECE369

CSE 2021 COMPUTER ORGANIZATION

Processor: Multi- Cycle Datapath & Control

RISC Architecture: Multi-Cycle Implementation

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

Multiple Cycle Data Path

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

Computer Architecture 计算机体系结构. Lecture 2. Instruction Set Architecture 第二讲 指令集架构. Chao Li, PhD. 李超博士

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

Single Cycle CPU Design. Mehran Rezaei

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

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

Data paths for MIPS instructions

Pipelining. CSC Friday, November 6, 2015

Transcription:

ENGN64: Design of Computing Systems Topic 4: Single-Cycle Processor Design Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring 24 [ material from Patterson & Hennessy and Harris ]

Processor organization (microarchitecture) Multiple implementations for a single architecture: Single-cycle Each instruction executes in a single cycle Multi-cycle Each instruction is broken up into a series of shorter steps Pipelined Each instruction is broken up into a series of steps Multiple instructions execute at once. Superscalar Multiple instructions fetched, decoded and executed simultaneously. pplication Software Operating Systems rchitecture Microarchitecture Logic Digital Circuits nalog Circuits Devices Physics programs device drivers instructions registers datapaths controllers adders memories ND gates NOT gates amplifiers filters transistors diodes electrons 2

Introduction n n n CPU performance factors n n Instruction count n Determined by IS and compiler CPI and Cycle time n Determined by CPU hardware We will examine a number of MIPS implementations n n simplified single-cycle version more realistic pipelined version Simple subset, shows most aspects n n n reference: lw, sw rithmetic/logical: add, sub, and, or, slt Control transfer: beq, j 3

rchitectural state Determines everything about a processor: PC 32 registers PC' PC 32 32 32 32 Instruction 5 5 5 32 2 3 WD3 WE3 Register File 2 32 32 32 32 Data WD WE 32 4

Single-Cycle MIPS Processor Datapath Control Fetch instruction @ PC Decode instruction Fetch Operands Execute instruction Store result Update PC 5

Single-Cycle Datapath: lw fetch First consider executing lw STEP : Fetch instruction PC' PC Instruction Instr 2 3 WD3 WE3 Register File 2 Data WD WE 6

Single-Cycle Datapath: lw register read STEP 2: Read source operands from register file PC' PC Instruction Instr 25:2 2 3 WD3 WE3 Register File 2 Data WD WE 7

Single-Cycle Datapath: lw immediate STEP 3: Sign-extend the immediate PC' PC Instruction Instr 25:2 2 3 WD3 WE3 Register File 2 Data WD WE 5: Sign Extend SignImm 8

Single-Cycle Datapath: lw address STEP 4: Compute the memory address LUControl 2: PC' PC Instruction Instr 25:2 2 3 WD3 WE3 Register File 2 Src SrcB LU Zero LUResult Data WD WE 5: Sign Extend SignImm 9

Single-Cycle Datapath: lw memory read STEP 5: Read data from memory and write it back to register file PC' PC Instruction Instr 25:2 2:6 2 3 WD3 RegWrite WE3 Register File 2 LUControl 2: Src SrcB LU Zero LUResult Data WD WE ReadData 5: Sign Extend SignImm

Single-Cycle Datapath: lw PC increment STEP 6: Determine the address of the next instruction PC' PC Instruction Instr 25:2 2:6 2 3 WD3 RegWrite WE3 Register File 2 LUControl 2: Src SrcB LU Zero LUResult Data WD WE ReadData 4 + PCPlus4 5: Sign Extend SignImm Result

Single-Cycle Datapath: sw Write data in rt to memory PC' PC Instruction Instr 25:2 2:6 2:6 2 3 WD3 RegWrite WE3 Register File 2 LUControl 2: Src SrcB LU Zero LUResult WriteData MemWrite Data WD WE ReadData 4 + PCPlus4 5: Sign Extend SignImm Result 2

Single-Cycle Datapath: R-type instructions Read from rs and rt Write LUResult to register file Write to rd (instead of rt) PC' PC Instruction Instr 25:2 2:6 RegWrite RegDst LUSrc LUControl 2: MemWrite MemtoReg varies 2 3 WD3 WE3 Register File 2 Src SrcB LU Zero LUResult WriteData Data WD WE ReadData 4 + PCPlus4 2:6 5: 5: Sign Extend WriteReg 4: SignImm Result 3

Single-Cycle Datapath: beq Determine whether values in rs and rt are equal Calculate branch target address: BT = (sign-extended immediate << 2) + (PC+4) PCSrc PC' PC Instruction Instr 25:2 2:6 RegWrite RegDst LUSrc LUControl 2: Branch MemWrite MemtoReg x x 2 3 WD3 WE3 Register File 2 Src SrcB LU Zero LUResult WriteData Data WD WE ReadData 4 + PCPlus4 2:6 5: 5: WriteReg 4: Sign Extend SignImm <<2 + PCBranch Result 4

Complete single cycle processor [without jumps] 5

LU control n LU used for n Load/Store: F = add n Branch: F = subtract n R-type: F depends on funct field LU control Function ND OR add subtract set-on-less-than NOR 6

LU control n ssume 2-bit LUOp derived from opcode n Combinational logic derives LU control opcode LUOp Operation funct LU function LU control lw load word XXXXXX add sw store word XXXXXX add beq branch equal XXXXXX subtract R-type add add subtract subtract ND ND OR OR set-on-less-than set-on-less-than 7

The main control unit n Control signals derived from instruction R-type Load/ Store Branch rs rt rd shamt funct 3:26 25:2 2:6 5: :6 5: 35 or 43 rs rt address 3:26 25:2 2:6 5: 4 rs rt address 3:26 25:2 2:6 5: opcode always read read, except for load write for R-type and load sign-extend and add 8

Main decoder Instruction Op 5: RegWrite RegDst lusrc Branch Mem-read MemWrite MemtoReg LUOp : R-type lw sw X X beq X X addi 9

Implementing jumps Jump 2 address n Jump uses word address n Update PC with concatenation of n Top 4 bits of old PC n 26-bit jump address n 3:26 25: n Need an extra control signal decoded from opcode 2

Datapath and control with jumps Instruction Op 5: RegWrite RegDst lusrc Branch MemWrite MemtoReg LUOp : Jump j X X X X XX 2

Processor performance Program Execution Time = (# instructions)(cycles/instruction)(seconds/cycle) = # instructions x CPI x T C CPI = What is T C? 22

Critical path T C is limited by the critical path (lw) 3:26 5: MemtoReg Control MemWrite Unit Branch LUControl 2: Op LUSrc Funct RegDst RegWrite PCSrc PC' PC 4 Instruction + PCPlus4 Instr 25:2 2:6 2:6 5: 5: 2 3 WD3 WE3 Register File 2 WriteReg 4: Sign Extend SignImm Src SrcB <<2 Zero LU + LUResult WriteData PCBranch Data WD WE ReadData Single-cycle critical path: T c = t pcq_pc + t mem + max(t RFread, t sext + t mux ) + t LU + t mem + t mux + t RFsetup Result 23

Critical path delay Element Parameter Delay (ps) Register clock-to-q t pcq_pc 3 Register setup t setup 2 Multiplexer t mux 25 LU t LU 2 read t mem 25 Register file read t RFread 5 Register file setup t RFsetup 2 T c = t pcq_pc + 2t mem + t RFread + t mux + t LU + t RFsetup = [3 + 2(25) + 5 + 25 + 2 + 2] ps = 925 ps 24

Performance issues n Longest delay determines clock period n Critical path: load instruction n Instruction memory register file LU data memory register file n Not feasible to vary period for different instructions n Violates design principle n Making the common case fast 25

Summary Single-cycle processor design is simple Plenty of room for improvement: Pipelining Superscalar In Lab4 you will design, implement and boot your first processor! 26