cs3330-chap4-wrapup

cs3330-chap4-wrapup - CS/ECE 3330 Computer Architecture...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CS/ECE 3330 Computer Architecture Chapter 4 The Processor (Wrap-Up) Datapath With Control CS/ECE 3330 – Fall 2009 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 ± Control signals derived from instruction The Main Control Unit 0 rs r rd sham func R type rt shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 35 or 43 rs rt address 31:26 25:21 20:16 15:0 4 rs rt address R-type Load/ Store Branch CS/ECE 3330 – Fall 2009 2 31:26 25:21 20:16 15:0 opcode always read read, except for load write for R-type and load sign-extend and add ± Five stages, one step per stage ² IF: Instruction fetch from memory ² ID: Instruction decode & register read MIPS Pipeline ² EX: Execute operation or calculate address ² MEM: Access memory operand ² WB: Write result back to register IF ID EX MEM WB Instr 1 CS/ECE 3330 – Fall 2009 3 IF ID EX MEM WB IF ID EX MEM WB Instr 2 Instr 3 Time Æ
Background image of page 2
3 Data Hazards ± RAW: Read after write ± WAR: Write after read Dependencies vs. Hazards ± WAW: Write after write Control Hazards ± Cannot fetch next instruction until we know CS/ECE 3330 – Fall 2009 the outcome of the branch 4 ± An instruction depends on completion of data access by a previous instruction ± Think about which pipeline stage generates or Data Hazards uses a value IF ID EX MEM WB IF ID EX MEM WB add $s0, $t0, $t1 sub $t2, $s0, $t3 lw $s0 20($t1) CS/ECE 3330 – Fall 2009 5 IF ID EX MEM WB lw $s0, 20($t1) sw $t3, 12($t0) IF ID EX MEM WB
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 ± Use result when it is computed ² Don’t wait for it to be stored in a register ² Requires extra connections in the datapath Forwarding (aka Bypassing) CS/ECE 3330 – Fall 2009 6 ± Can’t always avoid stalls by forwarding ² If value not computed when needed ² Can’t forward backward in time! Load-Use Data Hazard CS/ECE 3330 – Fall 2009 7
Background image of page 4
5 Detour #1: More Pipeline Examples! CS/ECE 3330 – Fall 2009 8 ± Reorder code to avoid use of load result in the next instruction ± C code for A = B + E; C = B + F; Code Scheduling to Avoid Stalls lw $t1, 0($t0) lw $t2 , 4($t0) add $t3, $t1, $t2 sw
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/04/2009 for the course CS 333 taught by Professor Stankovic during the Fall '08 term at UVA.

Page1 / 15

cs3330-chap4-wrapup - CS/ECE 3330 Computer Architecture...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online