JPS638492B2 - - Google Patents

Info

Publication number
JPS638492B2
JPS638492B2 JP58212021A JP21202183A JPS638492B2 JP S638492 B2 JPS638492 B2 JP S638492B2 JP 58212021 A JP58212021 A JP 58212021A JP 21202183 A JP21202183 A JP 21202183A JP S638492 B2 JPS638492 B2 JP S638492B2
Authority
JP
Japan
Prior art keywords
instruction
address
branch
stage
register
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP58212021A
Other languages
Japanese (ja)
Other versions
JPS60105050A (en
Inventor
Katsumi Oonishi
Juji Oinaga
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP58212021A priority Critical patent/JPS60105050A/en
Priority to BR8407165A priority patent/BR8407165A/en
Priority to AU36122/84A priority patent/AU560378B2/en
Priority to EP84904162A priority patent/EP0163740B1/en
Priority to PCT/JP1984/000535 priority patent/WO1985002279A1/en
Priority to DE8484904162T priority patent/DE3478157D1/en
Priority to US06/758,665 priority patent/US4802113A/en
Publication of JPS60105050A publication Critical patent/JPS60105050A/en
Publication of JPS638492B2 publication Critical patent/JPS638492B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 (a) 発明の技術分野 本発明は、パイプライン制御のデータ処理装置
において、分岐命令を高速化する制御方式に関す
る。
DETAILED DESCRIPTION OF THE INVENTION (a) Technical Field of the Invention The present invention relates to a control method for speeding up branch instructions in a pipeline-controlled data processing device.

(b) 技術の背景 パイプライン制御のデータ処理装置において
は、キヤツシユメモリにデータ又は命令が存在し
なかつた時に生じる「待ち」を如何に少なくする
かという事と、命令のシーケンスが分岐条件の成
立、或いは割り込みによつて変更される場合、如
何に円滑に該変更処理を行うかという問題があ
る。
(b) Background of the technology In pipeline-controlled data processing devices, it is important to minimize the "waiting" that occurs when no data or instructions exist in the cache memory, and to ensure that the instruction sequence meets the branch condition. When a change is made due to establishment or interruption, there is a problem of how to smoothly carry out the change processing.

上記「待ち」の問題に対しては、キヤツシユメ
モリの容量を増加させることで、ある程度解決で
きるが、命令のシーケンスの変更処理に関して
は、分岐命令における分岐先命令の読み出しを如
何に早い時点で行うかがポイントとなる。
The above-mentioned "waiting" problem can be solved to some extent by increasing the cache memory capacity, but when it comes to changing the instruction sequence, it is difficult to read the branch destination instruction in a branch instruction as early as possible. The key is to do it.

一方、最近の論理回路の高集積化動向に伴つ
て、ある論理機能を構成する場合、論理素子の数
は多少増加しても、該論理ブロツクの入出力端子
が少なくできるハードウエア構成が実現できれ
ば、システム全体のパーフオマンスは向上する動
向にある。
On the other hand, with the recent trend toward higher integration of logic circuits, it would be desirable to realize a hardware configuration that can reduce the number of input/output terminals of the logic block even if the number of logic elements increases somewhat when configuring a certain logic function. , the performance of the entire system is on the rise.

本発明は、この点に着目して、パイプライン制
御のデータ処理装置における分岐命令の高速化を
考えようとするものである。
The present invention focuses on this point and attempts to speed up branch instructions in a pipeline-controlled data processing device.

(c) 従来技術と問題点 第1図は、従来方式のパイプライン制御のデー
タ処理装置におけるパイプライン動作を模式的に
示した図であつて、I1〜I3は命令フエツチの
為の命令読出パイプラインの各ステージを示し、
P1〜P6はオペランドフエツチ及び演算を実行
する命令実行パイプラインの各ステージを示して
いる。
(c) Prior Art and Problems FIG. 1 is a diagram schematically showing the pipeline operation in a conventional pipeline-controlled data processing device, in which I1 to I3 are instruction read pipes for fetching instructions. Showing each stage of the line,
P1 to P6 indicate each stage of the instruction execution pipeline for executing operand fetches and operations.

この図によつて、先ずパイプライン制御のデー
タ処理装置における一般的な動作を説明する。
With reference to this diagram, first, general operations in a pipeline-controlled data processing device will be explained.

最初、本データ処理装置のパイプラインのI1
ステージにおいて、サービスプロセツサー(図示
せず)から命令アドレスレジスタ(以下IARとい
う)1Aに、これから実行するプログラムの先頭
アドレスがセツトされる。この時、命令フエツチ
コンスタントレジスタ(以下IFKRという)1B
には“0”が設定されているので、IAR1Aの内
容はその侭、I2ステージにおいて、加算器(A)2
Aを通して、実行アドレスレジスタ(以下EAR
という)3にセツトされ、EAR3によつてキヤ
ツシユメモリ4がアクセスされて、I3ステージ
の終わりのタイミングで、当該命令が命令語レジ
スタ(以下IWRという)5に読み出される。
Initially, I1 of the pipeline of this data processing device
At this stage, the start address of the program to be executed from now on is set in the instruction address register (hereinafter referred to as IAR) 1A from the service processor (not shown). At this time, instruction fetch constant register (hereinafter referred to as IFKR) 1B
Since "0" is set in IAR1A, the contents of IAR1A are stored in adder (A)2 in stage I2.
Through A, the execution address register (hereinafter referred to as EAR)
The cache memory 4 is accessed by the EAR3, and the instruction is read into the instruction word register (hereinafter referred to as IWR) 5 at the end of the I3 stage.

上記、最初の命令読み出し以降については、命
令フエツチ制御部(IFC)1より固定値“8”が
IFKR1Bに設定され、IAR1Aと加算器(A)2A
で加算され、実行アドレスが計算され、EAR3
にセツトされるように動作する。この結果、
IWR5への命令読み出しは8バイト単位で行わ
れる。
Above, after the first instruction reading, the fixed value "8" is set by the instruction fetch control unit (IFC) 1.
Set to IFKR1B, IAR1A and adder (A) 2A
, the execution address is calculated, and EAR3
It operates as if it were set to . As a result,
Instructions are read to IWR5 in units of 8 bytes.

上記のIWR5は、一般には多段のシフトレジ
スタで構成されていて、ポインタレジスタ(図示
せず)によつて、IWR5に蓄積されている複数
の命令の境界アドレスを知ることができる。
The IWR 5 described above is generally composed of a multi-stage shift register, and a pointer register (not shown) allows the boundary addresses of a plurality of instructions stored in the IWR 5 to be known.

上記ポインタレジスタが示すアドレスによつ
て、これからパイプラインにおいて実行する命令
を選択するのがセレクタ(SEL)6である。
A selector (SEL) 6 selects an instruction to be executed in the pipeline based on the address indicated by the pointer register.

パイプラインのP1ステージにおいて、セレク
タ(SEL)6によつて、当該命令がセレクトされ
ると、該命令の操作部は、各P2ステージ〜P6
ステージに対応して、それぞれ操作部レジスタP
2 OP〜P6 OP (8)にシフトされ、それぞれ
のステージでの命令実行時に使用される。
When the instruction is selected by the selector (SEL) 6 in the P1 stage of the pipeline, the operation section of the instruction is operated at each P2 stage to P6.
Each operation register P corresponds to the stage.
2 OP to P6 OP (8) and used when executing instructions at each stage.

該命令の各レジスタ指定部は、デコードされ、
そのデコードアドレスによつて、汎用レジスタが
アクセスされ、それぞれベースレジスタ(BR)
9、インデツクスレジスタ(XR)10に読み出
される。
Each register specification part of the instruction is decoded,
Depending on the decoded address, general-purpose registers are accessed, and the respective base registers (BR) are
9, read out to index register (XR) 10.

該命令のデイスプレイスメント指定部は、デイ
スプレイスメントレジスタ(DR)11に読み出
される。
The displacement designation part of the instruction is read into the displacement register (DR) 11.

次に、P2ステージにおいて、上記ベースレジ
スタ(BR)9と、インデツクスレジスタ(XR)
10と、デイスプレイスメントレジスタ(DR)
11とが、加算器(B)12において演算され、オペ
ランドアドレスが計算され、P3ステージのター
ゲツトレジスタ(P3TAR)13にストアされ、
キヤツシユメモリ4をアクセスして、オペランド
フエツチを行う。
Next, in the P2 stage, the base register (BR) 9 and the index register (XR)
10 and displacement register (DR)
11 is calculated in the adder (B) 12, and the operand address is calculated and stored in the target register (P3TAR) 13 of the P3 stage.
The cache memory 4 is accessed to perform an operand fetch.

該オペランドフエツチの結果は、P4ステージ
の終わりのタイミングにおいて、オペランド語レ
ジスタ(OWR)15に読み出され、次のP5ス
テージにおいて、演算回路16で演算され、演算
結果はP6ステージの最初のタイミングでリザル
トレジスタ(RR)17にセツトされ、同じP6
ステージで汎用レジスタ7にストアされる。
The result of the operand fetch is read out to the operand word register (OWR) 15 at the end timing of the P4 stage, and is operated in the arithmetic circuit 16 at the next P5 stage, and the operation result is read out at the first timing of the P6 stage. is set in result register (RR) 17, and the same P6
It is stored in the general-purpose register 7 at the stage.

又、前述のI1ステージにおいては、前記命令
実行アドレス計算の他に、以下の動作を行う。
In the I1 stage described above, in addition to the instruction execution address calculation, the following operations are performed.

即ち、命令実行アドレスを計算する時に、加算
器(A)2Aの1つの入力レジスタである命令フエツ
チコンスタントレジスタ(IFKR)1Bに、固定
値(例えば、“8”)を設定する毎に、カウンタ
(CTR)1Cに上記と同一の固定値を加算する。
That is, when calculating an instruction execution address, each time a fixed value (for example, "8") is set in the instruction fetch constant register (IFKR) 1B, which is one input register of the adder (A) 2A, the counter is (CTR) Add the same fixed value as above to 1C.

そして、パイプラインを抜けた命令コードを、
P6ステージにおける、命令操作部レジスタ(P
6 OP)より命令フエツチ制御部(IFC)1に
送出し、ここで命令の種別を判定することによ
り、該パイプラインを抜けた命令の長さ(バイト
数)を知つて、加算器(C)2Bで、上記カウンタ
(CTR)1Cから減算を行うように動作する。
Then, the instruction code that exits the pipeline is
The instruction operation unit register (P
6 OP) to the instruction fetch control unit (IFC) 1, and by determining the instruction type here, the length (number of bytes) of the instruction that has exited the pipeline is known, and the adder (C) 2B operates to subtract from the counter (CTR) 1C.

この結果、上記カウンタ(CTR)1Cには、
現在パイプライン中で処理されている全命令長が
入つていることになり、 〔IAR 1A〕−〔カウンタ(CTR)1C〕= P6ステージにある命令のアドレス を意味することになる。
As a result, the counter (CTR) 1C has the following:
It contains the length of all instructions currently being processed in the pipeline, and means [IAR 1A] - [Counter (CTR) 1C] = the address of the instruction at the P6 stage.

この演算が必要な場合、IAR 1Aからカウン
タ(CTR)1Cの値を、加算器(A)2Aで減算す
ることによつて実行する。
If this operation is necessary, it is performed by subtracting the value of the counter (CTR) 1C from the IAR 1A using the adder (A) 2A.

このように、従来方式においては、命令を読み
出す為の命令アドレスレジスタと、パイプライン
で実行中の命令のアドレスを示す命令アドレスレ
ジスタとが共用されている所に一つの特徴があ
る。
As described above, one feature of the conventional system is that the instruction address register for reading instructions and the instruction address register indicating the address of the instruction being executed in the pipeline are shared.

以上が、一般命令の動作であるが、本発明に関
連する分岐命令の場合の動作を、第3図のタイム
チヤートを参照しながら、次に説明する。
The above is the operation of a general instruction, but the operation of a branch instruction related to the present invention will be explained next with reference to the time chart of FIG.

今、IWR5に読み出された命令(nで示す)
が分岐命令であると、加算器(B)12で計算された
オペランドアドレスが分岐先のアドレスを示すこ
とになり、該アドレスがP3〜P6の各ステージ
のターゲツトレジスタP3TAR〜P6TARに蓄
積、シフトされると共に、P2ステージ(該分岐
先命令については、I1ステージ)において、オ
ア回路2Cを通してEAR3にセツトされ、キヤ
ツシユメモリ4をアクセスして、分岐先命令
(m,m+1……で示す)が読み出される。
The instruction currently read to IWR5 (indicated by n)
If is a branch instruction, the operand address calculated by the adder (B) 12 indicates the branch destination address, and this address is stored and shifted in the target registers P3TAR to P6TAR of each stage of P3 to P6. At the same time, in the P2 stage (I1 stage for the branch destination instruction), it is set to EAR3 through the OR circuit 2C, the cache memory 4 is accessed, and the branch destination instruction (indicated by m, m+1...) is read out. It can be done.

このP4ステージにおいて、該分岐命令の一つ
前の命令(n−1で示す)の演算が行われており
(n−1の命令に対してはP5ステージ)、その演
算結果によつて、分岐条件が成立すると、上記ア
クセスされている分岐先命令が、IWR5に読み
出され、該分岐先命令のP1〜P6の各ステージ
の実行が行われる。
In this P4 stage, an operation is performed on the instruction (indicated by n-1) immediately before the branch instruction (P5 stage for the n-1 instruction), and depending on the operation result, the branch When the condition is satisfied, the accessed branch destination instruction is read into the IWR 5, and each stage of P1 to P6 of the branch destination instruction is executed.

第3図のタイムチヤートにおいて、該分岐先命
令(但し、この時読み出された命令は、2個の4
バイト命令とする)のパイプラインでの動作(P
1〜P6ステージ)をm,m+1で示している。
In the time chart of FIG. 3, the branch destination instruction (however, the instruction read at this time is
Byte instruction) operation in the pipeline (P
1 to P6 stages) are indicated by m and m+1.

この従来方式において、続く分岐先命令m+2
を読み出す時は、分岐命令nのP6ステージにお
いて、ターゲツトレジスタP6TARに蓄積され
ている分岐先アドレスが、オア回路19を通して
IAR1Aにセツトされ、該分岐命令m+2のI1
ステージにおいて加算器(A)2AでIFKR1Bの値
(“8”)が加算され、分岐命令mのアドレスの8
バイト先の実行アドレスが、I2ステージで
EAR3にセツトされ、キヤツシユメモリ4をア
クセスして、m+2の命令が読み出される。
In this conventional method, the following branch destination instruction m+2
When reading out the branch destination address stored in the target register P6TAR at the P6 stage of the branch instruction n, the branch destination address is read through the OR circuit 19.
IAR1A of the branch instruction m+2.
At the stage, adder (A) 2A adds the value of IFKR1B (“8”) to 8 of the address of branch instruction m.
The execution address of the byte destination is at the I2 stage.
EAR3 is set, cache memory 4 is accessed, and instruction m+2 is read.

結局、従来方式においては、分岐命令nのP6
ステージが終了してから、m+2の分岐先命令を
読み出す為のI1〜I3ステージが実行されるこ
とになる。この後に、該m+2命令のP1〜P6
のステージが実行されるので、第3図のタイムチ
ヤートから明らかな如く、m+1の命令から3サ
イクル遅れてしまうことになる。
After all, in the conventional method, P6 of branch instruction n
After the stage ends, stages I1 to I3 for reading the m+2 branch destination instruction will be executed. After this, P1 to P6 of the m+2 instruction
As it is clear from the time chart in FIG. 3, the stage is executed, so there will be a delay of three cycles from the instruction m+1.

従来方式は、分岐命令を実行して、分岐条件が
成立し、先行して読み出している分岐先命令の実
行タイミングについては問題ないが、キヤツシユ
メモリから、後続する8バイト先の分岐先命令を
読み出すタイミングが遅れる(具体的には、前述
のように、分岐命令の実行がP6ステージに達し
てから、I1ステージがスタートする)所に問題
がある。
In the conventional method, the branch instruction is executed, the branch condition is met, and there is no problem with the execution timing of the branch destination instruction that is read in advance, but the subsequent 8-byte branch destination instruction is read from the cache memory. The problem is that the read timing is delayed (specifically, as described above, the I1 stage starts after the execution of the branch instruction reaches the P6 stage).

上記のように、分岐先アドレスを分岐命令のP
6ステージ迄、ターゲツトレジスタP3TAR〜
P6TARによつて保持する必要があるのは、P
6ステージにおいて、該分岐命令実行中に割り込
みがあつたかどうかとか、演算結果のエラーチエ
ツクを行つているので、少なくとも該分岐命令が
パイプラインを抜ける迄は、IAR1Aの内容を変
えることができないことによる。
As above, set the branch destination address to P of the branch instruction.
Up to 6th stage, target register P3TAR~
What needs to be maintained by P6TAR is P
This is because the contents of IAR1A cannot be changed at least until the branch instruction exits the pipeline because in stage 6, an error check is performed on the operation result, such as whether an interrupt occurred during the execution of the branch instruction. .

このことは例えば、P6ステージでエラーが検
出された場合を考えると、該分岐命令の実行は無
効となるので、該命令をリトライする必要があ
り、リトライアドレスをIAR1Aから得ることが
必須条件となるからである。
For example, if an error is detected in the P6 stage, the execution of the branch instruction will be invalidated, so the instruction must be retried, and it is essential to obtain the retry address from IAR1A. It is from.

以上、従来方式の問題点を要約すると、従来方
式においては、命令の読み出しの為の命令アドレ
スレジスタと、パイプラインで実行中の命令のア
ドレスを示す命令アドレスレジスタとを共用して
いること、又パイプライン処理中に割り込み、エ
ラーが生じる可能性があるため、分岐命令の分岐
が決定した後でも、該分岐命令が完了する迄、何
等かの手段で、該分岐命令のアドレスを保持して
いなければならない為、分岐先の8バイト先の命
令の読み出しに時間遅れを生じることにある。
To summarize the problems of the conventional method, in the conventional method, the instruction address register for reading instructions and the instruction address register indicating the address of the instruction being executed in the pipeline are shared; Since there is a possibility that an interrupt or error may occur during pipeline processing, the address of the branch instruction must be retained by some means even after the branch instruction has been decided until the branch instruction is completed. This causes a time delay in reading the instruction 8 bytes ahead of the branch destination.

尚、リザルトレジスタ(RR)17からオア回
路19のルートは、例えばロードPSW(プログラ
ムステータス語)命令で分岐する時に用いられ
る。
Note that the route from the result register (RR) 17 to the OR circuit 19 is used, for example, when branching by a load PSW (program status word) instruction.

(d) 発明の目的 本発明は上記従来の欠点に鑑み、パイプライン
制御のデータ処理装置において、エラー時の再試
行を可能にした上で、分岐命令を実行し分岐を行
う時に必要な、分岐先アドレスの8バイト先の命
令を高速に読み出す方法を提供することを目的と
するものである。
(d) Purpose of the Invention In view of the above-mentioned drawbacks of the conventional art, the present invention provides a pipeline control data processing device that enables retry in the event of an error and provides a branching system that is necessary when executing a branch instruction and branching. The object of this invention is to provide a method for quickly reading an instruction 8 bytes ahead of a destination address.

(e) 発明の構成 そしてこの目的は、本発明によれば、命令読出
パイプラインと、各ステージの実行中の命令の操
作部を保持する複数の操作部レジスタと、分岐命
令実行時に分岐先命令のアドレスを各ステージで
保持する複数のターゲツトレジスタとを具備した
命令実行パイプラインとより成り、分岐命令実行
中に、分岐先アドレスが算定されると、分岐条件
成立前に分岐先命令を該算定アドレスにより命令
読出パイプラインで前記分岐命令の実行と並行し
て読出すようにしたパイプライン制御のデータ処
理装置において、命令読出パイプラインにより命
令を読出すための命令アドレスを保持する第1の
命令アドレスレジスタと、命令実行パイプライ
ンの最終ステージで実行中の命令のアドレスを保
持する第2の命令アドレスレジスタと、最終ス
テージの操作部レジスタの内容から最終ステージ
で実行中の命令の命令長を生成する命令長生成回
路と、第1の命令アドレスレジスタに対し、第
2の命令アドレスレジスタの内容、又は、分岐
命令の実行中に分岐条件成立時に該当ステージの
ターゲツトレジスタの内容の何れをセツトするか
を選択するOR回路を設け、一連のプログラムの
処理の開始時には、前記第1、第2の命令アドレ
スレジスタ,に同一の先頭命令のアドレスを
セツトし、以降は、第1の命令アドレスレジスタ
には、1ステージ進行する毎に定数を加算し
て、保持内容を次命令のアドレスに歩進させ、第
2の命令アドレスレジスタには、前記命令長生
成回路による命令長を最終ステージでの実行完了
時点で加算するようにし、最終ステージでの命令
実行中はパイプラインで実行中の最も古い命令の
アドレスを保持するようにし、分岐命令の実行中
に分岐条件が成立すると、該当ステージのターゲ
ツトレジスタの内容をOR回路を経て第1の命令
アドレスレジスタにセツトすること、並びに、
前記分岐条件成立時以外に命令シーケンスの変更
がある場合は、第2の命令アドレスレジスタの
内容をOR回路を経て第1の命令アドレスレジス
タにセツトして、新たなな命令シーケンスの命
令を読出すようにすることを特徴とするするパイ
プライン制御方式により達成され、命令の読み出
しの為の命令アドレスレジスタと、パイプライ
ンで実行中の命令のアドレスを示す命令アドレス
レジスタとを独立して持つため、エラー時の再
試行のための分岐命令のアドレスは、この命令の
実行の最終ステージで命令アドレスレジスタに
保持されるので、分岐命令の分岐が決定した時点
で、命令アドレスレジスタを更新することがで
き、分岐先の8バイト先の命令の読み出しに対す
る遅れをなくすることができる利点がある。
(e) Structure of the Invention According to the present invention, the present invention provides an instruction read pipeline, a plurality of operation unit registers that hold the operation unit of the instruction being executed in each stage, and a branch target instruction when executing a branch instruction. It consists of an instruction execution pipeline equipped with multiple target registers that hold addresses of addresses at each stage, and when a branch destination address is calculated during execution of a branch instruction, the branch destination instruction is In a pipeline-controlled data processing device that reads an instruction in parallel with the execution of the branch instruction in an instruction read pipeline based on an address, a first instruction that holds an instruction address for reading an instruction by the instruction read pipeline; Generates the instruction length of the instruction being executed in the final stage from the contents of the address register, the second instruction address register that holds the address of the instruction being executed in the final stage of the instruction execution pipeline, and the final stage operation register. and an instruction length generation circuit to set the first instruction address register to either the contents of the second instruction address register or the contents of the target register of the corresponding stage when the branch condition is met during execution of a branch instruction. At the start of processing a series of programs, the address of the same first instruction is set in the first and second instruction address registers, and thereafter, the address of the same first instruction is set in the first instruction address register. , a constant is added every time one stage progresses, and the held contents are incremented to the address of the next instruction, and the second instruction address register stores the instruction length by the instruction length generation circuit at the time of completion of execution in the final stage. During instruction execution in the final stage, the address of the oldest instruction being executed in the pipeline is held, and if a branch condition is met during execution of a branch instruction, the contents of the target register of the relevant stage are added. is set in the first instruction address register via an OR circuit, and
If there is a change in the instruction sequence other than when the branch condition is met, the contents of the second instruction address register are set to the first instruction address register via the OR circuit, and the instructions of the new instruction sequence are read. This is achieved by a pipeline control method characterized by The address of the branch instruction for retry on error is held in the instruction address register during the final stage of execution of this instruction, so the instruction address register can be updated when the branch instruction is decided to branch. , there is an advantage that a delay in reading an instruction 8 bytes ahead of the branch destination can be eliminated.

(f) 発明の実施例 本発明の主旨を要約すると、本発明は命令の読
み出しの為の命令アドレスレジスタと、パイプ
ラインで実行中の命令のアドレスを示す命令アド
レスレジスタとを独立して持たせ、分岐命令の
アドレスは、該命令がパイプラインを抜け出す
迄、命令アドレスレジスタで保持しておき、該
分岐命令の分岐が決定した時点で、命令アドレス
レジスタを更新することができるようにし、分
岐先の8バイト先の命令の読み出しに対する遅れ
をなくするようにしたものである。
(f) Embodiments of the Invention To summarize the gist of the present invention, the present invention independently provides an instruction address register for reading instructions and an instruction address register indicating the address of the instruction being executed in the pipeline. The address of the branch instruction is held in the instruction address register until the instruction exits the pipeline, and when the branching of the branch instruction is determined, the instruction address register can be updated and the branch destination This eliminates the delay in reading an instruction 8 bytes ahead of the 8 bytes.

以下本発明の実施例を図面によつて詳述する。
第2図が本発明の一実施例をブロツク図で示した
図であり、第4図が第2図の実施例で、分岐命令
を実行した場合の動作をタイムチヤートで示した
図である。
Embodiments of the present invention will be described in detail below with reference to the drawings.
FIG. 2 is a block diagram showing one embodiment of the present invention, and FIG. 4 is a time chart showing the operation of the embodiment of FIG. 2 when a branch instruction is executed.

第2図において、1A,1B,2A,2C,3
〜19は第1図で説明したものと同じものであ
り、20〜22が本発明を実施するのに必要な論
理ブロツクで、上記のパイプラインで実行中の命
令のアドレスを示す命令アドレスレジスタを構
成する。即ち、20は命令長生成回路(ILC)、
21は命令アドレスレジスタ(IAR)、22
は加算器Dである。
In Figure 2, 1A, 1B, 2A, 2C, 3
1 to 19 are the same as those explained in FIG. 1, and 20 to 22 are logic blocks necessary to implement the present invention. Configure. That is, 20 is an instruction length generation circuit (ILC),
21 is an instruction address register (IAR), 22
is the adder D.

本発明を実施した場合の、他の特徴となる上記
命令の読み出しの為の命令アドレスレジスタ
(IAR)は、第1図で説明した1A,1B,2
Aで構成されている。
When the present invention is implemented, the instruction address registers (IAR) for reading the above-mentioned instructions, which are other features, are 1A, 1B, and 2 as explained in FIG.
It is composed of A.

このように、本発明を実施した場合、命令アド
レスレジスタと、命令アドレスレジスタとが
独立に構成されている所にポイントがある。
As described above, when the present invention is implemented, the point is that the instruction address register and the instruction address register are configured independently.

本発明を実施した場合の一般的なパイプライン
動作については、従来と同じであるので、説明は
省略し、分岐命令を実行した場合の効果を中心
に、第4図のタイムチヤートを参照しながら実施
例の説明を行う。
The general pipeline operation when implementing the present invention is the same as the conventional one, so the explanation will be omitted, and we will focus on the effect of executing a branch instruction, with reference to the time chart in Figure 4. An example will be explained.

本発明を実施した場合においても、最初本デー
タ処理装置のパイプラインの11ステージにおい
て、サービスプロセツサー(図示せず)から、2
つの命令アドレスレジスタ,〔IAR()1
A,IAR()21〕に、これから実行するプロ
グラムの先頭アドレスがセツトされる。
Even when the present invention is implemented, in the 11th stage of the pipeline of the present data processing device, the service processor (not shown)
two instruction address registers, [IAR()1
A, IAR()21] is set to the start address of the program to be executed from now on.

そして、命令アドレスレジスタ(IAR)1
Aは従来方式と同じ動作となるが、命令アドレス
レジスタ(IAR)21においては、パイプラ
インのP6ステージにおいて、1つの命令の実行
が完了する毎に、該命令の命令長が命令長生成回
路(ILC)20において生成され、命令アドレス
レジスタ(IAR)に加算されるように動作す
るので、この加算動作が行われる迄は、該パイプ
ラインで実行される命令の最も古い命令のアドレ
スを保持していることになる。
and instruction address register (IAR) 1
A has the same operation as the conventional method, but in the instruction address register (IAR) 21, each time the execution of one instruction is completed in the P6 stage of the pipeline, the instruction length of the instruction is determined by the instruction length generation circuit ( ILC) 20 and is added to the instruction address register (IAR), so until this addition operation is performed, the address of the oldest instruction executed in the pipeline is held. There will be.

従つて、分岐命令が実行される場合において
も、該分岐命令がパイプラインが抜け出す迄、命
令アドレスレジスタ(IAR)21に該分岐命
令のアドレスが保持されている。
Therefore, even when a branch instruction is executed, the address of the branch instruction is held in the instruction address register (IAR) 21 until the branch instruction leaves the pipeline.

以下、第1図、第3図での説明と同じように、
分岐命令をn、分岐先命令をm,m+1,m+2
として説明する。
Below, in the same way as the explanation in Figures 1 and 3,
Branch instruction is n, branch destination instruction is m, m+1, m+2
It will be explained as follows.

先ず、IWR5に読み出された命令(nで示す)
が分岐命令であると、加算器(B)12で計算された
オペランドアドレスが分岐先のアドレスを示すこ
とになり、P3〜P6の各ステージのターゲツト
レジスタP3TAR〜P6TARに蓄積、シフトさ
れると共に、P2ステージ(該分岐先命令につい
ては、I1ステージ)において、オア回路2Cを
通してEAR3にセツトされ、キヤツシユメモリ
4をアクセスして、分岐先命令(m,m+1……
で示す)が読み出される。
First, the instruction read to IWR5 (indicated by n)
If is a branch instruction, the operand address calculated by the adder (B) 12 indicates the branch destination address, and is accumulated and shifted in the target registers P3TAR to P6TAR of each stage of P3 to P6, and At the P2 stage (I1 stage for the branch destination instruction), the branch destination instruction (m, m+1...) is set to EAR3 through the OR circuit 2C, and the cache memory 4 is accessed.
) is read out.

