Pipeline Processors
Reservation Table Each functional evaluation can be represented using a diagram called Reservation Table (RT). It is the space-time diagram of a pipeline corresponding to one functional evaluation. X axis time units Y axis stages Columns represent the evaluation time for a given function Multiple checkmarks in a row, means repeated usage of the same stage in different cycles
Reservation Table For first sequence Sa, Sb, Sc, Sb, Sc, Sa called function A, we have 0 1 2 3 4 5 Sa A A Sb A A Sc A A
Reservation Table For second sequence Sa, Sc, Sb, Sa, Sb, Sc called function B, we have 0 1 2 3 4 5 Sa B B Sb B B Sc B B
3-Stage Non-Linear Pipeline Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5
Function A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5 A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5 A A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5 A A A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa A Sb A A Sc A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa A Sb A A Sc A A
3-Stage Pipeline : Sa, Sb, Sc, Sb, Sc, Sa Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa A A Sb A A Sc A A
Function B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5 B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage Sa Sb Sc 0 1 2 3 4 5 B B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa B Sb B Sc B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa B B Sb B Sc B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa B B Sb B B Sc B
3-Stage Pipeline: Sa, Sc, Sb, Sa, Sb, Sc Output A Input Sa Sb Sc Output B Time Reservation Table Stage 0 1 2 3 4 5 Sa B B Sb B B Sc B B
Latency Analysis Latency: The number of time units (clock cycles) between two initiations of a pipeline is the latency between them. A latency value k means that two initiations are separated by k clock cycles. Collision: An attempt by two or more initiations to use the same pipeline stage at the same time. Collision implies resource conflicts b/w two initiations in the pipeline. Some latencies cause collision, some not. Latencies that will cause collision are called Forbidden Latencies and the latencies that will not cause collision are called Permissible Latencies.
Latency Cycles A latency sequence is a sequence of permissible nonforbidden latencies between successive task initiations. A latency cycle is a latency sequence which repeats the same subsequence indefinitely.
Latency Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 x 1 x 1 x 2 x 1 x 2 x 3 x 2 x 3 x 1 x 1 x 2 x 3 x 1 x 1 x 1 x 2 x 2 x 2 x 2 x 3 x 3 x 3 Cycle Cycle A latency sequence is a sequence of permissible nonforbidden latencies between successive task initiations. A latency cycle is a latency sequence which repeats the same subsequence indefinitely.
Example X Y S1 S2 S3
Reservation Tables for X & Y S1 S2 S3 X X X X X X X X S1 S2 S3 Y Y Y Y Y Y
Forbidden Latencies To detect the forbidden latencies, check the distance between two checkmarks in the same row of the reservation table.
X after X S1 S2 S3 X X X X X X X X 2 S1 S2 S3 X1 X2 X1 X2 X1 X1 X2 X1 X2 X1 X2 X1 X2 X1
X after X S1 S2 S3 X X X X X X X X 5 S1 S2 S3 X1 X2 X1 X1 X1 X1 X2 X1 X1 X1 X2
X after X S1 S2 S3 X X X X X X X X 4 S1 S2 S3 X1 X2 X1 X1 X1 X1 X2 X2 X1 X1 X2 X1
X after X S1 S2 S3 X X X X X X X X 7 S1 X1 X1 X2 X1 S2 S3 X1 X1 X1 X1 X1
Collision Vector Combined set of permissible and forbidden latencies. Forbidden Latencies: 2, 4, 5, 7 Collision vector C = (C m, C m-1,, C 2, C 1 ), m <= n-1 n = number of column in reservation table The value of Ci = 1 if the latency i causes a collision; Ci = 0 if the latency i is permissible. Collision Vector = 1 0 1 1 0 1 0
Y after Y S1 S2 S3 Y Y Y Y Y Y Y Y Y Y S1 S2 S3 Y Y Y Y Y Y Y Y
Y after Y S1 S2 S3 Y Y Y Y Y Y Y Y Y Y S1 S2 S3 Y Y Y Y Y Y Y Y
Collision Vector Forbidden Latencies: 2, 4 Collision vector C = (C m, C m-1,, C 2, C 1 ), m <= n-1 n = number of column in reservation table C i = 1 if latency i causes collision, 0 otherwise Collision Vector = 1 0 1 0
Collision Vector Reservation Table x x x x x x C = (??...??)
Exercise Find the collision vector 1 2 3 4 5 6 7 A X X X B X X C X X D X
State Diagram State diagrams can be constructed to specify the permissible transitions among successive initiations. The collision vector, corresponding to the initial state of pipeline at time 1, is called the initial collision vector (ICV).
State Diagram The next state of the pipeline at time t+p can be obtained by using a bit-right shift register Initial CV is loaded into the register. The register is then shifted to the right. When a 0 emerges from the right end after p shifts, p is a permissible latency. When a 1 emerges, the corresponding latency should be forbidden latency. Logical 0 enters from the left end of the shift register. The next state after p shifts is obtained by bitwise-oring the initial CV with the shifted register contents.
Right Shift Register The next state can be obtained with the help of an p-bit shift register 0 latency. 1 Collision 0 Safe to allow an initiation Each 1-bit shift corresponds to increase in the latency by 1.
The Next State The next state is obtained by bitwise ORing the initial collision vector with the shifted register C.V. = 1 0 1 1 0 1 0 (first state) 0 1 0 1 1 0 1 C.V. 1-bit right shifted 1 0 1 1 0 1 0 initial C.V. ---------------- OR 1 1 1 1 1 1 1
State Diagram for X 8 + 1 0 1 1 0 1 0 3 6 8 + 1 8 + 1 0 1 1 0 1 1 1 1 1 1 1 1 1 3 * 6
Group Activity 1 1 2 3 4 S1 X X S2 S3 X X a. What are the forbidden latency? b. Draw the state transition diagram. c. List all the simple cycles and greedy cycles. d. Determine the minimal average latency (MAL). e. Determine the throughput of this pipeline.