processor architecture
play

Processor Architecture 2 Lab Schedule Ac=vi=es - PowerPoint PPT Presentation

Computer Systems and Networks ECPE 170 Jeff Shafer University of the Pacific Processor Architecture 2 Lab Schedule Ac=vi=es Assignments


  1. ì ¡ Computer ¡Systems ¡and ¡Networks ¡ ECPE ¡170 ¡– ¡Jeff ¡Shafer ¡– ¡University ¡of ¡the ¡Pacific ¡ Processor ¡ Architecture ¡

  2. 2 ¡ Lab ¡Schedule ¡ Ac=vi=es ¡ Assignments ¡Due ¡ ì Today ¡ ì Lab ¡11 ¡ Processor ¡Architecture ¡ Due ¡by ¡Dec ¡1 st ¡5:00am ¡ ì ì ì Next ¡Tuesday ¡ ì Lab ¡12 ¡ Network ¡Programming ¡ Due ¡by ¡Dec ¡8 th ¡5:00am ¡ ì ì Python ¡ ì ì Final ¡Exam ¡ ì Next ¡Thursday ¡ Tue ¡Dec ¡9 th ¡8-­‑10am ¡ ì Thanksgiving ¡ ì Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  3. 3 ¡ ì ¡ MIPS ¡Instruction ¡Cycle ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  4. 4 ¡ MIPS ¡Instruction ¡Cycle ¡ ì How ¡does ¡the ¡hardware ¡MIPS ¡processor ¡execute ¡a ¡ single ¡instrucNon? ¡ ì With ¡a ¡5-­‑stage ¡instrucNon ¡cycle ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  5. 5 ¡ MIPS ¡Instruction ¡Cycle ¡ ì Step ¡1 ¡– ¡InstrucNon ¡Fetch ¡(IF) ¡ ì Retrieve ¡next ¡instruc=on ¡from ¡memory ¡ (check ¡the ¡instruc-on ¡cache ¡first!) ¡ ì Program ¡Counter ¡ (PC) ¡register ¡stores ¡address ¡of ¡ next ¡instruc=on ¡to ¡be ¡retrieved/executed ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  6. 6 ¡ MIPS ¡Instruction ¡Cycle ¡ ì Step ¡2 ¡– ¡InstrucNon ¡Decode ¡(ID) ¡ ì Decode ¡instruc=on ¡– ¡what ¡should ¡we ¡do? ¡ ì Retrieve ¡input ¡values ¡from ¡registers ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  7. 7 ¡ MIPS ¡Instruction ¡Cycle ¡ ì Step ¡3 ¡– ¡Execute ¡(EX) ¡ ì ALU ¡performs ¡arithme=c ¡or ¡logical ¡opera=on ¡ ì Opera=on ¡might ¡be ¡calcula=ng ¡a ¡memory ¡address ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  8. 8 ¡ MIPS ¡Instruction ¡Cycle ¡ ì Step ¡4 ¡– ¡Memory ¡Access ¡(MEM) ¡ ì Read/write ¡memory ¡ if ¡necessary ¡ (Check ¡the ¡data ¡cache ¡first!) ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  9. 9 ¡ MIPS ¡Instruction ¡Cycle ¡ ì Step ¡5 ¡– ¡Write ¡Back ¡(WB) ¡ ì Write ¡final ¡result ¡of ¡instruc=on ¡to ¡register ¡ ¡ if ¡necessary ¡ Instruc=on ¡ Instruc=on ¡ Memory ¡ Execute ¡ Write ¡Back ¡ Fetch ¡ Decode ¡ Access ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  10. 10 ¡ Example ¡1 ¡– ¡add ¡$s0,$s1,$s2 ¡ 1. IF : ¡Load ¡instruc=on ¡from ¡memory; ¡ ¡ increment ¡PC ¡ 2. ID : ¡Determine ¡opera=on ¡is ¡“add”; ¡ ¡ Load ¡$s1 ¡and ¡$s2 ¡from ¡registers ¡ 3. EX : ¡ALU ¡performs ¡addi=on ¡opera=on ¡ 4. MEM : ¡No ¡opera=on ¡(no-­‑op) ¡ 5. WB : ¡Output ¡of ¡ALU ¡wri\en ¡to ¡$s0 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  11. 11 ¡ Example ¡2 ¡– ¡lw ¡$s0,10($t1) ¡ 1. IF : ¡Load ¡instruc=on ¡from ¡memory, ¡increment ¡PC ¡ 2. ID : ¡Determine ¡opera=on ¡is ¡“load ¡word”; ¡ ¡ retrieve ¡$t1 ¡from ¡register ¡ 3. EX : ¡ALU ¡calculates ¡memory ¡address ¡of ¡desired ¡data ¡ ($t1 ¡plus ¡10 ¡sign-­‑extended ¡to ¡full ¡32 ¡bits) ¡ 4. MEM : ¡Retrieve ¡data ¡from ¡memory ¡at ¡address ¡ calculated ¡by ¡ALU ¡ (check ¡the ¡data ¡cache ¡first!) ¡ 5. WB : ¡Output ¡of ¡memory ¡wri\en ¡to ¡$s0 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  12. 12 ¡ Example ¡3 ¡– ¡sw ¡$s0,20($t1) ¡ 1. IF : ¡Load ¡instruc=on ¡from ¡memory, ¡increment ¡PC ¡ 2. ID : ¡Determine ¡opera=on ¡is ¡“store ¡word”; ¡ ¡ retrieve ¡$s0 ¡and ¡$t1 ¡from ¡registers ¡ 3. EX : ¡ALU ¡calculates ¡memory ¡address ¡of ¡storage ¡ loca=on ¡($t1 ¡plus ¡20 ¡sign-­‑extended ¡to ¡full ¡32 ¡bits) ¡ 4. MEM : ¡Store ¡value ¡from ¡$s0 ¡to ¡memory ¡at ¡address ¡ calculated ¡by ¡ALU ¡ (write ¡goes ¡to ¡the ¡data ¡cache!) ¡ 5. WB : ¡No ¡opera=on ¡(no-­‑op) ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  13. 13 ¡ Example ¡4 ¡– ¡beq ¡$t1,$t2,label ¡ IF : ¡Load ¡instruc=on ¡from ¡memory, ¡increment ¡PC ¡ 1. ID : ¡Determine ¡opera=on ¡is ¡“branch ¡on ¡equal”; ¡ ¡ 2. retrieve ¡$t1 ¡and ¡$t2 ¡from ¡registers ¡ EX : ¡ALU ¡calculates ¡memory ¡address ¡of ¡loca=on ¡to ¡jump ¡ 3. to ¡ if ¡ the ¡comparison ¡is ¡true ¡(PC ¡+ ¡label ¡sign-­‑extended ¡to ¡ full ¡32 ¡bits); ¡ALU ¡also ¡compares ¡$t1 ¡and ¡$t2 ¡for ¡equality ¡ MEM : ¡If ¡comparison ¡is ¡equal, ¡PC ¡= ¡address ¡calculated ¡by ¡ 4. ALU. ¡Otherwise, ¡PC ¡is ¡unchanged ¡ WB : ¡No ¡opera=on ¡(no-­‑op) ¡ 5. Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  14. 14 ¡ ì ¡ Pipelining ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  15. 15 ¡ Instruction ¡Cycle ¡ The ¡performance ¡of ¡our ¡5-­‑step ¡ instruc=on ¡cycle ¡is ¡slow ¡if ¡we ¡ only ¡do ¡one ¡instruc=on ¡at ¡a ¡=me ¡ New ¡Goal: ¡ ¡Run ¡the ¡instruc=on ¡ cycle ¡quickly ¡and ¡efficiently ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  16. 16 ¡ Instruction ¡Cycle ¡ ì A ¡laundry ¡analogy… ¡ ì Laundry ¡cycle ¡instead ¡of ¡instruc=on ¡cycle ¡ ì Doing ¡laundry ¡in ¡your ¡residence ¡hall ¡ ì Washing ¡machine ¡– ¡35 ¡minutes ¡ ì Dryer ¡– ¡60 ¡minutes ¡ ì Folding ¡/ ¡Hanging ¡– ¡8 ¡minutes ¡ ì How ¡do ¡you ¡do ¡one ¡load ¡of ¡laundry ¡the ¡fastest? ¡ = ¡103 ¡ Washer ¡ Dryer ¡ Fold ¡ minutes ¡ 60 ¡ 35 ¡ 8 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  17. 17 ¡ Instruction ¡Cycle ¡for ¡Laundry ¡ ì How ¡do ¡you ¡do ¡two ¡loads ¡of ¡laundry ¡the ¡fastest? ¡ ì Back ¡to ¡back? ¡ ì 206 ¡minutes ¡total ¡ ì Leaves ¡machines ¡idle ¡at ¡different ¡=mes ¡ ì Concurrently? ¡ Load ¡1: ¡ Washer ¡ Dryer ¡ Fold ¡ Load ¡2: ¡ Washer ¡ Dryer ¡ Fold ¡ 35 ¡ 60 ¡ 60 ¡ Time ¡ è ¡ 8 ¡ Total: ¡163 ¡minutes ¡ ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  18. 18 ¡ Pipelining ¡ ì This ¡is ¡ pipelining ¡ Performing ¡work ¡in ¡parallel ¡instead ¡of ¡sequen=ally ¡ ì ì Goal: ¡Keep ¡all ¡hardware ¡busy ¡ Provides ¡for ¡ instrucNon ¡level ¡parallelism ¡(ILP) ¡ ì ì Execu=ng ¡more ¡than ¡one ¡instruc=on ¡at ¡a ¡=me ¡ Without ¡Pipelining: ¡ With ¡Pipelining: ¡ Instr. ¡ Stage ¡ Instr. ¡ Pipeline ¡Stage ¡ # ¡ # ¡ Finish ¡first ¡ 1 ¡ IF ¡ ID ¡ EX ¡ MEM ¡ WB ¡ 1 ¡ IF ¡ ID ¡ EX ¡ MEM ¡ WB ¡ instruc,on… ¡ IF ¡ ID ¡ EX ¡ 2 ¡ IF ¡ ID ¡ EX ¡ MEM ¡ WB ¡ 2 ¡ … ¡before ¡star,ng ¡ second ¡ 3 ¡ IF ¡ ID ¡ EX ¡ MEM ¡ 3 ¡ Cycle ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ Cycle ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

  19. 19 ¡ Deeper ¡Pipelining ¡ ì We ¡can ¡do ¡be\er ¡than ¡this ¡ ì (Original) ¡Laundry ¡Room ¡Specifica=ons: ¡ ì Washing ¡machine ¡– ¡35 ¡minutes ¡ ì Dryer ¡– ¡60 ¡minutes ¡ ì Folding ¡/ ¡Hanging ¡– ¡8 ¡minutes ¡ ì What ¡is ¡the ¡bo\leneck ¡in ¡our ¡simple ¡pipeline? ¡ ì Drying ¡takes ¡much ¡longer ¡than ¡the ¡other ¡stages ¡ ì This ¡slows ¡down ¡the ¡en=re ¡laundry ¡process ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2014 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend