[go: up one dir, main page]

JPH07319693A - Pipeline processing method - Google Patents

Pipeline processing method

Info

Publication number
JPH07319693A
JPH07319693A JP11621394A JP11621394A JPH07319693A JP H07319693 A JPH07319693 A JP H07319693A JP 11621394 A JP11621394 A JP 11621394A JP 11621394 A JP11621394 A JP 11621394A JP H07319693 A JPH07319693 A JP H07319693A
Authority
JP
Japan
Prior art keywords
instruction
stage
data
cache
read
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.)
Pending
Application number
JP11621394A
Other languages
Japanese (ja)
Inventor
Yuji Suzuki
裕司 鈴木
Kakuji Saitou
拡二 斎藤
Genichi Takeda
元一 武田
Kenji Matsubara
健二 松原
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP11621394A priority Critical patent/JPH07319693A/en
Publication of JPH07319693A publication Critical patent/JPH07319693A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

(57)【要約】 【目的】命令をパイプライン処理するパイプライン処理
装置において、ロード命令と該ロード命令の次に実行す
べき命令との間にデータ依存関係がある場合に、次命令
の演算待ち時間を短縮する。 【構成】ロード命令のキャッシュのヒット判定が判明す
る前にキャッシュからのデータをロード命令の次に実行
する命令に送り先行して演算を実行させる。ロード命令
がキャッシュミスとなった場合には次命令を演算ステー
ジの前のステージに戻す。次命令を演算ステージの前の
ステージに戻す動作はロード命令のキャッシュミスによ
って発生するブロック転送中に行う。 【効果】本発明によればロード命令の次の命令の演算待
ち時間が短縮されるのでパイプライン処理装置の処理速
度を向上させることができる。またデータ読み出しステ
ージとヒット判定が判明するステージが離れた場合でも
ペナルティ増加とはならず処理速度の低下を防ぐことが
できる。
(57) [Abstract] [Purpose] In a pipeline processing device that pipelines an instruction, if a load instruction and an instruction to be executed next to the load instruction have a data dependency relationship, the operation of the next instruction is performed. Reduce waiting time. [Structure] Before the cache hit judgment of the load instruction is known, the data from the cache is sent to the instruction to be executed next to the load instruction to execute the operation in advance. When the load instruction causes a cache miss, the next instruction is returned to the stage before the operation stage. The operation of returning the next instruction to the stage before the operation stage is performed during the block transfer generated by the cache miss of the load instruction. According to the present invention, since the operation waiting time of the instruction following the load instruction is shortened, the processing speed of the pipeline processing device can be improved. Further, even when the data read stage and the stage where the hit judgment is known are separated, the penalty does not increase and the processing speed can be prevented from decreasing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、各命令を複数のステー
ジに分割してパイプライン処理するパイプライン処理装
置において、ロード命令により読み出されたデータを他
の命令に高速で渡して処理するパイプライン処理装置に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention, in a pipeline processing apparatus for dividing each instruction into a plurality of stages and performing pipeline processing, passes data read by a load instruction to other instructions at high speed for processing. The present invention relates to a pipeline processing device.

【0002】[0002]

【従来の技術】従来のパイプライン処理装置では、各命
令は、命令読み出しステージ(IFステージ)、命令デ
コードステージ(Dステージ)、命令演算ステージ(E
ステージ)、メモリアクセスステージ(Aステージ)、
命令キャンセルステージ(Nステージ)、書き込みステ
ージ(Wステージ)の6つのステージに分割されて処理
される。
2. Description of the Related Art In a conventional pipeline processing apparatus, each instruction has an instruction read stage (IF stage), an instruction decode stage (D stage), and an instruction operation stage (E).
Stage), memory access stage (A stage),
The processing is divided into six stages, that is, an instruction cancel stage (N stage) and a write stage (W stage).

【0003】図8に従来のパイプライン処理装置の構成
図を示す。
FIG. 8 shows a block diagram of a conventional pipeline processing apparatus.

【0004】各ステージにはそれぞれのステージのアド
レス、データ及命令を保持する保持回路2、3、4、
5、6、7、14、16、19、10、26を備え、I
Fステージにはプログラムのカウントを行うプログラム
カウンタ8を備え、Dステージには先行命令とのデータ
依存関係を検出する検出回路24を備え、Eステージに
は命令の演算を行う演算装置15を備え、Nステージに
はデータキャッシュ17のヒット判定を行う判定回路2
0を備えている。命令はIFステージで命令キャッシュ
メモリ9から読み出しが行われ、データはAステージで
データキャッシュメモリ17から読み出しが行われる。
またレジスタファイル21からの読み出しはDステージ
で行われ、レジスタファイル21への書き込みはWステ
ージで行われる。さらにNステージとDステージの間に
はデータキャッシュ17から読み出されたデータを送る
バイパス119が設けられている。
Each stage has a holding circuit 2, 3, 4, for holding the address, data and instruction of each stage.
5, 6, 7, 14, 16, 19, 10, 26, and I
The F stage is provided with a program counter 8 for counting a program, the D stage is provided with a detection circuit 24 for detecting a data dependency relationship with a preceding instruction, and the E stage is provided with an arithmetic unit 15 for performing instruction arithmetic. The determination circuit 2 for determining the hit of the data cache 17 in the N stage
It has 0. The instruction is read from the instruction cache memory 9 in the IF stage, and the data is read from the data cache memory 17 in the A stage.
Further, reading from the register file 21 is performed at the D stage, and writing to the register file 21 is performed at the W stage. Further, a bypass 119 for sending the data read from the data cache 17 is provided between the N stage and the D stage.

【0005】図2の命令列は、まず第1の命令であるロ
ード命令がレジスタxのデータとレジスタbのデータを
加算し、該加算結果をデータキャッシュの読み出しアド
レスとして該アドレスにあるデータをレジスタr1に読
み出し、次に第2の命令である加算命令がレジスタr1
のデータとレジスタr2のデータを加算し、該加算結果
をレジスタtに書き込むという動作を行うものである。
ここで第1の命令と第2の命令はレジスタr1を介して
データの依存関係がある。
In the instruction sequence shown in FIG. 2, first, a load instruction, which is the first instruction, adds the data in register x and the data in register b, and the addition result is used as the read address of the data cache to register the data at that address. Then, the second instruction, that is, the add instruction, is read to the register r1.
And the data in the register r2 are added, and the addition result is written in the register t.
Here, the first instruction and the second instruction have a data dependency relationship via the register r1.

【0006】図9には従来技術に従うパイプライン処理
装置において、図2の命令列が処理される場合に第1の
命令であるロード命令がキャッシュヒットした場合のタ
イムチャートが示してあり、図10には第1の命令であ
るロード命令がキャッシュミスした場合のタイムチャー
トが示してある。
FIG. 9 shows a time chart in the case where the load instruction which is the first instruction causes a cache hit when the instruction sequence of FIG. 2 is processed in the pipeline processing apparatus according to the prior art, and FIG. Shows a time chart when the load instruction which is the first instruction causes a cache miss.

【0007】以下、図面に基づいて図2の命令列を例と
して従来のパイプライン処理装置の具体的動作について
示す。
The concrete operation of the conventional pipeline processing apparatus will be described below with reference to the drawings by taking the instruction sequence of FIG. 2 as an example.

