PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt op +4 shift 2 zero BRANCH CTRL muxmux sign extend immed 1632 ADDADD.

Slides:



Advertisements
Similar presentations
Lecture 5: MIPS Instruction Set
Advertisements

Adding the Jump Instruction
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Multicycle Datapath & Control Andreas Klappenecker CPSC321 Computer Architecture.
ELEN 468 Advanced Logic Design
©UCB CS 161Computer Architecture Chapter 5 Lecture 9 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
The Processor: Datapath & Control
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
©UCB CS 162 Computer Architecture Lecture 3: Pipelining Contd. Instructor: L.N. Bhuyan
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
EECC550 - Shaaban #1 Selected Chapter 5 For More Practice Exercises Winter The MIPS jump and link instruction, jal is used to support procedure.
1  1998 Morgan Kaufmann Publishers CH5 Datapath review.
CMPE 421 Advanced Computer Architecture Supplementary material for Pipelining PART1.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring)
Sample Code (Simple) Run the following code on a pipelined datapath: add1 2 3 ; reg 3 = reg 1 + reg 2 nand ; reg 6 = reg 4 & reg 5 lw ; reg.
Electrical and Computer Engineering University of Cyprus LAB 2: MIPS.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
Design a MIPS Processor
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Multicycle datapath.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 9: MIPS Lite 4 th edition: Chapter.
Design a MIPS Processor (II)
Single-cycle CPU Control
Single Cycle CPU - Control
Electrical and Computer Engineering University of Cyprus
CS 230: Computer Organization and Assembly Language
Exceptions Another form of control hazard Could be caused by…
ELEN 468 Advanced Logic Design
Extensions to the Multicycle CPU
Five Execution Steps Instruction Fetch
Single Cycle Processor
D.4 Finite State Diagram for the Multi-cycle processor
Basic MIPS Architecture
Design of the Control Unit for Single-Cycle Instruction Execution
ADITI SHINDE CHIDAMBARAM ALAGAPPAN
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CSCE 212 Chapter 5 The Processor: Datapath and Control
Tutorial #10 MIPS commands
Single-Cycle CPU DataPath.
Design of the Control Unit for One-cycle Instruction Execution
Multicycle Approach Break up the instructions into steps
Computer Architecture
Datapath & Control MIPS
The Processor Lecture 3.2: Building a Datapath with Control
Multicycle Approach We will be reusing functional units
MIPS Microarchitecture Multicycle Processor
Basic Building Blocks Multiplexer Demultiplexer Adder +
Access the Instruction from Memory
Review Fig 4.15 page 320 / Fig page 322
Basic Building Blocks Multiplexer Demultiplexer Adder +
The Processor: Datapath & Control.
COMS 361 Computer Organization
Processor: Datapath and Control
ELEC / Computer Architecture and Design Spring 2015 Pipeline Control and Performance (Chapter 6) Vishwani D. Agrawal James J. Danaher.
Presentation transcript:

PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt op +4 shift 2 zero BRANCH CTRL muxmux sign extend immed 1632 ADDADD ADDADD Single Cycle Datapath muxmux muxmux addr w data r data rd

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt Multicycle Datapath A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr fetch decode execute (1..3)

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data CONTROL rs rt rd fctnopshamt Multicycle with Exception/Interrupt Handling A B w data immedsign extend shift 2 +4 IRIR MRMR zero alu out shift 2jump addr EPCEPC CAUSECAUSE PC - 4 handler addr to? overflow to?

Pipelined Datapath PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux IFIDEXMEMWB

add rd, rt, rs: Fetch PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Instruction Fetch: Load IR, PC = PC + 4 IF Register Contains IR and PC, and other values

add rd, rt, rs: Decode PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Instruction Decode: Load data1, data2 into A, B (part of ID) ID register contains A, B, and other values

add rd, rt, rs: Execute PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Execute: sum of A, B into ALUout (part of EX)

