Docsity

Pipelining - Computer Architecture - Lecture Slides, Slides of Advanced Computer Architecture

Partial preview of the text

Download Pipelining - Computer Architecture - Lecture Slides and more Slides Advanced Computer Architecture in PDF only on Docsity!

Computer Architecture

Pipelining

How to improve performance?

  • Recall performance is function of
    • CPI: cycles per instruction
    • Clock cycle
    • Instruction count
  • Reducing any of the 3 factors will lead to

improved performance

Pipeline Approach to Improve System

Performance

  • Analogous to fluid flow in pipelines and

assembly line in factories

  • Divide process into “stages” and send tasks

into a pipeline

  • Overlap computations of different tasks by operating on them concurrently in different stages

Instruction Pipeline

  • Instruction execution process lends itself

naturally to pipelining

  • overlap the subtasks of instruction fetch, decode and execute

Synchronous Pipeline

All transfers simultaneous One task or operation enters the pipeline per cycle Processors reservation table : diagonal 4

Time Space Utilization of Pipeline

S

S

S

T T T T T T T T T

Time (in pipeline cycles)

Full pipeline after 4 cycles

Pipeline Clock and Timing

S

i

S

i+  m d Clock cycle of the pipeline :  Latch delay : d  = max {m } + d Pipeline frequency : f f = 1 /  6

Speedup and Efficiency

k-stage pipeline processes n tasks in k + (n-1) clock cycles: k cycles for the first task and n- 1 cycles for the remaining n- 1 tasks Total time to process n tasks Tk = [ k + (n-1)]  For the non-pipelined processor T 1 = n k  Speedup factor Sk = T 1 Tk = n k[ k + (n-1)]= n k k + (n-1) 7

Pipeline Performance: Example

  • Task has 4 subtasks with time: t1=60, t2=50, t3=90, and t4=80 ns (nanoseconds)
  • latch delay = 10
  • Pipeline cycle time = 90+10 = 100 ns
  • For non-pipelined execution
    • time = 60+50+90+80 = 280 ns
  • Speedup for above case is: 280/100 = 2.8 !!
  • Pipeline Time for 1000 tasks = 1000 + 4-1= 1003*100 ns
  • Sequential time = 1000*280ns
  • Throughput= 1000/
  • What is the problem here?
  • How to improve performance?

Non-linear pipelines and pipeline control

algorithms

  • Can have non- linear path in pipeline…
    • How to schedule instructions so they do no conflict for resources
  • How does one control the pipeline at the

microarchitecture level

  • How to build a scheduler in hardware?
  • How much time does scheduler have to make decision?

Reservation Tables

  • Reservation table : displays time-space flow of data through the pipeline analogous to opcode of pipeline - Not diagonal, as in linear pipelines
  • Multiple reservation tables for different functions
    • Functions may be dynamically assigned
  • Feedforward and feedback connections
  • The number of columns in the reservation table : evaluation time of a given function

Reservation Tables (Examples)

14

Collisions (Example)

x 1 x^ x 1 x 2 1 x 1 x 2 x 1 x 2 x 3 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 3 x 4 x 3 x 4 x 1 x 2 x 4 x 2 x 3 x 4 1 2 3 4 5 6 7 8 9 10 Latency = 2 16

Latency Cycle

x 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 x 1 x 1 x 1 x 1 x 1 x 1 x 2 x 1 x 2 x 2 x 2 x 2 x 2 x 3 x 2 x 2 x 3 x 3 x 3 x 3 18 x 3 Cycle Cycle Latency cycle : the sequence of initiations which has repetitive subsequence and without collisions Latency sequence length : the number of time intervals within the cycle Average latency : the sum of all latencies divided by the number of latencies along the cycle 17