JPH0218621A - Data processor - Google Patents
Data processorInfo
- Publication number
- JPH0218621A JPH0218621A JP16961488A JP16961488A JPH0218621A JP H0218621 A JPH0218621 A JP H0218621A JP 16961488 A JP16961488 A JP 16961488A JP 16961488 A JP16961488 A JP 16961488A JP H0218621 A JPH0218621 A JP H0218621A
- Authority
- JP
- Japan
- Prior art keywords
- stage
- instruction
- code
- register
- operand
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Advance Control (AREA)
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野コ
本発明は高度なパイプライン処理機構により高い処理能
力を実現したデータ処理装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a data processing device that achieves high processing performance through an advanced pipeline processing mechanism.
[従来の技術]
第31図は、従来のデータ処理装置の典型的なパイプラ
インステージの構成を示す模式図である。[Prior Art] FIG. 31 is a schematic diagram showing the configuration of a typical pipeline stage of a conventional data processing device.
図において、71は命令フェッチ(IP)ステージ、7
2は命令デコード(D)ステージ、73はオペランドア
ドレス計算(A)ステージ、74はオペランドフェッチ
(F)ステージ、75は命令実行(E)ステージ、76
はオペランドライト (W)ステージである。In the figure, 71 is an instruction fetch (IP) stage;
2 is an instruction decode (D) stage, 73 is an operand address calculation (A) stage, 74 is an operand fetch (F) stage, 75 is an instruction execution (E) stage, 76
is the operand light (W) stage.
次に動作について説明する。第31図に示したデータ処
理装置のパイプライン機構は、バスがおいている時間を
利用して命令データの取り込みを行うIFステージ71
.命令データの解析を行うDステージ72.オペランド
等のアドレス計算を行うAステージ73.オペランドデ
ータのフェッチを行うFステージ74.データの処理を
行うEステージ75オペランドデータの書き込みを行う
Wステージ7606段のパイプラインステージで構成さ
れており、各ステージは異なる命令を同時に処理できる
。但し、オペランドあるいはメモリのアクセスに際して
コンフリクトが生じた場合には、優先度の低いステージ
における処理がコンフリクト解消までの間、−時停止さ
れる。Next, the operation will be explained. The pipeline mechanism of the data processing device shown in FIG.
.. D stage 72 for analyzing instruction data. A stage 73 for calculating addresses of operands, etc. F stage 74 for fetching operand data. It is composed of 6 pipeline stages: an E stage 76 for processing data, and a W stage 760 for writing operand data, and each stage can process different instructions simultaneously. However, if a conflict occurs when accessing an operand or memory, processing at a stage with a lower priority is stopped until the conflict is resolved.
以上のように、パイプライン化されたデータ処理装置で
は、データ処理の流れに従って処理を複数のステージに
分割し、各ステージを同時に動作させることにより、■
命令に必要な平均処理時間を短縮させて、全体としての
処理時間を短縮して性能を向上させている。As described above, in a pipelined data processing device, processing is divided into multiple stages according to the flow of data processing, and each stage is operated simultaneously.
By shortening the average processing time required for each instruction, the overall processing time is shortened and performance is improved.
従来のパイプライン処理は上述の如くであるが、パイプ
ライン処理の構成上注意しなければならない問題点とし
て、使用するリソースのコンフリクトが挙げられる。具
体例を挙げると、レジスタのコンフリクトがその例で、
アドレス計算時に参照したレジスタの内容をパイプライ
ン中を先行して処理されている命令が書換えられた場合
には誤った結果を生しるというものである。Conventional pipeline processing is as described above, but one problem that must be taken into account when configuring pipeline processing is conflicts in the resources used. A specific example is a register conflict.
If the contents of the register referenced during address calculation are rewritten in an instruction that is being processed in advance in the pipeline, an incorrect result will be produced.
このような問題点の解決を目的として、たとえば特願昭
62−144394号の発明に開示されているようなレ
ジスタコンフリクトチエツク手段が提案されている。In order to solve these problems, a register conflict check means has been proposed, for example, as disclosed in Japanese Patent Application No. 144394/1982.
この特願昭62−144394号の発明の動作について
説明する。実行ステージで値が書換えられる可能性があ
るレジスタに関してはアドレス計算ステージでのアドレ
ス計算結果に従ってレジスタの書込み予約を行う。この
書込み予約の情報は実行ステージでの書込みが終了して
書込み予約が解除されるまで保持される。一方、アドレ
ス計算時には参照しようとするレジスタが、パイプライ
ン中で先行処理が行われている命令によって書換えられ
る可能性があるか否かをチエ、りする。書換えられる可
能性がある場合は処理が一時停止され、先行処理命令に
よるレジスタへの書込みが終了し、書込み予約が解除さ
れてからレジスタの参照が行われる。The operation of the invention disclosed in Japanese Patent Application No. 62-144394 will be explained. For registers whose values may be rewritten in the execution stage, a write reservation for the registers is made according to the address calculation result in the address calculation stage. This write reservation information is held until the writing in the execution stage is completed and the write reservation is canceled. On the other hand, when calculating an address, it is checked whether the register to be referenced is likely to be rewritten by an instruction that is being processed in advance in the pipeline. If there is a possibility of rewriting, processing is temporarily stopped, writing to the register by the preceding processing instruction is completed, and the register is referenced after the write reservation is canceled.
このような処理を行うことにより、特願昭621443
94号の発明ではアドレス計算時に正しいレジスタ値が
参照されることを保証している。この例では、レジスタ
の書込み予約は工つの汎用レジスタのみか、その他特定
のレジスタ群(全レジスタを含む)を指定可能である。By performing such processing, patent application No. 621443
The invention of No. 94 guarantees that the correct register value is referenced when calculating an address. In this example, register write reservation can specify only one general-purpose register or other specific register groups (including all registers).
[発明が解決しようとする課題]
従来のデータ処理装置のパイプライン処理機構では上述
の如く、命令デコードステージで一度に処理される命令
コード中に書換えを行う2つの任意のレジスタが指定さ
れる場合、全レジスタの書込み予約を行うか、あるいは
2つの任意の書き込みレジスタを一度に予約できるよう
にハードウェアを追加する必要があり、構成の複雑化、
ハードウェア両の増大を招来している。[Problems to be Solved by the Invention] As described above, in the pipeline processing mechanism of a conventional data processing device, when two arbitrary registers to be rewritten are specified in the instruction code that is processed at once in the instruction decode stage. , it is necessary to reserve all registers for writing, or to add hardware to reserve two arbitrary write registers at once, which increases the complexity of the configuration.
This has led to an increase in hardware.
本発明は、上述の如くハードウェアの追加をする事なく
、2つの任意のレジスタの書込み予約を行い得るデータ
処理装置の提供を目的とする。An object of the present invention is to provide a data processing device that can reserve writing to two arbitrary registers without adding any hardware as described above.
[課題を解決するための手段]
本発明のデータ処理装置は、命令デコードステージがオ
ペランドの書き込みを行う第1及び第2のレジスタ指定
フィールドをもつ命令を処理する場合、第1のレジスタ
指定フィールドの情報を含む第1の単位処理コードと、
第2のレジスタ指定フィールドの情報を含む第2の単位
処理コードとを生成する。更に、アドレス計算ステージ
でレジスタ予約処理のみの指示情報を有するパイプライ
ン処理単位を吸収して一つの単位処理コードにする。[Means for Solving the Problems] When the instruction decoding stage processes an instruction having first and second register designation fields in which operands are written, the data processing device of the present invention has the following advantages: a first unit processing code containing information;
A second unit processing code including information of the second register specification field is generated. Furthermore, in the address calculation stage, pipeline processing units having instruction information only for register reservation processing are absorbed into one unit processing code.
Y作用]
本発明のデータ処理装置では、1つの命令デコド単位の
命令コード中に書き込みを行うレジスタ指定フィールド
を2つ含む命令コードに対してデコードを行う場合、命
令デコードステージにおいて、まず第1のレジスタの予
約情報を含む第1のデコード結果が出力され、次に第2
のレジスタの予約情報を含む第2のデコード結果が出力
されてそれぞれについて一つずつのレジスタ予約が行わ
れる。更に、アドレス計算ステージにおける第1のデコ
ード結果に対する処理結果は次ステージ以後へは出力さ
れず、第2のデコード結果に対する処理結果のみが次ス
テージ以降のステージへ出力される。Y effect] In the data processing device of the present invention, when decoding an instruction code that includes two register specification fields for writing in one instruction decode unit, first, in the instruction decode stage, the first The first decoding result including the register reservation information is output, and then the second decoding result is output.
A second decoding result including reservation information for each register is output, and one register is reserved for each register. Further, the processing result for the first decoding result in the address calculation stage is not output to the next stage and subsequent stages, and only the processing result for the second decoding result is output to the next stage and subsequent stages.
[発明の実施例コ
以下、本発明をその実施例を示す図面に基づいて詳述す
る。[Embodiments of the Invention] The present invention will be described in detail below based on drawings showing embodiments thereof.
(1)1本発明のデータ処理装置の命令フォーマント」
本発明のデータ処理装置の命令は16ビツト単位で可変
長となっており、奇数バイト長の命令は使用しない。(1) 1. Instruction formant of data processing device of the present invention”
The instructions of the data processing device of the present invention have a variable length in units of 16 bits, and instructions with an odd number of bytes are not used.
本発明のデータ処理装置では高頻度命令を短いフォーマ
ントとする目的で特に工夫された命令フォーマット体系
を有する。例えば、2オペランド命令に関しては基本的
に“4バイト+拡張部”の構成を有して総てのアドレッ
シングモードが利用可能な一般形フオーマットと、使用
頻度の高い命令及びアドレッシングモードのみが使用可
能な短縮形フォーマットの2つのフォーマットとがある
。The data processing device of the present invention has an instruction format system specially devised for the purpose of converting high-frequency instructions into short formants. For example, for 2-operand instructions, there is a general format that basically has a configuration of "4 bytes + extension" and all addressing modes can be used, and a general format in which only frequently used instructions and addressing modes can be used. There are two abbreviated formats.
本発明のデータ処理装置の命令フォーマント中に現われ
る記号の意味は次の通りである。The meanings of the symbols appearing in the instruction form of the data processing device of the present invention are as follows.
:オペレーションコードが入る部分
#:リテラルまたは即値が入る部分
Ea:8ビy I・の−船形のアドレッシングモードで
オペランドを指定する部分
Sh:6ビツトの短縮形のアドレッシングモドでオペラ
ンドを指定する部分
Rn;レジスタ上のオペランドをレジスタ番号で指定す
る部分
フォーマットは、第3図に示す如く右側が1、SB側で
且つ高いアドレスになっている。アドレスNとアドレス
N+1の2バイトを見ないと命令フォーマットが判別で
きないようになっているが、これは前述の如く、命令が
必ず16ビツト(2ハイド)単位でフェッチ及びデコー
ドされることを前提としているためである。: Part where operation code is entered #: Part where literal or immediate value is entered Ea: Part that specifies the operand in the 8-bit I-ship-shaped addressing mode Sh: Part that specifies the operand in the 6-bit abbreviated addressing mode Rn ; In the partial format in which operands on registers are designated by register numbers, as shown in FIG. 3, the right side is 1, the SB side is the higher address. The instruction format cannot be determined without looking at the two bytes of address N and address N+1, but this is based on the assumption that instructions are always fetched and decoded in 16-bit (2-hyde) units, as mentioned above. This is because there is.
本発明のデータ処理装置では、いずれのフォーマットの
場合も、各オペランドのEaまたはshの拡張部は必ず
そのEaまたはshの基本部を含むハーフワードの直後
に位置される。これは、命令により暗黙に指定される即
値データあるいは命令の拡張部に優先する。従って、4
バイト以上の命令では、Eaの拡張部によって命令のオ
ペレーションコードが分断される場合がある。In the data processing apparatus of the present invention, in any format, the extended part of Ea or sh of each operand is always located immediately after the halfword containing the basic part of Ea or sh. This overrides any immediate data or extensions of the instruction implicitly specified by the instruction. Therefore, 4
For instructions larger than a byte, the operation code of the instruction may be divided by the extension part of Ea.
また後述する如く、多段間接モードによってEaの拡張
部に更に拡張部が付く場合にも、次の命令オペレーショ
ンコードよりもそちらの方が優先される。例えば、第1
ハーフワードにEalを含み、第2ハーフワードにEa
2を含み、第3ハーフワドまである6ハイト命令の場合
を考える。Ealに多段間接モードを使用したため、普
通の拡張部の他に多段間接モードの拡張部も付くものと
すると、実際の命令ビットパターンは、命令の第1ハー
フワード(Ealの基本部を含む)、 Ealの拡張部
、Ealの多段間接モード拡張部、命令の第2ハーフワ
ード(Ea2の基本部を含む)、 Ealの拡張部、命
令の第3ハーフワードの順となる。Further, as will be described later, even when an extension part is added to the extension part of Ea in the multi-stage indirect mode, that part is given priority over the next instruction operation code. For example, the first
Halfword contains Eal, second halfword contains Ea
Consider the case of a 6-height instruction containing 2 and up to the third half-word. Since the multi-indirect mode is used for Eal, assuming that the multi-indirect mode extension is included in addition to the normal extension, the actual instruction bit pattern is the first halfword of the instruction (including the basic part of Eal), The order is the extension of Eal, the multi-indirect mode extension of Eal, the second halfword of the instruction (including the base of Ea2), the extension of Eal, and the third halfword of the instruction.
(]、、1) r短縮形2オペランド命令」第4図か
ら第7図は2オペランド命令の短縮形フォーマントを示
す模式図である。(],,1) rReduced 2-Operand Instruction" FIGS. 4 to 7 are schematic diagrams showing the abbreviation formant of the 2-operand instruction.
第4図はメモリーレジスタ間演算命令のフォーマントを
示す模式図である。このフォーマットには、ソースオペ
ランド側がメモリとなるL−formatと、デスティ
ネーションオペランド側がメモリとなるS−forma
tとがある。FIG. 4 is a schematic diagram showing the formant of an operation instruction between memory registers. This format includes L-format, where the source operand side is memory, and S-format, where the destination operand side is memory.
There is a t.
L−formatでは、shはソースオペランドの指定
フィールドを、Rnはデスティネーションオペランドの
レジスタの指定フィールドを、RRはshのオペランド
サイズの指定をそれぞれ表す。レジスタ上に位置された
デスティネーションオペランドのサイズは32ビツトに
固定されている。レジスタ側とメモリ側とのサイズが異
なり、ソース側のサイズが小さい場合に符号拡張が行な
われる。In L-format, sh represents a source operand designation field, Rn represents a destination operand register designation field, and RR designates the sh operand size. The size of the destination operand located on the register is fixed at 32 bits. Sign extension is performed when the size of the register side and the memory side are different and the size of the source side is small.
S−formatでは、shはデスティネーションオペ
ランドの指定フィールドを、Rnはソースオペランドの
レジスタ指定フィールドを、RRはshのオペランドサ
イズの指定をそれぞれ表す。レジスタ上に位置されたソ
ースオペランドのサイズは32ビツトに固定されている
。レジスタ側とメモリ側とのサイズが異なり、ソース側
のサイズが大きい場合にオーバフローした部分の切捨て
とオーバフローチエツクが行なわれる。In the S-format, sh represents a destination operand designation field, Rn represents a source operand register designation field, and RR represents sh operand size designation. The size of the source operand located on the register is fixed at 32 bits. If the size of the register side and the memory side are different and the size of the source side is large, the overflow portion is truncated and an overflow check is performed.
第5図はレジスターレジスフ間演算命令のフォーマット
(R−forma t)を示す模式図である。Rnはデ
スティネーションレジスタの指定フィールド、Rmはソ
ースレジスタの指定フィールドである。オペランドサイ
ズは32ビツトのみである。FIG. 5 is a schematic diagram showing the format (R-format) of an inter-register operation instruction. Rn is a destination register designation field, and Rm is a source register designation field. The operand size is only 32 bits.
第6図はリテラル−メモリ間演算命令のフォーマツ)
(Q−format)を示す模式図である。問はディス
ティネーションオペランドサイズの指定フィルド、#I
#はリテラルによるソースオペランドの指定フィールド
、shはデスティネーションオペランドの指定フィール
ドである。Figure 6 is the format of literal-memory operation instructions)
(Q-format). The question is the destination operand size specification field, #I
# is a literal source operand designation field, and sh is a destination operand designation field.
第7図は即値−メモリ間演算命令のフォーマント(1−
format)を示す模式図である。MMはオペランド
サイズの指定フィールド(ソース、ディスティネーショ
ンで共通) 、shはデスティネーションオペランドの
指定フィールドである。L−formatの即値のサイ
ズはデスティネーション側のオペランドのサイズと共通
に8.16.32ビツトとなり、ゼロ拡張及び符号拡張
は行なわれない。Figure 7 shows the formant (1-
FIG. MM is an operand size specification field (common for source and destination), and sh is a destination operand specification field. The size of the immediate value of L-format is 8.16.32 bits, which is the same as the size of the destination operand, and zero extension and sign extension are not performed.
(1,2) r−船形1オペランド命令」第8図は1
オペランド命令の一膜形フオーマツ) (Gl−for
mat)を示す模式図である。問はオペランドサイズの
指定フィールドである。一部のG1forvnat命令
では、Eaの拡張部以外にも拡張部がある。また、聞を
使用しない命令もある。(1, 2) r-ship shape 1 operand command” Figure 8 shows 1
Single film format of operand instruction) (Gl-for
FIG. The question is the operand size specification field. Some G1forvnat instructions have extensions in addition to the Ea extension. There are also some commands that do not use .
(1,3) r−船形2オペランド命令」第9図から
第11図は2オペランド命令の一膜形フオーマットを示
す模式図である。このフォーマントに含まれるのは、8
ビツトで指定する一膜形アドレッシングモードのオペラ
ンドが最大2つ存在する命令である。オペランドの総数
自体は3つ以上になる場合がある。(1, 3) r-Ship-shaped 2-operand Instruction" FIGS. 9 to 11 are schematic diagrams showing the single-layer format of the 2-operand instruction. This formant contains 8
This is an instruction that has a maximum of two operands in single-layer addressing mode specified by bits. The total number of operands itself may be three or more.
第9図は第1オペランドがメモリ読み出しを必要とする
命令のフォーマット(G−format)を示す模式図
である。EaMはデスティネーションオペランドの指定
フィールド、財はデスティネーションオペランドサイズ
の指定フィールド、EaRはソースオペランド指定フィ
ールド、RRはソースオペランドサイズの指定フィール
ドである。一部のG−format命令では、Ea台あ
るいはEaRの拡張部以外にも拡張部がある。FIG. 9 is a schematic diagram showing the format (G-format) of an instruction whose first operand requires memory reading. EaM is a destination operand specification field, EaR is a destination operand size specification field, EaR is a source operand specification field, and RR is a source operand size specification field. Some G-format instructions have extensions in addition to the Ea or EaR extensions.
第10図は第1オペランドが8ビツト即値の命令のフォ
ーマント(E−format)を示す模式図である。FIG. 10 is a schematic diagram showing the format (E-format) of an instruction whose first operand is an 8-bit immediate value.
EaMはデスティネーションオペランドの指定フィール
ド、聞はデスティネーションオペランドサイズの指定フ
ィールド、#ト・・はソースオペランド値である。EaM is a destination operand designation field, EaM is a destination operand size designation field, and #t... is a source operand value.
E−formatとI−formatとは機能的には類
似しているが、考え方の点では大き←違っている。具体
的には、E−formatはあくまでも2オペランド−
膜形(G−format)の派生形であり、ソースオペ
ランドのサイズが8ビツト固定、ディスティネーション
オペランドのサイズが8 /16/32ビットからの選
択となっている。つまり、E−formatは異種サイ
ズ間の演算を前提とし、デスティネーションオペランド
のサイズに合わせて8ビツトのソースオペランドがゼロ
拡張または符号拡張される。一方、I−formatは
、特に転送命令及び比較命令で頻度の多い即値のパター
ンを短縮形にしたものであり、ソースオペランドとディ
スティネーションオペランドのサイズが等しい。Although E-format and I-format are similar in function, they are very different in terms of way of thinking. Specifically, E-format only has two operands.
It is a derivative of the film format (G-format), and the source operand size is fixed at 8 bits, and the destination operand size can be selected from 8/16/32 bits. In other words, E-format is based on the premise of operations between different sizes, and the 8-bit source operand is zero-extended or sign-extended to match the size of the destination operand. On the other hand, I-format is a shortened form of an immediate value pattern that is frequently used especially in transfer instructions and comparison instructions, and the size of the source operand and destination operand are equal.
第11図は、第1オペランドがアドレス計算のみの命令
のフォーマット(GA−format)を示す模式図で
ある。EaWはデスティネーションオペラントの指定フ
ィールド、開はデスティネーションオペランドサイズの
指定フィールド、EaAはソースオペランドの指定フィ
ールドである。ソースオペランドとしては実行アドレス
の計算結果自体が使用される。FIG. 11 is a schematic diagram showing the format (GA-format) of an instruction whose first operand is only address calculation. EaW is a destination operand specification field, OPEN is a destination operand size specification field, and EaA is a source operand specification field. The execution address calculation result itself is used as the source operand.
第12図は、ショートブランチ命令のフォーマントを示
す模式図である。ccccはブランチ条件指定フィール
ド、disp:8はジャンプ先との変位指定フィールド
であり、本発明のデータ処理装置では8ビツトで変位を
指定する場合には、ビソトバクンでの指定値を2倍して
変位値とする。FIG. 12 is a schematic diagram showing the formant of a short branch instruction. cccc is a branch condition specification field, and disp:8 is a displacement specification field with respect to the jump destination. In the data processing device of the present invention, when specifying a displacement with 8 bits, the specified value in bisotobakun is doubled and the displacement is value.
(1,4) rアドレッシングモード」本発明のデー
タ処理装置のアドレソシングモド指定方法には、レジス
タを含めて6ビツトで指定する短縮形と、8ビツトで指
定する一般形とがある。(1, 4) r Addressing Mode There are two methods for specifying the addressing mode of the data processing apparatus of the present invention: an abbreviated form in which the addressing mode is specified using 6 bits including registers, and a general form in which the addressing mode is specified using 8 bits.
未定義のアドレッシングモードが指定された場合、ある
いは意味的に考えて明らかに不適当なアドレッシングモ
ードの組み合わせが指定された場合には、未定義命令が
実行された場合同様に予約命令例外が発生され、例外処
理が起動される。If an undefined addressing mode is specified, or if a semantically inappropriate combination of addressing modes is specified, a reserved instruction exception will occur in the same way as when an undefined instruction is executed. , exception handling is triggered.
これに該当するのは、デスティネーションが即値モード
の場合、アドレス計算を伴うべきアドレッシングモード
指定フィールドで即値モードを使用した場合等である。This applies when the destination is in immediate mode, or when immediate mode is used in the addressing mode specification field that should involve address calculation.
フォーマントの図中で使われる記号の意味は次の通りで
ある。The meanings of the symbols used in the formant diagrams are as follows.
Rn:レジスタ指定
mem EA : EAで示されるアドレスのメモリ内
容(Sh):6ヒツトの短縮形アドレッシングモードで
の指定方法
(Ea) :8ヒツトの一般形アドレッシングモード
での指定方法
フォーマットの図において破線にて囲繞された部分は拡
張部を示す。Rn: Register specification mem EA: Memory contents of the address indicated by EA (Sh): Specification method in 6-hit abbreviated addressing mode (Ea): Specification method in 8-hit general addressing mode Broken line in the format diagram The area surrounded by indicates an extension.
(1,4,1) r基本アドレッシングモード」本発
明のデータ処理装置は様々なアドレノシングモードをサ
ポートする。それらの内、本発明のデータ処理装置でサ
ポートする基本アドレッシングモードには、レジスタ直
接モード、レジスタ間接モード、レジスタ相対間接モー
ド、即値モード、絶対モード、PC(プログラムカウン
ク)相対間接モード、スタックポツプモード及びスタッ
クブツシュモードがある。(1,4,1) r Basic Addressing Mode The data processing device of the present invention supports various addressing modes. Among them, the basic addressing modes supported by the data processing device of the present invention include register direct mode, register indirect mode, register relative indirect mode, immediate mode, absolute mode, PC (program count) relative indirect mode, and stack point. There are push mode and stack mode.
レジスタ直接モードはレジスタの内容をそのま末オペラ
ンドとする。フォーマノ1〜の模式図を第13図に示す
。Rnは汎用レジスタの番号を示す。In register direct mode, the contents of the register are used as the final operand. A schematic diagram of FORMANO 1~ is shown in FIG. Rn indicates the number of a general-purpose register.
レジスタ間接モードはレジスタの内容をアドレスとする
メモリの内容をオペランドとする。フォマノトの模式図
を第14図に示す。Rnは汎用レジスタの番号を示す。In register indirect mode, the operand is the contents of the memory whose address is the contents of the register. A schematic diagram of the fomanoto is shown in Fig. 14. Rn indicates the number of a general-purpose register.
レジスタ相対間接モードはディスプレースメント値が1
6ビノトであるか32ビツトであるかにより2種類があ
る。それぞれ、レジスタの内容に16ビソトまたは32
ビツトのディスプレースメント値を加えた値をアドレス
とするメモリの内容をオペランドとする。フォーマット
の模式図を第15図に示す。Rnは汎用レジスタの番号
を示す。disp : 16とdisp : 32とは
それぞれ各々16ビツトのディスプレースメント値また
は32ビツトのディスプレースメント値を示す。ディス
プレースメント値は符号イ]きとして扱う。In register relative indirect mode, the displacement value is 1.
There are two types depending on whether it is 6 bits or 32 bits. 16 bits or 32 bits for register contents, respectively.
The operand is the contents of the memory whose address is the value plus the bit displacement value. A schematic diagram of the format is shown in FIG. Rn indicates the number of a general-purpose register. disp:16 and disp:32 each indicate a 16-bit displacement value or a 32-bit displacement value. The displacement value is treated as having a sign.
即値モードは命令コード中で指定されるビットパターン
をそのまま2進数と見なしてオペランドとする。フォー
マットの模式図を第16図に示す。In the immediate mode, the bit pattern specified in the instruction code is treated as a binary number and used as an operand. A schematic diagram of the format is shown in FIG.
imm−dataは即値を示す。imm−dataのサ
イズは、オペランドサイズとして命令中で指定される。imm-data indicates an immediate value. The size of imm-data is specified in the instruction as the operand size.
絶対モードはアドレス値が16ビツトで示されるか32
ビツトで示されるかにより2種類ある。それぞれ、命令
コード中で指定される16ビソトまたは32ヒツトのビ
ットパターンをアドレスとするメモリの内容をオペラン
ドとする。フォーマットの模式図を第17図に示す。a
bs:16とabs:32とはそれぞれ16ビソトまた
は32ビツトのアドレス値を示す。In absolute mode, the address value is indicated by 16 bits or 32
There are two types depending on whether it is indicated by a bit. Each operand is the contents of the memory whose address is a 16-bit or 32-bit pattern specified in the instruction code. A schematic diagram of the format is shown in FIG. a
bs:16 and abs:32 indicate a 16-bit or 32-bit address value, respectively.
abs:16でアドレスが示される時は指定されたアド
レス値を32ビツトに符号拡張する。When an address is indicated by abs:16, the specified address value is sign-extended to 32 bits.
PC相対間接モードはディスプレースメント値がj6ビ
ノトか32ビツトかにより2種類ある。それぞれ、プロ
グラムカウンタの内容に16ビ、1・または32ビツト
のディスブレースメン1−値を加えた値をアドレスとす
るメモリの内容をオペランドとする6フオーマノトの模
式図を第18図に示す。disp : 16とdisp
: 32とはそれぞれ16ビノトのディスプレースメ
ント値または32ビツトのディスプレースメント値を示
す。ディスプレースメント値は符号イ」きとして扱う。There are two types of PC relative indirect modes depending on whether the displacement value is j6 bits or 32 bits. FIG. 18 shows a schematic diagram of a six-format node whose operands are the contents of a memory whose addresses are the contents of the program counter plus a 16-bit, 1, or 32-bit displacement value. disp: 16 and disp
: 32 indicates a 16-bit displacement value or a 32-bit displacement value, respectively. Displacement values are treated as having a sign of "I".
PC相対間接モードにおいて、参照されるプログラムカ
ウンタの値はそのオペランドを含む命令の先頭アドレス
である。多段間接アドレッシングモードにおいてプログ
ラムカウンタの値が参照される場合にも、同しように命
令の先頭のアドレスをPC相対の基準値として使用する
。In PC relative indirect mode, the referenced program counter value is the start address of the instruction containing the operand. When the value of the program counter is referenced in the multi-stage indirect addressing mode, the first address of the instruction is similarly used as the PC-relative reference value.
スタックポツプモードはスタックポインタ(S11)の
内容をアドレスとするメモリの内容をオペランドとする
。オペランドアクセス後、スタックポインタをオペラン
ドサイズだ番ノインクリメントする。The stack pop mode uses the contents of the memory whose address is the contents of the stack pointer (S11) as the operand. After accessing the operand, increment the stack pointer by the operand size.
例えば、32ビツトデータを扱う場合には、オペランド
アクセス後にSPが+4だけ更新(インクリメント)さ
れる。B、Hのサイズのオペランドに対するスタックポ
ツプモードの指定も可能であり、それぞれSPが+1.
+2だけ更新(インクリメント)される。フォーマット
の模式図を第19図に示す。オペランドに対しスタック
ポツプモー1′が意味を持たないものに関しては予約命
令例外が発生される。For example, when handling 32-bit data, SP is updated (incremented) by +4 after operand access. It is also possible to specify stack pop mode for operands of size B and H, each with SP +1.
It is updated (incremented) by +2. A schematic diagram of the format is shown in FIG. A reserved instruction exception is generated for operands in which stack pop mode 1' has no meaning.
具体的に予約命令例外となるのは、writeオペラン
ド、 read−modify−writeオペランド
に対するスタックポツプモード指定である。Specifically, the reserved instruction exception is the stack pop mode specification for the write operand and read-modify-write operand.
スタックブツシュモードはスタックポインタの内容をオ
ペランドサイズだリゾクリメン1−シた内容をアドレス
とするメモリの内容をオペランドとする。スタックブツ
シュモードでは、オペランドアクセス前にスタックポイ
ンタがデクリメントされる。例えば、32ビツトデータ
を扱う場合には、オペランドアクセス前にSPが−4だ
け更新(デクリメント)される。B、Hのサイズのオペ
ランドに対するスタックブツシュモードの指定も可能で
あり、それぞれSPが−1,−2だけ更新(デクリメン
+1 される。フォーマットの模式図を第20図に示す
。オペランドに対してスタックブツシュモードが意味を
持たないものに関しては、予約命令例外が発生される。In the stack bush mode, the operand is the contents of the memory whose address is the contents of the stack pointer resolved to the operand size. In stack bush mode, the stack pointer is decremented before operand access. For example, when handling 32-bit data, SP is updated (decremented) by -4 before operand access. It is also possible to specify stacked bush mode for operands of size B and H, and SP is updated (decremented +1) by -1 and -2, respectively. A schematic diagram of the format is shown in Figure 20. For those for which the stacked bush mode has no meaning, a reserved instruction exception is generated.
具体的に予約命令例外となるのは、readオペランド
、read−modify−wri teオペランドに
対すスタックブツシュモード指定である。Specifically, the reserved instruction exception is the stack bush mode specification for the read operand and read-modify-write operand.
(]、、4.2) r多段間接アドレッシングモード
」如何に複雑なアドレッシングも、基本的には加算と間
接参照の組み合わせに分解される。従って、加算と間接
参照のオペレーションをアドレッシングのプリミティブ
として与えておき、それを任意に組み合わせることがで
きれば、如何なる複雑なアドレッシングモードをも実現
可能となる。本発明のデータ処理装置の多段間接アドレ
ノソングモードはこの様な考え方に基づいたアドレノソ
ングモードである。複雑なアドレッシングモードはモジ
ュール間のデータ参照あるいはAI (人工知能)言語
の処理系に特に有用である。(], 4.2) Multi-stage indirect addressing mode No matter how complex addressing is, it is basically broken down into a combination of addition and indirect reference. Therefore, if addition and indirect reference operations are provided as addressing primitives and can be combined arbitrarily, any complex addressing mode can be realized. The multi-stage indirect adreno song mode of the data processing device of the present invention is an adreno song mode based on this idea. Complex addressing modes are particularly useful for inter-module data references or AI (artificial intelligence) language processing systems.
多段間接アドレッシングモードを指定する場合、基本ア
ドレッシングモード指定フィールドでは、レジスタベー
ス多段間接モート、PCヘース多多量間接モード絶対ヘ
ース多段間接モードの3種類の指定方法の内のいずれか
1つを指定する。When specifying the multi-stage indirect addressing mode, the basic addressing mode specification field specifies one of three types of specification methods: register-based multi-stage indirect mode, PC-based multi-stage indirect mode, and absolute-based multi-stage indirect mode.
レジスタベース多段間接モートはレジスタの値を拡張す
る多段間接アドレッシングのベース値とするアドレッシ
ングモードである。フォーマントの模式図を第21図に
示す。Rnは汎用レジスタの番号を示す。Register-based multi-stage indirect mode is an addressing mode in which the value of a register is used as the base value for multi-stage indirect addressing to be extended. A schematic diagram of the formant is shown in FIG. Rn indicates the number of a general-purpose register.
PCヘース多段間接モードはプログラムカウンタの値を
拡張する多段間接アドレッシングのベース値とするアド
レッシングモードである。ツメ−マントの模式図を第2
2図に示す。The PC-based multi-stage indirect mode is an addressing mode in which the value of the program counter is used as the base value for multi-stage indirect addressing to be extended. The second schematic diagram of the claw cloak
Shown in Figure 2.
絶対ヘース多段間接モードはゼロを拡張する多段間接ア
ドレッシングのベース値とするアドレッシングモードで
ある。フォーマツ1−の模式図を第23図に示す。The absolute Hayes multi-stage indirect mode is an addressing mode that uses zero as the base value of extended multi-stage indirect addressing. A schematic diagram of Formatsu 1- is shown in FIG.
拡張する多段間接モード指定フィールドは16ビツトを
単位としており、これを任意回反復する。The multi-stage indirect mode specification field to be expanded has a unit of 16 bits, and this is repeated any number of times.
1段の多段間接モードにより、ディスブレースメントの
加算、インデクスレジスタのスケーリング(XI、 X
2. X4. X8)と加算、メモリの間接参照を行な
う。多段間接モードのフォーマットの模式図を第24図
に示す。各フィールドは以下に示す意味を持つ。Displacement addition and index register scaling (XI, X
2. X4. X8) and performs indirect reference to memory. A schematic diagram of the format of the multi-stage indirect mode is shown in FIG. Each field has the meaning shown below.
E−0:多段間接モード継続
E−1ニアドレス計算終了
tmp ==> address of opera
nd■−0:メモリ間接参照なし
tmp+disp+Rx*5cale==>tmpI−
1:メモリ間接参照あり
memtmp+disp十Rx*5cale==>1.
mpM=0 : <Rx>をインデクスとして使用
ト1 :特殊なインデクス
<Rx>−〇 インデクス値を加算しない (R
x=0)
〈Rx〉−1プログラムカウンタをイ
ンデクス値として使用
(Rx=PC)
<Rx>=2− reserved
D−0:多段間接モード中の4ビツトのフィルドd4の
値を4倍してディスブレースメント値とし、これを加算
する
d4は符号付きとして扱い、オペラン
ドのサイズとは関係なく必ず4倍して
使用する
D=1:多段間接モードの拡張部で指定されたdisp
x (16/32ピッ日をディスブレースメント値とし
、これを加算する
拡張部のサイズはd4フィールドで指
定する
d4=o001 d:spxは16ビソトd4=o
o10 dispxは32ビットxx;インデクス
のスケール(scale=1/2/4/8)プログラム
カウンタに対してx 2+ ×4+ ×8のスケーリン
グを行なった場合には、その段の処理終了後の中間値(
tmp) として不定値が入る。この多段間接モードに
よってIMられる実効アドレスは予測できない値となる
が、例外は発生しない。プログラムカウンタに対するス
ケーリングの指定は行なってはいけない。E-0: Continuation of multi-stage indirect mode E-1 End of near address calculation tmp ==> address of opera
nd■-0: No memory indirect reference tmp+disp+Rx*5cale==>tmpI-
1: Memory indirect reference memtmp+disp1Rx*5cale==>1.
mpM=0: Use <Rx> as index 1: Special index <Rx>-〇 Do not add index value (R
x=0) <Rx>-1 Use program counter as index value (Rx=PC) <Rx>=2- reserved D-0: Multiply the value of 4-bit field d4 in multi-stage indirect mode by 4 and output D4 is treated as a signed brace value and added to it, and is always multiplied by 4 regardless of the size of the operand.D=1: disp specified in the extension part of multi-stage indirect mode
x (16/32 bits is the displacement value, and the size of the extension to which this is added is specified in the d4 field. d4=o001 d:spx is 16 bits d4=o
o10 dispx is 32 bits xx; index scale (scale = 1/2/4/8) If the program counter is scaled by x 2 + × 4 + × 8, the intermediate value after the processing of that stage is completed. (
An undefined value is entered as tmp). Although the effective address IMed by this multi-stage indirect mode becomes an unpredictable value, no exception occurs. Do not specify scaling for the program counter.
多段間接モードによる命令フォーマントのハリニージョ
ンを第25図、第26図に示す。The precision of the instruction formant in the multi-stage indirect mode is shown in FIGS. 25 and 26.
第25図は、多段間接モートが継続するか終了するかの
バリエーションを示す。FIG. 25 shows a variation of whether the multi-stage indirect moat continues or ends.
第26図は、ディスブレースメン1−のサイズのバリエ
ーションを示す。FIG. 26 shows variations in the size of the disbracemen 1-.
任意段数の多段間接モードが利用できれば、コンパイラ
の中で段数による場合分けが不要になるので、コンパイ
ラの負担が軽減されるというメリットがある。多段の間
接参照の頻度が非常に少ないとしても、コンパイラとし
ては必ず正しいコドを発生できなければならないからで
ある。このため、フォーマット上では任意の段数が可能
になっている。If a multi-stage indirect mode with an arbitrary number of stages can be used, there is no need for the compiler to differentiate between cases based on the number of stages, which has the advantage of reducing the burden on the compiler. This is because even if the frequency of multiple indirect references is very low, the compiler must always be able to generate correct code. Therefore, any number of stages is possible in the format.
(1,5) r例外処理」
本発明のデータ処理装置はソフトウェア負荷の軽減のた
め豊富な例外処理機能を有する。本発明のデータ処理装
置では、例外処理は命令処理を再実行するものく例外)
、命令処理を完了するもの(トラップ)及び割込の3種
類に分けて名称をつけている。また本発明のデータ処理
装置では、この3種の例外処理とシステム障害とを総称
してBITと称する。(1, 5) r Exception Handling” The data processing device of the present invention has abundant exception handling functions to reduce the software load. In the data processing device of the present invention, exception processing involves re-executing instruction processing (exceptions).
They are divided into three types and named: , those that complete instruction processing (traps), and interrupts. Furthermore, in the data processing apparatus of the present invention, these three types of exception handling and system failure are collectively referred to as BIT.
(2)「機能ブロックの構成」
第2図は本発明のデータ処理装置の構成を示すブロック
図である。(2) "Configuration of Functional Blocks" FIG. 2 is a block diagram showing the configuration of the data processing device of the present invention.
本発明のデータ処理装置の内部を機能的に大きく分ける
と、命令フェッチ部101.命令デコード部102、
PC計算部103.オペランドアドレス計算部104マ
イクロROM部105.データ演算部106.外部ハス
インターフェイス部107に分かれる。Functionally, the inside of the data processing device of the present invention can be roughly divided into an instruction fetch unit 101. instruction decoding unit 102,
PC calculation section 103. Operand address calculation section 104 micro ROM section 105. Data calculation unit 106. It is divided into an external lotus interface section 107.
第2図では、その他にCPU外部にアドレスを出力する
ためのアドレス出力回路108と、CPII外部とデー
タを入出力するためのデータ入出力回路109とを他の
機能ブロック部と分けて示した。In addition, in FIG. 2, an address output circuit 108 for outputting an address to the outside of the CPU, and a data input/output circuit 109 for inputting/outputting data to/from the CPII are shown separately from other functional blocks.
(2,1) r命令フェッチ部」
命令フェッチ部101にはブランチバッファ、命令キュ
ーとその制御部等があり、次にフェッチずべき命令のア
ドレスを決定してブランチバッファあるいはCPU外部
のメモリから命令をフェッチする。またブランチバッフ
ァへの命令登録をも行う。(2, 1) r Instruction fetch unit The instruction fetch unit 101 includes a branch buffer, an instruction queue, its control unit, etc., and determines the address of the next instruction to be fetched and fetches the instruction from the branch buffer or memory outside the CPU. fetch. It also registers instructions to the branch buffer.
ブランチバッファは小規模であるためセレクティブキャ
ッシュとして動作する。ブランチバッファの動作の詳細
は特願昭61−202041号で詳しく述べられている
。Since the branch buffer is small, it operates as a selective cache. The details of the operation of the branch buffer are described in detail in Japanese Patent Application No. 61-202041.
次にフェッチすべき命令のアドレスは、命令キューに入
力すべき命令のアドレスとして専用のカウンタにて計算
される。分岐あるいはジャンプが発生した場合には、新
たな命令のアドレスがPCδ1算部103あるいはデー
タ演算部106から転送されてくる。The address of the next instruction to be fetched is calculated by a dedicated counter as the address of the instruction to be input into the instruction queue. When a branch or a jump occurs, the address of a new instruction is transferred from the PCδ1 calculation unit 103 or the data calculation unit 106.
CPu外部のメモリから命令をフェッチする場合は、外
部バスインターフェイス部107を通して、フェッチす
べき命令のアドレスをアドレス出力回路108からCP
u外部へ出力し、データ入出力回路109から命令コー
トをフェッチする。そして、ハソファリングした命令コ
ードの内、次にデコードすべき命令コードを命令デコー
ド部102に出力する。When fetching an instruction from a memory external to the CPU, the address of the instruction to be fetched is sent from the address output circuit 108 to the CPU via the external bus interface unit 107.
u output to the outside and fetch the instruction code from the data input/output circuit 109. Then, the instruction code to be decoded next among the output instruction codes is output to the instruction decoding unit 102.
(2,2) r命令デコード部」
命令デコード部102では、基本的には16ビツト(ハ
ーフワード)単位で命令コードをデコードする。このブ
ロックには第1ハーフワードに含まれるオペレーション
コードをデコードするFH−デコーダ、第2.第3ハー
フワードに含まれるオペレーションコードをデコードす
るNFIIWデコーダ、アドレッシングモードをデコー
ドするアドレッシングモードデコーダが含まれる。これ
らPIIWデコーダ、NF)tWデコーダ、アドレッシ
ングモードデコーダを纏めて第1デコーダという。(2, 2) r Instruction Decoding Unit” The instruction decoding unit 102 basically decodes instruction codes in units of 16 bits (halfwords). This block includes an FH-decoder for decoding the operation code contained in the first halfword, a second . An NFIIW decoder decodes the operation code included in the third halfword, and an addressing mode decoder decodes the addressing mode. These PIIW decoder, NF)tW decoder, and addressing mode decoder are collectively referred to as a first decoder.
FHWデコーダあるいはNFHWデコーダの出力を更に
デコードして、マイクロROMのエントリアドレスを計
算する第2デコーダ、条件分岐命令の分岐予測を行う分
岐予測機構、オペランドアドレス計算の際のパイプライ
ンコンフリクトをチエツクするアドレス計算コンフリク
トチエツク機構も含まれる。A second decoder that further decodes the output of the FHW decoder or NFHW decoder to calculate the entry address of the micro ROM, a branch prediction mechanism that predicts branches of conditional branch instructions, and an address that checks pipeline conflicts when calculating operand addresses. A computational conflict checking mechanism is also included.
命令デコード部102は命令フェッチ部101から入力
された命令コードを2クロツク(1ステツプ)につきθ
〜6バイトずつデコードする。デコード結果の内、デー
タ演算部′1.06での演算に関する情報がマイクロR
OM部105に、オペランドアドレス計算に関係する情
報がオペランドアドレス計算部104に、pc計算に関
係する情報がpc計算部103にそれぞれ出力される。The instruction decode unit 102 converts the instruction code input from the instruction fetch unit 101 by θ every two clocks (one step).
~Decode 6 bytes at a time. Among the decoding results, information regarding the calculation in the data calculation section '1.06 is
The OM unit 105 outputs information related to operand address calculation to the operand address calculation unit 104, and the information related to pc calculation to the pc calculation unit 103.
(2,3) rマイクロROM部」
マイクロROM部105には、主にデータ演算部106
を制御するマイクロプログラムが格納されているマイク
ロRAM 、マイクロシーケンサ、マイクロ命令デコー
ダ等が含まれる。マイクロ命令はマイクロROMから2
クロツク(1ステツプ)に1度読出される。マイクロシ
ーケンサはマイクロプログラムで示されるシーケンス処
理の他に、例外、割込及びトラップ(この3つを合わせ
てEl↑と称する)の処理をハードウェア的に受付ける
。またマイクロROM部105はストアハソフプの管理
も行う。マイクロROM部105には命令コードに依存
しない割込みあるいは演算実行結果によるフラッグ情報
と、第2デコーダの出力等の命令デコード部の出力が入
力される。マイクロデコーダの出力は主にデータ演算部
106に対して出力されるが、ジャンプ命令の実行によ
る他の先行処理中止情報等の一部の情報は他のブロック
へも出力される。(2, 3) ``Micro ROM section'' The micro ROM section 105 mainly includes a data calculation section 106.
It includes a micro RAM in which a micro program for controlling is stored, a micro sequencer, a micro instruction decoder, etc. 2 micro instructions from micro ROM
It is read out once per clock (1 step). In addition to the sequence processing indicated by the microprogram, the microsequencer accepts processing of exceptions, interrupts, and traps (these three are collectively referred to as El↑) using hardware. The micro ROM unit 105 also manages the store hardware. The micro ROM unit 105 receives flag information based on interrupts or operation results that do not depend on instruction codes, and outputs from the instruction decoding unit such as the output from the second decoder. The output of the micro-decoder is mainly output to the data calculation unit 106, but some information, such as other preceding processing stop information due to execution of a jump instruction, is also output to other blocks.
(2,4) rオペランドアドレス引算部」オペラン
ドアドレス計算部104は命令デコード部102のアド
レスデコーダ等から出力されたオペランドアドレス計算
に関係する情報によりハードワイヤード制御される。こ
のブロックではオペランドのアドレス計算に関するほと
んどの処理が行われる。メモリ間接アドレシングのため
のメモリアクセスのアドレス及びオペランドアドレスが
メモリにマツプされたI10領域に入るか否かのチエツ
クも行われる。(2, 4) r Operand Address Subtraction Unit The operand address calculation unit 104 is hard-wired controlled by information related to operand address calculation output from the address decoder of the instruction decoding unit 102, etc. This block performs most of the processing related to operand address calculation. A check is also made to see if the memory access address and operand address for memory indirect addressing fall into the memory mapped I10 area.
アドレス計算結果は外部バスインターフェイス部107
に送られる。アドレス計算に必要な汎用レジスタ及びプ
ログラムカウンタの値はデータ演算部より人力される。The address calculation result is sent to the external bus interface section 107.
sent to. The values of the general-purpose registers and program counter necessary for address calculation are input manually from the data calculation section.
メモリ間接アドレッシングを行う際は外部バスインター
フェイス部107を通してアドレス出力回路108から
CPU外部へ参照すべきメモリアドレスを出力し、デー
タ入出力部109から入力された間接アドレス値を命令
デコード部102を通してフェッチする。When indirect memory addressing is performed, the address output circuit 108 outputs the memory address to be referenced to the outside of the CPU through the external bus interface section 107, and the indirect address value input from the data input/output section 109 is fetched through the instruction decoding section 102. .
(2,5) rPC計算部」
pc計算部103は命令デコード部102から出力され
るPC計算に関係する情報によりハードワイヤドに制御
され、命令のpc値を割算する。本発明のデータ処理装
置は可変長命令セントを有しており、命令をデコードし
なければその命令の長さが判らない。このため、PC計
算部103は命令デコード部102から出力される命令
長をデコード中の命令のpc値に加算することにより次
の命令のpc値を作り出す。また、命令デコード部10
2が分岐命令をデコードしてデコード段階での分岐を指
示した場合は、命令長の代わりに分岐変位を分岐命令の
pc値に加算することにより分岐先命令のpc値を計算
する。分岐命令に対して命令デコード段階で分岐を行う
ことを本発明のデータ処理装置ではプリブランチと称す
る。(2, 5) rPC calculation unit” The pc calculation unit 103 is hard-wired controlled by information related to PC calculation output from the instruction decoding unit 102, and divides the pc value of the instruction. The data processing device of the present invention has a variable length instruction code, and the length of the instruction cannot be determined unless the instruction is decoded. Therefore, the PC calculation unit 103 creates the pc value of the next instruction by adding the instruction length output from the instruction decoding unit 102 to the pc value of the instruction being decoded. In addition, the instruction decoding unit 10
2 decodes a branch instruction and instructs a branch at the decoding stage, the pc value of the branch destination instruction is calculated by adding the branch displacement instead of the instruction length to the pc value of the branch instruction. In the data processing device of the present invention, branching to a branch instruction at the instruction decoding stage is called pre-branch.
このプリブランチの手法については特願昭612045
00号及び特願昭61−200557号で詳しく述べら
れている。Regarding this pre-branch method, please refer to Japanese Patent Application No. 612045.
00 and Japanese Patent Application No. 61-200557.
pc計算部103の計算結果は各命令のpc値として命
令のデコード結果と共に出力される他、プリブランチ時
には、次にデコードすべき命令のアドレスとして命令フ
ェッチ部101へ出力される。また、次に命令デコード
部102でデコードされる命令の分岐予測のためのアド
レスにも使用される。The calculation result of the pc calculation unit 103 is output as the pc value of each instruction together with the instruction decoding result, and at the time of pre-branch, it is output to the instruction fetch unit 101 as the address of the next instruction to be decoded. It is also used as an address for branch prediction of the next instruction to be decoded by the instruction decoding unit 102.
分岐予測の手法については特願昭62−8394号で詳
しく述べられている。The branch prediction method is described in detail in Japanese Patent Application No. 8394/1983.
(2,6) rデータ演算部」
データ演算部106はマイクロプログラムにより制御さ
れ、マイクロROM部105の出力情報に従って各命令
の機能を実現するに必要な演算をレジスタと演算器で実
行する。演算対象となるオペランドがアドレスあるいは
即値である場合は、オペランドアドレス計算部オペラン
ドアドレス計算部104で計算されたアドレスあるいは
即値を外部ハスインクフェイス部107を通過さゼで得
る。また、演算対象となるオペランドがCPU外部のメ
モリにある場合は、アドレス計算部104で計算された
アトレスをバスインクフェイス部がアドレス出力回路1
0Bから出力して、CPU外部のメモリからフェッチし
たオペランドをデータ入出力回路]09がら得る。(2, 6) r Data Operation Unit The data operation unit 106 is controlled by a microprogram, and uses registers and arithmetic units to execute operations necessary to realize the function of each instruction according to the output information of the micro ROM unit 105. When the operand to be operated on is an address or an immediate value, the address or immediate value calculated by the operand address calculation unit 104 is passed through the external lotus ink face unit 107 and obtained. Furthermore, when the operand to be operated on is in the memory outside the CPU, the address calculated by the address calculation unit 104 is sent to the address output circuit 1 by the bus ink face unit.
The data input/output circuit 09 outputs the data from the data input/output circuit 09 and outputs the operand from the memory outside the CPU.
演算器としてはALU、バレルシフタ、プライオリティ
エンコーダあるいはカウンタ、シフトレジスタなどがあ
る。レジスタと主な演算器の間は3ハスで結合されてお
り、1つのレジスタ間演算を指示する1マイクロ命令を
2クロツク(1ステツプ)で処理する。Examples of arithmetic units include an ALU, a barrel shifter, a priority encoder or counter, and a shift register. The registers and the main arithmetic unit are connected by three hashes, and one microinstruction instructing one register-to-register operation is processed in two clocks (one step).
データ演算時にCPU外部のメモリをアクセスする必要
がある場合は、マイクロプログラムの指示により外部バ
スインターフェイス部107を通してアドレス出力回路
108からアドレスをCPU外部に出力し、データ入出
力回路109を通して目的のデータをフェッチする。When it is necessary to access memory outside the CPU during data calculation, the address is output from the address output circuit 108 to the outside of the CPU through the external bus interface section 107 according to instructions from the microprogram, and the target data is output through the data input/output circuit 109. fetch
CPU外部のメモリにデータをストアする場合は、外部
バスインターフェイス部107を通してアドレス出力回
路108よりアドレスを出力すると同時に、データ入出
力回路109からデータをCPU外部に出力する。オペ
ランドストアを効率的に行うため、データ演算部106
には4バイトのストアバッファが備えられている。When storing data in a memory external to the CPU, an address is output from the address output circuit 108 through the external bus interface section 107, and at the same time, data is output from the data input/output circuit 109 to the outside of the CPU. In order to efficiently store operands, the data calculation unit 106
is equipped with a 4-byte store buffer.
ジャンプ命令の処理あるいは例外処理等を行って新たな
命令アドレスをデータ演算部106が得た場合は、これ
を命令フェッチ部101とPC計算部103へ出力する
。When the data calculation unit 106 obtains a new instruction address by processing a jump instruction or processing an exception, it outputs this to the instruction fetch unit 101 and the PC calculation unit 103.
(2,7) r外部バスインターフェイス部」外部バ
スインターフェイス部107は本発明のデータ処理装置
の外部バスでの通信を制御する。メモリのアクセスはす
べてクロック同期で行われ、最小2クロンクサイクル(
1ステツプ)で行うことができる。(2, 7) ``External Bus Interface Section'' The external bus interface section 107 controls communication on the external bus of the data processing apparatus of the present invention. All memory accesses are clock synchronized and take a minimum of 2 clock cycles (
It can be done in one step).
メモリに対するアクセス要求は命令フェッチ部101、
オペランドアドレス計算部104及びデータ演算部10
6から独立に生じる。外部バスインターフェイス部10
7はこれらのメモリアクセス要求を調停する。更にメモ
リとcPUとを結ぶデータバスサイズである32ビツト
(1ワード)の整置境界を跨ぐメモリ番地にあるデータ
のアクセスは、このブロック内で自動的にワード境界を
跨くことを検知して2回のメモリアクセスに分解して行
う。The instruction fetch unit 101 issues an access request to the memory.
Operand address calculation unit 104 and data calculation unit 10
arises independently from 6. External bus interface section 10
7 arbitrates these memory access requests. Furthermore, when accessing data at a memory address that straddles a 32-bit (1 word) aligned boundary, which is the data bus size that connects memory and the CPU, this block automatically detects that it straddles a word boundary. It is broken down into two memory accesses.
ブリフェッチするオペランドとストアするオペランドと
が重なる場合のコンフリクト防止処理及びストアオペラ
ンドからフェッチオペランドへのバイパス処理も行う。It also performs conflict prevention processing when the pre-fetch operand and store operand overlap, and bypass processing from the store operand to the fetch operand.
(3)「パイプライン機構」
本発明のデータ処理装置のパイプライン処理機能は第1
図に模式的に示される如くである。(3) “Pipeline mechanism” The pipeline processing function of the data processing device of the present invention is the first
As schematically shown in the figure.
命令のブリフェッチを行う命令フェッチステージ(IP
ステージ)201.命令のデコードを行うデコードステ
ージ(Dステージ)202.オペランドのアドレス計算
を行うオペランドアドレス計算ステージ(Aステージ)
203.マイクロROMアクセス(特にRステージ20
6と呼ぶ)を行う部分とオペランドのブリフェッチ(特
にOFステージ207と称す)を行う部分とからなるオ
ペランドフエ’7チステージ(Fステージ)204.命
令を実行する実行ステージ(Eステージ)205の5段
構成をパイプライン処理の基本とする。Instruction fetch stage (IP
Stage) 201. Decode stage (D stage) 202 for decoding instructions. Operand address calculation stage (A stage) that calculates the address of the operand
203. Micro ROM access (especially R stage 20
6) and a part that performs operand brief fetching (particularly referred to as OF stage 207). A five-stage configuration of an execution stage (E stage) 205 for executing instructions is the basis of pipeline processing.
Eステージ205では1段のストアバソファがある他、
高機能命令の一部は命令の実行自体をパイプライン化す
るため、実際には5段以上のパイプライン処理効果があ
る。E stage 205 has a one-stage store bath sofa,
Some of the high-performance instructions pipeline the instruction execution itself, so there is actually a pipeline processing effect of five or more stages.
各ステージは他のステージとは独立に動作し、理論上は
5つのステージが完全に独立動作する。Each stage operates independently of the other stages, and in theory the five stages operate completely independently.
各ステージは1回の処理を最小2クロック(1ステツプ
)で行うことができる。従って理想的には2クロツク(
1ステツプ)毎に次々とパイプライン処理が進行する。Each stage can perform one process in a minimum of two clocks (one step). Therefore, ideally two clocks (
Pipeline processing progresses one after another for each step (1 step).
本発明のデータ処理装置には、メモリーメモリ間演算あ
るいはメモリ間接アドレッシング等の如く1回の基本パ
イプライン処理のみでは処理し得ない命令もあるが、本
発明のデータ処理装置はこれらの処理に対してもなるべ
く均衡のとれたパイプライン処理が行える様に設計され
ている。複数のメモリオペランドを持つ命令に対しては
メモリオペランドの数に基づいてデコード段階で複数の
パイプライン処理単位(ステップコード)に分解してパ
イプライン処理を行う。The data processing device of the present invention has some instructions that cannot be processed with just one basic pipeline process, such as memory-to-memory operations or memory indirect addressing, but the data processing device of the present invention can handle these processes. It is designed to perform pipeline processing as balanced as possible. An instruction having a plurality of memory operands is decomposed into a plurality of pipeline processing units (step codes) at the decoding stage based on the number of memory operands, and pipeline processing is performed.
パイプライン処理単位の分解方法に関しては特願昭61
−236456号で詳しく述べられている。Regarding the decomposition method of pipeline processing units, please refer to the patent application 1986.
It is described in detail in No.-236456.
IFステージ201からDステージ202に渡される情
報は、命令コート211そのものである。Dステジ20
2からAステージ203に渡される情報は、命令で指定
された演算に関するもの(Dコード212と称す)と、
オペランドのアドレス計算に関係するもの(へコード2
13と称す)との2つがある。The information passed from the IF stage 201 to the D stage 202 is the instruction code 211 itself. D stage 20
The information passed from 2 to the A stage 203 is related to the operation specified by the instruction (referred to as the D code 212),
Things related to operand address calculation (code 2
13).
Aステージ203からFステージ204に渡される情報
はマイクロプログラムのエントリアドレスあるいはマイ
クロプログラムのパラメータ等を含むRコード214と
、オペランドのアドレスとアクセス方法指示情報等を含
むFコード215との2つである。The information passed from the A stage 203 to the F stage 204 is an R code 214 that includes the microprogram entry address or microprogram parameters, and an F code 215 that includes the operand address and access method instruction information. .
Fステージ204からEステージ205に渡される情報
は、演算制御情報とリテラル等を含むEコード216と
、オペランドあるいはオペランドアドレス等を含むSコ
ード217との2つである。The information passed from the F stage 204 to the E stage 205 is two types: an E code 216 including arithmetic control information and literals, and an S code 217 including operands or operand addresses.
Bステージ205以外のステージで検出されたEITは
、そのコードがEステージ205に到達する迄はBIT
処理を起動しない。Eステージ205で処理されている
命令のみが実行段階の命令であり、IFステージ201
からFステージ204までの間で処理されている命令は
まだ実行段階に至っていないからである。従って、Eス
テージ205以外で検出されたBITは、それが検出さ
れたことがステップコード中に記録されて次のステージ
に伝えられるのみである。An EIT detected at a stage other than the B stage 205 is a BIT until the code reaches the E stage 205.
Does not start processing. Only the instructions being processed in the E stage 205 are instructions in the execution stage, and the instructions being processed in the IF stage 201
This is because the instructions being processed between F stage 204 and F stage 204 have not yet reached the execution stage. Therefore, when a BIT is detected at a stage other than the E stage 205, its detection is recorded in the step code and only transmitted to the next stage.
(3,1) rパイプライン処理単位」(3,1,1
) r命令コードフィールドの分類」本発明のデータ
処理装置のパイプライン処理単位は命令セントのフォー
マットの特徴を利用して決定されている。(3,1) r pipeline processing unit” (3,1,1
) Classification of Instruction Code Fields The pipeline processing unit of the data processing apparatus of the present invention is determined using the characteristics of the instruction code format.
+11節で述べた如く、本発明のデータ処理装置の命令
は2バイト単位の可変長命令であり、基本的には″2バ
イトの命令基本部+0〜4バイトのアドレシング拡張部
”を1〜3回反復することにより命令が構成されている
。As described in Section +11, the instructions of the data processing device of the present invention are variable length instructions in units of 2 bytes, and basically the "2 byte basic instruction part + 0 to 4 byte addressing extension part" is divided into 1 to 3 An instruction is constructed by repeating it several times.
命令基本部には多くの場合、オペレーションコード部と
アドレッシングモード指定部とがあり、インデノクスア
ドレシノングあるいはメモリ間接アドレッシングが必要
な場合にはアドレッシング拡張部の代わりに“2ハイド
の多段間接モード指定部+0〜4ハイドのアドレッシン
グ拡張部”が任意間付く。また、命令により2または4
ハイドの命令固有の拡張部が最後に付く。In most cases, the instruction basic part has an operation code part and an addressing mode specification part, and if index addressing or memory indirect addressing is required, a "2-hyde multi-stage indirect mode specification part" is used instead of the addressing extension part. Addressing extension part + 0 to 4 hides is optionally spaced. Also, depending on the command, 2 or 4
Hyde's command-specific extensions are added at the end.
命令基本部には命令のオペレーションコード、基本アド
レッシングモード、リテラルなどが含まれる。アドレッ
シング拡張部はディスプレースメント、絶対アドレス、
即値、分岐命令の変位のいずれかである。命令固有の拡
張部にはレジスタマツプ、I−format命令の即値
指定等がある。第27図は、本発明のデータ処理装置の
基本的命令フォーマットの特徴を示す模式図である。The instruction basic part includes the instruction operation code, basic addressing mode, literal, etc. Addressing extensions include displacement, absolute address,
Either an immediate value or a displacement of a branch instruction. Instruction-specific extensions include a register map, immediate value specification for I-format instructions, and the like. FIG. 27 is a schematic diagram showing the characteristics of the basic instruction format of the data processing device of the present invention.
(3,1,2) rステップコードへの命令の分解」
本発明のデータ処理装置では、上記の命令フォーマット
の特徴を生かしたパイプライン処理を行う。(3, 1, 2) Decomposition of instructions into r step code”
The data processing device of the present invention performs pipeline processing that takes advantage of the characteristics of the instruction format described above.
Dステージ202でば“2バイトの命令基本部→−0〜
4ハイドのアドレッシング拡張部”、“多段間接モード
指定部子アドレッシング拡張部”又は命令固有の拡張部
を1つのデコード単位として処理する。各回のデコード
結果をステップコードと称し、Aステージ203以降で
はこのステップコードをパイプライン処理の単位として
いる。ステソプコドの数は命令毎に固有であり、多段間
接モード指定を行わない場合は、1つの命令は最小1個
、最大3個のステップコードに分かれる。多段間接モー
ド指定が行われた場合はそれだけステソプコドが増加す
る。但し、これは後で述べる様にデコード段階のみであ
る。At the D stage 202, “2-byte instruction basic part → −0 ~
4-hide addressing extension, "multi-stage indirect mode specification part addressing extension," or instruction-specific extension are processed as one decoding unit.The decoding result of each time is called a step code, and from the A stage 203 onwards, this The step code is the unit of pipeline processing.The number of step codes is unique for each instruction, and if multi-stage indirect mode is not specified, one instruction is divided into a minimum of 1 step code and a maximum of 3 step codes.Multi-stage When the indirect mode is designated, the step code increases accordingly.However, as will be described later, this is only at the decoding stage.
(3,1,3) rプログラムカウンタの管理」本発
明のデータ処理装置のパイプライン上に存在するステッ
プコードは全て別命令に対するものである可能性があり
、このためプログラムカウンタの値はステップコード毎
に管理される。全てのステップコードは、そのステップ
コードのもとになった命令のプログラムカウンタ値を有
する。ステップコードに付属してパイプラインの各ステ
ジを流れるプログラムカウンタ値はステッププログラム
カウンタ(spc) と称する。sPcはパイプライ
ンステージ間を次々と受は渡されていく。(3, 1, 3) ``Program counter management'' It is possible that all the step codes existing on the pipeline of the data processing device of the present invention are for different instructions, and therefore the value of the program counter is the same as the step code. managed separately. Every step code has the program counter value of the instruction that the step code is based on. The program counter value that accompanies the step code and flows through each stage of the pipeline is referred to as the step program counter (spc). The sPc is passed between pipeline stages one after another.
(3,2) r各パイプラインステージの処理」各パ
イプラインステージの人出カステップコードには第1図
に示したように便宜上名前が付けられている。また、ス
テップコードはオペレーションコードに関する処理を行
い、マイクロプログラムのエントリアドレス及びEステ
ージ205に対するパラメータなどになる系列とEステ
ージ205のマイクロ命令に対するオペランドになる系
列との2系列がある。(3, 2) Processing of Each Pipeline Stage The turnout step codes for each pipeline stage are given names for convenience as shown in FIG. Further, the step code performs processing related to the operation code, and there are two series: a series that becomes the entry address of the microprogram and parameters for the E stage 205, and a series that becomes the operand for the microinstruction of the E stage 205.
(3,2,1) r命令フェッチステージ」命令フェ
ッチステージ(IFステージ)201は命令をメモリあ
るいはブランチバッファからフェッチして命令キュー3
01に入力し、Dステージ202に対して命令コードを
出力する。命令キューの入力は整置された4ハイド単位
で行う。メモリがら命令をフェッチする場合は、整置さ
れた4ハイドにつき最小2クロック(1ステツプ)を要
する。ブランチバッファがヒツトした場合は、整置され
た4バイトにつき1クロツクでフェッチ可能である。(3, 2, 1) r Instruction fetch stage The instruction fetch stage (IF stage) 201 fetches instructions from memory or branch buffer and stores them in the instruction queue 3.
01 and outputs the instruction code to the D stage 202. Input to the instruction queue is performed in units of arranged 4 hides. When fetching an instruction from memory, a minimum of two clocks (one step) is required for every four aligned hides. If the branch buffer is hit, it can be fetched in one clock per four aligned bytes.
命令キューの出力単位ば2ハイド毎に可変であり、2ク
ロツクの間に最大6ハイトまで出力できる。The output unit of the instruction queue is variable every 2 heights, and a maximum of 6 heights can be output during 2 clocks.
また、分岐の直後には命令キューをバイパスして命令基
本部2バイトを直接命令デコーダに転送することも可能
である。Further, immediately after a branch, it is also possible to bypass the instruction queue and directly transfer the 2 bytes of the instruction basic part to the instruction decoder.
ブランチバッファへの命令の登録及びクリア等の制御、
ブリフェッチ先の命令のアドレスの管理や命令キューの
制御もIFステージ201で行う。Control of registering and clearing instructions in the branch buffer,
The IF stage 201 also manages the address of the pre-fetch destination instruction and controls the instruction queue.
IFステージ201で検出するBITには、命令をメモ
リからフェッチする際のバスアクセス例外あるいはメモ
リ保護違反などによるアドレス変換例外がある。BITs detected in the IF stage 201 include bus access exceptions when fetching instructions from memory, address translation exceptions due to memory protection violations, and the like.
(3,2,2) r命令デコードステージ」命令デコ
ードステージ(Dステージ)2o2はIFステージ20
1から入力された命令コードをデコードする。デコード
は命令デコード部102のFIIWデコーダ、NFII
−デコーダ及びアドレッシングモードデコーダを合わせ
た第1デコーダ15を使用して、2クロツク(1ステツ
プ)単位に1度行ない、1回のデコード処理でO〜6バ
イトの命令コードを消費する(RET命令の復帰先アド
レスを含むステップコードの出力処理などでは命令コー
ドを消費しない)。(3, 2, 2) r instruction decode stage” instruction decode stage (D stage) 2o2 is IF stage 20
Decodes the instruction code input from 1. Decoding is performed by the FIIW decoder of the instruction decoding unit 102 and the NFII
- The first decoder 15, which is a combination of a decoder and an addressing mode decoder, is used to perform decoding once every two clocks (one step), and one decoding process consumes 0 to 6 bytes of instruction code (for RET instructions). Instruction codes are not consumed in output processing of step codes including return destination addresses, etc.).
1回のデコードでAステージ203に対してアドレス計
算情報としてのAコード213である制御コードとアド
レス修飾情報と、オペレーションコードの中間デコード
結果としてのDコード212である制御コードと8ビツ
トのリテラル情報とを出力する。この際、デコーダ結果
の一部は中間コード16としてランチ回路17にラッチ
される。このラッチ回路17にラッチされた中間コード
16は再度第1デコーダ15に与えられる。In one decoding, the A stage 203 receives a control code and address modification information, which is an A code 213 as address calculation information, and a control code and 8-bit literal information, which is a D code 212 as an intermediate decoding result of an operation code. Outputs . At this time, part of the decoder result is latched into the launch circuit 17 as the intermediate code 16. The intermediate code 16 latched by the latch circuit 17 is given to the first decoder 15 again.
Dステージ202では、各命令のPC計算部103の制
御、分岐予測処理、プリブランチ命令に対するプリブラ
ンチ処理、命令キューからの命令コード出力処理をも行
う。The D stage 202 also performs control of the PC calculation unit 103 for each instruction, branch prediction processing, prebranch processing for prebranch instructions, and instruction code output processing from the instruction queue.
Dステージ202で検出するEITには、予約命令例外
及びプリブランチ時の奇数アドレスジャンプトラップが
ある。また、IPステージ201より転送されてきた各
種E■Tはステップコード内にエンコードする処理をし
てAステージ203に転送する。EITs detected at the D stage 202 include reserved instruction exceptions and odd address jump traps during pre-branch. Further, various ETs transferred from the IP stage 201 are encoded into step codes and transferred to the A stage 203.
(3,2,3) rオペランドアドレス計算ステージ
」オペランドアドレス計算ステージ(へステージ)20
3は処理機能が大きく2つに分かれる。1つは命令デコ
ード部102の第2デコーダを使用してオペレーション
コードの後段デコードを行う処理で、他方はオペランド
アドレス計算部104でオペランドアドレスの計算を行
う処理である。(3, 2, 3) r operand address calculation stage” operand address calculation stage (to stage) 20
3 is divided into two major processing functions. One is a process in which the second decoder of the instruction decoding unit 102 is used to decode the operation code at a later stage, and the other is a process in which the operand address calculation unit 104 calculates an operand address.
オペレーションコードの後段デコード処理はDコード2
12を入力とし、レジスタ、メモリの書込み予約及びマ
イクロプログラムのエントリアドレスとマイクロプログ
ラムに対するパラメータなどを含むRコード214の出
力を行う。なお、レジスタあるいはメモリの書込み予約
はレジスタ書込み予約部18により行われるが、アドレ
ス計算で参照したレジスタやメモリの内容がパイプライ
ン上を先行する命令で書換えられることにより誤ったア
ドレス計算が行われるのを防ぐためのものである。The subsequent decoding process of the operation code is D code 2.
12 as an input, and outputs an R code 214 including register and memory write reservations, microprogram entry addresses, parameters for the microprogram, and the like. Note that the register or memory write reservation is performed by the register write reservation unit 18, but the contents of the register or memory referenced in address calculation may be rewritten by an instruction that precedes it on the pipeline, resulting in incorrect address calculation. This is to prevent
レジスタあるいはメモリの書込み予約はデッドロックを
避けるため、ステップコード毎ではなく命余録に行う。To avoid deadlock, write reservations for registers or memory are made at intervals rather than for each step code.
レジスタ及びメモリへの書込み予約については特願昭6
2−144394号で詳しく述べられている。For reservations for writing to registers and memory, please refer to the patent application filed in 1986.
2-144394.
オペランドアドレス計算処理はAコード213を入力と
し、Aコード213に従いオペランドアドレス計算部1
04で加算あるいはメモリ間接参照を組み合わせてアド
レス計算を行い、その計算結果をFコード215として
出力する。この際、アドレス計算に伴うレジスタ及びメ
モリの読み出し時にコンフリクトチエツクを行い、先行
命令がレジスタあるいはメモリに書込み処理を終了して
いないためコンフリクトが指示されれば、先行命令がE
ステージ205で書込み処理を終了するまで待つ。また
、オペランドアドレス及びメモリ間接参照のアドレスが
メモリにマツプされたI10領域に入るが否かのチエツ
クも行う。The operand address calculation process takes the A code 213 as input, and operates the operand address calculation unit 1 according to the A code 213.
04 performs address calculation by combining addition or memory indirect reference, and outputs the calculation result as F code 215. At this time, a conflict check is performed when reading registers and memory during address calculation, and if a conflict is indicated because the preceding instruction has not finished writing to the register or memory, the preceding instruction
Wait until the write process is completed at stage 205. It also checks whether the operand address and the memory indirect reference address fall into the I10 area mapped to memory.
Aステージ203で検出するBITには予約命令例外、
特権命令例外、ハスアクセス例外、アドレス変換例外、
メモリ間接アドレッシングの時のオペランドブレイクポ
イントヒントによるデバソグトラソブがある。Dコード
212又はAコード213自体がEITを起こしたこと
を示していれば、Aステージ203はそのコードに対し
てアドレス計算処理をせず、そのEITをRコード21
4及びFコード215に伝える。The BIT detected in the A stage 203 includes a reserved instruction exception,
privileged instruction exception, hash access exception, address translation exception,
There is a devasogtrasob due to operand breakpoint hints during memory indirect addressing. If the D code 212 or A code 213 itself indicates that an EIT has occurred, the A stage 203 does not perform address calculation processing on that code, and transfers the EIT to the R code 21.
4 and F code 215.
(3,2,4) rマイクロROMアクセスステージ
」オペランドフェッチステージ(Fステージ)2o4も
処理が大きく2つに分かれる。一方はマイクロROMの
アクセス処理であり、特にRステージ206と称する。(3, 2, 4) r Micro ROM Access Stage The operand fetch stage (F stage) 2o4 is also roughly divided into two processes. One is access processing of the micro ROM, and is particularly referred to as the R stage 206.
他方はオペランドプリフェッチ処理であり、特にOFス
テージ207と称する。Rステージ206とOFステー
ジ207とは必ずしも同時に動作するわけではなく、メ
モリアクセス権が獲得できるが否が等に依存して独立に
動作する。The other is operand prefetch processing, particularly referred to as OF stage 207. The R stage 206 and the OF stage 207 do not necessarily operate simultaneously, but operate independently depending on whether memory access rights can be acquired or not.
Rステージ206の処理であるマイクロROMアクセス
処理は、Rコード214に対して次のEステージ205
での実行に使用する実行制御コードであるEコード21
6を生成するためのマイクロROMアクセスとマイクロ
命令デコード処理である。1つのRコード214に対す
る処理が2つ以上のマイクロプログラムステップに分解
される場合、マイクロROMはEステージ205で使用
され、次のRコード214はマイクロROMアクセス待
ちになる。Rニド214に対するマイクロROMアクセ
スが行われるのは、その前のEステージ205での最後
のマイクロ命令実行の時である。本発明のデータ処理装
置では、はとんどの基本命令は1マイクロプログラムス
テ、プで行われるため、実際にはRコート214に対す
るマイクロROMアクセスが次りと行われることが多い
。Micro ROM access processing, which is the processing of the R stage 206, is performed on the R code 214 at the next E stage 205.
E code 21 which is the execution control code used for execution in
This is micro ROM access and micro instruction decoding processing to generate 6. When processing for one R code 214 is broken down into two or more microprogram steps, the micro ROM is used in the E stage 205 and the next R code 214 waits for micro ROM access. The micro ROM access to the R nid 214 is performed at the time of execution of the last microinstruction in the previous E stage 205. In the data processing device of the present invention, most basic instructions are executed in one microprogram step, so in reality, the micro ROM access to the R coat 214 is often executed one after the other.
Rステージ206で新たに検出するBITはない。There is no new BIT detected in the R stage 206.
Rコード214が命令処理再実行型のEITを示してい
る時は、その旧T処理に対するマイクロプログラムが実
行されるので、Rステージ206はそのRコード214
に従ったマイクロ命令をフェッチする。When the R code 214 indicates an instruction processing re-execution type EIT, the microprogram for that old T process is executed, so the R stage 206 uses that R code 214.
Fetch microinstructions according to
Rコード214が奇数アドレスジャンプトラップを示し
ている場合、Rステージ206はそれをEコド216に
よって伝える。これはプリブランチに対するもので、E
ステージ205ではそのEコード216で分岐が生じな
ければそのプリブランチを有効として奇数アドレスジャ
ンプトラップを発生ずる。If R code 214 indicates an odd address jump trap, R stage 206 conveys it via E code 216. This is for pre-branch and E
In stage 205, if a branch does not occur in the E code 216, the pre-branch is made valid and an odd address jump trap is generated.
(3,2,5) rオペランドフェッチステージ」オ
ペランドフェッチステージ(OFステージ)207はF
ステージ204で行う上記の2つの処理の内のオペラン
ドプリフェッチ処理を行う。(3, 2, 5) "r operand fetch stage" Operand fetch stage (OF stage) 207 is F
Of the above two processes performed in stage 204, operand prefetch processing is performed.
オペランドプリフェッチはFコード215を入力とし、
フェッチしたオペランドとそのアドレスをSコード21
7として出力する。1つのFコード215ではワード境
界を跨いでも良いが4ハイド以下のオペランドフェッチ
を指定する。Fコード215にはオペランドのアクセス
を行うか否かの指定も含まれており、Aステージ203
で計算したオペランドアドレス自体あるいは即値をEス
テージ205に転送する場合にはオペランドプリフェッ
チは行わず、Fコード215の内容をSコード217と
して転送する。プリフェッチしようとするオペランドと
、Eステージ205が書込み処理を行おうとするオペラ
ンドとが一致する場合は、オペランドプリフェッチはメ
モリから行わずバイパスして行う。また、T10領域に
対してはオペランドプリフェッチを遅延させ、先行命令
がすべて完了するまで待ってオペランドフェッチを行う
。Operand prefetch takes F code 215 as input,
The fetched operand and its address are sent to S code 21.
Output as 7. One F code 215 specifies an operand fetch of 4 hides or less, although it may straddle word boundaries. The F code 215 also includes a designation as to whether or not to access the operand, and the A stage 203
When transferring the operand address itself or the immediate value calculated in , to the E stage 205, operand prefetch is not performed, and the contents of the F code 215 are transferred as the S code 217. If the operand to be prefetched matches the operand to be written by the E stage 205, the operand is not prefetched from the memory but is bypassed. Further, operand prefetch is delayed for the T10 area, and operand fetch is performed after waiting until all preceding instructions are completed.
叶ステージ207で検出されるHITには、ハスアクセ
ス例外、アドレス変換例外、オペランドプリフェッチに
対するブレイクポイントヒノ1−によるデバッグトラン
プがある。Fコード215がデバッグトランプ以外のB
ITを示している時は、それをSコード217に転送し
、オペランドプリフェッチは行わない。Fコード215
がデバッグトランプを示している時は、そのFコード2
15に対してEITを示していない場合と同じ処理をす
ると共にデバッグトランプをSコード217に伝える。The HITs detected in the leaf stage 207 include a hash access exception, an address translation exception, and a debug trump using the breakpoint hino1- for operand prefetch. F code 215 is B other than debug playing cards
When it indicates IT, it is transferred to the S code 217 and no operand prefetch is performed. F code 215
When indicates a debug trump, its F code 2
15, performs the same processing as when no EIT is indicated, and also transmits a debug trump to the S code 217.
(3,2,6) r実行ステージj
実行ステージ(Eステージ)205ばEコード216及
びSコード217を入力として動作する。このEステー
ジ205が命令を実行するステージであり、Fステージ
204以前のステージで行われた処理は全てEステージ
205のための前処理である。Eステージ205でジャ
ンプ命令が実行されたり、あるいはBIT処理が起動さ
れたりした場合は、IFステジ201からFステージ2
04までの処理は全て無効化される。Eステージ205
はマイクロプログラムにより制御され、Rコード214
に示されたマイクロプログラムのエントリアドレスから
の一連のマイクロプログラムを実行することにより命令
を実行する。(3, 2, 6) r Execution stage j Execution stage (E stage) 205 operates with E code 216 and S code 217 as input. This E stage 205 is a stage for executing instructions, and all processing performed in stages before the F stage 204 is preprocessing for the E stage 205. When a jump instruction is executed at E stage 205 or BIT processing is started, the process from IF stage 201 to F stage 2 is performed.
All processes up to 04 are invalidated. E stage 205
is controlled by a microprogram, R code 214
The instructions are executed by executing a series of microprograms starting from the entry address of the microprogram indicated in .
マイクロROMの読み出しとマイクロ命令の実行とはパ
イプライン化されて行われる。従ってマイクロプログラ
ムで分岐が起きた場合は、1マイクロステツプの空きが
できる。また、Eステージ205はデータ演算部106
にあるストアバッファを利用して、4バイト以内のオペ
ランドストアと次のマイクロ命令実行をパイプライン処
理することもできる。Reading of the micro ROM and execution of micro instructions are performed in a pipelined manner. Therefore, when a branch occurs in a microprogram, one microstep becomes available. In addition, the E stage 205 includes the data calculation section 106
It is also possible to perform pipeline processing of operand store within 4 bytes and execution of the next microinstruction using the store buffer located in the .
Eステージ205では、Aステージ203で行ったレジ
スタ及びメモリに対する書込み予約をオペランドの書込
み後に解除する。In the E stage 205, the write reservation for registers and memory made in the A stage 203 is canceled after the operand is written.
また、条件分岐命令がEステージ205で分岐を発した
場合は、その条件分岐命令に対する分岐予測が誤ってい
たのであるから、分岐履歴の書換えを行う。Further, if a conditional branch instruction issues a branch at the E stage 205, the branch prediction for that conditional branch instruction was incorrect, so the branch history is rewritten.
Eステージ205で検出されるBIT には、ハスアク
セス例外、アドレス変換例外、デバッグ1−ランプ、奇
数アドレスジャンプトラップ、予約機能例外、不正オペ
ランド例外、予約スタックフォーマント例外、ゼロ除算
トラップ、無条件トラップ、条件トラップ、遅延コンテ
キス1−トラップ、外部割込、遅延割込、リセット割込
、システム障害がある。BITs detected in the E stage 205 include hash access exception, address translation exception, debug 1-ramp, odd address jump trap, reserved function exception, illegal operand exception, reserved stack formant exception, divide-by-zero trap, and unconditional trap. , conditional traps, delayed context 1-traps, external interrupts, delayed interrupts, reset interrupts, and system failures.
Eステージ205で検出されたBITは全てBIT処理
されるが、Eステージ以前のIFステージ201からF
ステージ204の間で検出され、Rコード214あるい
はSコード217に反映されているBITは必すしもE
I丁処理されるとは限らない。IPステージ20]から
Fステージ204の間で検出されたが、先行の命令がE
ステージ205でジャンプ命令が実行されたなどの原因
でEステージ205まで到達しなかったBITは全てキ
ャンセルされる。そのBITを起こした命令はそもそも
実行されなかったことになる。All BITs detected at E stage 205 are processed, but BITs from IF stage 201 before E stage
BIT detected during stage 204 and reflected in R code 214 or S code 217 is not necessarily E
It does not necessarily mean that it will be processed one by one. IP stage 20] to F stage 204, but the preceding instruction is
All BITs that have not reached the E stage 205 due to a jump instruction being executed at the stage 205 or the like are cancelled. This means that the instruction that caused the BIT was never executed in the first place.
外部割込及び遅延割込は命令の切れ目でEステジ205
に直接受は付けられ、マイクロプログラムにより必要な
処理が実行される。その他の各種EITの処理はマイク
ロプログラムにより行われる。External interrupts and delayed interrupts are executed at E stage 205 at the end of instructions.
is directly accepted, and the necessary processing is executed by the microprogram. Other various EIT processes are performed by microprograms.
(3,31r各パイプラインステージの状態制御」パイ
プラインの各ステージは入力ランチと出力ラッチとを有
し、他のステージとは独立に動作することを基本とする
。各ステージは1つ前に行った処理が終わり、その処理
結果を出力ラッチから次のステージの入力ランチに転送
し、自分のステージの入力ランチに次の処理に必要な入
力信号がすべて揃えば次の処理を開始する。(3, 31r State control of each pipeline stage) Each stage of the pipeline has an input launch and an output latch, and basically operates independently from other stages. When the processing is completed, the processing result is transferred from the output latch to the input lunch of the next stage, and when all the input signals necessary for the next processing are available at the input lunch of the own stage, the next processing is started.
つまり各ステージは、1つ前段のステージから出力され
てくる次の処理に対する入力信号が全て有効となり、今
の処理結果を後段のステージの入力ランチに転送して出
力ランチが空になると次の処理を開始する。In other words, in each stage, all input signals for the next process output from the previous stage are valid, the current processing result is transferred to the input lunch of the next stage, and when the output lunch is empty, the next process starts. Start.
各ステージが動作を開始する1つ前のクロックタイミン
グで入力信号が全て揃っている必要がある。入力信号が
揃っていない場合、そのステージは待ち状態(入力待ち
)になる。出力ラッチから次のステージの入力ランチへ
の転送を行う場合には次のステージの入力ランチが空き
状態になっている必要があり、次のステージの入力ラン
チが空きでない場合もパイプラインステージは待ち状態
(出力待ち)になる。必要なメモリアクセス権が獲得で
きなかったり、処理しているメモリアクセスにウェイト
が挿入されたり、その他のパイプラインコンフリクトが
生しると各ステージの処理自体が遅延する。All input signals must be available at the clock timing immediately before each stage starts operating. If the input signals are not ready, the stage is in a waiting state (waiting for input). When transferring from the output latch to the input lunch of the next stage, the input lunch of the next stage must be free, and even if the input lunch of the next stage is not free, the pipeline stage will wait. state (waiting for output). If a necessary memory access right cannot be obtained, a wait is inserted into the memory access being processed, or other pipeline conflicts occur, the processing itself at each stage will be delayed.
(3,4) rレジスクコンフリクトチェソク」本発
明のデータ処理装置では次のようにしてレジスタのコン
フリクトによる誤動作を回避している。(3, 4) ``Register Conflict Check'' In the data processing device of the present invention, malfunctions due to register conflicts are avoided in the following manner.
本発明のデータ処理装置では、処理中のステップコード
を含めて各ステップコードに対応させて16ビツトのフ
ラグを設けている。これら16ビノトのフラグは16個
の汎用レジスタにそれぞれ対応している。In the data processing apparatus of the present invention, a 16-bit flag is provided corresponding to each step code including the step code being processed. These 16 bit flags correspond to 16 general-purpose registers, respectively.
Aステージ203では、オペランドアドレスの計算の結
果、実行ステージ205まで処理が進んだ際に書換えを
行う可能性のあるレジスタに関して書込み予約を行う。In the A stage 203, as a result of calculating the operand address, a write reservation is made for registers that may be rewritten when the process progresses to the execution stage 205.
1回の書込み予約処理では、任意の1つの汎用レジスタ
、全汎用レジスタ、 ROR4,SP、SPとFP (
フレームポインタ)の5通りの書込み予約が可能である
。書込み予約処理により書込む可(資)性のあるレジス
タに夕4応するフラグが“1”にセットされる。このフ
ラグ群がステップコートの転送に同期して転送される。In one write reservation process, any one general-purpose register, all general-purpose registers, ROR4, SP, SP and FP (
Five types of write reservations can be made for the frame pointer). By the write reservation process, flags corresponding to registers that are capable of writing are set to "1". This flag group is transferred in synchronization with the transfer of the step coat.
実行ステージ205でレジスタへの書込み処理が終了す
るとフラグは“0″にクリアされる。When the writing process to the register is completed in the execution stage 205, the flag is cleared to "0".
アドレス計算時にレジスタを参照する場合は、参照する
レジスタに対するフラグ群が“0”になっているか否か
をチエツクする。この処理がレジスタコンフリクトチエ
ツク処理である。When referring to a register during address calculation, it is checked whether the flag group for the register to be referred to is set to "0". This processing is register conflict check processing.
参照しようとするレジスタに対するフラグが“1”であ
るならば、先行するステップコードの処理により参照す
べきレジスタの値が書換えられる可能性があることを示
しており、コンフリクトが起こっていることが示される
。参照しようとするレジスタに対するフラグが”0”で
あるならば、先行するステップコードの処理により参照
すべきレジスタの値が書換わらないことを保証しており
、アドレス計算においてレジスタの参照が可能となる。If the flag for the register to be referenced is "1", this indicates that the value of the register to be referenced may be rewritten by the processing of the preceding step code, indicating that a conflict has occurred. It will be done. If the flag for the register to be referenced is "0", it is guaranteed that the value of the register to be referenced will not be rewritten by the processing of the preceding step code, and the register can be referenced in address calculation. .
Aステージ203はレジスタに関してコンフリクトが生
していることが検出された場合には、コンフリクトが解
消されるまでこのステージでの処理の開始を遅らセる。If it is detected that a conflict has occurred regarding a register, the A stage 203 delays the start of processing at this stage until the conflict is resolved.
(3,5) rMULX、 DIVX命令の処理」M
ULX、 DIVX命令は多倍長演算命令である。これ
らの命令のビット割り付けを第28図に示す。(3,5) rMULX, DIVX instruction processing”M
The ULX and DIVX instructions are multiple precision operation instructions. FIG. 28 shows the bit assignments of these instructions.
MULX、 DIVX命令はアドレシノジングモードで
多段間接モードが用いられなければ、3つのステップコ
ードに分解さた」二でパイプライン処理される。The MULX and DIVX instructions are pipelined in three step codes unless multi-indirect mode is used in addressing mode.
演算結果は命令コード中の第2ハーフワード(33と3
4)内の2つの書込みレジスタ指定フィールドで示され
るレジスタ(デスティネーション指定がメモリの場合は
レジスタとメモリ〉に格納される。The operation result is the second halfword (33 and 3) in the instruction code.
4) is stored in the register indicated by the two write register designation fields (register and memory if the destination designation is memory).
第29図のフローチャートに本発明の特徴を表すAステ
ージ203での処理手順を示す。The flowchart in FIG. 29 shows the processing procedure at stage A 203, which represents the features of the present invention.
Aステージ203ではステージ内で処理するために必要
なりコード212. Aコード213が入カラノチに揃
うまで待機状態となり、両コードが揃うと処理を始める
。In stage A 203, code 212. is necessary for processing within the stage. It is in a standby state until the A code 213 is aligned at the input point, and when both codes are aligned, processing begins.
レジスタ書込み予約部18はアドレス計算コンフリクト
のチエツクを行い、コンフリクトが生じればAステージ
203での処理をやりなおす。コンフリクトが生しない
場合(もしくは解消された場合)は、Aコード213の
指示によりアドレスδ1算を行ってFコード215を生
成する。The register write reservation unit 18 checks for address calculation conflicts, and if a conflict occurs, the process at the A stage 203 is redone. If no conflict occurs (or if it is resolved), the address δ1 is calculated according to the instruction of the A code 213 to generate the F code 215.
一方、Dコード212をDステージ202から入力して
第2デコーダで命令デコード処理を行ってRコード21
4を生成する。Dコード212内にレジスタ書込み予約
の情報が含まれていれば、レジスタ書込み予約部18で
解析してレジスタ書込み予約を行う。On the other hand, the D code 212 is input from the D stage 202, and the second decoder performs instruction decoding processing, and the R code 212 is inputted from the D stage 202.
Generate 4. If register write reservation information is included in the D code 212, the register write reservation unit 18 analyzes it and makes a register write reservation.
Aステージ203で生成したRコード214. Fコー
ド215を出力するかしないかの判定を行い、出力する
場合はFステージ204の入カラソチが空いているかど
うか否かを見て、空いていれば入力ラソチヘRコード2
14. Fコード215を転送して処理を終了する。出
力しないと判定した場合はRコード214またはFコー
ド215が無効であることを指示する信号を次のステー
ジへ出力し、Fステージ204の入力ラノチには取込ま
せない。R code 214 generated at A stage 203. It is determined whether or not to output the F code 215, and if it is to be output, it is checked whether or not the input slot of the F stage 204 is vacant, and if it is vacant, the R code 2 is sent to the input slot.
14. The F code 215 is transferred and the process ends. If it is determined that the R code 214 or the F code 215 is not output, a signal indicating that the R code 214 or the F code 215 is invalid is output to the next stage, and is not input to the input wire of the F stage 204.
以下の説明では、ソースとしてメモリを、デスティネー
ションとしてレジスタをそれぞれ用いる場合のMIIL
X命令の処理について述べる。ただし、多段間接モード
は用いられていないものとする。In the following explanation, MIIL is used when using memory as the source and register as the destination.
The processing of the X command will be described. However, it is assumed that the multi-stage indirect mode is not used.
各ステップコードにおける処理の概要を以下に示す。An overview of the processing in each step code is shown below.
第1ステップコード:ソースオペランドのアドレスを計
算し、メモ
リからオペランドをフ
エッチし、ワーキング
レジスタに待避させる。First step code: calculates the address of the source operand, fetches the operand from memory, and saves it to the working register.
第2ステップコード:1つ目のレジスタの書込み予約を
行う。Second step code: Makes a write reservation for the first register.
第3ステンブコード:デスティネーションオペランドの
レジスタを
指定し、拡張乗算命令
の指示を行い、演算終
1後レジスタ予約を解
除する。Third stave code: Specifies the register of the destination operand, instructs the extended multiplication instruction, and releases the register reservation after the operation is completed.
なお第3ステツプコードについては、デスティネーショ
ンオペランドのアドレシソシングモードがレジスタ直接
モードである時を考えているので、2つ目の書込みレジ
スタの予約を含んでいる。Regarding the third step code, since we are considering the case where the addressing mode of the destination operand is the register direct mode, it includes reservation of the second write register.
まず、第1ステツプコードに関する処理について、各ス
テージでの処理を示す第30図(alのフローチャート
を参照して説明する。First, the processing related to the first step code will be explained with reference to the flowchart in FIG. 30 (al) showing the processing at each stage.
Dステージ202は命令コードの第1ハーフワード(3
1と32)を取込み、デコードする。そして、第1ステ
ツプコードを示すDコード212とAコード213とを
Aステージ203へ転送する。Aステジ203ではDコ
ード212を入力として2段目のデコード処理を行い、
Rコード214を生成しFステージ204へ転送する。The D stage 202 processes the first halfword (3
1 and 32) and decode it. Then, the D code 212 and A code 213 indicating the first step code are transferred to the A stage 203. In the A stage 203, the second stage decoding process is performed using the D code 212 as input.
An R code 214 is generated and transferred to the F stage 204.
また、Aコード213の指示によりソースオペランドの
アドレス計算を行い、計算結果のアドレス情報をFコー
ド215としてFステージ204へ転送する。Fステー
ジ204ではRコード214を入力としてマイクロ命令
の読出し及びマイクロ命令のデコードを行い、Eコード
216を生成してEステージ205へ転送する。また、
Fコード215の指示によりオペランドをフェッチし、
フェッチしたオペランドをSコード217としてEステ
ージ205へ転送する。Eステージ205ではEコード
216の指示によりSコード217中のソースオペラン
ドの値ををワーキングレジスタに待避させる。Further, the address calculation of the source operand is performed according to the instruction of the A code 213, and the address information of the calculation result is transferred to the F stage 204 as the F code 215. The F stage 204 receives the R code 214 as input, reads the microinstruction, decodes the microinstruction, generates the E code 216, and transfers it to the E stage 205. Also,
Fetch the operand according to the instruction of F code 215,
The fetched operand is transferred to the E stage 205 as an S code 217. At the E stage 205, the value of the source operand in the S code 217 is saved in the working register according to the instruction from the E code 216.
次に、第2ステツプコードに関する処理について、各ス
テージでの処理を示す第30図(blのフローチャート
を参照して説明する。Next, the processing related to the second step code will be explained with reference to the flowchart in FIG. 30 (bl) showing the processing at each stage.
Dステージ202は命令コードの第2ハーフワード(3
3と34)を取り込み、デコードを行う。この時に、レ
ジスタ(フィールド33で示されるレジスタ)の書込み
予約の情報を持っDコード212を第2ステツプコード
としてAステージ203へ転送する。デコード結果の一
部は中間コード16としてDステージ202内のランチ
回路17に保持されている。The D stage 202 processes the second halfword (3
3 and 34) and decode it. At this time, the D code 212 is transferred to the A stage 203 as the second step code with information on the write reservation of the register (register indicated by field 33). A part of the decoding result is held in the launch circuit 17 in the D stage 202 as an intermediate code 16.
またアドレッシングモードデコーダの入力側及びDコー
ド212. Aコード213を生成するためのフィール
ド切出し部の入力側にはランチが設けてあり、オペレー
ションコードの内の第3ステンプコードの生成に必要な
情報が保持されている。Aステージ203では転送され
てきたDコード212の指示により、拡張乗算命令実行
結果の上位桁(DIVX命令の場合は拡張除算命令実行
結果の剰余)を格納するレジスタの書込み予約を行う。Also, the input side of the addressing mode decoder and the D code 212. A lunch is provided on the input side of the field extraction section for generating the A code 213, and holds information necessary for generating the third stamp code among the operation codes. In the A stage 203, according to the instruction of the transferred D code 212, a write reservation is made to a register that stores the upper digit of the execution result of the extended multiplication instruction (in the case of the DIVX instruction, the remainder of the execution result of the extended division instruction).
この際、Aステージ203からFステージ204へのR
コード214の出力については、第2デコーダによるデ
コードの結果、出力しないと判断してRコード214の
無効を指示する信号をFステージ204へ出力し、Fス
テージ204の大カラソチにはRコード214を取込ま
せない。従って第2のステップコードはAステージ20
3で吸収された形となる。At this time, R from A stage 203 to F stage 204
As for the output of the code 214, as a result of decoding by the second decoder, it is determined that it will not be output, and a signal instructing the invalidation of the R code 214 is output to the F stage 204. Don't let it be taken in. Therefore, the second step code is A stage 20
3, it becomes the absorbed form.
最後に、第3のステップコードに関する処理について、
各ステージでの処理を示す第30図FC+のフローチャ
ートを参照して説明する。Finally, regarding the processing related to the third step code,
The processing at each stage will be explained with reference to the flowchart shown in FIG. 30 FC+.
Dステージ202ではIFステージ201から命令コー
ド211の取込みは行わず、ラッチ17に保持しておい
た中間コード16をデコードし、アドレッシングモード
デコーダもラッチの内容を用いてデコードし、各フィー
ルドの切出しもラッチの内容を用いて処理し、第3ステ
ツプコードを示すDコード212及びAコード213を
生成してAステージ203へ転送する。Aステージ20
3では、Dコード212を入力として2段目のデコード
処理を行い、デスティネーションレジスタ指定の情報を
有するRコード214を生成してFステージ204へ転
送する。In the D stage 202, the instruction code 211 is not fetched from the IF stage 201, but the intermediate code 16 held in the latch 17 is decoded, the addressing mode decoder is also decoded using the contents of the latch, and each field is also extracted. Processing is performed using the contents of the latch to generate a D code 212 and an A code 213 indicating the third step code, and transfer them to the A stage 203. A stage 20
3, the D code 212 is input and a second stage decoding process is performed to generate an R code 214 having destination register designation information and transfer it to the F stage 204.
更にAステージ203では、拡張乗算命令実行結果の下
位桁(DIVX命令の場合は拡張除算命令実行結果の商
)を格納するレジスタの書込み予約を行う。Furthermore, in the A stage 203, a write reservation is made to a register that stores the lower digit of the extended multiplication instruction execution result (in the case of the DIVX instruction, the quotient of the extended division instruction execution result).
Fステージ204はRコード214を入力としてマイク
ロ命令の読出し及びマイクロ命令のデコードを行ってE
コード226を生成し、Eステージ205へ転送する。The F stage 204 receives the R code 214 as input, reads the microinstruction, decodes the microinstruction, and executes E.
A code 226 is generated and transferred to the E stage 205.
Eステージ205はEコード216の指示により拡張乗
算命令を実行する。演算実行結果はデスティネーション
で指定された2つのレジスタに格納され、レジスタの書
込み予約が解除される。E stage 205 executes an extended multiplication instruction according to instructions from E code 216. The results of the operation are stored in the two registers specified by the destination, and the write reservation of the registers is released.
以上、デスティネーションオペランドのアドレシノシン
グモードがレジスタ直接モードの場合について述べた。The case where the addressing mode of the destination operand is the register direct mode has been described above.
これに対してオペランドがメモリ上にある場合には、第
3ステンブコードでレジスタの書き込み予約を行う必要
がないので第2ステツプコードを生成する必要はないが
、ハードウェア上の処理を簡略化する目的で、レジスタ
直接モードの場合と同様に第2.第3ステツプコードと
も生成される。また、多段間接モードが用いられた場合
には指定された段数骨だけDステージ202でステップ
コードが生成される。On the other hand, if the operand is in memory, there is no need to reserve the register write in the third step code, so there is no need to generate the second step code, but it simplifies the processing on the hardware. As in the case of register direct mode, the second . A third step code is also generated. Further, when the multi-stage indirect mode is used, step codes are generated at the D stage 202 for a specified number of stages.
このように本発明のデータ処理装置では1回のデコード
処理対象となる命令基本部の中に書込みを行う汎用レジ
スタ指定が2つある場合、各レジスタの書込み予約情報
を含む2つのステップコードがDステージ202で生成
され、Aステージ203で各レジスタの書き込み予約が
行われる。また、Aステージ203ではEステージ20
5で処理されるステップコードの削減を計るため、予約
のみを行うステップコードは吸収されて、ステソプコー
ドとしでは出力されない。これは、1つのステップコー
ドに対してEステージ205が長時間処理を行う場合(
?1tlL等を実行中の場合)に有効である。As described above, in the data processing device of the present invention, when there are two general-purpose register specifications for writing in the basic instruction part that is subject to one decoding process, two step codes containing write reservation information for each register are It is generated at stage 202, and a write reservation for each register is made at stage A 203. Also, in A stage 203, E stage 20
In order to reduce the number of step codes processed in Step 5, step codes that only perform reservations are absorbed and are not output as step codes. This occurs when the E stage 205 performs long processing for one step code (
? 1tlL etc.) is effective.
[発明の勿J果]
以−4二に説明した如く本発明のデータ処理装置によれ
ば、多倍長演算命令のように1つの命令デコド処理単位
となる命令コード中に2つの書込みレジスタ指定フィー
ルドが含まれている場合は、それぞれのレジスタ指定フ
ィールドを含むステップコードに分けることにより2つ
のレジスフ書き込み予約処理を別々のパイプライン処理
単位として実行しているので、レジスタ予約のためのデ
コダを2つ設ける必要がないというハードウェア削減の
効果があり、更にオペランドアドレス計算ステージにお
いてレジスタの書込み予約のみを行うステップコードは
吸収されるため、実行ステージで処理されるステップコ
ードの数が削減され、これによりステップコードが実行
ステージを占有する時間が削減されるため、データ処理
が高速化される。[Results of the Invention] As explained in 4-2 below, according to the data processing device of the present invention, two write register specifications are specified in an instruction code that is a single instruction decoding processing unit, such as a multiple-precision operation instruction. If a field is included, the two register write reservation processes are executed as separate pipeline processing units by dividing them into step codes that include each register specification field, so the decoder for register reservation is divided into two step codes. This has the effect of reducing hardware in that there is no need to provide one. Furthermore, since the step code that only makes register write reservations in the operand address calculation stage is absorbed, the number of step codes processed in the execution stage is reduced. This reduces the time that the step code occupies the execution stage, thus speeding up data processing.
第1図は本発明を適用したデータ処理装置のパイプライ
ン処理機構の構成を示すブロック図、第2図は本発明の
データ処理装置の構成を示すブロック図、第3図〜第2
7図は本発明のデータ処理装置の命令フォーマットを示
す模式図、第28図はMULX、 DIVX命令の命令
ビット割付を示す模式図、第29図はAステージの動作
手順を示すフローチャート、第30図は多倍長演算命令
実行の各ステップコードの各ステージでの処理手頃を示
すフローチャト、第31図は従来のパイプライン処理機
構の構成を示すブロック図である。
15・・・デコーダ 16・・・中間コード 18
・・・レジスタ書込み予約部 102・・・命令デコー
ド部 104・・オペランドアドレス計算部 106・
・・データ演算部 202・・・命令デコードステージ
203・・・オペランドアドレス計算ステージ 20
5・・・命令実行ステジ
なお、各図中同一符号は同−又は相当部分を示す。FIG. 1 is a block diagram showing the configuration of a pipeline processing mechanism of a data processing device to which the present invention is applied, FIG. 2 is a block diagram showing the configuration of the data processing device of the present invention, and FIGS.
FIG. 7 is a schematic diagram showing the instruction format of the data processing device of the present invention, FIG. 28 is a schematic diagram showing the instruction bit allocation of MULX and DIVX instructions, FIG. 29 is a flowchart showing the operation procedure of the A stage, and FIG. 30 31 is a flowchart showing the processing at each stage of each step code in the execution of a multiple-length arithmetic instruction, and FIG. 31 is a block diagram showing the configuration of a conventional pipeline processing mechanism. 15...Decoder 16...Intermediate code 18
...Register write reservation section 102...Instruction decoding section 104...Operand address calculation section 106.
...Data calculation unit 202...Instruction decode stage 203...Operand address calculation stage 20
5... Instruction execution stage Note that the same reference numerals in each figure indicate the same or corresponding parts.
Claims (1)
数のステージにより命令をパイプライン処理する機構を
備えたデータ処理装置において、 前記命令デコードステージは、オペランドの書き込みを
行うための第1及び第2のレジスタ指定フィールドを有
する命令を、前記第1のレジスタ指定フィールドの情報
を含む第1の単位処理コードと、前記第2のレジスタ指
定フィールドの情報を含む第2の単位処理コードとにデ
コードする手段を備えたことを特徴とするデータ処理装
置。 2、命令をデコードする命令デコードステージと、オペ
ランドアドレスを計算するオペランドアドレス計算ステ
ージと、命令を実行する命令実行ステージとを含む複数
のステージにより命令をパイプライン処理する機構を備
えたデータ処理装置において、 前記オペランドアドレス計算ステージで制御され、前記
命令実行ステージでの命令実行時に書換えられる可能性
のあるレジスタを前記オペランドアドレス計算ステージ
でのアドレス計算時に参照することを禁止するためのレ
ジスタ書き込み予約を行うレジスタ書き込み予約手段と
、 前記命令デコードステージで制御され、1つの命令を前
記レジスタ書き込み予約手段への指示情報を含む第1の
前段単位処理コードと第2の前段単位処理コードを含む
複数の前段単位処理コードにデコードするデコード手段
と、 前記オペランドアドレス計算ステージで制御され、前記
第1の前段単位処理コードと前記第2の前段単位処理コ
ードとを処理して1つの後段単位処理コードを出力する
手段と を備えたことを特徴とするデータ処理装置。[Claims] 1. In a data processing device equipped with a mechanism for pipeline processing of instructions through a plurality of stages including an instruction decode stage for decoding the instructions, the instruction decode stage includes a first stage for writing operands. an instruction having first and second register specification fields, a first unit processing code including information in the first register specification field, and a second unit processing code including information in the second register specification field. What is claimed is: 1. A data processing device characterized by comprising means for decoding. 2. In a data processing device equipped with a mechanism for pipeline processing of instructions through a plurality of stages including an instruction decode stage for decoding instructions, an operand address calculation stage for calculating operand addresses, and an instruction execution stage for executing instructions. , making a register write reservation for prohibiting a register that is controlled in the operand address calculation stage and that may be rewritten during instruction execution in the instruction execution stage from being referenced during address calculation in the operand address calculation stage. register write reservation means; and a plurality of pre-stage units controlled by the instruction decode stage and including a first pre-stage unit processing code and a second pre-stage unit processing code containing instruction information for one instruction to the register write reservation means. decoding means for decoding into a processing code; and means controlled by the operand address calculation stage for processing the first pre-stage unit processing code and the second pre-stage unit processing code to output one post-stage unit processing code. A data processing device comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16961488A JPH0218621A (en) | 1988-07-07 | 1988-07-07 | Data processor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16961488A JPH0218621A (en) | 1988-07-07 | 1988-07-07 | Data processor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0218621A true JPH0218621A (en) | 1990-01-22 |
Family
ID=15889764
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP16961488A Pending JPH0218621A (en) | 1988-07-07 | 1988-07-07 | Data processor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0218621A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014041422A (en) * | 2012-08-21 | 2014-03-06 | Fujitsu Ltd | Processor |
-
1988
- 1988-07-07 JP JP16961488A patent/JPH0218621A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014041422A (en) * | 2012-08-21 | 2014-03-06 | Fujitsu Ltd | Processor |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5218711A (en) | Microprocessor having program counter registers for its coprocessors | |
| US5091853A (en) | Chained addressing mode pipelined processor which merges separately decoded parts of a multiple operation instruction | |
| JPH02173823A (en) | Data processor | |
| JP2507638B2 (en) | Data processing device | |
| JPH04260950A (en) | Cache memory device | |
| US4945511A (en) | Improved pipelined processor with two stage decoder for exchanging register values for similar operand instructions | |
| JPH03158928A (en) | Data processor | |
| JP2847974B2 (en) | Data processing device | |
| JPH01214932A (en) | Data processor | |
| JPH0391029A (en) | Data processor | |
| JP3345787B2 (en) | Data processing device | |
| JP2668456B2 (en) | Bit search circuit and data processing device having the same | |
| JP2504235B2 (en) | Data processing device | |
| JPH0769806B2 (en) | Data processing device | |
| JPH0218621A (en) | Data processor | |
| JP2522048B2 (en) | Microprocessor and data processing device using the same | |
| JP2532560B2 (en) | Data processing device for high-performance exception handling | |
| JPH0225932A (en) | Data processor | |
| JPH0290325A (en) | Data processor | |
| JPH0769805B2 (en) | Data processing device | |
| JPH0769808B2 (en) | Data processing device | |
| JPH0769802B2 (en) | Data processing device | |
| JPH01281534A (en) | Data processor | |
| JPH01214933A (en) | Data processor | |
| JPH0769807B2 (en) | Data processing device |