そして、P4ステージにおいて、該分岐命令の
一つ前の命令(n−1)の演算が行われており
(即ち、P5ステージ)、その演算結果によつて、
分岐条件が成立すると、上記アクセスされている
分岐命令が、I3ステージの終わりのタイミング
で、IWR5に読み出され、続いて該分岐先命令
のP1〜P6の各ステージの実行が行われる。
Then, in the P4 stage, the operation of the instruction (n-1) immediately before the branch instruction is performed (that is, the P5 stage), and based on the result of the operation,
When the branch condition is met, the accessed branch instruction is read out to IWR5 at the end of the I3 stage, and then each stage of P1 to P6 of the branch destination instruction is executed.

第4図のタイムチヤートにおいて、該分岐先命
令(但し、この時読み出された命令は、2個の4
バイト命令とする)のパイプラインでの動作(P
1〜P6ステージ)をm,m+1で示している。
In the time chart of FIG. 4, the branch destination instruction (however, the instruction read at this time is
Byte instruction) operation in the pipeline (P
1 to P6 stages) are indicated by m and m+1.

本図から明らかな如く、ここ迄の動作は従来方
式と同じである。
As is clear from this figure, the operation up to this point is the same as the conventional system.

後続する分岐先命令m+2を読み出す場合、本
発明においては、分岐命令nのP4ステージにお
いて、ターゲツトレジスタP4TARに蓄積され
ている分岐先アドレスが、オア回路23を通して
IAR()1Aにセツトされ、分岐先命令m+2
のI1ステージにおいて加算器(A)2AでIFKR1
Bの値(“8”)が加算され、分岐先命令mのアド
レスの8バイト先の実行アドレスが、I2ステー
ジでEAR3にセツトされるように動作する。
When reading the subsequent branch destination instruction m+2, in the present invention, the branch destination address stored in the target register P4TAR is read through the OR circuit 23 at the P4 stage of the branch instruction n.
IAR() is set to 1A, branch destination instruction m+2
In the I1 stage of the adder (A) 2A, IFKR1
The value of B ("8") is added, and the execution address 8 bytes ahead of the address of the branch destination instruction m is set to EAR3 at the I2 stage.

