CS250 Section 4. 9/21/10 Yunsup Lee. Image Courtesy: Tilera

Similar documents
Image Courtesy CS250 Section 3. Yunsup Lee 9/11/09

Verilog RTL for a Two-Stage SMIPSv2 Processor

CS250 Section 5. 9/30/10 Yunsup Lee

Write and Synthesize a Two-Stage SMIPSv2 Processor

Lecture 08: RISC-V Single-Cycle Implementa9on CSE 564 Computer Architecture Summer 2017

RTL Model of a Two-Stage MIPS Processor

Simulating Verilog RTL using Synopsys VCS

Lecture 4 - Pipelining

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

CS 152 Laboratory Exercise 1 (Directed Portion Only)

CS 152, Spring 2011 Section 2

CS 152 Laboratory Exercise 1

CPU Design for Computer Integrated Experiment

EC 513 Computer Architecture

CS3350B Computer Architecture Winter 2015

Welcome to CS250 VLSI Systems Design

Chapter 4. The Processor

CS Computer Architecture Spring Week 10: Chapter

CS 61C: Great Ideas in Computer Architecture. Lecture 13: Pipelining. Krste Asanović & Randy Katz

Lecture 7 Pipelining. Peng Liu.

Chapter 4. The Processor Designing the datapath

ece4750-tinyrv-isa.txt

Chapter 4. The Processor

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

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

Final Project: MIPS-like Microprocessor

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

CENG 3420 Lecture 06: Datapath

R-type Instructions. Experiment Introduction. 4.2 Instruction Set Architecture Types of Instructions

Processor (I) - datapath & control. Hwansoo Han

are Softw Instruction Set Architecture Microarchitecture are rdw

Review: MIPS Organization

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

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

Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University. See P&H Chapter:

CS 351 Exam 2 Mon. 11/2/2015

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

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

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

Full Name: NetID: Midterm Summer 2017

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

Tailoring the 32-Bit ALU to MIPS

CS222: Processor Design

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

CSE140: Components and Design Techniques for Digital Systems

Very Simple MIPS Implementation

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

Programmable Machines

CAD for VLSI 2 Pro ject - Superscalar Processor Implementation

Programmable Machines

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 27: Single- Cycle CPU Datapath Design

Chapter 4. The Processor

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

CPU Pipelining Issues

Concocting an Instruction Set

EE108B Lecture 3. MIPS Assembly Language II

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

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang

Improving Performance: Pipelining

Computer Architecture. The Language of the Machine

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

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

Non-Pipelined Processors

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

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

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

6.004 Tutorial Problems L22 Branch Prediction

Chapter 4. The Processor

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

Laboratory Exercise 6 Pipelined Processors 0.0

RISC-V Assembly and Binary Notation

UC Berkeley CS61C : Machine Structures

Concocting an Instruction Set

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

CS152 Computer Architecture and Engineering January 29, 2013 ISAs, Microprogramming and Pipelining Assigned January 29 Problem Set #1 Due February 14

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

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

CS61C : Machine Structures

Concocting an Instruction Set

MIPS Memory Access Instructions

Concocting an Instruction Set

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

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

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

COMPUTER ORGANIZATION AND DESIGN

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Computer Architecture Experiment

UC Berkeley CS61C : Machine Structures

6.823 Computer System Architecture Datapath for DLX Problem Set #2

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

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

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

Instructions: Language of the Computer

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

Ch 5: Designing a Single Cycle Datapath

Computer Organization MIPS ISA

Lecture 3 - From CISC to RISC

Transcription:

CS250 Section 4 9/21/10 Yunsup Lee Image Courtesy: Tilera

Any questions on lab 2 & lab 3? Doing okay with gate-level simulations?

Announcements I m still working to get physical libraries for lab 3 work probably a day or more RTL simulation is working, in the mean time you can get your circuit to work RISC-V Specification is taking a little bit more time We are still changing the ISA You should get lab 2 done during this week Lab 3 is also a lot of work

Lab 2: RISC-V Processor riscvtestharness testrig_tohost imemreq_bits_addr testrig_fromhost riscvproc imemreq_val imemresp_bits_data Instruction Memory clk dmemreq_rw dmemreq_bits_addr clk reset dmemreq_bits_data dmemreq_val dmemresp_bits_data Data Memory clk

