Implementing an Instruction Set

Similar documents
Implementing an ISA, part II - Control

CS61CL Machine Structures. Lec 5 Instruction Set Architecture

The MIPS Instruction Set Architecture

Computer Architecture. The Language of the Machine

CS 4200/5200 Computer Architecture I

Reduced Instruction Set Computer (RISC)

MIPS Reference Guide

Reduced Instruction Set Computer (RISC)

CS654 Advanced Computer Architecture. Lec 1 - Introduction

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

Instruction Set Principles. (Appendix B)

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

Computer Architecture Experiment

Project Part A: Single Cycle Processor

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

MIPS Instruction Format

Review: Organization. CS152 Computer Architecture and Engineering Lecture 2. Review of MIPS ISA and Design Concepts

EE108B Lecture 3. MIPS Assembly Language II

software hardware Which is easier to change/design???

MIPS Instruction Set

ECE468 Computer Organization & Architecture. MIPS Instruction Set Architecture

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

Question 0. Do not turn this page until you have received the signal to start. (Please fill out the identification section above) Good Luck!

Anne Bracy CS 3410 Computer Science Cornell University. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

Computer Organization & Design

B649 Graduate Computer Architecture. Lec 1 - Introduction

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

F. Appendix 6 MIPS Instruction Reference

A Processor! Hakim Weatherspoon CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

MIPS Instruction Reference

Exam in Computer Engineering

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

Computer Architecture. MIPS Instruction Set Architecture

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013

Digital System Design II

Instruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers

CS61C : Machine Structures

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

MIPS Assembly Language. Today s Lecture

Today s Lecture. MIPS Assembly Language. Review: What Must be Specified? Review: A Program. Review: MIPS Instruction Formats

Midterm. Sticker winners: if you got >= 50 / 67

Midterm Questions Overview

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

Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

MOTIVATION. B649 Parallel Architectures and Programming

Midterm Questions Overview

TSK3000A - Generic Instructions

Q1: /30 Q2: /25 Q3: /45. Total: /100

ECE Exam I February 19 th, :00 pm 4:25pm

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam One 4 February Your Name (please print clearly)

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

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

CS Computer Architecture Spring Week 10: Chapter

ENCM 369 Winter 2013: Reference Material for Midterm #2 page 1 of 5

Mips Code Examples Peter Rounce

CS 351 Exam 2 Mon. 11/2/2015

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction

Computer Architecture

CS61C : Machine Structures

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

Concocting an Instruction Set

Concocting an Instruction Set

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

CS152 Computer Architecture and Engineering. Lecture 1 CS 152 Introduction & MIPS Review John Lazzaro. Dave Patterson

CSSE 232 Computer Architecture I. I/O and Addressing

ece4750-parc-isa.txt

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

INSTRUCTION SET COMPARISONS

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

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

Mark Redekopp, All rights reserved. EE 352 Unit 3 MIPS ISA

CS152 Computer Architecture and Engineering. Lecture 1 Introduction & MIPS Review Dave Patterson. www-inst.eecs.berkeley.

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

RTL Model of a Two-Stage MIPS Processor

CPU Design for Computer Integrated Experiment

SPIM Instruction Set

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 22 September Your Name (please print clearly) Signed.

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

M2 Instruction Set Architecture

Computer Architecture

MIPS%Assembly% E155%

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

Lec 10: Assembler. Announcements

EE 109 Unit 13 MIPS Instruction Set. Instruction Set Architecture (ISA) Components of an ISA INSTRUCTION SET OVERVIEW

CS61C : Machine Structures

MIPS R-format Instructions. Representing Instructions. Hexadecimal. R-format Example. MIPS I-format Example. MIPS I-format Instructions

Chapter 2. Computer Abstractions and Technology. Lesson 4: MIPS (cont )

CSCI 402: Computer Architectures. Instructions: Language of the Computer (3) Fengguang Song Department of Computer & Information Science IUPUI.

UC Berkeley CS61C : Machine Structures

ECE 15B Computer Organization Spring 2010

EE 109 Unit 8 MIPS Instruction Set

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Two 11 March Your Name (please print) total

Concocting an Instruction Set

Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21

Transcription:

Implementing an Instruction Set David E. Culler CS61CL Oct 28, 2009 Lecture 9 10/28/09 UCB CS61CL F09 Lec 9 1

Review: Synchronous Circuit Design Combinational Logic Blocks (CL) cyclic no internal state (no feedback) output only a function of inputs Registers (reg) collections of flip-flops clock distributed to all flip-flops LL CYCLES GO THROUGH REG! 10/14/09 CS61CL F09 2

MIPS: Register Transfers 10/14/09 CS61CL F09 3

MIPS: Register Transfers 10/28/09 UCB CS61CL F09 Lec 9 4

MIPS: Register Transfers 10/28/09 UCB CS61CL F09 Lec 9 5

Standard High-level Organization Controller accepts external and control input, generates control and external output and sequences the movement of data in the datapath. Datapath is responsible for data manipulation. Usually includes a limited amount of storage. Memory optional block used for long term storage of data structures. Standard model for CPUs, micro-controllers, many other digital sub-systems. Usually not nested. Often cascaded: 6

Datapath vs Control Datapath Controller signals Control Points Datapath: Storage, FU, interconnect sufficient to perform the desired functions Inputs are Control Points Outputs are signals Controller: State machine to orchestrate operation on the data path Based on desired function and signals 7

Register Transfer Level Descriptions standard high-level representation for describing systems. It follows from the fact that all synchronous digital system can be described as a set of state elements connected by combination logic (CL) blocks: RTL comprises a set of register transfers with optional operators as part of the transfer. Example: reg regb regc reg + regb if (start==1) reg regc Personal style: use ; to separate transfers that occur on separate cycles. Use, to separate transfers that occur on the same cycle. Example (2 cycles): reg regb, regb 0; regc reg; 8