従つて、本発明を実施した場合、分岐命令のP
4ステージが終了した時点において、m+2の分
岐先命令を読み出す為のI1〜I3ステージの実
行が開始されるので、分岐先命令m,m+1の読
み出し動作(即ち、I1〜I3ステージ)と、該
分岐先命令mの8バイト先の命令m+2の読み出
し動作(I1〜I3ステージ)との間に遅れを生
じない。そして、この後該m+2命令のP1〜P
6のステージが実行されるので、第4図のタイム
チヤートから明らかな如く、m+1の命令からの
遅れは、1サイクルに削減されることになる。
Therefore, when the present invention is implemented, the branch instruction P
At the end of the 4th stage, the execution of stages I1 to I3 for reading the branch destination instruction m+2 is started, so the read operation of branch destination instructions m and m+1 (i.e. stage I1 to I3) and the branch destination instruction m+2 are started. There is no delay between the reading operation (stages I1 to I3) of the instruction m+2 which is 8 bytes ahead of the previous instruction m. Then, after this, P1 to P of the m+2 instruction
Since six stages are executed, the delay from the m+1 instruction is reduced to one cycle, as is clear from the time chart of FIG.

上記のように、本発明を実施した場合、分岐命
令nのP4ステージで、分岐先命令m+2を読み
出す為のI1〜I3ステージを実行を開始する為
に、IAR()1Aにm+2命令のアドレスをセ
ツトし、分岐命令nのアドレスを壊しているが、
前述のように該分岐命令がP6ステージを抜け出
す迄、該分岐命令のアドレスが、命令アドレスレ
ジスタ(IAR)21に保持されているので、
従来方式において説明したように、上記P6ステ
ージでエラーが検出され、該分岐命令をリトライ
する必要が生じても、上記命令アドレスレジスタ
(IAR)21の内容を、加算器(D)22、オア
回路19,23を通して、命令アドレスレジスタ
(IAR)1Aに再セツトすることにより、該
命令の再読み出しができるので問題は起こらな
い。ここに、本発明のポイントがある。
As described above, when the present invention is implemented, in order to start executing the I1 to I3 stages for reading the branch destination instruction m+2 at the P4 stage of the branch instruction n, the address of the m+2 instruction is set in IAR()1A. set and destroy the address of branch instruction n, but
As mentioned above, the address of the branch instruction is held in the instruction address register (IAR) 21 until the branch instruction exits the P6 stage.
As explained in the conventional method, even if an error is detected at the P6 stage and it becomes necessary to retry the branch instruction, the contents of the instruction address register (IAR) 21 are transferred to the adder (D) 22 and the OR circuit. No problem occurs because the instruction can be reread by resetting the instruction address register (IAR) 1A through 19 and 23. This is the key point of the present invention.