【0008】まず第1の命令であるロード命令がIFス
テージで命令キャッシュ9から読み出される。次に第1
の命令であるロード命令はDステージでレジスタファイ
ル21からレジスタxのデータとレジスタbのデータを
それぞれデータ線131、110に読み出し、選択回路
12、13でそれぞれデータ線131、110を選択し
データ線111、112に出力する。このとき第2の命
令である加算命令がIFステージで命令キャッシュ9か
ら読み出される。第1の命令であるロード命令はEステ
ージでデータ111、112を用いて演算装置15で加
算を実行し、データキャッシュの読み出しアドレス11
5を出力する。このとき第2の命令である加算命令はD
ステージでレジスタファイル21からレジスタr1のデ
ータとレジスタr2のデータをそれぞれデータ線13
1、110に読み出している。ここで図2に示すように
第1の命令であるロード命令と第2の命令である加算命
令との間ではレジスタr1を介してデータの依存関係が
あるので、検出回路24でデータ依存関係があることが
検出される。依存関係があることが検出されると第2の
命令である加算命令は、この時点では第1の命令である
ロード命令によってレジスタr1はまだ更新されていな
いので、レジスタr1のデータが読み出されているデー
タ線131には古いデータが出力されていることになる
ため、命令演算ステージであるEステージには送られず
直前のDステージでステージロック信号129によって
保持される。第1の命令であるロード命令はデータ依存
関係の有無にかかわらず引き続き処理され、Aステージ
でEステージからの出力結果115を用いて、データキ
ャッシュ読み出しアドレス116としデータキャッシュ
17からデータ117を読み出し、選択回路27でデー
タ117を選択しNステージデータ保持回路19に送
り、またデータアドレスタグ18とデータTLB28か
らはそれぞれ物理アドレス118、133を読み出し、
第1の命令であるロード命令のキャッシュのヒット判定
を行うヒット判定回路20まで送る。
First, the load instruction which is the first instruction is read from the instruction cache 9 in the IF stage. Then the first
In the D stage, the load instruction, which is the instruction of, reads out the data of the register x and the data of the register b from the register file 21 to the data lines 131 and 110, respectively, and selects the data lines 131 and 110 by the selection circuits 12 and 13, respectively. Output to 111 and 112. At this time, the add instruction which is the second instruction is read from the instruction cache 9 in the IF stage. The load instruction, which is the first instruction, performs addition in the arithmetic unit 15 using the data 111 and 112 at the E stage, and the read address 11 of the data cache.
5 is output. At this time, the addition instruction which is the second instruction is D
At the stage, the data of the register r1 and the data of the register r2 are respectively transferred from the register file 21 to the data line 13
1, 110 are read. Here, as shown in FIG. 2, since there is a data dependency relationship between the load instruction which is the first instruction and the addition instruction which is the second instruction via the register r1, the data dependency relationship is detected in the detection circuit 24. Is detected. When it is detected that there is a dependency, the add instruction which is the second instruction reads the data in the register r1 because the register r1 has not been updated by the load instruction which is the first instruction at this point. Since the old data has been output to the data line 131 that is in operation, the data is not sent to the E stage, which is the instruction operation stage, and is held by the stage lock signal 129 at the immediately preceding D stage. The load instruction, which is the first instruction, is continuously processed regardless of the presence or absence of data dependency, and the output result 115 from the E stage is used in the A stage to read the data 117 from the data cache 17 as the data cache read address 116. The selection circuit 27 selects the data 117 and sends it to the N stage data holding circuit 19, and reads the physical addresses 118 and 133 from the data address tag 18 and the data TLB 28, respectively.
It is sent to the hit determination circuit 20 which determines the cache hit of the load instruction which is the first instruction.

【0009】ここでまず第1の命令であるロード命令が
Nステージでヒット判定回路20によってキャッシュヒ
ットと判明した場合には、ステージロック信号129は
解除され、Nステージにはキャッシュメモリ17から有
効なデータが読み出されていることになる。第1の命令
であるロード命令は該有効データを直ちにNステージか
らバイパス119を通してDステージに送る。また該ロ
ード命令はレジスタr1に有効データ119をWステー
ジで書き込む。第2の命令である加算命令は、Nステー
ジからレジスタr1に相当する有効なデータ119が送
られてくると、送られてきた該データ119を選択回路
12で選択しデータ線111に出力するとともに、すで
にDステージでレジスタファイル21から読み出されて
いるレジスタr2のデータ110を選択回路13で選択
しデータ線112に出力する。第2の命令である加算命
令はEステージで、Dステージからの出力データ11
1、112を用いて演算装置15で加算を実行し、加算
結果115を出力する。そしてNステージで加算結果で
あるデータ116を選択回路27で選択しWステージで
レジスタtに該加算結果を書き込む。
Here, when the load instruction which is the first instruction is found to be a cache hit by the hit determination circuit 20 in the N stage, the stage lock signal 129 is released, and the cache memory 17 is valid for the N stage. The data has been read. The first instruction, the load instruction, immediately sends the valid data from the N stage to the D stage through the bypass 119. The load instruction also writes the valid data 119 to the register r1 at the W stage. When the valid data 119 corresponding to the register r1 is sent from the N stage, the add instruction which is the second instruction selects the sent data 119 by the selection circuit 12 and outputs it to the data line 111. , The data 110 of the register r2 already read from the register file 21 at the D stage is selected by the selection circuit 13 and output to the data line 112. The add instruction, which is the second instruction, is the E stage and the output data 11 from the D stage.
The arithmetic unit 15 performs addition using 1 and 112, and outputs the addition result 115. Then, at the N stage, the data 116 as the addition result is selected by the selection circuit 27, and at the W stage, the addition result is written in the register t.

【0010】従来技術に従うパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュヒットし
た場合、第2の命令である加算命令は2サイクルペナル
ティとなる。
When a load instruction which is the first instruction causes a cache hit in the pipeline processing device according to the conventional technique, the addition instruction which is the second instruction has a penalty of two cycles.

【0011】一方第1の命令であるロード命令がNステ
ージでキャッシュミスと判明した場合には、Nステージ
にはキャッシュメモリ17から無効なデータが読み出さ
れているので、該ロード命令は有効なデータをNステー
ジに読み出すためにブロック転送を行い、ブロック転送
中はステージロック信号126によりNステージで保持
される。第2の命令である加算命令は、ブロック転送に
よって有効なデータがNステージに読み出されるまでス
テージロック信号129により引き続きDステージで保
持される。キャッシュミスが判明してから複数サイクル
の後ブロック転送が終了すると、各ステージロック信号
126、129は解除され、第1の命令であるロード命
令が存在するNステージには有効なデータが読み出され
ている。第1の命令であるロード命令は有効なデータが
Nステージに読み出されると、該有効データをバイパス
119を通してNステージからDステージに送る。また
該ロード命令はWステージでレジスタr1に有効データ
119を書き込む。第2の命令である加算命令は、Nス
テージからDステージに有効なデータ119が送られて
くると、送られてきた該データ119を選択回路12で
選択しデータ線111に出力するとともに、すでにDス
テージでレジスタファイル21から読み出されているレ
ジスタr2のデータ110を選択回路13で選択しデー
タ線112に出力する。第2の命令である加算命令はE
ステージで、Dステージからの出力データ111、11
2を用いて演算装置15で加算を実行し、加算結果11
5を出力する。そしてNステージで加算結果であるデー
タ116を選択回路27で選択しWステージでレジスタ
tに該加算結果を書き込む。
On the other hand, when the load instruction, which is the first instruction, is found to be a cache miss in the N stage, invalid data is read from the cache memory 17 in the N stage, so the load instruction is valid. Block transfer is performed to read data to the N stage, and the block is held in the N stage by the stage lock signal 126 during the block transfer. The add instruction, which is the second instruction, is continuously held in the D stage by the stage lock signal 129 until valid data is read to the N stage by the block transfer. When the block transfer is completed after a plurality of cycles after the cache miss is found, the stage lock signals 126 and 129 are released, and valid data is read out to the N stage where the load instruction which is the first instruction exists. ing. The first instruction, the load instruction, sends valid data from the N stage to the D stage through the bypass 119 when valid data is read to the N stage. The load instruction writes valid data 119 in the register r1 at the W stage. When the valid data 119 is sent from the N stage to the D stage, the add instruction, which is the second instruction, selects the sent data 119 by the selection circuit 12 and outputs it to the data line 111. The selection circuit 13 selects the data 110 of the register r2 read from the register file 21 in the D stage and outputs it to the data line 112. The second addition instruction is E
In the stage, output data 111, 11 from the D stage
2 is used to perform addition in the arithmetic unit 15, and the addition result 11
5 is output. Then, at the N stage, the data 116 as the addition result is selected by the selection circuit 27, and at the W stage, the addition result is written in the register t.

【0012】従来技術に従うパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュミスした
場合、第2の命令である加算命令は2サイクル+ブロッ
ク転送サイクルペナルティとなる。
When a load instruction which is the first instruction causes a cache miss in the pipeline processing apparatus according to the prior art, the addition instruction which is the second instruction has a penalty of 2 cycles + block transfer cycle.

【0013】一般にデータキャッシュのデータ読み出し
とデータキャッシュのヒット判定ではデータキャッシュ
のヒット判定の方が遅い。例えばダイレクトマップのデ
ータキャッシュ17ではデータ117を読み出すと同時
に、データアドレスタグ18からデータ117が存在し
たアドレス118を読み出し該アドレス118を用いて
ヒット判定を行う。該ヒット判定を行うヒット判定回路
20においてヒット判定結果123を出力するまでに時
間がかかるため、データキャッシュ17のデータ読み出
し117とデータキャッシュ17のヒット判定123で
はデータキャッシュ17のヒット判定123の方が遅く
なる。
Generally, in the data read of the data cache and the hit judgment of the data cache, the hit judgment of the data cache is slower. For example, in the direct map data cache 17, at the same time as reading the data 117, the address 118 where the data 117 existed is read from the data address tag 18 and the hit determination is performed using the address 118. Since it takes a long time to output the hit determination result 123 in the hit determination circuit 20 that performs the hit determination, the data read 117 of the data cache 17 and the hit determination 123 of the data cache 17 are better in the hit determination 123 of the data cache 17. Become slow.

【0014】上述した従来例はヒット判定の方がデータ
読み出しよりも1サイクル遅い場合を示している。
The above-mentioned conventional example shows a case where the hit determination is one cycle later than the data reading.

【0015】しかし近年では、さらに高速化されたパイ
プライン処理装置が求められている。パイプライン処理
装置の高速化が行われると1サイクルの時間が短くな
り、ヒット判定を行うヒット判定回路のディレイがさら
に厳しくなることになり、1サイクルではヒット判定結
果を出力することができず、ヒット判定結果判明までに
2サイクル以上遅くなることが考えられる。ここでヒッ
ト判定の方がデータ読み出しよりも2サイクル遅い場合
には単純に第2の命令である加算命令のペナルティは1
サイクル増加する。
However, in recent years, there has been a demand for a pipeline processing device which has a higher speed. If the pipeline processing device is speeded up, the time for one cycle is shortened, the delay of the hit determination circuit for performing the hit determination becomes more severe, and the hit determination result cannot be output in one cycle. It may be delayed by two cycles or more until the hit determination result is known. Here, if the hit determination is two cycles later than the data read, the penalty of the addition instruction, which is the second instruction, is 1
Cycle increase.

【0016】図13に従来技術に従ったパイプライン処
理装置において、ヒット判定の方がデータ読み出しより
も2サイクル遅くなった場合のキャッシュヒット時のタ
イムチャートを示す。図13に示すように、このときの
第2の命令である加算命令は3サイクルペナルティとな
る。図14にはキャッシュミス時のタイムチャートを示
す。図14に示すように、このときの加算命令は3サイ
クル+ブロック転送サイクルペナルティとなる。
FIG. 13 shows a time chart at the time of a cache hit in the pipeline processor according to the prior art when the hit determination is delayed by two cycles from the data read. As shown in FIG. 13, the add instruction, which is the second instruction at this time, has a 3-cycle penalty. FIG. 14 shows a time chart at the time of a cache miss. As shown in FIG. 14, the addition instruction at this time is 3 cycles + block transfer cycle penalty.

【0017】[0017]

【発明が解決しようとする課題】図2に示すような命令
列のキャッシュヒット時のペナルティは性能上最も重要
である。上記従来例ではキャッシュヒット時のペナルテ
ィは2サイクルペナルティであるがこれをさらに低減す
ることが必要である。
The penalty at the time of a cache hit of an instruction string as shown in FIG. 2 is the most important in terms of performance. In the above-mentioned conventional example, the penalty at the time of a cache hit is a 2-cycle penalty, but it is necessary to further reduce this penalty.

【0018】また上記従来例では、処理の高速化などに
よりデータキャッシュのデータ読み出しを行うステージ
とヒット判定を行うステージが離れるとキャッシュヒッ
ト時のペナルティが増加し性能低下につながる。
Further, in the above-mentioned conventional example, if the stage for reading the data from the data cache and the stage for making the hit determination are separated from each other due to speeding up of the processing, the penalty at the time of cache hit increases and the performance deteriorates.

【0019】本発明は上述のような事情に鑑みてなされ
たものであり、第2の命令が過剰に保持されることを排
除するパイプライン処理装置を提供することを目的とす
る。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a pipeline processing device that eliminates excessive holding of a second instruction.

【0020】[0020]

【課題を解決するための手段】請求項1の発明は、第1
の命令であるロード命令と次に実行すべき第2の命令と
の間にデータの依存関係があった場合、第1の命令であ
るロード命令によってデータキャッシュから読み出され
たデータを、第1の命令であるロード命令のキャッシュ
のヒット判定が判明するステージよりも前のステージか
ら演算ステージの前のステージに送るものである。具体
的には第1の命令であるロード命令によって読み出され
たデータをキャッシュのヒット判定が判明する前に演算
ステージの前のステージに送るバイパスと該バイパスを
通して送られてきたデータを演算ステージに送り演算さ
せるように制御する制御手段とを備える構成とする。
The invention according to claim 1 is the first
If there is a data dependency between the load instruction that is the first instruction and the second instruction that is to be executed next, the data read from the data cache by the load instruction that is the first instruction is This instruction is sent from the stage prior to the stage where the cache hit determination of the load instruction is clear to the stage before the operation stage. Specifically, a bypass that sends the data read by the load instruction, which is the first instruction, to the stage before the operation stage before the hit judgment of the cache becomes clear, and the data sent through the bypass to the operation stage. And a control means for controlling so as to perform a feed calculation.

【0021】請求項2の発明は、第1の命令であるロー
ド命令がキャッシュミスと判明した場合、あらかじめ第
1の命令であるロード命令はバイパスを通してデータを
第2の命令に対し送っているので、演算ステージ以降ま
で送られてしまった第2の命令を、演算ステージより前
のステージから再実行するものである。具体的には、請
求項1の構成に、第1の命令であるロード命令がキャッ
シュミスとなった場合、第2の命令を演算ステージの前
のステージに戻すパスと、該パスを通して送られてきた
第2の命令を再実行するように制御する制御手段とを備
える構成とする。
According to the second aspect of the present invention, when the load instruction which is the first instruction is found to be a cache miss, the load instruction which is the first instruction sends data to the second instruction through the bypass in advance. The second instruction sent up to and after the operation stage is re-executed from the stage before the operation stage. Specifically, in the configuration of claim 1, when the load instruction which is the first instruction causes a cache miss, a path for returning the second instruction to the stage before the operation stage and a path for sending the second instruction are sent through the path. And a control means for controlling the second instruction to be re-executed.

【0022】請求項3の発明は、第1の命令であるロー
ド命令のキャッシュミスによって発生したブロック転送
中に、第2の命令を演算ステージより前のステージに戻
し、演算ステージの前のステージで保持しておき、ブロ
ック転送が終了した時には読み出された有効データを第
2の命令が直ちに受け取り演算実行可能な状態にしてお
く構成とするものである。
According to the third aspect of the invention, the second instruction is returned to the stage prior to the operation stage during the block transfer generated by the cache miss of the load instruction which is the first instruction, and the second instruction is returned to the stage before the operation stage. The configuration is such that the second instruction immediately receives the read valid data when the block transfer is completed, and the operation is ready to be executed.

【0023】[0023]

【作用】請求項1の発明の構成により、第1の命令であ
るロード命令と第2の命令との間にデータの依存関係が
あるときには、キャッシュから読み出されたデータはキ
ャッシュのヒット判定が判明する前に演算ステージの前
に送られるため、第2の命令は先行して演算を実行する
ことが可能となり、キャッシュヒット時の第2の命令の
過剰な保持が排除される。
According to the structure of the first aspect of the present invention, when there is a data dependency relationship between the load instruction which is the first instruction and the second instruction, the data read from the cache is judged as a cache hit. Since it is sent before the operation stage before it is known, the second instruction can execute the operation in advance, and the excessive holding of the second instruction at the time of cache hit is eliminated.

【0024】請求項2の発明の構成により、第1の命令
であるロード命令がキャッシュミスした場合、演算ステ
ージ以降まで送られてしまった第2の命令を再度実行す
ることが可能であり、正常動作が保証される。
According to the configuration of the second aspect of the present invention, when the load instruction which is the first instruction causes a cache miss, it is possible to re-execute the second instruction that has been sent up to and after the operation stage, and the normal operation is performed. Operation is guaranteed.

