Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.

Slides:



Advertisements
Similar presentations
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Advertisements

The Processor: Datapath & Control
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Shift Instructions (1/4)
Datapath and Control Andreas Klappenecker CPSC321 Computer Architecture.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Computer Organization CS224 Fall 2012 Lesson 26. Summary of Control Signals addsuborilwswbeqj RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp.
Chapter 4 CSF 2009 The processor: Building the datapath.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
ECE 445 – Computer Organization
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Datapath Design Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Composing the Elements First-cut data path does an instruction.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
EE204 Computer Architecture
Exam-like questions.
Electrical and Computer Engineering University of Cyprus
CS 230: Computer Organization and Assembly Language
Single-Cycle Datapath and Control
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Morgan Kaufmann Publishers
Introduction CPU performance factors
/ Computer Architecture and Design
ELEN 468 Advanced Logic Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
MIPS Processor.
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
MIPS processor continued
CSCI206 - Computer Organization & Programming
CSCE 212 Chapter 5 The Processor: Datapath and Control
Single-Cycle CPU DataPath.
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
Systems Architecture II
MIPS Processor.
Datapath & Control MIPS
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Composing the Elements
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Topic 5: Processor Architecture
Systems Architecture I
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Review Fig 4.15 page 320 / Fig page 322
October 29 Review for 2nd Exam Ask Questions! 4/26/2019
Morgan Kaufmann Publishers The Processor
MIPS processor continued
A single-cycle MIPS processor
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230

Nios II Instruction Set Is available for download at: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/nios2/n2cpu_nii51017.pdf

Instruction Format: R-Type MIPS Nios II Add R4, R3, R2 rs rt rd shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 Rsrc1 Rsrc2 Rdst OPX OP code 31:27 26:22 21:17 16:6 5:0

Instruction Format: I-Type MIPS Nios II addi R4, R3, 0x10, ldw R5, 4(R4), beq R0, R1, label opcode rs rt address 31:26 25:21 20:16 15:0 Rsrc Rdst OP code Immediate Operand 31:27 26:22 21:6 5:0

Instruction Format: J- or call-Type MIPS Nios II j label, call label Jump 0x02 address 31:26 25:0 Call address 0x00 31:6 5:0

Example Instruction jmp R3 r-type i-type j-type Encoding: 00011 00000 00000 00 1101 00000 111010 OPX

Datapath Illustrations Assume MIPS instruction set R-type rs rt rd shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 opcode rs rt address 31:26 25:21 20:16 15:0 I-type J-type 0x02 address 31:26 25:0

Simple RISC Datapath

Instruction Execution: General Considerations Morgan Kaufmann Publishers 11 September, 2018 Instruction Execution: General Considerations Classical von-Neumann architecture: Each instruction read from the memory, decoded, and executed according to its meaning. The program counter “remembers” current point in program execution. Additional access(es) to the memory may be necessary during the execution because of instructions like ldw and stw. Datapath components must be selected to accommodate different types of instructions Datapath complexity also depends on whether every instruction must complete in one clock cycle or more – very little flexibility in sharing components when all work must be done in one clock cycle. Chapter 4 — The Processor

Five Stages of Instruction Execution Classical – goes back to von-Neumann machines: Fetch instruction from memory (all) Decode it (all) Read registers (all but call or j) Execute (most use ALU but in different ways) Write back to register file or memory

Single-cycle Design All five stages executed in one clock cycle. Implications: All instructions take the same amount of time Clock cycle time set according to the worst-case instruction execution time Sequential dependencies implemented by chaining combinational logic Dedicated functional units – no reuse possible

Single-Cycle Design: Constraint and Initial Architectural Choices Constraint: Need separate memories for instructions and data. (Harvard architecture) Why? Choice: No caches (to simplify design). Choice: Register File has two output ports (speed up reading two operand registers) and one input port (don’t need to write two registers in one instruction) Choice: A programmable ALU, instead of separate functional units (simplifies design)

Morgan Kaufmann Publishers 11 September, 2018 Full Datapath Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 ALU Control ALU used for Load/Store: F = add Branch: F = subtract R-type: F depends on funct field ALU control (Ainv, Bneg, Op1, Op0) §4.4 A Simple Implementation Scheme 4 A 32 ALU 32 F ALU control Function 0000 AND 0001 OR 0010 add 0110 subtract 0111 set-on-less-than 1100 NOR B 32 CarryOut Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 The Main Control Unit Control signals derived from instruction R-type rs rt rd shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 write for R-type and I-type Load/ Store/ i-type opcode rs rt address 31:26 25:21 20:16 15:0 sign-extend and add 4 rs rt address 31:26 25:21 20:16 15:0 Branch opcode always read Read for R-Type, write for I-type Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 The Main Control Unit Control signals derived from instruction R-type Rsrc1 Rsrc2 Rdst OP code 31:27 26:22 write for R-type and load 21:17 16:0 I-type Load Store Branch Rsrc Rdst Immediate Operand OP code 31:27 26:22 21:6 sign-extended immediate 5:0 always read opcode Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Implementing Jumps Jump (MIPS) 2 address 31:26 25:0 Call address OP code 31:6 5:0 Jump uses word address Update PC with concatenation of Top 4 bits of old PC 26-bit jump address Shift left by two bits Need an extra control signal decoded from opcode Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Datapath With Control Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Datapath With Control Fetch Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Datapath With Control Decode/Read Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Datapath With Control Execute Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Datapath With Control Write-back Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 R-Type Instruction Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Load Instruction Chapter 4 — The Processor

Branch-on-Equal Instruction Morgan Kaufmann Publishers 11 September, 2018 Branch-on-Equal Instruction Chapter 4 — The Processor

Datapath With Jumps Added Morgan Kaufmann Publishers 11 September, 2018 Datapath With Jumps Added Fig. 4.24 Chapter 4 — The Processor

Morgan Kaufmann Publishers 11 September, 2018 Performance Issues Longest delay determines clock period Critical path: load instruction Instruction memory  register file  ALU  data memory  register file Not feasible to vary period for different instructions Violates design principle Making the common case fast (Amdahl’s Law) We will improve performance by pipelining Chapter 4 — The Processor

R-Type: add $1, $2, $3

I-Type: addi $1, $2, 0x10

I-Type: beq $1, $2, 0x20

I-Type: lw $1, 4($2)