(g) 発明の効果 以上、詳細に説明したように、本発明のパイプ
ライン制御方式は、命令の読み出しの為の命令ア
ドレスレジスタと、パイプラインの最終ステー
ジで実行中の命令のアドレスを示す命令アドレス
レジスタとを独立して持たせ、エラー時の再試
行に備えるための分岐命令のアドレスは、該命令
がパイプラインを抜け出す迄、命令アドレスレジ
スタに保持しておき、該分岐命令の分岐が決定
した時点で、命令アドレスレジスタを更新する
ことができるようにし、分岐先の8バイト先の命
令の読み出しに対する遅れをなくするように制御
されるので、分岐命令を実行し、分岐条件が成立
した時でも、パイプライン中で発生するサイクル
ロスを少なくすることができ、分岐命令を高速化
できる効果がある。
(g) Effects of the Invention As explained above in detail, the pipeline control method of the present invention has an instruction address register for reading instructions and an instruction register indicating the address of the instruction being executed in the final stage of the pipeline. The address of the branch instruction is kept independent from the address register, and the address of the branch instruction is held in the instruction address register until the instruction leaves the pipeline, and the branch of the branch instruction is determined. When the branch instruction is executed and the branch condition is met, the instruction address register can be updated and the delay in reading the instruction 8 bytes ahead of the branch destination is eliminated. However, it has the effect of reducing the cycle loss that occurs in the pipeline and speeding up branch instructions.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は従来方式のパイプライン動作を模式的
に示した図、第2図は本発明を実施した場合のパ
イプライン動作を模式的に示した図、第3図は従
来方式のパイプラインにおいて、分岐命令を実行
した場合の動作をタイムチヤートで示した図、第
4図は本発明を実施したパイプラインにおいて、
分岐命令を実行した場合の動作をタイムチヤート
で示した図である。 図面において、1は命令フエツチ制御部
(IFC)、1Aは命令アドレスレジスタ(IAR)、
命令アドレスレジスタ(IAR)、1Bは命令
フエツチコンスタントレジスタ(IFKR)、1C
はカウンタ(CTR)、2A,2B,12,22は
加算器(A,C,B,D)、3は実行アドレスレ
ジスタ(EAR)、4はキヤツシユメモリ、5は命
令語レジスタ(IWR)、6はセレクタ、7は汎用
レジスタ、8は操作部レジスタ(P2OP〜P6
OP)、18はターゲツトレジスタ(P3TAR〜
P6TAR)、20は命令長生成回路(ILC)、2
1は命令アドレスレジスタ(IAR)、をそれ
ぞれ示す。
Fig. 1 is a diagram schematically showing the pipeline operation of the conventional method, Fig. 2 is a diagram schematically showing the pipeline operation when the present invention is implemented, and Fig. 3 is a diagram schematically showing the pipeline operation of the conventional method. , a time chart showing the operation when a branch instruction is executed.
FIG. 3 is a time chart showing the operation when a branch instruction is executed. In the drawing, 1 is an instruction fetch control unit (IFC), 1A is an instruction address register (IAR),
Instruction address register (IAR), 1B is instruction fetch constant register (IFKR), 1C
is a counter (CTR), 2A, 2B, 12, 22 are adders (A, C, B, D), 3 is an execution address register (EAR), 4 is a cache memory, 5 is an instruction word register (IWR), 6 is a selector, 7 is a general-purpose register, and 8 is an operation register (P2OP to P6
OP), 18 is the target register (P3TAR~
P6TAR), 20 is the instruction length generation circuit (ILC), 2
1 indicates an instruction address register (IAR).