【0025】請求項3の発明により、第2の命令を演算
ステージの前のステージに戻し、演算ステージの前のス
テージで保持するまでの動作が第1の命令であるロード
命令のブロック転送中に行われ、該ブロック転送が終了
したときには第2の命令の演算が直ちに実行されるので
請求項2の動作はペナルティ増加とはならない。
According to the invention of claim 3, the operation of returning the second instruction to the stage before the operation stage and holding it in the stage before the operation stage is during the block transfer of the load instruction which is the first instruction. When the block transfer is completed, the operation of the second instruction is immediately executed, so that the operation of claim 2 does not result in an increase in penalty.

【0026】[0026]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。
Embodiments of the present invention will be described below with reference to the drawings.

【0027】図5に第1の実施例として請求項1と請求
項2の発明に従うパイプライン処理装置の構成を示す。
FIG. 5 shows the configuration of a pipeline processing apparatus according to the first and second aspects of the present invention as a first embodiment.

【0028】第1の実施例におけるパイプライン処理装
置は、各ステージにはそれぞれのステージのアドレス、
データ及命令を保持する保持回路2、3、4、5、6、
7、14、16、19、10、26を備え、IFステー
ジにはプログラムのカウントを行うプログラムカウンタ
8を備え、Dステージには先行命令とのデータ依存関係
を検出する検出回路24を備え、Eステージには命令の
演算を行う演算装置15を備え、Nステージにはデータ
キャッシュのヒット判定を行う判定回路20を備えてい
る。命令はIFステージで命令キャッシュメモリ9から
読み出しが行われ、データはAステージでデータキャッ
シュメモリ17から読み出しが行われる。またレジスタ
ファイル21からの読み出しはDステージで行われ、レ
ジスタファイル21への書き込みはWステージで行われ
る。さらにNステージからDステージ及Aステージから
Dステージにはそれぞれデータキャッシュ17から読み
出されたデータを送るバイパス119、117が設けら
れ、EステージからIFステージにはアドレスを送るパ
ス104が設けられている。
In the pipeline processing apparatus according to the first embodiment, each stage has an address of each stage,
Holding circuits 2, 3, 4, 5, 6, for holding data and instructions,
7, 14, 16, 19, 10, 26, the IF stage is provided with a program counter 8 for counting a program, the D stage is provided with a detection circuit 24 for detecting a data dependency relationship with a preceding instruction, and E is provided. The stage is provided with an arithmetic unit 15 for performing an instruction operation, and the N stage is provided with a determination circuit 20 for performing a data cache hit determination. The instruction is read from the instruction cache memory 9 in the IF stage, and the data is read from the data cache memory 17 in the A stage. Further, reading from the register file 21 is performed at the D stage, and writing to the register file 21 is performed at the W stage. Further, the N-stage to D-stage and the A-stage to D-stage are provided with bypasses 119 and 117 for sending the data read from the data cache 17, respectively, and the E-stage to the IF stage are provided with a path 104 for sending an address. There is.

【0029】図6には第1の実施例のパイプライン処理
装置において、図2の命令列が処理される場合に第1の
命令であるロード命令がキャッシュヒットした場合のタ
イムチャートが示してあり、図7には第1の命令である
ロード命令がキャッシュミスした場合のタイムチャート
が示してある。
FIG. 6 shows a time chart in the case where the load instruction which is the first instruction causes a cache hit in the pipeline processing device of the first embodiment when the instruction sequence of FIG. 2 is processed. FIG. 7 shows a time chart in the case where the load instruction which is the first instruction causes a cache miss.

【0030】以下、図2の命令列を例にして第1の実施
例のパイプライン処理装置の具体的な動作について説明
する。
The specific operation of the pipeline processing apparatus of the first embodiment will be described below by taking the instruction sequence of FIG. 2 as an example.

【0031】まず第1の命令であるロード命令がIFス
テージで命令キャッシュ9から読み出される。次に第1
の命令であるロード命令はDステージでレジスタファイ
ル21からレジスタxのデータとレジスタbのデータを
それぞれデータ線131、110に読み出し、選択回路
12、13でそれぞれデータ線131、110を選択し
データ線111、112に出力する。このとき第2の命
令である加算命令がIFステージで命令キャッシュ9か
ら読み出される。第1の命令であるロード命令はEステ
ージでデータ111、112を用いて演算装置15で加
算を実行し、データキャッシュの読み出しアドレス11
5を出力する。このとき第2の命令である加算命令はD
ステージでレジスタファイル21からレジスタr1のデ
ータとレジスタr2のデータをそれぞれデータ線13
1、110に読み出している。ここで図2に示すように
第1の命令であるロード命令と第2の命令である加算命
令との間ではレジスタr1を介してデータの依存関係が
あるので、検出回路24でデータ依存関係があることが
検出される。依存関係があることが検出されると第2の
命令である加算命令は、レジスタr1のデータが読み出
されているデータ線131には古いデータが出力されて
いることになるため、命令演算ステージであるEステー
ジには送られず直前のDステージでステージロック信号
129によって保持される。第1の命令であるロード命
令はデータ依存関係の有無にかかわらず引き続き処理さ
れ、AステージでEステージからの出力結果115を用
いて、データキャッシュ読み出しアドレス116としデ
ータキャッシュ17からデータ117を読み出す。Aス
テージで読み出されたデータはバイパス117を通して
Dステージに送られ、ここで第2の命令である加算命令
を保持していたステージロック信号129は解除され
る。第2の命令である加算命令は、Aステージからレジ
スタr1に相当するデータ117が送られてくると、送
られてきた該データ117を選択回路12で選択しデー
タ線111に出力するとともに、すでにDステージでレ
ジスタファイル21から読み出されているレジスタr2
のデータ110を選択回路13で選択しデータ線112
に出力する。第2の命令である加算命令はEステージ
で、Dステージからの出力データ111、112を用い
て演算装置15で、第1の命令であるロード命令のキャ
ッシュのヒット判定が判明する前に先行して加算を実行
し、加算結果115を出力する。第1の命令であるロー
ド命令は、Aステージでデータ117を選択回路27で
選択しNステージデータ保持回路29にも送り、またデ
ータキャッシュ読み出しアドレス116でデータアドレ
スタグ18とデータTLB28からもそれぞれ物理アド
レス118、133を読み出し、第1の命令であるロー
ド命令のキャッシュのヒット判定を行うヒット判定回路
20まで送る。
First, the load instruction which is the first instruction is read from the instruction cache 9 at the IF stage. Then the first
In the D stage, the load instruction, which is the instruction of, reads out the data of the register x and the data of the register b from the register file 21 to the data lines 131 and 110, respectively, and selects the data lines 131 and 110 by the selection circuits 12 and 13, respectively. Output to 111 and 112. At this time, the add instruction which is the second instruction is read from the instruction cache 9 in the IF stage. The load instruction, which is the first instruction, performs addition in the arithmetic unit 15 using the data 111 and 112 at the E stage, and the read address 11 of the data cache.
5 is output. At this time, the addition instruction which is the second instruction is D
At the stage, the data of the register r1 and the data of the register r2 are respectively transferred from the register file 21 to the data line 13
1, 110 are read. Here, as shown in FIG. 2, since there is a data dependency relationship between the load instruction which is the first instruction and the addition instruction which is the second instruction via the register r1, the data dependency relationship is detected in the detection circuit 24. Is detected. When it is detected that there is a dependency relationship, the addition instruction, which is the second instruction, means that old data is output to the data line 131 from which the data of the register r1 is read, and therefore the instruction operation stage Is not sent to the E stage, which is held by the stage lock signal 129 at the immediately preceding D stage. The load instruction, which is the first instruction, is continuously processed regardless of the presence or absence of data dependency, and the output result 115 from the E stage is used in the A stage to read the data 117 from the data cache 17 as the data cache read address 116. The data read in the A stage is sent to the D stage through the bypass 117, and the stage lock signal 129 holding the addition instruction which is the second instruction is released here. When the data 117 corresponding to the register r1 is sent from the A stage, the addition instruction, which is the second instruction, selects the sent data 117 by the selection circuit 12 and outputs it to the data line 111. Register r2 read from register file 21 in D stage
Data 110 is selected by the selection circuit 13 and the data line 112 is selected.
Output to. The addition instruction which is the second instruction is preceded by the E stage before the hit judgment of the cache of the load instruction which is the first instruction is determined by the arithmetic unit 15 using the output data 111 and 112 from the D stage. Then, the addition is performed and the addition result 115 is output. The load instruction, which is the first instruction, selects the data 117 at the A stage by the selection circuit 27 and sends it to the N stage data holding circuit 29. Also, the data cache read address 116 physically causes the data address tag 18 and the data TLB 28 to be used. The addresses 118 and 133 are read and sent to the hit determination circuit 20 which determines the cache hit of the load instruction which is the first instruction.

