Computer system Structure pipelining technology-scalar

Source: Internet
Author: User
Tags scalar

I. Overlapping execution and advance control

一条指令的执行过程:(1)取指令:按照指令计数器PC的内容访问主存,取出一条指令送到指令寄存器。(2)分析指令:对指令的操作码进行译码,按照给定的寻址方式和地址字段形成操作数的地址,并用这个地址读取操作数。操作数可能在主存中,也可能在通用寄存器中。(3)执行指令:按照操作码的要求,完成指令规定的功能。

1.1 Overlapping executions

When there are more than one instruction to execute in the processor, there are three ways to do this

(1) Sequential execution

取指令k -> 分析指令k -> 执行指令k -> 取指令k+1 -> 分析指令k+1 -> 执行指令k+1 -> ...

The time it takes to execute n instructions is

T = ∑ (t取i + t分i + t执行i)

If the time of the fetch instruction, the analysis instruction and the execution instruction is equal, it is T, then

T = 3nt

(2) One-time overlapping execution mode

The execution of the k instruction is carried out in conjunction with the k+1 instruction, and if the time of the fetch instruction, the analysis instruction and the execution instruction is equal, it is T, then the time taken to execute the n instruction is

T = (1+2n)t

(3) Two overlapping execution modes

The k+1 instruction is advanced to the same time as the analysis of section K instruction, and the analysis of the K+1 directive is carried out in parallel with the execution of section K, if the instruction, analysis and execution
instruction takes equal time and is T, the time taken to execute n instructions is

T = (2+n)t

1.2 Advance control

先行控制技术实际上就是缓冲技术和预处理技术。缓冲技术:在工作速度不固定的两个功能部件之间设置缓冲器,用以平滑它们的工作。预处理技术:是指预取指令、对指令进行加工以及预取操作数等。

Second, the basic concept of the pipeline

把一个重复的过程分解为若干子过程,每个子过程由专门的功能部件来实现,将多个处理过程在时间上错开,依次通过个功能段,这样,每个子过程就可以与其他子过程并行进行。

2.1 Time and space diagram of pipeline

If the delay time (through time) of each stream segment is δts and the lockout time is ΔTL, the processing time for each function segment Δti:

Δti= Δts+Δtl

The maximum operating frequency of a water processor is:

If the delay time of each flow segment is not equal, the maximum operating frequency is:

2.1 Characteristics of flowing water technology

⑴ 一条流水线通常由若干个有联系的流水段组成。流水线中的段数也称为 “流水深度”。⑵ 每个流水段有专门的功能部件对指令进行某种加工。⑶ 各流水段所需时间应尽量相等,以减少流水线的瓶颈影响。⑷ 流水线工作阶段可分为建立(填入)、满载和排空三个阶段。 ⑸在理想情况下,当流水线充满后,每隔Δt时间将会有一个结果流出流水线。

2.2 Performance Index of pipeline

(1) Throughput rate

吞吐率TP是指在单位时间内流水线所完成的任务数量或输出结果的数量。

where n is the number of tasks, TK is the time it takes to complete n tasks.

1) line with equal time of each period

For a M-segment linear pipeline, in the ideal case of continuous input of n tasks, after the first task is entered, the M-unit time is passed from the input
Outflow, after which n-1 units of time, each unit of time to complete a task. In this case, the total amount required for the pipeline to complete n consecutive tasks
Time is

Tm=(n+m-1) Δt

Complete the actual throughput rate for n tasks:

Maximum throughput rate

The maximum throughput rate is the throughput at full-load, so the actual throughput rate is:

2) The line of time is not exactly equal to each period

t1= t, t2= t, t3=3 t, t4= t;

In general, the actual throughput rate of the pipeline with different periods of time is

The maximum throughput rate is

(2) Acceleration ratio

加速比是指采用流水方式后的工作速度与等效的顺序串行方式的工作速度之比。

For n solving tasks, if it takes time to complete the work in a serial way, it takes time to complete the work with M-segment, and each functional section
The delay time is ΔT, then the speedup of the pipeline is:

Maximum acceleration ratio:

If the delay time of each functional section of the pipeline varies, the speedup is:

(3) Efficiency

效率是指流水线中的各功能段的利用率。

If the periods are equal

If each period of time is unequal

(3) The relationship between throughput rate, acceleration ratio and efficiency

E=Tp·Δt=Sp/m效率是实际加速比和最大加速比之比。只有E=1时,才能达到Sp=m当Δt不变时,效率与吞吐率成正比。所以为提高效率所采用的方法,对提高吞吐率也有好处。

Iii. the correlation and conflict of pipeline

3.1 A classic 5-segment line

(1)取指令周期(IF)(2)指令译码/读寄存器周期(ID)(3)执行/有效地址计算周期(EX)(4)存储器访问/分支完成周期(MEM)(5)写回周期(WB)

3.2 Related

(1) Data related

对于两条指令i(在前)和j(在后),如果下述条件之一成立,则称指令j与指令i数据相关:1)指令j使用指令i产生的结果。2)指令j与指令k数据相关,而指令k又与指令i数据相关。

(2) Name related

名指的是指令所访问的寄存器或存储器单元的名称。如果两条指令使用相同的名,但是它们之间没有数据流动,则称这两条指令存在名相关。1)反相关:如果指令j写的名与指令i读的名相同,则称指令i和j发生了反相关,反相关指令之间的执行顺序是必须严格遵守的,以保证i读的值是正确的。2)输出相关:如果指令j和指令i写相同的名,则称指令i和j发生了输出相关,输出相关指令的执行顺序是不能颠倒的,以保证最后的结果是指令j写进去的。

(3) Control-related

控制相关是指由分支指令引起的相关。一般来说,为了保证程序应有的执行顺序,必须严格按控制相关确定的顺序执行。

3.3 Conflicts

流水线冲突是指对于具体的流水线来说,由于相关的存在,使得指令流中的下一条指令不能再指定的时钟周期执行。

There are 3 types of pipelining conflicts

(1)结构冲突:因硬件资源满足不了指令重叠执行的要求而发生的冲突。(2)数据冲突:当指令在流水线中重叠执行时,因需要用到前面指令的执行结果而发生的冲突。(3)控制冲突:流水线遇到分支指令和其他会改变PC值得指令所引起的冲突。

Computer system Structure pipelining technology-scalar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.