Claims (1)

【特許請求の範囲】 1 命令読出パイプラインと、各ステージの実行
中の命令の操作部を保持する複数の操作部レジス
タと、分岐命令実行時に分岐先命令のアドレスを
各ステージで保持する複数のターゲツトレジスタ
とを具備した命令実行パイプラインとより成り、 分岐命令実行中に、分岐先アドレスが算定され
ると、分岐条件成立前に分岐先命令を該算定アド
レスにより命令読出パイプラインで前記分岐命令
の実行と並行して読出すようにしたパイプライン
制御のデータ処理装置において、 命令読出パイプラインにより命令を読出すため
の命令アドレスを保持する第1の命令アドレスレ
ジスタと、命令実行パイプラインの最終ステージ
で実行中の命令のアドレスを保持する第2の命令
アドレスレジスタと、最終ステージの操作部レジ
スタの内容から最終ステージで実行中の命令の命
令長を生成する命令長生成回路と、第1の命令ア
ドレスレジスタに対し、第2の命令アドレスレジ
スタの内容、又は、分岐命令の実行中に分岐条件
成立時に該当ステージのターゲツトレジスタの内
容の何れをセツトするかを選択するOR回路を設
け、 一連のプログラムの処理の開始時には、前記第
1、第2の命令アドレスレジスタに同一の先頭命
令のアドレスをセツトし、以降は、第1の命令ア
ドレスレジスタには、1ステージ進行する毎に定
数を加算して、保持内容を次命令のアドレスに歩
進させ、第2の命令アドレスレジスタには、前記
命令長生成回路による命令長を最終ステージでの
実行完了時点で加算するようにし、最終ステージ
での命令実行中はパイプラインで実行中の最も古
い命令のアドレスを保持するようにし、 分岐命令の実行中に分岐条件が成立すると、該
当ステージのターゲツトレジスタの内容をOR回
路を経て第1の命令アドレスレジスタにセツトす
ること、並びに、前記分岐条件成立時以外に命令
シーケンスの変更がある場合は、第2の命令アド
レスレジスタの内容をOR回路を経て第1の命令
アドレスレジスタにセツトして、新たなな命令シ
ーケンスの命令を読出すようにすることを特徴と
するパイプライン制御方式。
[Claims] 1. An instruction read pipeline, a plurality of operation unit registers that hold the operation unit of the instruction being executed at each stage, and a plurality of operation unit registers that hold the address of the branch destination instruction at each stage when a branch instruction is executed. When a branch destination address is calculated during execution of a branch instruction, the branch destination instruction is transferred to the instruction read pipeline using the calculated address before the branch condition is satisfied. In a pipeline-controlled data processing device that performs reading in parallel with the execution of an instruction, there is a first instruction address register that holds an instruction address for reading an instruction by an instruction read pipeline, and a first instruction address register that holds an instruction address for reading an instruction by an instruction read pipeline; a second instruction address register that holds the address of the instruction being executed in the stage; an instruction length generation circuit that generates the instruction length of the instruction being executed in the final stage from the contents of the operation unit register in the final stage; An OR circuit is provided for the instruction address register to select whether to set the contents of the second instruction address register or the contents of the target register of the corresponding stage when the branch condition is met during execution of a branch instruction. At the start of program processing, the address of the same first instruction is set in the first and second instruction address registers, and from then on, a constant is added to the first instruction address register every time one stage progresses. The stored content is incremented to the address of the next instruction, and the instruction length generated by the instruction length generation circuit is added to the second instruction address register at the time of completion of execution in the final stage. During execution, the address of the oldest instruction being executed in the pipeline is held, and when a branch condition is met during execution of a branch instruction, the contents of the target register of the corresponding stage are transferred to the first instruction address register via an OR circuit. In addition, if there is a change in the instruction sequence other than when the branch condition is met, the contents of the second instruction address register are set to the first instruction address register via the OR circuit, and a new instruction is issued. A pipeline control method characterized by reading instructions in an instruction sequence.
JP58212021A 1983-11-11 1983-11-11 Pipeline control system Granted JPS60105050A (en)