【0032】まず第1の命令であるロード命令がNステ
ージでヒット判定回路20によってキャッシュヒットと
判明した場合には、第1の命令のAステージで読み出さ
れたデータ117は有効なデータであるので、第1の命
令であるロード命令はAステージから送られてきてNス
テージに出力されている有効データ119をWステージ
でレジスタr1に書き込む。また第2の命令である加算
命令の先行演算も有効であるので該加算命令は引き続き
処理が継続され、Nステージでは選択回路27で第2の
命令である加算命令の加算結果116を選択し、Wステ
ージでレジスタtに該加算結果を書き込む。
First, when the load instruction which is the first instruction is identified as a cache hit by the hit determination circuit 20 in the N stage, the data 117 read in the A stage of the first instruction is valid data. Therefore, the load instruction which is the first instruction writes the valid data 119 sent from the A stage and output to the N stage to the register r1 in the W stage. Further, since the preceding operation of the addition instruction which is the second instruction is also effective, the addition instruction continues to be processed, and in the N stage, the selection circuit 27 selects the addition result 116 of the addition instruction which is the second instruction, At the W stage, the addition result is written in the register t.

【0033】第1の実施例のパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュヒットし
た場合、第2の命令である加算命令は1サイクルペナル
ティとなる。
In the pipeline processing device of the first embodiment, when the load instruction which is the first instruction causes a cache hit, the addition instruction which is the second instruction has a one-cycle penalty.

【0034】一方第1の命令であるロード命令がNステ
ージでキャッシュミスと判明した場合には、第1の命令
のAステージで読み出されたデータは無効なデータであ
るので、該ロード命令は有効なデータを読み出すために
ブロック転送を行い、ブロック転送中はステージロック
信号126によりNステージで保持される。また第2の
命令である加算命令もブロック転送中はステージロック
信号126によりEステージで保持される。キャッシュ
ミス発生から複数サイクルの後ブロック転送が終了する
と、ステージロック信号126は解除され、第1の命令
であるロード命令が存在するNステージには有効なデー
タが読み出されている。第1の命令であるロード命令は
Wステージで有効データ119をレジスタr1に書き込
む。しかし第2の命令である加算命令は、ブロック転送
が終了した時にはすでに加算演算は終了しているが、第
1の命令であるロード命令によってAステージからDス
テージに送られてきたデータ117は無効データである
ので該加算演算は無効演算であり、該加算命令は再度実
行し直す必要がある。第2の命令である加算命令は、第
1の命令であるロード命令のブロック転送が終了したと
きにはEステージに存在するので、Eステージにある加
算命令のアドレスをパス104を通して前のステージに
戻し選択回路1でアドレス104を選択しIFステージ
に戻す。戻された該アドレス102で命令キャッシュ9
から第2の命令である加算命令を再度読み出す。ここで
命令を演算ステージよりも前のステージに戻し再実行す
る処理をリトライと呼ぶ。第2の命令である加算命令が
Dステージまで処理されたときには、レジスタr1には
第1の命令であるロード命令によって読み出されたデー
タがすでに書き込まれている。第2の命令である加算命
令はDステージでレジスタファイル21からレジスタr
1のデータとレジスタr2のデータをそれぞれデータ線
131、110に読み出し、選択回路12、13でそれ
ぞれデータ131、110を選択しデータ線111、1
12に出力する。第2の命令である加算命令はEステー
ジで、Dステージからの出力データ111、112を用
いて演算装置15で加算を再度実行し、Aステージで該
加算結果である116を選択回路27で選択し、Wステ
ージで該加算結果をレジスタtに書き込む。
On the other hand, when the load instruction, which is the first instruction, is found to be a cache miss in the N stage, the data read in the A stage of the first instruction is invalid data. Block transfer is performed to read valid data, and the block is held in the N stage by the stage lock signal 126 during the block transfer. Further, the add instruction which is the second instruction is also held in the E stage by the stage lock signal 126 during the block transfer. When the block transfer ends after a plurality of cycles from the occurrence of the cache miss, the stage lock signal 126 is released, and valid data is read to the N stage where the load instruction which is the first instruction exists. The load instruction, which is the first instruction, writes the valid data 119 to the register r1 at the W stage. However, the addition instruction which is the second instruction has already completed the addition operation when the block transfer is finished, but the data 117 sent from the A stage to the D stage by the load instruction which is the first instruction is invalid. Since it is data, the addition operation is an invalid operation, and the addition instruction needs to be executed again. The add instruction which is the second instruction exists in the E stage when the block transfer of the load instruction which is the first instruction is completed. Therefore, the address of the add instruction in the E stage is returned to the previous stage through the path 104 and selected. The address 104 is selected by the circuit 1 and returned to the IF stage. The instruction cache 9 at the returned address 102
From the second instruction, the addition instruction which is the second instruction is read again. Here, the process of returning the instruction to the stage before the operation stage and re-executing it is called a retry. When the add instruction which is the second instruction is processed up to the D stage, the data read by the load instruction which is the first instruction is already written in the register r1. The add instruction which is the second instruction is executed from the register file 21 to the register r in the D stage.
The data of 1 and the data of the register r2 are read to the data lines 131 and 110, respectively, and the selection circuits 12 and 13 select the data 131 and 110, respectively.
Output to 12. The addition instruction which is the second instruction is the E stage, the addition is performed again in the arithmetic unit 15 using the output data 111 and 112 from the D stage, and the addition circuit 116 is selected by the selection circuit 27 at the A stage. Then, in the W stage, the addition result is written in the register t.

【0035】第1の実施例のパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュミスした
場合、第2の命令である加算命令は2サイクル+ブロッ
ク転送サイクル+リトライ処理サイクルペナルティとな
る。
In the pipeline processing device of the first embodiment, when the load instruction which is the first instruction causes a cache miss, the addition instruction which is the second instruction becomes 2 cycles + block transfer cycle + retry processing cycle penalty. .

【0036】第2の実施例としては、第1の実施例のパ
イプライン処理装置に請求項3の発明を加えた構成とす
る。
The second embodiment has a configuration in which the invention of claim 3 is added to the pipeline processing apparatus of the first embodiment.

【0037】図1に第2の実施例の構成を示す。FIG. 1 shows the configuration of the second embodiment.

【0038】図3には第2の実施例のパイプライン処理
装置において、図2の命令列が処理される場合に第1の
命令であるロード命令がキャッシュヒットした場合のタ
イムチャートが示してあり、図4には第1の命令である
ロード命令がキャッシュミスした場合のタイムチャート
が示してある。
FIG. 3 shows a time chart in the case where the load instruction which is the first instruction causes a cache hit when the instruction sequence of FIG. 2 is processed in the pipeline processing device of the second embodiment. FIG. 4 shows a time chart when the first instruction, the load instruction, causes a cache miss.

【0039】以下、図面に基づいて第2の実施例の具体
的な動作について説明する。
The specific operation of the second embodiment will be described below with reference to the drawings.

