Download presentation
Presentation is loading. Please wait.
1
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
2
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)
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 00 01 10 11 to? overflow to?
4
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
5
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
6
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
7
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)
8
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
9
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
10
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
11
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
12
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
13
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
14
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
15
A program fragment with 6 instructions 1. add r1, r2, r3 2. sw r4, 2232 ( r5 ) 3. addi r6, 55 4. lw r7, 1001 (r8) 5. bneq r7, r6, -3 6. add r1, r7, r0
16
A program fragment with 6 instructions 1. add r1, r2, r3 2. sw r4, 2232 ( r5 ) 3. addi r6, 55 4. lw r7, 1001 (r8) 5. slti r7, r6, -3 6. add r1, r7, r0
17
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
18
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
19
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
20
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
21
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)
22
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)
23
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)
24
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)
25
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)
26
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
27
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
28
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
29
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
30
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
31
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
32
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
33
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
34
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
35
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
36
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
37
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
38
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
39
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
40
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
41
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
42
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.