Priority Applications (7)

Application Number Priority Date Filing Date Title
JP58212021A JPS60105050A (en) 1983-11-11 1983-11-11 Pipeline control system
BR8407165A BR8407165A (en) 1983-11-11 1984-11-08 CHANNEL CONTROL SYSTEM
AU36122/84A AU560378B2 (en) 1983-11-11 1984-11-08 Method of controlling pipeline
EP84904162A EP0163740B1 (en) 1983-11-11 1984-11-08 Pipeline control system
PCT/JP1984/000535 WO1985002279A1 (en) 1983-11-11 1984-11-08 Method of controlling pipeline
DE8484904162T DE3478157D1 (en) 1983-11-11 1984-11-08 Pipeline control system
US06/758,665 US4802113A (en) 1983-11-11 1984-11-08 Pipeline control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58212021A JPS60105050A (en) 1983-11-11 1983-11-11 Pipeline control system

Publications (2)

Publication Number Publication Date
JPS60105050A JPS60105050A (en) 1985-06-10
JPS638492B2 true JPS638492B2 (en) 1988-02-23

Family

ID=16615557

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58212021A Granted JPS60105050A (en) 1983-11-11 1983-11-11 Pipeline control system

Country Status (1)

Country Link
JP (1) JPS60105050A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2534662B2 (en) * 1986-03-25 1996-09-18 日本電気株式会社 Instruction cache control method
CA2006732C (en) 1988-12-27 1994-05-03 Tsuyoshi Mori Control system for fetching an instruction

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6058489B2 (en) * 1980-07-31 1985-12-20 富士通株式会社 Branch instruction advance control method
JPS5731052A (en) * 1980-07-31 1982-02-19 Fujitsu Ltd Job control system
JPS5848144A (en) * 1981-09-16 1983-03-22 Nec Corp Branch instruction control system of data processor