【0040】まず第1の命令であるロード命令がIFス
テージで命令キャッシュ9から読み出される。次に第1
の命令であるロード命令はDステージでレジスタファイ
ル21からレジスタxのデータとレジスタbのデータを
それぞれデータ線131、110に読み出し、選択回路
12、13でそれぞれデータ線131、110を選択し
データ線111、112に出力する。このとき第2の命
令である加算命令がIFステージで命令キャッシュ9か
ら読み出される。第1の命令であるロード命令はEステ
ージでデータ111、112を用いて演算装置15で加
算を実行し、データキャッシュの読み出しアドレス11
5を出力する。このとき第2の命令である加算命令はD
ステージでレジスタファイル21からレジスタr1のデ
ータとレジスタr2のデータをそれぞれデータ線13
1、110に読み出している。ここで図2に示すように
第1の命令であるロード命令と第2の命令である加算命
令との間ではレジスタr1を介してデータの依存関係が
あるので、検出回路24でデータ依存関係があることが
検出される。依存関係があることが検出されると第2の
命令である加算命令は、レジスタr1のデータが読み出
されているデータ線131には古いデータが出力されて
いることになるため、命令演算ステージであるEステー
ジには送られず直前のDステージでステージロック信号
129によって保持される。第1の命令であるロード命
令はデータ依存関係の有無にかかわらず引き続き処理さ
れ、AステージでEステージからの出力結果115を用
いて、データキャッシュ読み出しアドレス116としデ
ータキャッシュ17からデータ117を読み出す。Aス
テージで読み出されたデータはバイパス117を通して
Dステージに送られ、ここで第2の命令である加算命令
を保持していたステージロック信号129は解除され
る。第2の命令である加算命令は、Aステージからレジ
スタr1に相当するデータ117が送られてくると、送
られてきた該データ117を選択回路12で選択しデー
タ線111に出力するとともに、すでにDステージでレ
ジスタファイル21から読み出されているレジスタr2
のデータ110を選択回路13で選択しデータ線112
に出力する。第2の命令である加算命令はEステージ
で、Dステージからの出力データ111、112を用い
て演算装置15で、第1の命令であるロード命令のキャ
ッシュのヒット判定が判明する前に先行して加算を実行
し、加算結果115を出力する。第1の命令であるロー
ド命令は、Aステージでデータ117を選択回路27で
選択しNステージデータ保持回路29にも送り、またデ
ータキャッシュ読み出しアドレス116でデータアドレ
スタグ18とデータTLB28からもそれぞれ物理アド
レス118、133を読み出し、第1の命令であるロー
ド命令のキャッシュのヒット判定を行うヒット判定回路
20まで送る。
First, the load instruction which is the first instruction is read from the instruction cache 9 in the IF stage. Then the first
In the D stage, the load instruction, which is the instruction of, reads out the data of the register x and the data of the register b from the register file 21 to the data lines 131 and 110, respectively, and selects the data lines 131 and 110 by the selection circuits 12 and 13, respectively. Output to 111 and 112. At this time, the add instruction which is the second instruction is read from the instruction cache 9 in the IF stage. The load instruction, which is the first instruction, performs addition in the arithmetic unit 15 using the data 111 and 112 at the E stage, and the read address 11 of the data cache.
5 is output. At this time, the addition instruction which is the second instruction is D
At the stage, the data of the register r1 and the data of the register r2 are respectively transferred from the register file 21 to the data line 13
1, 110 are read. Here, as shown in FIG. 2, since there is a data dependency relationship between the load instruction which is the first instruction and the addition instruction which is the second instruction via the register r1, the data dependency relationship is detected in the detection circuit 24. Is detected. When it is detected that there is a dependency relationship, the addition instruction, which is the second instruction, means that old data is output to the data line 131 from which the data of the register r1 is read, and therefore the instruction operation stage Is not sent to the E stage, which is held by the stage lock signal 129 at the immediately preceding D stage. The load instruction, which is the first instruction, is continuously processed regardless of the presence or absence of data dependency, and the output result 115 from the E stage is used in the A stage to read the data 117 from the data cache 17 as the data cache read address 116. The data read in the A stage is sent to the D stage through the bypass 117, and the stage lock signal 129 holding the addition instruction which is the second instruction is released here. When the data 117 corresponding to the register r1 is sent from the A stage, the addition instruction, which is the second instruction, selects the sent data 117 by the selection circuit 12 and outputs it to the data line 111. Register r2 read from register file 21 in D stage
Data 110 is selected by the selection circuit 13 and the data line 112 is selected.
Output to. The addition instruction which is the second instruction is preceded by the E stage before the hit judgment of the cache of the load instruction which is the first instruction is determined by the arithmetic unit 15 using the output data 111 and 112 from the D stage. Then, the addition is performed and the addition result 115 is output. The load instruction, which is the first instruction, selects the data 117 at the A stage by the selection circuit 27 and sends it to the N stage data holding circuit 29. Also, the data cache read address 116 physically causes the data address tag 18 and the data TLB 28 to be used. The addresses 118 and 133 are read and sent to the hit determination circuit 20 which determines the cache hit of the load instruction which is the first instruction.

【0041】まず第1の命令であるロード命令がNステ
ージでヒット判定回路20によってキャッシュヒットと
判明した場合には、第1の命令のAステージで読み出さ
れたデータ117は有効なデータであるので、第1の命
令であるロード命令はAステージから送られてきてNス
テージに出力されている有効データ119をWステージ
でレジスタr1に書き込む。また第2の命令である加算
命令の先行演算も有効であるので該加算命令は引き続き
処理が継続され、Nステージでは選択回路27で第2の
命令である加算命令の加算結果116を選択し、Wステ
ージでレジスタtに該加算結果を書き込む。
First, in the case where the load instruction which is the first instruction is found to be a cache hit by the hit determination circuit 20 in the N stage, the data 117 read in the A stage of the first instruction is valid data. Therefore, the load instruction which is the first instruction writes the valid data 119 sent from the A stage and output to the N stage to the register r1 in the W stage. Further, since the preceding operation of the addition instruction which is the second instruction is also effective, the addition instruction continues to be processed, and in the N stage, the selection circuit 27 selects the addition result 116 of the addition instruction which is the second instruction, At the W stage, the addition result is written in the register t.

【0042】第2の実施例のパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュヒットし
た場合、第1の実施例と同様の動作が行われ、第2の命
令である加算命令は1サイクルペナルティとなる。
When the load instruction which is the first instruction causes a cache hit in the pipeline processing device of the second embodiment, the same operation as in the first embodiment is performed, and the addition instruction which is the second instruction is executed. There is a one-cycle penalty.

【0043】一方第1の命令であるロード命令がNステ
ージでキャッシュミスと判明した場合には、第1の命令
のAステージで読み出されたデータは無効なデータであ
るので、該ロード命令は有効なデータを読み出すために
ブロック転送を行い、ブロック転送中はステージロック
信号126によりNステージで保持される。また第2の
命令である加算命令の先行演算は無効なデータを使用し
ていることになり該先行演算は無効演算となるため、該
加算命令は再度実行し直す必要がある。第2の命令であ
る加算命令は、第1の命令であるロード命令がキャッシ
ュミスと判明したときにはEステージに存在するので、
Eステージにある加算命令のアドレスをパス104を通
して前のステージに戻し選択回路1でアドレス104を
選択しIFステージに戻す。戻された該アドレス102
で命令キャッシュ9から第2の命令である加算命令を再
度読み出し、Eステージの前のステージであるDステー
ジで第1の命令であるロード命令のブロック転送によっ
て有効なデータが送られてくるまで第2の命令である加
算命令はステージロック信号128によって再度保持さ
れる。ここで第1の実施例では第2の命令のリトライ処
理は第1の命令のブロック転送後に実行しているが、第
2の実施例では第2の命令のリトライ処理をブロック転
送中に行い、ブロック転送が終了する前に該リトライ処
理を終了させている。キャッシュミス発生から複数サイ
クルの後ブロック転送が終了すると、ステージロック信
号126、128は解除され、第1の命令であるロード
命令が存在するNステージには有効なデータが読み出さ
れている。第1の命令であるロード命令はNステージに
読み出されているレジスタr1に相等する有効なデータ
をバイパス119を通してNステージからDステージに
送る。また該ロード命令はWステージでレジスタr1に
有効データ119を書き込む。第2の命令である加算命
令はNステージからDステージに有効なデータ119が
送られてくると、送られてきた該データ119を選択回
路12で選択しデータ線111に出力するとともに、す
でにDステージでレジスタファイル21から読み出され
ているレジスタr2のデータ110を選択回路13で選
択しデータ線112に出力する。第2の命令である加算
命令はEステージで、Dステージからの出力データ11
1、112を用いて演算装置15で再度加算を実行し、
加算結果115を出力する。そしてNステージで加算結
果であるデータ116を選択回路27で選択しWステー
ジでレジスタtに該加算結果を書き込む。
On the other hand, when the load instruction, which is the first instruction, is found to be a cache miss in the N stage, the data read in the A stage of the first instruction is invalid data. Block transfer is performed to read valid data, and the block is held in the N stage by the stage lock signal 126 during the block transfer. Further, since the preceding operation of the add instruction which is the second instruction uses invalid data, the preceding operation becomes an invalid operation, so that the add instruction needs to be executed again. The add instruction, which is the second instruction, exists in the E stage when the load instruction, which is the first instruction, is found to be a cache miss.
The address of the add instruction in the E stage is returned to the previous stage through the path 104, and the address 104 is selected by the selection circuit 1 and returned to the IF stage. The returned address 102
Then, the add instruction which is the second instruction is read again from the instruction cache 9 and the valid data is sent by block transfer of the load instruction which is the first instruction in the D stage which is the stage before the E stage. The add instruction, which is the instruction of 2, is held again by the stage lock signal 128. Here, in the first embodiment, the retry processing of the second instruction is executed after the block transfer of the first instruction, but in the second embodiment, the retry processing of the second instruction is executed during the block transfer, The retry process is completed before the block transfer is completed. When the block transfer ends after a plurality of cycles from the occurrence of the cache miss, the stage lock signals 126 and 128 are released, and valid data is read out to the N stage where the load instruction which is the first instruction exists. The load instruction, which is the first instruction, sends valid data equivalent to the register r1 read to the N stage from the N stage to the D stage through the bypass 119. The load instruction writes valid data 119 in the register r1 at the W stage. When the valid data 119 is sent from the N stage to the D stage, the add instruction, which is the second instruction, selects the sent data 119 by the selection circuit 12 and outputs it to the data line 111. The data 110 of the register r2 read from the register file 21 at the stage is selected by the selection circuit 13 and output to the data line 112. The add instruction, which is the second instruction, is the E stage and the output data 11 from the D stage.
The addition is performed again by the arithmetic unit 15 using 1, 112,
The addition result 115 is output. Then, at the N stage, the data 116 as the addition result is selected by the selection circuit 27, and at the W stage, the addition result is written in the register t.

