JPH03212734A - Data processor - Google Patents
Data processorInfo
- Publication number
- JPH03212734A JPH03212734A JP937790A JP937790A JPH03212734A JP H03212734 A JPH03212734 A JP H03212734A JP 937790 A JP937790 A JP 937790A JP 937790 A JP937790 A JP 937790A JP H03212734 A JPH03212734 A JP H03212734A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- branch
- stage
- address
- output
- 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
Links
Landscapes
- Advance Control (AREA)
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明はデータ処理装置に関し、更に詳述すれば、分岐
命令処理機構によりパイプライン処理の乱れを抑制して
多段パイプライン処理機構を効率的に動作させて高度の
処理能力を発揮し得るデータ処理装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a data processing device, and more specifically, it suppresses disturbances in pipeline processing by a branch instruction processing mechanism and makes the multi-stage pipeline processing mechanism efficient. The present invention relates to a data processing device that can be operated to exhibit high processing power.
第6図は従来のデータ処理装置において一般的に採用さ
れているパイプライン処理機構の概略の構成例を示す模
式図である。FIG. 6 is a schematic diagram showing a general configuration example of a pipeline processing mechanism generally employed in conventional data processing devices.
図中11は命令フェッチステージ(IFステージ)12
は命令デコードステージ(Dステージ)、13はオペラ
ンドアドレス計算ステージ(Aステージ)、14はオペ
ラントフェッチステージ(Fステージ)、15は命令実
行ステージ(Eステージ)である。11 in the figure is the instruction fetch stage (IF stage) 12
1 is an instruction decode stage (D stage), 13 is an operand address calculation stage (A stage), 14 is an operant fetch stage (F stage), and 15 is an instruction execution stage (E stage).
[Fステージ11は図示しないメモリから命令コードを
フェッチしてDステージ12へ出力する。Dステージ1
2はIPステージ11がフェッチした命令コートをデコ
ードし、そのデコード結果をAステージ13へ出力する
。Aステージ13は命令コード中で指定されたオペラン
ドの実効アドレスを計算し、その結果をFステージ14
へ出力する。Fステージ14はAステージ13から入力
されたオペランドアドレスに従ってメモリからオペラン
ドアドレスをフェッチし、Eステージ15へ出力する。[The F stage 11 fetches an instruction code from a memory (not shown) and outputs it to the D stage 12. D stage 1
2 decodes the instruction code fetched by the IP stage 11 and outputs the decoding result to the A stage 13. The A stage 13 calculates the effective address of the operand specified in the instruction code, and sends the result to the F stage 14.
Output to. The F stage 14 fetches the operand address from the memory according to the operand address input from the A stage 13 and outputs it to the E stage 15.
Eステージ15はFステージ14から入力されたオペラ
ンドを対象として命令コード中で指定された演算を実行
し、更に必要な場合はその演算結果をメモリにストアす
る。The E stage 15 executes the operation specified in the instruction code on the operand input from the F stage 14, and stores the operation result in the memory if necessary.
上述のように、従来のデータ処理装置ではパイプライン
処理機構により各命令で指定される処理は一例として5
つに分解されて順次処理される。As mentioned above, in conventional data processing devices, the processing specified by each instruction by the pipeline processing mechanism is, for example, 5.
It is decomposed into parts and processed sequentially.
それぞれの5つの処理は異なる命令に対しては並列動作
させることが可能であり、理想的には5段のパイプライ
ン処理機構により5個の命令を同時並列的に処理して、
パイプライン処理を採用しない場合に比して最大で5倍
の処理能力を有するデータ処理装置が得られる。Each of the five processes can be operated in parallel for different instructions, and ideally, five instructions can be processed in parallel using a five-stage pipeline processing mechanism.
A data processing device can be obtained that has up to five times the processing capacity as compared to the case where pipeline processing is not adopted.
パイプライン処理の手法は上述の如く、データ処理装置
の処理能力を大幅に向上させ得るため、処理速度が高い
データ処理装置では広く採用されている。As described above, the pipeline processing method can significantly improve the processing capacity of a data processing device, and is therefore widely employed in data processing devices with high processing speeds.
しかし、パイプライン処理は常に理想的な状態で動作す
るという保証はない。パイプライン処理における問題の
一つとして、分岐命令の処理が挙げられる。However, there is no guarantee that pipeline processing always operates under ideal conditions. One of the problems in pipeline processing is the processing of branch instructions.
たとえば、第6図に示す如き構成のパイプライン処理機
構により分岐命令をEステージ15において処理した後
、別の分岐命令をIFステージ11が処理する場合には
、パイプライン処理が大きく乱れる。その様子を第7図
の従来のデータ処理装置における分岐命令の処理手順を
示す模式図を参照して説明する。For example, if a branch instruction is processed in the E stage 15 by the pipeline processing mechanism configured as shown in FIG. 6, and then another branch instruction is processed in the IF stage 11, the pipeline processing will be greatly disrupted. The situation will be explained with reference to FIG. 7, which is a schematic diagram showing a branch instruction processing procedure in a conventional data processing device.
第7図においては、命令1)13及び命令lNl2が分
岐命令である。命令rN3が実行されると、既にパイプ
ライン処理が開始されている命令IN4. 命令IN
S、 命令IN6. 命令IN7はキャンセルされ
、命令IN3の分岐先命令である命令INIIの処理が
新たにIFステージ11から開始される。In FIG. 7, instruction 1)13 and instruction lNl2 are branch instructions. When instruction rN3 is executed, instructions IN4. Command IN
S, Instruction IN6. The instruction IN7 is canceled, and the processing of the instruction INII, which is the branch destination instruction of the instruction IN3, is newly started from the IF stage 11.
命令IN3がEステージ15で実行されてから命令IN
IIがEステージ15で実行されるまでには4命令分の
処理時間が無駄になる。After instruction IN3 is executed at E stage 15, instruction IN
Until II is executed at E stage 15, processing time equivalent to four instructions is wasted.
命令lNl2についても同様に4命令分の処理時間が無
駄になる。Similarly, processing time for four instructions is wasted for the instruction lNl2.
この無駄時間は分岐命令の実行後に処理されるべき命令
のフェッチが分岐命令に対する全パイプライン処理が終
了した後に行われるために生しる。This dead time occurs because the instruction to be processed after execution of the branch instruction is fetched after all pipeline processing for the branch instruction is completed.
従って、パイプライン処理の段数が多ければ多い程、無
駄時間も長くなる。Therefore, the greater the number of pipeline processing stages, the longer the wasted time.
このような、分岐命令の実行に際するパイプライン処理
の乱れを抑制する目的で、IFステージ11において命
令をフェッチする時点で分岐命令の分岐先を予測し、そ
の分岐命令がEステージ15において実行される以前に
命令のフェッチ先を予め分岐先へ変更する先行分岐処理
が採用されている。In order to suppress such disturbances in pipeline processing when executing a branch instruction, the branch destination of the branch instruction is predicted at the time the instruction is fetched at the IF stage 11, and the branch instruction is executed at the E stage 15. Advance branch processing is employed in which the fetch destination of an instruction is changed to the branch destination in advance before the instruction is executed.
このような先行分岐処理をプリブランチ処理と称する。Such advance branch processing is referred to as pre-branch processing.
第8図は上述のようなプリブランチ処理に使用される従
来のデータ処理装置のブランチターゲットバッファ(B
TB)及び命令フェッチ部の構成例を示す模式図である
。FIG. 8 shows a branch target buffer (B
TB) and a schematic diagram showing a configuration example of an instruction fetch unit.
BTB160は、複数のエントリにて構成され、それぞ
れのエントリは分岐命令アドレスフィールド。BTB 160 is composed of multiple entries, each entry being a branch instruction address field.
エントリが有効であるか否かを示す有効ビットフィール
ド及び分岐先アドレスフィールドにて構成されている。It consists of a valid bit field that indicates whether the entry is valid or not, and a branch destination address field.
分岐命令アドレスフィールドには、分岐命令のアドレス
が登録される。分岐先アドレスフィールドにはそれぞれ
の分岐命令が分岐した場合の分岐先アドレスが登録され
る。The address of a branch instruction is registered in the branch instruction address field. A branch destination address when each branch instruction branches is registered in the branch destination address field.
Eステージ15において分岐命令が分岐を発生すると、
その命令のアドレスと分岐先アドレスとが対になってそ
れぞれBTB160の分岐命令アドレスフィールドと分
岐先アドレスフィールドとに登録され、対応する有効ビ
ットフィールドのビットが“1“にセットされる。When a branch instruction causes a branch in E stage 15,
The address of the instruction and the branch destination address are registered as a pair in the branch instruction address field and the branch destination address field of the BTB 160, respectively, and the bit of the corresponding valid bit field is set to "1".
1Fステージ11による命令のフェッチは、フェッチす
べき命令のアドレスをカウンタ口INPC115にセッ
トすることにより行われる。Fetching of an instruction by the 1F stage 11 is performed by setting the address of the instruction to be fetched in the counter INPC 115.
IPステージ11が命令をフェッチすると、カウンタQ
INPC115の値であるその命令のアドレスがデコー
ダ190によりデコードされ、このデコード結果に従っ
てBTB160の対応するエントリが指定される。When IP stage 11 fetches an instruction, counter Q
The address of the instruction, which is the value of INPC 115, is decoded by decoder 190, and the corresponding entry in BTB 160 is designated according to the decoding result.
指定されたBT3160中の分岐命令アドレスフィール
ドの値は比較器191へ出力されるが、比較器191に
はカウンタQINPC115の値も与えられており、両
者は比較器191で比較される。The value of the branch instruction address field in the designated BT 3160 is output to the comparator 191, but the comparator 191 is also given the value of the counter QINPC 115, and the two are compared by the comparator 191.
この比較器191による比較結果が一致し、且つ対応す
る有効ビットフィールドのビットが“1″であれば、プ
リブランチが発生する。即ち、比較器191の比較結果
が一致したことを示す信号“l”と有効ビットフィール
ドの値“1”とが共にANDゲート192へ入力される
ので、その“1″出力がプリブランチ発生信号として分
岐先アドレスレジスタ161に与えられると共に命令フ
ェッチシーケンスがBTB160中の分岐先アドレスフ
ィールドの値に変更される。If the comparison result by the comparator 191 matches and the corresponding bit in the valid bit field is "1", a pre-branch occurs. That is, since the signal "l" indicating that the comparison result of the comparator 191 matches and the value "1" of the valid bit field are both input to the AND gate 192, the "1" output is used as the pre-branch generation signal. The instruction fetch sequence is applied to the branch destination address register 161 and the instruction fetch sequence is changed to the value of the branch destination address field in the BTB 160.
具体的には、分岐先アドレスレジスタ161はBTB1
60中の分岐先アドレスフィールドからの出力をラッチ
し、このアドレスの命令、即ち分岐先命令をフェッチし
て命令キュー112に格納する。Specifically, the branch destination address register 161 is BTB1.
The output from the branch destination address field in 60 is latched, and the instruction at this address, that is, the branch destination instruction, is fetched and stored in the instruction queue 112.
このようにして分岐先命令が命令キュー112に格納さ
れると、それに対応して入力ポインタP1164がイン
クリメントされる。この現在入カポインタP1164が
指示している位置の一つ前の位置には分岐命令が格納さ
れている。即ち、命令キュー112には分岐命令とこの
分岐命令からの分岐先命令とが連続して格納されている
。従って、Dステージ12以降の各ステージにおける処
理を混乱させることなく、命令シーケンスを変更するこ
とが可能である。When the branch destination instruction is stored in the instruction queue 112 in this manner, the input pointer P1164 is incremented accordingly. A branch instruction is stored at the position immediately before the position pointed to by the current input pointer P1164. That is, the instruction queue 112 stores a branch instruction and a branch destination instruction from the branch instruction consecutively. Therefore, it is possible to change the instruction sequence without disrupting the processing at each stage after the D stage 12.
上述の如く、プリブランチ処理の採用により、命令フェ
ッチステージにおいて命令フェッチシーケンスを予め分
岐先へ切換えれば、パイプライン処理の効率は一般的に
向上する。As described above, by employing pre-branch processing, the efficiency of pipeline processing is generally improved by switching the instruction fetch sequence to the branch destination in advance at the instruction fetch stage.
しかし、命令キュー112の各エントリの命令フィール
ドのサイズが命令フェッチのデータサイズ以下である場
合、たとえば命令が4バイト(32ビツト)単位でフェ
ッチされ、一方命令キュー112の命令フィールドのサ
イズが2ハイド(16ビツト)であるような場合には、
分岐命令の最後が命令フェッチのデータサイズの境界で
終わらない場合、あるいは分岐先命令の先頭が命令フェ
ッチのデータサイズの境界から始まらない場合等が有り
得る。However, if the size of the instruction field of each entry in the instruction queue 112 is less than or equal to the instruction fetch data size, for example, instructions are fetched in units of 4 bytes (32 bits), while the size of the instruction field in the instruction queue 112 is 2 bytes (32 bits). (16 bits),
There may be cases where the end of a branch instruction does not end at the boundary of the data size of instruction fetch, or the beginning of the branch destination instruction does not start from the boundary of data size of instruction fetch.
このような場合には、命令キューの内部で分岐命令と分
岐先命令との間に無効なコードが介在することになるの
で、命令キューの制御が不可能になる。In such a case, an invalid code will be interposed between the branch instruction and the branch destination instruction within the instruction queue, making it impossible to control the instruction queue.
本発明はこのような事情に鑑みてなされたものであり、
命令キューの内部において分岐命令と分岐先命令との間
に無効なコードが介在するような状況においても、命令
キューの制御が可能なデータ処理装置の提供を目的とす
る。The present invention was made in view of these circumstances, and
An object of the present invention is to provide a data processing device capable of controlling an instruction queue even in a situation where an invalid code exists between a branch instruction and a branch destination instruction inside the instruction queue.
本発明のデータ処理装置では、分岐発生時専用の出力ポ
インタを備え、分岐発生時にはその分岐の原因となった
命令の命令キューでの格納位置と分岐先命令のアドレス
とに基づいて分岐先命令の格納位置を分岐発生時専用の
出力ポインタに与える。The data processing device of the present invention includes an output pointer dedicated to when a branch occurs, and when a branch occurs, the branch destination instruction is selected based on the storage position in the instruction queue of the instruction that caused the branch and the address of the branch destination instruction. Give the storage location to the output pointer dedicated to when a branch occurs.
本発明のデータ処理装置では、分岐発生時に、命令キュ
ーの内部において分岐命令と分岐先命令との間に無効な
コードが介在する場合にも、分岐発生時専用の出力ポイ
ンタにより命令キューからの命令の出力位置が補正され
て分岐命令の先頭から出力され、正しくプリブランチが
行われる。In the data processing device of the present invention, even if an invalid code exists between the branch instruction and the branch destination instruction in the instruction queue when a branch occurs, the instruction from the instruction queue is retrieved using the output pointer dedicated to the branch occurrence. The output position of the branch instruction is corrected and output from the beginning of the branch instruction, and the pre-branch is performed correctly.
以下、本発明をその実施例を示す図面に基づいて詳述す
る。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described in detail below based on drawings showing embodiments thereof.
(1)「機能ブロックの構成」
第4図は本発明のデータ処理装置の一構成例を示すブロ
ック図である。(1) "Configuration of Functional Blocks" FIG. 4 is a block diagram showing an example of the configuration of the data processing device of the present invention.
本発明のデータ処理装置の内部を機能的に大きく分ける
と、命令フェッチ部51.命令デコード部52、 PC
計算部53.オペランドアドレス計算部54゜マイクロ
ROM部55.データ演算部56.外部バスインターフ
ェイス部57に分かれる。Functionally, the inside of the data processing device of the present invention can be roughly divided into an instruction fetch section 51. Instruction decoding unit 52, PC
Calculation section 53. Operand address calculation unit 54° micro ROM unit 55. Data calculation section 56. It is divided into an external bus interface section 57.
第4図では、その他にCPU外部ヘアドレスを出力する
ためのアドレス出力回路58と、CPU外部とデータを
入出力するためのデータ入出力回路59とを他の機能ブ
ロック部と分けて示した。In addition, in FIG. 4, an address output circuit 58 for outputting an address to the outside of the CPU, and a data input/output circuit 59 for inputting and outputting data to and from the outside of the CPU are shown separately from other functional blocks.
(1,1) r命令フェッチ部」
命令フェッチ部51にはブランチバッファ、命令キュー
とその制御部等があり、次にフェッチすべき命令のアド
レスを決定してブランチバッファあるいはCPU外部の
メモリから命令をフェッチする。(1, 1) r Instruction fetch unit The instruction fetch unit 51 includes a branch buffer, an instruction queue, and its control unit, and determines the address of the next instruction to be fetched and fetches the instruction from the branch buffer or memory outside the CPU. fetch.
またブランチバッファへの命令登録をも行う。It also registers instructions to the branch buffer.
ブランチバッファは小規模であるためセレクティプキャ
、シュとして動作する。ブランチバッファの動作の詳細
は特開昭63−56731号公報に開示されている。Since the branch buffer is small, it acts as a selective cache. Details of the operation of the branch buffer are disclosed in Japanese Patent Application Laid-Open No. 63-56731.
次にフェッチすべき命令のアドレスは、後述する命令キ
ュー112(第1図参照)へ入力すべき命令のアドレス
として専用のカウンタにて計算される。The address of the next instruction to be fetched is calculated by a dedicated counter as the address of the instruction to be input to the instruction queue 112 (see FIG. 1), which will be described later.
分岐あるいはジャンプが発生した場合には、新たな命令
のアドレスがPC計算部53またはデータ演算部56か
ら転送されてくる。When a branch or jump occurs, the address of a new instruction is transferred from the PC calculation unit 53 or the data calculation unit 56.
CPU外部のメモリから命令をフェッチする場合は、外
部バスインターフェイス部57を通じて、フェッチすべ
き命令のアドレスがアドレス出力回路58からCPU外
部へ出力されることにより、データ入出力回路59から
命令コードがフェッチされる。When fetching an instruction from a memory external to the CPU, the address of the instruction to be fetched is output from the address output circuit 58 to the outside of the CPU through the external bus interface section 57, so that the instruction code is fetched from the data input/output circuit 59. be done.
そして、バンファリングした命令コードの内、次にデコ
ードすべき命令コードが命令デコード部52へ出力され
る。Then, of the bumped instruction codes, the instruction code to be decoded next is output to the instruction decoding section 52.
(1,2) r命令デコード部」
命令デコード部52においては、基本的には16ビノト
(ハーフワード)単位で命令コードがデコートされる。(1, 2) r Instruction Decode Unit” In the instruction decode unit 52, instruction codes are basically decoded in units of 16 bits (halfwords).
このブロックには命令コードの第1ハーフワードに含ま
れるオペレーションコードをデコードするFH−デコー
ダ、第2.第3ハーフワードに含まれるオペレーション
コードをデコートするNFHWデコーダ、アドレッシン
グモードをデコードするアドレッシングモードデコーダ
が含まれる。This block includes an FH-decoder for decoding the operation code contained in the first halfword of the instruction code; It includes an NFHW decoder that decodes the operation code included in the third halfword, and an addressing mode decoder that decodes the addressing mode.
これらFH−デコーダ、NFH−デコーダ、アドレッシ
ングモードデコーダを一括して第1デコーダと称する。These FH-decoder, NFH-decoder, and addressing mode decoder are collectively referred to as a first decoder.
FHWデコーダあるいはNFH−デコーダの出力を更に
デコードしてマイクロROMのエントリアドレスを計算
する第2デコーダ及びオペランドアドレス計算の際のパ
イプラインコンフリクトをチエツクするアドレス計算コ
ンフリクトチエツク機構も命令デコード部52に含まれ
る。The instruction decoding unit 52 also includes a second decoder that further decodes the output of the FHW decoder or NFH-decoder to calculate the entry address of the micro ROM, and an address calculation conflict check mechanism that checks for pipeline conflicts during operand address calculation. .
命令デコード部52は命令フェッチ部51から入力され
た命令コードを2クロツク(1ステツプ)につき0〜6
バイトずつデコードする。デコード結果の内、データ演
算部56での演算に関係する情報がマイクロROM部5
5へ、オペランドアドレス計Xに関係する情報がオペラ
ンドアドレス計算部54へ、PC計算に関係する情報が
pc計算部53へそれぞれ出力される。The instruction decode unit 52 converts the instruction code input from the instruction fetch unit 51 into 0 to 6 bits per 2 clocks (1 step).
Decode byte by byte. Among the decoding results, information related to the calculation in the data calculation unit 56 is stored in the micro ROM unit 5.
5, information related to the operand address total X is output to the operand address calculation unit 54, and information related to PC calculation is output to the pc calculation unit 53.
(1,3) rマイクロROM部」
マイクロROM部55には、主にデータ演算部56を制
御するマイクロプログラムが格納されているマイクロR
OM、 マイクロシーケンサ、マイクロ命令デコーダ
等が含まれる。(1, 3) Micro ROM section" The micro ROM section 55 mainly stores a micro program that controls the data calculation section 56.
Includes OM, micro sequencer, micro instruction decoder, etc.
マイクロ命令はマイクロROMから2クロツク(1ステ
ツプ)に1度続出される。マイクロシーケンサはマイク
ロプログラムで示されるシーケンス処理の他に、例外1
割込及びトラップ(この3つを合わせてEITと称する
)の処理をハードウェア的に受付ける。またマイクロR
OM部55はストアバッファの管理も行う6
マイクロll0M部55には命令コードに依存しない割
込みあるいは演算実行結果によるフラッグ情報と、第2
デコーダの出力等の命令デコード部の出力が入力される
。Microinstructions are successively issued from the micro ROM once every two clocks (one step). In addition to the sequence processing indicated by the microprogram, the microsequencer also handles exception 1.
Processing of interrupts and traps (these three are collectively referred to as EIT) is accepted by hardware. Also Micro R
The OM unit 55 also manages the store buffer6.
The output of the instruction decoding unit, such as the output of the decoder, is input.
マイクロデコーダの出力は主にデータ演算部56に対し
て出力されるが、ジャンプ命令の実行による他の先行処
理中止情報等の一部の情報は他のブロックへも出力され
る。The output of the micro-decoder is mainly output to the data calculation unit 56, but some information such as other preceding processing stop information due to execution of a jump instruction is also output to other blocks.
(1,4) rオペランドアドレス計算部」オペラン
ドアドレス計算部54は命令デコード部52のアドレス
デコーダ等から出力されたオペランドアドレス計算に関
係する情報によりハードワイヤード制御される。このブ
ロックではオペランドのアドレス計算に関するほとんど
の処理が行われる。メモリ間接アドレッシングのための
メモリアクセスのアドレス及びオペランドアドレスがメ
モリにマツプされたI/CII域に入るか否かのチエツ
クもこのオペランドアドレス計算部54で行われる。(1, 4) r Operand Address Calculation Unit The operand address calculation unit 54 is hard-wired controlled by information related to operand address calculation output from the address decoder of the instruction decoding unit 52, etc. This block performs most of the processing related to operand address calculation. The operand address calculation unit 54 also checks whether the memory access address and operand address for memory indirect addressing fall within the I/CII area mapped to memory.
アドレス計算結果は外部バスインターフェイス部57へ
送られる。アドレス計算に必要な汎用レジスタ及びプロ
グラムカウンタの値はデータ演算部から入力される。The address calculation result is sent to the external bus interface section 57. The values of the general-purpose register and program counter necessary for address calculation are input from the data calculation section.
メモリ間接アドレッシングを行う際は外部バスインター
フェイス部57を通してアドレス出力回路5BからCP
U外部へ参照すべきメモリアドレスが出力されることに
より、データ入出力部59から入力された間接アドレス
値が命令デコード部52をそのまま通過してフェッチさ
れる。When indirect memory addressing is performed, the address output circuit 5B is connected to the CP through the external bus interface section 57.
By outputting the memory address to be referenced to the outside of the U, the indirect address value input from the data input/output unit 59 passes through the instruction decoding unit 52 as it is and is fetched.
(1,5) rPC計算部J
PC計算部53は命令デコード部52から出力されるP
C計算に関係する情報によりハードワイヤードに制御さ
れ、命令のPC値を計算する。(1, 5) rPC calculation unit J The PC calculation unit 53 receives the P output from the instruction decoding unit 52.
It is hardwired and controlled by information related to C computation and calculates the PC value of the instruction.
本発明のデータ処理装置は可変長命令セントを有してお
り、命令をデコードしなければその命令の長さが判らな
い。このため、PC計算部53は命令デコード部52か
ら出力される命令長をデコード中の命令のPC値に加算
することにより次の命令のPC値を作り出す。The data processing device of the present invention has a variable length instruction code, and the length of the instruction cannot be determined unless the instruction is decoded. Therefore, the PC calculation unit 53 creates the PC value of the next instruction by adding the instruction length output from the instruction decoding unit 52 to the PC value of the instruction being decoded.
pc計算部53の計算結果は各命令のpc値として命令
のデコード結果と共に出力される。The calculation result of the pc calculation unit 53 is output as the pc value of each instruction together with the decoding result of the instruction.
(1,6) rデータ演算部」
データ演算部56はマイクロプログラムにより制御され
、マイクロROM部55の出力情報に従って各命令の機
能を実現するに必要な演算をレジスタと演算器とで実行
する。(1, 6) r Data Operation Unit The data operation unit 56 is controlled by a microprogram, and uses registers and arithmetic units to execute operations necessary to realize the function of each instruction according to the output information of the micro ROM unit 55.
演算対象となるオペランドがアドレスあるいは即値であ
る場合は、データ演算部56はオペランドアドレス計算
部54で計算されたアドレスあるいは即値を外部バスイ
ンクフェイス部57を通じて得る。When the operand to be operated on is an address or an immediate value, the data calculation unit 56 obtains the address or immediate value calculated by the operand address calculation unit 54 through the external bus ink face unit 57.
また、演算対象となるオペランドがCPU外部のメモリ
にある場合は、アドレス計算部54で計算されたアドレ
スをバスインタフェイス部57がアドレス出力回路58
から出力することにより、データ演算部56はCPu外
部のメモリからフェッチしたオペランドをデータ入出力
回路59から得る。Furthermore, when the operand to be operated on is in a memory external to the CPU, the bus interface section 57 transfers the address calculated by the address calculation section 54 to the address output circuit 58.
By outputting from the data input/output circuit 59, the data calculation unit 56 obtains the operand fetched from the memory external to the CPU.
演算器としてはALU、 バレルシフク、プライオリ
ティエンコーダあるいはカウンタ、シフトレジスタなど
がある。レジスタと主な演算器との間は3バスで結合さ
れており、1つのレジスタ間演算を指示する1マイクロ
命令は2クロツク(1ステツプ)で処理される。Arithmetic units include ALU, barrel shift, priority encoder or counter, and shift register. The registers and the main arithmetic unit are connected by three buses, and one microinstruction instructing one register-to-register operation is processed in two clocks (one step).
データ演算時にCPU外部のメモリをアクセスする必要
がある場合は、マイクロプログラムの指示により外部ハ
スインターフェイス部57を通してアドレス出力回路5
8からアドレスがCPU外部へ出力されることにより、
データ入出力回路59を通して目的のデータがデータf
R算部56ヘフエノチされる。If it is necessary to access memory outside the CPU during data calculation, the address output circuit 5
By outputting the address from 8 to the outside of the CPU,
The target data is transferred to data f through the data input/output circuit 59.
The processing is performed in the R calculation section 56.
データ演算部56がCPU外部のメモリからデータをリ
ードする場合は、リードすべきデータのアドレスが^A
ルジスタ76にセットされ、そのアドレスが外部バスイ
ンターフェイス部57を通じてアドレス出力回路58か
ら出力されることにより、データがデータ入出力回路5
9から後述するDDハス108(第1図参照)を通して
[l[l12ルジスク77(第1図参照)へ取込まれる
。When the data calculation unit 56 reads data from a memory external to the CPU, the address of the data to be read is ^A.
The address is set in the register 76 and output from the address output circuit 58 through the external bus interface section 57, so that the data is transferred to the data input/output circuit 58.
9 through the DD lotus 108 (see FIG. 1), which will be described later, to the [l[l12 Luzisk 77 (see FIG. 1).
データ演算部56がCPU外部のメモリへデータをライ
トする場合は、ライトすべきデータのアドレスがAAI
レジスタ76にセットされ、そのアドレスが外部バスイ
ンターフェイス部57を通してアドレス出力回路58か
ら出力されることにより、後述するDDR2レジスタ7
8(第1図参照)にセットされているデータがDDババ
ス08を通じてデータ入出力回路59からCPU外部へ
出力される。When the data calculation unit 56 writes data to a memory external to the CPU, the address of the data to be written is AAI.
By setting the address in the register 76 and outputting it from the address output circuit 58 through the external bus interface section 57, the DDR2 register 7, which will be described later,
8 (see FIG. 1) is output from the data input/output circuit 59 to the outside of the CPU through the DD bus 08.
ジャンプ命令の処理あるいは例外処理等を行って新たな
命令アドレスをデータ演算部56が得た場合は、これを
命令フェッチ部11とPC計算部13とへ出力する。When the data calculation unit 56 obtains a new instruction address by processing a jump instruction or handling an exception, it outputs this to the instruction fetch unit 11 and the PC calculation unit 13.
(1,7) r外部バスインターフェイス部」外部バ
スインターフェイス部57は本発明のデータ処理装置の
外部バスでの通信を制御する。メモリのアクセスはすべ
てクロック同期で行われ、最小2クロックサイクル(1
ステツプ)で行うことができる。(1, 7) ``External Bus Interface Section'' The external bus interface section 57 controls communication on the external bus of the data processing apparatus of the present invention. All memory accesses are performed in clock synchronization, with a minimum of 2 clock cycles (1
This can be done in steps).
メモリに対するアクセス要求は命令フェッチ部51、オ
ペランドアドレス計算部54及びデータ演算部56から
独立に生じる。更に、オペランドプリフェッチを行うた
めのアクセス要求も生じる。Access requests to the memory are generated independently from the instruction fetch unit 51, operand address calculation unit 54, and data calculation unit 56. Furthermore, an access request for performing operand prefetch is also generated.
外部ハスインターフェイス部57はこれらのメモリアク
セス要求を調停する。更に、メモリとCPUとを結ぶデ
ータバスサイズである32ビツト(1ワード)の整置境
界を跨ぐメモリ番地にあるデータのアクセスは、このブ
ロック内で自動的にワード境界を跨ぐことが検知されて
2回のメモリアクセスに分解されて行われる。The external hash interface unit 57 mediates these memory access requests. Furthermore, accessing data at a memory address that straddles a 32-bit (1 word) aligned boundary, which is the data bus size that connects memory and the CPU, is automatically detected as straddling a word boundary within this block. It is divided into two memory accesses.
ブリフェッチされるオペランドとストアされるオペラン
ドとが重なる場合のコンフリクト防止処理及びストアオ
ペランドからフェッチオペランドへのバイパス処理もこ
の外部バスインターフェイス部57で行われる。The external bus interface unit 57 also performs conflict prevention processing when the pre-fetched operand and stored operand overlap and bypass processing from the store operand to the fetch operand.
命令フェッチ部51からのアクセス要求がある場合は、
後述するCAMレジスタ142(第1図参照)にアクセ
ス対象のアドレスがセットされる。アドレス計算部54
からのアクセス要求がある場合は、■^レジスタ125
にアクセス対象のアドレスがセントされる。データ演算
部56からのアクセス要求がある場合は、AAIレジス
タ76にアクセス対象のアドレスがセントされる。When there is an access request from the instruction fetch unit 51,
The address to be accessed is set in the CAM register 142 (see FIG. 1), which will be described later. Address calculation section 54
If there is an access request from ■^Register 125
The address to be accessed is sent to . When there is an access request from the data calculation unit 56, the address to be accessed is written to the AAI register 76.
オペランドのブリフェッチのためのアクセス要求がある
場合は、FAレジスタ127にセットされたアクセス対
象のアドレスがA^ババス07へ出力されることにより
、CPU外部のメモリから外部バスインターフェイス部
57ヘオペランドデータがフェッチされる6フエツチさ
れたオペランドデータはI)Dバス10gを通してS[
1ATA80へ入力される。また、アクセスに使用され
たAAババス07上のアドレスがSCAM79へ入力さ
れる。When there is an access request for prefetching an operand, the address to be accessed set in the FA register 127 is output to the A^ba bus 07, so that the operand data is transferred from the memory outside the CPU to the external bus interface section 57. The 6-fetched operand data is I) S[
1 Input to ATA80. Further, the address on the AA bus 07 used for access is input to the SCAM 79.
SCAM79と5DATA80とは一致指示線90によ
り相互に接続されている。5DATA80には整置され
た4バイトのデータが2個まで入る。SCAM79には
5DATA80中のデータに対応するアドレスが入る。SCAM79 and 5DATA80 are connected to each other by a match indicating line 90. Up to two pieces of aligned 4-byte data are stored in 5DATA80. SCAM79 contains an address corresponding to the data in 5DATA80.
5DATA80へのデータの入力は整置された上で行わ
れるが、そのデータをデータ演算部56が取出して使用
する際には、任意のアドレスから任意のデータ長(但し
、4バイト以内)を取出すことが可能である。Data is input to 5DATA 80 after being arranged, but when the data calculation unit 56 retrieves and uses the data, it retrieves any data length (within 4 bytes) from any address. Is possible.
(2)「パイプライン機構」
本発明のデータ処理装置のパイプライン処理機構は第5
図に模式的に示される如く構成されている。(2) “Pipeline mechanism” The pipeline processing mechanism of the data processing device of the present invention is the fifth
It is constructed as schematically shown in the figure.
命令のブリフェッチを行う命令フェッチステージ(IP
ステージ)31. 命令のデコードを行うデコードス
テージ(Dステージ)32. オペランドのアドレス
計算を行うオペランドアドレス計算ステージ(Aステー
ジ)33. マイクロROMアクセス(特にRステー
ジ36と称す)を行う部分とオペランドのブリフェッチ
(特にOFステージ37と称す)を行う部分とからなる
オペランドフェッチステージ(Fステージ)34.
命令を実行する実行ステージ(Eステージ)35の5段
構成を本発明のデータ処理装置のパイプライン処理の基
本とする。Instruction fetch stage (IP
Stage) 31. Decode stage (D stage) 32 to decode instructions. Operand address calculation stage (A stage) 33. Operand address calculation stage (A stage) for calculating addresses of operands. Operand fetch stage (F stage) 34 consisting of a part that performs micro ROM access (particularly referred to as R stage 36) and a part that performs operand brief fetch (particularly referred to as OF stage 37).
The five-stage configuration of the execution stage (E stage) 35 for executing instructions is the basis of the pipeline processing of the data processing apparatus of the present invention.
Eステージ35では1段のストアバッファがある他、高
機能命令の一部は命令の実行自体をパイプライン化する
ため、実際には5段以上のパイプライン処理効果がある
。In addition to a one-stage store buffer in the E stage 35, some of the high-performance instructions pipeline the instruction execution itself, so there is actually a pipeline processing effect of five or more stages.
各ステージは他のステージとは独立に動作し、理論上は
5つのステージが完全に独立して動作する。各ステージ
は1回の処理を最小2クロック(lステップ)で行うこ
とができる。従って、理想的には2クロツク(lステッ
プ)毎に次々とパイプライン処理が進行する。Each stage operates independently of the other stages, and in theory the five stages operate completely independently. Each stage can perform one process in a minimum of two clocks (l steps). Therefore, ideally, pipeline processing proceeds one after another every two clocks (l steps).
本発明のデータ処理装置には、メモリーメモリ間演算あ
るいはメモリ間接アドレッシング等の如く1回の基本パ
イプライン処理のみでは処理し得ない命令もあるが、本
発明のデータ処理装置はこれらの処理に対してもなるべ
く均衡のとれたパイプライン処理が行えるように設計さ
れている。また、本発明のデータ処理装置では複数のメ
モリオペランドを持つ命令に対しては、メモリオペラン
ドの数に基づいてデコード段階で複数のパイプライン処
理華位(ステップコード)に分解してパイプライン処理
を行う。The data processing device of the present invention has some instructions that cannot be processed with just one basic pipeline process, such as memory-to-memory operations or memory indirect addressing, but the data processing device of the present invention can handle these processes. It is designed to perform pipeline processing as balanced as possible. Furthermore, in the data processing device of the present invention, for an instruction having multiple memory operands, pipeline processing is performed by decomposing the instruction into multiple pipeline processing steps (step codes) at the decoding stage based on the number of memory operands. conduct.
パイプライン処理華位の分解方法に関しては特開昭63
−89932号公報に詳しく開示されている。Regarding the disassembly method of pipeline processing, see JP-A-63
This is disclosed in detail in Japanese Patent No.-89932.
IFステージ31からDステージ32へ渡される情報は
命令コード40そのものである。Dステージ32からA
ステージ33へ渡される情報は命令で指定された演算に
関するもの(Dコード41と称す)と、オペランドのア
ドレス計算に関係するもの(Aコード42と称す)との
2つがある。The information passed from the IF stage 31 to the D stage 32 is the instruction code 40 itself. D stage 32 to A
There are two types of information passed to the stage 33: information related to the operation specified by the instruction (referred to as D code 41) and information related to address calculation of the operand (referred to as A code 42).
Aステージ33からFステージ34へ渡される情報はマ
イクロプログラムルーチンのエントリアドレスあるいは
マイクロプログラムのパラメータ等を含むRコード43
と、オペランドのアドレスとアクセス方法指示情報等を
含むFコード44との2つである。The information passed from the A stage 33 to the F stage 34 is an R code 43 containing the entry address of the microprogram routine or the parameters of the microprogram.
and an F code 44 containing operand addresses, access method instruction information, and the like.
Fステージ34からEステージ35へ渡される情報は演
算制御情報とリテラル等を含むEコード45と、オペラ
ンドあるいはオペランドアドレス等を含むSコード46
との2つである。The information passed from the F stage 34 to the E stage 35 is an E code 45 containing arithmetic control information and literals, and an S code 46 containing operands or operand addresses.
There are two.
Eステージ35以外のステージで検出されたEITは、
そのコードがEステージ35へ到達する迄はEIT処理
を起動しない。Eステージ35で処理されている命令の
みが実行段階の命令であり、IFステージ31からFス
テージ34までの間で処理されている命令はまだ実行段
階に至っていないからである。従って、Eステージ35
以外で検出されたEITは、それが検出されたことがス
テップコード中に記録されて次のステージへ伝えられる
のみである。EIT detected at stages other than E stage 35 is
EIT processing is not started until the code reaches the E stage 35. This is because only the instructions being processed in the E stage 35 are in the execution stage, and the instructions being processed from the IF stage 31 to the F stage 34 have not yet reached the execution stage. Therefore, E stage 35
For EITs detected outside of the above steps, the fact that they have been detected is recorded in the step code and transmitted to the next stage.
(2,1) rパイプライン処理単位」(2,1,1
) rステップコードへの命令の分解」本発明のデー
タ処理装置では、上述のパイプライン機構の特徴を生か
したパイプライン処理を行う。(2,1) r pipeline processing unit” (2,1,1
) Decomposition of instructions into r-step codes The data processing device of the present invention performs pipeline processing that takes advantage of the features of the pipeline mechanism described above.
Dステージ32では“2ハイドの命令基本部+θ〜4バ
イトのアドレッシング拡張部”、“多段間接モード指定
部子アドレッシング拡張部”又は命令固有の拡張部を1
つのデコード単位として処理する。In the D stage 32, "2 hide instruction basic part + θ ~ 4 byte addressing extension part", "multi-stage indirect mode specification part addressing extension part" or instruction-specific extension part is 1
Processed as one decoding unit.
各回のデコード結果をステップコードと称し、Aステー
ジ33以降ではこのステップコードをパイプライン処理
の単位としている。ステップコードの数は命令毎に固有
であり、多段間接モード指定を行わない場合は、1つの
命令は最小1個、最大3個のステップコードに分かれる
。多段間接モード指定が行われた場合はそれだけステッ
プコードが増加する。The decoding result of each time is called a step code, and from the A stage 33 onwards, this step code is used as a unit of pipeline processing. The number of step codes is unique for each instruction, and if the multi-stage indirect mode is not specified, one instruction is divided into a minimum of 1 step code and a maximum of 3 step codes. When the multi-stage indirect mode is specified, the step code increases accordingly.
(2,1,2) rプログラムカウンタの管理」本発
明のデータ処理装置のパイプライン上に存在するステッ
プコードは全て別命令に対するものである可能性があり
、このためプログラムカウンタの値はステップコード毎
に管理される。全てのステップコードは、そのステップ
コードを発生した命令のプログラムカウンタ値を有する
。(2, 1, 2) ``Program counter management'' It is possible that all the step codes existing on the pipeline of the data processing device of the present invention are for different instructions, and therefore the value of the program counter is the same as the step code. managed separately. Every step code has the program counter value of the instruction that generated the step code.
ステップコードに付属してパイプラインの各ステージを
流れるプログラムカウンタ値はステンブブログラムカウ
ンタ(SPC) と称する。SPCはパイプラインの各
ステージ間を次々と受渡されていく。The program counter value that accompanies the step code and flows through each stage of the pipeline is referred to as the program counter (SPC). SPCs are passed between each stage of the pipeline one after another.
(2,2) r各パイプラインステージの処理J各パ
イプラインステージの入出カステップコードには第5図
に示したように便宜上名前が付けられている。(2, 2) r Processing of each pipeline stage The input/output step codes of each pipeline stage are named for convenience as shown in FIG.
また、ステップコードはオペレーションコードに関する
処理を行い、マイクロプログラムのエントリアドレス及
びEステージ35に対するパラメータ等になる系列と、
Eステージ35のマイクロ命令に対するオペランドにな
る系列との2系列がある。In addition, the step code performs processing related to the operation code, and includes a sequence that becomes the entry address of the microprogram, parameters for the E stage 35, etc.
There are two series: a series that becomes an operand for the microinstruction in the E stage 35;
(2,2,1) r命令フェッチステージ」命令フェ
ッチステージ(IFステージ)31は命令をメモリある
いはブランチバッファからフェッチして命令キュー11
2(第1図参照)へ入力し、Dステージ32に対して命
令コードを出力する。命令キュー112への入力は整置
された4ハイド単位で行われる。(2, 2, 1) r Instruction fetch stage The instruction fetch stage (IF stage) 31 fetches instructions from the memory or branch buffer and stores them in the instruction queue 11.
2 (see FIG. 1) and outputs the instruction code to the D stage 32. Input to the instruction queue 112 is performed in units of arranged 4 hides.
メモリから命令をフェッチする場合は、整置された4バ
イトにつき最小2クロック(1ステツプ)を要する。ブ
ランチターゲットバッファ160(BTB:第1図及び
第2図参照)がヒントした場合は、整置された4バイト
につき1クロツクでフェッチ可能である。命令キュー1
12の出力単位は2バイト毎lこ可変であり、2クロツ
クの間に最大6バイトまで出力できる。また、分岐の直
後には命令キュー112をバイパスして命令基本部2バ
イトを直接命令デコーダへ転送することも可能である。Fetching an instruction from memory requires a minimum of two clocks (one step) per four aligned bytes. If the branch target buffer 160 (BTB: see FIGS. 1 and 2) hints, it can be fetched in one clock per four aligned bytes. instruction queue 1
The output unit of 12 is variable every 2 bytes, and a maximum of 6 bytes can be output during 2 clocks. Immediately after branching, it is also possible to bypass the instruction queue 112 and directly transfer the 2 bytes of the instruction basic part to the instruction decoder.
ブランチターゲットバッファ160への命令の登録及び
クリア等の制御、ブリフェッチ先の命令のアドレスの管
理及び命令キュー112の制御もIPステージ31で行
う。The IP stage 31 also controls the registration and clearing of instructions in the branch target buffer 160, manages the address of the instruction to which the branch target buffer is fetched, and controls the instruction queue 112.
1Fステージ31で検出するErTには、命令をメモリ
からフェッチする際のハスアクセス例外あるいはメモリ
保護違反などによるアドレス変換例外がある。The ErT detected at the 1F stage 31 includes a hash access exception when fetching an instruction from memory, an address translation exception due to a memory protection violation, and the like.
(2,2,2) r命令デコードステージ」命令デコ
ードステージ(Dステージ)32はIFステージ31か
ら入力された命令コードをデコードする。(2, 2, 2) r Instruction Decode Stage The instruction decode stage (D stage) 32 decodes the instruction code input from the IF stage 31.
デコードは命令デコード部52のFHWデコーダ、NP
H−デコーダ及びアドレッシングモードデコーダを合わ
せた第1デコーダを使用して、2クロツク(1ステツプ
)単位に1度行ない、1回のデコード処理でθ〜6バイ
トの命令コードを消費する(RET命令の復帰先アドレ
スを含むステップコードの出力処理などでは命令コード
を消費しない)。Dステージ32は1回のデコードでA
ステージ33に対してアドレス計算情報としてのAコー
ド42である約35ビツトの制御コードと最大32ビツ
トのアドレス修飾情報と、オペレーションコードの中間
デコード結果としてのDコード41である約50ビツト
の制御コードと、8ビツトのリテラル情報とを出力する
。Decoding is done by the FHW decoder of the instruction decoding section 52, NP
The first decoder, which is a combination of the H-decoder and the addressing mode decoder, is used to perform decoding once every two clocks (one step), and one decoding process consumes θ to 6 bytes of instruction code (for the RET instruction). Instruction codes are not consumed in output processing of step codes including return destination addresses, etc.). D stage 32 is A with one decoding
For the stage 33, an approximately 35-bit control code that is an A code 42 as address calculation information, a maximum of 32 bits of address modification information, and an approximately 50-bit control code that is a D code 41 as an intermediate decoding result of the operation code. and 8-bit literal information.
Dステージ32では、各命令のPC計算部53の制御。In the D stage 32, the PC calculation unit 53 controls each instruction.
命令キュー112からの命令コードの出力処理をも行う
。It also performs output processing of instruction codes from the instruction queue 112.
Dステージ32で検出するEITには予約命令例外があ
る。また、IPステージ31から転送されてきた各種E
l↑はステップコード内にエンコードする処理をしてA
ステージ33へ転送する。The EIT detected in the D stage 32 includes a reserved instruction exception. In addition, various E
l↑ is encoded in the step code and A
Transfer to stage 33.
(2,2,3) rオペランドアドレス計算ステージ
」オペランドアドレス計算ステージ(Aステージ)33
は処理機能が大きく2つに分かれる。1つは命令デコー
ド部52の第2デコーダを使用してオペレーションコー
ドの後段デコードを行う処理で、他方はオペランドアド
レス計算部54でオペランドアドレスの計算を行う処理
である。(2, 2, 3) r operand address calculation stage” operand address calculation stage (A stage) 33
The processing functions are broadly divided into two. One is a process in which the second decoder of the instruction decoding unit 52 is used to decode the operation code at a later stage, and the other is a process in which the operand address calculation unit 54 calculates an operand address.
オペレーションコードの後段デコード処理はDコード4
1を入力とし、レジスタ、メモリの書込み予約及びマイ
クロプログラムのエントリアドレスとマイクロプログラ
ムに対するパラメータなどを含むRコード43の出力を
行う。なお、レジスタあるいはメモリの書込み予約は、
アドレス計算で参照したレジスタやメモリの内容がパイ
プライン上を先行する命令で書換えられることにより誤
ったアドレス計算が行われるのを防ぐためのものである
。レジスタあるいはメモリの書込み予約はデッドロック
を避けるため、ステ、プコード毎ではなく命令毎に行う
。The subsequent decoding process of the operation code is D code 4.
1 as an input, and outputs an R code 43 including register and memory write reservations, microprogram entry addresses, parameters for the microprogram, and the like. Note that register or memory write reservations are
This is to prevent incorrect address calculation from being performed due to the contents of the register or memory referenced in address calculation being rewritten by a preceding instruction on the pipeline. Register or memory write reservations are made for each instruction, not for each step code, to avoid deadlock.
レジスタ及びメモリへの書込み予約については特廓昭6
2−144394号に詳細に開示されている。For reservations for writing to registers and memory, please refer to Tokusho 6.
2-144394 in detail.
オペランドアドレス計算処理はAコード42を入力とし
、Aコード42に従いオペランドアドレス計算部54で
加算あるいはメモリ間接参照を組合わせてアドレス計算
を行い、その計算結果をFコード44として出力する。The operand address calculation process takes the A code 42 as input, performs address calculation in the operand address calculation unit 54 in accordance with the A code 42 by combining addition or memory indirect reference, and outputs the calculation result as the F code 44.
この際、アドレス計算に伴うレジスタ及びメモリの続出
し時にコンフリクトチエツクが行われ、先行命令がレジ
スタあるいはメモリへの書込み処理を終了していないた
めコンフリクトが指示されれば、先行命令がEステージ
35で書込み処理を終了するまで待機する。また、オペ
ランドアドレス及びメモリ間接参照のアドレスがメモリ
にマツプされたI10領域に入るか否かのチエツクも行
われる。At this time, a conflict check is performed when registers and memory are successively written due to address calculation, and if a conflict is indicated because the preceding instruction has not finished writing to the register or memory, the preceding instruction is at E stage 35. Wait until the write process is finished. It is also checked whether the operand address and the memory indirect reference address fall within the I10 area mapped to memory.
Aステージ33で検出するBITには予約命令例外特権
命令例外、バスアクセス例外、アドレス変換例外、メモ
リ間接アドレッシング時のオペランドブレイクポイント
ヒントによるデバッグトラップがある。Dコード41又
はAコード42自体がEITを発生したことを示してい
れば、Aステージ33はそのコードに対してアドレス計
算処理をせず、そのEITをRコード43及びFコード
44へ伝える。BITs detected in the A stage 33 include reserved instruction exceptions, privileged instruction exceptions, bus access exceptions, address translation exceptions, and debug traps based on operand breakpoint hints during memory indirect addressing. If the D code 41 or A code 42 itself indicates that an EIT has been generated, the A stage 33 transmits the EIT to the R code 43 and F code 44 without performing address calculation processing on that code.
(2,2,4) rマイクロROMアクセスステージ
」オペランドフェッチステージ(Fステージ)34も処
理が大きく2つに分かれる。一方はマイクロROMのア
クセス処理であり、特にRステージ36と称する。他方
はオペランドプリフェッチ処理であり、特にOFステー
ジ37と称する。Rステージ36と叶ステージ37とは
必ずしも同時に動作するわけではなく、メモリアクセス
権が獲得できるか否か等に依存して独立に動作する。(2, 2, 4) r Micro ROM Access Stage The operand fetch stage (F stage) 34 is also broadly divided into two processes. One is access processing of the micro ROM, and is particularly referred to as the R stage 36. The other is operand prefetch processing, particularly referred to as OF stage 37. The R stage 36 and the Kano stage 37 do not necessarily operate at the same time, but operate independently depending on whether memory access rights can be acquired or not.
Rステージ36の処理であるマイクロROMアクセス処
理は、Rコード43に対して次のEステージ35での実
行に使用する実行制御コードであるEコード45を生成
するためのマイクロROMアクセスとマイクロ命令デコ
ード処理とである。1つのRコード43に対する処理が
2つ以上のマイクロプログラムステップに分解される場
合、マイクロROMはEステージ35で使用され、次の
Rコード43はマイクロROMアクセス待ちになる。R
コード43に対するマイクロROMアクセスが行われる
のは、その前のEステージ35での最後のマイクロ命令
実行の時である。本発明のデータ処理装置では、はとん
どの基本命令は1マイクロプログラムステツプで行われ
るため、実際にはRコード43に対するマイクロROM
アクセスが次々と行われることが多い。Micro ROM access processing, which is the processing of the R stage 36, includes micro ROM access and microinstruction decoding for the R code 43 to generate an E code 45, which is an execution control code used for execution in the next E stage 35. processing. When processing for one R code 43 is decomposed into two or more microprogram steps, the micro ROM is used in the E stage 35, and the next R code 43 waits for micro ROM access. R
The micro ROM access to the code 43 is performed at the time of execution of the last microinstruction in the previous E stage 35. In the data processing device of the present invention, since most basic instructions are executed in one microprogram step, the microROM for the R code 43 is actually
Accesses are often made one after another.
Rステージ36で新たに検出するBITはない。Rコー
ド43が命令処理再実行型のEITを示している場合は
そのETT処理に対するマイクロプログラムが実行され
るので、Rステージ36はそのRコード43に従ったマ
イクロ命令をフェッチする。There is no new BIT detected in the R stage 36. If the R code 43 indicates an instruction processing re-execution type EIT, the microprogram for that ETT processing is executed, so the R stage 36 fetches the microinstruction according to the R code 43.
Rコード43が奇数アドレスジャンプトラップを示して
いる場合、Rステージ36はそれをEコード45によっ
て伝える。これはプリブランチに対するもので、Eステ
ージ35ではそのEコード45で分岐が生しなければそ
のプリブランチを有効として奇数アドレスジャンプトラ
ップを発生する。If R code 43 indicates an odd address jump trap, R stage 36 conveys it by E code 45. This is for a pre-branch, and in the E stage 35, if a branch does not occur in the E code 45, the pre-branch is made valid and an odd address jump trap is generated.
(2,2,5) rオペランドフェッチステージ」オ
ペランドフェッチステージ(OFステージ)37はFス
テージ34で行う上記の2つの処理の内のオペランドプ
リフェッチ処理を行う。(2, 2, 5) r Operand Fetch Stage The operand fetch stage (OF stage) 37 performs operand prefetch processing of the above two processes performed in the F stage 34.
オペランドプリフェッチはFコード44を入力とし、フ
ェッチしたオペランドとそのアドレスとをSコード46
として出力する。1つのFコード44ではワード境界を
跨いでもよいが、4ハイド以下のオペランドフェッチを
指定する。Fコード44にはオペランドのアクセスを行
うか否かの指定も含まれており、Aステージ33で計算
したオペランドアドレス自体あるいは即値をEステージ
35に転送する場合にはオペランドプリフェッチは行わ
ず、Fコード44の内容をSコード46として転送する
。Operand prefetch takes the F code 44 as input, and sends the fetched operand and its address to the S code 46.
Output as . One F code 44 may straddle word boundaries, but specifies operand fetch of 4 hides or less. The F code 44 also includes a designation as to whether or not to access the operand, and when the operand address itself or the immediate value calculated in the A stage 33 is transferred to the E stage 35, operand prefetch is not performed and the F code is The contents of 44 are transferred as S code 46.
ブリフェッチしようとするオペランドと、Eステージ3
5が書込み処理を行おうとするオペランドとが一致する
場合は、オペランドブリフェッチはメモリからは行われ
ずにバイパスして行われる。Operand to be briefetched and E stage 3
5 matches the operand for which write processing is to be performed, the operand briefetch is not performed from the memory but is performed in a bypass manner.
また、I/C1i域に対してはオペランドプリフェッチ
を遅延させ、先行命令の処理が全て完了するまで待って
オペランドフェッチを行う。Further, operand prefetch is delayed for the I/C1i area, and operand fetch is performed after waiting until all preceding instruction processing is completed.
叶ステージ37で検出されるBITには、ハスアクセス
例外、アドレス変換例外、オペランドプリフェッチに対
するブレイクポイントヒツトによるデバッグトラップが
ある。BITs detected in the leaf stage 37 include debug traps caused by hash access exceptions, address translation exceptions, and breakpoint hits for operand prefetch.
Fコード44がデバッグトラップ以外のBITを示して
いる場合はそれをSコード46へ転送し、オペランドプ
リフェッチは行われない。Fコード44がデバッグトラ
ップを示している場合はそのFコード44に対してEI
Tを示していない場合と同し処理をすると共にデバッグ
トラップがSコード46へ伝えられる。If the F code 44 indicates a BIT other than a debug trap, it is transferred to the S code 46 and no operand prefetch is performed. If the F code 44 indicates a debug trap, the EI for that F code 44 is
The same processing as in the case where T is not indicated is performed and a debug trap is transmitted to the S code 46.
(2,2,6) r実行ステージ」
実行ステージ(Eステージ)35はEコード45及びS
コード46を入力として動作する。このEステージ35
が命令を実行するステージであり、Fステージ34以前
のステージで行われた処理は全てEステージ35のため
の前処理である。Eステージ35でジャンプ命令が実行
されたり、あるいはBIT処理が起動されたりした場合
は、IPステージ31からFステージ34までの間に行
われた処理は全て無効化される。Eステージ35はマイ
クロプログラムにより制御され、Rコード43に示され
たマイクロプログラムのエントリアドレスからの一連の
マイクロプログラムを実行することにより命令を実行す
る。(2, 2, 6) r execution stage” Execution stage (E stage) 35 has E code 45 and S
It operates with code 46 as input. This E stage 35
is a stage for executing instructions, and all processing performed in stages before the F stage 34 is preprocessing for the E stage 35. When a jump instruction is executed or BIT processing is started at E stage 35, all processing performed from IP stage 31 to F stage 34 is invalidated. The E stage 35 is controlled by a microprogram and executes instructions by executing a series of microprograms starting from the entry address of the microprogram indicated in the R code 43.
マイクロROMの読出しとマイクロ命令の実行とはパイ
プライン化されて行われる。従って、マイクロプログラ
ムで分岐が起きた場合は、1マイクロステツプの空きが
できる。また、Eステージ35はデータ演算部56にあ
るストアバッファを利用して、4バイト以内のオペラン
ドストアと次のマイクロ命令実行とをパイプライン処理
することもできる。Reading of the micro ROM and execution of micro instructions are performed in a pipelined manner. Therefore, when a branch occurs in a microprogram, one microstep becomes vacant. Furthermore, the E stage 35 can perform pipeline processing for storing operands within 4 bytes and executing the next microinstruction by using the store buffer in the data calculation unit 56.
Eステージ35では、Aステージ33で行われたレジス
タ及びメモリに対する書込み予約をオペランドの書込み
後に解除される。In the E stage 35, the write reservation for registers and memory made in the A stage 33 is canceled after the operand is written.
また、条件分岐命令がEステージ35で分岐を発生した
場合は、その条件分岐命令に対する分岐予測が誤ってい
たのであるから、分岐履歴の書換えが行われる。Furthermore, if a conditional branch instruction causes a branch at the E stage 35, the branch history is rewritten because the branch prediction for that conditional branch instruction was incorrect.
Eステージ35で検出されるBITには、バスアクセス
例外、アドレス変換例外、デバッグトラップ。BITs detected at the E stage 35 include bus access exceptions, address translation exceptions, and debug traps.
奇数アドレスジャンプトラップ、予約機能例外。Odd address jump trap, reservation function exception.
不正オペランド例外、予約スタックフォーマット例外、
ゼロ除算トラップ、無条件トラップ、条件トラップ、遅
延コンテキストトラップ、外部割込遅延割込、リセット
割込、システム障害がある。illegal operand exception, reserved stack format exception,
There are divide-by-zero traps, unconditional traps, conditional traps, delayed context traps, external interrupt delayed interrupts, reset interrupts, and system failures.
Eステージ35で検出されたBITは全てBIT処理さ
れるが、Eステージ以前のIPステージ31からFステ
ージ34の間で検出され且つRコード43あるいはSコ
ード46に反映されているBITは必ずしもBIT処理
されるとは限らない。IFステージ31からFステージ
34の間で検出されたが、先行の命令がEステージ35
でジャンプ命令が実行されたなどの原因でEステージ3
5まで到達しなかったErTは全てキャンセルされる。All BITs detected in the E stage 35 are subjected to BIT processing, but BITs detected between the IP stage 31 before the E stage and the F stage 34 and reflected in the R code 43 or S code 46 are not necessarily BIT processed. There is no guarantee that it will be done. It was detected between IF stage 31 and F stage 34, but the preceding instruction was detected at E stage 35.
E stage 3 due to a jump instruction being executed in
All ErTs that have not reached 5 are cancelled.
そのEITを起こした命令はそもそも実行されなかった
ことになる。This means that the instruction that caused the EIT was never executed in the first place.
外部割込及び遅延割込は命令の切目でEステージ35に
直接受付けられ、マイクロプログラムにより必要な処理
が実行される。その他の各種BITの処理はマイクロプ
ログラムにより実行される。External interrupts and delayed interrupts are directly accepted by the E stage 35 at the instruction interval, and necessary processing is executed by the microprogram. Other various BIT processes are executed by microprograms.
(2,3) r各パイプラインステージの状態制御」
パイプラインの各ステージは入力ラッチと出力ランチと
を有し、他のステージとは独立して動作することを基本
とする。各ステージは1つ前に行った処理が終わり、そ
の処理結果を出力ランチから次のステージの入力ラッチ
へ転送し、自身のステージの入力ランチに次の処理に必
要な入力信号が総て揃えば次の処理を開始する。(2, 3) r State control of each pipeline stage”
Each stage of the pipeline has an input latch and an output launch, and basically operates independently of other stages. Each stage completes the previous processing and transfers the processing result from the output lunch to the input latch of the next stage, and when all the input signals necessary for the next processing are available at the input lunch of its own stage. Start the next process.
つまり各ステージは、1つ前段のステージから出力され
てくる次の処理に対する入力信号が全て有効となり、今
の処理結果を後段のステージの入力ランチに転送して出
力ランチが空になると次の処理を開始する。In other words, in each stage, all input signals for the next process output from the previous stage are valid, the current processing result is transferred to the input lunch of the next stage, and when the output lunch is empty, the next process starts. Start.
各ステージが動作を開始する1つ前のクロックタイミン
グで入力信号が全て揃っている必要がある。入力信号が
揃っていない場合、そのステージは待ち状態(入力待ち
)になる。出力ランチから次のステージの入力ランチへ
の転送を行う場合には次のステージの入力ラッチが空き
状態になっている必要があり、次のステージの入力ラン
チが空きでない場合もパイプラインステージは待ち状態
(出力待ち)になる。必要なメモリアクセス権が獲得で
きなかったり、処理しているメモリアクセスにウェイト
が挿入されたり、その他のパイプラインコンフリクトが
生しると各ステージの処理自体が遅延する。All input signals must be available at the clock timing immediately before each stage starts operating. If the input signals are not ready, the stage is in a waiting state (waiting for input). When transferring from the output lunch to the input lunch of the next stage, the input latch of the next stage must be in the free state, and even if the input lunch of the next stage is not free, the pipeline stage will wait. state (waiting for output). If a necessary memory access right cannot be obtained, a wait is inserted into the memory access being processed, or other pipeline conflicts occur, the processing itself at each stage will be delayed.
(3)「分岐命令の処理」
本発明のデータ処理装置においては、上述のように多段
構成のパイプライン処理を採用しているため、分岐命令
を実行した際のオーバヘッドが大きい。このオーバヘッ
ドを小さくするためにIFステージ11においてプリブ
ランチ処理を行っている。(3) "Processing of Branch Instructions" Since the data processing device of the present invention employs multi-stage pipeline processing as described above, there is a large overhead when executing branch instructions. In order to reduce this overhead, pre-branch processing is performed in the IF stage 11.
プリブランチ処理はEステージ15において分岐する代
わりにIFステージ11において予め分岐することによ
り、可及的早期において分岐先命令をパイプライン処理
機構へ取込むことを目的としている。The purpose of pre-branch processing is to take a branch destination instruction into the pipeline processing mechanism as early as possible by branching in advance at the IF stage 11 instead of branching at the E stage 15.
また、本発明のデータ処理装置のプリブランチ処理は可
変長の分岐命令にも対応可能であり、従来の固定長の分
岐命令にのみ対応可能であったプリブランチ処理に比し
て、処理可能な分岐命令の数が大幅に増加する。In addition, the pre-branch processing of the data processing device of the present invention can also handle variable-length branch instructions, and is more efficient than the conventional pre-branch processing that can only handle fixed-length branch instructions. The number of branch instructions increases significantly.
本発明のデータ処理装置に限らず、−i的にブタ処理装
置では分岐命令が実行される頻度は非常に高く、このた
めプリブランチ処理による性能向上の効果は大きい。Not limited to the data processing apparatus of the present invention, branch instructions are executed very frequently in pig processing apparatuses, and therefore the performance improvement effect of pre-branch processing is significant.
(3,1) r分岐命令の種類」
本発明のデータ処理装置では、命令フェッチステージに
おいてプリブランチを行う命令をプリフランチ命令と称
す。このプリブランチ命令には、無条件分岐命令のよう
に、必ず分岐する命令も含まれる。(3,1) Type of r branch instruction In the data processing device of the present invention, an instruction that performs a pre-branch in the instruction fetch stage is called a pre-branch instruction. The pre-branch instructions include instructions that always branch, such as unconditional branch instructions.
本発明のデータ処理装置が有する分岐命令は、分岐条件
がスタティックであるかダイナミックであるか及び分岐
先がスタティックであるかダイナミックであるかにより
計4種類に分類される。しかし、本発明のデータ処理装
置においては以下の2種類の命令をプリブランチ命令と
して扱う。The branch instructions included in the data processing device of the present invention are classified into four types depending on whether the branch condition is static or dynamic and whether the branch destination is static or dynamic. However, in the data processing device of the present invention, the following two types of instructions are handled as pre-branch instructions.
第1は、分岐条件及び分岐先共にスタティックな命令で
ある。この種の命令には無条件分岐命令(BRA)とサ
ブルーチン呼出し命令(BSR)とがある。The first is an instruction in which both the branch condition and the branch destination are static. This type of instructions include an unconditional branch instruction (BRA) and a subroutine call instruction (BSR).
第2は、分岐条件がダイナミックで分岐先がスタティッ
クな命令である。この種の命令には、条件分岐命令(B
cc)とループ制御命令(ACB)とがある。The second is an instruction in which the branch condition is dynamic and the branch destination is static. This type of instruction includes a conditional branch instruction (B
cc) and a loop control command (ACB).
(3,2) r分岐命令処理回路の機能構成」第1図
は本発明のデータ処理装置の全体の構成を示すブロック
図である。(3, 2) Functional Configuration of r-Branch Instruction Processing Circuit" FIG. 1 is a block diagram showing the overall configuration of the data processing apparatus of the present invention.
第1図には、命令フェッチ部51.命令デコート部52
. PC計算部53.オペランドアドレス計算部54デ
ータ演算部56.外部ハスインターフェイス部57のそ
れぞれに含まれる内部回路の構成と、アドレス出力回路
58.データ入出力回路59等が示されている。In FIG. 1, an instruction fetch unit 51. Instruction decoding section 52
.. PC calculation section 53. Operand address calculation unit 54 data calculation unit 56. The configuration of the internal circuits included in each of the external lotus interface sections 57 and the address output circuits 58 . A data input/output circuit 59 and the like are shown.
命令デコーダ111とpc加算器132の入力端及びア
ドレス加算器124の入力側とは、ディスプレースメン
ト値1分岐命令の変位値を転送するDISPバス100
にて接続されている。The input terminals of the instruction decoder 111 and the PC adder 132 and the input side of the address adder 124 are connected to a DISP bus 100 that transfers the displacement value of the displacement value 1 branch instruction.
It is connected at
命令デコーダ111 とアドレス加算器124の入力側
とは、ステップコード生成に使用された命令コード長、
スタックブツシュモード時のプリデクリメント値等を転
送する補正値バス102とでも接続されている。The input side of the instruction decoder 111 and the address adder 124 is the instruction code length used for step code generation,
It is also connected to a correction value bus 102 that transfers pre-decrement values and the like during stack bush mode.
命令デコーダ111とpc加算器132の入力側とは、
ステップコード生成に使用した命令コード長を転送する
命令長ハス101 とでも接続されている。The input sides of the instruction decoder 111 and the PC adder 132 are:
It is also connected to an instruction length hash 101 that transfers the instruction code length used for step code generation.
レジスタファイル144 とアドレス加算器124の入
力側とは、レジスタファイル144に蓄えられているア
ドレス値を転送するAバス103で接続されている。The register file 144 and the input side of the address adder 124 are connected by an A bus 103 through which address values stored in the register file 144 are transferred.
命令デコーダ111には命令キュー112から命令コー
ドが入力される。命令デコーダ111の出力部には、プ
リブランチ処理により条件分岐命令の分岐条件指定フィ
ールドをEステージ15へそのまま出力するか、条件指
定を反転して出力するかを選択する分岐条件生成回路1
14が備えられている。An instruction code is input to the instruction decoder 111 from an instruction queue 112 . The output section of the instruction decoder 111 includes a branch condition generation circuit 1 that selects whether to output the branch condition specification field of the conditional branch instruction to the E stage 15 as is or to invert the condition specification and output it by pre-branch processing.
14 are provided.
命令長バス101の値とDISPハス100の値とを入
力とし、いずれかを選択して出力する被加算値選択回路
131の出力と、Dステージ12においてデコードされ
た命令のPC値を保持するDPC135の値またはステ
ップコードの切目毎の作業用PC値を保持するTPC1
34の値のいずれかとはPC加算器132へ入力される
。The output of the augend selection circuit 131 receives the value of the instruction length bus 101 and the value of the DISP hash 100 and selects and outputs one of them, and the DPC 135 holds the PC value of the instruction decoded in the D stage 12. TPC1 that holds the value or work PC value for each step code cut
Any of the 34 values is input to a PC adder 132.
pc加算器132の出力はpc加算器出力ラうチ133
にラッチされた後、POババス05へ出力される。The output of the pc adder 132 is the pc adder output latch 133.
After being latched, it is output to the PO bus 05.
POハス105は、ラッチTPC134,ラッチDPC
135゜Aステージ13において処理中の命令のPC値
を保持するラッチAPC136とに接続している。PO lotus 105 has latch TPC134, latch DPC
It is connected to a latch APC 136 that holds the PC value of the instruction being processed in the 135°A stage 13.
TPC134にはEステージ15で分岐あるいはジャン
プが生じた際に新たな命令アドレスを入力するためのC
Aババス04からの入力経路もある。The TPC 134 has a C for inputting a new instruction address when a branch or jump occurs in the E stage 15.
There is also an input path from the AB bus 04.
補正値ハス102の出力とDISPバス100の出力と
はディスプレースメント選択回路122へ入力され、い
ずれか一方がアドレス加算器124へ入力される。The output of the correction value hash 102 and the output of the DISP bus 100 are input to a displacement selection circuit 122, and either one is input to an address adder 124.
DISPバスlOOの出力とAバス103の出力とはベ
ースアドレス選択回路123へ入力され、いずれか−方
がアドレス加算器124へ入力される。The output of the DISP bus lOO and the output of the A bus 103 are input to the base address selection circuit 123, and the negative one is input to the address adder 124.
アドレス加算器124は、ディスプレースメント選択回
路122の出力、ベースアドレス選択回路123の出力
及びAハス103から入力された値をシフトすることに
より、1倍、2倍、4倍、8倍の値をとるインデックス
値生成回路121の出力の3つ値を入力として3値加算
を行う。The address adder 124 shifts the output of the displacement selection circuit 122, the output of the base address selection circuit 123, and the values input from the A hash 103, thereby increasing the values by 1, 2, 4, and 8 times. Three-value addition is performed using the three output values of the index value generation circuit 121 as input.
アドレス加算器124の出力値はアドレス加算器出力ラ
ッチ125を通じてへ〇ハス106へ出力される。The output value of the address adder 124 is output to the hash 106 through the address adder output latch 125.
AOババス06は、メモリ間接アドレッシング時に、A
Aババス07を通してアドレス出力口858からCPU
外部ヘアドレス値を出力する際にそのアドレス値を保持
するラッチrA126と、Fステージ14におけるオペ
ランドフェッチ時に、靜バス107を通してアドレス出
力回路58からCPU外部へオペランドアドレス値を出
力する際にそのオペランドアドレス値を保持するラッチ
FA127とに接続されている。During memory indirect addressing, the AO bus 06
CPU from address output port 858 through A bus 07
A latch rA126 holds the address value when outputting the address value to the external device, and a latch rA126 holds the address value when outputting the address value to the outside, and the operand address when outputting the operand address value from the address output circuit 58 to the outside of the CPU through the silent bus 107 when fetching the operand in the F stage 14. It is connected to the latch FA127 that holds the value.
ラッチFAI27は、アドレス加算器124により計算
されたオペランドアドレスをEステージI5で使用する
ためにオペランドアドレス値を保持するラッチ5A14
1への出力経路を有する。Latch FAI27 is a latch 5A14 that holds an operand address value for use in E stage I5 using the operand address calculated by address adder 124.
It has an output path to 1.
ラッチ5A141は、データ演算部56の汎用データバ
スであるSバス109への出力経路を存する。The latch 5A141 has an output path to the S bus 109, which is a general-purpose data bus of the data calculation unit 56.
命令のアドレスを転送するCAババス04はPC加算器
出力ララッチ33と、ラッチTPC134と、命令フェ
ッチ部51がブリフェッチする命令コードのアドレスを
管理するカウンタQrNPC115と、命令フェッチの
ためのアドレスをAAババス07を通してアドレス出力
回路58からCPU外部へ出力する際にその値を保持す
るラッチCAAI42と、Eステージ15において分岐
あるいはジャンプが生した際に新たな命令アドレスをS
バス109から入力するEBレジスタ143とに接続さ
れている。The CA bus 04 that transfers the address of the instruction is connected to the PC adder output latch 33, the latch TPC 134, the counter QrNPC 115 that manages the address of the instruction code to be prefetched by the instruction fetch unit 51, and the AA bus 07 that transfers the address for instruction fetch. A latch CAAI42 holds the value when outputting it from the address output circuit 58 to the outside of the CPU through the S
It is connected to the EB register 143 input from the bus 109.
ラッチAPC136は、Aバス103 と、Fステージ
14において処理中の命令のPC値を保持するためのラ
ンチFPC137とへの出力経路を有する。Latch APC 136 has an output path to A bus 103 and launch FPC 137 for holding the PC value of the instruction being processed in F stage 14.
ラッチFPC137は、Eステージ15において処理中
の命令のPC値を保持するう7 fcPc13Bへの出
力経路を有する。The latch FPC 137 has an output path to the fcPc 13B that holds the PC value of the instruction being processed in the E stage 15.
ラッチCPCl38は、Sバス109と、−分岐履歴書
換えのためにPC値の最下位バイトの値を保持するう・
ノチ0PCI39とに出力経路を有する。The latch CPCl38 holds the value of the least significant byte of the PC value for rewriting the S bus 109 and the branch history.
It has an output path to Nochi0PCI39.
レジスタファイル144は汎用レジスタあるいは作業用
レジスタ等にて構成されており、Sバス109とAバス
103とへの出力経路を有し、Dバス110からの入力
経路を有する。The register file 144 is composed of general-purpose registers or work registers, and has an output route to the S bus 109 and the A bus 103, and an input route from the D bus 110.
データ演算部56の演算機構であるデータ演算器145
は、Sバス109からの入力経路を有し、Dバス110
への出力経路を有している。Data calculation unit 145 which is the calculation mechanism of data calculation unit 56
has an input path from S bus 109 and has an input path from D bus 110.
It has an output route to.
BTB (ブランチターゲントバッファ)160は詳細
は後述するが64エントリで構成されており、各エント
リは分岐命令アドレスフィールド(25ビツト)有効ビ
ットフィールド(lビット)、 分岐先アドレスフィー
ルド(31ビツト)及びシーケンス制御フィールド(2
ビツト)で構成されている (第2図参照)。The BTB (branch target buffer) 160 consists of 64 entries, which will be described in detail later, and each entry contains a branch instruction address field (25 bits), a valid bit field (l bit), a branch destination address field (31 bits), and a branch target address field (31 bits). Sequence control field (2
(see Figure 2).
有効ビットフィールドは対応するエントリが有効か否か
を示すフィールドであり、シーケンス制御フィールドは
、プリブランチが生した際の命令フェッチシーケンスを
切換えるタイミングを制御するフィールドである。The valid bit field is a field that indicates whether the corresponding entry is valid or not, and the sequence control field is a field that controls the timing of switching the instruction fetch sequence when a pre-branch occurs.
分岐命令アドレスをBTB160に登録するために、ラ
ッチCPCl38からBTB160への経路が設けられ
ている。また、プリブランチが発生した際にフェッチす
る命令のアドレスを登録するために、CAハス104か
らBTB160への経路が設けられている。A path from latch CPCl 38 to BTB 160 is provided to register the branch instruction address in BTB 160. Further, a path from the CA lotus 104 to the BTB 160 is provided in order to register the address of the instruction to be fetched when a pre-branch occurs.
分岐先アドレスレジスタ161は、BTB160から出
力される分岐先アドレスフィールドの内容の上位30ピ
ントをランチしておき、命令フェッチシーケンスが切換
わるタイミングでカウンタQTNPC115へ値を出力
する。The branch destination address register 161 launches the top 30 pins of the content of the branch destination address field output from the BTB 160, and outputs a value to the counter QTNPC 115 at the timing when the instruction fetch sequence is switched.
シーケンス制御機構162はダウンカウンタにて構成さ
れており、BTB160のシーケンス制御フィールドの
値を取込み、命令フェッチが行われる都度値をカウント
ダウンする。そして、シーケンス制御機構162は計数
値が“O”になると命令シーケンスを切換える制御信号
を出力する。The sequence control mechanism 162 is composed of a down counter, takes in the value of the sequence control field of the BTB 160, and counts down the value each time an instruction is fetched. Then, when the count value reaches "O", the sequence control mechanism 162 outputs a control signal to switch the command sequence.
(3,3) rプリブランチの処理方法」第1図に示
した本発明のデータ処理装置の構成の内の、プリブラン
チ処理に特に関係が深い部分の詳細な構成を第2図のブ
ロック図に示す。(3, 3) r Pre-branch processing method” The block diagram of FIG. 2 shows the detailed configuration of the part particularly closely related to pre-branch processing of the configuration of the data processing apparatus of the present invention shown in FIG. Shown below.
BTB160は64エントリで構成され、各エントリは
分岐命令アドレスフィールド(25ビツト)、 有効ビ
ットフィールド(2ビツト)、 分岐先アドレスフィー
ルド(31ビツト)及びシーゲンス制御フィルド(2ビ
ツト)にて構成される。The BTB 160 consists of 64 entries, and each entry consists of a branch instruction address field (25 bits), a valid bit field (2 bits), a branch destination address field (31 bits), and a sequence control field (2 bits).
分岐命令アドレスフィールドには、分岐命令アドレスの
上位24ビツトと、最下位から2番目の1ビツトとが登
録される。The upper 24 bits of the branch instruction address and the second 1 bit from the lowest order are registered in the branch instruction address field.
分岐先アドレスフィールドには、分岐先の命令アドレス
の上位31ビツトが登録される。The upper 31 bits of the branch destination instruction address are registered in the branch destination address field.
分岐先アドレスレジスタ161 は30ビツトであり、
BTB15Qの分岐先アドレスフィールドの出力の上位
30ビツトをランチする。The branch destination address register 161 is 30 bits,
Launch the upper 30 bits of the output of the branch destination address field of BTB15Q.
シーケンス制御機構162は、BTB160のシーケン
ス制御フィールドの出力値を取込み、命令フェッチが行
われる都度、その値をカウントダウンする。The sequence control mechanism 162 takes in the output value of the sequence control field of the BTB 160 and counts down the value each time an instruction is fetched.
シーケンス制?i1機構162はカウント値が“0”に
なると、命令フェッチシーケンスを次フェッチアドレス
に切換える制御信号を出力する。Sequence system? When the count value reaches "0", the i1 mechanism 162 outputs a control signal to switch the instruction fetch sequence to the next fetch address.
163はプリブランチ時に使用されるPOO値をラッチ
するプリブランチ出力ポインタレジスタPBRAPOで
あり、プリブランチが発生した際の命令キュー112の
出力ポインタレジスタPO165を調整する。A pre-branch output pointer register PBRAPO 163 latches a POO value used at the time of pre-branch, and adjusts the output pointer register PO165 of the instruction queue 112 when a pre-branch occurs.
190はデコーダであり、カウンタQINPC115の
下位6ビツトをデコードしてBTB160の一致すエン
トリを選択する。即ち、デコーダ190はBTB160
のエントリ検索手段として機能する。A decoder 190 decodes the lower 6 bits of the counter QINPC 115 and selects a matching entry in the BTB 160. That is, the decoder 190 uses the BTB 160
functions as a means of searching for entries.
191は比較器であり、分岐命令アドレスフィールドの
上位24ビツトの出力値とカウンタQINPC115の
上位24ビツトとを比較し、一致すれば一致信号179
を2入力のANDゲート192の一方の入力として出力
する。A comparator 191 compares the output value of the upper 24 bits of the branch instruction address field with the upper 24 bits of the counter QINPC 115, and if they match, a match signal 179 is output.
is output as one input of the two-input AND gate 192.
ANDゲート192の他方の入力には有効ビットフィー
ルドの1ビツトの出力値180が与えられている。AN
Dゲート192は再入力が共に“1″であれば、プリブ
ランチ発生信号171(“1”)を出力して分岐先アド
レスレジスタ161及びシーケンス制御機構162へ与
える。即ち、このANDゲート192はBTB160の
有効ビットフィールドの有効性を判断する手段として機
能する。The other input of AND gate 192 is provided with the 1-bit output value 180 of the valid bit field. AN
If both of the re-inputs are "1", the D gate 192 outputs a pre-branch generation signal 171 ("1") to be applied to the branch destination address register 161 and the sequence control mechanism 162. That is, this AND gate 192 functions as a means for determining the validity of the valid bit field of BTB 160.
その他に、カウンタQINPC115,命令キュー11
2゜命令キューの入力ポインタレジスタP1164.
命令デコーダ111等が備えられている。In addition, counter QINPC115, instruction queue 11
2° Instruction queue input pointer register P1164.
An instruction decoder 111 and the like are provided.
入力ポインタレジスタPK164. 出力ポインタレ
ジスタPO165,プリブランチ出力ポインタレジスタ
PBRAPO163はそれぞれ3ビツト構成であり、カ
ウンタQINPC115の値は下位側に2ビツトのデー
タ“00”を付加して命令フェッチのアドレスとして使
用される。Input pointer register PK164. The output pointer register PO165 and the pre-branch output pointer register PBRAPO163 each have a 3-bit configuration, and the value of the counter QINPC115 is used as an instruction fetch address with 2-bit data "00" added to the lower side.
命令キュ〜112には、命令コードを入力するフィール
ド(16ビノト)の他に、プリブランチが生したことを
示すフィールド(1ビツト)がある。In addition to a field (16 bits) for inputting an instruction code, the instruction queue 112 has a field (1 bit) indicating that a pre-branch has occurred.
命令キュー112の各エントリは16ビツトで8エント
リで構成されている。Each entry in the instruction queue 112 has 16 bits and consists of 8 entries.
なお、本実施例では、内部キャッシュを有していないも
のとする。Note that in this embodiment, it is assumed that there is no internal cache.
以下、第1図及び第2図を参照して、分岐命令のプリブ
ランチ処理の手順を以下の4通りの場合に分けて説明す
る。Hereinafter, with reference to FIGS. 1 and 2, the procedure for pre-branch processing of a branch instruction will be explained in the following four cases.
・プリブランチが発生せず、EステージI5で分岐が発
生しない場合。- When a pre-branch does not occur and a branch does not occur at E stage I5.
・プリブランチが発生せず、Eステージ15で分岐が発
生する場合。- When a branch occurs at E stage 15 without a pre-branch.
・プリブランチが発生し、Eステージ15で分岐が発生
しない場合。- When a pre-branch occurs and no branch occurs at E stage 15.
・プリブランチが発生し、Eステージ15で分岐が発生
する場合。- When a pre-branch occurs and a branch occurs at E stage 15.
(3,3,1) rプリブランチが発生せず、Eステ
ージで分岐が発生しない場合」
カウンタQINPC115の値で外部メモリに対して命
令フェッチが行われると同時に、カウンタ旧NPC11
5の下位6ビントがデコーダ190でデコードされてB
TB160の一つのエントリを選択する。(3, 3, 1) When r pre-branch does not occur and branch does not occur at E stage” At the same time, an instruction is fetched to external memory using the value of counter QINPC115, counter old NPC11
The lower 6 bits of 5 are decoded by the decoder 190 and B
Select one entry in TB160.
選択されたエントリの分岐命令アドレスフィールドの上
位24ビツトとカウンタQINPC115の上位24ビ
ツトとが比較器191で比較される。比較結果が一致し
なければ、プリブランチは発生しない。また、比較結果
が一致する場合でも、選択されたエントリの有効ピント
ビットフィールドの値が“0”であれば、プリブランチ
は発生しない。プリブランチが発生しない場合、カウン
タQINPC115の値は°1”だけインクリメントさ
れる。即ち、以降の命令のフェッチはシーケンシャルに
行われる。Comparator 191 compares the upper 24 bits of the branch instruction address field of the selected entry with the upper 24 bits of counter QINPC115. If the comparison results do not match, prebranch does not occur. Furthermore, even if the comparison results match, if the value of the valid focus bit field of the selected entry is "0", no pre-branch occurs. If a pre-branch does not occur, the value of the counter QINPC 115 is incremented by 0.1''. That is, subsequent instructions are fetched sequentially.
外部メモリから取込まれた命令データは命令キュー11
2へ入力され、入力ポインタレジスタP1164は“2
”だけインクリメントされる。命令キュー112に入力
された命令データは出力ポインタレジスタPO165に
従って命令バス170を経由し、命令デコーダ111へ
送られる。The instruction data fetched from external memory is stored in the instruction queue 11.
2, and the input pointer register P1164 is “2”.
The instruction data input to the instruction queue 112 is sent to the instruction decoder 111 via the instruction bus 170 according to the output pointer register PO 165.
命令デコーダ111が命令をデコードした結果、POイ
ンクリメント信号172が出力され、これに従ってPO
±0(166)、 PO+1(167)、 PO+2(
168)のいずれかの出力ポインタインクリメンタが選
択され、出力ポインタレジスタPO165にセットされ
る。As a result of the instruction decoder 111 decoding the instruction, a PO increment signal 172 is output, and the PO increment signal 172 is output accordingly.
±0(166), PO+1(167), PO+2(
168) is selected and set in the output pointer register PO165.
命令デコーダ111は命令をデコードする際にその命令
の命令長も計数し、計数結果の情報をPOインクリメン
ト信号172として出力すると共に、後段のバイブライ
ンステージへも伝送する。When the instruction decoder 111 decodes an instruction, it also counts the instruction length of the instruction, outputs the information of the counting result as a PO increment signal 172, and also transmits it to the subsequent vibe line stage.
次のAステージ13では分岐先のアドレスが計算される
。また、命令の先頭アドレスはラッチDPC135、ラ
ッチAPC136,ラッチPPC137を経由してEス
テージ15が使用するランチCPCI3Bへ伝えられる
。In the next A stage 13, the branch destination address is calculated. Further, the start address of the instruction is transmitted to the launch CPCI 3B used by the E stage 15 via the latch DPC 135, the latch APC 136, and the latch PPC 137.
命令デコーダ111でデコードされたプリブランチ命令
がEステージ15で分岐しない場合には、命令処理シー
ケンスは変更されない。If the pre-branch instruction decoded by the instruction decoder 111 does not branch at the E stage 15, the instruction processing sequence is not changed.
(3,3,2) rブリブランチが発生せず、Eステ
ージで分岐が発生する場合」
プリブランチしないプリブランチ命令がパイプライン処
理され、Eステージ15に到達するまでの処理は(3,
3,1)の場合と同様である。(3, 3, 2) When the r branch does not occur and a branch occurs at the E stage" A pre-branch instruction that does not pre-branch is pipelined and the processing until it reaches the E stage 15 is (3, 3, 2)
This is the same as in case 3.1).
プリブランチしなかったプリブランチ命令がEステージ
15で分岐すると、そのプリブランチ命令はBTB16
0に登録される。If a pre-branch instruction that did not pre-branch branches at E stage 15, that pre-branch instruction will be transferred to BTB16.
Registered as 0.
プリブランチ命令のアドレスがラッチCPCl38から
BTB160へ入力され、分岐先アドレスがEBレジス
タ143からCAババス04を経由し、更にインクリメ
ンタ192によりml′ インクリメントされた後に[
1TB160へ入力される。The address of the pre-branch instruction is input from the latch CPCl 38 to the BTB 160, and the branch destination address is passed from the EB register 143 to the CA bus 04, and further incremented by ml' by the incrementer 192.
It is input to 1TB160.
ラッチCPCl38の最下位2ビツトを除く下位6ビノ
トがデコーダ190によりデコードされ、BTB160
の一つのエントリが選択される。選択されたエントリの
分岐命令アドレスフィールドには、ランチCPCl38
の上位24ビツトと最下位から2番目の1ビツトとが登
録される。The lower 6 bits of the latch CPCl 38 excluding the lowest 2 bits are decoded by the decoder 190, and the BTB 160
One entry is selected. The branch instruction address field of the selected entry contains the branch instruction address field.
The upper 24 bits and the second 1 bit from the lowest are registered.
選択されたエントリの分岐先アドレスフィールドには、
EBレジスタ143の出力の上位31ビツトが登録され
る。また、プリブランチ命令のアドレスとその命令長と
からその命令をフェッチするに必要なメモリアクセスの
回数が計算され、その値がシーケンス制御の値として選
択されたエントリのシーケンス制御フィールドに登録さ
れる。また、選択されたエントリの有効ビットフィール
ドは“ビにセットされる。The branch destination address field for the selected entry contains
The upper 31 bits of the output of the EB register 143 are registered. Further, the number of memory accesses required to fetch the pre-branch instruction is calculated from the address of the pre-branch instruction and its instruction length, and the value is registered as the sequence control value in the sequence control field of the selected entry. Also, the valid bit field of the selected entry is set to "B".
Eステージ15におけるBTB160の登録動作と、I
Pステージ11におけるBTB160の参照動作とが同
時に起こった場合には登録動作が優先される。Registration operation of BTB 160 in E stage 15 and I
If the reference operation of the BTB 160 in the P stage 11 occurs at the same time, the registration operation takes priority.
(3,3,3) rプリブランチが発生し、Eステー
ジで分岐が発生しない場合」
カウンタΩINPC115の値で外部メモリに対して命
令フェッチが行われると同時に、カウンタ旧NPC11
5の下位6ビノトがデコーダ190でデコートされてB
TB160のlエントリが選択される。(3, 3, 3) When an r pre-branch occurs and no branch occurs at the E stage” At the same time, an instruction is fetched from the external memory using the value of the counter ΩINPC115, and the counter old NPC11
The lower 6 bits of 5 are decoded by the decoder 190 and B
The l entry of TB 160 is selected.
選択されたエントリの分岐命令アドレスフィールドの上
位24ビツトとカウンタQINPC115の上位24ビ
ツトとが比較器191で比較され、比較結果が−致し且
つ選択されたエントリの有効ビットフィールドの値が“
1”であればプリブランチが発生する。The high-order 24 bits of the branch instruction address field of the selected entry and the high-order 24 bits of the counter QINPC 115 are compared by the comparator 191, and the comparison result is - and the value of the valid bit field of the selected entry is ".
1”, pre-branch occurs.
この際、プリブランチ発生信号177が分岐先アドレス
レジスタ161 とシーケンス制御機構162とへ出力
される。At this time, a pre-branch generation signal 177 is output to the branch destination address register 161 and the sequence control mechanism 162.
プリブランチ発生信号177により分岐先アトレスレジ
スフ161はBTB160の分岐先アドレスフィールド
からの出力の上位30ビツトをラッチし、ラッチ174
はBTB160の分岐先アドレスフィールドの下位1ビ
ツトをラッチする。シーケンス制御機構162はBTB
160のシーケンス制御フィールドからの出力(2ビツ
ト)をランチする。In response to the pre-branch generation signal 177, the branch destination address register 161 latches the upper 30 bits of the output from the branch destination address field of the BTB 160, and the latch 174
latches the lower one bit of the branch destination address field of BTB 160. The sequence control mechanism 162 is BTB
Launches the output (2 bits) from the sequence control field of 160.
シーケンス制御フィールドには分岐命令全体が取込まれ
るのに必要な命令フェッチの回数がセットされている。The number of instruction fetches required to fetch the entire branch instruction is set in the sequence control field.
シーケンス制御機構162にセントされた値は外部メモ
リアクセスが完了する都度“1”づつカウントダウンさ
れる。そして、シーケンス制御機構162中の値が“0
”になると命令シーケンス切換え信号178が出力され
る。The value sent to the sequence control mechanism 162 is counted down by "1" each time an external memory access is completed. Then, the value in the sequence control mechanism 162 is “0”.
”, an instruction sequence switching signal 178 is output.
この命令シーケンス切換え信号178の出力により、分
岐先アドレスレジスタ161の値がカウンタQINPC
115にセントされる。また、インクリメント後の入力
ポインタレジスタP1164の上位2ビツトがプリブラ
ンチ出力ポインタレジスタPBRAPO163の上位2
ビツトに、ラッチ174の値がプリブランチ出力ポイン
タレジスタPBRAPO163の下位lビットにそれぞ
れセントされる。By outputting this instruction sequence switching signal 178, the value of the branch destination address register 161 is changed to the counter QINPC.
115 cents. Also, the upper 2 bits of the input pointer register P1164 after incrementing are the upper 2 bits of the pre-branch output pointer register PBRAPO163.
The value of latch 174 is written to the lower l bits of pre-branch output pointer register PBRAPO 163, respectively.
分岐命令の最後がワード境界で終わっていない場合及び
分岐先の命令の先頭がワード境界から始まっていない場
合には、命令キュー112中で分岐命令と分岐先命令と
の間に無効なコードが挿入される。ブリブランチ出力ポ
インタレジスタPBRAPO163はこの無効なコード
を補正するために使用される。If the end of the branch instruction does not end at a word boundary or the beginning of the branch destination instruction does not start from a word boundary, an invalid code is inserted between the branch instruction and the branch destination instruction in the instruction queue 112. be done. The brake branch output pointer register PBRAPO 163 is used to correct this invalid code.
第3図にプリブランチが発生した場合の命令キュー11
2内での分岐命令と分岐先命令との関係を示す。Instruction queue 11 when pre-branch occurs in Figure 3
2 shows the relationship between branch instructions and branch destination instructions in 2.
第3図(alに示されているのは、分岐命令(ハンチン
グを付して示す)の最後がワード境界で終わっており、
分岐先命令(クロスハンチングを付して示す)の先頭が
ワード境界から始まっていない場合、
第3図山)に示されているのは、分岐命令の最後がワー
ド境界で終わっておらず、分岐先命令の先頭がワード境
界から始まっている場合、第3図tc+に示されている
のは、分岐命令の最後がワード境界で終わっておらず、
分岐先命令の先頭がワード境界から始まっていない場合
である。What is shown in FIG. 3 (al) is that the end of the branch instruction (shown with hunting) ends at a word boundary,
If the beginning of the branch destination instruction (shown with cross-hunting) does not start on a word boundary, the end of the branch instruction (shown in Figure 3) does not end on a word boundary, and the branch If the beginning of the previous instruction starts on a word boundary, what is shown in Figure 3 tc+ is that the end of the branch instruction does not end on a word boundary,
This is the case when the beginning of the branch destination instruction does not start on a word boundary.
第3図fat、 fbl及び(C1のいずれの場合も、
分岐命令と分岐先命令との間に無効なコードが介在して
おり、これを調整するためにブリブランチ出力ポインタ
レジスタPBRAPO163が使用される。In each case of Figure 3 fat, fbl and (C1,
There is an invalid code between the branch instruction and the branch destination instruction, and the branch output pointer register PBRAPO 163 is used to adjust this.
プリブランチを発生した分岐命令が命令キュー112へ
取込まれる際に、BTB160の分岐先アドレスフィー
ルドの最下位ビットを参照することにより、その先頭の
ハーフワードに対応するエントリのプリブランチ発生フ
ィールドが“1“にセントされる。When a branch instruction that has generated a prebranch is taken into the instruction queue 112, by referring to the least significant bit of the branch destination address field of the BTB 160, the prebranch generation field of the entry corresponding to the first halfword is set to “ 1” cent.
プリブランチを発生した分岐命令が命令デコーダ111
へ送られる際には、命令データと同時にプリブランチ命
令信号171が送られ、プリブランチを発生した命令で
あることが伝達される。The branch instruction that caused the pre-branch is sent to the instruction decoder 111
When the instruction data is sent to the instruction data, a pre-branch instruction signal 171 is sent simultaneously with the instruction data, and it is transmitted that this is the instruction that generated the pre-branch.
命令デコーダ111がプリブランチを発生した命令のデ
コードを完了すると、POインクリメント信号172の
代わりにプリブランチ命令デコード完了信号173が出
力される。When the instruction decoder 111 completes decoding the instruction that generated the prebranch, a prebranch instruction decode completion signal 173 is output instead of the PO increment signal 172.
セレクタ176はブリブランチ命令デコード完了信号1
73を受取ると、ブリブランチ出力ポインタレジスタP
BRAPO163の出力を選択して出力ポインタレジス
タPO165にセットする。これによって、分岐命令と
分岐先命令との間に介在する無効なコードは無視される
。The selector 176 receives the BRIB branch instruction decoding completion signal 1.
73, the BRIB branch output pointer register P
Select the output of BRAPO163 and set it in output pointer register PO165. As a result, invalid code intervening between the branch instruction and the branch destination instruction is ignored.
命令デコーダ111はデコードした命令がプリブランチ
した命令であることを示す情報を後段のパイプラインス
テージへ伝達する。また、PC計算部53において分岐
先のアドレスが計算され、次の命令のpc値とされる。The instruction decoder 111 transmits information indicating that the decoded instruction is a prebranched instruction to the subsequent pipeline stage. Further, the PC calculation unit 53 calculates the branch destination address and uses it as the pc value of the next instruction.
更に、分岐条件生成回路114によりプリブランチした
命令の分岐条件を反転する。Further, the branch condition generating circuit 114 inverts the branch condition of the pre-branched instruction.
また、プリブランチの予測が外れた場合には命令シーケ
ンスを分岐命令の次の命令に戻す必要がある。このため
、Aステージ13においてプリブランチ命令のアドレス
とプリブランチ命令の命令長とを加算して次の命令のア
ドレスを計算する。Furthermore, if the pre-branch prediction is incorrect, it is necessary to return the instruction sequence to the instruction following the branch instruction. Therefore, in the A stage 13, the address of the pre-branch instruction and the instruction length of the pre-branch instruction are added to calculate the address of the next instruction.
これは、ラッチAPC136の値をAバス103及びベ
ースアドレス選択回路123を通してアドレス加算器1
24へ送り、プリブランチ命令の命令長を補正値バス1
02及びディスプレースメント選択回路122を通して
アドレス加算器124へ送り、インデンクス値生成回路
121から“O“を出力することで、アドレス加算器1
24により計算されてアドレス加算器出力ラッチ125
にセットされる。This transfers the value of the latch APC 136 to the address adder 1 through the A bus 103 and the base address selection circuit 123.
24, and the instruction length of the pre-branch instruction is sent to correction value bus 1.
02 and the displacement selection circuit 122 to the address adder 124, and the index value generation circuit 121 outputs "O".
24 and the address adder output latch 125
is set to
このアドレスはAOババス06及びラッチFA127を
通してランチ5A141へ伝送され、Eステージ15で
使用される。This address is transmitted to the launch 5A 141 through the AO bus 06 and the latch FA 127, and is used in the E stage 15.
プリブランチしたプリブランチ命令がEステージ15で
分岐しない場合には、Eステージ15では命令シーケン
スは変更されない。If the prebranched prebranch instruction does not branch at E stage 15, the instruction sequence is not changed at E stage 15.
(3,3,4) rプリブランチが発生し、Eステー
ジで分岐が発生する場合」
プリブランチを発生したプリブランチ命令が命令デコー
ダ111でデコードされ、Eステージ15に到達するま
での処理は(3,3,3)と同様である。(3, 3, 4) When an r pre-branch occurs and a branch occurs at the E stage" The pre-branch instruction that causes the pre-branch is decoded by the instruction decoder 111, and the processing until reaching the E stage 15 is ( 3, 3, 3).
プリブランチを発生したプリブランチ命令がEステージ
15で分岐するということは、プリブランチが誤ってい
たことを意味する。そこで、プリブランチ命令の次の命
令にシーケンスを戻す必要がある。プリブランチ命令の
次の命令のアドレスはラッチS^141にセットされて
いるので、ラッチ5A141の値t−sバス109を通
じてEBレジスタ143にセットし、Eステージ15に
おいて分岐を発生する。The fact that the pre-branch instruction that caused the pre-branch branches at E stage 15 means that the pre-branch was incorrect. Therefore, it is necessary to return the sequence to the instruction following the pre-branch instruction. Since the address of the instruction following the pre-branch instruction is set in the latch S^141, the value of the latch 5A141 is set in the EB register 143 via the t-s bus 109, and a branch is generated in the E stage 15.
またEステージ15において分岐が発生した後、次に同
一のプリブランチ命令が実行される際にプリブランチを
発生しないようにするために、BT8160中の対応す
るエントリのをビットフィールドを“0”にする。In addition, after a branch occurs in E stage 15, in order to prevent a prebranch from occurring the next time the same prebranch instruction is executed, the bit field of the corresponding entry in the BT8160 is set to "0". do.
以上に説明したプリブランチ処理においては、BTB1
60はダイレクトマツピング方式を採っているが、それ
以外の方式でも勿論よい。In the prebranch processing described above, BTB1
60 employs a direct mapping method, but other methods may of course be used.
また本実施例では、分岐先がスタティックに決定される
分岐命令のみをプリブランチ命令としているが、分岐先
がダイナミックな分岐命令に関してもプリブランチした
分岐先が適当であるか否かをチエツクする機構を備えれ
ば、プリブランチ命令として処理することが出来る。Furthermore, in this embodiment, only branch instructions whose branch destination is determined statically are used as pre-branch instructions, but even for branch instructions whose branch destination is dynamic, there is a mechanism to check whether the pre-branched branch destination is appropriate. If it is provided, it can be processed as a pre-branch instruction.
以上に詳述した如く本発明によれば、分岐発生時に命令
キューの内部で分岐命令と分岐先命令との間に無効なコ
ードが介在しているような場合においても、ブリブラン
チ時専用の出力ポインタにより命令キューからの出力を
補正して分岐先命令がその先頭から出力されるので、分
岐処理が正しく行われ、従ってパイプライン処理機構が
より効率的に動作し、高いデータ処理能力を発揮する。As described in detail above, according to the present invention, even if an invalid code exists between the branch instruction and the branch destination instruction in the instruction queue when a branch occurs, an output exclusively for branching can be performed. Since the output from the instruction queue is corrected by the pointer and the branch destination instruction is output from the beginning, branch processing is performed correctly, and therefore the pipeline processing mechanism operates more efficiently and exhibits high data processing capacity. .
第1図は本発明のデータ処理装置の全体の構成例を示す
ブロック図、第2図はそのブリブランチ処理に関係する
部分のより詳細な構成を示すブロック図、第3図は本発
明のデータ処理装置の命令キュー内の分岐命令と分岐先
命令との関係を示す模式図、第4図は本発明のデータ処
理装置の全体の概略構成を示すブロック図、第5図は本
発明のデータ処理装置のパイプライン処理itsの概略
構成を示す模式図、第6図は従来のデータ処理装置のパ
イプライン処理機構の概略構成を示す模式図、第7図は
従来のデータ処理装置における分岐命令の処理手順を示
す模式図、第8図は従来のデータ処理装置のブランチタ
ーゲノトハノファの構成を示す模式図である。
III・・・デコーダ
112・・・命令キュー
160・・・BTB (ブランチターゲノトハソファ)
161・・・分岐先アドレスレジスタ
163・・・プリブランチ出力ポインタレジスタPBR
APO164・・・入力ポインタレジスタP1165・
・・出力ポインタレジスタP0166、167、168
・・・出力ポインタインクリメンタ173・・・プリブ
ランチ命令デコード完了信号176・・・セレクタ
190・・・デコーダ(エントリ検索手段)192・・
・へNOゲート (有効性判断手段)なお、図中、同一
符号は同一、又は相当部分を示す。FIG. 1 is a block diagram showing an example of the overall configuration of a data processing device according to the present invention, FIG. 2 is a block diagram showing a more detailed configuration of a portion related to the hybrid branch processing, and FIG. 3 is a block diagram showing an example of the overall configuration of a data processing device according to the present invention. A schematic diagram showing the relationship between branch instructions and branch destination instructions in the instruction queue of a processing device, FIG. 4 is a block diagram showing the overall schematic configuration of the data processing device of the present invention, and FIG. 5 shows the data processing of the present invention. FIG. 6 is a schematic diagram showing a schematic configuration of a pipeline processing mechanism of a conventional data processing device; FIG. 7 is a schematic diagram showing a schematic configuration of a pipeline processing mechanism of a conventional data processing device; FIG. FIG. 8 is a schematic diagram showing the procedure, and FIG. 8 is a schematic diagram showing the configuration of a branch target node of a conventional data processing device. III...Decoder 112...Instruction queue 160...BTB (branch target notohasofa)
161... Branch destination address register 163... Pre-branch output pointer register PBR
APO164...Input pointer register P1165...
...Output pointer register P0166, 167, 168
... Output pointer incrementer 173 ... Pre-branch instruction decoding completion signal 176 ... Selector 190 ... Decoder (entry search means) 192 ...
・NO gate (Effectiveness judgment means) In the figures, the same reference numerals indicate the same or corresponding parts.
Claims (1)
アドレスレジスタと、 複数のエントリにて構成され、各エントリが分岐命令の
アドレスを格納する命令アドレスフィールドと、エント
リの有効性を示す情報を格納する有効エントリフィール
ドと、分岐先の命令のアドレスを格納する分岐先アドレ
スフィールドとを含むテーブルと、 前記命令アドレスレジスタの記憶値で前記テーブルの命
令アドレスフィールドを検索して双方の記憶値が一致す
るエントリを検出するエントリ検索手段と、 該エントリ検索手段により検出されたエントリの有効性
をそのエントリの有効エントリフィールドの情報により
判断する有効性判断手段と、 1命令を複数に分割して格納する命令フィールドと、前
記有効性判断手段が有効と判断したエントリの命令の先
頭が対応するエントリに格納されていることを示す情報
を格納する分岐命令表示フィールドとで構成されるエン
トリを複数有する命令キューと、 該命令キューのいずれのエントリへ次の命令の先頭を入
力するかを指示する入力ポインタレジスタと、 前記命令キューのいずれのエントリから命令を出力する
かを指示する出力ポインタレジスタと、 前記出力ポインタレジスタの値をインクリメントする出
力ポインタインクリメンタと、前記有効性判断手段が有
効と判断した場合に、前記入力ポインタレジスタの値と
前記分岐先アドレスフィールドの内容とに基づいて前記
出力ポインタが次に採るべき値を求めて保持する分岐用
出力ポインタレジスタと、 前記命令キューの命令フィールドと分岐命令表示フィー
ルドとの内容を取込み、デコードして分岐を発生した命
令であると判断した場合に所定の信号を出力するデコー
ダと、 該デコーダから前記所定の信号が出力された場合に前記
分岐用出力ポインタレジスタの値を、前記所定の信号が
出力されなかった場合に前記出力ポインタインクリメン
タの値をそれぞれ選択して前記出力ポインタへ入力する
セレクタと を備えたことを特徴とするデータ処理装置。(1) Consists of an instruction address register that stores the address of the instruction to be fetched, an instruction address field that stores the address of a branch instruction, and information that indicates the validity of the entry. a table including a valid entry field for storing a branch destination instruction address, and a branch destination address field for storing the address of a branch destination instruction, and searching the instruction address field of the table using the stored value of the instruction address register to find that both stored values match. Entry search means for detecting an entry; Validity determination means for determining the validity of an entry detected by the entry search means based on information in a valid entry field of the entry; and an instruction for dividing one instruction into multiple parts and storing them. and a branch instruction display field that stores information indicating that the head of the instruction of the entry determined to be valid by the validity determining means is stored in the corresponding entry. , an input pointer register that instructs which entry in the instruction queue the head of the next instruction is to be input to, an output pointer register which instructs which entry in the instruction queue the instruction is to be output from, and the output pointer an output pointer incrementer that increments the value of the register, and a next position of the output pointer based on the value of the input pointer register and the contents of the branch destination address field when the validity determining means determines that the value is valid. A branch output pointer register that calculates and holds an exponent value, and the contents of the instruction field and branch instruction display field of the instruction queue are taken in, decoded, and a predetermined signal is output when the instruction is determined to have caused a branch. a decoder to output, a value of the branch output pointer register when the predetermined signal is output from the decoder, and a value of the output pointer incrementer when the predetermined signal is not output. and a selector for inputting the output pointer to the output pointer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP937790A JPH03212734A (en) | 1990-01-17 | 1990-01-17 | Data processor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP937790A JPH03212734A (en) | 1990-01-17 | 1990-01-17 | Data processor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03212734A true JPH03212734A (en) | 1991-09-18 |
Family
ID=11718767
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP937790A Pending JPH03212734A (en) | 1990-01-17 | 1990-01-17 | Data processor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03212734A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2006006613A1 (en) * | 2004-07-08 | 2006-01-19 | Sony Computer Entertainment Inc. | Methods and apparatus for updating of a branch history table |
-
1990
- 1990-01-17 JP JP937790A patent/JPH03212734A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2006006613A1 (en) * | 2004-07-08 | 2006-01-19 | Sony Computer Entertainment Inc. | Methods and apparatus for updating of a branch history table |
| US7500088B2 (en) | 2004-07-08 | 2009-03-03 | Sony Computer Entertainment Inc. | Methods and apparatus for updating of a branch history table |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0463975A2 (en) | Byte-compare operation for high-performance processor | |
| EP0463978A2 (en) | Granularity hint for translation buffer in high performance processor | |
| EP0465322A2 (en) | In-register data manipulation in reduced instruction set processor | |
| EP0463973A2 (en) | Branch prediction in high performance processor | |
| EP0465321A2 (en) | Ensuring data integrity in multiprocessor or pipelined processor system | |
| US5148529A (en) | Pipelined multi-stage data processor including an operand bypass mechanism | |
| US5522053A (en) | Branch target and next instruction address calculation in a pipeline processor | |
| US5313644A (en) | System having status update controller for determining which one of parallel operation results of execution units is allowed to set conditions of shared processor status word | |
| JPH05224928A (en) | Data processor | |
| US6131158A (en) | Data processing system capable of executing groups of instructions, including at least one arithmetic instruction, in parallel | |
| JPH04260950A (en) | Cache memory device | |
| JP2006520964A5 (en) | ||
| JPH03158928A (en) | Data processor | |
| JPH01214932A (en) | Data processor | |
| JPH0215331A (en) | Data processor | |
| US5461715A (en) | Data processor capable of execution of plural instructions in parallel | |
| JPH10232821A (en) | Data processing device | |
| JP3345787B2 (en) | Data processing device | |
| JP2710994B2 (en) | Data processing device | |
| JPH03212734A (en) | Data processor | |
| US5745723A (en) | Data processing system capable of execution of plural instructions in parallel | |
| JPH0377138A (en) | Data processor | |
| JP2532560B2 (en) | Data processing device for high-performance exception handling | |
| JPH02105937A (en) | Data processor | |
| JPH03212736A (en) | Data processor |