Register Transfer Level (RTL) Design

Similar documents
CSE140: Components and Design Techniques for Digital Systems

Processor (I) - datapath & control. Hwansoo Han

CPE 335 Computer Organization. Basic MIPS Architecture Part I

Chapter 4. The Processor

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

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

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

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

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

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

The MIPS Processor Datapath

CENG 3420 Lecture 06: Datapath

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

Unsigned Binary Integers

Unsigned Binary Integers

Chapter 4. The Processor

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

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

CS61C : Machine Structures

Systems Architecture

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

COMP303 Computer Architecture Lecture 9. Single Cycle Control

The Processor: Datapath & Control

Inf2C - Computer Systems Lecture Processor Design Single Cycle

ECE232: Hardware Organization and Design

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

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

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

Chapter 4. The Processor Designing the datapath

Data paths for MIPS instructions

Introduction. Datapath Basics

CS Computer Architecture Spring Week 10: Chapter

Laboratory 5 Processor Datapath

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

Computer Science 141 Computing Hardware

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

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

LECTURE 5. Single-Cycle Datapath and Control

Ch 5: Designing a Single Cycle Datapath

CPE 335. Basic MIPS Architecture Part II

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

Systems Architecture I

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.

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

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

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

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

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

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

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

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

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

Processor: Multi- Cycle Datapath & Control

ECE260: Fundamentals of Computer Engineering

Merging datapaths: (add,lw, sw)

Review: Abstract Implementation View

CC 311- Computer Architecture. The Processor - Control

The Processor: Datapath & Control

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

Fundamentals of Computer Systems

Review. Steps to writing (stateless) circuits: Create a logic function (one per output)

Learning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW

ECE260: Fundamentals of Computer Engineering

CS61C : Machine Structures

ECE260: Fundamentals of Computer Engineering

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

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

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

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

CSEN 601: Computer System Architecture Summer 2014

CS 351 Exam 2 Mon. 11/2/2015

The overall datapath for RT, lw,sw beq instrucution

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

RISC Design: Multi-Cycle Implementation

Chapter 5 Solutions: For More Practice

LECTURE 6. Multi-Cycle Datapath and Control

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

RISC Processor Design

Improving Performance: Pipelining

CSE 378 Midterm 2/12/10 Sample Solution

Computer Hardware Engineering

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

CS222: Processor Design

The Single Cycle Processor

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

CS31001 COMPUTER ORGANIZATION AND ARCHITECTURE. Debdeep Mukhopadhyay, CSE, IIT Kharagpur. Instructions and Addressing

ECE232: Hardware Organization and Design

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

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

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1

Chapter 5: The Processor: Datapath and Control

Lecture 10: Simple Data Path

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2)

Lets Build a Processor

Multicycle Approach. Designing MIPS Processor

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Transcription:

CSE4: Components and Design Techniques for Digital Systems Register Transfer Level (RTL) Design Instructor: Mohsen Imani Slides from Tajana Simunic Rosing

CAPE CAPEs are out!!! https://cape.ucsd.edu/students/ Please submit your evaluations!!!! Your feedback is very important, please take the time to fill out the survey.

3D Xpoint Memory

About the final ~5 minutes Final Exam Bring one 8 ½ x paper with handwritten notes, but nothing else Problems including (but not limited to): - design - components (shifters, adders, etc.) - FSM - Moore, Mealy, design of FSM using state table, excitation table - Timing constraints - RTL design and HLSM

: Arithmetic Logic Unit

Designing an Arithmetic Logic Unit op A 3 N Zero N Result Overflow B N CarryOut Control Lines (op) Function And Or Add Subtract Set-on-less-than 6

A One Bit This -bit performs AND, OR, and ADD + -4-2 -6 7

A 32-bit -bit 32-bit 8

Subtract We d like to implement a means of doing A-B (subtract) but with only minor changes to our hardware. How?. Provide an option to use bitwise NOT A 2. Provide an option to use bitwise NOT B 3. Provide an option to use bitwise A XOR B 4. Provide an option to use instead of the first CarryIn 5. Provide an option to use instead of the first CarryIn Selection Choices A alone B Both and 2 C Both 3 and 4 D Both 2 and 5 E None of the above 9

Full 32-bit what signals accomplish ADD? Binvert CIn Oper A 2 B 2 C 2 D 2 E NONE OF THE ABOVE sign bit (adder output from bit 3)

Full 32-bit what signals accomplish OR? Binvert CIn Oper A B C D E NONE OF THE ABOVE sign bit (adder output from bit 3)

Full 32-bit Little more intense can you get this? what signals accomplish SUB? Binvert CIn Oper A 2 B 2 C 2 D 2 E NONE OF THE ABOVE sign bit (adder output from bit 3) 2