【0044】第2の実施例のパイプライン処理装置にお
いて第1の命令であるロード命令がキャッシュミスした
場合、第2の命令である加算命令は2サイクル+ブロッ
ク転送サイクルペナルティとなる。
In the pipeline processing device of the second embodiment, when the load instruction which is the first instruction causes a cache miss, the addition instruction which is the second instruction has a penalty of 2 cycles + block transfer cycle.

【0045】上記の第1の実施例と第2の実施例はデー
タキャッシュのヒット判定の方がデータキャッシュのデ
ータ読み出しよりも1サイクル遅い場合を示している。
The above-described first and second embodiments show the case where the hit judgment of the data cache is one cycle later than the data read of the data cache.

【0046】第3の実施例としては、第2の実施例にお
けるパイプライン段数を6段に限るものではない。
The number of pipeline stages in the second embodiment is not limited to six in the third embodiment.

【0047】図11に第3の実施例のパイプライン処理
装置において、処理の高速化などによりヒット判定の方
がデータ読み出しよりも2サイクル遅くなった場合のキ
ャッシュヒット時のタイムチャートを示す。図11に示
すように、このときの第2の命令である加算命令は1サ
イクルペナルティとなる。図12にはキャッシュミス時
のタイムチャートを示す。図12に示すように、このと
きの加算命令は3サイクル+ブロック転送サイクルペナ
ルティとなる。
FIG. 11 shows a time chart at the time of a cache hit in the pipeline processing apparatus of the third embodiment when the hit determination is delayed by 2 cycles from the data reading due to the speedup of the processing. As shown in FIG. 11, the addition instruction, which is the second instruction at this time, has a one-cycle penalty. FIG. 12 shows a time chart at the time of a cache miss. As shown in FIG. 12, the addition instruction at this time is 3 cycles + block transfer cycle penalty.

【0048】第4の実施例としては、第3の実施例にお
ける第2の命令のリトライ処理で戻すデータをアドレス
だけに限るものではない。
In the fourth embodiment, the data returned by the retry process of the second instruction in the third embodiment is not limited to the address.

【0049】第5の実施例としては、第4の実施例にお
ける第2の命令のリトライ処理の戻り先を演算ステージ
の前のステージであるならばIFステージに限るもので
はない。
In the fifth embodiment, the return destination of the retry processing of the second instruction in the fourth embodiment is not limited to the IF stage as long as it is the stage before the operation stage.

【0050】[0050]

【発明の効果】以上説明したように、請求項1の発明に
よると、第1の命令であるロード命令と第2の命令との
間にデータの依存関係があるときには、キャッシュから
読み出されたデータはキャッシュのヒット判定が判明す
る前に演算ステージの前に送られるため、第2の命令は
先行して演算を行うことが可能となり、キャッシュヒッ
ト時には過剰な保持が排除されることになりつまりペナ
ルティが低減されるのでパイプライン処理装置の処理速
度を向上させることができる。またデータキャッシュか
らのデータ読み出しのステージとキャッシュのヒット判
定が判明するステージが離れても、第2の命令の先行演
算が可能なことから、キャッシュヒット時の過剰な保持
が排除され、キャッシュヒット時のペナルティが増加し
ないのでパイプライン処理装置の処理速度の低下を防ぐ
ことができる。
As described above, according to the first aspect of the present invention, when there is a data dependency between the load instruction which is the first instruction and the second instruction, the data is read from the cache. Since the data is sent before the operation stage before the cache hit decision is known, the second instruction can perform the operation in advance, and excessive holding is eliminated at the time of cache hit. Since the penalty is reduced, the processing speed of the pipeline processing device can be improved. Further, even if the stage for reading data from the data cache and the stage for determining the hit determination of the cache are separated from each other, since the preceding operation of the second instruction is possible, excessive holding at the time of cache hit is eliminated, and at the time of cache hit. Therefore, the processing speed of the pipeline processing device can be prevented from decreasing.

【0051】請求項2の発明の構成により、第1の命令
であるロード命令がキャッシュミスした場合でも、演算
ステージ以降まで送られてしまった第2の命令が再度実
行可能であり、正常動作が保証される。
According to the configuration of the second aspect of the present invention, even if the load instruction which is the first instruction causes a cache miss, the second instruction that has been sent up to and after the operation stage can be executed again, and the normal operation is performed. Guaranteed.

【0052】請求項3の発明により、第2の命令を演算
ステージの前のステージに戻し、演算ステージの前のス
テージで保持するまでの動作が第1の命令であるロード
命令のブロック転送中に行われ、該ブロック転送が終了
したときには読み出された有効データを第2の命令が直
ちに受け取り演算を実行することが可能であるので請求
項2の動作はペナルティ増加とはならず、パイプライン
処理装置の処理速度の低下を防ぐことができる。
According to the invention of claim 3, the operation of returning the second instruction to the stage before the operation stage and holding it in the stage before the operation stage is during the block transfer of the load instruction which is the first instruction. When the block transfer is completed, the second instruction can immediately receive the read valid data and execute the operation. Therefore, the operation of claim 2 does not increase the penalty, and the pipeline processing is performed. It is possible to prevent the processing speed of the device from decreasing.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明に従うパイプライン処理装置の第2の実
施例の構成図。
FIG. 1 is a configuration diagram of a second embodiment of a pipeline processing device according to the present invention.

【図2】データ依存関係がある命令列。FIG. 2 is an instruction sequence having a data dependency relationship.

【図3】第2の実施例におけるキャッシュヒット時のタ
イムチャート。
FIG. 3 is a time chart at the time of a cache hit in the second embodiment.

【図4】第2の実施例におけるキャッシュミス時のタイ
ムチャート。
FIG. 4 is a time chart when a cache miss occurs in the second embodiment.

【図5】本発明に従うパイプライン処理装置の第1の実
施例の構成図。
FIG. 5 is a configuration diagram of a first embodiment of a pipeline processing device according to the present invention.

【図6】第1の実施例におけるキャッシュヒット時のタ
イムチャート。
FIG. 6 is a time chart when a cache hit occurs in the first embodiment.

【図7】第1の実施例におけるキャッシュミス時のタイ
ムチャート。
FIG. 7 is a time chart when a cache miss occurs in the first embodiment.

【図8】従来技術に従うパイプライン処理装置の構成
図。
FIG. 8 is a configuration diagram of a pipeline processing device according to a conventional technique.

