当前位置:网站首页>1.14 - assembly line
1.14 - assembly line
2022-07-05 06:10:00 【It's Li sticky duck】
Catalog
3、 ... and 、 No pipeline is used to execute instructions
Four 、 Use pipeline to execute instructions
6、 ... and 、 Pipeline calculation formula
7、 ... and 、 Throughput of the pipeline
8、 ... and 、 Test method 1: Pipeline related calculation
One 、 The concept of pipeline
- The so-called assembly line , It refers to the execution of the program , Multiple instructions overlap A quasi parallel processing implementation technology .
Two 、 Pipeline workflow
- When an instruction is executed , It can usually be divided into several stages , Each stage is realized by different components ;
- Divide into 3 Take the first stage as an example : Fingering 、 analysis 、 perform ;
3、 ... and 、 No pipeline is used to execute instructions
1、 Execution process
- When the assembly line is not used , When the fetching part of the first instruction fetches , The analysis part and the execution part are idle ;
- When the finger picking part is finished , The analysis part starts the analysis instruction , At this time, the referring part and the executing part are idle ;
- When the execution of the analysis part is completed , The execution part executes instructions after compilation , At this time, the finger taking part and the analysis part are idle ;
2、 Conclusion
- Thus we can see that , When instructions are executed without pipeline , Take the finger part , Analyze components , The utilization of execution parts is not high ;
Four 、 Use pipeline to execute instructions
1、 Execution process
- When the first instruction starts to execute , Take the finger part and start working , Analysis part and execution part are idle ;
- When the first instruction fetch is completed , The analysis part starts to work ; At this time, the finger taking part is idle , At this point, you can get the second instruction ;
- When the first instruction analysis is completed , The execution part starts working ; At this time, the analysis unit is idle , At this point, you can analyze the second instruction just taken ; And since the second instruction fetching is completed , So at this time, the finger taking part is free again , So now you can get the third instruction ;
2、 Conclusion
- thus it can be seen , Use pipeline to execute instructions , It can effectively improve the utilization rate of components , It effectively improves the execution efficiency of instructions ;
5、 ... and 、 pipeline cycle
- At each stage of the instruction , The time of this stage with the longest execution time , Is the cycle of the assembly line ;
analysis :(1) For example, the workers on the assembly line , Three people work together to complete an item ; The first person needs 2 second , The second person needs 4 second , The third person needs 1 second ;(2) If the period for completing this item is set as 1 second , So first 、 The second person can't finish his work ;(3) Only set the period as 4 seconds , These three talents can complete their own work ;(4) So we will generally Complete an item The time of the phase that takes the longest to execute , Set as cycle , The period in the example is 4 second ;
6、 ... and 、 Pipeline calculation formula
- Time required for a single instruction +(n-1)*( pipeline cycle )
(1) It can be seen from the picture that , When executing the first instruction , need 3 Stages ;(2) At the end of the first instruction , The second order zh The analysis phase has been completed , Only one execution stage is needed to complete the execution of the second instruction ;(3) When the execution of the second instruction is completed , The third instruction has finished the analysis stage , Only one execution stage is needed to complete the execution of the third instruction ;(4) So execute n Instruction time , Just use the time of a single instruction ( The sum of the three phases of the first instruction )+(n-1) The time required to execute an instruction ;
- Be careful :n Indicates the number of instructions ;
7、 ... and 、 Throughput of the pipeline
8、 ... and 、 Test method 1: Pipeline related calculation
边栏推荐
- Sword finger offer II 058: schedule
- SPI 详解
- Transform optimization problems into decision-making problems
- Introduction to LVS [unfinished (semi-finished products)]
- Navicat連接Oracle數據庫報錯ORA-28547或ORA-03135
- R language [import and export of dataset]
- 1996. number of weak characters in the game
- Introduction to convolutional neural network
- Brief introduction to tcp/ip protocol stack
- Analysis of backdoor vulnerability in remote code execution penetration test / / phpstudy of national game title of national secondary vocational network security B module
猜你喜欢
How to adjust bugs in general projects ----- take you through the whole process by hand
[jailhouse article] jailhouse hypervisor
Appium automation test foundation - Summary of appium test environment construction
leetcode-6108:解密消息
LeetCode 0107.二叉树的层序遍历II - 另一种方法
Appium自动化测试基础 — Appium测试环境搭建总结
Open source storage is so popular, why do we insist on self-development?
In this indifferent world, light crying
CF1634E Fair Share
Analysis of backdoor vulnerability in remote code execution penetration test / / phpstudy of national game title of national secondary vocational network security B module
随机推荐
【实战技能】如何做好技术培训?
Doing SQL performance optimization is really eye-catching
One question per day 1765 The highest point in the map
Spark中groupByKey() 和 reduceByKey() 和combineByKey()
SPI 详解
全排列的代码 (递归写法)
Leetcode-6111: spiral matrix IV
1039 Course List for Student
R language [import and export of dataset]
MIT-6874-Deep Learning in the Life Sciences Week 7
打印机脱机时一种容易被忽略的原因
leetcode-1200:最小绝对差
The connection and solution between the shortest Hamilton path and the traveling salesman problem
leetcode-556:下一个更大元素 III
One question per day 2047 Number of valid words in the sentence
【Rust 笔记】17-并发(下)
RGB LED infinite mirror controlled by Arduino
[rust notes] 17 concurrent (Part 2)
leetcode-31:下一个排列
7. Processing the input of multidimensional features