Arithmetic Logic Unit Example 2 A A B N N B N N N N F2 Y N Cout + [N-] S Zero Extend N N N N 2 3 2 3F F2: Function A&B A B A+B Not used A & ~B A ~B A-B Not used F: N Y

Problem x y z OP A+B A-B A+A A<B A*4 A/4 Reverse (A) 2-complement (B) Design an with two 8bit inputs A and B that has three control bits xyz and implements the operations described in the table

Problem x y z OP A+B A-B A+A A<B A*4 A/4 Reverse (A) 2-complement (B)

Problem x y z OP A+B A-B A+A A<B A*4 A/4 Reverse (A) 2-complement (B)

Problem x y z OP A+B A-B A+A A<B A*4 A/4 Reverse (A) 2-complement (B)

Design of a new FF (waveforms) Q(t) x Q(t+)

Design of a new FF Q(t+) = Q(t) x + Q(t)x Q(t) x Q(t+)

Problem: FSM from circuit to state diagram

Problem: FSM from circuit to state diagram D = y= Q a D y Qo \ a

Problem: FSM from circuit to state diagram D = Q *a y = Qo + a Q a D y Qo \ a,,,,

Problem: FSM from word description to state diagram A microwave oven has 3 modes of operation when it is on: High temperature (H), Low temperature (L) and Defrost (D). A -bit input signal X is controlled by a button. Whenever the button is pressed, X changes its value. When the oven is off, X = will make it switch on to D mode. After that, every time X changes its value, the oven goes to L, then H the off again. a. Is it a Moore or a Mealy machine? b. How many states does it have? How many bits are required to represent them? c. Draw the state diagram

Solution

Solution

Solution

Problem: FSM from state diagram to circuit QQ D A D Y QQ\A,,,,,,,,

Solution QQ D A D Y QQ\A,,,,,,,,

Solution D = Q Q \ QA D = QQ + QA + Q A Q \ QA Y = Q Q + QQA Q \ QA QQ D A D Y

Solution

Circuit timing recap Gate: - minimum (contamination) delay : t_cd - maximum (propagation) delay : t_pd D-FF: - Input: - Setup : t_setup - Hold : t_hold - Output: - Minimum (contamination) delay : t_ccq - Maximum (propagation) delay : t_pcq

Time constraints Setup time constraints: T_c t_pcq + t_pd + t_setup Hold time constraints: t_hold < t_ccq + t_cd

Time constraints with skew Setup time constraints: T_c t_pcq + t_pd + t_setup + t_skew t_pd T_c (t_pcq + t_setup + t_skew) Hold time constraints: t_ccq + t_cd > t_hold + t_skew t_cd > t_hold + t_skew t_ccq

Timing constraints example D-FF: - t_ccq = 4 - t_pcq = 6 - t_setup = 7 - t_hold = 8 Gates: AND: - t_pd = 4 - t_cd = 3 OR: - t_pd = 4 - t_cd = 3 NOT: - t_pd = 3 - t_cd = 2

Timing constraints example D-FF: - t_ccq = 4 - t_pcq = 6 - t_setup = 7 - t_hold = 8 Gates: AND: - t_pd = 4 - t_cd = 3 OR: - t_pd = 4 - t_cd = 3 NOT: - t_pd = 3 - t_cd = 2

Timing constraints example Setup time constraints: T_c t_pcq + t_pd + t_setup T_c (6) + (3*4 + 3) + 7 T_c 28ps Hold time constraints: t_hold < t_ccq + t_cd 8 < 4 + 3 ----> NO!! ----> add buffer!

Timing constraints example Setup time constraints with skew: What is the maximum t_skew that can be tolerated before having a setup timing error with a frequency of 3 GHz? T_c = / f = / 3e9 = 333ps T_c t_pcq + t_pd + t_setup + t_skew 333 - (6) - (3*4 + 3) - 7 t_skew 53ps t_skew

CPU Control and Datapath Execute Instruction Set Processor Control Datapath PC R E G I S T E R S DEVICES IN Main Memory OUT Control takes program as input; it interprets each instruction and tells the Datapath to operate on data via, memory and registers 38

PC+4 [3-28] JMP ADDRESS [3-] 4 ADDER ADDER I[25-] PC << 2 JMP ADDRESS [25-] << 2 BRANCH REG_DST INSTRUCTION[3-26] REG_ ADDRESS INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER JUMP MEM_TO_REG CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Sign Extend INSTRUCTION[5-] CONTROL 39

