22 Pages

ch6

Course: HIST 4381, Fall 2008
School: Southern Methodist
Rating:
 
 
 
 
 

Word Count: 1643

Document Preview

Six 1998 Chapter Morgan Kaufmann Publishers 1 Pipelining Improve perfomance by increasing instruction throughput Program execution Time order (in instructions) lw $1, 100($0) lw $2, 200($0) lw $3, 300($0) 2 4 6 8 10 12 14 16 18 Instruction Reg fetch ALU Data access Reg Instruction Reg fetch ALU Data access Reg Instruction fetch 8 ns 8 ns 8 ns Program execution Time order (in instructions) lw $1, 100($0)...

Register Now

Unformatted Document Excerpt

Coursehero >> South Carolina >> Southern Methodist >> HIST 4381

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Six 1998 Chapter Morgan Kaufmann Publishers 1 Pipelining Improve perfomance by increasing instruction throughput Program execution Time order (in instructions) lw $1, 100($0) lw $2, 200($0) lw $3, 300($0) 2 4 6 8 10 12 14 16 18 Instruction Reg fetch ALU Data access Reg Instruction Reg fetch ALU Data access Reg Instruction fetch 8 ns 8 ns 8 ns Program execution Time order (in instructions) lw $1, 100($0) lw $2, 200($0) lw $3, 300($0) 2 4 6 8 10 12 14 ... Instruction fetch Reg Instruction fetch ALU Reg Instruction fetch Data access ALU Reg Reg Data access ALU Reg Data access Reg 2 ns 2 ns 2 ns 2 ns 2 ns 2 ns 2 ns Ideal speedup is number of stages in the pipeline. Do we achieve this? 1998 Morgan Kaufmann Publishers 2 Pipelining What makes it easy all instructions are the same length just a few instruction formats memory operands appear only in loads and stores What makes it hard? structural hazards: suppose we had only one memory control hazards: need to worry about branch instructions data hazards: an instruction depends on a previous instruction Well build a simple pipeline and look at these issues Well talk about modern processors and what really makes it hard: exception handling trying to improve performance with out-of-order execution, etc. 1998 Morgan Kaufmann Publishers 3 Basic Idea IF: Instruction fetch 0 M u x 1 ID: Instruction decode/ register file read EX: Execute/ address calculation MEM: Memory access WB: Write back Add 4 Shift left 2 Read register 1 Add Add result PC Address Instruction Instruction memory Read data 1 Read register 2 Registers Read Write data 2 register Write data 0 M u x 1 Zero ALU ALU result Address Data memory Write data Read data 1 M u x 0 16 Sign extend 32 What do we need to add to actually split the datapath into stages? 1998 Morgan Kaufmann Publishers 4 Pipelined Datapath 0 M u x 1 IF/ID Add 4 ID/EX EX/MEM MEM/WB Add Add result Shift left 2 Instruction Read register 1 PC Address Instruction memory Read data 1 Read register 2 Registers Read Write data 2 register Write data 0 M u x 1 Zero ALU ALU result Address Data memory Write data Read data 1 M u x 0 16 Sign extend 32 Can you find a problem even if there are no dependencies? What instructions can we execute to manifest the problem? 1998 Morgan Kaufmann Publishers 5 Corrected Datapath 0 M u x 1 IF/ID Add 4 ID/EX EX/MEM MEM/WB Add Shift left 2 Instruction Read register 1 Add result PC Address Instruction memory Read data 1 Read register 2 Registers Read Write data 2 register Write data 0 M u x 1 Zero ALU ALU result Address Data memory Write data Read data 1 M u x 0 16 Sign extend 32 1998 Morgan Kaufmann Publishers 6 Graphically Representing Pipelines Time (in clock cycles) Program execution order (in instructions) lw $10, 20($1) CC 1 CC 2 CC 3 CC 4 CC 5 CC 6 IM Reg ALU DM Reg sub $11, $2, $3 IM Reg ALU DM Reg Can help with answering questions like: how many cycles does it take to execute this code? what is the ALU doing during cycle 4? use this representation to help understand datapaths 1998 Morgan Kaufmann Publishers 7 Pipeline Control PCSrc 0 M u x 1 IF/ID Add 4 RegWrite ID/EX EX/MEM MEM/WB Add Shift left 2 Add result Branch PC Address Instruction memory Instruction Read register 1 MemWrite Read data 1 ALUSrc Read register 2 Registers Read Write data 2 register Write data 0 M u x 1 Zero Zero ALU ALU result MemtoReg Address Data memory Write data Read data 1 M u x 0 Instruction 16 [15 0] Sign extend 32 6 ALU control MemRead Instruction [20 16] Instruction [15 11] 0 M u x 1 RegDst ALUOp 1998 Morgan Kaufmann Publishers 8 Pipeline control We have 5 stages. What needs to be controlled in each stage? Instruction Fetch and PC Increment Instruction Decode / Register Fetch Execution Memory Stage Write Back How would control be handled in an automobile plant? a fancy control center telling everyone what to do? should we use a finite state machine? 1998 Morgan Kaufmann Publishers 9 Pipeline Control Pass control signals along just like the data Execution/Address Calculation Memory access stage stage control lines control lines Reg ALU ALU ALU Mem Mem Dst Op1 Op0 Src Branch Read Write 1 1 0 0 0 0 0 0 0 0 1 0 1 0 X 0 0 1 0 0 1 X 0 1 0 1 0 0 Write-back stage control lines Reg Mem to write Reg 1 0 1 1 0 X 0 X Instruction R-format lw sw beq WB Instruction M EX WB M WB Control IF/ID ID/EX EX/MEM MEM/WB 1998 Morgan Kaufmann Publishers 10 Datapath with Control PCSrc ID/EX WB Control M EX EX/MEM WB M MEM/WB WB 0 M u x 1 IF/ID Add 4 RegWrite Add Add result MemWrite Shift left 2 ALUSrc Branch PC Address Instruction memory Read data 1 Read register 2 Registers Read Write data 2 register Write data 0 M u x 1 Zero ALU ALU result Address Data memory Write data Read data Instruction 16 0] Sign [15 extend 32 6 ALU control MemRead Instruction [20 16] Instruction [15 11] 0 M u x 1 RegDst ALUOp MemtoReg 1 M u x 0 Instruction Read register 1 1998 Morgan Kaufmann Publishers 11 Dependencies Problem with starting next instruction before first is finished dependencies that go backward in time are data hazards Time (in clock cycles) CC 1 Value of register $2: 10 Program execution order (in instructions) sub $2, $1, $3 IM Reg DM Reg CC 2 10 CC 3 10 CC 4 10 CC 5 10/ 20 CC 6 20 CC 7 20 CC 8 20 CC 9 20 and $12, $2, $5 IM Reg DM Reg or $13, $6, $2 IM Reg DM Reg add $14, $2, $2 IM Reg DM Reg sw $15, 100($2) IM Reg DM Reg 1998 Morgan Kaufmann Publishers 12 Software Solution Have compiler guarantee no hazards Where do we insert the nops ? sub and or add sw $2, $1, $3 $12, $2, $5 $13, $6, $2 $14, $2, $2 $15, 100($2) Problem: this really slows us down! 1998 Morgan Kaufmann Publishers 13 Forwarding Use temporary results, dont wait for them to be written register file forwarding to handle read/write to same register ALU forwarding Time (in clock cycles) CC 1 Value of register $2 : 10 Value of EX/MEM : X Value of MEM/WB : X Program execution order (in instructions) sub $2, $1, $3 IM Reg DM Reg CC 2 10 X X CC 3 10 X X CC 4 10 20 X CC 5 10/ 20 X 20 CC 6 20 X X CC 7 20 X X CC 8 20 X X CC 9 20 X X and $12, $2, $5 IM Reg DM Reg or $13, $6, $2 IM Reg DM Reg add $14, $2, $2 IM Reg DM Reg sw $15, 100($2) IM Reg DM Reg what if this $2 was $13? 1998 Morgan Kaufmann Publishers 14 Forwarding ID/EX WB Control IF/ID M EX EX/MEM WB M MEM/WB WB Instruction M u x Registers ALU M u x IF/ID.RegisterRs IF/ID.RegisterRt IF/ID.RegisterRt IF/ID.RegisterRd Rs Rt Rt Rd M u x Forwarding unit EX/MEM.RegisterRd Data memory PC Instruction memory M u x MEM/WB.RegisterRd 1998 Morgan Kaufmann Publishers 15 Can't always forward Load word can still cause a hazard: an instruction tries to read a register following a load instruction that writes to the same register. Time (in clock cycles) Program CC 1 execution order (in instructions) lw $2, 20($1) IM CC 2 CC 3 CC 4 CC 5 CC 6 CC 7 CC 8 CC 9 Reg DM Reg and $4, $2, $5 IM Reg DM Reg or $8, $2, $6 IM Reg DM Reg add $9, $4, $2 IM Reg DM Reg slt $1, $6, $7 IM Reg DM Reg Thus, we need a hazard detection unit to stall the load instruction 1998 Morgan Kaufmann Publishers 16 Stalling We can stall the pipeline by keeping an instruction in the same stage Program Time (in clock cycles) execution CC 1 CC 2 order (in instructions) lw $2, 20($1) IM Reg CC 3 CC 4 CC 5 CC 6 CC 7 CC 8 CC 9 CC 10 DM Reg and $4, $2, $5 IM Reg Reg DM Reg or $8, $2, $6 IM IM Reg DM Reg bubble add $9, $4, $2 IM Reg DM Reg slt $1, $6, $7 IM Reg DM Reg 1998 Morgan Kaufmann Publishers 17 Hazard Detection Unit Stall by letting an instruction that wont write anything go forward Hazar...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Southern Methodist - HX - 7370
r ! ! r r ! ( ` ) ` v ) ) ` 5hkylt q guh"q ` i f s 0x ` ( ` ) q ` f ) ) 0 f v q q 0 v 0 q v v c 0x ( } t g3Y'GyAah"y AgssyWp{"hy'Wgyxl q x v ) v 0 0 f vx 0 q ` f ` ` i 0 ` ) v i 0 f vxx ) 0 x v 0 onsn
Southern Methodist - HX - 8361
G I V E X D Q V W C Q P S E G Q R F Q H 2 5 ) #( ' @ T 1 H 9 # Q F 78 1 C S 56 1 2 2 C H b H a W G Q H G T Q V VG H Q T F C H R W G c Q F g i V F H Q R D HG b E E cI S cD Y F DE V G P D c X HD D d Ee `E G PX Y F S T V S ` G W Y E C IPQ HD E
Southern Methodist - HX - 8361
68 4 8 4C B97 A3 3@ 89 7 6473 45 32 $% # " ! @8 duc XPIG EjIi XI hYGg dibIGS RF eQI YPIF U PHF ePQ p RF ERG EPTGQ PF fGg eIQI T PEe '()0& nl pqoo k oo n m ut u zx k r s wvx uuvyxEPTGQFQ ERc fGgS bbG eTF fIGg IQIS hIFF eQ
Southern Oregon - MS - 211
Bi 211 Spreadsheet InstructionsLogging in on a Macintosh Enter your User ID and password in the Login Dialog box. Your ID is the first 4 letters of your last name, followed by the last four digits of your student ID number (social security number).
Southern Oregon - BA - 427
Southern Oregon University Business Policy and Strategy (BA 427, CRN 3716)Winter 2008-2009Noon-1:50PM (Tuesday-Thursday) Instructor: Andy Dungan, Ph.D. Phone: office (541) 552-8291 Email: dungan@sou.edu Office Hours: Monday - Wednesday 10AM-Noon or
Southern Oregon - BA - 427
Business Policy and Strategy Course Schedule and Assignments Winter 2007Key to schedule: Denotes reading assignmentdate assigned, complete prior to next class Homework assignmentdate assigned, due for next class BSG day game will be automatically ru
Southern Oregon - BI - 211
Bi 211 Plant Project Spreadsheet InstructionsLogging in on a Macintosh and Starting Excel on a Macintosh Enter your User ID and password in the Login box. Refer to the Spreadsheet instructions from the 1st week if you have not logged on before. Open
Southern Oregon - PE - 160
Interdepartmental Degrees137Interdepartmental DegreesCo-MajorsThe University offers several co-majors that combine strengths from two disciplines to form a single degree. A typical co-major requires more coursework than does a single major, but
Southern Oregon - PE - 160
Interdisciplinary Studies141Interdisciplinary StudiesA number of interdisciplinary degree programs are offered for students who want to pursue a degree drawn from several academic fields.pects of the course. Enrollment in the College Colloquiu
Southern Oregon - PH - 112
Geog 112: Physical Geography II SoilsGreg Jones, Department of GeographySoil Properties: 1) Color - most obvious soil property, but can be misleading. black or dark brown - fertile humus material reds and yellows - mostly iron oxides gray or w
Southern Utah - ACCT - 2020
Math 2020, Math for Elementary Ed II Fall 2008 Syllabus, Section 1 12:00-12:50 MWF in ELC 301Instructor: Dr. Jim Brandt Oce: ELC 403 Oce hours: MWF 10:00 to 11:00, TR 12:00 to 1:00, and by appointment Phone: 586-5454 e-mail: brandt@suu.edu Web site
Southern Utah - ACCT - 4200
Public Policy Process1. 2. 3. 4. 5.Policy Issues Policy Agenda Legislation Regulatory agencies Policy EvaluationPolicy Issues:Problems that exist in societySocial Economic Political TechnologicalPolicy Agenda:Choosing which issues to fo
Southern Utah - ACCT - 4950
ThompsonStrickland: Strategic Management: Concepts and Cases, 13th Edition9. Azalea Seafood Gumbo ShoppeCase The McGrawHill Companies, 2002case9Azalea Seafood Gumbo ShoppeJohn E. GambleUniversity of South AlabamaThe aroma of boiling c
Southern Utah - ACCT - 4950
ThompsonGambleStrickland: Strategy: Winning in the MarketplaceV. Cases in Crafting and Executing Strategy12. Callaway Golf Company: Sustaining Advantage in a Changing Industry The McGrawHill Companies, 2004CASECallaway Golf CompanySustainin
Southern Utah - ACCT - 4950
Continental Airlines in 2003Time to Turn Around the Turnaround Strategy?Arthur A. Thompson The University of Alabama1994, Continental Airlines was a troubled company. While it was the fifth largest commercial airline in the United States, with re
Southern Utah - AGSC - 1100
AGSC 1100 PRINCIPLES OF ANIMAL SCIENCE Fall Semester 2007 MWF 11:00-11:50 AM Science Center 114INSTRUCTOR Chad L. Gasser, Ph.D. Office: GC 203A Phone: 586-7923 E-mail: gasser@suu.eduOFFICE HOURS MWF 9:30-10:30 AM M 3:00-5:00 PM Other times as nee
Southern Utah - AGSC - 2615
AGSC 2615 RUMINANT LIVESTOCK PRODUCTION PRACTICES I Fall Semester 2007 T 2:30-5:20 PM Valley FarmINSTRUCTOR Chad L. Gasser, Ph.D. Office: GC 203A Phone: 586-7923 E-mail: gasser@suu.eduOFFICE HOURS MWF 9:30-10:30 AM M 3:00-5:00 PM Other times as n
Southern Utah - AGSC - 3100
AGSC 3100 BEEF MANAGEMENT Fall Semester 2007 TR 8:30-9:50 AM Science Center 225INSTRUCTOR Chad L. Gasser, Ph.D. Office: GC 203A Phone: 586-7923 E-mail: gasser@suu.eduOFFICE HOURS MWF 9:30-10:30 AM M 3:00-5:00 PM Other times as neededCOURSE DESC
Southern Utah - AGSC - 3250
AGSC 3250 SHEEP AND WOOL MANAGEMENT Spring Semester 2008 TR 10:00-11:20 AM Science Center 122INSTRUCTOR Chad L. Gasser, Ph.D. Office: GC 203A Phone: 586-7923 E-mail: gasser@suu.eduOFFICE HOURS MWF 9:30-10:30 AM TR 8:30-9:30 AM Other times as need
Southern Utah - AGSC - 3500
AGSC 3500 & 3510 APPLIED REPRODUCTION IN LIVESTOCK AND HORSES & LAB Spring Semester 2008 MWF 11:00-11:50 AM, W 2:00-4:50 PM Science Center 127INSTRUCTOR Chad L. Gasser, Ph.D. Office: GC 203A Phone: 586-7923 E-mail: gasser@suu.eduOFFICE HOURS MWF
Southern Utah - HSS - 1120
HSS 1120 SECTION:SOUTHERN UTAH UNIVERSITY "INTRODUCTION TO DIVERSITY" 04 TR 10:00-11:20 AM, Room Teacher Education Building 111SPRING 2009INSTRUCTOR: Dr. Kholoud AI-Qubbaj E-Mail: Samhak@suu.edu www.suu.edu/faculty/samhak Office: CN 225P (Histo
Southern Utah - ART - 1010
English 1010 Diagnostic/Benchmark Essay You will have until Wednesday, Sept. 3rd to type a double-spaced, two-page essay on the topic below. Keep in mind this diagnostic/benchmark allows the English Department to assess its composition program, so it
Southern Utah - ART - 1010
1Deutsch 1010 Syllabus2Table of ContentsGerman Pronunciation.4 The German Verb: Present Tense.7 Nominative and Accusative Cases.13 Dative Case..16 Dual Control Prepositions.19 Genitive Case.22 The Imperative Mood.24 The Future Tense.26 Conjunc
Southern Utah - ART - 1010
ENGLISH 1010 / KYLE BISHOPPERSONAL NARRATIVE ESSAYAssignment Overview For the Personal Narrative Essay, students will write a 3-5 page essay that 1. explains a particular item or object that has personal significance to the author; 2. describes th
Southern Utah - ART - 3110
ENGL 3110Literature and FilmBLDG BC 202 TR 11:30 - 12:50 Dr. Todd Petersen BC 203-C 865-8080OFFICE HOURSTR 9:00 - 11:15 Online MWF 9:00-11:15 and by appointment petersent@suu.edu AIM doctortoddpSCHEDULE1.1 Introduction 1.2 Adaptation Theor
Southern Utah - ART - 3240
MGMT 3240 Spring 2009 M-W-F 10:00 AM 10:50 AM BUS 203 Professor: E-mail: Office location: Phone: Office Hours: Dr. Gerald E. Calvasina calvasina@suu.edu 309B Business Bldg. 435-586-1976 9:00 AM 10:00 AM T&R 1:00 PM 2:00 PM M-W9:00 AM 10:00 AM M
Southern Utah - ART - 3240
MGMT 3240 HUMAN RESOURCE MANAGEMENT Fall 2008 2:30 - 3:50 TR Dixie Leavitt Business Bldg. Room 102 INSTRUCTOR: OFFICE: PHONE: E-MAIL: OFFICE HOURS: Dr.Gerald E. Calvasina BU 309B 586-1976 calvasina@suu.edu 9:00 AM - 11:00 AM TR 1:00 PM 2:30 PM TR 4:
Southern Utah - ART - 3900
DRAMAPantomimeThe following activities come from the book: Integrating the Arts Across the Elementary School Curriculum, Gelineau, Phyllis R. Activities: The following activities contain pantomime in some form that may be varied as desired. Numbers
Southern Utah - ART - 3900
Southern Utah - ART - 3900
Glossary for Dance 3900 abstract ballet: ballet based on an idea as opposed to that based on a story (narrative ballet) with emphasis on skillful execution of prescribed ballet movement axial movement: movement performed while remaining in one place
Southern Utah - MATH - 1050
Math 1050, College Algebra Spring 2008 Syllabus, Section 4 1:00-1:50 MTWRF in SC 230Instructor: Dr. Jim Brandt Oce: ELC 421 Oce hours: MWF 10 to 11, TR 12 to 1, and by appointment Phone: 586-5489 e-mail: brandt@suu.edu Web site: http:/www.suu.edu/f