Why is the speed of a variable-length pipeline determined by the slowest stage + what is the total execution time of the program?

I am new to pipelining and I need help in that

The conveyor speed is determined by the speed of the slowest stage

Not only this, if I am given a 5-stage conveyor with a duration of 5 ns, 10 ns, 8 ns, 7 ns, 7 ns, respectively, they say that each instruction will take 10 ns. Can I get a clear explanation for this?

(edited ) Also, let my program have 3 teams I1, I2, I3, and I take 1 clk cycle duration = 1ns so that the above steps take 5, 10, 8, 7, 7 cycles, respectively. Now, according to the theory, a snapshot of the pipeline will be -

Simple pipeline snapshot

But this gives me the total time to be -no cycles clk * Cycle duration clk = 62 * 1 = 62 ns But according to theory, the total time should be - (the slowest step) * no. instructions = 10 * 3 = 30 ns Although I have an idea why the slowest stage is important (each pipeline step must wait, so 1 instruction is created after every 10 clk cycles, but the result is incompatible when I calculate it using clk cycles. Why Is this inconsistency? What am I missing ?? (edited)

+4
source share
4 answers

Thank you all for your answers.

I think everything is clear with me. Here is what I consider the answer -

Question-1: - Why the execution of the pipeline depends on the slowest step

It is clearly seen that at each stage, each stage must wait for the completion of the slowest stage. Thus, the total time after which each instruction completes is limited by the wait time. (In my example, after a space of 10 ns)

Question-2: - What is the total lead time of the program

I wanted to know how long a particular program containing 3 NOT commands would take to execute , how long it would take for 3 instructions to execute , which is obviously 30 ns related to the fact that each instruction will be completed every 10 ns.

Now suppose that I1 is selected in the pipeline, then 4 more commands are already executed in it. 4 instructions complete in 40 ns. After that, I1, I2, I3 are executed in the order of 30 ns. (Assuming there are no conveyor stalls)

This gives 30 + 40 = 70 ns.

In fact, for an n command program, k-stage piping

I think this is (n + k-1) * C * T

where C = no. clk cycles at the slowest stage T = cycle time

Please read my understanding .... to find out if I think something is wrong and so I can accept my own answer.

0
source

Suppose the process of car manufacturing. Suppose a two-stage lining is used. Let's say it takes 1 day to make an engine. 2 days to produce the rest. You can perform both stages in parallel. What is the speed of your car? It should be one car in 2 days. Despite the fact that you extend the balance for 1 day, you need to wait another day to get the engine.

In your case, although the other steps finish in less time, you need to wait 10ns to get the whole process.

+3
source

Staging allows you to perform "parts" of the same operation in onces.

I will create a smaller example here by canceling the last 2 steps of your example: 5, 10, 8 ns

Let's take two operations:

5 10 8 5 10 8 | The first operation starts here | At stage 2 the second operation can start it fist stage | However, since the stages take different amount of times, | the longest ones determines the runtime | the thirds stage can only start after the 2nd has completed: after 15ns | this is also true for the 2nd stage of the 2nd operation 
+1
source

I'm not sure about the source of your confusion. If one unit of your conveyor takes longer, the units located behind it will not be able to advance the pipeline until this device is completed, even if they themselves have finished their work. As DPG said, try looking at it from an example of a car production line. This is one of the most common ways to explain a pipeline. If the AHEAD units from the slowest unit are faster after completion, it still doesn't matter, because they have to wait until the slower unit finishes its work. So yes, your pipeline executes 3 instructions for a total execution time of 30ns.

0
source

Source: https://habr.com/ru/post/1485980/


All Articles