Lab 3: RISC-V Core riscvcore riscvtestharness riscvproc testrig_fromhost imemreq_bits_addr imemreq_rdy testrig_tohost clk reset Instruction Cache Data Cache imemresp_bits_data dmemreq_rw dmemreq_bits_addr dmemreq_bits_data dmemresp_val dmemresp_bits_data log_control imemreq_val imemresp_val dmemreq_rdy dmemreq_val clk reset ic_mem_req_addr ic_mem_req_rdy mem_resp_data ic_mem_req_val ic_mem_resp_val dc_mem_req_rw dc_mem_req_addr mem_req_data dc_mem_resp_val mem_resp_data dc_mem_req_rdy dc_mem_req_val Arbiter mem_req_rw mem_req_addr mem_req_data dc_mem_resp_val mem_resp_data mem_req_rdy mem_req_val clk reset mem_req_tag mem_resp_tag clk reset_ext 32 32 32 128 128 128 128 128 clk reset

Lab 3: Note on the arbiter

Lab 3: Things you need to do Clean up your RISC-V v2 3-stage pipeline with a BTB Now change pipeline structure (add stall signals) to deal with the cache memory interface You can t always put a memory request (when [i d]memreq_rdy is deasserted) Memory response may take some time (when [i d]memresp_val is deasserted) Start with the Instruction cache first Run RISC-V v2 assembly test programs and benchmarks Globally installed programs ~cs250/install/{riscv-tests, riscv-bmarks} Local programs in your lab harness

Lab 3: Things you need to do Push your design all the way through the flow Count instruction mix for all assembly tests and benchmarks Measure energy consumption Generate analytic energy model A: instruction mix matrix x: energy/instruction b: energy consumption Ax = b holds. Use MATLAB regression to get a best guess to x Use your energy model and measure the error

Area Breakdown

ALU If you make your ALU using behavioral Verilog, this is what you get It s always good to start with behavioral Verilog to get things working, but after you get things working, you might optimize your ALU

ALU operations Here s the ALU operations you need to support ADD, SUB, SLT, SLTU, SLTI, SLTIU SL, SR, SRA AND, OR, XOR, NOR

ALU Operations: ADD/SUB ADDW xc,xa,xb xc = xa + xb SUBW xc,xa,xb xc = xa - xb Simple arithemetic for SUBW xc = xa + (~xb + 1) two inputs: xa and ~xb carry input: 1

ALU Operations: SLTU/SLTIU Did you notice the operands of SLTU and SLTIU are flipped? SLTU xc, xa, xb: xc = (xa < xb)? 32 d1 : 32 d0 SLTIU xa, xb, imm: xa = (xb < imm)? 32 d1 : 32 d0 You can t use the same adder, since the inputs are in a different place The natural alignment is imm - xb since we use xa - xb. We can now know whether imm - xb < 0, or imm - xb >= 0 imm < xb, imm >= xb. We re almost there. If we can do imm >= xb+1, we know imm > xb imm - (xb+1) = imm + (~xb) Add with no carry Think about the signed case

Suggested Datapath +4 Instruction Mem Reg File Sign Extend Decoder Data Mem ir[24:20] branch pc+4 pc_sel ir[11:0] ir[11:0] rd1 ALU Control Signals wb_sel Reg File rf_wen val rw PC tohost testrig_tohost tohost_en val addr wdata rdata nop killf IR Jump TargGen Branch TargGen Zero Extend ir[19:15] ir[26:0] ir[11:0] PC+4 jalr 0 rd0 Branch CondGen eq? lt? testrig_fromhost ir[24:20] ir[4:0] jump ir[4:0] ir[19:0] wa_sel Fetch Stage Execute Stage ltu? 31

ALU Operations: SL/SR/SRA Use one right signed shifter How would you do a shift left with a right shifter? Reverse bits! How would you do logical right shift? Control the MSB of your operand

Optimize ALU You can make an ALU with one adder, shifter, and a logic unit Let s form groups of three (First letter of your name s ASCII) % 4