Download - Linear Pipelining
-
7/27/2019 Linear Pipelining
1/24
Principles of Linear Pipelining
-
7/27/2019 Linear Pipelining
2/24
Principles of Linear Pipelining
In pipelining, we divide a task into set of
subtasks.
The precedence relation of a set of subtasks
{T1, T2,, Tk} for a given task T implies that the
same task Tj cannot start until some earlier
task Ti finishes.
The interdependencies of all subtasks form
the precedence graph.
-
7/27/2019 Linear Pipelining
3/24
Principles of Linear Pipelining
With a linear precedence relation, task Tj
cannot start until earlier subtasks { Ti} for all
(i < j) finish.
A linear pipeline can process subtasks with a
linear precedence graph.
-
7/27/2019 Linear Pipelining
4/24
Principles of Linear Pipelining
A pipeline can process successive
subtasks if
Subtasks have linear precedence order Each subtasks take nearly same time to
complete
-
7/27/2019 Linear Pipelining
5/24
Basic Linear Pipeline
L: latches, interface between different stages
of pipeline
S1, S2, etc. : pipeline stages
-
7/27/2019 Linear Pipelining
6/24
Basic Linear Pipeline
It consists of cascade of processing stages. Stages:Pure combinational circuits
performing arithmetic or logic operations over
the data flowing through the pipe. Stages are separated by high speed interface
latches.
Latches : Fast Registers holding intermediateresults between stages
Information Flow are under the control of
common clock applied to all latches
-
7/27/2019 Linear Pipelining
7/24
Basic Linear Pipeline
The flow of data in a linear pipeline having four stagesfor the evaluation of a function on five inputs is asshown below:
-
7/27/2019 Linear Pipelining
8/24
Basic Linear Pipeline
The vertical axis represents four stages
The horizontal axis represents time in units of
clock period of the pipeline.
-
7/27/2019 Linear Pipelining
9/24
Clock Period () for the pipeline
Let i be the time delay of the circuitry Si and
t1 be time delay of latch.
Then the clock period of a linear pipeline is
defined by
The reciprocal of clock period is called clockfrequency (f = 1/) of a pipeline processor.
111
max ttt mi
k
i
-
7/27/2019 Linear Pipelining
10/24
Performance of a linear pipeline
Consider a linear pipeline with k stages. Let T be the clock period and the pipeline is initially
empty.
Starting at any time, let us feed n inputs and wait tillthe results come out of the pipeline.
First input takes k periods and the remaining (n-1)
inputs come one after the another in successive
clock periods.
Thus the computation time for the pipeline Tp is
Tp = kT+(n-1)T = [k+(n-1)]T
-
7/27/2019 Linear Pipelining
11/24
Performance of a linear pipeline
For example if the linear pipeline have fourstages with five inputs.
Tp = [k+(n-1)]T = [4+4]T = 8T
-
7/27/2019 Linear Pipelining
12/24
Performance Parameters
The various performance parameters of
pipeline are :
1. Speed-up
2. Throughput
3. Efficiency
-
7/27/2019 Linear Pipelining
13/24
Speedup
Speedup is defined asSpeedup = Time taken for a given computation by a non-pipelined functional unit
Time taken for the same computation by a pipelined version
Assume a function of k stages of equal
complexity which takes the same amount oftime T.
Non-pipelined function will take kT time for one
input. Then Speedup = nkT/(k+n-1)T = nk/(k+n-1)
-
7/27/2019 Linear Pipelining
14/24
Speed-up
For e.g., if a pipeline has 4 stages and 5 inputs,
its speedup factor is
Speedup = ?
The maximum value of speedup is
Lt [Speedup] = ?
n
-
7/27/2019 Linear Pipelining
15/24
Speed-up
The maximum value of speedup is
Lt [Speedup] = k
n
-
7/27/2019 Linear Pipelining
16/24
Efficiency
It is an indicator of how efficiently theresources of the pipeline are used.
If a stage is available during a clock period,
then its availability becomes the unit ofresource.
Efficiency can be defined as
ncomputatiothatduringavailableunitstimestageofnumberTotal
ncomputatioduringusedactuallyunitstimestageofNumber=Efficiency
-
7/27/2019 Linear Pipelining
17/24
Efficiency
No. of stage time units = nk
there are n inputs and each input uses k stages.
Total no. of stage-time units available
= k[ k + (n-1)]
It is the product of no. of stages in the pipeline (k)
and no. of clock periods taken for
computation(k+(n-1)).
-
7/27/2019 Linear Pipelining
18/24
Efficiency
Thus efficiency is expressed as follows:
The maximum value of efficiency is
11-nknk
Efficiency
nk
n
k
?1
nk
nLtEfficiencyLtnn
-
7/27/2019 Linear Pipelining
19/24
Efficiency
Efficiency is minimum when n = 1.
Efficiency = ?
For k = 4 and n = 5, Efficiency = ?
-
7/27/2019 Linear Pipelining
20/24
Throughput
It is the average number of results computed
per unit time.
For n inputs, a k-staged pipeline takes
[k+(n-1)]T time units
Then,
Throughput = n / [k+n-1] T = nf / [k+n-1]
where f is the clock frequency
-
7/27/2019 Linear Pipelining
21/24
Throughput
The maximum value of throughput is
Lt [Throughput] = ?
n
-
7/27/2019 Linear Pipelining
22/24
Throughput
The maximum value of throughput is
Lt [Throughput] = f
n
Throughput = Efficiency x Frequency
-
7/27/2019 Linear Pipelining
23/24
Problem
Consider the execution of a program of 15000instructions by a linear pipeline processor with a
clock rate of 25MHz. Assume that the instruction
pipeline has 5 stages and that one instruction is
issued per clock cycle. The penalties due to branchinstructions and out-of-sequence executions are
ignored
a) Calculate the speedup factor as compared with
non-pipelined processor
b) What are the efficiency and throughput of this
pipelined processor
-
7/27/2019 Linear Pipelining
24/24
Individual Assignment