CPU Components Single Cycle Execution Assumptions: Every machine language instruction happens in Clock Cycle MIPS architecture Microprocessor without interlocked pipeline stages reg-reg architecture: all operands must be in registers (total 24) 3 Instruction Types; each instruction 32 bits long. R-type: all data in registers (most arithmetic and logical) e.g. add $s, $s2, $s3 2. I-type: branches, memory transfers, constants e.g. beq $s, $s2, Label; lw $s, 32($s2) 3. J-type: jumps and calls e.g. j Label; add $s, $s, $s2 7 8 6 32 4

R-type Instruction: reg-reg ops (e.g. add, and) Tells specific variant of operation (e.g. add/sub have same opcode) Tells operation to be performed R-type Instruction OPCODE = 3-26 RS 25-2 RT RD shamt FUNCT = 32 or 34 2-6 5- -6 5- ADD $S, $S2, $S3 ADD RD, RS, RT Source Register (attached to Read Register input) Shift amount (for sll, srl etc.) Source Register 2 (attached to Read Register 2 input) Destination Register (attached to Write Register input) 4

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step (R-type): Fetch instruction and advance PC Sign Extend INSTRUCTION[5-] CONTROL 42

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] REGISTER MEM_,MEM OP ZERO REGISTERS _SRC MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY Sign Extend INSTRUCTION[5-] INSTRUCTION[5-] Step 2 (R-type): Read two registers and set control signals CONTROL 43

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 3 (R-type): Perform the operation Sign Extend INSTRUCTION[5-] CONTROL 44

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 4 (R-type): Write result to register Sign Extend INSTRUCTION[5-] CONTROL 45

I-Type: Store Instruction Tells operation to be performed Store Instruction OPCODE = 35 or 43 3-26 Base Address Register (attached to Read Register input) SW $S, 32($S2) SW RT, #(RS) RS 25-2 RT OFFSET 2-6 5- Source register whose value will be stored to memory (attached to Read Register 2 input) Constant offset (added to the base address in RS) Note: same as x86 MOV [ebx+32], eax

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step (store): Fetch instruction and advance PC Sign Extend INSTRUCTION[5-] CONTROL 47

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 2 (store): Read register values and set control signals Sign Extend INSTRUCTION[5-] CONTROL 48

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 3 (store): Compute the address Sign Extend INSTRUCTION[5-] CONTROL 49

4 ADDER ADDER << 2 REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 PC INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 4 (store): Write the value to memory Sign Extend INSTRUCTION[5-] CONTROL 5

I-Type: Conditional Branch BEQ/BNE Instruction OPCODE = 4 or 5 RS RT 3-26 25-2 2-6 BRANCH TARGET S OFFSET Source Register Source register 2 (attached to Read (attached to Read Register input) Register 2 input) BEQ Source, Source2, Offset BEQ $S, $S2, = AL 4 7 8 25 = ML (in binary) 5- Word Offset, which we multiply by 4 (via <<2) to get Bit Offset, then add to PC+4 to get the address of the instruction to which we branch if RS = RT) PC-relative address 5

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] REGISTER MEM_,MEM OP ZERO REGISTERS _SRC MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY Sign Extend INSTRUCTION[5-] INSTRUCTION[5-] Step (beq): Fetch instruction and advance PC CONTROL 52

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Step 2 (beq): Read register values and set control signals Sign Extend INSTRUCTION[5-] CONTROL 53

4 ADDER ADDER << 2 PC REG_DST INSTRUCTION[3-26] INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER MEM_TO_REG REG_ ADDRESS BRANCH CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Sign Extend INSTRUCTION[5-] Step 3 (beq): Compare registers, calculate branch target, and choose new PC CONTROL 54

J-Type: Unconditional Branch JMP/JAL Instruction OPCODE = 2 or 3 3-26 BRANCH TARGET ADDRESS 25- J Offset Actual Address (in words) which we multiply by 4 (<<2) to get 28-Bit Address, J = AL then concatenate to upper 4 bits of PC+4 2 25 = ML (in binary) to get the 32-bit addresss of instruction to which we branch unconditionally 55

PC+4 [3-28] JMP ADDRESS [3-] 4 ADDER ADDER I[25-] PC << 2 JMP ADDRESS [25-] << 2 BRANCH REG_DST INSTRUCTION[3-26] REG_ ADDRESS INSTRUCTION[25-2] REGISTER INSTRUCTION[2-6] REGISTER 2 INSTRUCTION MEMORY INSTRUCTION [3-] INST[5-] _SRC MEM_,MEM OP ZERO REGISTERS REGISTER JUMP MEM_TO_REG CON TROL 2 ADDRESS MEMORY INSTRUCTION[5-] Single-Cycle Datapath with Support for the Jump Instruction Sign Extend INSTRUCTION[5-] CONTROL 56