add rd, rt, rs: MEM PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux MEM: (no memory access) save ALU result in MEM

add rd, rt, rs: WB PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Write Back: write sum to register rd

sw rt, offset(rs): Fetch PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux

sw rt, offset(rs): Decode PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux ID gets rs, rt, and immed+sign ext

sw rt, offset(rs): Execute PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux EX gets rs+offset, and rt

sw rt, offset(rs): MEM PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Write Data Memory [address] with rt value; nothing of interest in WD

sw rt, offset(rs): WB PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Registers not written in this instruction

A program fragment with 6 instructions 1. add r1, r2, r3 2. sw r4, 2232 ( r5 ) 3. addi r6, lw r7, 1001 (r8) 5. bneq r7, r6, add r1, r7, r0

A program fragment with 6 instructions 1. add r1, r2, r3 2. sw r4, 2232 ( r5 ) 3. addi r6, lw r7, 1001 (r8) 5. slti r7, r6, add r1, r7, r0

Six instructions 1,2,3,4,5,6: Step 1 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 1

Six instructions 1,2,3,4,5,6: Step 2 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 2Decode 1

Six instructions 1,2,3,4,5,6: Step 3 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 3 Decode 2 Execute 1

Six instructions 1,2,3,4,5,6: Step 4 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 4 Decode 3Execute 2Mem 1

Six instructions 1,2,3,4,5,6: Step 5 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 5Decode 4Execute 3 WB 1 (add) Mem 2 (sw)

Six instructions 1,2,3,4,5,6: Step 6 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Fetch 6 Decode 5 Execute 4Mem 3 (addi) WB 2 (sw: no write)

Six instructions 1,2,3,4,5,6: Step 7 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Decode 6 Execute 5 Mem 4 (lw) WB 3 (addi)

Six instructions 1,2,3,4,5,6: Step 8 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Execute 6 Mem 5 (slti) WB 4 (lw)

Six instructions 1,2,3,4,5,6: Step 9 PCPC Instruction Memory addr out Registers read1 read2 write w data data1 data2 sign extend add +4 shift add ALUALU Data Memory addr w data r data muxmux muxmux muxmux Mem 6 (add) WB 5 (slti)

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt add rd, rs, rt fetch: load ir, pc=pc+4 decode execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt Multicycle Datapath A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr fetch decode execute

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt add rd, rs, rt fetch decode:load A,B registers execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt add rd, rs, rt fetch decode execute (2 cycles) load alu out; load register A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt bne rs, rt, addr fetch: load IR, pc=pc+4 decode execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt bne rs, rt, addr fetch decode: load A B, aluout = immediate (extendx2)+pc execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt bne rs, rt, addr fetch: decode: execute: (1 cycle) compare A, B (holding rs, rt); if neq, load pc with aluout (holding branch addr) A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt lw rt, offset ( rs) fetch: load IR, pc=pc+4 decode execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt lw rt, offset ( rs) fetch decode: load A B; offset is ready execute A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt lw rt, offset ( rs) fetch decode execute: (3 cycles): load aluout with addr, load mr with data, load register rt A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt Multicycle Datapath A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr Try these: sw rt, off(rs) j addr andi rd,rs,rt

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt Multicycle Datapath A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out

PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt rd fctn op shamt R-Format: add, slt, sll

PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt op +4 shift 2 zero BRANCH CTRL muxmux sign extend immed 1632 ADDADD ADDADD I-Format bne

PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt op zero sign extend immed 1632 I-Format lw, sw addr W Data muxmux R Data

PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL op +4 shift 2 zero BRANCH CTRL muxmux ADDADD ADDADD J-Format address

PCPC addr REGISTERS MEMORY R1 R2 WR W Data R Data 1 R Data 2 ALU data ALU CTRL rs rt rd fctnopshamt Multicycle Datapath A B w data immedsign extend shift 2 +4 IRIR MRMR z alu out shift 2jump addr fetch decode execute