Computer Architecture Experiment

Similar documents
Project Part A: Single Cycle Processor

Mips Code Examples Peter Rounce

F. Appendix 6 MIPS Instruction Reference

MIPS%Assembly% E155%

MIPS Instruction Reference

MIPS Reference Guide

RTL Model of a Two-Stage MIPS Processor

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

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

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

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

Reduced Instruction Set Computer (RISC)

Week 10: Assembly Programming

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

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

The MIPS Instruction Set Architecture

Reduced Instruction Set Computer (RISC)

CPU Design for Computer Integrated Experiment

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

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

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


MIPS Instruction Format

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

Computer Architecture. MIPS Instruction Set Architecture

CS3350B Computer Architecture Quiz 3 March 15, 2018

Computer Architecture. The Language of the Machine

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

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

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

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

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 19 September 2012

Exam in Computer Engineering

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

MIPS Instruction Set

TSK3000A - Generic Instructions

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

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

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

Concocting an Instruction Set

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Three 10 April 2013

EE108B Lecture 3. MIPS Assembly Language II

Laboratory Exercise 6 Pipelined Processors 0.0

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

Computer Architecture Instruction Set Architecture part 2. Mehran Rezaei

Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

5/17/2012. Recap from Last Time. CSE 2021: Computer Organization. The RISC Philosophy. Levels of Programming. Stored Program Computers

Recap from Last Time. CSE 2021: Computer Organization. Levels of Programming. The RISC Philosophy 5/19/2011

Concocting an Instruction Set

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 23 October Your Name (please print clearly) Signed.

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

INSTRUCTION SET COMPARISONS

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

Concocting an Instruction Set

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

Concocting an Instruction Set

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

SPIM Instruction Set

CS 61c: Great Ideas in Computer Architecture

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 21 October 2016

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

ECE260: Fundamentals of Computer Engineering

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

CENG 3420 Lecture 06: Datapath

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

ECE 2035 A Programming Hw/Sw Systems Fall problems, 8 pages Final Exam 8 December 2014

Final Project: MIPS-like Microprocessor

ECE260: Fundamentals of Computer Engineering

CS 351 Exam 2 Mon. 11/2/2015

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

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

Arithmetic for Computers

Assembly Programming

CS 4200/5200 Computer Architecture I

ECE 2035 A Programming Hw/Sw Systems Spring problems, 8 pages Final Exam 29 April 2015

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

Programming the processor

Computer Architecture Experiment

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

Alexandria University

CPS311 - COMPUTER ORGANIZATION. A bit of history

ECE 2035 A Programming Hw/Sw Systems Fall problems, 8 pages Final Exam 9 December 2015

IMPLEMENTATION MICROPROCCESSOR MIPS IN VHDL LAZARIDIS DIMITRIS.

CSc 256 Midterm 2 Fall 2011

CS654 Advanced Computer Architecture. Lec 1 - Introduction

Examples of branch instructions

ece4750-parc-isa.txt

CS Computer Architecture Spring Week 10: Chapter

Instruction Set Principles. (Appendix B)

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich. Sep 2006

Flow of Control -- Conditional branch instructions

Midterm. CS64 Spring Midterm Exam

Computer Organization & Design

MIPS Assembly Language. Today s Lecture

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

CS61CL Machine Structures. Lec 5 Instruction Set Architecture

CSc 256 Midterm 2 Spring 2012

MACHINE LANGUAGE. To work with the machine, we need a translator.

MIPS Integer ALU Requirements

Patrick Murray 4/17/2012 EEL4713 Assignment 5

Transcription:

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

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 Architecture Lab_jxh 2 2

Outline Experiment Purpose Experiment Task Basic Principle Operating Procedures Precaution Architecture Lab_jxh 3 3

Experiment Purpose 1 Understand 31 MIPS instructions. Extend your design to support all the 31 MIPS instructions in pipelined CPU. Architecture Lab_jxh 4 4

Experiment Purpose 2 Understand why and when Control Hazards arise Master the methods of resolving Control Hazards Freeze or flush Predict-not-taken Predict-taken Delayed-branch Implement the predict-not-taken scheme in your final pipelined CPU. Write the verification program yourself to test whether it can execute right in both taken and not-taken cases and to test all the 31 instructions. Architecture Lab_jxh 5 5

