JP2928879B2 - Data processing device - Google Patents

Data processing device

Info

Publication number
JP2928879B2
JP2928879B2 JP36158997A JP36158997A JP2928879B2 JP 2928879 B2 JP2928879 B2 JP 2928879B2 JP 36158997 A JP36158997 A JP 36158997A JP 36158997 A JP36158997 A JP 36158997A JP 2928879 B2 JP2928879 B2 JP 2928879B2
Authority
JP
Japan
Prior art keywords
instruction
unit
branch
jump
destination address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP36158997A
Other languages
Japanese (ja)
Other versions
JPH10154074A (en
Inventor
雅仁 松尾
豊彦 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP36158997A priority Critical patent/JP2928879B2/en
Publication of JPH10154074A publication Critical patent/JPH10154074A/en
Application granted granted Critical
Publication of JP2928879B2 publication Critical patent/JP2928879B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はデータ処理装置に関
し、具体的にはジャンプ命令の処理を高速に行うパイプ
ライン処理機構を有するデータ処理装置に関し、より詳
しくは、パイプラインの初期のステージでジャンプ処理
を行うことにより、ジャンプ命令が実行された場合のパ
イプライン処理のオーバーヘッドを削減し得るデータ処
理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing apparatus, and more particularly, to a data processing apparatus having a pipeline processing mechanism for processing a jump instruction at a high speed. The present invention relates to a data processing device capable of reducing overhead of pipeline processing when a jump instruction is executed by performing processing.

【0002】[0002]

【従来の技術】従来のデータ処理装置では、データ処理
の流れに従って処理を複数のステップに分割し、異なる
命令の各ステップをパイプラインのそれぞれ対応するス
テージにおいて同時に処理することにより、1命令に必
要な平均処理時間を短縮させ、全体としての処理性能を
向上させている。
2. Description of the Related Art In a conventional data processing apparatus, processing is divided into a plurality of steps in accordance with the flow of data processing, and each step of a different instruction is processed simultaneously in a corresponding stage of a pipeline, thereby making it necessary for one instruction. The average processing time is shortened, and the overall processing performance is improved.

【0003】ところが、ジャンプ命令のように命令処理
のシーケンスを乱す命令が実行された場合には、命令の
実行段階で命令の処理シーケンスが切り替わるためにパ
イプライン処理のオーバーヘッドが大きくなり、効率の
よいパイプライン処理が行えない。しかも、現実のプロ
グラムを実行する際のジャンプ命令の出現頻度は非常に
高く、従ってジャンプ命令の処理の高速化はデータ処理
装置の性能を向上する上で最も重要な項目の一つであ
る。
However, when an instruction that disturbs the instruction processing sequence, such as a jump instruction, is executed, the processing sequence of the instruction is switched in the execution stage of the instruction, so that the overhead of the pipeline processing increases and the efficiency is improved. Pipeline processing cannot be performed. In addition, the frequency of occurrence of jump instructions when executing an actual program is extremely high. Therefore, speeding up the processing of jump instructions is one of the most important items in improving the performance of a data processing device.

【0004】データ処理装置の性能向上のため、無条件
分岐命令,条件分岐命令等の命令実行の際のオーバーヘ
ッド削減について種々の工夫がなされている。例えば、
分岐命令のアドレスと分岐先のアドレスとを組にして記
憶しておくブランチ・ターゲット・バッファを用いて、
命令フェッチの段階で命令の流れを予測し、分岐処理を
行う手法が提案されている(J.K.F. Lee and A.J.Smit
h,"Branch PredictionStrategies and Branch Target B
uffer Design", IEEE COMPUER Vol.17, No.1,January 1
984,pp.6-22. 参照)。しかし、この手法では処理性能
の向上度はブランチ・ターゲット・バッファのサイズに
大きく依存するため、大幅な性能向上を図るためには追
加すべきハードウェア量が大きくなる。
In order to improve the performance of the data processing device, various measures have been taken to reduce the overhead when executing instructions such as unconditional branch instructions and conditional branch instructions. For example,
Using a branch target buffer that stores the address of the branch instruction and the address of the branch destination as a set,
A method of predicting the flow of instructions at the instruction fetch stage and performing branch processing has been proposed (JKF Lee and AJSmit
h, "Branch PredictionStrategies and Branch Target B
uffer Design ", IEEE COMPUER Vol.17, No.1, January 1
984, pp. 6-22.). However, in this method, the degree of improvement in processing performance greatly depends on the size of the branch target buffer, and therefore, the amount of hardware to be added increases in order to achieve significant performance improvement.

【0005】少ないハードウェア量の追加で分岐命令の
処理を高速化しようとする手法として、デコード段階で
分岐先アドレスを計算して分岐処理を行う本願発明者ら
が提案している手法がある(松尾他、「TRON仕様32ビッ
トマイクロプロセッサM32/100 の高速化手法とその性能
評価」電子情報通信学会技術研究報告ICD89-161 、pp.6
5-72、1989年11月22日)。
As a technique for speeding up the processing of a branch instruction by adding a small amount of hardware, there is a technique proposed by the inventors of the present invention in which a branch destination address is calculated in a decoding stage and branch processing is performed ( Matsuo et al., "High-speed Method and Performance Evaluation of T32-Specific 32-bit Microprocessor M32 / 100" IEICE Technical Report ICD89-161, pp.6
5-72, November 22, 1989).

【0006】図67は上述のような命令デコード段階で分
岐先アドレスを計算してジャンプ処理を行う従来のデー
タ処理装置のジャンプ命令処理機構の構成を示すブロッ
ク図である。
FIG. 67 is a block diagram showing a configuration of a jump instruction processing mechanism of a conventional data processing apparatus which performs a jump process by calculating a branch destination address at the instruction decoding stage as described above.

【0007】図67において、参照符号 301は図示されて
いないメモリから命令を取り込む命令フェッチ部、 302
は命令フェッチ部301 が取り込んだ命令をデコードする
命令デコード部、 303は命令の先頭アドレスを計算/保
持するプログラムカウンタ(PC)計算部である。また、参
照符号 304は命令デコード部302 でデコード中の命令の
PC値を保持するラッチ(DPC) 、 305は命令デコード部30
2 でデコード中の命令の命令コードの先頭アドレス値を
保持するラッチ(TPC) 、 306はPC計算及び分岐先アドレ
スの計算を行うPC加算器、 307, 308, 309はPC加算器30
9 の入出力ラッチ(PIA, PIB, PO)、311, 312, 313, 314
は各ブロック間を結ぶデータ転送経路であり、それぞれ
変位バス, 命令長バス, 命令アドレスバス(IAバス),
PC加算器出力バス(POバス)である。
In FIG. 67, reference numeral 301 denotes an instruction fetch unit which fetches an instruction from a memory (not shown);
Is an instruction decoding unit that decodes the instruction fetched by the instruction fetch unit 301, and 303 is a program counter (PC) calculation unit that calculates / holds the start address of the instruction. Reference numeral 304 denotes an instruction being decoded by the instruction decoding unit 302.
Latch (DPC) holding PC value, 305 is instruction decoding unit 30
2, a latch (TPC) that holds the start address value of the instruction code of the instruction being decoded, 306 is a PC adder that performs PC calculation and branch destination address calculation, and 307, 308, and 309 are PC adders 30.
9 input / output latches (PIA, PIB, PO), 311, 312, 313, 314
Is a data transfer path connecting each block, and includes a displacement bus, an instruction length bus, an instruction address bus (IA bus),
PC adder output bus (PO bus).

【0008】この図67に示されている構成のジャンプ命
令処理機構が備えられているデータ処理装置は、命令が
格納されているメモリから命令を取り込む命令フェッチ
(IF)ステージ、取り込まれた命令をデコードする命令デ
コード(D)ステージ、命令のデコード結果に従ってオ
ペランドのアドレス計算を行うアドレス計算(A)ステ
ージ、オペランドのプリフェッチとマイクロ命令の読み
出し及びデコードを行うオペランドフェッチ(F)ステ
ージ、及び命令の実行を行う実行(E)ステージの5段
のパイプライン処理を行う。
The data processing apparatus provided with the jump instruction processing mechanism having the structure shown in FIG. 67 is an instruction fetch for fetching an instruction from a memory in which the instruction is stored.
(IF) stage, instruction decode (D) stage for decoding a fetched instruction, address calculation (A) stage for calculating the address of an operand according to the result of decoding the instruction, operand for prefetching the operand and reading and decoding the microinstruction A five-stage pipeline process of a fetch (F) stage and an execution (E) stage for executing an instruction is performed.

【0009】なおここでは、説明の簡単化のため、各パ
イプラインステージは1クロックサイクルで1つの単位
処理を行うものとする。また、処理対象の命令は可変長
命令セットであり、命令デコード部302 は1つの命令を
1つまたは複数個のデコード処理単位に分解してデコー
ドする。
Here, for simplicity of description, it is assumed that each pipeline stage performs one unit process in one clock cycle. The instruction to be processed is a variable-length instruction set, and the instruction decoding unit 302 decodes one instruction into one or a plurality of decode processing units.

【0010】PC計算部303 は命令デコードステージで動
作する。直前にデコードされてTPC305に格納されている
デコード処理単位の先頭アドレスが各デコードサイクル
でPIA307に取り込まれ、命令デコード部302 から出力さ
れる処理コード長が命令長バス312 を介してPIB308に取
り込まれる。そして、PC加算器306 でPIA307の値とPIB3
08の値とが加算され、加算結果はPO309 及びPOバス314
を介してTPC305に書き戻される。1命令のデコードが終
了した場合には、加算結果がPOバス314 を介してDPC304
にも書き戻されることにより、DPC304はデコードした命
令のPC値を保持する。このように、図67に示されている
構成のジャンプ命令処理機構を備えている従来のデータ
処理装置は、その命令体系が可変長命令セットであり、
各デコードサイクルでの処理コード長が命令デコードの
後でないと判明しないため、タイミング的にはPC計算部
303 は各命令の最初のデコードサイクルでデコード中の
命令の先頭アドレスを計算する。
The PC calculator 303 operates in the instruction decode stage. The start address of the decode processing unit decoded immediately before and stored in the TPC 305 is taken into the PIA 307 in each decode cycle, and the processing code length output from the instruction decode unit 302 is taken into the PIB 308 via the instruction length bus 312. . Then, the value of PIA307 and PIB3 are
08 and the result is added to PO309 and PO bus 314.
Is written back to the TPC 305 via. When decoding of one instruction is completed, the addition result is output to the DPC 304 via the PO bus 314.
The DPC 304 holds the PC value of the decoded instruction. As described above, the conventional data processing apparatus including the jump instruction processing mechanism having the configuration illustrated in FIG. 67 has an instruction system of a variable length instruction set,
Since the processing code length in each decode cycle is not known until after the instruction decode, the PC
303 calculates the start address of the instruction being decoded in the first decode cycle of each instruction.

【0011】次に命令デコード段階で分岐処理を行う機
構について説明する。命令の先頭アドレスからの変位で
分岐先アドレスを指定する無条件分岐命令(BRA命令) 処
理時の動作について説明する。
Next, a mechanism for performing branch processing at the instruction decoding stage will be described. The operation at the time of processing an unconditional branch instruction (BRA instruction) that specifies a branch destination address by displacement from the head address of the instruction will be described.

【0012】無条件分岐命令のデコードサイクル終了時
点においては、DPC304にはこの無条件分岐命令のPC値が
格納されている。Dステージでは次のサイクルで分岐先
アドレスの計算を行う。PC加算器306 は、命令デコード
部302 から変位バス311 を介してPIB308に取り込まれる
分岐変位と、DPC304からPIA307に取り込まれる分岐命令
のPC値とを加算することにより分岐先アドレスを計算
し、加算結果をPO309 及びIAバス313 を介して命令フェ
ッチ部301 へ転送する。また、加算結果はPC計算部303
の初期化のためにPO309 及びPOバス314 を介してTPC305
にも書き戻される。命令フェッチ部301 はIAバス313 を
介して取り込まれた分岐先アドレスに基づいて分岐先命
令のフェッチを行う。
At the end of the decoding cycle of the unconditional branch instruction, the DPC 304 stores the PC value of the unconditional branch instruction. In the D stage, calculation of the branch destination address is performed in the next cycle. The PC adder 306 calculates the branch destination address by adding the branch displacement fetched from the instruction decoding unit 302 into the PIA 308 via the displacement bus 311 and the PC value of the branch instruction fetched from the DPC 304 into the PIA 307. The result is transferred to the instruction fetch unit 301 via the PO 309 and the IA bus 313. The addition result is calculated by the PC calculation unit 303.
305 via PO309 and PO bus 314 for initialization of
Is also written back. The instruction fetch unit 301 fetches a branch destination instruction based on the branch destination address captured via the IA bus 313.

【0013】図68に、無条件分岐命令(BRA命令) 処理時
のタイミングチャートを示す。図68において、In-1 は
BRA命令の直前の命令、Ibtは分岐先命令を示す。図68
(b) に示されているようにC1サイクルにおいて無条件
分岐命令がデコードされ、図68(c) に示されているよう
にC2サイクルで分岐先アドレスが計算され、図68(a)
に示されているようにC3サイクルで分岐先命令がフェ
ッチされ、図68(b) に示されているようにC4サイクル
で分岐先命令がデコードされる。このように、命令デコ
ード段階で分岐処理を行うことにより、無条件分岐命令
の処理が3クロックサイクルで終了できるため、命令の
実行段階で分岐処理を行う場合に比べて性能は向上す
る。ただし、まだ命令デコードステージで考えると、C
2、C3サイクルの2クロックサイクルの無駄時間があ
る。
FIG. 68 is a timing chart at the time of processing an unconditional branch instruction (BRA instruction). In FIG. 68, In-1 is
The instruction immediately before the BRA instruction, Ibt, indicates a branch destination instruction. Figure 68
The unconditional branch instruction is decoded in the C1 cycle as shown in (b), and the branch destination address is calculated in the C2 cycle as shown in FIG. 68 (c).
As shown in FIG. 68, the branch destination instruction is fetched in the C3 cycle, and as shown in FIG. 68 (b), the branch destination instruction is decoded in the C4 cycle. As described above, by performing the branch processing at the instruction decoding stage, the processing of the unconditional branch instruction can be completed in three clock cycles, so that the performance is improved as compared with the case where the branch processing is performed at the instruction execution stage. However, considering still in the instruction decode stage, C
There is a dead time of two clock cycles of 2, C3 cycles.

【0014】以上のように、従来のデータ処理装置では
命令デコード段階で分岐処理を行うことにより、少ない
ハードウェア追加で分岐処理の高速化を図っている。
As described above, in the conventional data processing apparatus, the branch processing is performed at the instruction decoding stage, thereby speeding up the branch processing with a small amount of additional hardware.

【0015】なお上述の従来例では、命令デコード段階
で分岐処理が行われるのは、ジャンプ先アドレスがPC相
対アドレッシングモードで指定される分岐命令に限定さ
れており、ジャンプ先アドレスがオペランド指定子で指
定されるジャンプ命令は命令デコード段階ではジャンプ
処理は行われない。また上述の従来例では、命令デコー
ドステージで分岐処理が行われた無条件分岐命令も実行
ステージで処理される。
In the above-mentioned conventional example, the branch processing at the instruction decoding stage is limited to the branch instruction whose jump destination address is specified in the PC relative addressing mode, and the jump destination address is determined by the operand specifier. The specified jump instruction is not subjected to jump processing in the instruction decoding stage. In the above-described conventional example, an unconditional branch instruction that has been subjected to branch processing in the instruction decode stage is also processed in the execution stage.

【0016】更に従来のデータ処理装置には、条件分岐
命令を高速に処理するために、複数の命令バッファを備
え、条件分岐命令に関して分岐条件確定前に分岐予測と
分岐先命令の取り込みとを行い、予測された側の命令を
パイプライン処理するような構成のデータ処理装置も知
られている。例えば、IBM System/370 Model 168-3がそ
のようなデータ処理装置の例としてあげられる。(海
野、”IBM 3033プロセサの内部設計とパフォーマン
ス”、日経エレクトロニクス・ブックス「汎用大型コン
ピュータ」、日経マグロウヒル社、pp.251-263、1982年
5 月31日)
Further, the conventional data processing apparatus is provided with a plurality of instruction buffers in order to process conditional branch instructions at high speed, and performs a branch prediction and a fetch of a branch destination instruction before the branch condition is determined for the conditional branch instruction. There is also known a data processing device having a configuration in which a predicted instruction is pipeline-processed. For example, IBM System / 370 Model 168-3 is an example of such a data processing device. (Umino, "Internal Design and Performance of IBM 3033 Processor", Nikkei Electronics Books "General-purpose Large Computer", Nikkei McGraw-Hill, pp.251-263, 1982
May 31)

【0017】図69のブロック図に、従来のデータ処理装
置の一例として上述のIBM System/370 Model 168-3の内
部構造を示す。
FIG. 69 is a block diagram showing the internal structure of the above-mentioned IBM System / 370 Model 168-3 as an example of a conventional data processing apparatus.

【0018】この従来例のデータ処理装置は、命令, オ
ペランドデータを記憶する主記憶機構321 と、この主記
憶機構321 を制御すると共にキャッシュ, アドレス変換
機構更にはTLB(Translation Lookaside Buffer) を含む
主記憶制御機構322 と、命令のデコード及びオペランド
アドレスの生成等のような命令実行のために必要な前処
理を行う命令前処理機構323 と、命令の実行を行う実行
機構324 とからなる。命令前処理機構323 には2つの命
令バッファ(IB1,IB2)325, 326と、2つの命令アド
レスレジスタ(IAR1, IAR2)327と、命令レジスタ328
と、命令デコーダ329 と 、命令デコード済みレジスタ
330 と、オペランドアドレスレジスタ(OAR1, OAR2)3
31とを含んでいる。
This conventional data processing apparatus has a main memory 321 for storing instruction and operand data, a main memory 321 for controlling the main memory 321 and including a cache, an address translator and a TLB (Translation Lookaside Buffer). It comprises a storage control mechanism 322, an instruction pre-processing mechanism 323 for performing pre-processing necessary for instruction execution such as instruction decoding and operand address generation, and an execution mechanism 324 for executing instructions. The instruction preprocessor 323 has two instruction buffers (IB1, IB2) 325, 326, two instruction address registers (IAR1, IAR2) 327, and an instruction register 328.
And the instruction decoder 329 and the instruction decoded register
330 and operand address register (OAR1, OAR2) 3
Includes 31 and.

【0019】このような構成の従来例のデータ処理装置
としてのIBM System/370 Model 168-3では、2組の命令
バッファ325, 326と命令アドレスレジスタ327 とを利用
して、分岐命令処理時に分岐先命令のフェッチを行い、
且つ命令あるいはマスク値(分岐条件)による静的分岐
予測結果に従って、予測された側の命令のデコードを続
行するように構成されている。また、IBM System/370 M
odel 3033 のように、第2の条件分岐命令の分岐先命令
もプリフェッチできるように3組の命令バッファを備
え、2つの条件分岐命令を効率的にパイプライン処理す
るデータ処理装置も知られている。
In the IBM System / 370 Model 168-3 as a conventional data processing device having such a configuration, a branch is performed at the time of branch instruction processing using two sets of instruction buffers 325 and 326 and an instruction address register 327. Fetch the first instruction,
The decoding of the instruction on the predicted side is continued according to the result of the static branch prediction based on the instruction or the mask value (branch condition). Also, IBM System / 370 M
As in odel 3033, there is also known a data processing device including three sets of instruction buffers so that a branch destination instruction of a second conditional branch instruction can be prefetched, and which efficiently pipelines two conditional branch instructions. .

【0020】以上のように従来のデータ処理装置では、
複数の命令キューを備えることにより、条件分岐命令の
効率的な処理を行っている。
As described above, in the conventional data processing device,
By providing a plurality of instruction queues, efficient processing of conditional branch instructions is performed.

【0021】[0021]

【発明が解決しようとする課題】従来のデータ処理装置
では、条件分岐命令を効率よく処理するために複数の命
令バッファを備えているが、2つの条件分岐命令を効率
よくパイプライン処理するためには3つの命令バッファ
を備える必要があり、ハードウェア量が増大するという
問題点があった。
A conventional data processing apparatus has a plurality of instruction buffers for efficiently processing conditional branch instructions. However, in order to efficiently process two conditional branch instructions in a pipelined manner, Has to provide three instruction buffers, and there is a problem that the amount of hardware increases.

【0022】更に従来のデータ処理装置では、命令デコ
ード段階で分岐処理を行う場合には実行ステージで無条
件分岐命令の処理を行わない方が性能が向上するが、プ
ログラムのデバッグのために1命令毎に命令実行を行う
ステップ実行モードを備える場合、あるいはジャンプ先
アドレスが指定された境界条件を満たさない場合に例外
を検出する際等には、単純に無条件分岐命令を実行ステ
ージで処理しないような構成にすると正しく動作しない
という問題点があった。
Further, in the conventional data processing apparatus, when branch processing is performed in the instruction decoding stage, the performance is improved by not performing the processing of the unconditional branch instruction in the execution stage. When a step execution mode for executing an instruction every time is provided, or when an exception is detected when the jump destination address does not satisfy the specified boundary condition, the unconditional branch instruction is not simply processed in the execution stage. With such a configuration, there is a problem that it does not operate properly.

【0023】本発明は上述のような問題点を解消するた
めになされたもので、少ないハードウェア追加で2つの
条件分岐命令及び無条件分岐命令を効率よくパイプライ
ン処理し得るデータ処理装置の提供を目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and provides a data processing apparatus capable of efficiently pipeline processing two conditional branch instructions and unconditional branch instructions with a small amount of additional hardware. With the goal.

【0024】[0024]

【0025】また本発明は、プログラムのデバッグのた
めに1命令毎に命令実行を行うようなモードをも含む種
々の動作モードに応じて効率よくかつ正しく無条件ジャ
ンプ命令の処理を行うことが可能な高性能なデータ処理
装置の提供を目的とする。
[0025] The present invention can be efficiently and correctly handle unconditional jump instruction in accordance with the various operating modes including a mode in performing instruction execution for each instruction for debugging the program It is intended to provide a high-performance data processing device.

【0026】更に本発明は、無条件分岐命令を効率よく
処理すると共に例外検出時にも正しく動作する高性能な
データ処理装置の提供を目的とする。
It is a further object of the present invention to provide a high-performance data processing device which efficiently processes an unconditional branch instruction and operates correctly even when an exception is detected.

【0027】[0027]

【課題を解決するための手段】請求項1に係る発明
ータ処理装置は、命令を格納するメモリと、該メモリか
ら命令を取り込む命令フェッチ部と、該命令フェッチ部
が取り込んだ命令をデコードする命令デコード部と、該
命令デコード部による命令のデコード結果に基づいて命
令を実行する命令実行部と、分岐命令の処理に関して、
分岐先アドレスの生成を行う手段と、前記分岐先アドレ
スを前記命令フェッチ部へ転送する転送手段とを有する
分岐先アドレス生成部と、分岐命令処理時に、前記命令
実行部での分岐条件の確定に先立って前記分岐先アドレ
ス生成部で生成された分岐先アドレスを前記転送手段を
介して前記命令フェッチ部へ転送して分岐先命令のフェ
ッチを指示する手段とを有する先行分岐手段とを備え、
前記命令フェッチ部は、前記メモリから取り込んだ命令
を一時保持するための第1及び第2の命令プリフェッチ
キューと、前記第1及び第2の命令プリフェッチキュー
に保持されている命令を前記命令デコード部に選択的に
出力する出力手段と、前記第1及び第2の命令プリフェ
ッチキューに取り込む命令のアドレスをそれぞれ保持す
る第1及び第2のアドレスレジスタとを有し、前記出力
手段により前記第1の命令プリフェッチキューの命令が
前記命令デコード部に出力されており、且つ前記第1の
命令プリフェッチキューに取り込まれている命令列中に
条件分岐命令が含まれている場合は、前記条件分岐命令
処理時に、前記命令デコード部におけるデコード後、前
記分岐先アドレス生成部により分岐先アドレスの生成を
行い、前記先行分岐手段は、前記分岐先アドレス生成部
で生成された第1の分岐先アドレスを前記転送手段を介
して前記命令フェッチ部へ転送すると共に分岐先アドレ
スの命令のフェッチを指示し、前記命令フェッチ部は、
前記第2のアドレスレジスタに前記第1の分岐先アドレ
スを格納し、前記第2の命令プリフェッチキューの初期
化後、前記第2の命令プリフェッチキューに前記第1の
分岐先アドレスから始まる命令列を取り込み、前記出力
手段により前記第1あるいは第2の命令プリフェッチキ
ューのいずれか一方に取り込まれている命令を前記命令
デコード部に出力し、前記出力手段により前記第1のプ
リフェッチキューの命令が前記命令デコード部に出力さ
れおり、且つ前記第1の命令プリフェッチキューに取り
込まれてる命令列中に 無条件分岐命令が含まれている場
合は、前記無条件分岐命令処理時に、前記命令デコード
部におけるデコード後、前記分岐先アドレス生成部によ
り分岐先アドレスの生成を行い、前記先行分岐手段は、
前記分岐先アドレス生成部で生成された第2の分岐先ア
ドレスを前記転送手段を介して前記命令フェッチ部へ転
送すると共に分岐先アドレスの命令のフェッチを指示
し、前記命令フェッチ部は、前記第1のアドレスレジス
タに前記第2の分岐先アドレスを格納し、前記第1の命
令プリフェッチキューの初期化後、前記第1の命令プリ
フェッチキューに前記第2の分岐先アドレスから始まる
命令列を取り込み、前記出力手段により前記第1の命令
プリフェッチキューに取り込まれている命令を前記命令
デコード部に出力すべくなしてあることを特徴とする。
According to a first aspect of the present invention, there is provided a data processing apparatus comprising: a memory for storing an instruction;
Instruction fetch unit for fetching instructions from the same, and the instruction fetch unit
An instruction decoding unit for decoding instructions fetched by the
The instruction is executed based on the instruction decode result of the instruction decode unit.
Instruction execution unit that executes instructions and processing of branch instructions
Means for generating a branch destination address, and the branch destination address
Transfer means for transferring a program to the instruction fetch unit.
A branch destination address generation unit, wherein the instruction
Prior to determining the branch condition in the execution unit, the branch destination address
Transfer the branch destination address generated by the
To the instruction fetch unit via
Preceding branch means having means for indicating a switch,
The instruction fetch unit includes an instruction fetched from the memory.
And second instruction prefetch for temporarily storing
Queue and the first and second instruction prefetch queues
The instruction held in the
Output means for outputting the first and second instruction pre-fetches;
Holds the address of the instruction to be taken into the
First and second address registers,
By means, the instruction in the first instruction prefetch queue is
Output to the instruction decoding unit, and
In the instruction sequence captured in the instruction prefetch queue,
If a conditional branch instruction is included, the conditional branch instruction
During processing, after decoding in the instruction decoding unit,
The branch destination address is generated by the branch destination address generator.
The branching means includes a branch destination address generation unit.
The first branch destination address generated in
And transfers it to the instruction fetch section,
Instruction fetch instruction, and the instruction fetch unit comprises:
The first branch destination address is stored in the second address register.
Stored in the second instruction prefetch queue.
After the conversion, the first instruction prefetch queue
Fetch instruction sequence starting from branch destination address and output
Means for storing the first or second instruction prefetch key.
The instruction fetched in either one of the
Output to the decoding unit, and the first processor
The instruction in the refetch queue is output to the instruction decode unit.
And is stored in the first instruction prefetch queue.
If an unconditional branch instruction is included in the instruction sequence
In the case of the unconditional branch instruction processing,
After decoding in the branch unit,
Generating a branch destination address, wherein the preceding branch means comprises:
The second branch destination address generated by the branch destination address generation unit.
Address to the instruction fetch unit via the transfer means.
Instruction to fetch the instruction at the branch destination address
And the instruction fetch unit is configured to store the first address register
The second branch destination address is stored in the
After the initialization of the instruction prefetch queue, the first instruction prefetch
Starting from the second branch destination address in the fetch queue
Fetching an instruction sequence, and outputting the first instruction
The instruction fetched in the prefetch queue is
It is characterized in that it is output to a decoding unit.

【0028】[0028]

【0029】[0029]

【0030】このような発明のデータ処理装置では、出
力手段により第1の命令プリフェッチキューの命令が命
令デコード部に出力されており、第1の命令プリフェッ
チキューに取り込まれている命令列の中に条件分岐命令
が含まれている場合には、条件分岐命令処理時に先行分
岐手段は分岐先アドレス生成部で分岐先アドレスの生成
を行い、生成された第1の分岐先アドレスを命令フェッ
チ部へ転送すると共に分岐先命令のフェッチを行うこと
を指示し、命令フェッチ部は第2のアドレスレジスタに
第1の分岐先アドレスを格納し、第2の命令プリフェッ
チキューに第1の分岐先アドレスから始まる命令列を取
り込ませ、出力手段により第1あるいは第2の命令プリ
フェッチキューのいずれか一方に取り込まれている命令
を命令デコード部に出力し、出力手段により第1の命令
プリフェッチキューの命令が命令デコード部に出力され
ており且つ第1の命令プリフェッチキューに取り込まれ
ている命令列の中に無条件分岐命令が含まれていれば、
無条件分岐命令処理時に先行分岐手段は分岐先アドレス
生成部で分岐先アドレスの生成を行って生成された第2
の分岐先アドレスを命令フェッチ部へ転送すると共に分
岐先命令のフェッチを行うことを指示し、命令フェッチ
部は第1のアドレスレジスタに第2の分岐先アドレスを
格納し且つ第1の命令プリフェッチキューに第2の分岐
先アドレスから始まる命令列を取り込んで出力手段によ
り第1の命令プリフェッチキューに取り込まれている命
令を命令デコード部に出力することにより、2つの命令
プリフェッチキューで条件分岐命令の直後の無条件分岐
命令についても分岐先命令をフェッチすることができ
る。
[0030] In such inventions of the data processing apparatus, the output means an instruction of the first instruction prefetch queue are output to the instruction decoding unit, in the instruction sequence which is incorporated into the first instruction prefetch queue When the conditional branch instruction is included, the precedent branch means generates a branch destination address in the branch destination address generation unit during the processing of the conditional branch instruction, and sends the generated first branch destination address to the instruction fetch unit. The instruction fetch unit stores the first branch destination address in the second address register, and starts the first branch destination address in the second instruction prefetch queue. An instruction sequence is fetched, and an instruction fetched by the output means into one of the first and second instruction prefetch queues is read by an instruction decoding unit. If the instruction in the first instruction prefetch queue is output to the instruction decoding unit by the output means and the instruction string taken in the first instruction prefetch queue contains an unconditional branch instruction ,
In processing the unconditional branch instruction, the preceding branch means generates the branch destination address by generating the branch destination address in the branch destination address generation unit.
Is transferred to the instruction fetch unit and fetch of the branch instruction is performed. The instruction fetch unit stores the second branch destination address in the first address register, and stores the first instruction prefetch queue in the first instruction register. The instruction sequence starting from the second branch destination address is fetched and the instruction taken in the first instruction prefetch queue is output to the instruction decoding unit by the output means, so that the instruction prefetch queue immediately follows the conditional branch instruction in the two instruction prefetch queues. Can be fetched also for the unconditional branch instruction.

【0031】請求項2に係る発明のデータ処理装置で
は、命令が格納されているメモリから命令を取り込む命
令フェッチ部と、命令フェッチ部が取り込んだ命令のデ
コードを行う命令デコード部と、命令のデコード結果に
基づいて命令の実行を行う命令実行部と、ジャンプ命令
の処理に関してジャンプ先アドレスの生成を行い、ジャ
ンプ先アドレスを命令フェッチ部へ転送する転送手段を
有するジャンプ先アドレス生成部とジャンプ命令処理時
にジャンプ先アドレス生成部で生成されたジャンプ先ア
ドレスを命令フェッチ部へ転送させると共にジャンプ先
命令のフェッチを指示する手段とを有する先行ジャンプ
手段を備え、更に命令あるいはハードウェアで設定が可
能な動作モードを指定するためのモードレジスタとを備
えている。
[0031] In the data processing apparatus of the invention according to claim 2, the instruction fetch unit fetches instructions from memory instructions are stored, and the instruction decoding unit for decoding the instruction fetched by the instruction fetch unit, decodes the instruction An instruction execution unit for executing an instruction based on the result, a jump destination address generation unit having a transfer unit for generating a jump destination address for the processing of the jump instruction, and transferring the jump destination address to the instruction fetch unit, and a jump instruction processing And a means for transferring the jump destination address generated by the jump destination address generation unit to the instruction fetch unit and instructing the fetch of the jump destination instruction. A mode register for designating a mode.

【0032】このような発明のデータ処理装置では、無
条件ジャンプ命令処理時に先行ジャンプ手段はジャンプ
先アドレス生成部でジャンプ先アドレスの生成を行って
ジャンプ先アドレスを命令フェッチ部へ転送し、命令フ
ェッチ部はジャンプ先命令のフェッチを行い、モードレ
ジスタが第1のモードを示していれば無条件ジャンプ命
令が命令実行部で処理され、モードレジスタが第2のモ
ードを示していれば無条件ジャンプ命令が命令実行部で
処理されないため、動作モードに応じて効率よくかつ正
しく無条件ジャンプ命令の処理を行うことができる。
[0032] Such a calling in the light of the data processing device, pre-jump means at the time of unconditional jump instruction processing transfers the jump destination address to the instruction fetch unit carried out the generation of the jump destination address at the jump destination address generating unit, instruction The fetch unit fetches a jump destination instruction. If the mode register indicates the first mode, the unconditional jump instruction is processed by the instruction execution unit. If the mode register indicates the second mode, the unconditional jump is performed. Since the instruction is not processed by the instruction execution unit, it is possible to efficiently and correctly process the unconditional jump instruction according to the operation mode.

【0033】請求項3に係る発明のデータ処理装置は、
命令が格納されているメモリから命令を取り込む命令フ
ェッチ部と、命令フェッチ部が取り込んだ命令のデコー
ドを行う命令デコード部と、命令のデコード結果に基づ
いて命令の実行を行う命令実行部と、ジャンプ命令の処
理に関してジャンプ先アドレスの生成を行い、ジャンプ
先アドレスを命令フェッチ部へ転送する転送手段を有す
るジャンプ先アドレス生成部と、ジャンプ先アドレスの
境界条件を判定する判定手段と、ジャンプ命令処理時に
ジャンプ先アドレス生成部で生成されたジャンプ先アド
レスを命令フェッチ部へ転送させると共にジャンプ先命
令のフェッチを指示する手段とを有する先行ジャンプ手
段とを備えている。
According to a third aspect of the present invention, there is provided a data processing apparatus comprising:
An instruction fetch unit that fetches an instruction from a memory in which the instruction is stored, an instruction decode unit that decodes the instruction fetched by the instruction fetch unit, an instruction execution unit that executes the instruction based on the result of decoding the instruction, and a jump. A jump destination address generation unit having transfer means for generating a jump destination address for instruction processing and transferring the jump destination address to the instruction fetch unit; a determination unit for determining a boundary condition of the jump destination address; Means for transferring the jump destination address generated by the jump destination address generation unit to the instruction fetch unit and for instructing the fetch of the jump destination instruction.

【0034】このような発明のデータ処理装置では、無
条件ジャンプ命令処理時に先行ジャンプ手段はジャンプ
先アドレス生成部でジャンプ先アドレスの生成を行って
ジャンプ先アドレスを命令フェッチ部へ転送し、命令フ
ェッチ部はジャンプ先命令のフェッチを行い、判定手段
で例外が検出されていれば無条件ジャンプ命令が命令実
行部で処理され、判定手段で例外が検出されていなけれ
ば無条件ジャンプ命令が命令実行部で処理されないた
め、効率よくかつ例外検出時にも正しく無条件ジャンプ
命令の処理を行うことができる。
[0034] In such inventions of the data processing device, pre-jump means at the time of unconditional jump instruction processing transfers the jump destination address to the instruction fetch unit carried out the generation of the jump destination address at the jump destination address generating unit, instruction The fetch unit fetches a jump destination instruction. If an exception is detected by the determination unit, the unconditional jump instruction is processed by the instruction execution unit. If no exception is detected by the determination unit, the unconditional jump instruction is executed. Since it is not processed by the section, the unconditional jump instruction can be processed efficiently and correctly even when an exception is detected.

【0035】[0035]

【発明の実施の形態】以下、本発明をその実施の形態を
示す図面に基づいて詳述する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the drawings showing the embodiments.

【0036】〔実施の形態1〕 (1) 「本発明のデータ処理装置を用いたシステムの構
成」 図4は本発明のデータ処理装置100 を用いたシステム構
成の実施の形態の一例を示すブロック図である。
[First Embodiment] (1) "Configuration of System Using Data Processing Apparatus of the Present Invention" FIG. 4 is a block diagram showing an example of an embodiment of a system configuration using a data processing apparatus 100 of the present invention. FIG.

【0037】本実施の形態では、本発明のデータ処理装
置100, 命令キャッシュ106, データキャッシュ107, 1
08及び主メモリ109 がアドレスバス101, データバス10
2,命令バス103, メモリアドレスバス104 及びメモリデ
ータバス105 で相互に結合されている。
In this embodiment, the data processor 100, the instruction cache 106, the data cache 107, 1
08 and main memory 109 are address bus 101, data bus 10
2, mutually connected by an instruction bus 103, a memory address bus 104 and a memory data bus 105.

【0038】アドレスバス101 は本発明のデータ処理装
置100 から出力されるアドレスを命令キャッシュ106 と
データキャッシュ107, 108とに入力する。命令バス103
は命令キャッシュ106 から出力される命令コードを本発
明のデータ処理装置100 へ転送する。データバス102 は
本発明のデータ処理装置100 から出力されるデータをデ
ータキャッシュ107, 108へ転送し、またデータキャッシ
ュ107, 108から出力されるデータを本発明のデータ処理
装置100 へ転送する。メモリアドレスバス104は命令キ
ャッシュ106 またはデータキャッシュ107, 108から出力
されるアドレスを主メモリ109 へ転送する。メモリデー
タバス105 は主メモリ109 と命令キャッシュ106 または
データキャッシュ107, 108間で命令またはデータを転送
する。
The address bus 101 inputs an address output from the data processor 100 of the present invention to the instruction cache 106 and the data caches 107 and 108. Instruction bus 103
Transfers the instruction code output from the instruction cache 106 to the data processing device 100 of the present invention. The data bus 102 transfers data output from the data processing device 100 of the present invention to the data caches 107 and 108, and transfers data output from the data caches 107 and 108 to the data processing device 100 of the present invention. The memory address bus 104 transfers addresses output from the instruction cache 106 or the data caches 107 and 108 to the main memory 109. The memory data bus 105 transfers instructions or data between the main memory 109 and the instruction cache 106 or the data caches 107 and 108.

【0039】命令キャッシュ106, データキャッシュ10
7, 108がミスした場合はそれぞれのキャッシュ106, 107
または108 がメモリアドレスバス104 とメモリデータバ
ス105 とのバス権を調停して主メモリ109 をアクセスす
る。
Instruction cache 106, data cache 10
If 7, 108 misses each cache 106, 107
Or 108 accesses the main memory 109 by arbitrating the bus right between the memory address bus 104 and the memory data bus 105.

【0040】データキャッシュ107, 108は本発明のデー
タ処理装置100 側では64ビットのバスに結合しているた
め、両データキャッシュ107, 108が協調して動作する。
各64ビットデータ単位のデータの内の上位32ビットのデ
ータをデータキャッシュ107が、下位32ビットのデータ
をデータキャッシュ108 がそれぞれ分担して受け持つ。
Since the data caches 107 and 108 are connected to the 64-bit bus on the data processing device 100 side of the present invention, both data caches 107 and 108 operate in cooperation.
The data cache 107 takes charge of the upper 32 bits of the data of each 64-bit data unit, and the data cache 108 takes charge of the lower 32 bits of data.

【0041】以下、本発明のデータ処理装置100 の命令
体系及び処理機構について最初に説明し、次にジャンプ
命令の処理方法について詳しく説明する。
Hereinafter, an instruction system and a processing mechanism of the data processing apparatus 100 of the present invention will be described first, and then a method of processing a jump instruction will be described in detail.

【0042】(2) 「本発明のデータ処理装置の命令ビッ
ト割り付け」 (2.1) 「命令フォーマット」 本発明のデータ処理装置の命令は16ビット単位で可変長
となっており、奇数バイト長の命令はない。
(2) "Assignment of instruction bits of data processing device of the present invention" (2.1) "Instruction format" Instructions of the data processing device of the present invention have a variable length in 16-bit units, and have an odd byte length. There is no.

【0043】本発明のデータ処理装置100 では高頻度に
使用される命令を短いフォーマットとするため、特に工
夫された命令フォーマット体系を有する。たとえば、2
オペランド命令に対しては基本的に「4バイト+拡張
部」の構成を有し、全てのアドレッシングモードが利用
可能な一般形フォーマットと、頻度の高い命令とアドレ
ッシングモードとのみを使用可能な短縮形フォーマット
の2つのフォーマットを有する。
The data processing apparatus 100 of the present invention has a specially designed instruction format system in order to make frequently used instructions into a short format. For example, 2
Operand instructions have a basic structure of "4 bytes + extension part", a general format that can use all addressing modes, and a short form that can use only frequently used instructions and addressing modes. It has two formats: a format.

【0044】図8乃至図16は本発明のデータ処理装置の
命令フォーマットを示す模式図である。これらの模式図
中に現われる記号の意味は以下の通りである。
FIGS. 8 to 16 are schematic diagrams showing an instruction format of the data processing apparatus of the present invention. The meanings of the symbols appearing in these schematic diagrams are as follows.

【0045】−:オペレーションコードが入る部分 #:リテラルまたは即値の入る部分 Ea:8ビットの一般形のアドレッシングモードでオペラ
ンドを指定する部分 Sh:6ビットの短縮形のアドレッシングモードでオペラ
ンドを指定する部分 Rn: レジスタファイル上のオペランドをレジスタ番号
で指定する部分 * : 何が入ってもかまわない部分
-: Part where operation code is entered #: Part where literal or immediate value is entered Ea: Part where operand is specified in 8-bit general addressing mode Sh: Part where operand is specified in 6-bit compact addressing mode Rn: Part where the operand on the register file is specified by the register number *: Part where anything can be entered

【0046】フォーマットは、図8に示すように右側が
LSB側で、かつ高いアドレスになっている。アドレスN
とアドレスN+1との2バイトを見た後でないと命令フォ
ーマットが判別できないようになっているが、これは命
令が必ず16ビット(ハーフワード)単位でフェッチ、デ
コードされることを前提としたためである。
The format is shown on the right side as shown in FIG.
The address is higher on the LSB side. Address N
The instruction format can be identified only after looking at the two bytes of address and address N + 1. However, this is because instructions are always fetched and decoded in 16-bit (halfword) units. It is.

【0047】本発明のデータ処理装置100 の命令では、
いずれのフォーマットの場合も、各オペランドのEaまた
はShの拡張部は必ずそのEaまたはShの基本部を含む16ビ
ット(ハーフワード)の直後に置かれる。これは、命令
により暗黙に指定される即値データ及び命令の拡張部に
優先する。従って、4バイト以上の命令では、Eaの拡張
部によって命令のオペレーションコードが分断される場
合がある。
According to the instruction of the data processing device 100 of the present invention,
In either format, the Ea or Sh extension of each operand is always placed immediately after the 16-bit (halfword) containing the Ea or Sh base. This overrides immediate data implicitly specified by the instruction and the extension of the instruction. Therefore, in the case of an instruction of 4 bytes or more, the operation code of the instruction may be divided by the extension of Ea.

【0048】また、後述するように、多段間接モードに
おいてEaの拡張部に更に拡張部が付加される場合にも次
の命令オペレーションコードよりもそちらの方が優先さ
れる。例えば、第1ハーフワードにEa1を含み、第2ハ
ーフワードにEa2 を含み、第3ハーフワードまである6
バイト命令の場合について考える。なおこおでは、Ea1
に多段間接モードを使用したため、普通の拡張部の他に
多段間接モードの拡張部も付加されるものとする。この
場合、実際の命令ビットパターンは、命令の第1ハーフ
ワード(Ea1の基本部を含む), Ea1の多段間接モード
拡張部, 命令の第2ハーフワード(Ea2の基本部を含
む), Ea2の拡張部, 命令の第3ハーフワードの順とな
る。
As will be described later, even when an extension is added to the extension of Ea in the multistage indirect mode, that extension has priority over the next instruction operation code. For example, the first halfword contains Ea1, the second halfword contains Ea2, and up to the third halfword.
Consider the case of a byte instruction. At Naokoo, Ea1
Since the multi-stage indirect mode is used in this embodiment, it is assumed that a multi-stage indirect mode extension is added in addition to the normal extension. In this case, the actual instruction bit pattern is the first halfword of the instruction (including the basic part of Ea1), the multi-stage indirect mode extension of Ea1, the second halfword of the instruction (including the basic part of Ea2), and the The extension is in the order of the third halfword of the instruction.

【0049】(2.1.1) 「短縮形2オペランド命令」 図9乃至図12は2オペランド命令の短縮形フォーマット
を示す模式図である。
(2.1.1) "Short-form two-operand instruction" FIGS. 9 to 12 are schematic diagrams showing a short-form format of a two-operand instruction.

【0050】図9はメモリ−レジスタ間演算命令のフォ
ーマットを示す模式図である。このフォーマットにはソ
ースオペランド側がメモリとなるL-formatと、デスティ
ネーションオペランド側がメモリとなるS-formatがあ
る。
FIG. 9 is a schematic diagram showing the format of a memory-register operation instruction. This format includes an L-format in which the source operand side is a memory and an S-format in which the destination operand side is a memory.

【0051】L-formatでは、Shはソースオペランドの指
定フィールドを、Rnはデスティネーションオペランドの
レジスタの指定フィールドを、RRはShのオペランドサイ
ズの指定をそれぞれ表す。レジスタ上に置かれたデステ
ィネーションオペランドのサイズは、32ビットに固定さ
れている。レジスタ側とメモリ側とのサイズが異なり、
且つソース側のサイズが小さい場合に符号拡張が行なわ
れる。また、一部の命令(加算命令, 減算命令)では、
ソースのオペランドサイズもワードに固定されている。
この場合、RRのフィールドはオペレーションコードとな
っている。
In the L-format, Sh indicates the specification field of the source operand, Rn indicates the specification field of the register of the destination operand, and RR indicates the specification of the operand size of Sh. The size of the destination operand placed in the register is fixed at 32 bits. The size of the register side and the memory side are different,
When the size on the source side is small, sign extension is performed. Some instructions (addition instruction, subtraction instruction)
The source operand size is also fixed at word.
In this case, the RR field is an operation code.

【0052】S-formatでは、Shはデスティネーションオ
ペランドの指定フィールドを、Rnはソースオペランドの
レジスタ指定フィールドを、RRはShのオペランドサイズ
の指定フィールドをそれぞれ表す。レジスタ上に置かれ
たソースオペランドのサイズは32ビットに固定されてい
る。レジスタ側とメモリ側とのサイズが異なり、且つソ
ース側のサイズが大きい場合は、オーバフローした部分
の切り捨てとオーバフローチェックが行なわれる。
In the S-format, Sh indicates a destination operand specification field, Rn indicates a source operand register specification field, and RR indicates a Sh operand size specification field. The size of the source operand placed in the register is fixed at 32 bits. If the size of the register is different from that of the memory and the size of the source is large, the overflowed part is truncated and an overflow check is performed.

【0053】図10はレジスタ−レジスタ間演算命令のフ
ォーマット(R-format)を示す模式図である。このフォー
マットでは、Rnはデスティネーションレジスタの指定フ
ィールドを、Rmはソースレジスタの指定フィールドをそ
れぞれ示している。オペランドサイズは32ビットのみで
ある。
FIG. 10 is a schematic diagram showing the format (R-format) of a register-register operation instruction. In this format, Rn indicates a designated field of the destination register, and Rm indicates a designated field of the source register. Operand size is only 32 bits.

【0054】図11はリテラル−メモリ間演算命令のフォ
ーマット(Q-format)を示す模式図である。このフォーマ
ットでは、MMはディスティネーションオペランドサイズ
の指定フィールドを、#はリテラルによるソースオペラ
ンドの指定フィールドを、Shはデスティネーションオペ
ランドの指定フィールドをそれぞれ示している。
FIG. 11 is a schematic diagram showing a format (Q-format) of a literal-memory operation instruction. In this format, MM indicates a destination operand size specification field, # indicates a literal source operand specification field, and Sh indicates a destination operand specification field.

【0055】図12は即値−メモリ間演算命令のフォーマ
ット(I-format)の模式図である。このフォーマットで
は、MMはオペランドサイズの指定フィールド(ソース,
ディスティネーションで共通)を、Shはデスティネーシ
ョンオペランドの指定フィールドをそれぞれ示してい
る。I-formatの即値のサイズはデスティネーション側の
オペランドのサイズと共通であって8, 16, 32ビットと
なり、ゼロ拡張、符号拡張は行なわれない。
FIG. 12 is a schematic diagram of a format (I-format) of an immediate-memory operation instruction. In this format, MM specifies the operand size specification field (source,
), And Sh indicates a destination operand specification field. The size of the immediate value of the I-format is common to the size of the operand on the destination side, and is 8, 16, or 32 bits, and neither zero extension nor sign extension is performed.

【0056】(2.1.2) 「一般形1オペランド命令」 図13は1オペランド命令の一般形フォーマット(G1-form
at) を示す模式図である。このフォーマットでは、MMは
オペランドサイズの指定フィールドを表している。一部
のG1-format 命令では、Eaの拡張部以外にも拡張部を有
する。また、MMを使用しない命令もある。
(2.1.2) "General form one-operand instruction" FIG. 13 shows a general form (G1-form) of a one-operand instruction.
FIG. In this format, MM represents an operand size specification field. Some G1-format instructions have an extension in addition to the extension of Ea. Some instructions do not use MM.

【0057】(2.1.3) 「一般形2オペランド命令」 図14乃至図16は2オペランド命令の一般形フォーマット
を示す模式図である。このフォーマットに含まれるの
は、8ビットで指定される一般形アドレッシングモード
のオペランドが最大2つ存在する命令である。オペラン
ドの総数自体は3つ以上になる場合がある。
(2.1.3) "General Type Two Operand Instruction" FIGS. 14 to 16 are schematic diagrams showing a general format of a two operand instruction. Included in this format are instructions that have at most two operands in the general addressing mode specified by eight bits. The total number of operands itself may be three or more.

【0058】図14は第1オペランドがメモリ読み出しを
必要とする命令のフォーマット(G-format)を示す模式図
である。このフォーマットでは、 EaMはデスティネーシ
ョンオペランドの指定フィールドを、MMはデスティネー
ションオペランドサイズの指定フィールドを、 EaRはソ
ースオペランド指定フィールドを、RRはソースオペラン
ドサイズの指定フィールドをそれぞれ表している。な
お、一部のG-format命令では、EaM, EaRの拡張部以外に
も拡張部を有する。
FIG. 14 is a schematic diagram showing a format (G-format) of an instruction whose first operand requires memory reading. In this format, EaM indicates a destination operand specification field, MM indicates a destination operand size specification field, EaR indicates a source operand specification field, and RR indicates a source operand size specification field. Note that some G-format instructions have an extension in addition to the EaM and EaR extensions.

【0059】図15は第1オペランドが8ビット即値の命
令のフォーマット(E-format)を示す模式図である。この
フォーマットでは、 EaMはデスティネーションオペラン
ドの指定フィールドを、MMはデスティネーションオペラ
ンドサイズの指定フィールドを、#はソースオペランド
値をそれぞれ表している。
FIG. 15 is a schematic diagram showing a format (E-format) of an instruction in which the first operand is an 8-bit immediate value. In this format, EaM indicates a destination operand specification field, MM indicates a destination operand size specification field, and # indicates a source operand value.

【0060】図16は第1オペランドがアドレス計算のみ
の命令のフォーマット(GA-format)を示す模式図であ
る。このフォーマットでは、 EaWはデスティネーション
オペランドの指定フィールドを、WWはデスティネーショ
ンオペランドサイズの指定フィールドを、EaA はソース
オペランドの指定フィールドをそれぞれ表している。な
お、ソースオペランドとしては実効アドレスの計算結果
自体が使用される。
FIG. 16 is a schematic diagram showing a format (GA-format) of an instruction in which the first operand has only an address calculation. In this format, EaW indicates a destination operand specification field, WW indicates a destination operand size specification field, and EaA indicates a source operand specification field. The calculation result of the effective address itself is used as the source operand.

【0061】(2.1.4) 「その他の命令」 上述の命令の他に、変則的なオペランド指定を行う命
令、あるいはオペランド指定の無いオペレーションコー
ドのみの命令なども存在する。
(2.1.4) "Other Instructions" In addition to the above-mentioned instructions, there are also instructions for irregularly specifying operands, instructions only for operation codes without operand specification, and the like.

【0062】(2.2) 「アドレッシングモード」 本発明のデータ処理装置100 の命令のアドレッシングモ
ード指定方法には、レジスタを含めて6ビットで指定す
る短縮形と、8ビットで指定する一般形とがある。
(2.2) "Addressing Mode" The addressing mode of the instruction of the data processing apparatus 100 of the present invention can be specified in a short form of specifying 6 bits including a register or in a general form of specifying 8 bits. .

【0063】未定義のアドレッシングモードを指定した
場合、あるいは意味的に考えて明らかに不合理なアドレ
ッシングモードの組合わせが指定された場合には、未定
義命令を実行した場合と同様に予約命令例外を発生し、
例外処理が起動される。これに該当するのは、デスティ
ネーションが即値モードである場合、アドレス計算を伴
うべきアドレシングモード指定フィールドで即値モード
が使用されたた場合などである。
When an undefined addressing mode is specified, or when a combination of addressing modes that is obviously unreasonable from a semantic point of view is specified, a reserved instruction exception is executed in the same manner as when an undefined instruction is executed. Causes
Exception processing is started. This corresponds to a case where the destination is the immediate mode, a case where the immediate mode is used in the addressing mode designation field to be accompanied by the address calculation, and the like.

【0064】図17乃至図27に示すフォーマットの模式図
中で使われている記号の意味は以下の如くである。
The meanings of the symbols used in the schematic diagrams of the formats shown in FIGS. 17 to 27 are as follows.

【0065】Rn:レジスタ指定 (Sh):6 ビットの短縮形アドレッシングモードでの指定
方法 (Ea):8ビットの一般形アドレッシングモードでの指定
方法 なお、各フォーマットの模式図において点線にて表され
ている部分は拡張部を示す。
Rn: Register specification (Sh): Specification method in 6-bit compact addressing mode (Ea): Specification method in 8-bit general addressing mode It is represented by a dotted line in a schematic diagram of each format. The part which shows is an extended part.

【0066】(2.2.1) 「基本アドレッシングモード」 本発明のデータ処理装置100 の命令は種々のアドレッシ
ングモードをサポートする。それらの内、本発明のデー
タ処理装置100 でサポートする基本アドレッシングモー
ドには、レジスタ直接モード, レジスタ間接モード, レ
ジスタ相対間接モード, 即値モード, 絶対モード, PC相
対間接モード, スタックポップモード,スタックプッシ
ュモードがある。
(2.2.1) "Basic Addressing Mode" The instructions of the data processing apparatus 100 of the present invention support various addressing modes. Among them, the basic addressing modes supported by the data processor 100 of the present invention include register direct mode, register indirect mode, register relative indirect mode, immediate mode, absolute mode, PC relative indirect mode, stack pop mode, and stack push mode. There is a mode.

【0067】レジスタ直接モードは、レジスタの内容を
そのままオペランドとするアドレッシングモードであ
る。フォーマットの模式図を図17に示す。図中、Rnは汎
用レジスタまたは FPUレジスタの番号を示す。
The register direct mode is an addressing mode in which the contents of a register are used as an operand. FIG. 17 shows a schematic diagram of the format. In the figure, Rn indicates the number of a general-purpose register or FPU register.

【0068】レジスタ間接モードは、汎用レジスタの内
容をアドレスとするメモリの内容をオペランドとするア
ドレッシングモードである。フォーマットの模式図を図
18に示す。図中、Rnは汎用レジスタの番号を示す。
The register indirect mode is an addressing mode in which the contents of a memory whose addresses are the contents of general-purpose registers are used as operands. Diagram of format schematic
See Figure 18. In the figure, Rn indicates the number of a general-purpose register.

【0069】レジスタ相対間接モードは、ディスプレー
スメント値が16ビットであるか32ビットであるかにより
2種類に分かれる。いずれも、汎用レジスタの内容に16
ビットまたは32ビットのディスプレースメント値を加え
た値をアドレスとするメモリの内容をオペランドとする
アドレッシングモードである。フォーマットの模式図を
図19に示す。図中、Rnは汎用レジスタの番号を示す。di
sp:16とdisp:32とは、それぞれ16ビットのディスプレ
ースメント値, 32ビットのディスプレースメント値を示
す。ディスプレースメント値は符号付きとして扱われ
る。
The register relative indirect mode is classified into two types depending on whether the displacement value is 16 bits or 32 bits. In each case, 16
This is an addressing mode in which the contents of a memory whose address is a value obtained by adding a displacement value of 32 bits or 32 bits as an operand. FIG. 19 shows a schematic diagram of the format. In the figure, Rn indicates the number of a general-purpose register. di
sp: 16 and disp: 32 indicate a 16-bit displacement value and a 32-bit displacement value, respectively. Displacement values are treated as signed.

【0070】即値モードは、命令コード中で指定される
ビットパターンをそのまま2進数と見なしてオペランド
とするアドレッシングモードである。フォーマットの模
式図を図20に示す。図中、 imm_dataは即値を示す。 i
mm_dataのサイズは、オペランドサイズとして命令中で
指定される。
The immediate mode is an addressing mode in which a bit pattern specified in an instruction code is regarded as a binary number and used as an operand. FIG. 20 shows a schematic diagram of the format. In the figure, imm_data indicates an immediate value. i
The size of mm_data is specified in the instruction as an operand size.

【0071】絶対モードは、アドレス値が16ビットで示
されるか32ビットで示されるかにより2種類に分かれ
る。いずれも、命令コード中で指定される16ビットまた
は32ビットのビットパターンをアドレスとしたメモリの
内容をオペランドとするアドレッシングモードである。
フォーマットの模式図を図21に示す。図中、abs:16とab
s:32とは、それぞれ16ビット, 32ビットのアドレス値を
示す。abs:16にてアドレスが示される場合は指定された
アドレス値を32ビットに符号拡張される。
The absolute mode is divided into two types depending on whether the address value is represented by 16 bits or 32 bits. Each of these modes is an addressing mode in which the contents of a memory whose address is a bit pattern of 16 bits or 32 bits specified in the instruction code is used as an operand.
FIG. 21 shows a schematic diagram of the format. In the figure, abs: 16 and ab
s: 32 indicates a 16-bit and 32-bit address value, respectively. When the address is indicated by abs: 16, the specified address value is sign-extended to 32 bits.

【0072】PC相対間接モードは、ディスプレースメン
ト値が16ビットであるか32ビットであるかにより2種類
に分かれる。いずれも、プログラムカウンタの内容に16
ビットまたは32ビットのディスプレースメント値を加え
た値をアドレスとするメモリの内容をオペランドとする
アドレッシングモードである。フォーマットの模式図を
図22に示す。図中、disp:16 とdisp:32 とは、それぞれ
16ビットのディスプレースメント値, 32ビットのディス
プレースメント値を示す。ディスプレースメント値は符
号付きとして扱われる。PC相対間接モードにおいて参照
されるプログラムカウンタの値は、そのオペランドを含
む命令の先頭アドレスである。多段間接アドレッシング
モードにおいてプログラムカウンタの値が参照される場
合にも、同様に命令の先頭のアドレスがPC相対モードの
基準値として使用される。
The PC relative indirect mode is divided into two types depending on whether the displacement value is 16 bits or 32 bits. In either case, the contents of the program counter are 16
This is an addressing mode in which the contents of a memory whose address is a value obtained by adding a displacement value of 32 bits or 32 bits as an operand. FIG. 22 shows a schematic diagram of the format. In the figure, disp: 16 and disp: 32 are respectively
Indicates a 16-bit displacement value and a 32-bit displacement value. Displacement values are treated as signed. The value of the program counter referred to in the PC relative indirect mode is the start address of the instruction including the operand. Similarly, when the value of the program counter is referred to in the multi-stage indirect addressing mode, the head address of the instruction is used as the reference value in the PC relative mode.

【0073】スタックポップモードはスタックポインタ
(SP)の内容をアドレスとするメモリの内容をオペランド
とするアドレッシングモードである。オペランドアクセ
ス後にSPがオペランドサイズだけインクリメントされ
る。例えば、32ビットデータが扱われる場合には、オペ
ランドアクセス後にSPが+4だけ更新される。8, 16, 64
ビットのサイズのオペランドに対するスタックポップモ
ードの指定も可能であり、それぞれSPが+1, +2, +
8だけ更新される。フォーマットの模式図を図23に示
す。オペランドに対しスタックポップモードが意味を持
たない場合には予約命令例外が発生する。具体的に予約
命令例外となるのは、 writeオペランド及びread-modif
y-writeオペランドに対するスタックポップモード指定
である。
The stack pop mode is a stack pointer
This is an addressing mode in which the contents of a memory whose address is the contents of (SP) are used as an operand. After the operand access, the SP is incremented by the operand size. For example, when 32-bit data is handled, SP is updated by +4 after operand access. 8, 16, 64
It is also possible to specify the stack pop mode for bit-sized operands, where SP is +1, +2, +
8 is updated. FIG. 23 shows a schematic diagram of the format. If the stack pop mode has no meaning for the operand, a reserved instruction exception occurs. Specifically, reserved instruction exceptions are the write operand and read-modif
Stack pop mode specification for the y-write operand.

【0074】スタックプッシュモードはSPの内容をオペ
ランドサイズだけデクリメントした内容をアドレスとす
るメモリの内容をオペランドとするアドレッシングモー
ドである。スタックプッシュモードではオペランドアク
セス前にSPがデクリメントされる。例えば、32ビットデ
ータが扱われる場合には、オペランドアクセス前にSPが
-4だけ更新される。8, 16, 64ビットのサイズのオペラ
ンドに対するスタックプッシュモードの指定も可能であ
り、それぞれSPが−1, −2, −8だけ更新される。フ
ォーマットの模式図を図24に示す。オペランドに対して
スタックプッシュモードが意味を持たない場合には予約
命令例外が発生する。具体的に予約命令例外となるの
は、readオペランド及び read-modify-writeオペランド
に対すスタックプッシュモード指定である。
The stack push mode is an addressing mode in which the contents of the memory whose addresses are the contents of the SP decremented by the operand size are used as the operands. In the stack push mode, SP is decremented before operand access. For example, when 32-bit data is handled, SP
Updated by -4. It is also possible to specify a stack push mode for operands of 8, 16, and 64 bits, and the SP is updated by -1, -2 and -8, respectively. FIG. 24 shows a schematic diagram of the format. If the stack push mode has no meaning for the operand, a reserved instruction exception occurs. A specific exception to the reserved instruction is the stack push mode specification for the read operand and the read-modify-write operand.

【0075】(2.2.2) 「多段間接アドレッシングモー
ド」 複雑なアドレッシングも、基本的には加算と間接参照の
組み合わせに分解することが可能である。従って、加算
と間接参照のオペレーションをアドレッシングのプリミ
ティブとして与えておき、それらを任意に組み合わせる
ことができれば、どんな複雑なアドレッシングモードを
も実現することが出来る。
(2.2.2) "Multi-stage indirect addressing mode" Complex addressing can be basically decomposed into a combination of addition and indirect reference. Therefore, if the addition and indirect reference operations are given as addressing primitives, and they can be arbitrarily combined, any complicated addressing mode can be realized.

【0076】本発明のデータ処理装置100 の命令の多段
間接アドレッシングモードは上述のような考え方に基づ
いたアドレッシングモードである。複雑なアドレッシン
グモードは、モジュール間のデータ参照あるいは AI(人
工知能) 言語の処理系に特に有用である。
The multi-stage indirect addressing mode of the instruction of the data processing apparatus 100 of the present invention is an addressing mode based on the above-described concept. Complex addressing modes are particularly useful for inter-module data references or AI (Artificial Intelligence) language implementations.

【0077】多段間接アドレッシングモードを指定する
場合、基本アドレッシングモード指定フィールドではレ
ジスタベース多段間接モード, PCベース多段間接モー
ド, 絶対ベース多段間接モードの3種類の指定方法の内
のいずれか1つを指定する。
When the multi-stage indirect addressing mode is designated, one of three types of designation methods, ie, a register-based multi-stage indirect mode, a PC-based multi-stage indirect mode, and an absolute-based multi-stage indirect mode, is designated in the basic addressing mode designation field. I do.

【0078】レジスタベース多段間接モードは、汎用レ
ジスタの値を、拡張する多段間接アドレッシングのベー
ス値とするアドレッシングモードである。フォーマット
の模式図を図25に示す。図中、Rnは汎用レジスタの番号
を示す。
The register-based multistage indirect mode is an addressing mode in which the value of a general-purpose register is used as a base value of the extended multistage indirect addressing. FIG. 25 shows a schematic diagram of the format. In the figure, Rn indicates the number of a general-purpose register.

【0079】PCベース多段間接モードは、プログラムカ
ウンタの値を拡張する多段間接アドレッシングのベース
値とするアドレッシングモードである。フォーマットの
模式図を図26に示す。
The PC-based multistage indirect mode is an addressing mode in which the base value of the multistage indirect addressing for extending the value of the program counter is used. FIG. 26 shows a schematic diagram of the format.

【0080】絶対ベース多段間接モードは、ゼロを拡張
する多段間接アドレッシングのベース値とするアドレッ
シングモードである。フォーマットの模式図を図27に示
す。
The absolute base multistage indirect mode is an addressing mode in which the base value of the multistage indirect addressing extending zero is used. FIG. 27 shows a schematic diagram of the format.

【0081】拡張される多段間接モード指定フィールド
は16ビットを単位としており、これが任意回反復して付
加される。1段の多段間接アドレッシングモードによ
り、ディスプレースメントの加算, インデクスレジスタ
のスケーリング(×1, ×2,×4, ×8)と加算, メ
モリの間接参照を行なう。多段間接モードのフォーマッ
トの模式図を図28に示す。各フィールドは以下に示す意
味を有する。
The extended multi-stage indirect mode designation field has a unit of 16 bits, and is repeatedly added arbitrarily. In a single-stage multi-stage indirect addressing mode, displacement addition, index register scaling (× 1, × 2, × 4, × 8) and addition, and indirect memory reference are performed. FIG. 28 shows a schematic diagram of the format of the multistage indirect mode. Each field has the following meaning.

【0082】E=0 :多段間接モード継続 E=1 :アドレス計算終了 tmp ==> address of operand I=0 :メモリ間接参照なし tmp + disp + Rx * Scale ==> tmp I=1 :メモリ間接参照あり mem[tmp + disp + Rx * Scale] ==> tmpE = 0: Continue multi-stage indirect mode E = 1: End of address calculation tmp ==> address of operand I = 0: No memory indirect reference tmp + disp + Rx * Scale ==> tmp I = 1: Memory indirect With reference mem [tmp + disp + Rx * Scale] ==> tmp

【0083】M=0 : <Rx> をインデクスとして使用 M=1 :特殊なインデクス <Rx>=0 インデクス値を加算しない (Rx=0) <Rx>=1 プログラムカウンタをインデクス値として使
用 (Rx=PC) <Rx>=2〜 reserved
M = 0: <Rx> is used as an index M = 1: Special index <Rx> = 0 Index value is not added (Rx = 0) <Rx> = 1 Program counter is used as an index value (Rx = PC) <Rx> = 2 ~ reserved

【0084】D=0 :多段間接アドレッシングモード中の
4ビットのフィールドd4の値を4倍してディスプレース
メント値とし、これを加算する。d4は符号付きとして扱
われ、オペランドのサイズとは関係なく必ず4倍して使
用される。 D=1 :多段間接アドレッシングモードの拡張部で指定さ
れたdispx (16/32ビット)をディスプレースメント値と
し、これを加算する。拡張部のサイズはd4フィールドで
指定する。 d4 = 0001 dispxは16ビット d4 = 0010 dispxは32ビット XX :インデクスのスケール(scale = 1/2/4/8)
D = 0: The value of the 4-bit field d4 in the multistage indirect addressing mode is multiplied by 4 to obtain a displacement value, which is added. d4 is treated as signed, and is always used four times regardless of the size of the operand. D = 1: The dispx (16/32 bits) specified in the extension of the multi-stage indirect addressing mode is set as a displacement value, and this is added. The size of the extension is specified in the d4 field. d4 = 0001 dispx is 16 bits d4 = 0010 dispx is 32 bits XX: Scale of index (scale = 1/2/4/8)

【0085】プログラムカウンタに対して×2, ×4,
×8のスケーリングを行なった場合には、その段の処理
終了後の中間値(tmp) として不定値が入る。この多段間
接アドレッシングモードによって得られる実効アドレス
は予測できない値となるが、例外は発生しない。プログ
ラムカウンタに対するスケーリングの指定は禁じられて
いる。
With respect to the program counter, × 2, × 4,
When the scaling of × 8 is performed, an undefined value is entered as an intermediate value (tmp) after the processing of the stage is completed. The effective address obtained by this multi-stage indirect addressing mode has an unpredictable value, but no exception occurs. Specifying scaling for the program counter is prohibited.

【0086】多段間接アドレッシングモードによる命令
フォーマットのバリエーションを図29及び図30の模式図
に示す。図29は多段間接アドレッシングモードが継続す
るか終了するかのバリエーションを、図30はディスプレ
ースメントのサイズのバリエーションをそれぞれ示す。
Variations of the instruction format in the multi-stage indirect addressing mode are shown in FIGS. 29 and 30. FIG. 29 shows variations of whether the multi-stage indirect addressing mode continues or ends, and FIG. 30 shows variations of the displacement size.

【0087】任意段数の多段間接アドレッシングモード
が利用できれば、コンパイラの中で段数による場合分け
が不要になるので、コンパイラの負担が軽減されるとい
うメリットがある。多段の間接参照の頻度が非常に少な
いとしても、コンパイラとしては必ず正しいコードを発
生できなければならないからである。このため、フォー
マット上では任意の段数が可能になっている。
If the multi-stage indirect addressing mode with an arbitrary number of stages can be used, there is no need to classify the stages according to the number of stages in the compiler, and there is an advantage that the load on the compiler is reduced. This is because even if the frequency of multi-stage indirect references is extremely low, the compiler must always be able to generate correct code. For this reason, any number of stages is possible on the format.

【0088】(2.3) 「ジャンプ命令」図31乃至図47の模
式図に本発明のデータ処理装置100 のジャンプ命令の命
令フォーマットを示す。ここでは、以下に説明する先行
ジャンプ関連処理の対象となる命令のみをあげている。
図31乃至図47に現われる”*”は何が入っても構わない
部分であることを示す。
(2.3) "Jump Instruction" FIG. 31 to FIG. 47 schematically show the instruction format of the jump instruction of the data processor 100 of the present invention. Here, only the instruction to be subjected to the preceding jump-related processing described below is given.
“*” Appearing in FIG. 31 to FIG. 47 indicates that any portion can be entered.

【0089】図31は短縮形(Dフォーマット)の無条件
分岐命令(BRA命令)の命令フォーマットを示す模式図で
ある。 BRA命令は分岐先アドレスがPC相対で指定される
ジャンプ命令である。図中、pcdispは分岐変位であり、
8ビットの即値で指定される。分岐変位は符号付き数と
して扱われる。Dフォーマットの命令では、分岐変位は
2倍して用いられる。
FIG. 31 is a schematic diagram showing an instruction format of a short form (D format) unconditional branch instruction (BRA instruction). The BRA instruction is a jump instruction whose branch destination address is specified relative to the PC. In the figure, pcdisp is a branch displacement,
It is specified by an 8-bit immediate value. Branch displacements are treated as signed numbers. In the D format instruction, the branch displacement is used twice.

【0090】図32は、一般形(Gフォーマット)の無条
件分岐命令(BRA命令)の命令フォーマットを示す模式図
である。図中、pcdispは分岐変位であり、8,16または
32ビットの即値で指定され、符号付き数として扱われ
る。分岐変位サイズはsxで指定される。sxのビット割り
付けを以下に示す。
FIG. 32 is a schematic diagram showing an instruction format of a general type (G format) unconditional branch instruction (BRA instruction). In the figure, pcdisp is a branch displacement, which is 8, 16 or
It is specified as a 32-bit immediate value and is treated as a signed number. The branch displacement size is specified by sx. The bit assignment of sx is shown below.

【0091】sx = 00 : 8 ビット sx = 01 : 16 ビット sx = 10 : 32 ビットSx = 00: 8 bits sx = 01: 16 bits sx = 10: 32 bits

【0092】本発明のデータ処理装置100 では奇数バイ
ト長の命令は禁止されているので、8ビットの変位が指
定された場合にもフィールドとしては16ビットで指定さ
れる。但しこの場合、16ビットのフィールドの下位8ビ
ットのみが有効となり、上位8ビットはどのような値で
あっても無視される。
In the data processing apparatus 100 of the present invention, since an instruction having an odd-byte length is prohibited, a field is specified by 16 bits even when an 8-bit displacement is specified. However, in this case, only the lower 8 bits of the 16-bit field are valid, and the upper 8 bits are ignored whatever the value.

【0093】図33は短縮形(Dフォーマット)の条件分
岐命令(Bcc命令)の命令フォーマットを、図34は一般形
(Gフォーマット)の条件分岐命令(Bcc命令)の命令フ
ォーマットをそれぞれ示す模式図である。命令フォーマ
ットとしては BRA命令と同一である。図中のccccフィー
ルドで分岐条件の指定が行われる。指定された条件が成
立した場合のみ分岐処理が行われ、条件が不成立の場合
には次の命令が実行される。
FIG. 33 is a schematic diagram showing an instruction format of a shortened (D format) conditional branch instruction (Bcc instruction), and FIG. 34 is a schematic diagram showing an instruction format of a general type (G format) conditional branch instruction (Bcc instruction). It is. The instruction format is the same as the BRA instruction. The branch condition is specified in the cccc field in the figure. Branch processing is performed only when the specified condition is satisfied, and when the condition is not satisfied, the next instruction is executed.

【0094】図35は短縮形(Dフォーマット)のサブル
ーチン分岐命令(BSR命令)の命令フォーマットを、図36
は一般形(Gフォーマット)のサブルーチン分岐命令(B
SR命令)の命令フォーマットをそれぞれ示す模式図であ
る。命令フォーマットとしては BRA命令と同一である。
分岐処理が行われると共に、戻り先アドレスがスタック
トップにプッシュされる。
FIG. 35 shows an instruction format of a subroutine branch instruction (BSR instruction) in a compact form (D format).
Is a general form (G format) subroutine branch instruction (B
FIG. 3 is a schematic diagram showing an instruction format of an SR instruction). The instruction format is the same as the BRA instruction.
While the branch processing is performed, the return address is pushed to the stack top.

【0095】図37はジャンプ命令(JMP命令)のフォーマ
ットを、図38はサブルーチンジャンプ命令(JSR命令)の
フォーマットをそれぞれ示す模式図である。共に上述し
た一般形1オペランド命令(G1フォーマット)の命令
である。図中のpcadr は分岐先アドレスを示し、前述の
一般形アドレッシングモードで指定される。アドレッシ
ングモードの指定に従って計算されたオペランドのアド
レスにジャンプする。アドレッシングモードとして多段
間接モードを指定することも可能である。 JSR命令で
は、戻り先アドレスがスタックトップにプッシュされ
る。
FIG. 37 is a schematic diagram showing the format of a jump instruction (JMP instruction), and FIG. 38 is a schematic diagram showing the format of a subroutine jump instruction (JSR instruction). Both of them are instructions of the general type 1 operand instruction (G1 format) described above. In the figure, pcadr indicates a branch destination address, and is specified in the general addressing mode described above. Jump to the operand address calculated according to the addressing mode specification. It is also possible to specify a multi-stage indirect mode as the addressing mode. In the JSR instruction, the return address is pushed to the top of the stack.

【0096】図39乃至図42は、加算, 比較及び条件分岐
を行う ACB命令の命令フォーマットを示す模式図であ
る。この命令は、xreg値にstep値を加算しxregに書き戻
し、加算結果がlimit より小さければPC値にpcdispで指
定される分岐変位を加算したアドレスに分岐する命令で
あり、ループ制御のプリミティブとして使用される。分
岐変位はszにより指定される。szのビット割り付けを以
下に示す。
FIGS. 39 to 42 are schematic diagrams showing the instruction format of the ACB instruction for performing addition, comparison, and conditional branching. This instruction adds the step value to the xreg value, writes it back to xreg, and branches to the address obtained by adding the branch displacement specified by pcdisp to the PC value if the addition result is smaller than the limit. used. The branch displacement is specified by sz. The bit assignment of sz is shown below.

【0097】sz = ”00” : 8 ビット sz = ”01” : 16 ビット sz = ”10” : 32 ビットSz = "00": 8 bits sz = "01": 16 bits sz = "10": 32 bits

【0098】変位サイズが16ビットあるいは32ビットで
あった場合には、16ビットあるいは32ビットの拡張部が
付加される。変位サイズが8ビットであった場合には、
変位はpcdispのフィールドで指定され、拡張部は付加さ
れない。分岐変位は符号付き数として扱われる。
If the displacement size is 16 bits or 32 bits, a 16-bit or 32-bit extension is added. If the displacement size is 8 bits,
The displacement is specified in the pcdisp field and no extension is added. Branch displacements are treated as signed numbers.

【0099】ACB命令には4つの命令フォーマットがあ
る。全てのフォーマットについてxregはレジスタで指定
される。図39は、stepが”1”に固定され、limit 値が
6ビットのリテラル(オペレーションコード中にエンコ
ードされた小さな即値)で指定される短縮形のフォーマ
ット(Qフォーマット)を示す模式図である。図40は、
stepが”1”に固定され、limit 値がレジスタで指定さ
れる短縮形のフォーマット(Rフォーマット)を示す模
式図である。
The ACB instruction has four instruction formats. Xreg is specified in registers for all formats. FIG. 39 is a schematic diagram showing a shortened format (Q format) in which the step is fixed to “1” and the limit value is specified by a 6-bit literal (small immediate value encoded in the operation code). FIG.
FIG. 9 is a schematic diagram showing a short format (R format) in which step is fixed to “1” and a limit value is specified by a register.

【0100】図41は前述のGフォーマットの命令フォー
マットを示す模式図である。step及びlimit は一般形の
アドレッシングモードで指定される。図42は前述のEフ
ォーマットの命令フォーマットを示す模式図である。st
ep値が8ビットのリテラル値で、limit 値が一般形のア
ドレッシングモードでそれぞれ指定される。
FIG. 41 is a schematic diagram showing an instruction format of the G format described above. step and limit are specified in the general form of addressing mode. FIG. 42 is a schematic diagram showing the instruction format of the E format described above. st
The ep value is an 8-bit literal value, and the limit value is specified in the general addressing mode.

【0101】図43乃至図46は、減算, 比較及び条件分岐
を行う SCB命令の命令フォーマットを示す模式図であ
る。この SCB命令は、xreg値からstep値を減算しxregに
書き戻し、減算結果がlimit 以上であればPC値にpcdisp
で指定される分岐変位を加算したアドレスに分岐する命
令である。 ACB命令と同様にループ制御のプリミティブ
として使用される。
FIGS. 43 to 46 are schematic diagrams showing the instruction format of the SCB instruction for performing subtraction, comparison and conditional branching. This SCB instruction subtracts the step value from the xreg value and writes it back to xreg.
This is an instruction for branching to an address obtained by adding the branch displacement specified by. Like the ACB instruction, it is used as a primitive for loop control.

【0102】SCB命令には ACB命令と同様に4つのフォ
ーマットがある。図43はQフォーマットの命令フォーマ
ットを、図44はRフォーマットの命令フォーマットを、
図45はGフォーマットの命令フォーマットを、図46はE
フォーマットの命令フォーマットをそれぞれ示す模式図
である。
The SCB instruction has four formats as in the ACB instruction. FIG. 43 shows the instruction format of the Q format, FIG. 44 shows the instruction format of the R format,
FIG. 45 shows the instruction format of the G format, and FIG.
It is a schematic diagram which shows the instruction format of each format.

【0103】図47は浮動小数点数の演算結果による条件
分岐を行うFBcc命令の命令フォーマットを示す模式図で
ある。分岐条件はccccc で指定される。条件が成立した
場合、PC値にpcdispで示される分岐変位を加算したアド
レスに分岐する。分岐変位サイズはsyで指定される。分
岐変位は符号付き数として扱われる。sxは他の命令の命
令フォーマットとの関連でフィールドはあるが、FBcc命
令では特に意味は持たない。分岐変位の指定方法はGフ
ォーマットの BRA命令と同様である。
FIG. 47 is a schematic diagram showing an instruction format of an FBcc instruction for performing a conditional branch based on a result of operation of a floating-point number. Branch conditions are specified by ccccc. If the condition is satisfied, branch to the address obtained by adding the branch displacement indicated by pcdisp to the PC value. The branch displacement size is specified by sy. Branch displacements are treated as signed numbers. Although sx has a field in relation to the instruction format of another instruction, it has no special meaning in the FBcc instruction. The method of specifying the branch displacement is the same as that of the G format BRA instruction.

【0104】sy = ”00” : 8 ビット sy = ”01” : 16 ビット sy = ”10” : 32 ビットSy = ”00”: 8 bits sy = ”01”: 16 bits sy = ”10”: 32 bits

【0105】本発明のデータ処理装置100 では命令は16
ビット単位となっており、奇数アドレスへのジャンプは
禁止されている。従って、奇数アドレスへのジャンプが
行われた場合には奇数アドレスジャンプトラップ(OAJT)
が起動され、例外処理が行われる。
In the data processing device 100 of the present invention, 16 instructions are used.
It is a bit unit, and jumps to odd addresses are prohibited. Therefore, when a jump to an odd address is performed, the odd address jump trap (OAJT)
Is started and exception processing is performed.

【0106】(3) 「デバッグサポート機能」 本発明のデータ処理装置100 は、プログラムのデバッグ
をサポートする種々の機構を備えている。また、専用の
インサーキット・エミュレータを使用して、デバッグを
行う機能も備えている。デバッグサポート機能は、1つ
のデバッグ制御レジスタ(DBCレジスタ), 2つのPCブレイ
クポイント(XBP0, XBP1), 2つのオペランドブレイク
ポイント(OBP0, OBP1) により構成される。これらの
機能でデバッグ事象が検出されると、セルフデバッグト
ラップ(SDBT)または DBGデバッグトラップ(DDBT:インサ
ーキットエミュレータ用デバッグトラップ)が起動さ
れ、例外処理の1つとして処理される。なお、インサー
キット・エミュレータ用としていくつかの命令と専用ピ
ンとを用いていくつかの機能がインプリメントされてい
るが、ここでは説明を省略する。
(3) “Debug Support Function” The data processing device 100 of the present invention has various mechanisms for supporting program debugging. It also has the ability to debug using a dedicated in-circuit emulator. The debug support function includes one debug control register (DBC register), two PC breakpoints (XBP0, XBP1), and two operand breakpoints (OBP0, OBP1). When a debug event is detected by these functions, a self-debug trap (SDBT) or a DBG debug trap (DDBT: debug trap for an in-circuit emulator) is activated and processed as one of the exception processing. Although some functions are implemented using some instructions and dedicated pins for the in-circuit emulator, their description is omitted here.

【0107】本発明のデータ処理装置100 は、ノーマル
モード, DBGモード, DBGACKモードの3つのモードを備
えている。リセット時の DBGINT#ピン(外部ピン)が”
H”レベルであれば本発明のデータ処理装置100 はノー
マルモードとして立ち上がる。ノーマルモードではイン
サーキットエミュレータサポート機能は働かない。リセ
ット時の DBGINT#ピンが”L”レベルであれば本発明の
データ処理装置100 はDBGモードとして立ち上がる。ノ
ーマルモードではインサーキットエミュレータサポート
機能が動作する。 DBGモードでインサーキットエミュレ
ータサポート用の例外処理あるいは割り込み処理が起動
されるとDBGACKモードになる。
The data processing device 100 of the present invention has three modes: a normal mode, a DBG mode, and a DBGACK mode. DBGINT # pin (external pin) at reset
If the level is "H", the data processing apparatus 100 of the present invention starts up in the normal mode.In the normal mode, the in-circuit emulator support function does not work.If the DBGINT # pin at the time of resetting is "L" level, the data processing of the present invention The apparatus 100 starts up in the DBG mode, in which the in-circuit emulator support function operates in the normal mode, and when the exception processing or the interrupt processing for the in-circuit emulator support is activated in the DBG mode, the apparatus enters the DBGACK mode.

【0108】本発明のデータ処理装置のデバッグ機能に
は以下が用意されている。 ・トレースモードで実行される(3種類)。 ・実行命令ブレイクポイントの命令実行をチェックす
る。 ・オペランドブレイクポイントからのオペランドの読み
出しをチェックする。 ・オペランドブレイクポイントに対するオペランドの書
き込みをチェックする。
The following are prepared for the debugging function of the data processing device of the present invention. -Executed in trace mode (3 types). Check the instruction execution at the execution instruction breakpoint. Check the reading of the operand from the operand breakpoint. Check that the operand has been written to the operand breakpoint.

【0109】図64の模式図に、プロセッサ・ステータス
・ワード(PSW : Processor StatusWord) 及びデバッグ
関連の制御レジスタの構成を示す。
FIG. 64 is a schematic diagram showing the configuration of a processor status word (PSW: Processor Status Word) and debug related control registers.

【0110】図64において、”−”及び”=”は、未定
義のフィールドであり、”0”を書き込む必要がある。
但し、”=”で示されたフィールドには、”1”を書き
込もうとしても無視される。これらのレジスタは制御空
間操作命令で操作可能である。図64(a) はPSW を示して
いる。また、図64(b) に示されている DBCレジスタはデ
バッグ環境を制御するためのレジスタであり、各種のデ
バッグモードを設定するためのフィールドと、デバッグ
事象の検出状態を示すフィールドとにて構成されてい
る。図64(c) 〜図64(f) に示されている XBP0, XBP
1, OBP0, OBP1の各レジスタは命令実行及びオペラ
ンドアクセスに関するブレイクポイントのアドレスを設
定するために使用される。物理的には、PSW 及び DBCレ
ジスタは整数演算部117 に、 XBP0レジスタ, XBP1レ
ジスタはPC処理部116 に、 OBP0レジスタ, OBP1レジ
スタはオペランドアクセス部120 にそれぞれ配置されて
いる。以下に、 PSW及び DBCレジスタのSDBT, DDBTに関
連するフィールドの説明を行う。
In FIG. 64, "-" and "=" are undefined fields, and "0" must be written.
However, writing "1" in the field indicated by "=" is ignored. These registers can be operated by control space operation instructions. FIG. 64 (a) shows the PSW. The DBC register shown in FIG. 64 (b) is a register for controlling the debug environment, and includes a field for setting various debug modes and a field for indicating a detection state of a debug event. Have been. XBP0 and XBP shown in FIGS. 64 (c) to 64 (f)
1, OBP0 and OBP1 registers are used to set breakpoint addresses for instruction execution and operand access. Physically, the PSW and DBC registers are arranged in the integer operation unit 117, the XBP0 and XBP1 registers are arranged in the PC processing unit 116, and the OBP0 and OBP1 registers are arranged in the operand access unit 120. The fields related to the SDBT and DDBT of the PSW and DBC registers are described below.

【0111】PSW DB:デバッグモード(セルフデバッグ) 0:デバッグ中でない 1:デバッグ中であるPSW DB: Debug mode (self-debug) 0: Not under debug 1: Under debug

【0112】DBCレジスタ D: DBCレジスタ有効ビット 0: DBGモードで DBCレジスタを使用中でない。 1: DBGモードで DBCレジスタを使用中である。 B:デバッグトラップ起動抑止ビット 0: DBGモードでSDBT, DDBTを起動する。 1: DBGモードでSDBT, DDBTの起動を抑止する。DBC register D: DBC register valid bit 0: The DBC register is not being used in the DBG mode. 1: The DBC register is being used in DBG mode. B: Debug trap activation suppression bit 0: Activates SDBT and DDBT in DBG mode. 1: Suppress the activation of SDBT and DDBT in DBG mode.

【0113】TR:トレース有効ビット 00:トレースモードでない。 01:トレースモードである。1命令ずつ逐次実行する。
トレースによるデバッグ事象は検出しない。 10:トレースモードである。1命令ずつ逐次実行する。
命令のシーケンスを乱す命令(分岐命令等)でのみトレ
ースによるデバッグ事象を検出する。 11:トレースモードである。命令の切れ目でデバッグ事
象を検出する。
TR: Trace valid bit 00: Not in trace mode. 01: Trace mode. Execute sequentially one instruction at a time.
It does not detect trace debugging events. 10: Trace mode. Execute sequentially one instruction at a time.
Detects trace-based debug events only for instructions that disturb the instruction sequence (such as branch instructions). 11: Trace mode. Detect debug events at instruction breaks.

【0114】TA:トレースステータスビット 00:トレースモードでデバッグ事象を検出していない。 01:未定義 10: TR = 10のトレースモードでデバッグ事象を検出し
た。 11: TR = 11のトレースモードでデバッグ事象を検出し
た。 E :命令実行ブレイク有効ビット 0: XBP0, XBP1をdisable 。 1: XBP0, XBP1をeable 。 XBP0または XBP1にセットされたアドレスの命令を実
行するとデバッグ事象が検出される。
TA: Trace status bit 00: No debug event was detected in trace mode. 01: Not defined 10: Debug event detected in trace mode with TR = 10. 11: A debug event was detected in trace mode with TR = 11. E: Instruction execution break valid bit 0: XBP0 and XBP1 are disabled. 1: XBP0 and XBP1 are eable. When the instruction at the address set in XBP0 or XBP1 is executed, a debug event is detected.

【0115】EA:命令実行ブレイクステータスビット 00: XBP0, XBP1でデバッグ事象を検出していない。 01: XBP1でデバッグ事象を検出した。 10: XBP0でデバッグ事象を検出した。 11: XBP0及び XBP1でデバッグ事象を検出した。 R :オペランドリードブレイク有効ビット 0:リードアクセスに対して OBP0, OBP1をdisable
。 1:リードアクセスに対して OBP0, OBP1をeable 。 OBP0または OBP1にセットされたアドレスに対してオ
ペランドの読み出しが行われるとデバッグ事象を検出す
る。
EA: Instruction execution break status bit 00: No debug event has been detected in XBP0 and XBP1. 01: A debug event was detected in XBP1. 10: Debug event detected in XBP0. 11: A debug event was detected on XBP0 and XBP1. R: Operand read break valid bit 0: OBP0 and OBP1 are disabled for read access
. 1: OBP0 and OBP1 are enabled for read access. When an operand is read from the address set in OBP0 or OBP1, a debug event is detected.

【0116】RA:オペランドリードブレイクステータス
ビット 00: OBP0, OBP1からの読み出しでデバッグ事象を検
出していない。 01: OBP1からの読み出しでデバッグ事象を検出した。 10: OBP0からの読み出しでデバッグ事象を検出した。 11: OBP0及び OBP1からの読み出しでデバッグ事象を
検出した。 W :オペランドライトブレイク有効ビット 0 :ライトアクセスに対して OBP0, OBP1をdisable
。 1 :ライトアクセスに対して OBP0, OBP1をeable 。 OBP0または OBP1にセットされたアドレスに対してオ
ペランドの書き込みが行われるとデバッグ事象を検出す
る。
RA: Operand read break status bit 00: No debug event was detected in reading from OBP0 and OBP1. 01: A debug event was detected during reading from OBP1. 10: A debug event was detected by reading from OBP0. 11: A debug event was detected in reading from OBP0 and OBP1. W: Operand write break valid bit 0: OBP0 and OBP1 are disabled for write access
. 1: OBP0 and OBP1 are enabled for write access. When an operand is written to the address set in OBP0 or OBP1, a debug event is detected.

【0117】WA:オペランドライトブレイクステータス
ビット 00: OBP0, OBP1への書き込みでデバッグ事象を検出
していない。 01: OBP1への書き込みでデバッグ事象を検出した。 10: OBP0への書き込みでデバッグ事象を検出した。 11: OBP0及び OBP1への書き込みでデバッグ事象を検
出した。
WA: Operand write break status bit 00: Debug event is not detected by writing to OBP0 and OBP1. 01: A debug event was detected during writing to OBP1. 10: Debug event detected by writing to OBP0. 11: A debug event was detected during writing to OBP0 and OBP1.

【0118】ノーマルモードでは、PSW.DB=1であれば D
BCレジスタは動作状態となり、デバッグ事象が検出され
ると、検出情報を DBCレジスタのTA, EA, RA, WAフィー
ルドに反映し、SDBTが起動される。PSW.DB=0であればデ
バッグ事象の検出は行われない。また、ノーマルモード
では、インサーキットエミュレータサポート機構は機能
せず、 DBCレジスタの上位3ビットは常に”0”であ
り、値を変えることはできない。
In the normal mode, if PSW.DB = 1, D
The BC register is activated, and when a debug event is detected, the detected information is reflected in the TA, EA, RA, and WA fields of the DBC register, and the SDBT is started. If PSW.DB = 0, no debug event is detected. In the normal mode, the in-circuit emulator support mechanism does not function, the upper 3 bits of the DBC register are always "0", and the value cannot be changed.

【0119】DBGモードでは、DBC.D=0, DBC.B=0且つ PS
W.DB=1 である場合には DBCレジスタは動作状態とな
り、デバッグ事象が検出されると検出情報は DBCレジス
タのTA, EA, RA, WAフィールドに反映され、SDBTが起動
する。 DBC.D=1で且つ DBC.B=0である場合には DBCレジ
スタは動作状態となり、デバッグ事象が検出されると検
出情報が DBCレジスタのTA, EA, RA, WAフィールドに反
映さ、DDBTが起動する。DBC.D=1 で且つ DBC.B=1である
場合には DBCレジスタは動作状態となり、デバッグ事象
の検出は行われるが、デバッグ事象を検出したことが外
部ピンをアサートすることによりデータ処理装置外部に
通知されるのみで、検出情報が DBCレジスタに反映され
ることはなく、DDBTも起動しない。
In the DBG mode, DBC.D = 0, DBC.B = 0 and PS
When W.DB = 1, the DBC register is in the operating state. When a debug event is detected, the detection information is reflected in the TA, EA, RA, and WA fields of the DBC register, and the SDBT starts. When DBC.D = 1 and DBC.B = 0, the DBC register is in operation, and when a debug event is detected, the detection information is reflected in the TA, EA, RA, and WA fields of the DBC register, and the DDBT Starts. When DBC.D = 1 and DBC.B = 1, the DBC register is in the operating state and the debug event is detected, but the detection of the debug event is performed by asserting the external pin. The detection information is only reflected to the outside, the detection information is not reflected in the DBC register, and the DDBT does not start.

【0120】上記以外の場合にはデバッグ事象の検出は
行われない。なお、DBGACKモードでは、SDBT, DDBTは一
切起動されない。
In other cases, no debug event is detected. In the DBGACK mode, SDBT and DDBT are not activated at all.

【0121】(4) 「本発明のデータ処理装置の機能ブロ
ックの構成」 図5は本発明のデータ処理装置100 の構成を示すブロッ
ク図である。
(4) “Configuration of Functional Block of Data Processing Device of the Present Invention” FIG. 5 is a block diagram showing the configuration of the data processing device 100 of the present invention.

【0122】本発明のデータ処理装置100 の内部を機能
的に大きく分けると、命令入力部110, 命令フェッチ部
111, 命令デコード部112, 第1マイクロROM 部113,
第2マイクロROM 部114, オペランドアドレス計算部11
5, PC処理部116, 整数演算部117, 浮動小数点演算部
118, アドレス入出力部119, オペランドアクセス部12
0, データ入出力部121 に分かれる。
The functions of the inside of the data processor 100 of the present invention can be roughly divided into an instruction input unit 110, an instruction fetch unit, and the like.
111, an instruction decoding unit 112, a first micro ROM unit 113,
2nd micro ROM unit 114, operand address calculation unit 11
5, PC processing unit 116, integer operation unit 117, floating point operation unit
118, address input / output unit 119, operand access unit 12
0, data input / output unit 121

【0123】各ブロックは、S1バス201, S2バス202,
DOバス203, IIバス204, DISPバス205, IXバス206,
AGバス207, JAバス208, AAバス209, DDバス210, EI
バス211, EAバス212, EDバス213, ADJSTバス214, IL
ENバス215, AOバス216 を介してアドレス及びデータの
転送を行っている。そして、アドレス入出力部119 をア
ドレスバス101 に結合し、データ入出力部121 をデータ
バス102 に結合し、命令入力部110 を命令バス103 に結
合することにより、図4に示されているシステム構成を
とることが出来る。
Each block includes an S1 bus 201, an S2 bus 202,
DO bus 203, II bus 204, DISP bus 205, IX bus 206,
AG bus 207, JA bus 208, AA bus 209, DD bus 210, EI
Bus 211, EA bus 212, ED bus 213, ADJST bus 214, IL
The address and data are transferred via the EN bus 215 and the AO bus 216. By connecting the address input / output unit 119 to the address bus 101, the data input / output unit 121 to the data bus 102, and the instruction input unit 110 to the instruction bus 103, the system shown in FIG. Configuration can be taken.

【0124】(4.1) 「命令入力部」 命令入力部110 は外部の命令バス103 から32ビット単位
で命令コードを本発明のデータ処理装置100 へ入力す
る。命令キャッシュ106 のアクセス方法には、1つのア
ドレスに対して32ビットの命令コードをアクセスする標
準アクセスモードと、1つのアドレスに対して4回連続
で32ビットの命令コードをアクセスするクワッドアクセ
スモードとがあり、どちらの場合も命令入力部110 は入
力した命令コードをEIバス211 を介して命令フェッチ部
111 へ出力する。
(4.1) “Instruction Input Unit” The instruction input unit 110 inputs an instruction code from the external instruction bus 103 to the data processing device 100 of the present invention in 32-bit units. The access method of the instruction cache 106 includes a standard access mode in which a 32-bit instruction code is accessed for one address, a quad access mode in which a 32-bit instruction code is accessed four times in a row for one address. In either case, the instruction input unit 110 sends the input instruction code to the instruction fetch unit via the EI bus 211.
Output to 111.

【0125】(4.2) 「命令フェッチ部」 図7は命令フェッチ部111 の構成を示すブロック図であ
る。命令フェッチ部111 には命令アドレスのアドレス変
換機構, 内蔵命令キャッシュ, 命令用TLB 及びその制御
部を含む命令用MMU/キャッシュ部81と命令キュー部82等
が備えられている。
(4.2) "Instruction Fetch Unit" FIG. 7 is a block diagram showing the configuration of the instruction fetch unit 111. The instruction fetch unit 111 includes an instruction address MMU / cache unit 81 including an instruction address conversion mechanism, a built-in instruction cache, an instruction TLB and its control unit, and an instruction queue unit 82.

【0126】命令用MMU/キャッシュ部81は命令アドレス
のアドレス変換及び命令のフェッチを行う。通常、次に
フェッチすべき命令のPC値がQINPCA86あるいはQINPCB87
からPFAバス91を介して命令用MMU/キャッシュ部81に送
られる。但し、ジャンプが発生してジャンプ先命令を直
ちにフェッチする場合には、オペランドアドレス計算部
115, PC処理部116 あるいは整数演算部117 から出力さ
れたジャンプ先アドレス値がJAバス208 を介してMMU/キ
ャッシュ部81に直接取り込まれる。命令用MMU/キャッシ
ュ部81ではこのPC値を物理アドレスに変換し、内蔵命令
キャッシュから命令コードをフェッチして命令コードを
ICOバス93を介して命令キューA83あるいは命令キュー
B84に送る。
The instruction MMU / cache unit 81 performs instruction address conversion and instruction fetch. Normally, the PC value of the instruction to be fetched next is QINPCA86 or QINPCB87
Via the PFA bus 91 to the instruction MMU / cache unit 81. However, when a jump occurs and the jump destination instruction is immediately fetched, the operand address calculation unit
The jump destination address value output from the PC processing unit 116 or the integer processing unit 117 is directly taken into the MMU / cache unit 81 via the JA bus 208. The instruction MMU / cache unit 81 converts this PC value to a physical address, fetches the instruction code from the internal instruction cache, and
It is sent to the instruction queue A83 or the instruction queue B84 via the ICO bus 93.

【0127】内蔵命令キャッシュがミスした場合にはア
ドレス入出力部119 へ物理アドレスが出力されて外部へ
の命令アクセスが要求され、命令入力部110 を通じて入
力された命令コードが内蔵命令キャッシュに登録される
と共に、命令キューA83あるいは命令キューB84にも送
られる。命令用TLB がミスした場合のページングによる
アドレス変換及び命令用TLB の更新も命令用MMU/キャッ
シュ部81の内部に備えられている制御回路により行われ
る。
If the internal instruction cache misses, the physical address is output to the address input / output unit 119 to request an external instruction access, and the instruction code input through the instruction input unit 110 is registered in the internal instruction cache. At the same time, it is also sent to the instruction queue A83 or the instruction queue B84. When the instruction TLB is missed, address conversion by paging and updating of the instruction TLB are also performed by a control circuit provided inside the instruction MMU / cache unit 81.

【0128】命令キュー部82は、命令のフェッチアドレ
ス管理と取り込まれた命令のバッファリングとを行う。
命令キュー部82は、条件分岐命令の分岐/非分岐の2方
向の命令をキューイング可能なように、2つの命令キュ
ーA83及び命令キューB84と、命令キュー取り込みアド
レスを保持する2 つのアドレスレジスタQINPCA86及びQI
NPCB87を備えている。また、2つ目の条件分岐命令の分
岐先アドレスを退避しておくためのラッチであるQINPCC
88をも備えている。
The instruction queue unit 82 manages the fetch address of the instruction and buffers the fetched instruction.
The instruction queue unit 82 includes two instruction queues A83 and B84 and two address registers QINPCA86 that hold instruction queue fetch addresses so that instructions in two directions of branching and non-branching of a conditional branch instruction can be queued. And QI
Equipped with NPCB87. QINPCC is a latch for saving the branch destination address of the second conditional branch instruction.
It also has 88.

【0129】なお、89は命令プリフェッチアドレスをイ
ンクリメントするためのカウンタであり、90はカウンタ
89の入力ラッチである。
Incidentally, 89 is a counter for incrementing the instruction prefetch address, and 90 is a counter for incrementing the instruction prefetch address.
89 input latches.

【0130】命令キューA83及び命令キューB84は共に
32バイトの容量を有し、入出力ポインタ部85により入出
力制御が行われる。命令キューの入力ポインタはワード
(4バイト)単位で管理されており、キャッシュヒット
時には ICOバス93から 128ビットの命令コードが、キャ
ッシュミス時にはEIバス211 から32ビットの命令が命令
キューA83または命令キューB84にそれぞれ取り込まれ
る。入力ポインタは命令キャッシュのヒット/ミスに応
じて更新される。出力ポインタはハーフワード(2バイ
ト)単位で管理されており、命令キューA83及びB84に
取り込まれた命令コードは、16ビット単位で整置されて
IIバス204 に出力され、命令デコード部112 及びPC処理
部116 へ転送される。出力ポインタは、命令デコード部
112 から送られて来る出力ポインタ更新情報に従って更
新される。
Both the instruction queue A83 and the instruction queue B84
It has a capacity of 32 bytes and is controlled by the input / output pointer unit 85. The input pointer of the instruction queue is managed in units of words (4 bytes). When a cache hit occurs, a 128-bit instruction code is transmitted from the ICO bus 93, and when a cache miss occurs, a 32-bit instruction is transmitted from the EI bus 211 to the instruction queue A83 or the instruction queue. B84 respectively. The input pointer is updated according to the hit / miss of the instruction cache. The output pointer is managed in units of half words (2 bytes), and the instruction codes taken into the instruction queues A83 and B84 are arranged in units of 16 bits.
It is output to the II bus 204 and transferred to the instruction decoding unit 112 and the PC processing unit 116. The output pointer is the instruction decode unit
It is updated according to the output pointer update information sent from 112.

【0131】また、命令キューA83及び命令キューB84
は、ジャンプ直後のように命令キューが空の場合に ICO
バス93またはEIバス211 から取り込まれたデータをバイ
パスしてIIバス204 に出力することも可能である。
The instruction queue A 83 and the instruction queue B 84
Returns ICO when the instruction queue is empty, such as immediately after a jump.
It is also possible to bypass the data taken in from the bus 93 or the EI bus 211 and output it to the II bus 204.

【0132】命令入出力ポインタ部85には、命令キュー
A83及び命令キューB84を管理するための2組の入出力
ポインタと、QINPCC88に対応してポインタ値を退避して
おくためのラッチも備えられている。ジャンプが発生し
た場合には、JAバス208 から取り込まれた値によりポイ
ンタの初期化が行われる。
The instruction input / output pointer section 85 is also provided with two sets of input / output pointers for managing the instruction queue A83 and the instruction queue B84, and a latch for saving the pointer value corresponding to the QINPCC88. ing. When a jump occurs, the pointer is initialized by the value fetched from the JA bus 208.

【0133】命令キュー部82は2本の命令キューA83及
び命令キューB84とQINPCC88とを用いて分岐命令を効率
よく処理する。また命令キュー部82は条件分岐命令処理
時には2方向の命令のフェッチを行うが、次に実行され
ると予測された側のシーケンスの命令を優先的に取り込
み、予測された側のシーケンスの命令キューがフルであ
れば他方のシーケンスの命令を取り込む。更に、命令キ
ュー部82は、2つの条件分岐命令をパイプライン処理可
能なように、2つ目の条件分岐命令の分岐先アドレスを
QINPCC88に退避しておき、2つの命令キューの一方が空
いたらQINPCC88に退避されているアドレスの命令を直ち
に取り込めるようになっている。
The instruction queue unit 82 processes a branch instruction efficiently using two instruction queues A83 and B84 and a QINPCC88. The instruction queue unit 82 fetches a two-way instruction at the time of processing a conditional branch instruction. However, the instruction queue unit 82 preferentially fetches the instruction of the sequence predicted to be executed next and the instruction queue of the predicted sequence. Is full, the other sequence of instructions is fetched. Further, the instruction queue unit 82 sets the branch destination address of the second conditional branch instruction so that the two conditional branch instructions can be pipelined.
The instruction is saved in the QINPCC 88, and if one of the two instruction queues becomes empty, the instruction at the address saved in the QINPCC 88 can be immediately taken in.

【0134】通常、命令キュー部82が連続的に命令フェ
ッチを行う場合には、QINPCA86またはQINPCB87の値が P
FAバス91に出力されて命令用MMU/キャッシュ部81に送ら
れると共に、ラッチ90を介してカウンタ89に取り込まれ
てインクリメントされ、QINPCA86またはQINPCB87に書き
戻される。ジャンプ先アドレスがJAバス208 を介して転
送されてきた場合には、JAバス208 上の値がQINPCA86,
QINPCB87あるいはQINPCC88のいずれかに取り込まれる。
いずれのレジスタに書き込まれるかは、命令フェッチ部
111 が受け付けた要求の種類と命令キュー部82の内部状
態とによって異なる。また、JAバス208 上のジャンプ先
アドレスの命令が次のサイクルにおいて取り込まれる場
合には、JAバス208 上のジャンプ先アドレスがラッチ90
を介してカウンタ89に直接取り込まれてインクリメント
され、QINPCA86あるいはQINPCB87に書き込まれる。
Normally, when the instruction queue unit 82 continuously fetches instructions, the value of QINPCA86 or QINPCB87 becomes P
The signal is output to the FA bus 91 and sent to the instruction MMU / cache unit 81, and is also taken in by the counter 89 via the latch 90, incremented, and written back to the QINPCA 86 or QINPCB 87. When the jump destination address is transferred via the JA bus 208, the value on the JA bus 208 is set to QINPCA86,
Imported into either QINPCB87 or QINPCC88.
Which register is written in the instruction fetch section
111 differs depending on the type of request accepted and the internal state of the instruction queue unit 82. When the instruction at the jump destination address on the JA bus 208 is fetched in the next cycle, the jump destination address on the JA bus 208 is latched.
, Are directly taken into the counter 89, incremented, and written to the QINPCA 86 or the QINPCB 87.

【0135】命令キュー部82において2つの条件分岐命
令を処理中で、QINPCA86, QINPCB87及びQINPCC88に有効
なアドレスが取り込まれており、且つ1つ目の条件分岐
命令の分岐予測が的中していた場合には、命令キューA
83または命令キューB84の一方が無効になり、無効にな
った側のQINPCA86またはQINPCB87にQINPCC88の値が書き
込まれる。また、QINPCC88に退避されているアドレスの
命令のフェッチを直ちに開始する場合には、QINPCC88の
値が PFAバス91に出力されて命令用MMU/キャッシュ部81
に送られると共に、ラッチ90を介してカウンタ89に取り
込まれてインクリメントされ、QINPCA86またはQINPCB87
に書き戻される。
The instruction queue unit 82 was processing two conditional branch instructions, a valid address was fetched into QINPCA86, QINPCB87 and QINPCC88, and the branch prediction of the first conditional branch instruction was correct. In the case, instruction queue A
83 or one of the instruction queues B84 becomes invalid, and the value of QINPCC88 is written to the invalidated QINPCA86 or QINPCB87. To immediately start fetching the instruction at the address saved in the QINPCC88, the value of the QINPCC88 is output to the PFA bus 91 and the instruction MMU / cache unit 81 is output.
And is taken into a counter 89 via a latch 90 and incremented, and the QINPCA86 or QINPCB87
Is written back to

【0136】また、本発明のデータ処理装置100 がバス
ウッチモードである場合には、アドレス入出力部119 を
通じて入力された物理アドレスがヒットする内蔵命令キ
ャッシュのエントリが無効化される。
When the data processor 100 of the present invention is in the bus-watch mode, the entry in the internal instruction cache in which the physical address input through the address input / output unit 119 hits is invalidated.

【0137】(4.3) 「命令デコード部」 命令デコード部112 では、IIバス204 から取り込まれた
命令コードを16ビット(ハーフワード)単位でデコード
する。この命令デコード部112 には、第1ハーフワード
に含まれるオペレーションコードをデコードする OPDEC
1, 第2及び第3ハーフワードに含まれるオペレーショ
ンコードをデコードする OPDEC2, アドレッシングモー
ドをデコードするアドレッシングモードデコーダ, 2命
令の並列デコードを行うために限られた2バイト命令の
みをデコードするSUBDEC1, SUBDEC2が備えられてい
る。
(4.3) "Instruction Decoding Unit" The instruction decoding unit 112 decodes the instruction code fetched from the II bus 204 in units of 16 bits (half words). The instruction decoding unit 112 includes an OPDEC for decoding an operation code included in the first halfword.
1, OPDEC2 for decoding the operation code included in the second and third halfwords, addressing mode decoder for decoding the addressing mode, SUBDEC1 and SUBDEC2 for decoding only two-byte instructions limited to parallel decoding of two instructions Is provided.

【0138】更に、 OPDEC1及びOPDEC 2の出力を更に
デコードして、マイクロROM のエントリアドレスを計算
する第2デコーダ, 条件分岐命令の分岐予測を行う分岐
予測部, オペランドアドレス計算に際してパイプライン
コンフリクトをチェックするアドレス計算コンフリクト
チェック機構も含まれる。分岐予測部では、過去1回の
分岐履歴により条件分岐命令の分岐予測が行われる。こ
の分岐予測情報が条件分岐命令デコード時に参照され
る。分岐履歴は条件分岐命令の直前に実行された命令ア
ドレスの一部をタグとして記憶しており、登録及び参照
を行うPC値はPC処理部116 から送られてくる。
Further, the outputs of OPDEC1 and OPDEC2 are further decoded, a second decoder for calculating the entry address of the micro ROM, a branch prediction unit for predicting the branch of a conditional branch instruction, and checking for a pipeline conflict when calculating the operand address. An address calculation conflict check mechanism is also included. The branch prediction unit performs a branch prediction of a conditional branch instruction based on a past one-time branch history. This branch prediction information is referred to when the conditional branch instruction is decoded. The branch history stores, as a tag, a part of the instruction address executed immediately before the conditional branch instruction, and a PC value for registration and reference is sent from the PC processing unit 116.

【0139】命令デコード部112 は命令フェッチ部111
から出力された命令コードを1クロックにつき0乃至8
バイトデコードする。デコード結果の内の整数演算部11
7 での演算に関する情報が第1マイクロROM 部113 に、
浮動小数点演算部118 での演算に関する情報が第2マイ
クロROM 部114 に、オペランドアドレス計算に関係する
情報がオペランドアドレス計算部115 に、PC計算に関係
する情報がPC処理部116 に、命令キューの出力ポインタ
更新情報が命令フェッチ部111 にそれぞれ出力される。
命令デコード部112 は、後ろ側の命令がメモリオペラン
ドを持たない2バイト命令である場合に限り2つの命令
を並列にデコードすることが可能であり、後ろ側の命令
に関するデコード結果(サブコードという)は第1マイ
クロROM部113 に送られる。また、命令デコード段階で
行われるジャンプ処理に関する情報が、命令フェッチ部
111, PC処理部116 あるいはオペランドアドレス計算部
115 へ出力される。
The instruction decoding unit 112 includes an instruction fetch unit 111
0 to 8 per clock
Byte decode. Integer operation part 11 of decoded result
The information on the operation in step 7 is stored in the first micro ROM unit 113,
Information relating to the operation in the floating point operation unit 118 is stored in the second micro ROM unit 114, information relating to the operand address calculation is transmitted to the operand address calculation unit 115, information relating to the PC calculation is transmitted to the PC processing unit 116, and the instruction queue is The output pointer update information is output to the instruction fetch unit 111, respectively.
The instruction decoding unit 112 can decode two instructions in parallel only when the latter instruction is a two-byte instruction having no memory operand, and decodes the latter instruction (called a subcode). Is sent to the first micro ROM unit 113. Also, information on jump processing performed in the instruction decoding stage is stored in an instruction fetch unit.
111, PC processing unit 116 or operand address calculation unit
Output to 115.

【0140】なお、分岐予測部は条件分岐命令の動的分
岐予測を行うが、分岐しないと静的に予測するように整
数演算部117 内の制御レジスタにより設定可能である。
Although the branch prediction unit performs dynamic branch prediction of a conditional branch instruction, it can be set by a control register in the integer operation unit 117 so as to statically predict that a branch will not take place.

【0141】(4.4) 「第1マイクロROM 部」 第1マイクロROM 部113 には、整数演算部117 の制御を
行う種々のマイクロプログラムルーチンが格納されてい
るマイクロROM, マイクロシーケンサ, マイクロ命令デ
コーダ, サブコードデコーダ等が備えられている。マイ
クロ命令はマイクロROM から1クロック当り1度読み出
される。マイクロシーケンサは命令実行に関するマイク
ロプログラム実行のためのシーケンス処理の他に、例
外, 割り込み及びトラップ(この3つをあわせて EITと
いう)の受付けと各 EITに対応するマイクロプログラム
のシーケンス処理も行う。
(4.4) First Micro ROM Unit The first micro ROM unit 113 stores various micro program routines for controlling the integer operation unit 117, a micro ROM, a micro sequencer, a micro instruction decoder, A subcode decoder and the like are provided. The microinstruction is read from the microROM once per clock. The micro-sequencer performs, in addition to the sequence processing for microprogram execution related to instruction execution, acceptance of exceptions, interrupts, and traps (collectively referred to as EITs) and sequence processing of microprograms corresponding to each EIT.

【0142】第1マイクロROM 部113 には命令コードに
依存しない外部割り込み及び整数演算実行結果によるマ
イクロプログラムの分岐条件も入力される。マイクロ命
令デコーダの出力は主に整数演算部117 へ出力される
が、ジャンプ命令の実行時及び例外受付時は一部の情報
を他の機能ブロックへも出力する。サブデコーダはサブ
コードのデコードを行う。サブコードが有効な場合は、
1命令の最終マイクロステップに同期してサブコードに
関する演算情報が有効になる。サブデコーダの出力は整
数演算部117 に対して出力される。
The first micro-ROM unit 113 is also supplied with an external interrupt independent of the instruction code and a branch condition of the microprogram based on the result of executing the integer operation. The output of the microinstruction decoder is mainly output to the integer operation unit 117. However, when the jump instruction is executed and an exception is accepted, some information is also output to other functional blocks. The sub-decoder decodes the sub-code. If the subcode is valid,
The operation information relating to the subcode becomes valid in synchronization with the last microstep of one instruction. The output of the sub-decoder is output to integer operation section 117.

【0143】(4.5) 「第2マイクロROM 部」 第2マイクロROM 部114 には浮動小数点演算部118 の制
御を行う種々のマイクロプログラムルーチンが格納され
ているマイクロROM, マイクロシーケンサ, マイクロ命
令デコーダ等が備えられている。マイクロ命令はマイク
ロROM から1クロック当り1度読み出される。マイクロ
シーケンサはマイクロプログラムで示されるシーケンス
処理の他に、浮動小数点演算にかかわる例外の処理も行
い、マスクされていない浮動小数点例外が検出された場
合には第1マイクロROM 部113 へ例外処理を要求する。
第2マイクロROM 部114 のマイクロシーケンサは第1マ
イクロROM 部113 のマイクロシーケンサと並列に動作
し、整数演算部117 と並列に浮動小数点演算部118 を制
御する。
(4.5) "Second Micro ROM Unit" The second micro ROM unit 114 stores various micro program routines for controlling the floating point arithmetic unit 118, a micro ROM, a micro sequencer, a micro instruction decoder, etc. Is provided. The microinstruction is read from the microROM once per clock. The micro-sequencer also performs exception processing related to floating-point operations in addition to the sequence processing indicated by the micro-program. When an unmasked floating-point exception is detected, the micro-sequencer requests the first micro-ROM unit 113 to perform exception processing. I do.
The micro-sequencer of the second micro-ROM unit 114 operates in parallel with the micro-sequencer of the first micro-ROM unit 113, and controls the floating-point operation unit 118 in parallel with the integer operation unit 117.

【0144】第2マイクロROM 部113 には浮動小数点演
算の実行結果によるフラグ情報も入力される。マイクロ
命令デコーダの出力は主に浮動小数点演算部118 へ出力
されるが、浮動小数点演算にかかわる例外の検出など一
部の情報は他の機能ブロックへも出力される。
The flag information based on the execution result of the floating-point operation is also input to the second micro-ROM unit 113. The output of the microinstruction decoder is mainly output to the floating point arithmetic unit 118, but some information such as detection of an exception related to the floating point arithmetic is also output to other functional blocks.

【0145】(4.6) 「オペランドアドレス計算部」 オペランドアドレス計算部115 は、命令デコード部112
のアドレッシングモードデコーダ等から出力されたオペ
ランドアドレス計算に関係する情報によりハードワイヤ
ードに制御される。このオペランドアドレス計算部115
ではメモリ間接アドレッシングのためのメモリアクセス
以外のオペランドのアドレス計算とジャンプ命令のジャ
ンプ先アドレスの計算が行われる。
(4.6) “Operand address calculation section” The operand address calculation section 115 includes the instruction decoding section 112.
Is hard-wired by information related to operand address calculation output from an addressing mode decoder or the like. This operand address calculator 115
In, the address calculation of the operands other than the memory access for the memory indirect addressing and the calculation of the jump destination address of the jump instruction are performed.

【0146】図3はオペランドアドレス計算部115 の詳
細な構成を示すブロック図である。図において、61はア
ドレス計算を行うためのアドレス加算器を、62, 63, 64
は入力ラッチを、65は出力ラッチ(AOラッチ)を、66は
プッシュモード時のプリデクリメント値などの補正値を
保持する ADJSTラッチを、67はアドレス計算のための変
位及び即値を保持するためのDISPラッチをそれぞれ示し
ている。なお、多段間接モードの1段のアドレス計算を
1サイクルで処理するために、アドレス加算器61は3値
加算器が使用されている。
FIG. 3 is a block diagram showing a detailed configuration of the operand address calculation unit 115. In the figure, 61 is an address adder for performing address calculation, and 62, 63, 64
Is an input latch, 65 is an output latch (AO latch), 66 is an ADJST latch that holds correction values such as pre-decrement values in push mode, and 67 is a button that holds displacement and immediate values for address calculation. Each shows a DISP latch. Note that a ternary adder is used as the address adder 61 in order to process one-stage address calculation in the multistage indirect mode in one cycle.

【0147】アドレス計算時に参照される汎用レジスタ
の値及びPC値は整数演算部117 及びPC処理部116 からIX
バス206 を介してラッチ64あるいはラッチ63に取り込ま
れる。ラッチ62には ADJSTラッチ66あるいはDISPラッチ
67に保持されているデータが32ビットに符号拡張されて
取り込まれる。多段間接モードで間接参照を行う場合に
は、フェッチアドレスがAOラッチ65及びAAバス209 を介
してオペランドアクセス部120 へ転送されてデータのフ
ェッチを行う。フェッチされたデータはAGバス207 を介
して入力ラッチ64に取り込まれる。多段間接モードで間
接参照が行われない場合には、前段のアドレス計算結果
がそのまま入力ラッチ64に取り込まれる。アドレス計算
結果はAOバス216 を介して整数演算部117 に送られる。
また、オペランドのプリフェッチが行われる場合には、
AOラッチ65及びAAバス209 を介してオペランドアドレス
がオペランドアクセス部120 へ転送される。
The value of the general-purpose register and the PC value referred to at the time of address calculation are calculated by the integer operation unit 117 and the PC processing unit 116 from the IX.
The data is taken into the latch 64 or 63 via the bus 206. ADJST latch 66 or DISP latch for latch 62
The data held in 67 is sign-extended to 32 bits and taken in. When performing indirect referencing in the multistage indirect mode, the fetch address is transferred to the operand access unit 120 via the AO latch 65 and the AA bus 209 to fetch data. The fetched data is taken into the input latch 64 via the AG bus 207. When the indirect reference is not performed in the multistage indirect mode, the address calculation result of the previous stage is taken into the input latch 64 as it is. The address calculation result is sent to the integer operation unit 117 via the AO bus 216.
Also, when operand prefetching is performed,
The operand address is transferred to the operand access unit 120 via the AO latch 65 and the AA bus 209.

【0148】オペランドが即値である場合には、DISPラ
ッチ67に取り込まれたデータがアドレス加算器61, AOラ
ッチ65及びAOバス216 を介して整数演算部117 に送られ
る。また、即値が倍精度浮動小数点数(64ビット)であ
る場合には、上位32ビットと下位32ビットとの2つの部
分に分割され、2回に分けてDISPラッチ67に取り込まれ
る。この場合、第1サイクルにおいて上位32ビットがAO
ラッチ65に退避され、第2サイクルにおいて上位32ビッ
トがAGバス207 を介して整数演算部117 へ転送されると
共に下位32ビットがAOバス216 を介して整数演算部117
に送られる。
If the operand is an immediate value, the data fetched by the DISP latch 67 is sent to the integer operation unit 117 via the address adder 61, AO latch 65 and AO bus 216. If the immediate value is a double-precision floating point number (64 bits), it is divided into two parts, upper 32 bits and lower 32 bits, and is taken into the DISP latch 67 twice. In this case, the upper 32 bits are AO in the first cycle.
In the second cycle, the upper 32 bits are transferred to the integer operation unit 117 via the AG bus 207 and the lower 32 bits are transferred to the integer operation unit 117 via the AO bus 216 in the second cycle.
Sent to

【0149】オペランドアドレス計算が終了した段階で
ジャンプが行われる場合には、ジャンプ先アドレスの計
算結果がAOラッチ65及びJAバス208 を介して命令フェッ
チ部111 とPC処理部116 とへ出力される。
When the jump is performed at the stage when the operand address calculation is completed, the calculation result of the jump destination address is output to the instruction fetch unit 111 and the PC processing unit 116 via the AO latch 65 and the JA bus 208. .

【0150】(4.7) 「PC処理部」 図1及び図2はPC処理部116 の構成を示すブロック図で
ある。PC処理部116 は、大きく分けて、分岐先アドレス
計算部1, PC計算部2, ステップPC転送部3及びPCスタ
ック4に分かれる。
(4.7) "PC Processing Unit" FIGS. 1 and 2 are block diagrams showing the configuration of the PC processing unit 116. The PC processing unit 116 is roughly divided into a branch destination address calculation unit 1, a PC calculation unit 2, a step PC transfer unit 3, and a PC stack 4.

【0151】PC計算部2は命令デコード部112 から出力
されるPC計算に関係する情報でハードワイヤードに制御
され、命令のPC値を計算する。本発明のデータ処理装置
100の命令は可変長命令であり、命令をデコードした後
でなければ命令の長さが判明しない。PC計算部2は、命
令デコード部112 から出力される命令長をデコード中の
命令のPC値に加算することにより次に実行すべき命令の
PC値を計算する。
The PC calculation unit 2 is hard-wiredly controlled by the information related to the PC calculation output from the instruction decoding unit 112, and calculates the PC value of the instruction. Data processing device of the present invention
The 100 instructions are variable length instructions, and the length of the instruction cannot be determined unless the instruction is decoded. The PC calculation unit 2 adds the instruction length output from the instruction decoding unit 112 to the PC value of the instruction being decoded, thereby obtaining the next instruction to be executed.
Calculate PC value.

【0152】PC計算部2において、 DPC29はデコード中
の命令の先頭アドレスを保持する。また、 TPC27は1命
令の命令コードが複数の処理単位に分割されて処理され
る場合も含めて、デコード処理対象のコードの先頭アド
レスを保持する。即ち、IIバス204 から命令デコード部
112 に取り込まれるコードの先頭アドレスが保持され
る。
In the PC calculator 2, the DPC 29 holds the start address of the instruction being decoded. The TPC 27 holds the start address of the code to be decoded, including the case where the instruction code of one instruction is divided into a plurality of processing units and processed. That is, the instruction decoding unit
The start address of the code fetched into 112 is retained.

【0153】PC加算器23は、命令デコード部112 からIL
ENバス215 を介して取り込まれた命令長と TPC27の値と
を加算し、加算結果は TPC27及びATPC28に書き戻され
る。また、1命令のデコード終了時には加算結果は次の
命令の先頭アドレスを示すので、 DPC29にも書き戻され
る。ATPC28はアドレス計算時に次の命令のPC値として参
照される。ジャンプが発生した場合には、ジャンプ先ア
ドレスがJAバス208 から取り込まれ、 TPC27及び DPC29
が初期化される。但し、ATPC28はジャンプが発生しても
初期化されない。 DPC29の一部は命令デコード部112 に
も転送されて分岐予測に用いられる。
The PC adder 23 outputs the IL
The instruction length fetched via the EN bus 215 is added to the value of TPC27, and the addition result is written back to TPC27 and ATPC28. When the decoding of one instruction is completed, the addition result indicates the head address of the next instruction, so that the result is also written back to the DPC 29. ATPC 28 is referred to as the PC value of the next instruction when calculating the address. When a jump occurs, the jump destination address is fetched from the JA bus 208, and TPC27 and DPC29
Is initialized. However, the ATPC 28 is not initialized even if a jump occurs. Part of the DPC 29 is also transferred to the instruction decoding unit 112 and used for branch prediction.

【0154】分岐先アドレス計算部1は、命令デコード
段階で分岐先アドレスの計算を行うブロックである。命
令フェッチ部111 から命令デコード部112 に送られるII
バス204 上の命令コードから分岐変位位置のデータを切
り出して DPCと加算することにより、分岐先アドレス計
算部1は分岐先アドレスを計算する。本発明のデータ処
理装置100 では、 BRA命令, BSR命令, Bcc命令の全て
の命令に関して命令デコードと同時にジャンプ先アドレ
スが計算出来るように、第1〜第4加算器5,6,7,
8の4つの加算器を備えている。なお、9〜16は各加算
器5,6,7,8の入力ラッチであり、17〜20は出力ラ
ッチである。
The branch destination address calculation unit 1 is a block for calculating a branch destination address at the instruction decoding stage. II sent from instruction fetch unit 111 to instruction decode unit 112
By extracting data of the branch displacement position from the instruction code on the bus 204 and adding it to the DPC, the branch destination address calculation unit 1 calculates a branch destination address. In the data processing apparatus 100 of the present invention, the first to fourth adders 5, 6, 7,..., Are calculated so that the jump destination address can be calculated simultaneously with the instruction decoding for all of the BRA, BSR, and Bcc instructions.
8 are provided. 9 to 16 are input latches of the adders 5, 6, 7, and 8, and 17 to 20 are output latches.

【0155】分岐先アドレス計算部1は命令コードのデ
コード処理に同期して動作する。各命令デコードサイク
ルに同期して、 DPCの値がPIバス40を介して入力ラッチ
13〜16に取り込まれる。また、IIバス204 上のデータが
入力ラッチ9〜12に取り込まれる。図48の模式図に分岐
変位として各加算器に入力されるIIバス204 のビット位
置を示す。
The branch destination address calculator 1 operates in synchronization with the decoding process of the instruction code. The value of DPC is input latched via PI bus 40 in synchronization with each instruction decode cycle.
Incorporated in 13-16. The data on the II bus 204 is taken into the input latches 9-12. The schematic diagram of FIG. 48 shows the bit position of the II bus 204 input to each adder as a branch displacement.

【0156】入力ラッチ9は、IIバス204 のbit(8:15)
(ビット8からビット15の8ビット)を取り込んで2倍
(1ビット左シフト)した後、32ビットに符号拡張す
る。入力ラッチ10は、IIバス204 のbit(24:31)を取り込
んで32ビットに符号拡張する。入力ラッチ11は、IIバス
204 のbit(16:31)を取り込んで32ビットに符号拡張す
る。入力ラッチ12は、IIバス204 のbit(16:47)を取り込
む。第1〜第4加算器5〜8は各入力ラッチの内容を加
算し、出力ラッチ17〜20へ出力する。また、ラッチ21に
は入力ラッチ11に取り込まれて符号拡張されたデータが
そのまま保持される。ラッチ22には入力ラッチ12に取り
込まれたデータがそのまま保持される。
The input latch 9 is connected to the bit (8:15) of the II bus 204.
(8 bits from bit 8 to bit 15) are fetched, doubled (shifted left by 1 bit), and sign-extended to 32 bits. The input latch 10 takes in bits (24:31) of the II bus 204 and sign-extends them to 32 bits. Input latch 11 is connected to II bus
It takes 204 bits (16:31) and sign-extends to 32 bits. The input latch 12 receives bits (16:47) of the II bus 204. The first to fourth adders 5 to 8 add the contents of the input latches and output to the output latches 17 to 20. In addition, the latch 21 holds the data which is taken into the input latch 11 and sign-extended as it is. The latch 22 holds the data taken into the input latch 12 as it is.

【0157】分岐命令デコードサイクル中に第1〜第4
加算器5〜8で分岐先アドレスが計算できない場合に
は、次のサイクルにおいて入力ラッチ12は、命令デコー
ド部112 からDISPバス205 を介して分岐変位を取り込
む。入力ラッチ16は、PIバス40を介して DPCの値を取り
込む。第4加算器8は各入力ラッチ12, 16の内容を加算
して出力ラッチ20に出力する。
During the branch instruction decode cycle, the first to fourth
If the adder 5 to 8 cannot calculate the branch destination address, the input latch 12 fetches the branch displacement from the instruction decode unit 112 via the DISP bus 205 in the next cycle. The input latch 16 captures the value of DPC via the PI bus 40. The fourth adder 8 adds the contents of the input latches 12 and 16 and outputs the result to the output latch 20.

【0158】命令デコード段階でジャンプ処理が行われ
る場合には、命令デコード部112 から入力された制御信
号により出力ラッチ17〜22の1つが選択され、その内容
がJAバス208 へ出力されることにより、ジャンプ先アド
レスが命令フェッチ部111 へ転送される。また、JAバス
208 上の値が TPC27及び DPC29に取り込まれる。
When jump processing is performed in the instruction decoding stage, one of the output latches 17 to 22 is selected by the control signal input from the instruction decoding unit 112, and the contents are output to the JA bus 208. , The jump destination address is transferred to the instruction fetch unit 111. Also, JA bus
208 The upper value is taken into TPC27 and DPC29.

【0159】PCスタック4は、サブルーチンへのジャン
プ命令の実行時にスタックにプッシュしたサブルーチン
からの戻り先PC値のコピーを保持するためのバッファで
ある。サブルーチンからのリターン命令に対してはPCス
タック4から戻り先PC値が読み出されてJAバス208 を介
して命令フェッチ部111 へ転送される。また、JAバス20
8 上の値が TPC27及び DPC29に取り込まれる。
The PC stack 4 is a buffer for holding a copy of the return PC value from the subroutine pushed on the stack when the jump instruction to the subroutine is executed. For the return instruction from the subroutine, the return PC value is read from the PC stack 4 and transferred to the instruction fetch unit 111 via the JA bus 208. Also, JA bus 20
8 The upper value is taken into TPC27 and DPC29.

【0160】ステップPC転送部3は、各パイプラインス
テージに対応してPC値を保持するための複数のラッチを
備えており、命令デコード段階で計算された DPC29の値
がパイプライン処理の進行と共に各命令のPC値として転
送されてゆく。 OLDPC36は実行ステージが直前に実行し
た命令のPC値を保持しており、命令デコード部112 に出
力している。この値を用いることにより、命令デコード
部112 内の分岐履歴テーブルの更新が行われる。
The step PC transfer section 3 has a plurality of latches for holding PC values corresponding to the respective pipeline stages, and the value of the DPC 29 calculated in the instruction decoding stage is stored as the pipeline processing progresses. It is transferred as the PC value of each instruction. The OLDPC 36 holds the PC value of the instruction executed immediately before by the execution stage, and outputs it to the instruction decoding unit 112. By using this value, the branch history table in the instruction decoding unit 112 is updated.

【0161】(4.8) 「整数演算部」 整数演算部117 は第1マイクロROM 部113 のマイクロRO
M に格納されたマイクロプログラムとサブコードとによ
り制御され、各整数演算命令の機能を実現するために必
要な演算を整数演算部117 の内部にあるレジスタファイ
ルと演算器とで実行する。レジスタファイルには汎用レ
ジスタや作業用レジスタが含まれる。この整数演算部11
7 には演算器としては、マイクロプログラムにより制御
される ALU, シフタ, プライオリティエンコーダ等にて
構成される主演算器と、サブコードの実行を行うための
ALU 及びシフタ等の副演算器とが備えられている。
(4.8) "Integer operation unit" The integer operation unit 117 is a micro RO of the first micro ROM unit 113.
The operation required to realize the function of each integer operation instruction is controlled by the microprogram and subcode stored in M, and the register file and the operation unit inside the integer operation unit 117 execute the operation. The register file includes general-purpose registers and work registers. This integer operation unit 11
Fig. 7 shows an arithmetic unit consisting of a main arithmetic unit consisting of ALU, shifter, priority encoder, etc. controlled by a microprogram, and a sub-code execution unit.
ALU and sub-operation units such as shifters are provided.

【0162】また、整数演算部117 は、主演算器と副演
算器とを用いて2命令を並列に実行することが可能なよ
うに構成されている。副演算器はマイクロプログラムで
も制御可能である。また、整数演算部117 には整数演算
の結果により変化するフラグ, 外部割り込みのマスクレ
ベルを定めるビット等を含むプロセッサ状態語(PSW)及
びバッファメモリ制御レジスタ等も備えられている。
The integer operation unit 117 is configured to execute two instructions in parallel using a main operation unit and a sub operation unit. The sub-operation unit can be controlled by a microprogram. The integer operation unit 117 is also provided with a flag that changes according to the result of the integer operation, a processor status word (PSW) including bits for determining a mask level of an external interrupt, a buffer memory control register, and the like.

【0163】命令の演算対象となるオペランドがアドレ
スまたは即値である場合は、オペランドアドレス計算部
115 からA0バス216 及びAGバス207 を介して即値あるい
は計算されたアドレスが入力される。また、命令の演算
対象となるオペランドがメモリ上のデータである場合
は、アドレス計算部115 で計算されたアドレスがオペラ
ンドアクセス部120 へ出力され、内蔵データキャッシュ
または外部からフェッチしたオペランドがDDバス210 を
介して整数演算部117 へ入力される。
If the operand to be operated on by the instruction is an address or an immediate value, the operand address calculation unit
Immediate values or calculated addresses are inputted from the address 115 via the A0 bus 216 and the AG bus 207. If the operand to be operated on by the instruction is data on a memory, the address calculated by the address calculation unit 115 is output to the operand access unit 120, and the operand fetched from the internal data cache or from the outside is stored on the DD bus 210. Is input to the integer operation unit 117 via

【0164】演算に際して内蔵データキャッシュ, 外部
のデータキャッシュ107, 108あるいは主メモリ109 をリ
ードする必要がある場合は、マイクロプログラムの指示
によりAAバス209 を介してオペランドアクセス部120 へ
アドレスが出力され、目的のデータがDDバス210 から取
り込まれる。一方、演算結果を内蔵データキャッシュ,
外部のデータキャッシュ107, 108あるいは主メモリ109
へストアする必要がある場合は、マイクロプログラムの
指示によりAAバス209 を介してアドレスが、DDバス210
を介してデータがそれぞれオペランドアクセス部120 へ
出力される。
When it is necessary to read the internal data cache, external data caches 107 and 108, or main memory 109 at the time of operation, an address is output to the operand access unit 120 via the AA bus 209 according to the instruction of the microprogram. The target data is fetched from the DD bus 210. On the other hand, the operation result is stored in the built-in data cache,
External data cache 107, 108 or main memory 109
If the address needs to be stored in the DD bus 210,
Are output to the operand access unit 120 via the.

【0165】外部割り込みまたは例外の処理等が行われ
て新たな命令アドレスを整数演算部117 が得た場合は、
新たなアドレスが命令フェッチ部111 とPC処理部116 と
へ出力される。
When a new instruction address is obtained by the integer operation unit 117 after processing of an external interrupt or exception is performed,
The new address is output to the instruction fetch unit 111 and the PC processing unit 116.

【0166】(4.9) 「浮動小数点演算部」 浮動小数点演算部118 は第2マイクロROM 部114 のマイ
クロROM に格納されたマイクロプログラムにより制御さ
れ、各浮動小数点演算命令の機能を実現するために必要
な演算を浮動小数点演算部118 の内部に備えられている
レジスタファイルと演算器で実行する。浮動小数点演算
部118 には浮動小数点演算の丸め処理方法及び浮動小数
点演算例外の検出許可をモードを設定する浮動小数点演
算モード制御レジスタ(FMC) と、浮動小数点演算結果に
対するフラグ, 浮動小数点例外の発生状態を示すステー
タスビットからなる浮動小数点演算状態語(FSW) とが備
えられている。
(4.9) Floating-point operation unit The floating-point operation unit 118 is controlled by a microprogram stored in the micro-ROM of the second micro-ROM unit 114, and is necessary for realizing the function of each floating-point operation instruction. Various operations are executed by a register file and an arithmetic unit provided inside the floating point arithmetic unit 118. A floating-point operation unit 118 includes a floating-point operation mode control register (FMC) for setting a rounding method for the floating-point operation and a mode for enabling detection of a floating-point operation exception, a flag for a floating-point operation result, and generation of a floating-point exception. And a floating-point operation status word (FSW) comprising status bits indicating the status.

【0167】命令の演算対象となるオペランドが即値の
場合またはメモリ上のデータである場合は、オペランド
の値がS1バス201 またはS2バス202 を介して整数演算部
117から浮動小数点演算部118 へ入力される。
When the operand to be operated on by the instruction is an immediate value or data on a memory, the operand value is changed to an integer operation unit via the S1 bus 201 or S2 bus 202.
The data is input to the floating point arithmetic unit 118 from 117.

【0168】ストア動作では浮動小数点演算部118 と整
数演算部117 とが協調して動作する。オペランドを内蔵
データキャッシュ, 外部のデータキャッシュ107, 108あ
るいは主メモリ109 へストアする必要がある場合は、浮
動小数点演算部118 はマイクロプログラムの指示により
DOバス203 を介して整数演算部117 にデータを出力す
る。整数演算部117 は、オペランドアクセス部120 に対
してAAバス209 を介してオペランドのアドレスを、DDバ
ス210 を介してオペランドデータをそれぞれ出力する。
In the store operation, the floating point operation unit 118 and the integer operation unit 117 operate in cooperation. If the operands need to be stored in the internal data cache, external data caches 107 and 108, or main memory 109, the floating-point arithmetic unit 118
The data is output to the integer operation unit 117 via the DO bus 203. The integer operation unit 117 outputs the address of the operand to the operand access unit 120 via the AA bus 209 and the operand data via the DD bus 210.

【0169】(4.10)「オペランドアクセス部」 オペランドアクセス部120 にはオペランドアドレスのア
ドレス変換機構, 内臓データキャッシュ, データ用TLB,
プリフェッチデータバッファ, ストアバッファ, オペ
ランドブレイクポイントレジスタ及びそれらの制御部が
備えられている。
(4.10) "Operand access unit" The operand access unit 120 has an address conversion mechanism for operand addresses, a built-in data cache, a data TLB,
A prefetch data buffer, a store buffer, an operand breakpoint register, and a control unit for them are provided.

【0170】データのロード動作ではオペランドアドレ
ス計算部115 または整数演算部117からAAバス209 に出
力されたロードすべきデータの論理アドレスが物理アド
レスに変換されることにより内蔵データキャッシュから
データがフェッチされ、整数演算部117 へ出力される。
In the data loading operation, the logical address of the data to be loaded, which is output from the operand address calculation unit 115 or the integer operation unit 117 to the AA bus 209, is converted into a physical address, so that the data is fetched from the internal data cache. Are output to the integer operation unit 117.

【0171】内蔵データキャッシュがミスした場合に
は、アドレス入出力部119 へ物理アドレスが出力されて
外部へのデータアクセスが要求され、データ入出力部12
1 を通じて入力されたデータが内蔵データキャッシュに
登録される。一方、データのストア動作においては、整
数演算部117 から出力されたストアすべきデータの論理
アドレスが物理アドレスに変換されることにより整数演
算部117 または浮動小数点演算部118 から出力されたデ
ータが内蔵データキャッシュにストアされると共に、ス
トアバッファを通じてアドレス入出力部119 へ物理アド
レスが出力され、データ入出力部121 を通じてデータが
外部へ出力される。ストア動作でミスが発生した場合に
はデータの更新は行わない。
When the built-in data cache misses, the physical address is output to the address input / output unit 119 to request external data access.
The data entered through 1 is registered in the internal data cache. On the other hand, in the data storing operation, the logical address of the data to be stored output from the integer operation unit 117 is converted into a physical address, so that the data output from the integer operation unit 117 or the floating-point operation unit 118 is stored. The data is stored in the data cache, the physical address is output to the address input / output unit 119 through the store buffer, and the data is output to the outside through the data input / output unit 121. If a mistake occurs in the store operation, the data is not updated.

【0172】ストアバッファではストアすべきデータと
そのアドレス、更にそのストア動作を行った命令のPC値
とが1組として管理される。ストアバッファでのストア
動作は先入れ先だし制御方式で管理される。
In the store buffer, data to be stored, its address, and the PC value of the instruction that performed the store operation are managed as one set. The store operation in the store buffer is managed by a first-in first-out control method.

【0173】データ用TLB がミスした場合のページング
によるアドレス変換及びデータ用TLB の更新もオペラン
ドアクセス部120 内部の制御回路により行われる。ま
た、メモリアクセスアドレスがメモリ空間にマッピング
されている I/O領域に入るか否かのチェックも行われ
る。
Address conversion by paging and updating of the data TLB when the data TLB is missed are also performed by the control circuit in the operand access unit 120. Also, it is checked whether the memory access address is in the I / O area mapped in the memory space.

【0174】また、データバッファを内蔵データキャッ
シュとして動作させる場合、本発明のデータ処理装置10
0 がバスウッチモードで動作している場合には、アドレ
ス入出力部119 を通じて入力された物理アドレスがヒッ
トする内蔵データキャッシュのエントリが無効化され
る。
When the data buffer is operated as a built-in data cache, the data processing device 10 of the present invention is used.
When 0 operates in the bus-watch mode, the entry of the internal data cache in which the physical address input through the address input / output unit 119 hits is invalidated.

【0175】(4.11)「アドレス入出力部」 アドレス入出力部119 は命令フェッチ部111 とオペラン
ドアクセス部120 とから出力されたアドレスを本発明の
データ処理装置100 の外部へ出力する。アドレスの出力
は本発明のデータ処理装置100 で定められたバスプロト
コルに従って行われる。バスプロトコルの制御はアドレ
ス入出力部119 内にある外部バス制御回路が行う。外部
バス制御回路ではページ不在例外, バスアクセス例外あ
るいは外部割り込みの受け付けも行う。
(4.11) "Address input / output unit" The address input / output unit 119 outputs addresses output from the instruction fetch unit 111 and the operand access unit 120 to the outside of the data processing device 100 of the present invention. The output of the address is performed according to a bus protocol defined by the data processing device 100 of the present invention. The bus protocol is controlled by an external bus control circuit in the address input / output unit 119. The external bus control circuit also accepts a page absent exception, a bus access exception or an external interrupt.

【0176】また、本発明のデータ処理装置100 以外の
外部デバイスがバスマスタになっており、且つ本発明の
データ処理装置100 がバスウッチモードであれば外部デ
バイスがデータライトサイクルを実行した場合にアドレ
スバス101 上に出力されたアドレスを取り込んで命令フ
ェッチ部111 とオペランドアクセス部120 とへ転送す
る。
If an external device other than the data processing device 100 of the present invention is a bus master, and the data processing device 100 of the present invention is in the bus-watch mode, the address becomes high when the external device executes a data write cycle. The address output on the bus 101 is fetched and transferred to the instruction fetch unit 111 and the operand access unit 120.

【0177】(4.12)「データ入出力部」 データ入出力部121 はオペランドのロード動作の際にデ
ータバス102 からデータを取り込んでオペランドアクセ
ス部120 へ転送し、またオペランドのストア動作の際に
オペランドアクセス部120 から出力されたオペランドを
データバス102へ出力する。データキャッシュ107, 108
のアクセス方法には、1つのアドレスに対して64ビット
のデータをアクセスする標準アクセスモードと1つのア
ドレスに対して4回連続で64ビットのデータをアクセス
するクワッドアクセスモードとがあり、いずれの場合も
データ入出力部121 はオペランドアクセス部120 と外部
のメモリとの間で送受されるデータの入出力を制御す
る。
(4.12) "Data input / output unit" The data input / output unit 121 fetches data from the data bus 102 at the time of an operand loading operation and transfers it to the operand access unit 120. The operand output from the access unit 120 is output to the data bus 102. Data cache 107, 108
There are two access methods: a standard access mode in which 64-bit data is accessed for one address, and a quad access mode in which 64-bit data is accessed four times consecutively for one address. The data input / output unit 121 controls input / output of data transmitted / received between the operand access unit 120 and an external memory.

【0178】(5) 「パイプライン処理」 本発明のデータ処理装置100 は各種のバッファ記憶と、
命令バス103 及びデータバス102 を使用したメモリの効
率的アクセスとにより、命令をパイプライン処理して高
性能に動作する。ここでは、本発明のデータ処理装置10
0 のパイプライン処理方法について説明する。
(5) "Pipeline processing" The data processing apparatus 100 of the present invention stores various buffers,
With efficient access of the memory using the instruction bus 103 and the data bus 102, instructions are pipelined to operate at high performance. Here, the data processing device 10 of the present invention
A pipeline processing method of 0 will be described.

【0179】(5.1) 「パイプライン処理機構」 本発明のデータ処理装置100 のパイプライン処理機構を
図6の模式図に示す。本発明のデータ処理装置100 のパ
イプライン処理機構は、命令のプリフェッチを行う命令
フェッチステージ(IFステージ)131, 命令のデコードを
行うデコードステージ(Dステージ)132, オペランドの
アドレス計算を行うオペランドアドレス計算ステージ
(Aステージ)133, マイクロROM アクセス(特にRステ
ージ137 という)とオペランドのプリフェッチ(特にOF
ステージ138 という)とを行うオペランドフェッチステ
ージ(Fステージ)134, 命令の実行を行う実行ステージ
(Eステージ)135, メモリオペランドのストアを行うス
トアステージ(Sステージ)136の6段構成でパイプライ
ン処理を行う。なお、Sステージ136 には3段のストア
バッファが備えられている。
(5.1) “Pipeline processing mechanism” The pipeline processing mechanism of the data processing apparatus 100 of the present invention is shown in the schematic diagram of FIG. The pipeline processing mechanism of the data processing apparatus 100 of the present invention includes an instruction fetch stage (IF stage) 131 for prefetching instructions, a decode stage (D stage) 132 for decoding instructions, and an operand address calculation for calculating operand addresses. Stage (A stage) 133, micro ROM access (especially R stage 137) and operand prefetch (especially OF
Stage 138), an instruction fetch stage (F stage) 134 for executing instructions, an execution stage (E stage) 135 for executing instructions, and a store stage (S stage) 136 for storing memory operands. I do. The S stage 136 is provided with a three-stage store buffer.

【0180】各ステージは他のステージとは独立に動作
し、理論上は6つのステージが完全に独立して動作す
る。Sステージ136 以外の各ステージは1回の処理を最
小1クロックで行うことが可能である。Sステージ136
は1回のオペランドストア処理を最小2クロックで行う
ことが可能である。但し、ストアバッファがフルになる
まではSステージは1クロック毎に1つのストア処理を
受け付けることが出来る。従って、理想的には1クロッ
クごとに次々とパイプライン処理が進行する。
Each stage operates independently of the other stages, and theoretically six stages operate completely independently. Each stage other than the S stage 136 can perform one process with a minimum of one clock. S stage 136
Can perform one operand store process with a minimum of two clocks. However, until the store buffer becomes full, the S stage can accept one store process per clock. Therefore, ideally, pipeline processing proceeds one after another for each clock.

【0181】本発明のデータ処理装置100 にはメモリ−
メモリ間演算あるいはメモリ間接アドレッシング等のよ
うに、1回の基本パイプライン処理だけでは処理が行え
ない命令があるが、これらの命令に対しても本発明のデ
ータ処理装置100 はなるべく均衡したパイプライン処理
が行えるように設計されている。複数のメモリオペラン
ドを有する命令に対しては、本発明のデータ処理装置10
0 はメモリオペランドの数に基づいてデコード段階で複
数のパイプライン処理単位(ステップコード)に分解し
てパイプライン処理を行う。
The data processing device 100 of the present invention has a memory
Although there are instructions that cannot be processed by only one basic pipeline processing, such as operations between memories or indirect memory addressing, the data processing apparatus 100 of the present invention also applies to these instructions as much as possible a balanced pipeline. It is designed to perform processing. For an instruction having a plurality of memory operands, the data processing device 10 of the present invention is used.
0 decomposes into a plurality of pipeline processing units (step codes) at the decoding stage based on the number of memory operands to perform pipeline processing.

【0182】IFステージ131 からDステージ132 に渡さ
れる情報は命令コードそのものである。Dステージ132
からAステージ133 に渡される情報は命令で指定された
演算に関する情報(Dコード141 と呼ぶ)と、オペラン
ドのアドレス計算に関係する情報(Aコード142 と呼
ぶ)と、処理中の命令のプログラムカウンタ値(PC)との
3つである。Aコード142 にはAステージ133 で行われ
る先行ジャンプ処理に関する情報も含まれている。
The information passed from the IF stage 131 to the D stage 132 is the instruction code itself. D stage 132
Are passed to the A stage 133 from the information relating to the operation specified by the instruction (referred to as D code 141), information relating to the address calculation of the operand (referred to as A code 142), and the program counter of the instruction being processed. Value (PC). The A code 142 also includes information on the preceding jump process performed in the A stage 133.

【0183】Aステージ133 からFステージ134 に渡さ
れる情報はマイクロプログラムルーチンのエントリ番
地, マイクロプログラムへのパラメータ等を含むRコー
ド143と、オペランドのアドレス, アクセス方法指示情
報等を含むFコード144 と、処理中の命令のプログラム
カウンタ値(PC)との3つである。Fステージ134 からE
ステージ135 に渡される情報は演算制御情報, リテラル
等を含むEコード145 と、オペランド, オペランドアド
レス等を含むSコード146 と、処理中の命令のプログラ
ムカウンタ値(PC)との3つである。Sコード146 はアド
レスとデータとにて構成されている。
The information passed from the A stage 133 to the F stage 134 includes an R code 143 containing the entry address of the microprogram routine, parameters to the microprogram, etc., and an F code 144 containing the address of the operand, access method instruction information, etc. , And the program counter value (PC) of the instruction being processed. F stage 134 to E
The information passed to the stage 135 is an E code 145 containing operation control information, literals, etc., an S code 146 containing operands, operand addresses, etc., and a program counter value (PC) of the instruction being processed. The S code 146 is composed of an address and data.

【0184】Eステージ135 からSステージ136 に渡さ
れる情報はストアすべき演算結果であるWコード147
と、その演算結果を出力した命令のプログラムカウンタ
値(PC)との2つである。Wコード147 はアドレスとデー
タとにて構成されている。
The information passed from the E stage 135 to the S stage 136 is a W code 147 which is an operation result to be stored.
And the program counter value (PC) of the instruction that outputs the operation result. The W code 147 is composed of an address and data.

【0185】Eステージ135 以前の各ステージで検出さ
れたEIT(例外, 割り込み, トラップ)はそのコードがE
ステージ135 に到達するまで EIT処理を起動しない。E
ステージ135 で処理されている命令のみが実行段階の命
令であり、IFステージ131 〜Fステージ134 で処理され
ている命令はまだ実行段階に至っていないからである。
従って、Eステージ135 以前で検出された EITは検出さ
れたことがステップコード中に記録されて次のステージ
に伝えられるのみである。Sステージ136 で検出された
EITはEステージ135 で処理中の命令が完了した時点で
受け付けられるか、またはその命令の処理がキャンセル
されて受け付けられ、Eステージ135 に戻って処理され
る。
The EIT (exception, interrupt, trap) detected in each stage before the E stage 135 has the code
Do not start EIT processing until stage 135 is reached. E
This is because only the instruction processed in the stage 135 is the instruction in the execution stage, and the instruction processed in the IF stage 131 to the F stage 134 has not yet reached the execution stage.
Therefore, EITs detected before the E stage 135 are only recorded in the step code and transmitted to the next stage. Detected in S stage 136
The EIT is accepted when the instruction being processed in the E stage 135 is completed, or the processing of the instruction is canceled and accepted, and the process returns to the E stage 135 for processing.

【0186】(5.2) 「各パイプラインステージの処理」 各パイプラインステージの入出力ステップコードには図
6に示されているように便宜上名前が付与されている。
またステップコードはオペレーションコードに関する処
理を行い、マイクロROM のエントリ番地あるいはEステ
ージ135 に対するパラメータなどになる系列と、Eステ
ージ135 の処理対象のオペランドになる系列との2系列
がある。また、Dステージ132 からSステージ136 まで
の間では処理中の命令のプログラムカウンタ値が受け渡
される。
(5.2) “Processing of Each Pipeline Stage” As shown in FIG. 6, names are assigned to input / output step codes of each pipeline stage for convenience.
The step code performs a process related to an operation code, and there are two sequences: a sequence serving as an entry address of the micro ROM or a parameter for the E stage 135, and a sequence serving as an operand to be processed in the E stage 135. Also, between the D stage 132 and the S stage 136, the program counter value of the instruction being processed is transferred.

【0187】(5.2.1) 「命令フェッチステージ」 命令フェッチステージ(IFステージ)131では命令フェッ
チ部111 が動作する。IFステージ131 では、内蔵命令キ
ャッシュまたは外部から命令をフェッチして命令キュー
に取り込み、Dステージ132 に対して0〜8バイト単位
で命令コードを出力する。命令キューへの入力は整置さ
れた4バイト単位で行われる。
(5.2.1) "Instruction Fetch Stage" In the instruction fetch stage (IF stage) 131, the instruction fetch unit 111 operates. The IF stage 131 fetches an instruction from a built-in instruction cache or an external device, takes it into an instruction queue, and outputs an instruction code to the D stage 132 in units of 0 to 8 bytes. Input to the instruction queue is performed in aligned 4-byte units.

【0188】標準アクセスモードで外部から命令をフェ
ッチする場合は整置された4バイトにつき最小2クロッ
クを要する。クワッドアクセスモードでは16バイトにつ
き最小5クロックを要する。内蔵命令キャッシュがヒッ
トした場合は整置された16バイトにつき1クロックでフ
ェッチ可能である。命令キューの出力単位は2バイトご
とに可変であり、1クロックの間に最大8バイトまで出
力できる。またジャンプの直後には命令キューをバイパ
スして2または4バイトの命令コードを直接命令デコー
ダへ転送することもできる。
When fetching an instruction from the outside in the standard access mode, at least two clocks are required for the aligned 4 bytes. In the quad access mode, a minimum of 5 clocks is required for 16 bytes. When the built-in instruction cache hits, it is possible to fetch the aligned 16 bytes in one clock. The output unit of the instruction queue is variable every two bytes, and can output up to eight bytes during one clock. Immediately after the jump, the instruction code of 2 or 4 bytes can be directly transferred to the instruction decoder, bypassing the instruction queue.

【0189】命令の論理アドレスの物理アドレスへの変
換, 内蔵命令キャッシュ及び命令用TLB の制御, プリフ
ェッチ先命令アドレスの管理, 命令キューの制御もIFス
テージ131 で行われる。
The IF stage 131 also converts instructions from logical addresses to physical addresses, controls the internal instruction cache and instruction TLB, manages prefetch destination instruction addresses, and controls instruction queues.

【0190】なお、IFステージ131 で検出される EITに
は、命令フェッチに関するアドレス変換例外, ページ不
在例外, バスアクセス例外がある。
Note that EITs detected in the IF stage 131 include an address translation exception, a page absent exception, and a bus access exception related to instruction fetch.

【0191】(5.2.2) 「命令デコードステージ」 命令デコードステージ(Dステージ)132はIFステージ13
1 から入力された命令コードをデコードする。命令コー
ドのデコードは命令デコード部112 の OPDEC1, OPDEC
2、アドレッシングモードデコーダ, SUBDEC1, SUBDEC
2を使用して、1クロックに1度行ない、1回のデコー
ド処理で、0〜8バイトの命令コードを消費する。 OPD
EC1または OPDEC2でデコードされた命令に引き続く命
令がSUBDEC1またはSUBDEC2でデコードされ、レジスタ
オペランドに関して干渉が発生しない場合には、1回の
デコード処理で2つの命令が処理される(OPDEC1または
OPDEC2でのデコード結果をメインコード、SUBDEC1ま
たはSUBDEC2でのデコード結果をサブコードという)。
(5.2.2) “Instruction Decode Stage” The instruction decode stage (D stage) 132 is an IF stage 13
Decode the instruction code input from 1. The instruction code is decoded by the OPDEC1 and OPDEC of the instruction decode unit 112.
2. Addressing mode decoder, SUBDEC1, SUBDEC
2 is performed once per clock, and a single decoding process consumes 0 to 8 bytes of instruction code. OPD
If the instruction following the instruction decoded by EC1 or OPDEC2 is decoded by SUBDEC1 or SUBDEC2 and no interference occurs with respect to the register operand, two instructions are processed in one decoding process (OPDEC1 or OPDEC2).
The decoding result in OPDEC2 is called a main code, and the decoding result in SUBDEC1 or SUBDEC2 is called a subcode).

【0192】なお、一部の命令では、1命令の第2デコ
ードサイクル以降で命令コードを消費せずにステップコ
ードの生成を行う場合がある。1回のデコードでAステ
ージ133 に対してアドレス計算情報であるAコード142
とオペレーションコードの中間デコード結果であるDコ
ード141 とが出力される。
For some instructions, a step code may be generated without consuming an instruction code after the second decode cycle of one instruction. In one decoding, A code 142 which is address calculation information is sent to A stage 133.
And a D code 141 which is an intermediate decoding result of the operation code.

【0193】Dステージ132 ではPC処理部116 の制御及
び命令キューからの命令コードの出力制御も行う。ま
た、Dステージ132 では無条件分岐命令及びサブルーチ
ンからのリターン命令等に対して先行ジャンプ処理を行
う。先行ジャンプを行った無条件分岐命令に対してはD
コード141 もAコード142 も出力せず、Dステージ132
で命令の処理を終了する。
The D stage 132 also controls the PC processor 116 and controls the output of instruction codes from the instruction queue. In the D stage 132, a preceding jump process is performed for an unconditional branch instruction, a return instruction from a subroutine, and the like. D for an unconditional branch instruction with a preceding jump
Neither code 141 nor A code 142 is output, and D stage 132
Ends the instruction processing.

【0194】但し、ジャンプ先アドレスが奇数である場
合、またはデバッグ事象検出モード(DBC.D=1あるいは P
SW.DB=1)である場合には、無条件分岐命令に対してDコ
ード141 及びAコード142 が出力される。なお、Dステ
ージ132 で検出される例外には、予約命令例外, 先行ジ
ャンプに関する奇数アドレスジャンプトラップがある。
However, when the jump destination address is an odd number, or in the debug event detection mode (DBC.D = 1 or P
If SW.DB = 1), the D code 141 and the A code 142 are output for the unconditional branch instruction. The exceptions detected in the D stage 132 include a reserved instruction exception and an odd address jump trap related to a preceding jump.

【0195】(5.2.3) 「オペランドアドレス計算ステー
ジ」 オペランドアドレス計算ステージ(Aステージ)133での
処理は大きく2つに分かれる。一方は命令デコード部11
2 の第2デコーダを使用してオペレーションコードの後
段デコードを行う処理で、他方はオペランドアドレス計
算部54でオペランドアドレスの計算を行う処理である。
(5.2.3) “Operand Address Calculation Stage” The processing in the operand address calculation stage (A stage) 133 is roughly divided into two. One is the instruction decoding unit 11
2 is a process of performing the second-stage decoding of the operation code using the second decoder, and the other is a process of calculating the operand address by the operand address calculation unit 54.

【0196】オペレーションコードの後段デコード処理
はDコード141 を入力とし、レジスタとメモリの書き込
み予約及びマイクロプログラムルーチンのエントリ番地
及びマイクロプログラムに対するパラメータ等を含むR
コード143 の出力を行う。なお、レジスタ及びメモリの
書き込み予約は、アドレス計算で参照したレジスタある
いはメモリの内容がパイプライン上を先行する命令で書
き換えられてしまって誤ったアドレス計算が行われるの
を防ぐためのものである。
In the latter decoding process of the operation code, the D code 141 is input, and R including the register and memory write reservation, the entry address of the microprogram routine, the parameter for the microprogram, etc.
Output code 143. Note that the write reservation of the register and the memory is performed to prevent erroneous address calculation from being performed by rewriting the contents of the register or the memory referred to in the address calculation by a preceding instruction on the pipeline.

【0197】オペランドアドレス計算処理はAコード14
2 を入力とし、Aコード142 に従ってオペランドアドレ
ス計算部54でオペランドのアドレス計算を行い、その計
算結果をFコード144 として出力する。この際、アドレ
ス計算に伴うレジスタの読み出し時に書き込み予約のチ
ェックが行われ、先行命令のレジスタまたはメモリへの
書き込み処理が終了していないために予約があることが
指示されれば、先行命令のEステージ135 での書き込み
処理が終了するまで待機状態になる。また、多段間接モ
ードでメモリ間接参照の指定が行われた場合のメモリア
クセス制御も行われる。
Operand address calculation processing is performed using A code 14.
The operand address is calculated by the operand address calculator 54 in accordance with the A code 142, and the calculation result is output as an F code 144. At this time, a write reservation check is performed at the time of reading of the register accompanying the address calculation, and if it is indicated that there is a reservation because the write processing of the preceding instruction to the register or the memory has not been completed, the E of the preceding instruction is indicated. It enters a standby state until the write processing in stage 135 is completed. In addition, memory access control is also performed when a memory indirect reference is specified in the multistage indirect mode.

【0198】Aステージ133 では、Dステージ132 で先
行ジャンプを行わなかったジャンプ命令に対して先行ジ
ャンプ処理を行う。レジスタ間接アドレッシングのジャ
ンプ等に対してはAステージ133 で先行ジャンプが行わ
れる。先行ジャンプを行った無条件ジャンプ命令に対し
てはRコード143 もFコード144 も出力されず、Aステ
ージ133 で命令の処理を終了する。但し、ジャンプ先ア
ドレスが奇数である場合、あるいはデバッグ事象検出モ
ード(DBC.D=1あるいは PSW.DB=1)である場合には無条件
ジャンプ命令に対してRコード143 及びFコード144 が
出力される。
In the A stage 133, the preceding jump processing is performed for the jump instruction for which the preceding jump was not performed in the D stage 132. For a jump of register indirect addressing or the like, a preceding jump is performed in the A stage 133. Neither the R code 143 nor the F code 144 is output for the unconditional jump instruction for which the preceding jump has been performed, and the A stage 133 terminates the processing of the instruction. However, if the jump destination address is an odd number or if the debug event detection mode (DBC.D = 1 or PSW.DB = 1), R code 143 and F code 144 are output for unconditional jump instructions. Is done.

【0199】Aステージ133 で検出される EITには、予
約命令例外, 特権命令例外, 先行ジャンプに関する奇数
アドレスジャンプトラップ, 間接参照に関するアドレス
変換例外, ページ不在例外, バスアクセス例外がある。
また、間接参照アドレスとオペランドブレイクポイント
の比較チェックもAステージ133 で行われる。
EITs detected in the A stage 133 include a reserved instruction exception, a privileged instruction exception, an odd address jump trap relating to a preceding jump, an address conversion exception relating to indirect reference, a page absent exception, and a bus access exception.
A comparison check between the indirect reference address and the operand breakpoint is also performed in the A stage 133.

【0200】(5.2.4) 「マイクロROM アクセスステー
ジ」 オペランドフェッチステージ(Fステージ)134での処理
も大きく2つに分かれる。第1はマイクロROM のアクセ
ス処理であり、特にRステージ137 という。第2はオペ
ランドプリフェッチ処理であり、特にOFステージ138 と
いう。Rステージ137 とOFステージ138 とは必ずしも同
時に動作するわけではなく、データキャッシュのミス,
ヒット、データ用TLB のミス, ヒットなどに依存して動
作タイミングが異なる。
(5.2.4) “Micro ROM Access Stage” The processing in the operand fetch stage (F stage) 134 is roughly divided into two. The first is the access processing of the micro ROM, which is particularly called R stage 137. The second is an operand prefetch process, particularly called an OF stage 138. The R stage 137 and the OF stage 138 do not always operate at the same time.
The operation timing differs depending on the hit, miss of the data TLB, hit, and the like.

【0201】Rステージ137 での処理であるマイクロRO
M アクセス処理はRコード143 に対して次のEステージ
135 での実行に使用される実行制御コードであるEコー
ド145 を作り出すためのマイクロROM アクセスとマイク
ロ命令デコード処理とである。
Micro RO as processing in R stage 137
M access processing is the next E stage for R code 143
Micro-ROM access and micro-instruction decode processing for creating an E-code 145 which is an execution control code used for execution at 135.

【0202】1つのRコードに対する処理が2つ以上の
マイクロプログラムステップに分解される場合、第1マ
イクロROM 部113 及び第2マイクロROM 部114 がEステ
ージ135 で使用され、次のRコード143 がマイクロROM
アクセス待機状態になる場合がある。Rコード143 に対
するマイクロROM アクセスが行われるのは、Eステージ
135 でのマイクロROM アクセスが行われない場合であ
る。本発明のデータ処理装置100 では多くの整数演算命
令が1マイクロプログラムステップで行われ、多くの浮
動小数点演算命令が2マイクロプログラムステップで行
われるため、実際にはRコード143 に対するマイクロRO
M アクセスが次々と行われる可能性が高い。
When the processing for one R code is divided into two or more microprogram steps, the first micro ROM unit 113 and the second micro ROM unit 114 are used in the E stage 135, and the next R code 143 is used. Micro ROM
It may be in the access waiting state. Micro ROM access to R code 143 is performed at E stage
This is the case when the micro ROM access in 135 is not performed. In the data processing apparatus 100 of the present invention, since many integer operation instructions are performed in one microprogram step and many floating point operation instructions are performed in two microprogram steps, the micro RO for the R code 143 is actually used.
M Access is likely to be made one after another.

【0203】2命令が並列にデコードされ且つサブコー
ドが有効な場合には、サブデコーダでのデコード結果が
有効になる。1つのRコードに対する処理が2つ以上の
マイクロプログラムステップに分解される場合、最終マ
イクロプログラムステップでサブコードに関するEコー
ド145 が有効になる。Rステージ137 では、実行PCに関
するブレークポイントのチェックが行われる。
When two instructions are decoded in parallel and the subcode is valid, the result of decoding by the subdecoder is valid. If the processing for one R code is broken down into two or more microprogram steps, the E code 145 for the subcode becomes valid in the last microprogram step. In the R stage 137, a breakpoint check on the execution PC is performed.

【0204】(5.2.5) 「オペランドフェッチステージ」 オペランドフェッチステージ(OFステージ)138はFステ
ージ134 が行う上記の2つの処理の内のオペランドプリ
フェッチ処理を行う。
(5.2.5) "Operand Fetch Stage" The operand fetch stage (OF stage) 138 performs an operand prefetch process of the above two processes performed by the F stage 134.

【0205】OFステージ138 では、Fコード144 の論理
アドレスをデータ用TLB で物理アドレスに変換して得ら
れた物理アドレスで内蔵データキャッシュまたは外部の
メモリをアクセスしてオペランドをフェッチし、そのオ
ペランドとFコード144 として転送されてきたその論理
アドレスとを組み合わせてSコード146 として出力す
る。
In the OF stage 138, the built-in data cache or an external memory is accessed with the physical address obtained by converting the logical address of the F code 144 into a physical address by the data TLB, and the operand is fetched. The logical address transferred as the F code 144 is combined with the logical address and output as the S code 146.

【0206】1つのFコード144 では8バイト境界をク
ロスしてもよいが、8バイト以下のオペランドフェッチ
を指定する。Fコード144 にはオペランドのアクセスを
行うか否かの指定も含まれており、Aステージ133 で計
算されたオペランドアドレス自体あるいは即値をEステ
ージ135 へ転送する場合にはオペランドプリフェッチは
行われず、Fコード144 の内容がSコード146 として転
送される。
One F code 144 may cross an 8-byte boundary, but specifies an operand fetch of 8 bytes or less. The F code 144 also includes designation of whether or not to access the operand. When the operand address itself or the immediate value calculated in the A stage 133 is transferred to the E stage 135, the operand prefetch is not performed. The contents of the code 144 are transferred as the S code 146.

【0207】OFステージ138 で検出される EITには、オ
ペランドプリフェッチに関するアドレス変換例外, ペー
ジ不在例外, バスアクセス例外がある。
EITs detected in the OF stage 138 include an address translation exception, a page absent exception, and a bus access exception related to operand prefetch.

【0208】(5.2.6) 「実行ステージ」 実行ステージ(Eステージ)135はEコード145 とSコー
ド146 とを入力として動作する。このEステージ135 が
命令を実行するステージであり、Fステージ134 以前の
各ステージで行われた処理は全てEステージ135 のため
の前処理である。Eステージ135 でジャンプが実行され
たり、 EIT処理が起動されたりした場合には、IFステー
ジ131 〜Fステージ134 までの処理は全て無効化され
る。Eステージ135 はマイクロプログラムにより制御さ
れ、Eコード145 に示されたマイクロプログラムルーチ
ンのエントリ番地からの一連のマイクロ命令を実行する
ことにより命令を実行する。
(5.2.6) “Execution Stage” The execution stage (E stage) 135 operates with the E code 145 and the S code 146 as inputs. The E stage 135 is a stage for executing an instruction, and all processes performed in each stage before the F stage 134 are pre-processes for the E stage 135. When a jump is executed in the E stage 135 or the EIT process is activated, all the processes from the IF stage 131 to the F stage 134 are invalidated. The E stage 135 is controlled by the microprogram and executes instructions by executing a series of microinstructions from the microprogram routine entry address indicated by E code 145.

【0209】Eコード145 には整数演算部117 を制御す
るコード(特にEIコードと呼ぶ)と浮動小数点演算部11
8 を制御するコード(特にEFコードと呼ぶ)とがある。
EIコードとEFコードとは独立に出力されることが可能で
ある。両コードが独立して出力された場合には、Eステ
ージ135 では整数演算部117 と浮動小数点演算部118と
が並列に動作する。たとえば、浮動小数点演算部118 で
メモリオペランドを持たない浮動小数点演算命令を実行
する場合、この動作は整数演算部117 の動作と独立して
実行される。
The E code 145 includes a code for controlling the integer operation unit 117 (particularly, an EI code) and the floating point operation unit 11
8 (especially called EF code).
The EI code and the EF code can be output independently. When both codes are output independently, in the E stage 135, the integer operation unit 117 and the floating point operation unit 118 operate in parallel. For example, when the floating-point operation unit 118 executes a floating-point operation instruction having no memory operand, this operation is executed independently of the operation of the integer operation unit 117.

【0210】整数演算であっても浮動小数点演算であっ
ても、マイクロROM の読み出しとマイクロ命令の実行と
はパイプライン化されて行われる。従って、マイクロプ
ログラムで分岐が発生した場合は1マイクロステップの
空きが発生するが、この空きステップで有効な処理を行
うことが可能なように構成されている。Eステージ135
ではAステージ133 で行われたレジスタまたはメモリに
対する書き込み予約をオペランドの書き込みの後に解除
する。
[0210] Regarding the integer operation or the floating point operation, the reading of the micro ROM and the execution of the micro instruction are performed in a pipelined manner. Therefore, when a branch occurs in the microprogram, a vacancy of one microstep occurs, but the configuration is such that effective processing can be performed in this vacant step. E stage 135
Then, the write reservation to the register or the memory performed in the A stage 133 is released after the operand is written.

【0211】2命令が並列にデコードされ、且つサブコ
ードが有効な場合には、主演算器と副演算器とにより2
命令が並列に実行される。1つのRコードに対する処理
が2つ以上のマイクロプログラムステップに分解される
場合、最終マイクロプログラムステップでサブコードに
関する演算実行が行われる。
When two instructions are decoded in parallel and the sub-code is valid, the main operation unit and the sub-operation unit
Instructions are executed in parallel. When the processing for one R code is divided into two or more microprogram steps, the operation is performed on the subcode in the final microprogram step.

【0212】各種の割り込みは命令の切れ目のタイミン
グにおいてEステージ135 が直接受け付け、マイクロプ
ログラムにより必要な処理が実行される。デバッグ事象
を検出するモードにおいてデバッグ事象が検出されてい
る場合には、検出情報が DBCレジスタに反映され、SDBT
あるいはDDBTが起動する。その他の各種 EITの処理もE
ステージ135 でマイクロプログラムにより処理される。
Various interrupts are directly received by the E stage 135 at the timing of instruction breaks, and necessary processing is executed by the microprogram. If a debug event is detected in the debug event detection mode, the detected information is reflected in the DBC register and the SDBT
Or DDBT starts. Other EIT processing is also E
The processing is performed by the microprogram in stage 135.

【0213】演算の結果をメモリにストアする必要があ
る場合には、Eステージ135 はSステージ136 へWコー
ド147 とストア処理を行う命令のプログラムカウンタ値
との双方を出力する。
When it is necessary to store the result of the operation in the memory, the E stage 135 outputs both the W code 147 and the program counter value of the instruction for performing the storing process to the S stage 136.

【0214】(5.2.7) 「オペランドストアステージ」 オペランドストアステージ(Sステージ)136はWコード
147 の論理アドレスをデータ用TLB で物理アドレスに変
換して得られたアドレスでWコード147 のデータを内蔵
データキャッシュにストアする。同時に、Wコード147
とプログラムカウンタ値とをストアバッファに入力し、
データ用TLB から出力された物理アドレスを用いて外部
のメモリへWコード147 のデータをストアする処理を行
う。
(5.2.7) “Operand store stage” Operand store stage (S stage) 136 is a W code
The data of the W code 147 is stored in the built-in data cache with the address obtained by converting the logical address of 147 into a physical address by the data TLB. At the same time, W code 147
And the program counter value into the store buffer,
Using the physical address output from the data TLB, processing for storing the data of the W code 147 in the external memory is performed.

【0215】Sステージ136 の動作はオペランドアクセ
ス部120 で行われ、データ用TLB または内蔵データキャ
ッシュがミスした場合のアドレス変換処理や内蔵データ
キャッシュの入れ替え処理も行う。オペランドのストア
処理で EITが検出された場合は、ストアバッファにWコ
ード147 とプログラムカウンタ値とが保持されたままの
状態で、Eステージ135 にEITの検出が通知される。
The operation of the S stage 136 is performed by the operand access unit 120, and also performs an address conversion process when the data TLB or the built-in data cache misses and a process of replacing the built-in data cache. If an EIT is detected in the operand store processing, the E stage 135 is notified of the EIT detection while the W code 147 and the program counter value are held in the store buffer.

【0216】(5.3) 「各パイプラインステージの状態制
御」 パイプラインの各ステージは入力ラッチと出力ラッチと
を有し、基本的にはそれぞれ他のステージと独立に動作
する。各ステージは1つ前に行った処理が終了するとそ
の処理結果を出力ラッチから次のステージの入力ラッチ
へ転送し、自ステージの入力ラッチに次の処理に必要な
入力信号が全て揃えば次の処理を開始する。
(5.3) “State control of each pipeline stage” Each stage of the pipeline has an input latch and an output latch, and basically operates independently of the other stages. When the previous processing is completed, each stage transfers the processing result from the output latch to the input latch of the next stage. If all the input signals necessary for the next processing are arranged in the input latch of its own stage, the next stage Start processing.

【0217】つまり、各ステージは、1つ前段のステー
ジから出力されてくる次の処理に対する入力信号が全て
有効となり、今の処理結果を後段のステージの入力ラッ
チへ転送して出力ラッチが空になると次の処理を開始す
る。換言すれば、各ステージが動作を開始する直前のタ
イミングで入力信号が全て揃っている必要がある。入力
信号が揃っていない場合には、そのステージは待ち状態
(入力待ち)になる。出力ラッチから次のステージの入
力ラッチへの転送が行われる場合には次のステージの入
力ラッチが空き状態になっている必要があり、次のステ
ージの入力ラッチが空き状態でない場合もパイプライン
ステージは待ち状態(出力待ち)になる。また、キャッ
シュまたはTLB がミスしたり、パイプラインで処理中の
命令間にデータ干渉が生じたよな場合には、1つのステ
ージの処理に複数クロック必要となり、パイプライン処
理が遅延する。
That is, in each stage, all the input signals for the next processing output from the previous stage become valid, the current processing result is transferred to the input latch of the subsequent stage, and the output latch becomes empty. Then, the next process is started. In other words, all the input signals need to be prepared at the timing immediately before each stage starts operating. If the input signals are not ready, the stage enters a waiting state (input waiting). When the transfer from the output latch to the input latch of the next stage is performed, the input latch of the next stage must be empty, and even if the input latch of the next stage is not empty, the pipeline stage Is in the waiting state (output waiting). If a cache or TLB misses or data interference occurs between instructions being processed in the pipeline, a plurality of clocks are required for processing in one stage, and the pipeline processing is delayed.

【0218】また、 BRA命令あるいは JMP命令の実行に
際しては、ジャンプ先アドレスが奇数である場合または
デバッグ事象検出モード(DBC.D=1あるいは PSW.DB=1)で
ある場合には、命令に対して先行ジャンプ処理終了後に
ステップコードの出力を行うが、それ以外の場合では先
行ジャンプ処理終了後のステップコードの出力は行われ
ず、そのステージで命令処理が終了する。また、NOP(ノ
ー・オペレーション)命令の実行に際しては、デバッグ
事象検出モードである場合には、 NOP命令に対してDコ
ード141 及びAコード142 が出力されるが、それ以外の
場合ではDステージ132 で処理を終了する。奇数アドレ
スジャンプトラップ(OAJT), SDBT, DDBTの起動またはト
レース実行(1命令毎の逐次実行)制御はEステージ13
5 で行われる。また、PCブレイクポイントに関するアド
レス比較はRステージで行われる。
When the BRA instruction or JMP instruction is executed, if the jump destination address is an odd number or the debug event detection mode (DBC.D = 1 or PSW.DB = 1), the instruction In this case, the step code is output after the preceding jump processing ends, but otherwise, the step code is not output after the preceding jump processing ends, and the instruction processing ends at that stage. When the NOP (no operation) instruction is executed, the D code 141 and the A code 142 are output in response to the NOP instruction in the debug event detection mode. Ends the processing. Startup or trace execution of odd address jump trap (OAJT), SDBT, DDBT (sequential execution for each instruction) is controlled by E stage 13.
5 is done. The address comparison for the PC breakpoint is performed in the R stage.

【0219】従って、 BRA, JMP, NOP命令はEステージ
135 では有効な処理は行われないが、先行ジャンプ時の
ジャンプ先アドレスが奇数である場合、あるいはデバッ
グ事象検出モード(DBC.D=1あるいは PSW.DB=1)である場
合には、Eステージ135 での処理が行われる。
Therefore, the BRA, JMP and NOP instructions are in the E stage
Although effective processing is not performed in 135, if the jump destination address in the preceding jump is an odd number, or if the debug event detection mode (DBC.D = 1 or PSW.DB = 1), the E stage The processing at 135 is performed.

【0220】(6) 「先行ジャンプ処理機構の詳細動作」 本発明のデータ処理装置100 ではEステージ135 以前の
ステージで行われるジャンプ処理を総称して先行ジャン
プ処理という。以下の説明において、ジャンプを発生す
る命令を総称してジャンプ命令といい、ジャンプ先アド
レスがPC相対モードに限られたジャンプ命令を特別に分
岐命令と定義しておく。
(6) "Detailed operation of preceding jump processing mechanism" In the data processing apparatus 100 of the present invention, jump processing performed in stages before the E stage 135 is generically called preceding jump processing. In the following description, instructions that cause a jump are collectively called a jump instruction, and a jump instruction whose jump destination address is limited to the PC relative mode is specifically defined as a branch instruction.

【0221】表1に示すように、先行ジャンプ処理の処
理対象となる命令は大きく分けて3つに分類できる。第
1は無条件ジャンプ命令であり、指定されたジャンプ先
に必ずジャンプする命令である。該当する命令としてBR
A, BSR, JMP, JSRの各命令がある。第2は条件分岐命令
であり、分岐先アドレスに分岐するか否かが実行時のフ
ラグ状態に依存する命令である。該当する命令として、
Bcc, ACB, SCB, FBccの各命令がある。第3はサブルー
チンからのリターン命令である。該当する命令としてRT
S 及びEXITD の各命令がある。
As shown in Table 1, instructions to be processed by the preceding jump processing can be roughly classified into three types. The first is an unconditional jump instruction, which always jumps to a designated jump destination. BR as applicable instruction
There are A, BSR, JMP, and JSR instructions. The second is a conditional branch instruction, which depends on a flag state at the time of execution whether or not to branch to a branch destination address. As applicable instructions,
There are Bcc, ACB, SCB, and FBcc instructions. Third is a return instruction from the subroutine. RT as applicable instruction
There are S and EXITD instructions.

【0222】[0222]

【表1】 [Table 1]

【0223】本発明のデータ処理装置100 では表1に示
されている全ての命令を対象として先行ジャンプ処理を
行う。
In the data processor 100 of the present invention, the preceding jump processing is performed for all the instructions shown in Table 1.

【0224】無条件ジャンプ命令に関しては、無条件プ
リジャンプが行われる。更に、Dステージ132 で無条件
プリジャンプが行われる場合と、Aステージ133 で無条
件プリジャンプが行われる場合とがある。また、条件ジ
ャンプ命令に関しては、分岐予測が行われ、分岐すると
予測された場合には条件プリブランチが、分岐しないと
予測された場合には分岐先命令プリフェッチが行われ
る。
As for the unconditional jump instruction, an unconditional pre-jump is performed. Further, there are a case where the unconditional pre-jump is performed in the D stage 132 and a case where the unconditional pre-jump is performed in the A stage 133. For a conditional jump instruction, branch prediction is performed. If a branch is predicted, a conditional pre-branch is performed. If a branch is not predicted, a branch destination instruction prefetch is performed.

【0225】本発明のデータ処理装置100 の条件分岐命
令の分岐予測方法は、表2に示すように、分岐すると静
的に予測を行う場合と、分岐しないと静的に予測を行う
場合と、過去の分岐履歴に従って動的に分岐予測を行う
場合との3つに分類できる。但し、整数演算部117 内の
制御レジスタにより条件分岐命令を分岐しないと静的に
予測するように設定することも可能である。
As shown in Table 2, the branch prediction method of the conditional branch instruction of the data processor 100 according to the present invention includes a case where the branch is statically predicted when the branch is taken, a case where the branch is statically predicted without the branch, Dynamic prediction is performed according to past branch history. However, it is also possible to set so as to statically predict that the conditional branch instruction will not be branched by the control register in the integer operation unit 117.

【0226】[0226]

【表2】 [Table 2]

【0227】条件プリブランチはDステージ132 で行わ
れる。分岐先命令プリフェッチはDステージ132 で行わ
れる場合と、Aステージ133 で行われる場合とがある。
サブルーチンリターン命令に関しては、サブルーチンコ
ール時に戻り先アドレスが登録されているPCスタック4
を用いてDステージ132 でプリリターン処理が行われ
る。
The condition pre-branch is performed in the D stage 132. The branch destination instruction prefetch may be performed in the D stage 132 or may be performed in the A stage 133.
For the subroutine return instruction, the PC stack 4 where the return address is registered when the subroutine is called
The pre-return processing is performed in the D stage 132 by using.

【0228】処理方法による対象ジャンプ命令の分類を
表3にまとめて示す。各先行ジャンプ処理の処理方法に
ついて以下で説明する。但し、プリリターン処理に関し
ては、本発明では特に重要ではないので詳しい説明は行
わない。
Table 3 shows the classification of the target jump instructions according to the processing method. The processing method of each preceding jump process will be described below. However, the pre-return processing is not particularly important in the present invention, and therefore will not be described in detail.

【0229】[0229]

【表3】 [Table 3]

【0230】図49は、命令フェッチ部111, 命令デコー
ド部112, PC処理部116, オペランドアドレス計算部11
5, 整数演算部117 相互間で先行ジャンプ処理, あるい
は実行ステージジャンプ等の命令処理シーケンス制御関
連の制御信号及びジャンプ先アドレスの受渡しの関係を
示すブロック図である。
FIG. 49 shows an instruction fetch unit 111, an instruction decode unit 112, a PC processing unit 116, and an operand address calculation unit 11.
5 is a block diagram showing the relationship between the transfer of control signals related to instruction processing sequence control such as a preceding jump process or an execution stage jump and the jump destination address between the integer operation units 117. FIG.

【0231】(6.1) 「Dステージ無条件プリジャンプ」 BRA命令, BSR命令, ジャンプ先アドレスが絶対モード
あるいはPC相対モードで示される JMP命令及び JSR命令
では、Dステージ132 で無条件プリジャンプ処理が行わ
れる。これらの各命令の処理に際しては、命令のデコー
ドサイクルにおいて分岐先アドレス計算部1において有
効なジャンプ先アドレス生成が行われる。
(6.1) "D stage unconditional pre-jump" In the BRA instruction, BSR instruction, JMP instruction and JSR instruction whose jump destination address is indicated in the absolute mode or the PC relative mode, the unconditional pre-jump processing is performed in the D stage 132. Done. When processing each of these instructions, a valid jump destination address is generated in the branch destination address calculation unit 1 in the decode cycle of the instruction.

【0232】命令デコード部112 は、これらの命令をデ
コードした場合には、DJMPAREQ信号301 を”1”にする
ことによりDステージ無条件プリジャンプ要求を命令フ
ェッチ部111 に伝える。また、命令デコード部112 は、
JAバス208 に出力するジャンプ先アドレスの格納位置を
選択するための JASEL信号313 をPC処理部116 に出力す
る。命令フェッチ部111 は各ステージからのジャンプ要
求を調停し、Dステージでの無条件プリジャンプ要求が
受け付け可能な場合には、DPJMPACK信号305 を”1”に
することにより、Dステージ無条件プリジャンプ要求を
受け付けたことを、命令デコード部112 及びPC処理部11
6 に伝える。命令デコード部112 は、DPJMPACK信号305
が”1”になるまでDJMPAREQ信号301 を”1”に維持す
る。
When these instructions are decoded, the instruction decode unit 112 sends the D stage unconditional pre-jump request to the instruction fetch unit 111 by setting the DJMPAREQ signal 301 to "1". Further, the instruction decoding unit 112
A JASEL signal 313 for selecting the storage location of the jump destination address to be output to the JA bus 208 is output to the PC processing unit 116. The instruction fetch unit 111 arbitrates the jump request from each stage, and when the unconditional pre-jump request in the D stage can be accepted, sets the DPJMPACK signal 305 to “1”, thereby setting the D stage unconditional pre-jump. The instruction decoding unit 112 and the PC processing unit 11
Tell 6. The instruction decode unit 112 outputs the DPJMPACK signal 305
The DJMPAREQ signal 301 is maintained at "1" until the signal becomes "1".

【0233】DPJMPACK信号305 が”1”になると、PC処
理部116 では JASEL信号313 により選択された分岐先ア
ドレス計算部1内の出力ラッチの値をJAバス208 に出力
し、命令フェッチ部111 へ転送する。
When the DPJMPACK signal 305 becomes "1", the PC processing section 116 outputs the value of the output latch in the branch destination address calculation section 1 selected by the JASEL signal 313 to the JA bus 208 and sends it to the instruction fetch section 111. Forward.

【0234】命令フェッチ部111 は、JAバス208 から取
り込まれたジャンプ先アドレスに従って命令フェッチ処
理を開始し、フェッチされた命令を命令デコード部112
に出力中であった側の命令キューに取り込む。また、命
令フェッチ部111 はJAバス208 から取り込まれたジャン
プ先アドレスに従って命令キューの入出力ポインタ及び
命令キュー取り込みアドレスレジスタが初期化される。
The instruction fetch unit 111 starts instruction fetch processing according to the jump destination address fetched from the JA bus 208, and decodes the fetched instruction into the instruction decode unit 112.
Is taken into the instruction queue on the side that was being output. The instruction fetch unit 111 initializes the input / output pointer of the instruction queue and the instruction queue fetch address register according to the jump destination address fetched from the JA bus 208.

【0235】命令デコード部112 はDPJMPACK信号305
が”1”になったことにより、PCINIT信号314 を”1”
にして、PC処理部116 にPC値の初期化を指示する。PCIN
IT信号314 が”1”になると、PC処理部116 はJAバス20
8 上の値を TPC27及び DPC29に取り込んで初期化を行
う。命令デコード部112 はこれらの処理を行った後に、
命令コード待ち状態になり、有効な命令コードが取り込
まれて命令フェッチ部111から転送され次第、ジャンプ
先命令のデコードを行う。また、命令デコード部112
は、ジャンプアドレスが奇数アドレスであるか否かの判
定を行い、奇数アドレスにジャンプしたか否かを示す情
報をDコード141 として転送する。
[0235] The instruction decoding unit 112 outputs the DPJMPACK signal 305.
Becomes “1”, the PCINIT signal 314 changes to “1”.
Then, the CPU processing unit 116 is instructed to initialize the PC value. PCIN
When the IT signal 314 becomes “1”, the PC processing unit 116
8 Take the above value into TPC27 and DPC29 and initialize. After performing these processes, the instruction decode unit 112
The instruction code wait state is reached, and as soon as a valid instruction code is fetched and transferred from the instruction fetch unit 111, the jump destination instruction is decoded. The instruction decoding unit 112
Determines whether or not the jump address is an odd address, and transfers information indicating whether or not a jump has been made to the odd address as a D code 141.

【0236】BRA命令及びジャンプ先アドレスが絶対モ
ードまたはPC相対モードで示されるJMP命令では、ジャ
ンプ先アドレスが奇数でなく、且つデバッグ事象検出モ
ード(DBC.D=1 あるいは PSW.DB=1)でない場合には、
BRA, JMP命令に対してDコード141 及びAコード142 の
出力は行われず、Dステージ132 で命令の処理が終了す
る。ジャンプ先アドレスが奇数であるか、またはデバッ
グ事象検出モードである場合には、ノー・オペレーショ
ン(NOP) のステップコードが出力される。このように、
BRA, JMP命令の処理は通常はDステージ132 で終了する
ため、パイプライン中を先行する命令の処理が遅延して
いる場合には、Eステージ135 でのBRA, JMP命令の処理
時間がゼロになるので有効である。
In the BRA instruction and the JMP instruction in which the jump destination address is indicated in the absolute mode or the PC relative mode, the jump destination address is not an odd number and is not in the debug event detection mode (DBC.D = 1 or PSW.DB = 1). in case of,
The D code 141 and the A code 142 are not output for the BRA and JMP instructions, and the processing of the instruction is terminated at the D stage 132. If the jump destination address is odd or in the debug event detection mode, a no operation (NOP) step code is output. in this way,
Since the processing of the BRA and JMP instructions normally ends at the D stage 132, if the processing of the preceding instruction in the pipeline is delayed, the processing time of the BRA and JMP instructions at the E stage 135 becomes zero. It is effective because it becomes.

【0237】Eステージ135 では奇数アドレスジャンプ
の検出が行われる。先行ジャンプ処理時に奇数アドレス
ジャンプが検出されたか否かを示す情報がDコード141,
Rコード143, Eコード145 を経由して送られて来
る。先行ジャンプ処理時に奇数アドレスジャンプが検出
されていた場合には、ジャンプ命令に関する処理が終了
した時点で、奇数アドレスジャンプトラップに関する処
理が行われる。
In the E stage 135, an odd address jump is detected. Information indicating whether or not an odd address jump is detected during the preceding jump processing is a D code 141,
It is sent via R code 143 and E code 145. If an odd address jump has been detected during the preceding jump process, the process related to the odd address jump trap is performed when the process related to the jump instruction ends.

【0238】(6.2) 「Aステージ無条件プリジャンプ」 ジャンプ先アドレスが絶対モード及びPC相対モード以外
のアドレッシングモードで示される JMP命令及び JSR命
令の処理に際してはAステージ133 で無条件プリジャン
プ処理が行われる。
(6.2) "A-stage unconditional pre-jump" When processing a JMP instruction or a JSR instruction whose jump destination address is indicated in an addressing mode other than the absolute mode and the PC relative mode, the A-stage 133 performs unconditional pre-jump processing. Done.

【0239】命令デコード部112 がこれらの命令をデコ
ードすると、Aステージ133 で無条件プリジャンプを行
うことを示す情報がAコード142 としてオペランドアド
レス計算部115 に送られる。この場合、パイプラインの
処理シーケンスが変更されるため、命令デコード部112
はデコード処理を一時中断する。これらの命令の処理に
際しては、オペランドアドレス計算部115 においてジャ
ンプ先アドレスが計算される。なお、多段間接モードを
用いてジャンプ先のアドレスを指定することも可能であ
る。
When instruction decoding section 112 decodes these instructions, information indicating that an unconditional pre-jump is performed in A stage 133 is sent to operand address calculation section 115 as A code 142. In this case, since the processing sequence of the pipeline is changed, the instruction decoding unit 112
Suspends the decoding process. In processing these instructions, the jump address is calculated by the operand address calculation unit 115. It is also possible to specify the jump destination address using the multistage indirect mode.

【0240】オペランドアドレス計算部115 は、有効な
ジャンプ先アドレスが計算されるサイクルにおいてAJMP
AREQ信号308 を”1”にすることによりAステージ無条
件プリジャンプ要求を命令フェッチ部111 に伝える。命
令フェッチ部111 は各ステージからのジャンプ要求を調
停し、Aステージ無条件プリジャンプ要求が受け付け可
能な場合には、APJMPACK信号307 を”1”にすることに
より、Aステージ無条件プリジャンプ要求を受け付けた
ことを、命令デコード部112 及びPC処理部116に伝え
る。
Operand address calculation section 115 performs AJMP in a cycle in which a valid jump destination address is calculated.
By setting the AREQ signal 308 to "1", the A-stage unconditional pre-jump request is transmitted to the instruction fetch unit 111. The instruction fetch unit 111 arbitrates a jump request from each stage, and if the A-stage unconditional pre-jump request can be accepted, sets the APJMPACK signal 307 to “1”, thereby causing the A-stage unconditional pre-jump request to change. The reception is transmitted to the instruction decoding unit 112 and the PC processing unit 116.

【0241】オペランドアドレス計算部115 は、APJMPA
CK信号307 が”1”になるまでAJMPAREQ信号308 を”
1”に維持する。オペランドアドレス計算部115 では、
APJMPACK信号307 が”1”になると、ジャンプ先アドレ
スを示すAOラッチ65の値をJAバス208 に出力し、命令フ
ェッチ部111 へ転送する。命令フェッチ部111 は、JAバ
ス208 から取り込まれたジャンプ先アドレスに従って命
令フェッチ処理を開始し、フェッチされた命令を命令デ
コード部112 に出力中であった側の命令キューに取り込
む。また、命令フェッチ部111 はJAバス208 から取り込
まれたジャンプ先アドレスに従って命令キューの入出力
ポインタや命令キュー取り込みアドレスレジスタの初期
化を行う。
The operand address calculation unit 115 is configured to execute APJMPA
Change the AJMPAREQ signal 308 until the CK signal 307 becomes “1”.
1 ”. In the operand address calculation unit 115,
When the APJMPACK signal 307 becomes "1", the value of the AO latch 65 indicating the jump destination address is output to the JA bus 208 and transferred to the instruction fetch unit 111. The instruction fetch unit 111 starts instruction fetch processing in accordance with the jump destination address fetched from the JA bus 208, and fetches the fetched instruction into the instruction queue on the side that was being output to the instruction decode unit 112. The instruction fetch unit 111 initializes an input / output pointer of an instruction queue and an instruction queue fetch address register according to a jump destination address fetched from the JA bus 208.

【0242】命令デコード部112 はAPJMPACK信号307
が”1”になったことにより、中断されていた命令デコ
ード処理を再開すると共に、PCINIT信号314 を”1”に
して、PC処理部116 にPC値の初期化を指示する。PCINIT
信号314 が”1”になると、PC処理部116 はJAバス208
上の値を TPC27及び DPC29に取り込んで初期化する。命
令デコード部112 はこれらの処理を行った後、命令コー
ド待ち状態になり、有効な命令コードが取り込まれて命
令フェッチ部111 から転送され次第、ジャンプ先命令の
デコードを行う。
The instruction decoding unit 112 receives the APJMPACK signal 307
Becomes "1", the interrupted instruction decoding process is restarted, and the PCINIT signal 314 is set to "1" to instruct the PC processing unit 116 to initialize the PC value. PCINIT
When the signal 314 becomes “1”, the PC processing unit 116 sends the JA bus 208
The values above are loaded into TPC27 and DPC29 and initialized. After performing these processes, the instruction decoding unit 112 enters an instruction code waiting state, and decodes a jump destination instruction as soon as a valid instruction code is fetched and transferred from the instruction fetch unit 111.

【0243】また、オペランドアドレス計算部115 は、
ジャンプアドレスが奇数アドレスであるか否かの判定を
行い、奇数アドレスにジャンプしたか否かを示す情報を
Rコード143 として転送する。
The operand address calculation unit 115 calculates
It is determined whether or not the jump address is an odd address, and information indicating whether or not the jump to the odd address is transferred as an R code 143.

【0244】ジャンプ先アドレスが絶対モードまたはPC
相対モード以外のモードで示されるJMP命令の処理に際
しては、ジャンプ先アドレスが奇数でなく、且つデバッ
グ事象検出モード(DBC.D=1 あるいは PSW.DB=1)でない
場合には、 JMP命令に対してRコード143 もFコード14
4 も出力されず、Aステージ133 で命令の処理が終了す
る。ジャンプ先アドレスが奇数であるか、または、デバ
ッグ事象検出モードである場合には、ノー・オペレーシ
ョン(NOP) のステップコードが出力される。
If the jump destination address is in absolute mode or PC
When processing a JMP instruction indicated in a mode other than the relative mode, if the jump destination address is not an odd number and is not in the debug event detection mode (DBC.D = 1 or PSW.DB = 1), the JMP instruction R code 143 and F code 14
4 is not output, and the processing of the instruction ends in the A stage 133. If the jump destination address is an odd number or is in the debug event detection mode, a no operation (NOP) step code is output.

【0245】このように、 JMP命令の処理が通常はAス
テージ133 で終了するため、パイプライン中を先行する
命令の処理が遅延している場合には、Eステージ135 で
の JMP命令の処理時間がゼロになるので有効である。
As described above, since the processing of the JMP instruction normally ends at the A stage 133, if the processing of the preceding instruction in the pipeline is delayed, the processing time of the JMP instruction at the E stage 135 is reduced. Is effective because it becomes zero.

【0246】Eステージ135 では、奇数アドレスジャン
プの検出を行う。先行ジャンプ処理時に奇数アドレスジ
ャンプが検出されたか否かを示す情報が、Rコード143,
Eコード145 を経由して送られて来る。先行ジャンプ
処理時に奇数アドレスジャンプが検出されていた場合に
は、ジャンプ命令に関する処理が終了した時点で、奇数
アドレスジャンプトラップに関する処理が行われる。
In the E stage 135, an odd address jump is detected. Information indicating whether or not an odd address jump has been detected during the preceding jump processing is indicated by R code 143,
Sent via E-code 145. If an odd address jump has been detected during the preceding jump process, the process related to the odd address jump trap is performed when the process related to the jump instruction ends.

【0247】(6.3) 「Dステージ条件プリジャンプ」 Bcc命令の処理に際して分岐すると予測された場合及び
ACB命令, SCB命令の処理に際しては、Dステージ132
で条件プリジャンプ処理が行われる。条件プリジャンプ
では、命令デコード部112 が分岐変位を取り込むサイク
ルにおいて分岐先アドレス計算部1の4つの加算器5〜
8のいずれで分岐先アドレスが計算されるか否かによっ
て以降の処理が異なる。
(6.3) "D-stage condition pre-jump" When a branch is predicted during the processing of a Bcc instruction, and
When processing the ACB instruction and SCB instruction, the D stage 132
Performs a conditional pre-jump process. In the conditional pre-jump, the four adders 5 to 5 of the branch destination address calculation unit 1 in the cycle in which the instruction decode unit 112 takes in the branch displacement.
8, the subsequent processing differs depending on whether the branch destination address is calculated or not.

【0248】分岐変位を取り込むサイクルにおいて分岐
先アドレスが計算される場合では、命令デコード部112
は、これらの命令をデコードすると、DJMPCREQ信号302
を”1”にすることによりDステージ条件プリジャンプ
要求を命令フェッチ部111 に伝える。また、命令デコー
ド部112 は、JAバス208 に出力するジャンプ先アドレス
の格納位置を選択するための JASEL信号313 をPC処理部
116 に出力する。
When a branch destination address is calculated in a cycle for taking in a branch displacement, the instruction decode unit 112
When these instructions are decoded, the DJMPCREQ signal 302
Is set to "1", the D stage condition pre-jump request is transmitted to the instruction fetch unit 111. The instruction decoding unit 112 outputs a JASEL signal 313 for selecting a storage location of a jump destination address to be output to the JA bus 208 to the PC processing unit.
Output to 116.

【0249】他方、分岐変位を取り込むサイクルにおい
て分岐先アドレスを計算することが出来ない場合には、
そのサイクルにおいて分岐変位の切り出し処理のみが行
われる。切り出された分岐変位はDISPバス205 を介して
分岐先アドレス計算部1に送られる。また、LDDISP信号
315 は”1”に維持される。このサイクルにおいては、
PC加算器23による加算結果は DPC29に書き戻されること
はなく、 DPC29はジャンプ命令のPC値を保持している。
On the other hand, if the branch destination address cannot be calculated in the cycle for taking the branch displacement,
In that cycle, only the branch displacement extraction processing is performed. The cut-out branch displacement is sent to the branch destination address calculation unit 1 via the DISP bus 205. Also, LDDISP signal
315 is maintained at "1". In this cycle,
The result of the addition by the PC adder 23 is not written back to the DPC 29, and the DPC 29 holds the PC value of the jump instruction.

【0250】分岐先アドレス計算部1は、次のサイクル
において分岐先アドレスを計算する。LDDISP信号315
が”1”になっていることにより、第4加算器8の入力
ラッチ12には、IIバス204 の代わりにDISPバス205 から
分岐変位が取り込まれる。第4加算器8においてこの分
岐変位と DPC29の値とが加算され、計算された分岐先ア
ドレスの値が出力ラッチ20に取り込まれる。命令デコー
ド部112 は、このサイクルにおいてDJMPCREQ信号302
を”1”にすることによりDステージ条件プリジャンプ
要求を命令フェッチ部111 に伝える。また、出力ラッチ
20を選択する値が JASEL信号313 としてPC処理部116 に
出力される。
The branch destination address calculation unit 1 calculates a branch destination address in the next cycle. LDDISP signal 315
Is "1", the input latch 12 of the fourth adder 8 receives the branch displacement from the DISP bus 205 instead of the II bus 204. In the fourth adder 8, the branch displacement and the value of the DPC 29 are added, and the calculated value of the branch destination address is taken into the output latch 20. In this cycle, the instruction decode unit 112 outputs the DJMPCREQ signal 302
Is set to "1", the D stage condition pre-jump request is transmitted to the instruction fetch unit 111. Also, output latch
A value for selecting 20 is output to the PC processing section 116 as a JASEL signal 313.

【0251】以後の処理はいずれの場合も同一である。
命令フェッチ部111 は各ステージからのジャンプ要求を
調停し、Dステージ条件プリジャンプ要求が受け付け可
能な場合には、DPJMPACK信号305 を”1”にすることに
より、Dステージ条件プリジャンプ要求を受け付けたこ
とを命令デコード部112 及びPC処理部116 に伝える。
The subsequent processing is the same in each case.
The instruction fetch unit 111 arbitrates the jump request from each stage, and when the D stage condition pre-jump request can be accepted, sets the DPJMPACK signal 305 to "1", thereby accepting the D stage condition pre-jump request. This is reported to the instruction decoding unit 112 and the PC processing unit 116.

【0252】命令フェッチ部111 は2本の命令キューと
1つのアドレス退避機構(QINPCC)88を備えており、2つ
の条件分岐命令に関して3つのシーケンスの情報を保持
できるように構成されている。既に3つのシーケンス情
報が取り込まれている場合には、整数演算部117 から先
行する条件分岐命令の分岐予測ヒット/ミスが伝えられ
るまで、Dステージ条件プリジャンプ要求を受け付けな
い。命令デコード部112 はDPJMPACK信号305 が”1”に
なるまでDJMPCREQ信号302 を”1”に維持する。
The instruction fetch unit 111 has two instruction queues and one address saving mechanism (QINPCC) 88, and is configured to be able to hold information on three sequences for two conditional branch instructions. When three pieces of sequence information have already been fetched, the D stage condition pre-jump request is not accepted until the integer operation unit 117 transmits a branch prediction hit / miss of the preceding conditional branch instruction. The instruction decoding unit 112 maintains the DJMPCREQ signal 302 at “1” until the DPJMPACK signal 305 becomes “1”.

【0253】DPJMPACK信号305 が”1”になると、PC処
理部116 では JASEL信号313 により選択された分岐先ア
ドレス計算部1内の出力ラッチの値をJAバス208 に出力
して命令フェッチ部111 へ転送する。
When the DPJMPACK signal 305 becomes "1", the PC processing section 116 outputs the value of the output latch in the branch destination address calculation section 1 selected by the JASEL signal 313 to the JA bus 208 and sends it to the instruction fetch section 111. Forward.

【0254】命令フェッチ部111 が1つのシーケンス情
報のみを保持している場合には、命令フェッチ部111 は
命令キューの切り替え処理を行う。現在使用中の命令キ
ューA83または命令キューB84の内容と、命令キュー取
り込みアドレスを保持する2つのレジスタQINPCA86また
はQINPCB87の値と、命令キューの入出力ポインタ値とを
保持したままで、命令フェッチ部111 はJAバス208 から
取り込まれたジャンプ先アドレスに従って命令フェッチ
処理を開始し、フェッチされた命令を未使用であった側
の命令キューに取り込んで命令デコード部112 に出力す
る。また、JAバス208 から取り込まれたジャンプ先アド
レスに従って、未使用であった側の命令キューの入出力
ポインタ及び命令キュー取り込みアドレスレジスタを初
期化する。命令フェッチ部111 は、分岐先命令側のシー
ケンス命令を優先的にフェッチし、命令キューがフルに
なっている期間を利用して条件分岐命令に引き続く側の
シーケンスの命令フェッチを行う。
When the instruction fetch unit 111 holds only one piece of sequence information, the instruction fetch unit 111 performs an instruction queue switching process. The instruction fetch unit 111 retains the contents of the instruction queue A83 or B84 currently in use, the values of the two registers QINPCA86 or QINPCB87 holding the instruction queue fetch address, and the input / output pointer value of the instruction queue. Starts instruction fetch processing in accordance with the jump destination address fetched from the JA bus 208, fetches the fetched instruction into the instruction queue on the unused side, and outputs it to the instruction decode unit 112. Further, according to the jump destination address fetched from the JA bus 208, the input / output pointer of the unused instruction queue and the instruction queue fetch address register are initialized. The instruction fetch unit 111 preferentially fetches a sequence instruction on the branch destination instruction side, and performs an instruction fetch of a sequence following the conditional branch instruction using a period during which the instruction queue is full.

【0255】命令フェッチ部111 が既に2つのシーケン
ス情報を保持している場合には、命令フェッチ部111 は
JAバス208 から取り込まれたジャンプ先アドレスをQINP
CC88及び入出力ポインタ部85に退避しておき、命令キュ
ーの切り替え処理をペンディング状態にする。先行する
条件分岐命令の分岐条件が確定し、分岐予測が的中して
いた場合には、ペンディングになっていた処理が再開さ
れる。予測が外れていた場合には、QINPCC88に退避され
ていたアドレス値も無効化される。
If the instruction fetch unit 111 already holds two pieces of sequence information, the instruction fetch unit 111
The jump destination address taken from JA bus 208 is QINP
It is saved in the CC 88 and the input / output pointer unit 85, and the process of switching the instruction queue is put in a pending state. If the branch condition of the preceding conditional branch instruction has been determined and the branch prediction has been successful, the pending processing is resumed. If the prediction is incorrect, the address value saved in the QINPCC 88 is also invalidated.

【0256】命令デコード部112 はDPJMPACK信号305
が”1”になったことにより、PCINIT信号314 を”1”
にして、PC処理部116 にPC値の初期化を指示する。PCIN
IT信号314 が”1”になると、PC処理部116 はJAバス20
8 上の値を TPC27及び DPC29に取り込んで初期化する。
命令デコード部112 はこれらの処理を行った後、命令コ
ード待ち状態になり、有効な命令コードが取り込まれて
命令フェッチ部111 から転送され次第、ジャンプ先命令
のデコードを行う。
The instruction decoding unit 112 receives the DPJMPACK signal 305
Becomes “1”, the PCINIT signal 314 changes to “1”.
Then, the CPU processing unit 116 is instructed to initialize the PC value. PCIN
When the IT signal 314 becomes “1”, the PC processing unit 116
8 Take the above values into TPC27 and DPC29 and initialize them.
After performing these processes, the instruction decoding unit 112 enters an instruction code waiting state, and decodes a jump destination instruction as soon as a valid instruction code is fetched and transferred from the instruction fetch unit 111.

【0257】また、命令デコード部112 はジャンプアド
レスが奇数アドレスであるか否かの判定を行い、奇数ア
ドレスにジャンプしたか否かを示す情報をDコード141
として転送する。
The instruction decoding unit 112 determines whether or not the jump address is an odd address, and outputs information indicating whether or not a jump to an odd address to the D code 141.
Transfer as

【0258】命令フェッチ部111 では、条件プリジャン
プ処理を行った条件分岐命令がEステージ135 で処理さ
れ分岐条件が確定するまで、予測された側のシーケンス
のフェッチを優先的に行うが、命令キューがフルになっ
ている期間には元のシーケンスのフェッチも継続して行
う。
The instruction fetch unit 111 preferentially fetches the predicted side sequence until the conditional branch instruction subjected to the conditional pre-jump processing is processed in the E stage 135 and the branch condition is determined. During the period when is full, the original sequence is fetched continuously.

【0259】条件プリジャンプ処理を行った命令の処理
に際しては、分岐予測が外れた場合にPC計算部2の初期
化を行う必要があるので、Aステージ133 で条件分岐命
令の次の命令アドレスを計算する。この処理は、ATPC28
の値をIXバス206, アドレス加算器61, AOバス216 を介
して整数演算部117 へ転送することにより行われる。
In processing an instruction that has been subjected to conditional pre-jump processing, it is necessary to initialize the PC calculation unit 2 when a branch prediction is missed. calculate. This process is based on ATPC28
Is transferred to the integer operation unit 117 via the IX bus 206, the address adder 61, and the AO bus 216.

【0260】条件プリジャンプ処理を行った条件分岐命
令の分岐条件判定はEステージ135で行われる。分岐予
測が的中していた場合には、整数演算部117 は QCANCEL
信号312 を”1”にすることにより、命令フェッチ部11
1 に条件分岐命令に引き続くシーケンス情報を無効化す
ることを伝える。 QCANCEL信号312 が”1”になると、
命令フェッチ部111 は条件分岐命令に引き続くシーケン
ス側の命令キューを開放する。QINPCC88にアドレスが退
避されていた場合には、その情報で無効化された側の命
令キューに関する情報が初期化される。パイプライン中
で処理中の命令処理はそのまま継続される。分岐予測が
外れていた場合には、命令キューの切り替え処理が行わ
れる。
The branch condition judgment of the conditional branch instruction that has been subjected to the conditional pre-jump processing is performed in the E stage 135. If the branch prediction was successful, the integer operation unit 117 sets QCANCEL
By setting the signal 312 to “1”, the instruction fetch unit 11
Tell 1 to invalidate the sequence information following the conditional branch instruction. When the QCANCEL signal 312 becomes “1”,
The instruction fetch unit 111 releases the instruction queue on the sequence side following the conditional branch instruction. If the address has been saved in the QINPCC 88, the information related to the instruction queue on the invalidated side is initialized by the information. Instruction processing being processed in the pipeline is continued as it is. If the branch prediction is incorrect, the instruction queue switching process is performed.

【0261】整数演算部117 はQEXCHG信号311 を”1”
にする事により命令フェッチ部111に分岐予測が外れた
ことを通知する。また、整数演算部117 は、Dステージ
132以降のパイプライン処理を無効化するためにINIT信
号300 を”1”にすると共に、PC計算部2の初期化を行
うためにJAバス208 に条件分岐命令の次の命令のPC値を
出力する。パイプライン機構のDステージ132 以降の各
ステージでは、INIT信号300 が”1”になったことを受
けて初期化される。
The integer operation unit 117 sets the QEXCHG signal 311 to “1”.
Thus, the instruction fetch unit 111 is notified that the branch prediction has failed. In addition, the integer operation unit 117 includes a D stage
The INIT signal 300 is set to "1" to invalidate the pipeline processing after 132, and the PC value of the instruction following the conditional branch instruction is output to the JA bus 208 to initialize the PC calculation unit 2. I do. In each stage after the D stage 132 of the pipeline mechanism, initialization is performed in response to the INIT signal 300 becoming "1".

【0262】QEXCHG信号311 が”1”になると、命令フ
ェッチ部111 は分岐先シーケンス側の命令キューを開放
し、条件分岐命令に引き続くシーケンス側のフェッチを
行い、命令コードを命令デコード部112 に送る。QINPCC
88にアドレスが退避されていた場合にはQINPCC88の無効
化も行われる。条件分岐命令に引き続くシーケンス側の
命令キューには既に命令コードが取り込まれている場合
が多い。
When the QEXCHG signal 311 becomes "1", the instruction fetch unit 111 releases the instruction queue of the branch destination sequence, fetches the sequence following the conditional branch instruction, and sends the instruction code to the instruction decode unit 112. . QINPCC
If the address has been saved to 88, the QINPCC 88 is also invalidated. In many cases, the instruction code on the sequence side following the conditional branch instruction has already been fetched.

【0263】命令デコード部112 は、INIT信号300 が”
1”になったことを受けて初期化を行うと共に、PCINIT
信号314 を”1”にすることによりPC計算部2の初期化
を指示する。PCINIT信号314 が”1”になると、PC処理
部116 はJAバス208 上の値をTPC27及び DPC29に取り込
んで初期化する。
The instruction decoding unit 112 sets the INIT signal 300 to "
Initialization is performed in response to “1”, and PCINIT
By setting the signal 314 to "1", the initialization of the PC calculation unit 2 is instructed. When the PCINIT signal 314 becomes "1", the PC processing unit 116 takes the value on the JA bus 208 into the TPC 27 and the DPC 29 and initializes them.

【0264】Eステージ135 では奇数アドレスジャンプ
の検出を行う。先行ジャンプ処理時に奇数アドレスジャ
ンプが検出されたか否かを示す情報がDコード141, R
コード143, Eコード145 を経由して送られて来る。も
し、分岐予測が的中していて先行ジャンプ処理時に奇数
アドレスジャンプが検出されていた場合には、ジャンプ
命令に関する処理が終了した時点で奇数アドレスジャン
プトラップに関する処理が行われる。分岐予測が外れて
いた場合には、先行ジャンプ処理時に奇数アドレスジャ
ンプが検出されていても奇数アドレスジャンプの処理は
行われない。
The E stage 135 detects an odd address jump. Information indicating whether or not an odd address jump is detected during the preceding jump processing is D code 141, R
Sent via code 143, E code 145. If the branch prediction is correct and an odd address jump is detected during the preceding jump processing, the processing related to the odd address jump trap is performed when the processing related to the jump instruction ends. If the branch prediction is incorrect, the odd address jump processing is not performed even if an odd address jump is detected during the preceding jump processing.

【0265】(6.4) 「Dステージ分岐先命令プリフェッ
チ」 Bcc命令で分岐しないと予測された場合には、Dステー
ジ132 で分岐先命令プリフェッチ処理が行われる。この
場合、分岐先アドレスは命令デコードサイクルにおいて
分岐先アドレス計算部1の4つの加算器5〜8のいずれ
かで分岐先アドレスが計算される。
(6.4) “D-stage branch destination instruction prefetch” If it is predicted that the Bcc instruction will not branch, the D-stage 132 performs branch destination instruction prefetch processing. In this case, the branch destination address is calculated by one of the four adders 5 to 8 of the branch destination address calculation unit 1 in the instruction decode cycle.

【0266】命令デコード部112 は Bcc命令をデコード
し、且つ過去の分岐履歴により分岐が発生しないと予測
されていた場合には、DPFETREQ信号303 を”1”にする
ことによりDステージ分岐先命令プリフェッチ要求を命
令フェッチ部111 に伝える。また、命令デコード部112
は、JAバス208 に出力するジャンプ先アドレスの格納位
置を選択するための JASEL信号313 をPC処理部116 に出
力する。
The instruction decoding unit 112 decodes the Bcc instruction, and if it is predicted from the past branch history that no branch will occur, sets the DPFETREQ signal 303 to "1" to prefetch the D-stage branch destination instruction. The request is transmitted to the instruction fetch unit 111. The instruction decoding unit 112
Outputs a JASEL signal 313 to the PC processing unit 116 for selecting the storage location of the jump destination address to be output to the JA bus 208.

【0267】命令フェッチ部111 は各ステージからのジ
ャンプ要求を調停し、Dステージ分岐先命令プリフェッ
チ要求が受け付け可能な場合には、DPJMPACK信号305
を”1”にすることによりDステージ分岐先命令プリフ
ェッチ要求を受け付けたことを命令デコード部112 及び
PC処理部116 に伝える。
The instruction fetch unit 111 arbitrates a jump request from each stage, and if the D stage branch destination instruction prefetch request can be accepted, the DPJMPACK signal 305
Is set to “1”, the fact that the D stage branch destination instruction prefetch request has been accepted indicates that the instruction decoding unit 112 and
Notify the PC processing unit 116.

【0268】命令フェッチ部111 は、前述のように2つ
の条件分岐命令に関して3つのシーケンスの情報を保持
出来るようになっている。既に3つのシーケンス情報が
取り込まれている場合には、整数演算部117 から先行す
る条件分岐命令の分岐予測ヒット/ミスが伝えられるま
で、命令フェッチ部111 はDステージ条件プリジャンプ
要求を受け付けない。命令デコード部112 はDPJMPACK信
号305 が”1”になるまでDPFETREQ信号303 を”1”に
維持する。
The instruction fetch unit 111 can hold information on three sequences for two conditional branch instructions as described above. When three pieces of sequence information have already been fetched, the instruction fetch unit 111 does not accept the D stage condition pre-jump request until the integer operation unit 117 transmits a branch prediction hit / miss of the preceding conditional branch instruction. The instruction decoding unit 112 maintains the DPFETREQ signal 303 at "1" until the DPJMPACK signal 305 becomes "1".

【0269】DPJMPACK信号305 が”1”になると、PC処
理部116 ではJASEL 信号313 により選択された分岐先ア
ドレス計算部1内の出力ラッチの値をJAバス208 に出力
して命令フェッチ部111 へ転送する。
When the DPJMPACK signal 305 becomes "1", the PC processing section 116 outputs the value of the output latch in the branch destination address calculation section 1 selected by the JASEL signal 313 to the JA bus 208 and sends it to the instruction fetch section 111. Forward.

【0270】命令フェッチ部111 が1つのシーケンス情
報のみを保持している場合には、命令フェッチ部111 は
JAバス208 から取り込まれたジャンプ先アドレスに従っ
て、使用中でない側の命令キューのフェッチアドレスレ
ジスタQINPCA86またはQINPCB87と、命令キューの入出力
ポインタ値とを初期化する。現在使用中の命令キューA
83または命令キューB84は引き続く命令のフェッチを行
い、取り込んだ命令を命令デコード部112 に出力する。
命令フェッチ部111 は、条件分岐命令に引き続く側のシ
ーケンス命令を優先的にフェッチし、命令キューがフル
になっている期間を利用して分岐先の命令フェッチを行
う。
When the instruction fetch unit 111 holds only one sequence information, the instruction fetch unit 111
In accordance with the jump destination address fetched from the JA bus 208, the fetch address register QINPCA86 or QINPCB87 of the instruction queue not in use and the input / output pointer value of the instruction queue are initialized. Instruction queue A currently in use
The instruction 83 or the instruction queue B 84 fetches a subsequent instruction and outputs the fetched instruction to the instruction decoding unit 112.
The instruction fetch unit 111 preferentially fetches a sequence instruction following the conditional branch instruction, and fetches a branch destination instruction using a period during which the instruction queue is full.

【0271】命令フェッチ部111 が既に2つのシーケン
ス情報を保持している場合には、命令フェッチ部111 は
JAバス208 から取り込まれたジャンプ先アドレスをQINP
CC88及び入出力ポインタ部85に退避しておき、命令キュ
ーのプリフェッチ処理をペンディング状態にしておく。
先行する条件分岐命令の分岐条件が確定し、分岐予測が
的中していた場合には、ペンディングになっていた処理
が再開される。予測が外れていた場合には、QINPCC88に
退避されていたアドレス値も無効化される。
If the instruction fetch unit 111 already holds two pieces of sequence information, the instruction fetch unit 111
The jump destination address taken from JA bus 208 is QINP
The instruction queue is evacuated to the CC 88 and the input / output pointer unit 85, and the prefetch processing of the instruction queue is set to a pending state.
If the branch condition of the preceding conditional branch instruction has been determined and the branch prediction has been successful, the pending processing is resumed. If the prediction is incorrect, the address value saved in the QINPCC 88 is also invalidated.

【0272】分岐先命令プリフェッチでは、パイプライ
ン処理を行うシーケンス自身は変化しないので、PC処理
部116 はPC値の初期化は行わない。命令デコード部112
は引き続く命令の処理を行う。この場合は、処理シーケ
ンスの切り替えは行わないので、命令デコード部112 で
はジャンプアドレスが奇数アドレスであるか否かの判定
は行われない。
In the branch destination instruction prefetch, the sequence itself for performing the pipeline processing does not change, so that the PC processing unit 116 does not initialize the PC value. Instruction decode unit 112
Performs the processing of the subsequent instruction. In this case, since the processing sequence is not switched, the instruction decoding unit 112 does not determine whether or not the jump address is an odd address.

【0273】分岐先命令プリフェッチ処理を行った命令
では、分岐予測が外れた場合にPC計算部2の初期化を行
う必要があるので、Aステージ133 で再び分岐先アドレ
スの計算が行われる。この処理は、IXバス206 を介して
入力された APC30の値と、DISPバス205, DISPラッチ67
を介して命令デコード部112 より取り込まれた分岐変位
の値とを加算することにより行われる。
In the instruction that has been subjected to the branch destination instruction prefetch processing, it is necessary to initialize the PC calculation unit 2 when the branch prediction is incorrect, so that the A stage 133 calculates the branch destination address again. This processing is based on the APC30 value input via the IX bus 206, the DISP bus 205, and the DISP latch 67.
This is performed by adding the value of the branch displacement fetched by the instruction decoding unit 112 via the instruction decoding unit 112.

【0274】分岐先命令プリフェッチ処理を行った条件
分岐命令の分岐条件判定はEステージ135 で行われる。
分岐予測が的中していた場合には、整数演算部117 はQC
ANCEL 信号312 を”1”にすることにより命令フェッチ
部111 に分岐先命令に引き続くシーケンス情報を無効化
することを伝える。QCANCEL 信号312 が”1”になる
と、命令フェッチ部111 は分岐先命令に引き続くシーケ
ンス側の命令キューを開放する。QINPCC88にアドレスが
退避されていた場合には、その情報で無効化された側の
命令キューに関する情報が初期化される。パイプライン
中で処理中の命令処理はそのまま継続される。
The E-stage 135 determines the branch condition of the conditional branch instruction that has been subjected to the branch destination instruction prefetch processing.
If the branch prediction is correct, the integer operation unit 117
Setting the ANCEL signal 312 to "1" informs the instruction fetch unit 111 that the sequence information following the branch destination instruction is invalidated. When the QCANCEL signal 312 becomes "1", the instruction fetch unit 111 releases the instruction queue on the sequence side following the branch destination instruction. If the address has been saved in the QINPCC 88, the information related to the instruction queue on the invalidated side is initialized by the information. Instruction processing being processed in the pipeline is continued as it is.

【0275】分岐予測が外れていた場合には、命令キュ
ーの切り替え処理が行われる。整数演算部117 は、QEXC
HG信号311 を”1”にすることにより命令フェッチ部11
1 に分岐予測が外れたことを通知する。また、整数演算
部117 は、Dステージ132 以降のパイプライン処理を無
効化するためにINIT信号300 を”1”にすると共に、PC
計算部2の初期化を行うためにJAバス208 に分岐先アド
レスを出力する。パイプライン処理機構のDステージ13
2 以降のパイプライン処理を行う各ステージは、INIT信
号300 が”1”になったことを受けて初期化される。
If the branch prediction is incorrect, the process of switching the instruction queue is performed. Integer operation unit 117 uses QEXC
By setting the HG signal 311 to “1”, the instruction fetch unit 11
Notify 1 that the branch prediction is incorrect. In addition, the integer operation unit 117 sets the INIT signal 300 to “1” in order to invalidate the pipeline processing after the D stage 132,
The branch destination address is output to the JA bus 208 in order to initialize the calculation unit 2. D stage 13 of pipeline processing mechanism
Each stage for performing the subsequent pipeline processing is initialized when the INIT signal 300 becomes "1".

【0276】QEXCHG信号311 が”1”になると、命令フ
ェッチ部111 は条件分岐命令に引き続くシーケンス側の
命令キューを開放し、分岐先命令に引き続くシーケンス
側のフェッチを行って命令コードを命令デコード部112
に送る。QINPCC88にアドレスが退避されていた場合には
QINPCC88は無効化される。条件分岐命令に引き続くシー
ケンス側の命令キューには既に命令コードが取り込まれ
ている場合が多い。
When the QEXCHG signal 311 becomes “1”, the instruction fetch unit 111 releases the instruction queue on the sequence side following the conditional branch instruction, fetches the sequence side following the branch destination instruction, and decodes the instruction code into the instruction decode unit. 112
Send to If the address has been saved to QINPCC88
QINPCC88 is invalidated. In many cases, the instruction code on the sequence side following the conditional branch instruction has already been fetched.

【0277】命令デコード部112 は、INIT信号300 が”
1”になったことを受けて初期化を行うと共に、PCINIT
信号314 を”1”にすることによりPC計算部2の初期化
を指示する。PCINIT信号314 が”1”になると、PC処理
部116 はJAバス208 上の値をTPC27及び DPC29に取り込
んで初期化する。
The instruction decoding unit 112 sets the INIT signal 300 to "
Initialization is performed in response to “1”, and PCINIT
By setting the signal 314 to "1", the initialization of the PC calculation unit 2 is instructed. When the PCINIT signal 314 becomes "1", the PC processing unit 116 takes the value on the JA bus 208 into the TPC 27 and the DPC 29 and initializes them.

【0278】Eステージ135 では奇数アドレスジャンプ
の検出を行う。分岐予測が外れていてJAバス208 に出力
した分岐先アドレスが奇数であった場合には、ジャンプ
命令に関する処理が終了した時点で奇数アドレスジャン
プトラップに関する処理が行われる。分岐先アドレスが
奇数であっても、分岐が実際には発生しなかった場合に
は、奇数アドレスジャンプの処理は行われない。
The E stage 135 detects an odd address jump. If the branch prediction is incorrect and the branch destination address output to the JA bus 208 is an odd number, the processing related to the odd address jump trap is performed when the processing related to the jump instruction ends. Even if the branch destination address is an odd number, if the branch has not actually occurred, the odd address jump processing is not performed.

【0279】(6.5) 「Aステージ分岐先命令プリフェッ
チ」 FBcc命令の処理に際しては、Aステージ133 で分岐先命
令プリフェッチ処理が行われる。Dステージ132 ではな
くAステージ133 で分岐先命令のプリフェッチ処理が行
われる理由は、FBcc命令では命令デコードサイクルにお
いては分岐先アドレス計算部1の4つの加算器5〜8の
いずれかで分岐先アドレスを計算することが出来ないた
めである。
(6.5) "A-Stage Branch Destination Instruction Prefetch" In processing the FBcc instruction, the A-stage 133 performs branch destination instruction prefetch processing. The reason why the prefetch processing of the branch destination instruction is performed not in the D stage 132 but in the A stage 133 is that in the FBcc instruction, the branch destination address is calculated by one of the four adders 5 to 8 of the branch destination address calculator 1 in the instruction decode cycle. Cannot be calculated.

【0280】命令デコード部112 はFBcc命令をデコード
すると、Aステージ133 で分岐先命令プリフェッチを行
うことを示す情報をAコード142 としてオペランドアド
レス計算部115 に送る。この場合、命令フェッチ部111
に出力される先行ジャンプ処理要求が命令の処理順序に
なるように、命令デコード部112 はこの命令のプリフェ
ッチ要求が受け付けられるまで、Dステージ132 での先
行ジャンプ処理の要求を命令フェッチ部111 に出力する
ことを抑止する。
When the instruction decode unit 112 decodes the FBcc instruction, the instruction decode unit 112 sends information indicating that the branch destination instruction prefetch is performed in the A stage 133 to the operand address calculation unit 115 as an A code 142. In this case, the instruction fetch unit 111
The instruction decoding unit 112 outputs the request for the preceding jump processing in the D stage 132 to the instruction fetch unit 111 until the prefetch request for this instruction is accepted so that the preceding jump processing request output to the instruction is in the instruction processing order. Deters them from doing so.

【0281】Aステージ133 で分岐先命令プリフェッチ
処理を行う命令では、Aステージ133 で分岐先アドレス
の計算が行われる。この処理は、IXバス206 を介して入
力された APC30の値と、DISPバス205 及びDISPラッチ67
を介して命令デコード部112より取り込まれた分岐変位
の値とを加算することにより行われる。
For an instruction that performs branch destination instruction prefetch processing in the A stage 133, the branch destination address is calculated in the A stage 133. This processing is performed by comparing the value of the APC 30 input via the IX bus 206 with the value of the DISP bus 205 and the DISP latch 67.
By adding the value of the branch displacement fetched from the instruction decoding unit 112 via the instruction decoding unit 112.

【0282】オペランドアドレス計算部115 は、分岐先
アドレスが計算されるサイクルにおいて、APFETREQ信号
309 を”1”にすることによりAステージ分岐先命令プ
リフェッチ要求を命令フェッチ部111 に伝える。
Operand address calculating section 115 controls the APFETREQ signal in the cycle in which the branch destination address is calculated.
By setting 309 to “1”, the A-stage branch destination instruction prefetch request is transmitted to the instruction fetch unit 111.

【0283】命令フェッチ部111 は各ステージからのジ
ャンプ要求を調停し、Aステージ分岐先プリフェッチ要
求が受け付け可能な場合には、APJMPACK信号307 を”
1”にすることにより、Aステージ分岐先命令プリフェ
ッチ要求を受け付けたことを命令デコード部112 及びオ
ペランドアドレス計算部115 に伝える。オペランドアド
レス計算部115 は、APJMPACK信号307 が”1”になるま
でAPFETREQ信号309 を”1”に維持する。
The instruction fetch unit 111 arbitrates a jump request from each stage, and if the A-stage branch destination prefetch request can be accepted, changes the APJMPACK signal 307 to “
By setting it to "1", the reception of the A-stage branch destination instruction prefetch request is notified to the instruction decoding unit 112 and the operand address calculation unit 115. The operand address calculation unit 115 keeps the APFETREQ signal until the APJMPACK signal 307 becomes "1". The signal 309 is maintained at "1".

【0284】APJMPACK信号307 が”1”になると、オペ
ランドアドレス計算部115 ではAOラッチ65の値をJAバス
208 に出力して命令フェッチ部111 へ転送する。命令フ
ェッチ部111 内部の処理はDステージ分岐先命令プリフ
ェッチの場合と同様である。分岐予測が外れた場合にPC
計算部2の初期化を行う必要があるので、この分岐先ア
ドレスはAOバス216 を介して整数演算部117 にも転送さ
れる。
When the APJMPACK signal 307 becomes "1", the operand address calculation unit 115 stores the value of the AO latch 65 in the JA bus.
The output is sent to the instruction fetch unit 111. The processing inside the instruction fetch unit 111 is the same as that in the case of the D stage branch destination instruction prefetch. PC when branch prediction goes wrong
Since the calculation unit 2 needs to be initialized, this branch destination address is also transferred to the integer operation unit 117 via the AO bus 216.

【0285】また、命令デコード部112 はDPJMPACK信号
305 が”1”になったことによりDステージ132 での先
行ジャンプ処理の抑止を解除する。分岐先命令プリフェ
ッチでは、パイプライン処理を行うシーケンス自身は変
化しないので、PC処理部116はPC値の初期化は行われな
い。この場合は、処理シーケンスの切り替えは行われな
いため、オペランドアドレス計算部115 ではジャンプア
ドレスが奇数アドレスであるか否かの判定は行われな
い。
The instruction decoding unit 112 outputs the DPJMPACK signal
When 305 becomes "1", the suppression of the preceding jump processing in the D stage 132 is released. In the branch destination instruction prefetch, the sequence itself for performing the pipeline processing does not change, so that the PC processing unit 116 does not initialize the PC value. In this case, since the processing sequence is not switched, the operand address calculation unit 115 does not determine whether the jump address is an odd address.

【0286】分岐先命令プリフェッチ処理を行った条件
分岐命令の分岐条件判定はEステージ135 で行われる。
Eステージ135 での処理はDステージ分岐先命令プリフ
ェッチを行った場合の処理とまったく同一である。
The E-stage 135 determines the branch condition of the conditional branch instruction that has been subjected to the branch destination instruction prefetch processing.
The processing in the E stage 135 is exactly the same as the processing when the D stage branch destination instruction prefetch is performed.

【0287】(6.6) 「命令キューの動作」 次に、プリジャンプ処理時の命令キュー部82の動作につ
いて、その状態遷移を示す図66の模式図を参照して説明
する図66に示されている各状態は以下の如くである。
(6.6) “Operation of Instruction Queue” Next, the operation of the instruction queue unit 82 during the pre-jump processing will be described with reference to the schematic diagram of FIG. Each state is as follows.

【0288】INIT: 初期状態 (リセット直後の状態) ・内部状態は不定。 ・QINPCA86のアドレスに従って命令キューA83に命令が
取込まれ、この命令が命令デコード部112 に出力され
る。
INIT: Initial state (state immediately after reset) • Internal state is undefined. The instruction is taken into the instruction queue A83 in accordance with the address of the QINPCA 86, and the instruction is output to the instruction decoding unit 112.

【0289】 ・QINPCB87のアドレスに従って命令キューB84に命令が
取込まれ、この命令が命令デコード部112 に出力され
る。
[0289] The instruction is taken into the instruction queue B84 according to the address of the QINPCB 87, and the instruction is output to the instruction decoding unit 112.

【0290】 ・QINPCA86のアドレスに従って命令キューA83に命令が
取込まれる。但し、命令キューA83がフルである場合は
QINPCB87のアドレスに従って命令キューB84に命令が取
り込まれる。命令キューA83に取り込まれた命令が命令
デコード部112 に出力される。
[0290] The instruction is taken into the instruction queue A83 according to the address of the QINPCA86. However, if instruction queue A83 is full
The instruction is taken into the instruction queue B84 according to the address of QINPCB87. The instruction captured in the instruction queue A83 is output to the instruction decoding unit 112.

【0291】 ・QINPCB87のアドレスに従って命令キューB84に命令が
取込まれる。但し、命令キューB84がフルである場合は
QINPCA86のアドレスに従って命令キューA83に命令が取
り込まれる。命令キューB84に取り込まれた命令が命令
デコード部112 に出力される。
[0291] The instruction is taken into the instruction queue B84 according to the address of QINPCB87. However, if instruction queue B84 is full
The instruction is taken into the instruction queue A83 according to the address of the QINPCA86. The instruction fetched into the instruction queue B84 is output to the instruction decoding unit 112.

【0292】 A3 : 命令キューA83/QINPCA86:有効 命令キューB84/QINPCB87:有効 QINPCC88:有効 優先順位:命令キューA83>QINPCC88>命令キューB84 ・QINPCA86のアドレスに従って命令キューA83に命令が
取込まれる。但し、命令キューA83がフルである場合は
QINPCB87のアドレスに従って命令キューB84に命令が取
り込まれる。命令キューA83に取り込まれた命令が命令
デコード部112 に出力される。
A3: Instruction queue A83 / QINPCA86: Valid Instruction queue B84 / QINPCB87: Valid QINPCC88: Valid Priority: Instruction queue A83>QINPCC88> Instruction queue B84 • Instruction is taken into instruction queue A83 according to the address of QINPCA86. However, if instruction queue A83 is full
The instruction is taken into the instruction queue B84 according to the address of QINPCB87. The instruction captured in the instruction queue A83 is output to the instruction decoding unit 112.

【0293】 B3 : 命令キューA83/QINPCA86:有効 命令キューB84/QINPCB87:有効 QINPCC88:有効 優先順位:命令キューB84>QINPCC88>命令キューA83 ・QINPCB87のアドレスに従って命令キューB84に命令が
取込まれる。但し、命令キューB84がフルである場合は
QINPCA86のアドレスに従って命令キューA83に命令が取
り込まれる。命令キューB84に取り込まれた命令が命令
デコード部112 に出力される。
B3: Instruction queue A83 / QINPCA86: Valid Instruction queue B84 / QINPCB87: Valid QINPCC88: Valid Priority: Instruction queue B84>QINPCC88> Instruction queue A83 • Instruction is taken into instruction queue B84 according to the address of QINPCB87. However, if instruction queue B84 is full
The instruction is taken into the instruction queue A83 according to the address of the QINPCA86. The instruction fetched into the instruction queue B84 is output to the instruction decoding unit 112.

【0294】 CA: 命令キューA83/QINPCA86:有効 命令キューB84/QINPCB87:有効 QINPCC88:有効 優先順位:QINPCC88>命令キューA83>命令キューB84 ・QINPCA86のアドレスに従って命令キューA83に命令が
取込まれる。但し、命令キューA83がフルである場合は
QINPCB87のアドレスに従って命令キューB84に命令が取
り込まれる。命令デコード部112 には有効な命令コード
は出力されない。
CA: Instruction queue A83 / QINPCA86: Valid Instruction queue B84 / QINPCB87: Valid QINPCC88: Valid Priority: QINPCC88> Instruction queue A83> Instruction queue B84 • Instructions are taken into the instruction queue A83 according to the address of QINPCA86. However, if instruction queue A83 is full
The instruction is taken into the instruction queue B84 according to the address of QINPCB87. No valid instruction code is output to the instruction decoding unit 112.

【0295】 CB: 命令キューA83/QINPCA86:有効 命令キューB84/QINPCB87:有効 QINPCC88:有効 優先順位:QINPCC88>命令キューB84>命令キューA83 ・QINPCB87のアドレスに従って命令キューB84に命令が
取込まれる。但し、命令キューB84がフルである場合は
QINPCA86のアドレスに従って命令キューA83に命令が取
り込まれる。命令デコード部112 には有効な命令コード
は出力されない。
CB: Instruction Queue A83 / QINPCA86: Valid Instruction Queue B84 / QINPCB87: Valid QINPCC88: Valid Priority: QINPCC88> Instruction Queue B84> Instruction Queue A83 • Instruction is taken into instruction queue B84 according to the address of QINPCB87. However, if instruction queue B84 is full
The instruction is taken into the instruction queue A83 according to the address of the QINPCA86. No valid instruction code is output to the instruction decoding unit 112.

【0296】図66において矢符は上述の各状態間で発生
し得る遷移の方向を示しており、それぞれの矢符に付さ
れた記号は遷移条件を示している。遷移条件を示す各記
号の意味及び優先順位は以下の如くである。なお、優先
順位「高」の3条件はEステージ135 でそれぞれが排他
的に発生する。優先順位「中」の2条件はAステージ13
3 で排他的に発生する。優先順位「低」の4条件はDス
テージ132 で排他的に発生する。
In FIG. 66, arrows indicate the directions of transitions that can occur between the above-described states, and the symbols attached to the arrows indicate transition conditions. The meanings and priorities of the symbols indicating the transition conditions are as follows. Note that the three conditions of priority "high" are exclusively generated in the E stage 135. Two conditions of priority "medium" are A stage 13
Occurs exclusively at 3. The four conditions of the priority "low" occur exclusively in the D stage 132.

【0297】 優先順位 高 EJ :Eステージジャンプ 〔 EJMPREQ=”1”〕 高 MISS:分岐予測ミス 〔 QEXCHG =”1”〕 高 HIT :分岐予測ヒット 〔 QCANCEL=”1”〕 中 PJA :Aステージ無条件プリジャンプ 〔 AJMPAREQ =”1”& APJMPACK =”1”〕 中 PFT :Aステージ分岐先命令プリフェッチ 〔 APFETREQ =”1”& APJMPACK =”1”〕 低 PJA :Dステージ無条件プリジャンプ 〔DJMPAREQ=”1”& DPJMPACK =”1”〕 低 PJC :Dステージ条件プリジャンプ 〔DJMPCREQ=”1”& DPJMPACK =”1”〕 低 PFT :Dステージ分岐先命令プリフェッチ 〔DPFETREQ=”1”& DPJMPACK =”1”〕 低 PRET:プリリターン 〔DPRETREQ=”1”& DPRETACK =”1”〕 Priority High EJ: E stage jump [EJMPREQ = "1"] High MISS: Branch prediction error [QEXCHG = "1"] High HIT: Branch prediction hit [QCANCEL = "1"] Medium PJA: No A stage Conditional pre-jump [AJMPAREQ = "1" & APJMPACK = "1"] Medium PFT: A-stage branch destination instruction prefetch [APFETREQ = "1" & APJMPACK = "1"] Low PJA: D-stage unconditional pre-jump [DJMPAREQ = "1" & DPJMPACK = "1"] Low PJC: D-stage condition pre-jump [DJMPCREQ = "1" & DPJMPACK = "1"] Low PFT: D-stage branch destination instruction prefetch [DPFETREQ = "1" & DPJMPACK = " 1 "] Low PRET: Prereturn [DPRETREQ =" 1 "& DPRETACK =" 1 "]

【0298】命令キューA83 (QINPCA86), 命令キュー
B84 (QINPCB87) 及びQINPCC88が全て有効である場合に
は、命令フェッチ部111 は条件プリジャンプ及びジャン
プ先命令プリフェッチ要求は受け付けない。状態遷移時
の命令キュー部82での処理について以下に説明する。
When the instruction queue A83 (QINPCA86), the instruction queue B84 (QINPCB87), and the QINPCC88 are all valid, the instruction fetch unit 111 does not accept a conditional pre-jump or a jump destination instruction prefetch request. The processing in the instruction queue unit 82 during the state transition will be described below.

【0299】・処理1(P1) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。命
令キューB84及びQINPCC88を無効化する。
Process 1 (P1) Initializes the input / output pointer of the instruction queue A83. JA bus
208 Take the jump destination address above into QINPCA86. Invalidate the instruction queue B84 and QINPCC88.

【0300】・処理2(P2) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスQINPCA86に取り込む。
Process 2 (P2) The input / output pointer of the instruction queue A83 is initialized. JA bus
Take in the jump destination address QINPCA86 on 208.

【0301】・処理3(P3) 命令キューB84の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCB87に取り込む。命
令キューB84のフェッチの優先度を高くする。命令キュ
ーB84の内容を命令デコード部112 に出力する。
Process 3 (P3) The input / output pointer of the instruction queue B84 is initialized. JA bus
Take the jump destination address on 208 into QINPCB87. The priority of fetching the instruction queue B84 is increased. The contents of the instruction queue B84 are output to the instruction decoding unit 112.

【0302】・処理4(P4) 命令キューB84の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCB87に取り込む。
Process 4 (P4) The input / output pointer of the instruction queue B84 is initialized. JA bus
Take the jump destination address on 208 into QINPCB87.

【0303】・処理5(P5) 命令キューB84を無効化する。命令キューA83の入出力
ポインタを初期化する。JAバス208 上のジャンプ先アド
レスをQINPCA86に取り込む。
Process 5 (P5) Invalidates the instruction queue B84. The input / output pointer of the instruction queue A83 is initialized. The jump destination address on the JA bus 208 is taken into the QINPCA86.

【0304】・処理6(P6) 命令キューB84の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCB87に取り込む。
Process 6 (P6) The input / output pointer of the instruction queue B84 is initialized. JA bus
Take the jump destination address on 208 into QINPCB87.

【0305】・処理7(P7) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。命
令キューA83のフェッチの優先度を高くする。命令キュ
ーA83の内容を命令デコード部112 に出力する。
Process 7 (P7) The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86. The priority of fetching the instruction queue A83 is increased. The contents of the instruction queue A83 are output to the instruction decoding unit 112.

【0306】・処理8(P8) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 8 (P8) The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0307】・処理9(P9) 命令キューB84を無効化する。命令キューA83の入出力
ポインタを初期化する。JAバス208 上のジャンプ先アド
レスをQINPCA86に取り込む。
Process 9 (P9) The instruction queue B84 is invalidated. The input / output pointer of the instruction queue A83 is initialized. The jump destination address on the JA bus 208 is taken into the QINPCA86.

【0308】・処理10(P10) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 10 (P10) The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0309】・処理11(P11) 命令キューB84を無効化する。Process 11 (P11) The instruction queue B84 is invalidated.

【0310】・処理12(P12) 命令キューA83を無効化する。命令キューB84の内容を
命令デコード部112 に出力する。
Process 12 (P12) The instruction queue A83 is invalidated. The contents of the instruction queue B84 are output to the instruction decoding unit 112.

【0311】・処理13(P13) JAバス208 上のジャンプ先アドレスをQINPCC88に取り込
む。命令キューA83から命令デコード部112 への出力を
停止する。
Process 13 (P13) The jump destination address on the JA bus 208 is taken into the QINPCC 88. The output from the instruction queue A83 to the instruction decoding unit 112 is stopped.

【0312】・処理14(P14) JAバス208 上のジャンプ先アドレスをQINPCC88に取り込
む。
Process 14 (P14) The jump destination address on the JA bus 208 is taken into the QINPCC 88.

【0313】・処理15(P15) 命令キューB84を無効化する。命令キューA83の入出力
ポインタを初期化する。JAバス208 上のジャンプ先アド
レスをQINPCA86に取り込む。
Process 15 (P15) The instruction queue B84 is invalidated. The input / output pointer of the instruction queue A83 is initialized. The jump destination address on the JA bus 208 is taken into the QINPCA86.

【0314】・処理16(P16) 命令キューB84の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCB87に取り込む。
Process 16 (P16) The input / output pointer of the instruction queue B84 is initialized. JA bus
Take the jump destination address on 208 into QINPCB87.

【0315】・処理17(P17) 命令キューA83を無効化する。Process 17 (P17) The instruction queue A83 is invalidated.

【0316】・処理18(P18) 命令キューB84を無効化する命令キューA83の内容を命
令デコード部112 に出力する。
Process 18 (P18) The contents of the instruction queue A83 for invalidating the instruction queue B84 are output to the instruction decoding unit 112.

【0317】・処理19(P19) JAバス208 上のジャンプ先アドレスをQINPCC88に取り込
む。命令キューB84から命令デコード部112 への出力を
停止する。
Process 19 (P19) The jump destination address on the JA bus 208 is taken into the QINPCC 88. The output from the instruction queue B84 to the instruction decoding unit 112 is stopped.

【0318】・処理20(P20) JAバス208 上のジャンプ先アドレスをQINPCC88に取り込
む。
Process 20 (P20) The jump destination address on the JA bus 208 is taken into the QINPCC 88.

【0319】・処理21(P21) 命令キューB84を無効化する。QINPCC88を無効化する。
命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 21 (P21) Invalidates the instruction queue B84. Disable QINPCC88.
The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0320】・処理22(P22) 命令キューB84を無効化する。QINPCC88の値をQINPCB87
へ転送する。QINPCC88を無効化する。命令キューB84の
内容を命令デコード部112 に出力する。命令キューB84
のフェッチの優先度を高くする。
Process 22 (P22) Invalidates the instruction queue B84. Change the value of QINPCC88 to QINPCB87
Transfer to Disable QINPCC88. The contents of the instruction queue B84 are output to the instruction decoding unit 112. Instruction queue B84
Fetch priority.

【0321】・処理23(P23) 命令キューA83を無効化する。QINPCC88を無効化する。
命令キューB84の内容を命令デコード部112 に出力す
る。
Process 23 (P23) The instruction queue A83 is invalidated. Disable QINPCC88.
The contents of the instruction queue B84 are output to the instruction decoding unit 112.

【0322】・処理24(P24) 命令キューB84を無効化する。QINPCC88を無効化する。
命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 24 (P24) The instruction queue B84 is invalidated. Disable QINPCC88.
The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0323】・処理25(P25) 命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 25 (P25) The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0324】・処理26(P26) 命令キューB84を無効化する。QINPCC88の値をQINPCB87
へ転送する。QINPCC88を無効化する。
Process 26 (P26) The instruction queue B84 is invalidated. Change the value of QINPCC88 to QINPCB87
Transfer to Disable QINPCC88.

【0325】・処理27(P27) 命令キューA83を無効化する。QINPCC88を無効化する。
命令キューB84の内容を命令デコード部112 に出力す
る。
Process 27 (P27) The instruction queue A83 is invalidated. Disable QINPCC88.
The contents of the instruction queue B84 are output to the instruction decoding unit 112.

【0326】・処理28(P28) 命令キューB84を無効化するQINPCC88を無効化する。命
令キューA83の入出力ポインタを初期化する。JAバス20
8 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 28 (P28) The QINPCC 88 that invalidates the instruction queue B84 is invalidated. The input / output pointer of the instruction queue A83 is initialized. JA bus 20
8 Take the upper jump destination address into QINPCA86.

【0327】・処理29(P29) 命令キューA83を無効する。QINPCC88の値をQINPCA86へ
転送する。QINPCC88を無効化する。命令キューA83の内
容を命令デコード部112 に出力する。命令キューA83の
フェッチの優先度を高くする。
Process 29 (P29) The instruction queue A83 is invalidated. Transfer the value of QINPCC88 to QINPCA86. Disable QINPCC88. The contents of the instruction queue A83 are output to the instruction decoding unit 112. The priority of fetching the instruction queue A83 is increased.

【0328】・処理30(P30) 命令キューB84を無効化する。QINPCC88を無効化する。
命令キューA83の内容を命令デコード部112 に出力す
る。
Process 30 (P30) Invalidates the instruction queue B84. Disable QINPCC88.
The contents of the instruction queue A83 are output to the instruction decoding unit 112.

【0329】・処理31(P31) 命令キューB84を無効化する。QINPCC88を無効化する。
命令キューA83の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCA86に取り込む。
Process 31 (P31) Invalidates the instruction queue B84. Disable QINPCC88.
The input / output pointer of the instruction queue A83 is initialized. JA bus
208 Take the jump destination address above into QINPCA86.

【0330】・処理32(P32) 命令キューB84の入出力ポインタを初期化する。JAバス
208 上のジャンプ先アドレスをQINPCB87に取り込む。
Process 32 (P32) The input / output pointer of the instruction queue B84 is initialized. JA bus
Take the jump destination address on 208 into QINPCB87.

【0331】・処理33(P33) 命令キューA83を無効化する。QINPCC88の値をQINPCA86
へ転送する。QINPCC88を無効化する。
Process 33 (P33) Invalidates the instruction queue A83. Change the value of QINPCC88 to QINPCA86
Transfer to Disable QINPCC88.

【0332】・処理34(P34) 命令キューB84を無効化する。QINPCC88を無効化する。
命令キューA83の内容を命令デコード部112 に出力す
る。
Process 34 (P34) Invalidates the instruction queue B84. Disable QINPCC88.
The contents of the instruction queue A83 are output to the instruction decoding unit 112.

【0333】条件プリジャンプ, 無条件プリジャンプ
時、あるいはEステージジャンプ時においてジャンプ要
求受け付け直後にジャンプ先命令のプリフェッチを行う
場合には、JAバス208 上のアドレスが直接命令用MMU/キ
ャッシュ部81へ転送される。またこの場合、JAバス208
上のアドレスがインクリメンタに入力されてインクリメ
ントされる。
When prefetching a jump destination instruction immediately after a jump request is accepted in a conditional prejump, unconditional prejump, or E stage jump, the address on the JA bus 208 is directly set to the instruction MMU / cache unit 81. Transferred to Also in this case, JA bus 208
The above address is input to the incrementer and is incremented.

【0334】また、分岐予測がヒットしてQINPCC88に退
避されているアドレスの命令のフェッチを QCANCEL信号
312 を受け付けた直後に開始する場合には、QINPCC88か
らアドレスが PFAバス91へ直接出力される。
Also, the fetch of the instruction at the address saved in the QINPCC88 due to the hit of the branch prediction is performed using the QCANCEL signal.
When starting immediately after receiving 312, the address is directly output from the QINPCC 88 to the PFA bus 91.

【0335】なお、上述の図66に示されているような命
令キュー部82の複雑な状態制御及び転送, 演算, フェッ
チ制御は、命令フェッチ部111 に備えられている制御部
(図示せず) により行われる。
The complicated state control and transfer, operation, and fetch control of the instruction queue unit 82 as shown in FIG. 66 are performed by the control unit provided in the instruction fetch unit 111.
(Not shown).

【0336】(7) 「各ジャンプ命令の処理方法」 各ジャンプ命令について、それぞれの処理方法を以下に
詳しく説明する。
(7) "Processing Method of Each Jump Instruction" The processing method of each jump instruction will be described in detail below.

【0337】(7.1) 「 BRA命令」 BRA命令の命令フォーマットは図31, 図32に示されてい
るが、この命令は1サイクルでデコードされる。図50の
模式図に BRA命令処理時のIIバス204 上の分岐変位位置
を示す。図50(a) はDフォーマットの場合を、図50(b)
〜図50(d) はGフォーマットの分岐変位がそれぞれ8ビ
ット, 16ビット, 32ビットの場合をそれぞれ示してい
る。これらと図48とを比較すれば明らかなように、全て
の場合について命令デコード時に分岐先アドレスの計算
が可能である。
(7.1) "BRA Instruction" The instruction format of the BRA instruction is shown in FIGS. 31 and 32. This instruction is decoded in one cycle. The schematic diagram of FIG. 50 shows the branch displacement position on the II bus 204 during the processing of the BRA instruction. FIG. 50 (a) shows the case of the D format, and FIG. 50 (b)
FIG. 50 (d) shows the case where the G format branch displacements are 8 bits, 16 bits and 32 bits, respectively. As is clear from a comparison of these with FIG. 48, the branch destination address can be calculated at the time of instruction decoding in all cases.

【0338】BRA命令処理時のタイミングを図54のタイ
ミングチャートに示す。図54(b) に示されているよう
に、Dステージ132 ではC1サイクルにおいて命令デコ
ード部112 が BRA命令のデコードを行うと共に、分岐先
アドレス計算部1が分岐先アドレスの計算を行う。Dフ
ォーマットの場合には第1加算器5で、Gフォーマット
で変位サイズが8ビットの場合には第2加算器6で、G
フォーマットで変位サイズが16ビットの場合には第3加
算器7で、Gフォーマットで変位サイズが32ビットの場
合には第4加算器8でそれぞれ分岐先アドレスが計算さ
れる。
The timing at the time of processing the BRA instruction is shown in the timing chart of FIG. As shown in FIG. 54 (b), in the D stage 132, the instruction decoding unit 112 decodes the BRA instruction in the C1 cycle, and the branch destination address calculation unit 1 calculates the branch destination address. The first adder 5 in the case of the D format, and the second adder 6 in the case of the displacement size of 8 bits in the G format,
When the displacement size is 16 bits in the format, the third adder 7 calculates the branch destination address in the G format and when the displacement size is 32 bits, the fourth adder 8 calculates the branch destination address.

【0339】デコードされた命令が BRA命令であるた
め、C1サイクルにおいてDステージ無条件ジャンプ処
理が行われる。分岐先アドレスが奇数であった場合ある
いはデバッグ事象検出モードである場合は BRA命令に対
するDコード141 及びAコード142 は出力されるが、そ
うでない場合には BRA命令の処理はDステージ132 で終
了し、Dコード141 もAコード142 も出力されない。図
54(a) に示されているように、C2サイクルにおいてIF
ステージ131 で分岐先の命令フェッチが行われ、キャッ
シュヒット時には、図54(b) に示されているように、C
3サイクルにおいて分岐先の命令のデコードが開始され
る。即ち、キャッシュヒット時には2サイクルで BRA命
令の処理を終了する。
Since the decoded instruction is a BRA instruction, the D stage unconditional jump processing is performed in the C1 cycle. When the branch destination address is an odd number or in the debug event detection mode, the D code 141 and the A code 142 for the BRA instruction are output, but otherwise, the processing of the BRA instruction ends at the D stage 132. , D code 141 and A code 142 are not output. Figure
As shown in Fig. 54 (a), IF in C2 cycle
At the stage 131, the instruction fetch of the branch destination is performed, and at the time of a cache hit, as shown in FIG.
Decoding of the instruction at the branch destination is started in three cycles. That is, at the time of a cache hit, the processing of the BRA instruction is completed in two cycles.

【0340】奇数アドレスジャンプが検出された場合に
は、各パイプラインステージは何の処理も行わないダミ
ーのステップコードを出力し、そのステップコードで奇
数アドレスへのジャンプが行われた情報を転送すること
により、奇数アドレスジャンプトラップの処理を起動す
る。
When an odd address jump is detected, each pipeline stage outputs a dummy step code that does not perform any processing, and transfers information in which a jump to an odd address is performed by the step code. This starts the odd address jump trap process.

【0341】(7.2) 「 BSR命令」 BSR命令の命令フォーマットは図35, 図36に示されてい
るが、この命令は1サイクルでデコードされる。 BSR命
令処理時のIIバス204 上の分岐変位位置は BRA命令と同
一であり、図50に示されている。 BSR命令でも BRA命令
の場合と同様に全ての場合について命令デコード時に分
岐先アドレスの計算が可能である。
(7.2) “BSR Instruction” The instruction format of the BSR instruction is shown in FIGS. 35 and 36, but this instruction is decoded in one cycle. The position of the branch displacement on the II bus 204 during the processing of the BSR instruction is the same as that of the BRA instruction, and is shown in FIG. As with the BRA instruction, the BSR instruction can calculate the branch destination address at the time of instruction decoding in all cases.

【0342】BSR命令処理時のタイミングを図55のタイ
ミングチャートに示す。図55(b) に示されているよう
に、Dステージ132 ではC1サイクルにおいて命令デコ
ード部112 が BSR命令のデコードを行うと共に、分岐先
アドレス計算部1が分岐先アドレスの計算を行う。
The timing at the time of processing the BSR instruction is shown in the timing chart of FIG. As shown in FIG. 55 (b), in the D stage 132, in the C1 cycle, the instruction decoding unit 112 decodes the BSR instruction, and the branch destination address calculation unit 1 calculates the branch destination address.

【0343】デコードされた命令が BSR命令であるた
め、C1サイクルにおいてDステージ無条件ジャンプ処
理が行われる。図55(a) に示されているように、C2サ
イクルにおいて分岐先の命令フェッチが行われる。この
際、Aステージ133 ではサブルーチンからの戻り先アド
レスの計算が行われる。この処理はPC計算部2内のATPC
28の値をIXバス206 及びアドレス加算器61を介して転送
することにより行われる。図55(e) に示されているよう
に、C4サイクルにおいて戻り先アドレスの値がPCスタ
ック201 に登録される。図55(f) に示されているよう
に、C5サイクルにおいて戻り先アドレスのキャッシュ
及びメモリへの書き込みが行われる。メモリへの書き込
みは、最低2クロックサイクル必要である。
Since the decoded instruction is a BSR instruction, the D stage unconditional jump processing is performed in the C1 cycle. As shown in FIG. 55 (a), the instruction fetch of the branch destination is performed in the C2 cycle. At this time, in the A stage 133, the return address from the subroutine is calculated. This processing is performed by the ATPC in the PC calculation unit 2.
This is performed by transferring the value of 28 via the IX bus 206 and the address adder 61. As shown in FIG. 55 (e), the value of the return address is registered in the PC stack 201 in the C4 cycle. As shown in FIG. 55 (f), the return address is written to the cache and the memory in the cycle C5. Writing to the memory requires at least two clock cycles.

【0344】キャッシュヒット時には、図55(b) に示さ
れているように、C3サイクルにおいて分岐先の命令の
デコードを開始することができる。従って、キャッシュ
ヒット時には2サイクルで BSR命令の処理を終了する。
At the time of a cache hit, as shown in FIG. 55B, the decoding of the instruction at the branch destination can be started in the C3 cycle. Therefore, at the time of a cache hit, the processing of the BSR instruction is completed in two cycles.

【0345】奇数アドレスジャンプが検出された場合に
は、ステップコードで奇数アドレスへのジャンプが行わ
れたことを示す情報を転送することにより、 BSR命令の
処理終了後、奇数アドレスジャンプトラップの処理を起
動する。
When an odd address jump is detected, the information indicating that the jump to the odd address has been performed is transferred by the step code, so that the odd address jump trap processing is performed after the BSR instruction processing is completed. to start.

【0346】(7.3) 「 Bcc命令」 Bcc命令の命令フォーマットは図33, 図34に示されてい
るが、この命令は1サイクルでデコードされる。 Bcc命
令処理時のIIバス204 上の分岐変位位置は BRA命令と同
一であり、図50に示されている。 Bcc命令でも BRA命令
の場合と同様に全ての場合について命令デコード時に分
岐先アドレスの計算が可能である。
(7.3) “Bcc Instruction” The instruction format of the Bcc instruction is shown in FIGS. 33 and 34. This instruction is decoded in one cycle. The position of the branch displacement on the II bus 204 during the processing of the Bcc instruction is the same as that of the BRA instruction, and is shown in FIG. Even in the case of the Bcc instruction, the branch destination address can be calculated at the time of instruction decoding in all cases as in the case of the BRA instruction.

【0347】Bcc命令処理時のタイミングを図56(A),
(B)のタイミングチャートに示す。C1サイクルにおい
て命令デコード部112 は DPC29のアドレスに従って分岐
履歴テーブルの検索を行い、次にデコードされる Bcc命
令の分岐予測を行う。C1サイクルの前半では DPC29に
は Bcc命令の直前のアドレスが格納されている。即ち、
Bcc命令の分岐予測は Bcc命令の直前の命令のアドレス
で行われる。この処理は、命令をデコードする前に行う
ため、デコードサイクルの都度行われており、次の命令
が Bcc命令である場合にのみ有効な情報が出力される。
Bcc命令に関しては整数演算部117 内の制御レジスタに
より分岐しないと静的に予測するように設定することも
可能である。分岐予測を行わない場合には、分岐履歴テ
ーブルから読み出された値にはよらずに強制的に分岐予
測結果を分岐しないことを示す値にする。
The timing at the time of processing the Bcc instruction is shown in FIG.
This is shown in the timing chart of FIG. In the C1 cycle, the instruction decoding unit 112 searches the branch history table according to the address of the DPC 29, and predicts the branch of the next Bcc instruction to be decoded. In the first half of the C1 cycle, the address immediately before the Bcc instruction is stored in the DPC 29. That is,
Bcc instruction branch prediction is performed at the address of the instruction immediately before the Bcc instruction. Since this processing is performed before decoding the instruction, it is performed every decoding cycle, and valid information is output only when the next instruction is a Bcc instruction.
The Bcc instruction can be set so as to be statically predicted not to branch by the control register in the integer operation unit 117. When the branch prediction is not performed, the branch prediction result is forcibly set to a value indicating that the branch prediction is not performed regardless of the value read from the branch history table.

【0348】図56(A) は、分岐しないと予測された場合
のタイミングチャートである。図56(A)(b)に示されてい
るように、C2サイクルにおいて命令デコード部112 は
Bcc命令のデコードを行うと共に、分岐先アドレス計算
部1は分岐先アドレスの計算を行う。分岐しないと予測
された場合には図56(A)(b)に示されているように、C2
サイクルにおいてDステージ分岐先命令プリフェッチ処
理が行われる。図56(A)(c)に示されているように、C3
サイクルにおいてAステージ133 では Bcc命令の分岐先
アドレスが計算される。C5サイクルにおいて分岐条件
の判定が行われ、分岐予測が的中しており分岐しなかっ
た場合には、命令フェッチ部111 は分岐先のシーケンス
側の命令キューの無効化を行う。この場合、1サイクル
で Bcc命令の処理が終了する。分岐予測が外れていた場
合には、命令フェッチ部111 は条件分岐命令に引き続く
シーケンス側の命令キューが無効化され、処理シーケン
スの切り替えが行われる。また、分岐履歴テーブルの更
新処理も行われる。C5サイクルにおいてステップPC転
送部3の OLDPC36には Bcc命令の直前に実行された命令
のアドレスが格納されており、その値で分岐履歴テーブ
ルの更新が行われる。C5サイクルにおいて命令キュー
に既に分岐先の命令がフェッチされていた場合には、 B
cc命令の処理に見かけ上4サイクルが費やされたことに
なる。
FIG. 56 (A) is a timing chart in the case where it is predicted that no branch will occur. As shown in FIGS. 56A and 56B, in the C2 cycle, the instruction decode unit 112
In addition to decoding the Bcc instruction, the branch destination address calculator 1 calculates a branch destination address. When it is predicted that the branch will not be taken, as shown in FIGS.
In a cycle, a D stage branch destination instruction prefetch process is performed. As shown in FIGS. 56A and 56C, C3
At the A stage 133 in the cycle, the branch destination address of the Bcc instruction is calculated. When the branch condition is determined in the C5 cycle and the branch prediction is correct and the branch is not taken, the instruction fetch unit 111 invalidates the instruction queue on the sequence side of the branch destination. In this case, the processing of the Bcc instruction is completed in one cycle. If the branch prediction is incorrect, the instruction fetch unit 111 invalidates the instruction queue on the sequence side following the conditional branch instruction, and switches the processing sequence. Further, an update process of the branch history table is also performed. In the C5 cycle, the address of the instruction executed immediately before the Bcc instruction is stored in the OLDPC 36 of the step PC transfer unit 3, and the branch history table is updated with that value. If the instruction at the branch destination has already been fetched into the instruction queue in the C5 cycle, B
Apparently, four cycles have been spent processing the cc instruction.

【0349】図56(B) は、分岐すると予測された場合の
タイミングチャートである。図56(B)(b)に示されている
ように、C2サイクルにおいて命令デコード部112 は B
cc命令のデコードを行うと共に、分岐先アドレス計算部
1は分岐先アドレスの計算を行う。分岐すると予測され
た場合にはC2サイクルにおいてDステージ条件ジャン
プ処理が行われる。図56(A)(c)に示されているように、
C3サイクルにおいてAステージ133 ではそのサイクル
の開始時にATPC28に保持されているアドレスを転送する
ことにより Bcc命令の次の命令のPC値が計算される。C
5サイクルにおいて分岐条件の判定が行われ、分岐予測
が的中していた場合には命令フェッチ部111 は条件分岐
命令に引き続くシーケンス側の命令キューを無効化す
る。この場合、キャッシュヒット時には2サイクルで B
cc命令の処理が終了する。分岐予測が外れて Bcc命令に
引き続く命令の処理を行わなければならない場合には、
命令フェッチ部111 は分岐先のシーケンス側の命令キュ
ーを無効化し、処理シーケンスの切り替えを行う。ま
た、分岐履歴テーブルの更新処理も行われる。更新処理
は、分岐しないと予測して分岐が発生した場合と同様で
ある。C5サイクルにおいて命令キューに既に Bcc命令
に引き続く命令が取り込まれていた場合には、 Bcc命令
の処理に見かけ上は4サイクルが費やされたことにな
る。
FIG. 56B is a timing chart in the case where a branch is predicted. As shown in FIGS. 56 (B) and (b), in the C2 cycle, the instruction
In addition to decoding the cc instruction, the branch destination address calculation unit 1 calculates the branch destination address. If the branch is predicted, a D stage condition jump process is performed in the C2 cycle. As shown in FIGS.56 (A) (c),
In the A stage 133 in the C3 cycle, the PC value of the instruction following the Bcc instruction is calculated by transferring the address held in the ATPC 28 at the start of the cycle. C
The branch condition is determined in five cycles, and if the branch prediction is correct, the instruction fetch unit 111 invalidates the instruction queue on the sequence side following the conditional branch instruction. In this case, at the time of a cache hit, B
The processing of the cc instruction ends. If the branch prediction is missed and the instruction following the Bcc instruction must be processed,
The instruction fetch unit 111 invalidates the instruction queue of the sequence at the branch destination and switches the processing sequence. Further, an update process of the branch history table is also performed. The update process is the same as the case where a branch is generated by predicting that a branch will not be taken. If the instruction following the Bcc instruction has already been fetched into the instruction queue in the C5 cycle, apparently four cycles have been spent processing the Bcc instruction.

【0350】分岐先アドレスが奇数であり、且つ実際に
分岐が発生した場合にのみ、 Bcc命令の処理終了後、奇
数アドレスジャンプトラップの処理が起動される。
Only when the branch destination address is an odd number and a branch actually occurs, the odd address jump trap processing is started after the processing of the Bcc instruction is completed.

【0351】(7.4) 「 JMP命令」 JMP命令は図37に示したように、ジャンプ先アドレスを
一般形アドレッシングモードで指定可能であるが、アド
レッシングモードによって先行ジャンプ処理を行うタイ
ミングが異なる。
(7.4) “JMP Instruction” As shown in FIG. 37, the JMP instruction can specify the jump destination address in the general addressing mode, but the timing of performing the preceding jump processing differs depending on the addressing mode.

【0352】まず、アドレッシングモードがPC相対間接
モードあるいは絶対モードである場合について説明す
る。図51の模式図に JMP命令処理時のIIバス204 上の分
岐変位及び絶対番地の指定位置を示す。図51(a) 及び図
51(b) はそれぞれPC相対間接モードで分岐変位が16ビッ
トである場合と32ビットである場合とを示し、図51(c)
及び図51(d) はそれぞれ絶対モードでアドレスが16ビッ
トで指定される場合と32ビットで指定される場合とを示
す。これらを図48と比較して明らかなように、これらの
場合は命令デコード時に分岐先アドレスの計算が可能で
ある。
First, the case where the addressing mode is the PC relative indirect mode or the absolute mode will be described. The schematic diagram of FIG. 51 shows the branch displacement on the II bus 204 and the designated position of the absolute address during JMP instruction processing. Figure 51 (a) and figure
51 (b) shows a case where the branch displacement is 16 bits and a case where the branch displacement is 32 bits in the PC relative indirect mode, respectively, and FIG.
FIG. 51 (d) shows a case where the address is specified by 16 bits and a case where the address is specified by 32 bits in the absolute mode. As is apparent from comparison with FIG. 48, in these cases, the branch destination address can be calculated at the time of instruction decoding.

【0353】ジャンプ先アドレスがPC相対間接モードあ
るいは絶対モードで示される場合には、 JMP命令処理時
のタイミング図は図54に示されている BRA命令の処理タ
イミングとまったく同一であり、図54中の BRA命令をJM
P 命令に置換すればよい。Dステージ132 ではC1サイ
クルにおいて命令デコード部112 が JMP命令のデコード
を行うと共に、分岐先アドレス計算部1がジャンプ先ア
ドレスの計算を行う。PC相対間接モードで分岐変位が16
ビットである場合には第3加算器7で、分岐変位が32ビ
ットである場合には第4加算器8でそれぞれジャンプ先
アドレスが計算される。絶対モードで16ビットである場
合はジャンプ先アドレスが出力ラッチ21に、32ビットで
ある場合は出力ラッチ22にそれぞれ32ビットのアドレス
として保持される。
When the jump destination address is indicated in the PC relative indirect mode or the absolute mode, the timing chart at the time of processing the JMP instruction is exactly the same as the processing timing of the BRA instruction shown in FIG. BRA instruction of JM
Just replace it with a P instruction. In the D stage 132, the instruction decoding unit 112 decodes the JMP instruction in the C1 cycle, and the branch destination address calculation unit 1 calculates the jump destination address. Branch displacement is 16 in PC relative indirect mode
If it is a bit, the third adder 7 calculates the jump destination address, and if the branch displacement is 32 bits, the fourth adder 8 calculates the jump destination address. When the absolute mode is 16 bits, the jump destination address is held in the output latch 21, and when the mode is 32 bits, the output latch 22 is held in the output latch 22 as a 32-bit address.

【0354】これらの場合、C1サイクルにおいてDス
テージ無条件ジャンプ処理が行われる。処理方法は BRA
命令の場合とまったく同様である。ジャンプ先アドレス
が奇数であった場合あるいはデバッグ事象検出モードで
は JMP命令に対するDコード141 とAコード142 とは出
力されるが、そうでない場合には JMP命令の処理はDス
テージ132 で終了し、Dコード141 もAコード142 も出
力されない。キャッシュヒット時には2サイクルで JMP
命令の処理が終了する。
In these cases, the D stage unconditional jump processing is performed in the C1 cycle. Processing method is BRA
Exactly the same as for instructions. When the jump destination address is an odd number or in the debug event detection mode, the D code 141 and the A code 142 for the JMP instruction are output, but otherwise, the processing of the JMP instruction ends at the D stage 132, and Neither code 141 nor A code 142 is output. JMP in 2 cycles when cache hit
The processing of the instruction ends.

【0355】次に、アドレッシングモードがPC相対間接
モードあるいは絶対モード以外のモードで指定された場
合について説明する。この場合は、ジャンプ先アドレス
は分岐先アドレス計算部1では計算できない。従って、
この場合はAステージ無条件プリジャンプ処理が行われ
る。
Next, a case where the addressing mode is specified in a mode other than the PC relative indirect mode or the absolute mode will be described. In this case, the jump destination address cannot be calculated by the branch destination address calculation unit 1. Therefore,
In this case, the A stage unconditional pre-jump processing is performed.

【0356】ジャンプ先アドレスがPC相対間接モードま
たは絶対モード以外のモードで指定された JMP命令処理
時のタイミングチャートを図57に示す。
FIG. 57 shows a timing chart at the time of processing a JMP instruction in which a jump destination address is specified in a mode other than the PC relative indirect mode or the absolute mode.

【0357】図57(b) に示されているように、Dステー
ジ132 ではC1サイクルにおいて命令デコード部112 が
JMP命令のデコードを行う。図57(c) に示されているよ
うに、C2サイクルにおいてジャンプ先アドレスの計算
が行われ、Aステージ無条件プリジャンプ処理が行われ
る。ジャンプ先アドレスが奇数であった場合またはデバ
ッグ事象検出モードである場合は JMP命令に対するRコ
ード143 とFコード144 とは出力されるが、そうでない
場合には JMP命令の処理はAステージ133 で終了し、R
コード143 もFコード144 も出力されない。図57(a) に
示されているように、C3サイクルにおいてIFステージ
131 で分岐先の命令フェッチが行われ、キャッシュヒッ
ト時には、図57(b) に示されているように、C4サイク
ルにおいて分岐先の命令のデコードが開始される。即
ち、キャッシュヒット時には3サイクルで JMP命令の処
理が終了する。ジャンプ先アドレスが多段間接モードで
指定されている場合にはジャンプ先アドレスの計算が終
了するサイクルにおいてAステージ無条件ジャンプ処理
が行われるので、 JMP命令の処理時間は長くなる。
As shown in FIG. 57 (b), in the D stage 132, the instruction decoding unit 112
Performs JMP instruction decoding. As shown in FIG. 57 (c), the jump destination address is calculated in the C2 cycle, and the A stage unconditional pre-jump processing is performed. When the jump destination address is an odd number or in the debug event detection mode, the R code 143 and the F code 144 for the JMP instruction are output, but otherwise, the processing of the JMP instruction ends at the A stage 133. Then R
Neither code 143 nor F code 144 is output. As shown in FIG. 57 (a), in the C3 cycle, the IF stage
At step 131, the branch destination instruction is fetched. At the time of a cache hit, decoding of the branch destination instruction is started in the C4 cycle as shown in FIG. 57 (b). That is, when a cache hit occurs, the processing of the JMP instruction is completed in three cycles. If the jump destination address is specified in the multi-stage indirect mode, the A stage unconditional jump processing is performed in the cycle in which the calculation of the jump destination address ends, so that the processing time of the JMP instruction becomes longer.

【0358】奇数アドレスジャンプが検出された場合に
は、各パイプラインステージで何の処理も行わないダミ
ーのステップコードが出力され、そのステップコードで
奇数アドレスへのジャンプが行われたことを示す情報を
転送することにより、奇数アドレスジャンプトラップの
処理が起動される。
When an odd address jump is detected, a dummy step code that does not perform any processing in each pipeline stage is output, and information indicating that a jump to an odd address has been performed by the step code. , The processing of the odd address jump trap is started.

【0359】(7.5) 「 JSR命令」 JMP命令と同様に、 JSR命令もジャンプ先アドレスを一
般形アドレッシングモードで指定可能であり、アドレッ
シングモードによって先行ジャンプ処理を行うタイミン
グが異なる。
(7.5) "JSR Instruction" Like the JMP instruction, the JSR instruction can specify the jump destination address in the general addressing mode, and the timing of performing the preceding jump processing differs depending on the addressing mode.

【0360】まず、アドレッシングモードがPC相対間接
モードあるいは絶対モードである場合について説明す
る。これらの場合には、 JMP命令と同様に、命令デコー
ド時に分岐先アドレスの計算が可能である。
First, the case where the addressing mode is the PC relative indirect mode or the absolute mode will be described. In these cases, the branch destination address can be calculated at the time of instruction decoding, similarly to the JMP instruction.

【0361】ジャンプ先アドレスがPC相対間接モードあ
るいは絶対モードで示される場合には、 JMP命令処理時
のタイミングは図54に示されている BSR命令の処理タイ
ミングとまったく同一であり、図54中の BRA命令をJMP
命令に置換すればよい。
When the jump destination address is indicated in the PC relative indirect mode or the absolute mode, the timing at the time of processing the JMP instruction is exactly the same as the processing timing of the BSR instruction shown in FIG. JMP BRA instruction
Just replace it with the instruction.

【0362】Dステージ132 ではC1サイクルにおいて
命令デコード部112 が JMP命令のデコードを行うと共
に、分岐先アドレス計算部1がジャンプ先アドレスの計
算を行う。PC相対間接モードで分岐変位が16ビットであ
る場合には第3加算器7で、分岐変位が32ビットである
場合には第4加算器8でそれぞれジャンプ先アドレスが
計算される。絶対モードで16ビットである場合はジャン
プ先アドレスが出力ラッチ21に、32ビットである場合は
出力ラッチ22にそれぞれ32ビットのアドレスとして保持
される。
In the D stage 132, the instruction decode unit 112 decodes the JMP instruction in the C1 cycle, and the branch destination address calculation unit 1 calculates the jump destination address. When the branch displacement is 16 bits in the PC relative indirect mode, the third adder 7 calculates the jump destination address, and when the branch displacement is 32 bits, the fourth adder 8 calculates the jump destination address. When the absolute mode is 16 bits, the jump destination address is held in the output latch 21, and when the mode is 32 bits, the output latch 22 is held in the output latch 22 as a 32-bit address.

【0363】C1サイクルにおいてDステージ無条件ジ
ャンプ処理が行われる。C2サイクルにおいて分岐先の
命令フェッチが行われる。この際、Aステージ133 では
サブルーチンからの戻り先アドレスが計算される。以後
の処理も BSR命令の場合とまったく同様である。キャッ
シュヒット時には2サイクルで JSR命令の処理が終了す
る。
In the C1 cycle, the D stage unconditional jump processing is performed. In the C2 cycle, the instruction fetch of the branch destination is performed. At this time, the return address from the subroutine is calculated in the A stage 133. The subsequent processing is exactly the same as for the BSR instruction. At the time of a cache hit, processing of the JSR instruction is completed in two cycles.

【0364】次に、アドレッシングモードがPC相対間接
モードあるいは絶対モード以外のモードで指定された場
合について説明する。この場合は、ジャンプ先アドレス
は分岐先アドレス計算部1では計算できない。従って、
この場合はAステージ無条件プリジャンプ処理が行われ
る。また、この場合、Aステージ133 までは2つのステ
ップコードに分解されて処理され、Aステージ133 で1
つのステップコードにマージされて出力される。
Next, the case where the addressing mode is specified in a mode other than the PC relative indirect mode or the absolute mode will be described. In this case, the jump destination address cannot be calculated by the branch destination address calculation unit 1. Therefore,
In this case, the A stage unconditional pre-jump processing is performed. In this case, up to the A stage 133, it is decomposed into two step codes and processed.
It is merged into two step codes and output.

【0365】ジャンプ先アドレスがPC相対間接モードま
たは絶対モード以外のモードで指定された JSR命令処理
時のタイミングチャートを図58に示す。
FIG. 58 shows a timing chart at the time of processing a JSR instruction in which the jump destination address is specified in a mode other than the PC relative indirect mode or the absolute mode.

【0366】図58(b) に示されているように、Dステー
ジ132 ではC1サイクルにおいて命令デコード部112 が
JSR命令のデコードを行う。図58(c) に示されているよ
うに、C2サイクルにおいてジャンプ先アドレスの計算
が行われ、Aステージ無条件プリジャンプ処理が行われ
る。C2サイクルにおいてはRコード143 とFコード14
4 の出力は行われない。Dステージ132 でC2サイクル
において戻り先アドレスの計算を行うための制御信号が
生成される。図58(c) に示されているように、Aステー
ジ133 でC3サイクルにおいてサブルーチンからの戻り
先アドレスの計算が行われ、Rコード143 とFコード14
4 とが出力される。C2サイクルにおいて奇数アドレス
ジャンプが検出された場合には、その情報がC3サイク
ルにおいて出力されるRコード143 に反映される。以後
の処理は BSR命令の場合とまったく同一である。
As shown in FIG. 58 (b), in the D stage 132, the instruction decoding unit 112
Perform JSR instruction decoding. As shown in FIG. 58 (c), the jump destination address is calculated in the C2 cycle, and the A stage unconditional pre-jump processing is performed. In the C2 cycle, R code 143 and F code 14
No output of 4 is done. In the D stage 132, a control signal for calculating the return address in the C2 cycle is generated. As shown in FIG. 58 (c), in the A stage 133, the return address from the subroutine is calculated in the C3 cycle, and the R code 143 and the F code 14 are calculated.
4 is output. When an odd address jump is detected in the C2 cycle, the information is reflected on the R code 143 output in the C3 cycle. The subsequent processing is exactly the same as for the BSR instruction.

【0367】図58(a) に示されているように、C3サイ
クルにおいてIFステージ131 で分岐先の命令フェッチが
行われ、キャッシュヒット時には図58(b) に示されてい
るように、C4サイクルにおいて分岐先の命令のデコー
ドが開始される。即ち、キャッシュヒット時には3サイ
クルで JSR命令の処理が終了する。ジャンプ先アドレス
が多段間接モードで指定されている場合には、ジャンプ
先アドレスの計算が終了するサイクルにおいてAステー
ジ無条件ジャンプ処理が行われるため、 JSR命令の処理
時間は長くなる。
As shown in FIG. 58 (a), the instruction fetch of the branch destination is performed in the IF stage 131 in the C3 cycle, and at the time of a cache hit, as shown in FIG. Starts decoding the instruction at the branch destination. That is, at the time of a cache hit, the processing of the JSR instruction ends in three cycles. When the jump destination address is specified in the multi-stage indirect mode, the A-stage unconditional jump processing is performed in the cycle where the calculation of the jump destination address is completed, so that the processing time of the JSR instruction becomes longer.

【0368】奇数アドレスジャンプが検出された場合に
は、ステップコードで奇数アドレスへのジャンプが行わ
れたことを示す情報を転送することにより、 JSR命令の
処理終了後、奇数アドレスジャンプトラップの処理が起
動される。
When an odd address jump is detected, the information indicating that the jump to the odd address has been performed by the step code is transferred, so that after the processing of the JSR instruction is completed, the processing of the odd address jump trap is performed. Is activated.

【0369】(7.6) 「ACB, SCB命令」 ACB命令及び SCB命令はループ制御のプリミティブとし
て用いられるため、これらの命令では静的に分岐すると
予測してDステージ条件プリジャンプ処理が行われる。
ACB, SCB命令では、図39〜図46に示されているように多
くのフォーマットを有するが、大きく分けて短縮形
(Q, Rフォーマット)と、一般形(G, Eフォーマッ
ト)に分類できる。短縮形フォーマットの場合は1サイ
クルでデコードは終了するが、一般形の場合は、オペラ
ンドの指定に多段間接モードが用いられていない場合で
も1命令のデコードに2または3サイクルの時間を要す
る。この場合、分岐変位の取り込み及び条件プリジャン
プ処理は最終デコードサイクルにおいて行われる。
(7.6) “ACB, SCB Instruction” Since the ACB instruction and the SCB instruction are used as primitives for loop control, the D-stage condition pre-jump processing is performed by predicting that these instructions will statically branch.
The ACB and SCB instructions have many formats as shown in FIGS. 39 to 46, and can be roughly classified into a shortened form (Q, R format) and a general form (G, E format). In the short format, decoding is completed in one cycle. In the general format, two or three cycles are required to decode one instruction even when the multi-stage indirect mode is not used to specify an operand. In this case, the fetch of the branch displacement and the conditional pre-jump processing are performed in the final decoding cycle.

【0370】図52(a), (b), (c), (d), (e), (f)の模式
図にそれぞれ、Q, Rフォーマットの sz = ”00” :
8 ビット、 sz = ”01” : 16 ビット、 sz = ”10” :
32ビットである場合の、G, Eフォーマットの sz =
”00” : 8 ビット、 sz =”01” : 16 ビット、 sz
= ”10” : 32 ビットである場合のACB, SCB命令の最終
デコードサイクル時のIIバス204 上の分岐変位位置を示
す。図48と比較して明らかなように、短縮形で変位サイ
ズが8ビットである場合と、一般形で変位サイズが16ビ
ットあるいは32ビットである場合は分岐変位の取り込み
サイクルにおいて分岐先アドレスの計算が可能である
が、それ以外の場合は分岐先アドレス計算部1では分岐
先アドレスの計算ができない。従って、前者の場合と後
者の場合で処理方法が異なる。
In the schematic diagrams of FIGS. 52 (a), (b), (c), (d), (e), and (f), respectively, sz = “00” in the Q and R formats:
8 bits, sz = "01": 16 bits, sz = "10":
Sz = G, E format with 32 bits
"00": 8 bits, sz = "01": 16 bits, sz
= "10": Indicates the branch displacement position on the II bus 204 at the time of the last decode cycle of the ACB and SCB instructions in the case of 32 bits. As is apparent from comparison with FIG. 48, when the displacement size is 8 bits in the short form and when the displacement size is 16 bits or 32 bits in the general form, the calculation of the branch destination address is performed in the branch displacement taking cycle. In other cases, the branch destination address calculation unit 1 cannot calculate the branch destination address. Therefore, the processing method differs between the former case and the latter case.

【0371】一般形の場合、最終ステップ以外の処理で
はオペランドの退避処理が行われるだけであるため、短
縮形の命令について説明を行う。
In the case of the general form, in the processing other than the last step, only the operand saving processing is performed, so that the shortened form of the instruction will be described.

【0372】まず、前者の場合について説明する。短縮
形で分岐変位が8ビットである場合の ACB命令処理時の
タイミングチャートを図59(A) に示す。
First, the former case will be described. FIG. 59 (A) shows a timing chart at the time of processing the ACB instruction when the branch displacement is 8 bits in a short form.

【0373】図59(A)(b)に示されているように、C1サ
イクルにおいて命令デコード部112は ACB命令のデコー
ドを行うと共に、分岐先アドレス計算部1は分岐先アド
レスの計算を行う。C1サイクルにおいてDステージ条
件ジャンプ処理が行われる。C2サイクルにおいて、 A
CB命令の次の命令のPC値が計算される。図59(A)(e)に示
されているように、C4サイクルにおいて演算が行わ
れ、C5サイクルにおいて分岐条件の判定が行われる。
分岐予測が的中していた場合には、命令フェッチ部111
は ACB命令に引き続く側のシーケンスの命令キューを無
効化する。この場合、キャッシュヒット時には2サイク
ルで ACB命令の処理が終了する。分岐予測が外れて ACB
命令に引き続く命令の処理を行わなければならない場合
には、C5サイクルにおいて処理シーケンスが元に戻さ
れる。C5サイクルにおいて命令キューに既に ACB命令
に引き続く命令が取り込まれていた場合には ACB命令の
処理に見かけ上5サイクルが費やされたことになる。
As shown in FIGS. 59A and 59B, in the C1 cycle, the instruction decoding unit 112 decodes an ACB instruction, and the branch destination address calculation unit 1 calculates a branch destination address. The D stage condition jump processing is performed in the C1 cycle. In the C2 cycle, A
The PC value of the instruction following the CB instruction is calculated. As shown in FIGS. 59 (A) and 59 (e), the operation is performed in the C4 cycle, and the branch condition is determined in the C5 cycle.
If the branch prediction is correct, the instruction fetch unit 111
Invalidates the instruction queue of the sequence following the ACB instruction. In this case, at the time of a cache hit, the processing of the ACB instruction is completed in two cycles. ACB branch prediction is wrong
If the processing of the instruction following the instruction must be performed, the processing sequence is restored in the C5 cycle. If an instruction following the ACB instruction has already been fetched into the instruction queue in the C5 cycle, five cycles have apparently been spent processing the ACB instruction.

【0374】次に、後者の場合について説明する。短縮
形で分岐変位が16ビットまたは32ビットである場合の A
CB命令処理時のタイミングチャートを図59(B) に示す。
Next, the latter case will be described. A for short form and 16 or 32 bit branch displacement
FIG. 59B shows a timing chart at the time of CB instruction processing.

【0375】図59(B)(b)に示されているように、C1サ
イクルにおいて命令デコード部112は ACB命令のデコー
ドを行うと共に、分岐変位フィールドの切り出しを行
う。C2サイクルにおいてAステージ133 で ACB命令の
次の命令のPC値が計算される。またDステージ132 で
は、切り出された分岐変位に基づいて分岐先アドレス計
算部1で分岐先アドレスの計算が行われ、Dステージ条
件ジャンプ処理が行われる。図59(B)(e)に示されている
ように、C4サイクルにおいては演算が行われ、C5サ
イクルにおいて分岐条件の判定が行われる。分岐予測が
的中していた場合には、命令フェッチ部111 は ACB命令
に引き続く側のシーケンスの命令キューを無効化する。
この場合、キャッシュヒット時には3サイクルで ACB命
令の処理が終了する。分岐予測が外れて ACB命令に引き
続く命令の処理を行わなければならない場合には、C5
サイクルにおいて処理シーケンスが元に戻される。C5
サイクルにおいて命令キューに既に ACB命令に引き続く
命令が取り込まれていた場合には、 ACB命令の処理に見
かけ上5サイクルが費やされたことになる。
As shown in FIGS. 59B and 59B, in the C1 cycle, the instruction decoding section 112 decodes the ACB instruction and cuts out the branch displacement field. In the C2 cycle, in the A stage 133, the PC value of the instruction following the ACB instruction is calculated. In the D stage 132, the branch destination address calculation unit 1 calculates the branch destination address based on the extracted branch displacement, and performs a D stage condition jump process. As shown in FIGS. 59 (B) and 59 (e), the operation is performed in the C4 cycle, and the branch condition is determined in the C5 cycle. If the branch prediction is correct, the instruction fetch unit 111 invalidates the instruction queue of the sequence following the ACB instruction.
In this case, at the time of a cache hit, the processing of the ACB instruction is completed in three cycles. If the branch prediction is missed and the instruction following the ACB instruction must be processed, C5
The processing sequence is restored in the cycle. C5
If an instruction subsequent to the ACB instruction has already been fetched into the instruction queue in a cycle, five cycles have apparently been spent processing the ACB instruction.

【0376】いずれの場合も、分岐先アドレスが奇数で
あり、且つ実際に分岐が発生した場合のみ、 ACB命令の
処理終了後に奇数アドレスジャンプトラップの処理が起
動される。
In any case, only when the branch destination address is odd and the branch actually occurs, the odd address jump trap processing is started after the processing of the ACB instruction is completed.

【0377】(7.7) 「FBcc命令」 FBcc命令は1サイクルでデコードされるが、図53(a),
(b), (c) の模式図にそれぞれsy =”00” : 8 ビッ
ト、sy =”01” : 16 ビット、sy =”10” : 32 ビット
の場合について示されているように、分岐変位のサイズ
には拘わらず、デコードするサイクルにおいて分岐先ア
ドレスを計算することは不可能である。また、この命令
では静的に分岐しないと予測して処理が行われる。条件
分岐命令では迅速に条件判定することが重要であり、分
岐しないと予測して処理が行われるため、ステップコー
ドを先に進めてAステージ133 で分岐先命令プリフェッ
チ処理が行われる。
(7.7) "FBcc instruction" The FBcc instruction is decoded in one cycle.
As shown in the schematic diagrams of (b) and (c), sy = "00": 8 bits, sy = "01": 16 bits, and sy = "10": 32 bits, the branch displacement Irrespective of the size, it is impossible to calculate the branch destination address in the decoding cycle. In addition, the processing is performed by predicting that the instruction does not statically branch. It is important for the conditional branch instruction to quickly determine the condition, and the processing is performed by predicting that the branch will not take place. Therefore, the step code is advanced, and the branch destination instruction prefetch processing is performed in the A stage 133.

【0378】図60に、FBcc命令処理時のタイミングチャ
ートを示す。図60(b) に示されているように、Dステー
ジ132 ではC1サイクルにおいて命令デコード部112 が
FBcc命令のデコードを行う。図60(c) に示されているよ
うに、C2サイクルにおいてAステージ133 で分岐先ア
ドレスが計算され、Aステージ分岐先命令プリフェッチ
処理が行われる。C4サイクルにおいて分岐条件の判定
が行われる。分岐予測が的中していた場合には、命令フ
ェッチ部111 は分岐先のシーケンスの命令キューを無効
化する。この場合、1サイクルでFBcc命令の処理が終了
する。分岐予測が外れて、分岐が発生する場合には、C
4サイクルにおいて処理シーケンスが切り替えられる。
C4サイクルにおいて命令キューに既に分岐先の命令が
取り込まれていた場合には、FBcc命令の処理に見かけ上
4サイクルが費やされたことになる。
FIG. 60 is a timing chart for processing the FBcc instruction. As shown in FIG. 60 (b), in the D stage 132, the instruction decoding unit 112
Decode the FBcc instruction. As shown in FIG. 60 (c), the branch destination address is calculated in the A stage 133 in the C2 cycle, and the A stage branch destination instruction prefetch processing is performed. In the C4 cycle, a branch condition is determined. If the branch prediction is correct, the instruction fetch unit 111 invalidates the instruction queue of the sequence at the branch destination. In this case, the processing of the FBcc instruction is completed in one cycle. If the branch prediction is missed and a branch occurs, C
The processing sequence is switched in four cycles.
If the instruction at the branch destination has already been fetched into the instruction queue in the C4 cycle, apparently four cycles have been spent processing the FBcc instruction.

【0379】いずれの場合も、分岐先アドレスが奇数で
あり、且つ実際に分岐が発生した場合のみ、FBcc命令の
処理終了後に奇数アドレスジャンプトラップの処理が起
動される。
In any case, only when the branch destination address is odd and the branch actually occurs, the odd address jump trap processing is started after the processing of the FBcc instruction is completed.

【0380】(8) 「ジャンプ命令のパイプライン処理の
例」 図61の模式図に、 BRA命令処理時のパイプライン処理の
一例を示す。この例では、 BRA命令の直前の命令のEス
テージ135 での処理が3クロックサイクル必要であり、
見かけ上は BRA命令のEステージ135 での処理時間がゼ
ロになっている。即ち、 BRA命令の処理がDステージ13
2 で終了することにより、 BRA命令の直前の命令の実行
直後に分岐先命令の実行が開始できる。アドレス計算時
に参照するレジスタがコンフリクトを起こしたりしてい
て BRA命令に先行する命令の処理が遅延した場合には、
この例と同様に BRA命令のEステージ135 での処理時間
がゼロになり、Eステージ135 での処理効率は向上す
る。
(8) “Example of Pipeline Processing of Jump Instruction” FIG. 61 schematically shows an example of pipeline processing at the time of processing a BRA instruction. In this example, the processing at the E stage 135 of the instruction immediately before the BRA instruction requires three clock cycles,
Apparently, the processing time in the E stage 135 of the BRA instruction is zero. In other words, the processing of the BRA instruction
By ending with 2, execution of the branch target instruction can start immediately after execution of the instruction immediately before the BRA instruction. If the register referred to at the time of address calculation conflicts or the processing of the instruction preceding the BRA instruction is delayed,
Similarly to this example, the processing time of the BRA instruction in the E stage 135 becomes zero, and the processing efficiency in the E stage 135 is improved.

【0381】図62の模式図に条件分岐命令が連続する場
合のパイプライン処理の様子を示す。この図62では、 B
cc1、 Bcc2が分岐しないと予測され、 Bcc1に関する
分岐予測が的中していた場合の状態を示している。
A schematic diagram of FIG. 62 shows a state of pipeline processing when conditional branch instructions are consecutive. In this FIG. 62, B
This shows a state where it is predicted that cc1 and Bcc2 will not branch, and the branch prediction for Bcc1 is correct.

【0382】C1サイクルにおいて Bcc1に関する分岐
先命令プリフェッチ処理が行われ、C2サイクルにおい
て Bcc2に関する分岐先命令プリフェッチ処理が行われ
る。C2サイクルにおいては2本の命令キューが既に使
用中であるが、 Bcc2の分岐先アドレスは命令フェッチ
部111 により退避されるため、 Bcc2に引き続く命令の
パイプライン処理は継続可能である。C4サイクルにお
いて Bcc1に関する分岐条件が確定し、 Bcc1の分岐先
側のシーケンスの命令キューが無効化される。C5サイ
クルにおいて Bcc2の条件判定が行われる。分岐予測が
的中していた場合にはC6サイクルにおいて Bcc2に引
き続く命令の処理を行うことができる。分岐予測が外れ
た場合には、早ければC5サイクルにおいて分岐先命令
のフェッチが可能であり、C9サイクルにおいて分岐先
命令の実行が開始できる。
In the cycle C1, branch destination instruction prefetch processing for Bcc1 is performed, and in cycle C2, branch destination instruction prefetch processing for Bcc2 is performed. Although two instruction queues are already in use in the C2 cycle, the branch destination address of Bcc2 is saved by the instruction fetch unit 111, so that the pipeline processing of the instruction following Bcc2 can be continued. In the C4 cycle, the branch condition relating to Bcc1 is determined, and the instruction queue of the sequence on the branch destination side of Bcc1 is invalidated. In the C5 cycle, the condition of Bcc2 is determined. If the branch prediction is correct, the instruction following Bcc2 can be processed in the C6 cycle. When the branch prediction is missed, the branch destination instruction can be fetched in the C5 cycle at the earliest, and the execution of the branch destination instruction can be started in the C9 cycle.

【0383】このように、2本の命令キューと1つのア
ドレス退避機構とにより、2つの条件分岐命令を効率的
に処理できる。プログラムで例外をチェックする場合、
正常動作では分岐しない条件分岐命令が連続することが
多いため、このような手法は有効である。
As described above, two conditional queue instructions can be efficiently processed by two instruction queues and one address saving mechanism. When checking exceptions programmatically,
Such a method is effective because a conditional branch instruction that does not branch in normal operation is often continued.

【0384】図63の模式図に、 Bcc命令直後に BSR命令
が続いている場合のパイプライン処理の様子を示す。こ
の例では、 Bcc命令が分岐しないと予測され、分岐予測
が正しかった場合を示している。
FIG. 63 is a schematic diagram showing the state of pipeline processing when a BSR instruction immediately follows a Bcc instruction. This example shows a case where the Bcc instruction is predicted not to branch and the branch prediction is correct.

【0385】C1サイクルにおいて Bcc命令に関する分
岐先命令プリフェッチ処理が行われる。C2サイクルに
おいて BSR命令に関して無条件プリジャンプ処理が行わ
れる。2本の命令キューを使用中であるが、無条件プリ
ジャンプであるため現在使用中の命令キューを使用でき
るので、C3サイクルにおいて BSRの分岐先命令をプリ
フェッチできる。従って、C5サイクルにおいて BSR命
令実行後に、C7サイクルにおいて分岐先命令が実行さ
れる。
In the C1 cycle, branch destination instruction prefetch processing for the Bcc instruction is performed. In the C2 cycle, unconditional pre-jump processing is performed for the BSR instruction. Although two instruction queues are being used, the currently used instruction queue can be used because of an unconditional pre-jump, so that the BSR branch destination instruction can be prefetched in the C3 cycle. Therefore, after executing the BSR instruction in the C5 cycle, the branch destination instruction is executed in the C7 cycle.

【0386】このように無条件プリジャンプ処理では、
使用中であった側の命令キューを使用して分岐先命令の
フェッチを行うので、条件分岐命令の直後の無条件ジャ
ンプ命令も効率よくパイプライン処理することができ
る。
As described above, in the unconditional pre-jump processing,
Since the branch destination instruction is fetched using the instruction queue of the used side, the unconditional jump instruction immediately after the conditional branch instruction can be efficiently pipelined.

【0387】〔実施の形態2〕なお上述の実施の形態で
は、PC計算部2において各デコードサイクルで処理した
コード長の加算を、それぞれのサイクルにおいて行って
いる。しかし、各デコードサイクルにおける処理コード
長の確定に比較的長時間を要するためにコード長の加算
をそのサイクル中に行うことが困難な場合には、実施の
形態1で図1及び図2に示した分岐先アドレス計算部1
及びPC計算部2を図65に示すような構成にすることによ
り対処出来る。この図65に示されている構成では、ジャ
ンプ命令の基本的な処理方法は実施の形態1と同じであ
るが、PC計算の加算タイミングと分岐先アドレスの計算
方法が異なる。以下、実施の形態1と異なる点に着目し
て説明を行う。
[Embodiment 2] In the above-described embodiment, the addition of the code length processed in each decoding cycle in the PC calculation unit 2 is performed in each cycle. However, when it is difficult to add the code length during each cycle because it takes a relatively long time to determine the processing code length in each decoding cycle, the first embodiment will be described with reference to FIGS. Branch destination address calculator 1
This can be dealt with by configuring the PC calculation unit 2 as shown in FIG. In the configuration shown in FIG. 65, the basic processing method of the jump instruction is the same as that of the first embodiment, but the addition timing of the PC calculation and the calculation method of the branch destination address are different. The following description focuses on the differences from the first embodiment.

【0388】PC計算部402 は、命令デコード後、次のサ
イクルにおいて直前にデコードされた命令の処理コード
長の加算を行い、PC値の管理を行う。従って、命令デコ
ード開始時には、 TPC27は直前にデコードされたコード
の先頭アドレスを示しており、この TPC27の値に直前に
処理したコード長を加算したアドレスがデコードしよう
としている命令の先頭アドレスになる。このため、分岐
先アドレス計算部401の各加算器405 〜408 は3値加算
器を使用しており、PIバス40を介して転送される TPC27
の値と、ILENバス215 を介して転送される直前にデコー
ドしたコードのコード長と、IIバス204 を介して転送さ
れる分岐命令の分岐変位フィールドとを加算する。各加
算器405 〜408 に取り込まれる分岐変位フィールドの位
置, 絶対アドレス等に関する処理は、図1及び図2に示
した実施の形態と同様である。このようにしてジャンプ
命令処理時に、各加算器405 〜408 は図1及び図2に示
されている第1〜第4加算器5〜8と同一の加算結果を
得ることができるのである。
After decoding the instruction, the PC calculation unit 402 adds the processing code length of the instruction decoded immediately before in the next cycle, and manages the PC value. Therefore, at the start of instruction decoding, the TPC 27 indicates the head address of the code decoded immediately before, and the address obtained by adding the code length processed immediately before to the value of the TPC 27 becomes the head address of the instruction to be decoded. Therefore, each of the adders 405 to 408 of the branch destination address calculation unit 401 uses a ternary adder, and the TPC 27 transferred through the PI bus 40 is used.
, The code length of the code decoded immediately before being transferred via the ILEN bus 215, and the branch displacement field of the branch instruction transferred via the II bus 204. The processing relating to the position, absolute address, and the like of the branch displacement field taken into each of the adders 405 to 408 is the same as in the embodiment shown in FIGS. In this way, at the time of the jump instruction processing, each of the adders 405 to 408 can obtain the same addition result as the first to fourth adders 5 to 8 shown in FIGS.

【0389】命令デコード後、分岐先アドレスの計算を
行う場合には、加算器408 でPIバス40を介して転送され
る分岐命令の先頭アドレス値である DPC29の値と、ILEN
バス215 を介して転送される”0”と、DISPバス205 を
介して転送される分岐命令の分岐変位フィールドとを加
算することにより、分岐先アドレスの計算を行う。ま
た、次命令PC値の計算は、アドレス計算部115 で APC30
の値と、命令デコード部112 から ADJSTバス214 を介し
て出力される分岐命令のコード長とを加算することによ
り行えばよい。
When calculating the branch destination address after decoding the instruction, the adder 408 calculates the value of DPC29, which is the head address value of the branch instruction transferred via the PI bus 40, and the value of ILEN.
The branch destination address is calculated by adding "0" transferred via the bus 215 and the branch displacement field of the branch instruction transferred via the DISP bus 205. In addition, the calculation of the PC value of the next instruction is performed by
And the code length of the branch instruction output from the instruction decode unit 112 via the ADJST bus 214 may be added.

【0390】このように、実施の形態2によっても前述
の実施の形態1と全く同様にジャンプ命令の処理を行う
ことができる。
As described above, according to the second embodiment, the jump instruction can be processed in exactly the same manner as in the first embodiment.

【0391】上述の実施の形態では、命令デコード時に
分岐先アドレスを計算するために4つの加算器をインプ
リメントしているが、ハードウェアコストを考慮して、
特に使用頻度の高い命令に的を絞り、加算器の数を減ら
しても構わない。たとえば、短縮形の BRA命令, Bcc命
令, BSR命令のみを高速化するのであれば、命令デコー
ドと同時に分岐先アドレスの計算を行う加算器は1つで
よい。逆に、 ACB命令, SCB命令, 更にはFBcc命令の分
岐変位に対応してより多くの加算器をインプリメントし
てもよい。
In the above-described embodiment, four adders are implemented to calculate a branch destination address at the time of instruction decoding. However, hardware costs are taken into consideration.
The number of adders may be reduced by focusing on particularly frequently used instructions. For example, if only the shortened BRA, Bcc, and BSR instructions are to be speeded up, only one adder may be used to decode the instruction and calculate the branch destination address at the same time. Conversely, more adders may be implemented corresponding to the branch displacement of the ACB instruction, SCB instruction, and even FBcc instruction.

【0392】また、絶対アドレスでジャンプ先アドレス
が指定される命令の処理についても、1つのフィールド
についてのみ命令デコード段階でのジャンプ処理を行う
ようにしてもよいし、対象となる絶対アドレスフィール
ドが多い場合にはより多くのフィールド切り出し手段を
設けてもよい。
In the processing of an instruction whose jump address is specified by an absolute address, jump processing in the instruction decoding stage may be performed for only one field, or there may be many target absolute address fields. In such a case, more field cutting means may be provided.

【0393】また、上述の実施の形態では、 Bcc命令に
ついては動的分岐予測を行い、FBcc命令に関しては分岐
しないと静的に予測し、ACB, SCB命令に関しては分岐す
ると静的に予測しているが、どのような予測を行っても
かまわない。たとえば、全ての分岐命令を分岐すると静
的に予測して処理してもよい。また、命令キューの構成
に関しては、全ての分岐命令を分岐しないと静的に予測
する従来の一般的な処理方法に対しても有効である。
In the above-described embodiment, the dynamic branch prediction is performed for the Bcc instruction, the FBcc instruction is statically predicted not to branch, and the ACB and SCB instructions are statically predicted to branch. However, it doesn't matter what predictions you make. For example, it may be statically predicted that all branch instructions are to be processed. The configuration of the instruction queue is also effective for a conventional general processing method that statically predicts that all branch instructions are not to be branched.

【0394】また、上述の実施の形態では、 Bcc命令に
ついては命令デコード段階で動的分岐予測を行っている
が、命令フェッチ段階で分岐予測を行い、分岐先アドレ
スの生成を行うたとえばブランチ・ターゲット・バッフ
ァのようなハードウェアを使用しても、本発明の命令キ
ューの構成は有効である。また、全ての分岐先アドレス
計算をアドレス計算ステージで計算し、Aステージ133
でジャンプ処理を行うような場合でも、本発明の命令キ
ューの構成は有効である。
In the above-described embodiment, the dynamic branch prediction is performed for the Bcc instruction at the instruction decode stage, but the branch prediction is performed at the instruction fetch stage to generate the branch destination address. Even if hardware such as a buffer is used, the configuration of the instruction queue of the present invention is effective. Also, all branch destination addresses are calculated in the address calculation stage, and the A stage 133 is calculated.
Even when the jump processing is performed by using the instruction queue, the configuration of the instruction queue of the present invention is effective.

【0395】上述の実施の形態では、DBC.D=1 あるいは
PSW.DB=1 である場合に、無条件分岐命令の終端を行っ
ているが、より詳細な条件設定を行い、無条件分岐命令
の終端を行う場合を増やしてもよい。たとえば、DBC.TR
=00 & DBC.E=0 & DBC.R=0 &DBC.W=0 であれば、DBC.D=1
あるいは PSW.DB=1 であってもデバッグ事象の検出は
行わないようにしてもよい。
In the above embodiment, DBC.D = 1 or
When PSW.DB = 1, the termination of the unconditional branch instruction is performed. However, more detailed conditions may be set and the number of cases where the unconditional branch instruction is terminated may be increased. For example, DBC.TR
= 00 & DBC.E = 0 & DBC.R = 0 & DBC.W = 0, then DBC.D = 1
Alternatively, even if PSW.DB = 1, detection of a debug event may not be performed.

【0396】上述の実施の形態2では、1つの命令のデ
コードを1つもしくは複数の部分に分割してデコードを
行い、PCの計算を各サイクルのデコード処理対象となる
命令コード単位に行っているが、PCの計算を命令単位に
管理してもよい。たとえば、1つの命令の最終デコード
サイクルの次のサイクルにおいて、直前にデコードされ
た命令の先頭アドレスと、その命令の命令長とを加算す
るようにしてもよい。特に、全ての命令が1サイクルで
デコードできる場合にはそのような構成が合理的であ
る。また、上述の実施の形態ではPC計算部2がPC値の管
理を行っているが、命令フェッチ部111 がPC値を管理し
て、命令キューが出力する命令のアドレスとして分岐先
アドレス計算部1に出力してもよい。
In the above-described second embodiment, decoding of one instruction is divided into one or a plurality of parts and decoding is performed, and PC calculation is performed for each instruction code to be decoded in each cycle. However, the calculation of the PC may be managed in instruction units. For example, in the cycle following the last decode cycle of one instruction, the start address of the instruction decoded immediately before and the instruction length of the instruction may be added. In particular, if all instructions can be decoded in one cycle, such a configuration is rational. In the above embodiment, the PC calculation unit 2 manages the PC value. However, the instruction fetch unit 111 manages the PC value, and stores the PC value as the address of the instruction output from the instruction queue. May be output.

【0397】上述の実施の形態では、第2の分岐命令の
分岐先アドレスを退避するラッチを命令フェッチ部111
に備えているが、ハードウェア的にどの位置にこのラッ
チを設けても構わない。
In the above embodiment, the latch for saving the branch destination address of the second branch instruction is provided by the instruction fetch unit 111.
However, the latch may be provided at any position in terms of hardware.

【0398】また、上述の実施の形態では2つの命令キ
ューが使用中の場合であり且つ条件プリジャンプ処理時
にも分岐先アドレスの退避を行っているが、分岐先命令
は2つの命令キューのいずれかが空かなければ取り込め
ないため、2つの命令キューが共に使用中の場合は分岐
先命令プリフェッチに際してのみ分岐先アドレスの退避
を行うようにして、命令フェッチ部の制御を単純にして
もよい。この場合、第2の条件分岐命令は条件プリジャ
ンプの処理要求が受け付けられなくても、条件プリジャ
ンプの処理のみ継続し、条件分岐命令実行後の命令の処
理方向を早期に確定する目的から、ステップコードの出
力は行えるようにする方がよい。
In the above-described embodiment, the two instruction queues are in use and the branch destination address is saved even during the conditional pre-jump processing. If the two instruction queues are both in use, the instruction fetch unit may be saved only when the two instruction queues are being used, so that the control of the instruction fetch unit may be simplified. In this case, the second conditional branch instruction continues only the processing of the conditional pre-jump even if the processing request of the conditional pre-jump is not accepted, and for the purpose of early determining the processing direction of the instruction after the execution of the conditional branch instruction, It is better to be able to output step codes.

【0399】更に、図66に示されている命令キュー部82
の状態遷移の例では、分岐予測ミスとプリジャンプ関連
要求とが重なった場合には、分岐予測ミスを優先的に受
け付けるように構成されているが、命令フェッチ部111
が分岐予測ミスとプリジャンプ関連要求とを同時に受け
付けて処理するような構成を採ることも勿論可能であ
る。
Further, the instruction queue unit 82 shown in FIG.
In the example of the state transition of the above, when the branch prediction error and the pre-jump related request overlap, the configuration is such that the branch prediction error is preferentially accepted.
Can, of course, adopt a configuration in which a branch prediction error and a pre-jump related request are simultaneously received and processed.

【0400】[0400]

【発明の効果】以上に詳述したように、請求項1に係る
発明によれば、先行分岐手段と2つの命令プリフェッチ
キューとを備え、条件分岐命令処理時には命令デコード
部におけるデコード後、現在使用中の命令プリフェッチ
キューとは異なる命令プリフェッチキューを使用して分
岐先命令の取り込みを行い、無条件分岐命令処理時には
命令デコード部におけるデコード後、現在使用中の命令
プリフェッチキューを初期化し、命令プリフェッチキュ
ーに分岐先命令の取り込みを行うので、条件分岐命令の
直後の無条件分岐命令についても分岐先命令をフェッチ
して命令デコード部に出力することが可能になる。この
ため、条件分岐命令と無条件分岐命令を効率よくパイプ
ライン処理することができる安価で且つ高性能なデータ
処理装置が得られる。
As described in detail above, according to the first aspect of the present invention, there is provided a pre-branch means and two instruction prefetch queues, and an instruction decoding means for processing a conditional branch instruction.
Instruction prefetch currently in use after decoding in section
Using an instruction prefetch queue different from the queue
The branch instruction is fetched, and the unconditional branch instruction is processed.
Instruction currently in use after decoding in the instruction decode section
Initializes the prefetch queue and stores the instruction prefetch queue.
The branch destination instruction is fetched into the
Fetch branch destination instruction even for unconditional branch instruction immediately after
Output to the instruction decoding unit. this
Therefore, an inexpensive and high-performance data processing device that can efficiently pipeline conditional and unconditional branch instructions can be obtained.

【0401】[0401]

【0402】また、請求項2に係る発明によれば、先行
ジャンプ手段を備え、無条件ジャンプ命令処理時に先行
ジャンプ処理を行い、モードレジスタが第1のモードを
示している場合に無条件ジャンプ命令を命令実行部で
処理し、モードレジスタが第2のモードを示している場
合には無条件ジャンプ命令を命令実行部が処理しないよ
うにしてあるから、動作モードに応じて効率よくかつ正
しく無条件ジャンプ命令の処理を行うことが可能な高性
能なデータ処理装置が得られる。
[0402] According to the invention of claim 2, prior comprise a jump means performs pre-jump process when an unconditional jump instruction processing, unconditional jump if the mode register indicates the first mode The instruction is processed by the instruction execution unit, and if the mode register indicates the second mode,
Instruction execution unit will not process unconditional jump instructions
Thus, a high-performance data processing device capable of efficiently and correctly processing an unconditional jump instruction according to an operation mode can be obtained.

【0403】また、請求項3に係る発明によれば、先行
ジャンプ手段を備え、無条件ジャンプ命令処理時に先行
ジャンプ処理を行い、判定手段で例外が検出されている
場合に無条件ジャンプ命令を命令実行部で処理し、判
定手段で例外が検出されていない場合には無条件ジャン
プ命令を命令実行部で処理しないようにしてあるから
無条件分岐命令を効率よく処理し、且つ例外検出時にも
正しく動作する高性能なデータ処理装置が得られる。
[0403] Also, according to the invention according to claim 3, further comprising a pre-jump means performs pre-jump process when an unconditional jump instruction processing, an unconditional jump instruction when the exception determination means is detected Processed by the instruction execution unit,
If no exception is detected by the
Instruction is not processed by the instruction execution unit .
A high-performance data processing device that processes unconditional branch instructions efficiently and operates correctly even when an exception is detected is obtained.

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

【図1】 本発明のデータ処理装置の実施の形態の一例
によるPC処理部の構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a PC processing unit according to an example of an embodiment of a data processing device of the present invention.

【図2】 本発明のデータ処理装置の実施の形態の一例
によるPC処理部の構成を示すブロック図である。
FIG. 2 is a block diagram illustrating a configuration of a PC processing unit according to an example of the embodiment of the data processing device of the present invention.

【図3】 本発明のデータ処理装置の実施の形態の一例
によるオペランドアドレス計算部の構成を示すブロック
図である。
FIG. 3 is a block diagram illustrating a configuration of an operand address calculation unit according to an example of the embodiment of the data processing device of the present invention.

【図4】 本発明のデータ処理装置の実施の形態の一例
を用いたシステムの構成例を示すブロック図である。
FIG. 4 is a block diagram illustrating a configuration example of a system using an example of an embodiment of a data processing device of the present invention.

【図5】 本発明のデータ処理装置の実施の形態の一例
の構成を示すブロック図である。
FIG. 5 is a block diagram illustrating a configuration of an example of a data processing device according to an embodiment of the present invention;

【図6】 本発明のデータ処理装置の実施の形態の一例
によるパイプライン構成を示す模式図である。
FIG. 6 is a schematic diagram showing a pipeline configuration according to an example of an embodiment of the data processing device of the present invention.

【図7】 本発明のデータ処理装置の実施の形態の一例
による命令フェッチ部の構成を示すブロック図である。
FIG. 7 is a block diagram showing a configuration of an instruction fetch unit according to an example of the embodiment of the data processing device of the present invention.

【図8】 本発明のデータ処理装置の実施の形態の一例
による命令フォーマットを示す模式図である。
FIG. 8 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図9】 本発明のデータ処理装置の実施の形態の一例
による命令フォーマットを示す模式図である。
FIG. 9 is a schematic diagram showing an instruction format according to an example of a data processing device according to an embodiment of the present invention;

【図10】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 10 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図11】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 11 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図12】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 12 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図13】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 13 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図14】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 14 is a schematic diagram showing an instruction format according to an example of an embodiment of the data processing device of the present invention.

【図15】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 15 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図16】 本発明のデータ処理装置の実施の形態の一
例による命令フォーマットを示す模式図である。
FIG. 16 is a schematic diagram showing an instruction format according to an example of the embodiment of the data processing device of the present invention.

【図17】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 17 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図18】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 18 is a schematic diagram showing an addressing mode format according to an example of the embodiment of the data processing apparatus of the present invention.

【図19】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 19 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図20】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 20 is a schematic diagram showing a format of an addressing mode according to an example of an embodiment of the data processing device of the present invention.

【図21】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 21 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図22】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 22 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図23】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 23 is a schematic diagram showing a format of an addressing mode according to an example of an embodiment of the data processing device of the present invention.

【図24】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 24 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図25】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 25 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図26】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 26 is a schematic diagram showing a format of an addressing mode according to an example of the embodiment of the data processing device of the present invention.

【図27】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 27 is a schematic diagram showing a format of an addressing mode according to an example of an embodiment of the data processing device of the present invention.

【図28】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 28 is a schematic diagram showing a format of an addressing mode according to an embodiment of the data processing device of the present invention.

【図29】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 29 is a schematic diagram showing a format of an addressing mode according to an example of an embodiment of the data processing device of the present invention.

【図30】 本発明のデータ処理装置の実施の形態の一
例によるアドレッシングモードのフォーマットを示す模
式図である。
FIG. 30 is a schematic diagram showing a format of an addressing mode according to an example of an embodiment of the data processing device of the present invention.

【図31】 本発明のデータ処理装置の実施の形態の一
例による BRA命令のビットパターンを示す模式図であ
る。
FIG. 31 is a schematic diagram showing a bit pattern of a BRA instruction according to an example of an embodiment of the data processing device of the present invention.

【図32】 本発明のデータ処理装置の実施の形態の一
例による BRA命令のビットパターンを示す模式図であ
る。
FIG. 32 is a schematic diagram showing a bit pattern of a BRA instruction according to an example of the embodiment of the data processing device of the present invention.

【図33】 本発明のデータ処理装置の実施の形態の一
例による Bcc命令のビットパターンを示す模式図であ
る。
FIG. 33 is a schematic diagram showing a bit pattern of a Bcc instruction according to an example of the embodiment of the data processing device of the present invention.

【図34】 本発明のデータ処理装置の実施の形態の一
例による Bcc命令のビットパターンを示す模式図であ
る。
FIG. 34 is a schematic diagram showing a bit pattern of a Bcc instruction according to an example of the embodiment of the data processing device of the present invention.

【図35】 本発明のデータ処理装置の実施の形態の一
例による BSR命令のビットパターンを示す模式図であ
る。
FIG. 35 is a schematic view showing a bit pattern of a BSR instruction according to an example of the embodiment of the data processing device of the present invention.

【図36】 本発明のデータ処理装置の実施の形態の一
例による BSR命令のビットパターンを示す模式図であ
る。
FIG. 36 is a schematic view showing a bit pattern of a BSR instruction according to an example of an embodiment of the data processing device of the present invention.

【図37】 本発明のデータ処理装置の実施の形態の一
例による JMP命令のビットパターンを示す模式図であ
る。
FIG. 37 is a schematic diagram showing a bit pattern of a JMP instruction according to an example of the embodiment of the data processing device of the present invention.

【図38】 本発明のデータ処理装置の実施の形態の一
例による JSR命令のビットパターンを示す模式図であ
る。
FIG. 38 is a schematic diagram showing a bit pattern of a JSR instruction according to an example of the embodiment of the data processing device of the present invention.

【図39】 本発明のデータ処理装置の実施の形態の一
例による ACB命令のビットパターンを示す模式図であ
る。
FIG. 39 is a schematic diagram showing a bit pattern of an ACB instruction according to an example of the embodiment of the data processing device of the present invention.

【図40】 本発明のデータ処理装置の実施の形態の一
例による ACB命令のビットパターンを示す模式図であ
る。
FIG. 40 is a schematic view showing a bit pattern of an ACB instruction according to an example of the embodiment of the data processing device of the present invention.

【図41】 本発明のデータ処理装置の実施の形態の一
例による ACB命令のビットパターンを示す模式図であ
る。
FIG. 41 is a schematic diagram showing a bit pattern of an ACB instruction according to an example of the embodiment of the data processing device of the present invention.

【図42】 本発明のデータ処理装置の実施の形態の一
例による ACB命令のビットパターンを示す模式図であ
る。
FIG. 42 is a schematic diagram showing a bit pattern of an ACB instruction according to an example of an embodiment of the data processing device of the present invention.

【図43】 本発明のデータ処理装置の実施の形態の一
例による SCB命令のビットパターンを示す模式図であ
る。
FIG. 43 is a schematic diagram showing a bit pattern of an SCB instruction according to an example of an embodiment of the data processing device of the present invention.

【図44】 本発明のデータ処理装置の実施の形態の一
例による SCB命令のビットパターンを示す模式図であ
る。
FIG. 44 is a schematic diagram showing a bit pattern of an SCB instruction according to an example of the embodiment of the data processing device of the present invention.

【図45】 本発明のデータ処理装置の実施の形態の一
例による SCB命令のビットパターンを示す模式図であ
る。
FIG. 45 is a schematic diagram showing a bit pattern of an SCB instruction according to an example of an embodiment of the data processing device of the present invention.

【図46】 本発明のデータ処理装置の実施の形態の一
例による SCB命令のビットパターンを示す模式図であ
る。
FIG. 46 is a schematic diagram showing a bit pattern of an SCB instruction according to an example of the embodiment of the data processing device of the present invention.

【図47】 本発明のデータ処理装置の実施の形態の一
例によるFBcc命令のビットパターンを示す模式図であ
る。
FIG. 47 is a schematic diagram showing a bit pattern of an FBcc instruction according to an example of the embodiment of the data processing device of the present invention.

【図48】 本発明のデータ処理装置の実施の形態の一
例による分岐先アドレス計算部の各加算器に分岐変位と
して入力されるIIバスのビット位置を示す模式図であ
る。
FIG. 48 is a schematic diagram showing a bit position of the II bus input as a branch displacement to each adder of the branch destination address calculation unit according to an example of the embodiment of the data processing device of the present invention.

【図49】 本発明のデータ処理装置の実施の形態の一
例による各ブロック間でのジャンプ関連の制御信号及び
ジャンプ先アドレスの受渡しの関係を示すブロック図で
ある。
FIG. 49 is a block diagram showing a relationship between transfer of a jump-related control signal and a jump destination address between blocks according to an example of an embodiment of the data processing apparatus of the present invention.

【図50】 本発明のデータ処理装置の実施の形態の一
例による BRA, BSR, Bcc命令処理時のIIバス上の分岐
変位位置を示す模式図である。
FIG. 50 is a schematic diagram showing a branch displacement position on the II bus at the time of processing a BRA, BSR, and Bcc instruction according to an example of an embodiment of the data processing device of the present invention.

【図51】 本発明のデータ処理装置の実施の形態の一
例によるJMP, JSR命令処理時のIIバス上の分岐変位位置
を示す模式図である。
FIG. 51 is a schematic diagram showing a branch displacement position on the II bus at the time of processing a JMP or JSR instruction according to an example of the data processing apparatus of the present invention;

【図52】 本発明のデータ処理装置の実施の形態の一
例によるACB, SCB命令処理時のIIバス上の分岐変位位置
を示す模式図である。
FIG. 52 is a schematic diagram showing a branch displacement position on the II bus at the time of processing an ACB or SCB instruction according to an example of the data processing apparatus of the present invention;

【図53】 本発明のデータ処理装置の実施の形態の一
例によるFBcc命令処理時のIIバス上の分岐変位位置を示
す模式図である。
FIG. 53 is a schematic diagram showing a branch displacement position on the II bus at the time of FBcc instruction processing according to an example of the data processing apparatus of the present invention;

【図54】 本発明のデータ処理装置の実施の形態の一
例による BRA命令処理時のタイミングチャートである。
FIG. 54 is a timing chart at the time of processing a BRA instruction according to an example of the embodiment of the data processing device of the present invention;

【図55】 本発明のデータ処理装置の実施の形態の一
例による BSR命令処理時のタイミングチャートである。
FIG. 55 is a timing chart at the time of processing a BSR instruction according to an example of the embodiment of the data processing apparatus of the present invention;

【図56】 本発明のデータ処理装置の実施の形態の一
例による Bcc命令処理時のタイミングチャートである。
FIG. 56 is a timing chart at the time of processing a Bcc instruction according to an example of the embodiment of the data processing device of the present invention;

【図57】 本発明のデータ処理装置の実施の形態の一
例による JMP命令処理時のタイミングチャートである。
FIG. 57 is a timing chart at the time of JMP instruction processing according to an example of the embodiment of the data processing device of the present invention.

【図58】 本発明のデータ処理装置の実施の形態の一
例による JSR命令処理時のタイミングチャートである。
FIG. 58 is a timing chart at the time of processing a JSR instruction according to an example of the embodiment of the data processing device of the present invention;

【図59】 本発明のデータ処理装置の実施の形態の一
例による ACB命令処理時のタイミングチャートである。
FIG. 59 is a timing chart at the time of ACB instruction processing according to an example of the embodiment of the data processing device of the present invention;

【図60】 本発明のデータ処理装置の実施の形態の一
例によるFBcc命令処理時のタイミングチャートである。
FIG. 60 is a timing chart at the time of FBcc instruction processing according to an example of the embodiment of the data processing device of the present invention;

【図61】 本発明のデータ処理装置の実施の形態の一
例による BRA命令処理時のタイミングチャートである。
FIG. 61 is a timing chart at the time of processing a BRA instruction according to an embodiment of the data processing apparatus of the present invention;

【図62】 本発明のデータ処理装置の実施の形態の一
例による2つの Bcc命令が連続して処理される場合のタ
イミングチャートである。
FIG. 62 is a timing chart in a case where two Bcc instructions are successively processed according to an example of the embodiment of the data processing apparatus of the present invention;

【図63】 本発明のデータ処理装置の実施の形態の一
例による Bcc命令とBSR命令が連続して処理される場合
のタイミングチャートである。
FIG. 63 is a timing chart in a case where a Bcc instruction and a BSR instruction are continuously processed according to an example of an embodiment of the data processing device of the present invention;

【図64】 本発明のデータ処理装置の実施の形態の一
例によるPSW とデバッグ関連制御レジスタの構成を示す
模式図である。
FIG. 64 is a schematic diagram showing a configuration of a PSW and a debug-related control register according to an example of a data processing device according to an embodiment of the present invention;

【図65】 本発明のデータ処理装置の他の実施の形態
によるのPC処理部の構成を示すブロック図である。
FIG. 65 is a block diagram showing a configuration of a PC processing unit according to another embodiment of the data processing device of the present invention.

【図66】 本発明のデータ処理装置の実施の形態の一
例による命令キュー部のプリジャンプ処理時の状態遷移
を示す模式図である。
FIG. 66 is a schematic diagram showing a state transition at the time of pre-jump processing of the instruction queue unit according to an example of the embodiment of the data processing apparatus of the present invention.

【図67】 命令デコード段階で分岐先アドレスを計算
してジャンプ処理を行う従来のデータ処理装置のジャン
プ命令処理機構の構成を示すブロック図である。
FIG. 67 is a block diagram showing a configuration of a jump instruction processing mechanism of a conventional data processing device that performs a jump process by calculating a branch destination address at an instruction decoding stage.

【図68】 従来のデータ処理装置の無条件分岐命令(B
RA命令) 処理時のタイミングチャートである。
FIG. 68 shows an unconditional branch instruction (B
It is a timing chart at the time of processing (RA instruction).

【図69】 従来のデータ処理装置の一例としてIBM Sy
stem/370 Model 168-3の内部構造を示すブロック図であ
る。
FIG. 69. IBM Sy as an example of a conventional data processing device
It is a block diagram which shows the internal structure of stem / 370 Model 168-3.

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

1 分岐先アドレス計算部、2 PC計算部、3 第1加
算器、4 第2加算器、7 第3加算器、8 第4加算
器、11 入力ラッチ、12 入力ラッチ、83 命令キュー
A、84 命令キューB、85 入出力ポインタ部、86 命
令キュー取り込みアドレスレジスタ(QINPCA)、87 命令
キュー取り込みアドレスレジスタ(QINPCB)、88 分岐先
アドレス退避ラッチ(QINPCC)、111 命令フェッチ部、
112 命令デコード部、115 オペランドアドレス計算
部、117 整数演算部、118 浮動小数点演算部、401
分岐先アドレス計算部、402 PC計算部。
1 branch destination address calculator, 2 PC calculator, 3 first adder, 4 second adder, 7 third adder, 8 fourth adder, 11 input latch, 12 input latch, 83 instruction queue A, 84 Instruction queue B, 85 input / output pointer section, 86 instruction queue capture address register (QINPCA), 87 instruction queue capture address register (QINPCB), 88 branch destination address saving latch (QINPCC), 111 instruction fetch section,
112 Instruction decode unit, 115 Operand address calculation unit, 117 Integer operation unit, 118 Floating point operation unit, 401
Branch destination address calculator, 402 PC calculator.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭63−316131(JP,A) 特開 平3−257527(JP,A) 特開 平2−59822(JP,A) 特開 平1−214932(JP,A) 特開 平2−181236(JP,A) 特開 平3−218524(JP,A) (58)調査した分野(Int.Cl.6,DB名) G06F 9/38 ──────────────────────────────────────────────────続 き Continuation of front page (56) References JP-A-63-316131 (JP, A) JP-A-3-257527 (JP, A) JP-A-2-59822 (JP, A) JP-A-1- 214932 (JP, A) JP-A-2-181236 (JP, A) JP-A-3-218524 (JP, A) (58) Fields investigated (Int. Cl. 6 , DB name) G06F 9/38

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 命令を格納するメモリと、 該メモリから命令を取り込む命令フェッチ部と、 該命令フェッチ部が取り込んだ命令をデコードする命令
デコード部と、 該命令デコード部による命令のデコード結果に基づいて
命令を実行する命令実行部と、分岐 命令の処理に関して、分岐先アドレスの生成を行う
手段と、前記分岐先アドレスを前記命令フェッチ部へ転
送する転送手段とを有する分岐先アドレス生成部と、
命令処理時に、前記命令実行部での分岐条件の確定に
先立って前記分岐先アドレス生成部で生成された分岐先
アドレスを前記転送手段を介して前記命令フェッチ部へ
転送して分岐先命令のフェッチを指示する手段とを有す
る先行分岐手段とを備え、 前記命令フェッチ部は、前記メモリから取り込んだ命令
を一時保持するための第1及び第2の命令プリフェッチ
キューと、前記第1及び第2の命令プリフェッチキュー
に保持されている命令を前記命令デコード部に選択的に
出力する出力手段と、前記第1及び第2の命令プリフェ
ッチキューに取り込む命令のアドレスをそれぞれ保持す
る第1及び第2のアドレスレジスタとを有し、 前記出力手段により前記第1の命令プリフェッチキュー
の命令が前記命令デコード部に出力されており、且つ前
記第1の命令プリフェッチキューに取り込まれている命
令列中に条件分岐命令が含まれている場合は、 前記条件分岐命令処理時に、前記命令デコード部におけ
るデコード後、前記分岐先アドレス生成部により分岐先
アドレスの生成を行い、前記先行分岐手段は、前記分岐
先アドレス生成部で生成された第1の分岐先アドレスを
前記転送手段を介して前記命令フェッチ部へ転送すると
に分岐先アドレスの命令のフェッチを指示し、前記命
令フェッチ部は、前記第2のアドレスレジスタに前記第
1の分岐先アドレスを格納し、前記第2の命令プリフェ
ッチキューの初期化後、前記第2の命令プリフェッチキ
ューに前記第1の分岐先アドレスから始まる命令列を取
り込み、前記出力手段により前記第1あるいは第2の命
令プリフェッチキューのいずれか一方に取り込まれてい
る命令を前記命令デコード部に出力し、前記出力手段により前記第1のプリフェッチキューの命
令が前記命令デコード部に出力されおり、且つ前記第1
の命令プリフェッチキューに取り込まれてる命令列中に
無条件分岐命令が含まれている場合は、 前記無条件分岐命令処理時に、前記命令デコード部にお
けるデコード後、前記分岐先アドレス生成部により分岐
先アドレスの生成を行い、 前記先行分岐手段は前記分
岐先アドレス生成部で生成された第2の分岐先アドレス
を前記転送手段を介して前記命令フェッチ部へ転送する
と共に分岐先アドレスの命令のフェッチを指示し、前記
命令フェッチ部は、前記第1のアドレスレジスタに前記
第2の分岐先アドレスを格納し、前記第1の命令プリフ
ェッチキューの初期化後、前記第1の命令プリフェッチ
キューに前記第2の分岐先アドレスから始まる命令列を
取り込み、前記出力手段により前記第1の命令プリフェ
ッチキューに取り込まれている命令を前記命令デコード
部に出力すべくなしてあることを特徴とするデータ処理
装置。
A memory for storing instructions; an instruction fetch unit for fetching instructions from the memory; an instruction decoding unit for decoding instructions fetched by the instruction fetch unit; An instruction execution unit for executing an instruction, a unit for generating a branch destination address for processing of a branch instruction, and a transfer unit for transferring the branch destination address to the instruction fetch unit; Minute
When Toki instruction processing, the branch destination address generated by the branch destination address generation unit prior to the determination of the branch condition to transfer through said transfer means to said instruction fetch unit branch destination instruction in the instruction execution unit A first branch unit having a first instruction prefetch queue for temporarily holding an instruction fetched from the memory; and a first and second instruction prefetch queue for temporarily holding an instruction fetched from the memory. Output means for selectively outputting the instructions held in the instruction prefetch queue to the instruction decoding unit, and first and second means for holding the addresses of the instructions to be taken into the first and second instruction prefetch queues, respectively. and an address register, the instruction of the first instruction prefetch queue are output to the instruction decoding unit by the output means, and If there are conditional branch instruction to the instruction in sequence are taken into serial first instruction prefetch queue, before the time Kijo matter branch instruction processing, put in the instruction decoding unit
After the decoding, the branch destination address generation unit generates a branch destination address, and the preceding branch unit transmits the first branch destination address generated by the branch destination address generation unit to the instruction via the transfer unit. instructs fetching instructions of the branch destination address to <br/> both the transferring to the fetch unit, the instruction fetch unit stores the first branch destination address to the second address register, said second Instruction prefe
After the initialization of the latch queue, the instruction sequence starting from the first branch destination address is fetched into the second instruction prefetch queue, and the instruction sequence is fetched into one of the first and second instruction prefetch queues by the output means. The first instruction is output to the instruction decoding unit, and the output unit outputs the instruction of the first prefetch queue.
Instruction is output to the instruction decode unit, and the first
In the instruction sequence captured in the instruction prefetch queue
When an unconditional branch instruction is included , the instruction decoding unit may process the unconditional branch instruction.
After decoding by the branch destination address generator,
Performs generation of the previous address, the pre-branch means, <br/> co transferring the second branch destination address generated by the branch destination address generation unit through said transfer means to said instruction fetch unit instructs fetching instructions of the branch destination address, the instruction fetch unit, the said first address register
A second branch destination address is stored, and the first instruction prefix is stored.
After the initialization of the etch queue, an instruction sequence starting from the second branch destination address is stored in the first instruction prefetch queue.
The first instruction prefetch by the output means.
Instruction fetched into the instruction queue
A data processing device characterized in that the data is output to a unit.
【請求項2】 命令を格納するメモリと、 該メモリから命令を取り込む命令フェッチ部と、 該命令フェッチ部が取り込んだ命令をデコードする命令
デコード部と、 該命令デコード部による命令のデコード結果に基づいて
命令を実行する命令実行部と、ジャンプ命令の処理に関して、ジャンプ先アドレスの生
成を行う手段と、前記ジャンプ先アドレスを前記命令フ
ェッチ部へ転送する転送手段とを有するジャンプ先アド
レス生成部と、ジャンプ命令処理時に、前記ジャンプ先
アドレス生成部で生成されたジャンプ先アドレスを前記
転送手段を介して前記命令フェッチ部へ転送してジャン
プ先命令のフェッチを指示する手段とを有する先行ジャ
ンプ手段と、 命令またはハードウェアで設定が可能で動作モードを指
定するためのモードレジスタと を備え、無条件ジャンプ命令処理時に、前記先行ジャンプ手段
は、前記ジャンプ先アド レス生成部でジャンプ先アドレ
スの生成を行い、前記ジャンプ先アドレスを前記転送手
段を介して前記命令フェッチ部へ転送し、前記命令フェ
ッチ部は前記ジャンプ先命令をフェッチし、前記モード
レジスタが第1のモードを示している場合には、前記無
条件ジャンプ命令を前記命令実行部で処理し、前記モー
ドレジスタが第2のモードを示している場合には、前記
無条件ジャンプ命令を前記命令実行部で処理しないよう
なしてあることを特徴とするデータ処理装置。
A memory for storing the instruction; an instruction fetch unit for fetching the instruction from the memory; an instruction decoding unit for decoding the instruction fetched by the instruction fetch unit; An instruction execution unit that executes an instruction and generates a jump destination address for the processing of a jump instruction.
Means for executing the instruction, and
Jump destination address having transfer means for transferring data to an etching section
Address generation unit and the jump destination
The jump destination address generated by the address generation unit is
Transfer to the instruction fetch unit via transfer means and
Means for instructing the fetch of a prefetch instruction.
The operation mode can be specified by setting the
And a mode register for setting the preceding jump means when the unconditional jump instruction is processed.
The jump destination address by the jump destination address generating unit
The jump destination address is generated by the transfer method.
The instruction is transferred to the instruction fetch unit through a stage.
The switch unit fetches the jump destination instruction, and
If the register indicates the first mode,
The conditional jump instruction is processed by the instruction execution unit, and the
If the register indicates the second mode,
Do not process unconditional jump instructions in the instruction execution unit
The data processing apparatus characterized by are None.
【請求項3】 命令で指定されたアドレスにジャンプす
るジャンプ命令を処理し、ジャンプ先アドレスが指定さ
れた境界条件を満たさない場合に例外を検出するデータ
処理装置であって、 命令を格納するメモリと、 該メモリから命令を取り込む命令フェッチ部と、 該命令フェッチ部が取り込んだ命令をデコードする命令
デコード部と、 該命令デコード部による命令のデコード結果に基づいて
命令を実行する命令実行部と、 ジャンプ命令の処理に関して、ジャンプ先アドレスの生
成を行う手段と、前記ジャンプ先アドレスを前記命令フ
ェッチ部へ転送する転送手段とを有するジャンプ先アド
レス生成部と、ジャンプ先アドレスの境界条件を判定す
る判定手段と、ジャンプ命令処理時に、前記ジャンプ先
アドレス生成部で生成されたジャンプ先アドレスを前記
転送手段を介して前記命令フェッチ部へ転送してジャン
プ先命令のフェッチを指示する手段とを有する先行ジャ
ンプ手段 備え、 無条件ジャンプ命令処理時に、前記先行ジャンプ手段
は、前記ジャンプ先アドレス生成部でジャンプ先アドレ
スの生成を行い、前記ジャンプ先アドレスを前記転送手
段を介して前記命令フェッチ部へ転送し、前記命令フェ
ッチ部は前記ジャンプ先命令をフェッチし、前記判定手
段で例外が検出されている場合には、前記無条件ジャン
プ命令を前記命令実行部で処理し、前記判定手段で例外
が検出されていない場合には、前記無条件ジャンプ命令
を前記命令実行部で処理しないようになしてあることを
特徴とするデータ処理装置。
3. A jump to an address specified by an instruction.
The jump instruction is processed and the jump destination address is specified.
That detects an exception if the specified boundary conditions are not met
A processing device, comprising: a memory for storing an instruction; an instruction fetch unit for fetching the instruction from the memory; an instruction decoding unit for decoding the instruction fetched by the instruction fetch unit; and a decoding result of the instruction by the instruction decoding unit. An instruction execution unit that executes an instruction based on the instruction; a unit that generates a jump destination address for processing of the jump instruction; and a transfer destination address generation unit that includes a transfer unit that transfers the jump destination address to the instruction fetch unit. Judge the boundary condition of the jump destination address
And a means for transferring a jump destination address generated by the jump destination address generation unit to the instruction fetch unit via the transfer unit and instructing a fetch of a jump destination instruction during jump instruction processing. Preceding jump means , when the unconditional jump instruction is processed, the preceding jump means generates a jump destination address in the jump destination address generation section, and stores the jump destination address in the instruction fetch section via the transfer means. transferred to the instruction fetch unit fetches the jump destination instruction, the determination hand
If an exception is detected in the stage, the unconditional jump instruction is processed by the instruction execution unit, and the exception is detected by the determination unit.
The data processing device is characterized in that when no is detected , the unconditional jump instruction is not processed by the instruction execution unit.
JP36158997A 1997-12-26 1997-12-26 Data processing device Expired - Lifetime JP2928879B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP36158997A JP2928879B2 (en) 1997-12-26 1997-12-26 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36158997A JP2928879B2 (en) 1997-12-26 1997-12-26 Data processing device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP4022695A Division JP2761688B2 (en) 1992-02-07 1992-02-07 Data processing device

Publications (2)

Publication Number Publication Date
JPH10154074A JPH10154074A (en) 1998-06-09
JP2928879B2 true JP2928879B2 (en) 1999-08-03

Family

ID=18474196

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36158997A Expired - Lifetime JP2928879B2 (en) 1997-12-26 1997-12-26 Data processing device

Country Status (1)

Country Link
JP (1) JP2928879B2 (en)

Also Published As

Publication number Publication date
JPH10154074A (en) 1998-06-09

Similar Documents

Publication Publication Date Title
JP2761688B2 (en) Data processing device
JP3977016B2 (en) A processor configured to map logical register numbers to physical register numbers using virtual register numbers
EP0380859B1 (en) Method of preprocessing multiple instructions
US5717946A (en) Data processor
JP2002525742A (en) Mechanism for transfer from storage to load
JP3543181B2 (en) Data processing device
JP2507638B2 (en) Data processing device
JPH04260950A (en) Cache memory device
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
JP2847974B2 (en) Data processing device
JPH01214932A (en) Data processor
JP3866920B2 (en) A processor configured to selectively free physical registers during instruction retirement
JP2669158B2 (en) Data processing device
JP3345787B2 (en) Data processing device
EP1974254A2 (en) Early conditional selection of an operand
JP3751402B2 (en) Multi-pipeline microprocessor with data accuracy mode indicator
JPH07120284B2 (en) Data processing device
JP2668456B2 (en) Bit search circuit and data processing device having the same
US5737562A (en) CPU pipeline having queuing stage to facilitate branch instructions
US20050144427A1 (en) Processor including branch prediction mechanism for far jump and far call instructions
US5212779A (en) System for guarantee reexecution after interruption by conditionally used store buffer if microinstruction being executed is a memory write and last microinstruction
JP2928879B2 (en) Data processing device
JP2504235B2 (en) Data processing device
JP2646855B2 (en) Data processing device
JP2532560B2 (en) Data processing device for high-performance exception handling

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 9

Free format text: PAYMENT UNTIL: 20080521

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080521

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090521

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100521

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110521

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20110521

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110521

Year of fee payment: 12

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120521

Year of fee payment: 13

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120521

Year of fee payment: 13