当前位置:网站首页>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

边栏推荐
- On the characteristics of technology entrepreneurs from Dijkstra's Turing Award speech
- [rust notes] 16 input and output (Part 2)
- 【Rust 笔记】16-输入与输出(上)
- Full Permutation Code (recursive writing)
- 1.15 - 输入输出系统
- 打印机脱机时一种容易被忽略的原因
- API related to TCP connection
- Sword finger offer II 058: schedule
- Brief introduction to tcp/ip protocol stack
- 【Rust 笔记】13-迭代器(中)
猜你喜欢

Brief introduction to tcp/ip protocol stack

Wazuh开源主机安全解决方案的简介与使用体验

可变电阻器概述——结构、工作和不同应用

传统数据库逐渐“难适应”,云原生数据库脱颖而出

Introduction and experience of wazuh open source host security solution

LaMDA 不可能觉醒吗?

Dichotomy, discretization, etc

leetcode-6110:网格图中递增路径的数目

CF1637E Best Pair

Dynamic planning solution ideas and summary (30000 words)
随机推荐
[cloud native] record of feign custom configuration of microservices
liunx启动redis
Solution to game 10 of the personal field
Daily question 1342 Number of operations to change the number to 0
1040 Longest Symmetric String
LaMDA 不可能觉醒吗?
Daily question 1688 Number of matches in the competition
F - Two Exam(AtCoder Beginner Contest 238)
2022年贵州省职业院校技能大赛中职组网络安全赛项规程
leetcode-31:下一个排列
Multi screen computer screenshots will cut off multiple screens, not only the current screen
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
Convolution neural network -- convolution layer
Appium automation test foundation - Summary of appium test environment construction
Groupbykey() and reducebykey() and combinebykey() in spark
SQLMAP使用教程(一)
Individual game 12
Navicat連接Oracle數據庫報錯ORA-28547或ORA-03135
Doing SQL performance optimization is really eye-catching
leetcode-1200:最小绝对差