Architecture Lab_jxh 6 Pipelined CPU supporting execution of 31 MIPS instructions MIPS Instructions Bit # 31..26 25..21 20..16 15..11 10..6 5..0 Operations R-type op rs rt rd sa func add rs rt rd 00000 100000 rd = rs + rt; with overflow PC+=4 addu rs rt rd 00000 100001 rd = rs + rt; without overflow PC+=4 sub rs rt rd 00000 100010 rd = rs - rt; with overflow PC+=4 subu rs rt rd 00000 100011 rd = rs - rt; without overflow PC+=4 and rs rt rd 00000 100100 rd = rs & rt; PC+=4 or rs rt rd 00000 100101 rd = rs rt; PC+=4 xor rs rt rd 00000 100110 rd = rs ^ rt; PC+=4 nor rs rt rd 00000 100111 rd = ~(rs rt); PC+=4 slt 000000 rs rt rd 00000 101010 if(rs < rt)rd = 1; else rd = 0; <(signed) PC+=4 sltu rs rt rd 00000 101011 if(rs < rt)rd = 1; else rd = 0; <(unsigned) PC+=4 sll 00000 rt rd sa 000000 rd = rt << sa; PC+=4 srl 00000 rt rd sa 000010 rd = rt >> sa (logical); PC+=4 sra 00000 rt rd sa 000011 rd = rt >> sa (arithmetic); PC+=4 sllv rs rt rd 00000 000100 rd = rt << rs; PC+=4 srlv rs rt rd 00000 000110 rd = rt >> rs (logical); PC+=4 srav rs rt rd 00000 000111 rd = rt >> rs(arithmetic); PC+=4 jr rs 00000 00000 00000 001000 PC=rs

Pipelined CPU supporting execution of 31 MIPS instructions MIPS Instructions Bit # 31..26 25..21 20..16 15..11 10..6 5..0 Operations I-type op rs rt immediate addi 001000 rs rt imm rt = rs + (sign_extend)imm; with overflow PC+=4 addiu 001001 rs rt imm rt = rs + (sign_extend)imm;without overflow PC+=4 andi 001100 rs rt imm rt = rs & (zero_extend)imm; PC+=4 ori 001101 rs rt imm rt = rs (zero_extend)imm; PC+=4 xori 001110 rs rt imm rt = rs ^ (zero_extend)imm; PC+=4 lui 001111 00000 rt imm rt = imm << 16; PC+=4 lw 100011 rs rt imm rt = memory[rs + (sign_extend)imm]; PC+=4 sw 101011 rs rt imm memory[rs + (sign_extend)imm] <-- rt; PC+=4 beq 000100 rs rt imm if (rs == rt) PC+=4 + (sign_extend)imm <<2; PC+=4 bne 000101 rs rt imm if (rs!= rt) PC+=4 + (sign_extend)imm <<2; PC+=4 slti 001010 rs rt imm sltiu 001011 rs rt imm Architecture Lab_jxh 7 if (rs < (sign_extend)imm) rt =1 else rt = 0; less than signed if (rs < (zero_extend)imm) rt =1 else rt = 0; less than unsigned J-type op address j 000010 address PC = (PC+4)[31..28],address<<2 jal 000011 address PC = (PC+4)[31..28],address<<2 ; $31 = PC+4 PC+=4 PC+=4

Architecture Lab_jxh 8

Careful with JAL and LUI Need add data path for JAL and LUI JAL: How many stall? When write R31? What write to R31? Architecture Lab_jxh 9 9

Observation Info Input West Button: Step execute South Button: Reset North Button + 4 Slide Button: Register Index East Button: High 16-bit of Reg. Content Sel. 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 (high bits is ignored) Architecture Lab_jxh 1010

Precautions 1 According to datapath to modify the modules of top module, then modify the definitions of the modules, then modify the CPU Controller. 2 The signals which transfer from former stage to later stage should be stored to stage registers temporally. 3 Design the program for verification by yourself, includes: Stall Forwarding All kinds of instructions Architecture Lab_jxh 1111

Signed and unsigned type Reg and wire are unsigned type Signed type: reg signed wire signed Type conversion $signed() $unsiged() Architecture Lab_jxh 1212

Submission Lab report 5 named as StID_name_Lab5.doc ( or pdf) All your verilog code, coe file, testing file, etc., in your project directory compacted as StID_name_prj.rar (from Lab 6) Architecture Lab_jxh 1313

Thanks! Architecture Lab_jxh 1414