The Methodology 1. Identify state and operations visible in the IS register transfer level operations of the IS 2. Select a set of storage elements, function units, and interconnections that realize all the architected state & operations plus internal state and operations 3. Map each instruction to register transfers on the data path 4. Identify the control points that cause the specified data transfers 5. Implement a controller that asserts those control points as a function of instruction, controller state, and signals from the data path 10/28/09 UCB CS61CL F09 Lec 9 9

r0 r1 r31 lo hi MIPS R3000 tiny subset 0 Programmable storage 2^32 x bytes 31 x 32-bit GPRs (R0=0) 32 x 32-bit FP regs (paired DP) HI, LO, rithmetic logical dd, ddu, Sub, SubU, nd, Or, Xor, Nor, SLT, SLTU, ddi, ddiu, SLTI, SLTIU, ndi, OrI, XorI, LUI SLL, SRL, SR, SLLV, SRLV, SRV Memory ccess LB, LBU, LH, LHU, LW, LWL,LWR SB, SH, SW, SWL, SWR Control J, JL, JR, JLR BEQ, BNE, BLEZ,BGTZ,BLTZ,BGEZ,BLTZL,BGEZL 10/28/09 cs61cl f09 lec 6 10

TinyMIPS Reg-Reg instructions (op == 0) addu R[rd] := R[rs] + R[rt]; pc:=pc+4 subu R[rd] := R[rs] - R[rt]; pc:=pc+4 Reg-Immed (op!= 0) lw R[rt] := Mem[ R[ rs ] + signex(im16) ] sw Mem[ R[ rs ] + signex(im16) ] := R[rt] Jumps j := 31..28 addr 00 jr := R[rs] Branches BEQ := (R[rs] == R[rt])? + signex(im16) : +4 BLTZ := (R[rs] < 0)? + signex(im16) : +4 10/28/09 UCB CS61CL F09 Lec 9 11

dministration Project 3 is out due Sun 11/15 Homework 7 is out due Wed 11/4 Midterm 2 is Monday 11/9 10/28/09 UCB CS61CL F09 Lec 9 12

Starting Point RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt ld_pc pc2 ld_ir wrt m2d ld_reg sx_sel comp s2 s2d 10/28/09 UCB CS61CL F09 Lec 9 13

Ifetch: IR := Mem[] RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt ld_pc pc2 ld_ir wrt m2d ld_reg sx_sel comp s2 s2d RM_addr <- <- ; (pc2) IR_in <- D <- RM_data; (m2d, ~wrt) IR := IR_in; (ld_ir) 10/28/09 UCB CS61CL F09 Lec 9 14

Exec: rithmetic RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt ld_pc pc2 ld_ir wrt m2d rs rt rd ld_reg sx_sel comp s2 s2d R[rd] := R[rs] + R[rt];(~sx_sel,~comp,s2D,ld_reg,~wrt) R[rd] := R[rs] R[rt];(~sx_sel, comp,s2d,ld_reg,~wrt) 10/28/09 UCB CS61CL F09 Lec 9 15

Exec: LW RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt ld_pc pc2 ld_ir wrt m2d rs rt rd rt_sel ld_reg sx_sel comp s2 s2d R[rt]:= Mem[R[rs]+SXim16]; sx_sel,~comp,s2,~pc2,~wrt,m2d,ld_reg rt_sel 10/28/09 UCB CS61CL F09 Lec 9 16

Exec: SW RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt ld_pc pc2 ld_ir wrt m2d rs rt rd rt_sel ld_reg sx_sel comp s2 s2d Mem[R[rs]+SXim16]:= R[rt]; 10/28/09 UCB CS61CL F09 Lec 9 17

Exec: SW RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd ld_pc pc2 ld_ir wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d Mem[R[rs]+SXim16]:= R[rt]; b2d, sx_sel, ~comp, s2, ~s2d, ~m2d, wrt, ~ld_reg, ~pc2 10/28/09 UCB CS61CL F09 Lec 9 18

Exec: := +4 RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd ld_pc pc2 ld_ir wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d ld_pc 10/28/09 UCB CS61CL F09 Lec 9 19

Exec: := +4 RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd ld_pc pc2 ld_ir wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d ld_pc 10/28/09 UCB CS61CL F09 Lec 9 20

Exec: Jump RM D +4 IR ~ B Ci sel Bsel Dsel ld xt rs rt rd npc_sel ld_pc pc2 ld_ir i2d wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d j := 31..28 addr 00 jr := R[rs] 10/28/09 UCB CS61CL F09 Lec 9 21

Exec: Branch RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd npc_sel ld_pc pc2 ld_ir i2d wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d BEQ := (R[rs] == R[rt])? + signex(im16) : +4 BLTZ := (R[rs] < 0)? + signex(im16) : +4 10/28/09 UCB CS61CL F09 Lec 9 22

Exec: Branch RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd npc_sel ld_pc pc2 ld_ir i2d wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d := (R[rs] == R[rt])? + signex(im16) : +4 n_sel = EQ? pcdd : Inc BLTZ := (R[rs] < 0)? + signex(im16) : +4 10/28/09 UCB CS61CL F09 Lec 9 23

DataPath + Control RM D +4 IR ~ B Ci + sel Bsel Dsel ld xt rs rt rd npc_sel ld_pc pc2 ld_ir i2d wrt m2d rt_sel ld_reg b2d sx_sel comp s2 s2d 10/28/09 UCB CS61CL F09 Lec 9 24

Levels of Design Representation CS 61C Pgm Language sm / Machine Lang Instruction Set rch Machine Organization HDL FlipFlops Gates Circuits EE 40 Devices Transistor Physics Transfer Function 25