【図9】従来技術におけるキャッシュヒット時のタイム
チャート。
FIG. 9 is a time chart when a cache hit occurs in the conventional technique.

【図10】従来技術におけるキャッシュミス時のタイム
チャート。
FIG. 10 is a time chart when a cache miss occurs in the conventional technique.

【図11】第2の実施例においてデータ読み出しとキャ
ッシュのヒット判定が2サイクル離れた場合のキャッシ
ュヒット時のタイムチャート。
FIG. 11 is a time chart when a cache hit occurs when data read and cache hit determination are separated by two cycles in the second embodiment.

【図12】第2の実施例においてデータ読み出しとキャ
ッシュのヒット判定が2サイクル離れた場合のキャッシ
ュミス時のタイムチャート。
FIG. 12 is a time chart when a cache miss occurs when data read and cache hit determination are separated by two cycles in the second embodiment.

【図13】従来技術においてデータ読み出しとキャッシ
ュのヒット判定が2サイクル離れた場合のキャッシュヒ
ット時のタイムチャート。
FIG. 13 is a time chart when a cache hit occurs when data read and cache hit determination are separated by two cycles in the prior art.

【図14】従来技術においてデータ読み出しとキャッシ
ュのヒット判定が2サイクル離れた場合のキャッシュミ
ス時のタイムチャート。
FIG. 14 is a time chart when a cache miss occurs when data read and cache hit determination are separated by two cycles in the prior art.

【符号の説明】[Explanation of symbols]

1、12、13、27…選択回路、 2、3、4、5、6、7、10、14、16、19、2
6…ステージ保持回路、 8…プログラムカウンタ、 9…命令キャッシュメモリ、 11…レジスタ選択回路、 15…演算装置、 17…データキャッシュメモリ、 18…データアドレスタグ、 20…ヒット判定回路、 21…レジスタファイル、 22…再実行制御装置、 23…制御装置、 24…依存関係検出回路、 25…先行演算制御装置、 28…データTLB。
1, 12, 13, 27 ... Selection circuit, 2, 3, 4, 5, 6, 7, 10, 14, 16, 19, 2
6 ... Stage holding circuit, 8 ... Program counter, 9 ... Instruction cache memory, 11 ... Register selection circuit, 15 ... Arithmetic unit, 17 ... Data cache memory, 18 ... Data address tag, 20 ... Hit determination circuit, 21 ... Register file 22 ... Re-execution control device, 23 ... Control device, 24 ... Dependency detection circuit, 25 ... Preceding operation control device, 28 ... Data TLB.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 松原 健二 神奈川県秦野市堀山下1番地 株式会社日 立製作所汎用コンピュータ事業部内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Kenji Matsubara, 1 Horiyamashita, Horiyamashita, Hadano, Kanagawa Prefecture

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】第1の命令と第1の命令の次に実行する第
2の命令とをそれぞれ複数のステージに分割してパイプ
ライン処理するパイプライン処理装置であり、第1の命
令がロード命令であり第2の命令が第1の命令であるロ
ード命令によって読み出されるデータを使用する命令で
あるときに、該ロード命令のキャッシュのヒット判定が
判別する前に、第2の命令の演算を実行するステージの
演算手段に読み出しデータを送るバイパスと、該バイパ
スを用いて読み出しデータを演算手段に送り演算させる
ように制御する制御手段とを有することを特徴とするパ
イプライン処理装置。
1. A pipeline processing device that divides a first instruction and a second instruction to be executed after the first instruction into a plurality of stages to perform pipeline processing, wherein the first instruction is loaded. When the second instruction is an instruction and uses the data read by the load instruction which is the first instruction, the operation of the second instruction is performed before the cache hit determination of the load instruction is determined. A pipeline processing device comprising: a bypass for sending read data to a computing means of a stage to be executed; and a control means for controlling the sending of the read data to the computing means by using the bypass.
【請求項2】請求項1のパイプライン処理装置におい
て、第2の命令が第1の命令であるロード命令によって
読み出されるデータを使用する命令であり、第1の命令
であるロード命令がキャッシュミスを起こしたときに、
第2の命令を演算ステージ以降のステージから演算ステ
ージの前のステージに戻すパスと、該パスを用いて第2
の命令を演算ステージの前のステージに戻し第2の命令
を再実行するように制御する制御手段とを有することを
特徴とするパイプライン処理装置。
2. The pipeline processing device according to claim 1, wherein the second instruction is an instruction that uses data read by a load instruction that is the first instruction, and the load instruction that is the first instruction is a cache miss. When you wake up
A path for returning the second instruction from the stage after the operation stage to the stage before the operation stage and a second path using the path
And a control means for controlling so that the second instruction is returned to the stage before the operation stage and the second instruction is re-executed.
【請求項3】請求項2のパイプライン処理装置におい
て、第1の命令であるロード命令のキャッシュミスによ
って発生したブロック転送中に、第2の命令を演算ステ
ージより前のステージに戻し、演算ステージの前のステ
ージで保持しておき、ブロック転送が終了した時には読
み出された有効データを第2の命令が直ちに受け取り演
算を実行するように制御する制御手段を有することを特
徴とするパイプライン処理装置。
3. The pipeline processing apparatus according to claim 2, wherein the second instruction is returned to a stage prior to the operation stage during block transfer caused by a cache miss of the load instruction which is the first instruction. Pipeline processing, characterized in that it has control means for holding the data in the stage prior to the above, and when the block transfer is completed, the second instruction immediately receives the valid data read and executes the operation. apparatus.
JP11621394A 1994-05-30 1994-05-30 Pipeline processing method Pending JPH07319693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11621394A JPH07319693A (en) 1994-05-30 1994-05-30 Pipeline processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11621394A JPH07319693A (en) 1994-05-30 1994-05-30 Pipeline processing method

Publications (1)

Publication Number Publication Date
JPH07319693A true JPH07319693A (en) 1995-12-08

Family

ID=14681640

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11621394A Pending JPH07319693A (en) 1994-05-30 1994-05-30 Pipeline processing method

Country Status (1)

Country Link
JP (1) JPH07319693A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7213130B2 (en) 2003-02-26 2007-05-01 Kabushiki Kaisha Toshiba Instruction rollback processor system, an instruction rollback method and an instruction rollback program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7213130B2 (en) 2003-02-26 2007-05-01 Kabushiki Kaisha Toshiba Instruction rollback processor system, an instruction rollback method and an instruction rollback program

Similar Documents

Publication Publication Date Title
US5003462A (en) Apparatus and method for implementing precise interrupts on a pipelined processor with multiple functional units with separate address translation interrupt means
US6233670B1 (en) Superscalar processor with direct result bypass between execution units having comparators in execution units for comparing operand and result addresses and activating result bypassing
EP0789299A1 (en) Method for executing speculative load instructions in high-performance processors
US8171266B2 (en) Look-ahead load pre-fetch in a processor
US6760835B1 (en) Instruction branch mispredict streaming
EP0675434B1 (en) Processing system and method of operation
EP0588252B1 (en) Apparatus for Processing Instructions with Improved Interrupt Handling
US20060224870A1 (en) Information processing device
JPH06236267A (en) Method and system for enhancement of dispatch efficiency of instruction device in superscalar processor system
JP2596712B2 (en) System and method for managing execution of instructions, including adjacent branch instructions
US20070079076A1 (en) Data processing apparatus and data processing method for performing pipeline processing based on RISC architecture
US5699538A (en) Efficient firm consistency support mechanisms in an out-of-order execution superscaler multiprocessor
US5678016A (en) Processor and method for managing execution of an instruction which determine subsequent to dispatch if an instruction is subject to serialization
US6484256B1 (en) Apparatus and method of branch prediction utilizing a comparison of a branch history table to an aliasing table
US5878242A (en) Method and system for forwarding instructions in a processor with increased forwarding probability
US6098168A (en) System for completing instruction out-of-order which performs target address comparisons prior to dispatch
JPH07319693A (en) Pipeline processing method
US5926645A (en) Method and system for enabling multiple store instruction completions in a processing system
US7130988B2 (en) Status register update logic optimization
JP2894438B2 (en) Pipeline processing equipment
JP2783285B2 (en) Information processing device
JP4092112B2 (en) Arithmetic processing unit
US6560695B1 (en) Dynamic pipe staging adder
JPH05298097A (en) Information processor
JPH08272608A (en) Pipeline processing equipment