Also Published As

Publication number Publication date
JPS60105050A (en) 1985-06-10

Similar Documents

Publication Publication Date Title
KR100260353B1 (en) Processor for executing two kinds of instruction code and its input device
US5206940A (en) Address control and generating system for digital signal-processor
US5247627A (en) Digital signal processor with conditional branch decision unit and storage of conditional branch decision results
CA1288169C (en) Digital signal processor
US5611061A (en) Method and processor for reliably processing interrupt demands in a pipeline processor
US5117490A (en) Pipelined data processor with parameter files for passing parameters between pipeline units
JPS589455B2 (en) Microprogrammed data processing system with multiple length address configuration
JPH0545985B2 (en)
EP0357188B1 (en) Pipelined processor
US5978905A (en) Program translating apparatus and a processor which achieve high-speed execution of subroutine branch instructions
EP0163740B1 (en) Pipeline control system
EP0094535B1 (en) Pipe-line data processing system
US5237667A (en) Digital signal processor system having host processor for writing instructions into internal processor memory
EP0201833A2 (en) Instruction processor
US4977496A (en) Branching control system
US5222241A (en) Digital signal processor having duplex working registers for switching to standby state during interrupt processing
JPS638492B2 (en)
KR900005340B1 (en) Pipeline control system
GB2126384A (en) Branch instructions in digital computers
JPS60231241A (en) Program advance fetch control system
JP2824484B2 (en) Pipeline processing computer
JP2812610B2 (en) Pipeline control method
JP3102399B2 (en) Data processing apparatus and method
JP3147884B2 (en) Storage device and information processing device
KR20010022065A (en) A method and a processor adapted for the handling of conditional jumps