1
00:00:01,040 --> 00:00:01,890
Hello fellas.

2
00:00:01,910 --> 00:00:02,710
Welcome back.

3
00:00:02,720 --> 00:00:06,890
In this lesson we're going to talk about the concept of pipelines.

4
00:00:06,890 --> 00:00:14,330
Basically a pipeline is the mechanism a risk process or users to execute instructions using a pipeline

5
00:00:14,360 --> 00:00:21,860
massively speeds up execution by fetching the next instruction while other instructions are being decoded

6
00:00:21,890 --> 00:00:23,650
and executed.

7
00:00:24,050 --> 00:00:31,040
One way to view a pipeline is to think of it as an automobile assembly line with each stage carrying

8
00:00:31,040 --> 00:00:39,710
out a particular task to manufacture the vehicle defect lows and instruction for memory the decode identifies

9
00:00:39,710 --> 00:00:46,340
the instruction to be executed and the execute processes the instruction and write the results back

10
00:00:46,340 --> 00:00:48,080
to register.

11
00:00:48,080 --> 00:00:51,070
This is a very simple pipeline.

12
00:00:51,110 --> 00:00:59,180
It is a three stage pipeline similar to the one used in Codex M and seven process source.

13
00:00:59,180 --> 00:01:07,400
Here is a sequence of three instructions being fetched decoded and executed by the process or it construction

14
00:01:07,400 --> 00:01:09,690
takes a single cycle to complete.

15
00:01:09,740 --> 00:01:16,370
After the pipeline is filled as we can see the three instructions are placed in the pipeline sequentially

16
00:01:16,670 --> 00:01:18,420
in the first cycle.

17
00:01:18,620 --> 00:01:24,080
The process or fetches the art instruction from memory in the second cycle.

18
00:01:24,110 --> 00:01:31,090
The process of fetches the swap instruction and decodes the art instruction in the third cycle.

19
00:01:31,100 --> 00:01:38,510
Both this up and add instruction are moved along the pipeline to add instruction is executed to sop

20
00:01:38,540 --> 00:01:44,660
instruction is decoded and they compare or see MP instruction is fetched.

21
00:01:44,660 --> 00:01:47,490
This procedure is called Fill in the pipeline.

22
00:01:47,540 --> 00:01:54,000
The pipeline in effect allows the corps to execute on instruction every cycle.

23
00:01:54,110 --> 00:01:58,260
As I mentioned this is a simple three stage pipeline architecture.

24
00:01:58,400 --> 00:02:05,870
Some implementations of the pipeline architecture are used in some cores like the cortex a family used

25
00:02:05,870 --> 00:02:13,670
in devices like the iPhone and other smartphones have as many as 15 stages as the pipeline length increases

26
00:02:13,970 --> 00:02:21,560
the amount of work done at each stage is reduced which allows the process or to attain higher operating

27
00:02:21,560 --> 00:02:22,850
frequencies.

28
00:02:22,850 --> 00:02:29,390
This in turn increases the young the performance and the system latency also increases because it takes

29
00:02:29,390 --> 00:02:34,310
more cycles to fill the pipeline before the call can execute on instruction.

30
00:02:34,310 --> 00:02:41,030
The increased pipeline length also means there can be data dependency between certain stages and we

31
00:02:41,030 --> 00:02:46,910
can write code to reduce this dependence using instruction scheduling which we shall explore in future

32
00:02:46,910 --> 00:02:48,350
sections.

33
00:02:48,350 --> 00:02:55,250
The pipeline has not processed on instruction until its past is complete the through the execute stage

34
00:02:55,760 --> 00:03:02,660
in the execute stage the program counter register always points to the address of the instruction being

35
00:03:02,720 --> 00:03:08,440
executed plus 8 byte and this corresponds to the fetch stage of the pipeline.

36
00:03:08,450 --> 00:03:15,260
In other words the piece always points to the address of the instruction being executed plus two instructions

37
00:03:15,350 --> 00:03:16,360
ahead.

38
00:03:16,430 --> 00:03:20,450
There are three other characteristics of the pipeline worth mentioning.

39
00:03:20,450 --> 00:03:28,280
First the execution of the branch instruction or directly modifying the course is the Army Corps flush

40
00:03:28,340 --> 00:03:29,300
its pipeline.

41
00:03:29,330 --> 00:03:37,070
Also some arm architectures like the arm 10 uses the branch predictor which reduces the effect of pipeline

42
00:03:37,070 --> 00:03:44,930
flush by predicting possible branches and loading the new branch address before the execution of the

43
00:03:44,930 --> 00:03:46,250
instruction.

44
00:03:46,250 --> 00:03:53,030
Finally the instruction in the execute stage will complete even though an interrupt has been raised.

45
00:03:53,150 --> 00:03:58,850
Other instruction is in the pipeline will be abundant and the process will start fill in the pipeline

46
00:03:59,330 --> 00:04:03,660
from the appropriate entry and defect a table.

47
00:04:03,710 --> 00:04:08,110
So this all there is to its fellows and I shall see you in the next lesson.
