JPH0225932A - Data processor - Google Patents

Data processor

Info

Publication number
JPH0225932A
JPH0225932A JP17794188A JP17794188A JPH0225932A JP H0225932 A JPH0225932 A JP H0225932A JP 17794188 A JP17794188 A JP 17794188A JP 17794188 A JP17794188 A JP 17794188A JP H0225932 A JPH0225932 A JP H0225932A
Authority
JP
Japan
Prior art keywords
stage
instruction
address
operand
code
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.)
Granted
Application number
JP17794188A
Other languages
Japanese (ja)
Other versions
JPH0769801B2 (en
Inventor
Yukari Watanabe
渡辺 由香里
Masahito Matsuo
雅仁 松尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP63177941A priority Critical patent/JPH0769801B2/en
Publication of JPH0225932A publication Critical patent/JPH0225932A/en
Publication of JPH0769801B2 publication Critical patent/JPH0769801B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To improve the data processing efficiency by calculating a source address at an address addition part of an address calculation stage and replacing the stack pointer of the address calculation stage to obtain a destination address. CONSTITUTION:The operand addresses 212 and 213 are calculated at an address addition part and the stack pointer of an address calculation stage 203 is replaced at the stage 203 when the push and push A instructions are processed. Then the value of the stack pointer is transferred synchronously with the flow of a pipeline. Thus the pipeline processing efficiency is improved without producing the conflict of the stack pointer at the stage 203 among the instructions produced after the push and push A instructions. Then the performance of a data processor is improved since a push instruction can be carried out in a single step at the minimum.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は高度なパイプライン処理機構により高い処理
能力を実現したデータ処理装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Field of Application] The present invention relates to a data processing device that achieves high processing performance through an advanced pipeline processing mechanism.

〔従来の技術〕[Conventional technology]

第33図は従来のパイプライン処理を行うデータ処理装
置の構成を示すブロック図であり、202は命令デコー
ドステージ、203はアドレス計算ステージ、204は
オペランドフェッチステージ、205は実行ステージ、
60はスタックポインタである。
FIG. 33 is a block diagram showing the configuration of a data processing device that performs conventional pipeline processing, in which 202 is an instruction decode stage, 203 is an address calculation stage, 204 is an operand fetch stage, 205 is an execution stage,
60 is a stack pointer.

また実行ステージ205ではストア処理とデータ演算処
理とを並列して行うことができ、ストア処理の終了を待
たずに次の命令の処理を始めることが可能である。
Furthermore, in the execution stage 205, store processing and data calculation processing can be performed in parallel, and it is possible to start processing the next instruction without waiting for the end of store processing.

次に動作について説明する。プッシュ命令は見かけ上l
オペランド命令であり、命令中に書かれたソースオペラ
ンドをスタックにプッシュする命令である。スタックへ
のプッシュはスタックポインタの値をオペランドのサイ
ズ分デクリメントした値が指すところをデスティネーシ
ョンアドレスとし、そこへソースオペランドを書き込む
Next, the operation will be explained. The push command appears to be
This is an operand instruction that pushes the source operand written in the instruction onto the stack. When pushing to the stack, the value obtained by decrementing the value of the stack pointer by the size of the operand specifies the destination address, and the source operand is written there.

プッシュ命令の場合は命令中に記述されるソースオペラ
ンドと、スタックトップのデスティネーションオペラン
ドとの2つを有しており、従来はソースオペランドをア
ドレス計算ステージ203で、デスティネーションオペ
ランドを実行ステージ205で計算していた。
In the case of a push instruction, there are two operands: a source operand written in the instruction and a destination operand at the top of the stack. Conventionally, the source operand is written in the address calculation stage 203 and the destination operand is written in the execution stage 205. I was calculating.

第34図にプッシュ命令のソースオペランドがメモリに
ある場合の各ステージの動作を示すフローチャートであ
る。
FIG. 34 is a flowchart showing the operation of each stage when the source operand of a push instruction is in memory.

アドレス計算ステージ203ではプッシュ命令中のアド
レシッシングモードに基づきソースアドレスを計算する
(ステップ1)。
In the address calculation stage 203, a source address is calculated based on the addressing mode in the push command (step 1).

次にオペランドフェッチステージ204で、ステップl
で計算されたアドレスの示すアドレスからデータを取り
込む(ステップ2)。
Next, in the operand fetch stage 204, step l
Data is fetched from the address indicated by the address calculated in (step 2).

次に実行ステージ205ではスタックポインタをオペラ
ンドのサイズ分デクリメントすることによりデスティネ
ーションアドレス(スタックトップ)をスタックポイン
タ60に設定する(ステップ3a)。
Next, in the execution stage 205, the destination address (stack top) is set in the stack pointer 60 by decrementing the stack pointer by the size of the operand (step 3a).

次にデクリメントされたスタックポインタの値をアドレ
スレジスタに、フェッチされたソースオペランドをデー
タレジスタに書き込む(ステップ3b)。
Next, the decremented value of the stack pointer is written to the address register and the fetched source operand is written to the data register (step 3b).

アドレスレジスタの示すアドレスにデータレジスタの値
を書き込む(ステップ3c)。
The value of the data register is written to the address indicated by the address register (step 3c).

プッシュ命令のみの流れはこのようになっているが、パ
イプライン処理により命令を流すと、理想的にはステッ
プ1のアドレス計算が終わりアドレス計算ステージが使
用可能になったら、次の命令のアドレス計算がすぐに実
行される。これにより最も効率のよいパイプライン処理
を行えば、常に各ステージが命令を処理中であり、実行
ステージでの処理時間がその命令の実行時間を決めるこ
とになる。
The flow of only push instructions is like this, but if instructions are flown by pipeline processing, ideally, once the address calculation in step 1 is finished and the address calculation stage is available, the address calculation for the next instruction will start. is executed immediately. In this way, if the most efficient pipeline processing is performed, each stage is always processing an instruction, and the processing time at the execution stage determines the execution time of the instruction.

しかし、いつもパイプラインがスムーズに流れるわけで
はなく、効率を低下させる原因かい(つかある。その中
に、[一番遅いステージで速度が制限される]という問
題がある。いまパイプライン中の各ステージの1回の処
理に必要な最小時間を2クロツクとする。ここで仮りに
実行ステージか2クロンクで処理で実行を終了しても、
アドレス計算ステージで4クロツクかかれば、その命令
の実行時間は4クロツクになってしまう。そこで各ステ
ージにおける命令実行のクロック数を均一にし、一番ク
ロック数の多くなるステージを重点的にクロック数減少
に向けることが望ましい。
However, the pipeline does not always flow smoothly, and there are several causes that reduce efficiency.One of them is the problem that the speed is limited at the slowest stage. The minimum time required to process one stage is 2 clocks.Here, even if the execution ends in the execution stage or 2 clocks,
If the address calculation stage takes four clocks, the execution time of the instruction will be four clocks. Therefore, it is desirable to equalize the number of clocks for instruction execution in each stage and focus on reducing the number of clocks at the stage with the largest number of clocks.

また別の問題点として、各ステージのリソースのコンフ
リクトがあるので、特に本発明に関連するアドレス計算
ステージでのコンフリクトについて説明する。アドレス
計算ステージ203で各命令はアドレス計算を行うわけ
だが、この計算実行時に参照したレジスタやメモリの値
をパイプライン中を先行する命令が書き換えてしまうこ
とがある。
Another problem is that there is a resource conflict at each stage, so the conflict at the address calculation stage, which is particularly relevant to the present invention, will be explained. In the address calculation stage 203, each instruction calculates an address, but a preceding instruction in the pipeline may overwrite the value of a register or memory referenced during execution of this calculation.

そうするとすでに行ったアドレス計算の結果は誤ってい
ることになる。このようなリソースの衝突(コンフリク
ト)が起こった時にも正しい結果を出すためには、先行
する命令が必要なリソースを書き換える可能性がある場
合は先行命令の処理が終了するまでアドレス計算を行わ
ないようにするか、アドレス計算を行った後で参照した
リソースが書き換わった場合にはアドレス計算をやり直
すようにしなければならない。
In this case, the result of the address calculation that has already been performed will be incorrect. In order to produce correct results even when such a resource conflict occurs, if there is a possibility that the preceding instruction will rewrite the necessary resources, do not calculate the address until the preceding instruction finishes processing. Otherwise, if the referenced resource is rewritten after performing address calculation, the address calculation must be redone.

第34図に示したプッシュ命令実行時に問題となるのは
、このプッシュ命令の実行が終了してスタックポインタ
の値を書き換えるまでは、スタックポインタがコンフリ
クトを起こすので、後の命令はアドレス計算においてス
タックポインタの値を参照できないことである。そのた
めプッシュ命令の次の命令がアドレス計算ステージでス
タックボインクを参照する場合は、プッシュ命令終了後
、次の命令が終了するまで、アドレス計算ステージ、オ
ペランドフェッチステージ、実行ステージの合計骨のク
ロック数が必要になる。また実行ステージでデスティネ
ーションアドレスを計算するために、実行ステージは2
つの処理を行い、プッシュ命令は最小でも4クロック分
の時間かかることになる。
The problem when executing the push instruction shown in Figure 34 is that until the execution of this push instruction is finished and the value of the stack pointer is rewritten, the stack pointer will cause a conflict, so later instructions will use the stack when calculating the address. The pointer value cannot be referenced. Therefore, if the next instruction after a push instruction refers to stack boiling in the address calculation stage, the total number of clocks in the address calculation stage, operand fetch stage, and execution stage after the push instruction ends and until the next instruction ends. is required. Also, in order to calculate the destination address in the execution stage, the execution stage
This means that the push command takes at least four clocks.

プッシュ命令と同じ様な命令にプッシュ八命令があり、
この命令はソースオペランドとしてソースアドレスが指
定され、第34図のステップ2の「オペランドフェッチ
ステージ204でのメモリからのデータのフェッチ」が
なく、アドレス計算結果がそのまま実行ステージ205
に転送される。それ以外はプッシュ命令と同様であり、
同じ問題点を持つ。
There is a push eight command which is similar to the push command.
In this instruction, the source address is specified as the source operand, there is no "fetching data from memory in the operand fetch stage 204" in step 2 in FIG.
will be forwarded to. Other than that, it is the same as the push instruction,
have the same problem.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

このように従来のデータ処理装置においては、実行ステ
ージでの処理でスタックポインタの値を更新するため、
プッシュ命令の実行時間が増え、またプッシュ命令以降
の命令でのアドレス計算において、スタックポインタの
コンフリクトを起こす可能性があり、高速化の妨げとな
っていた。
In this way, in conventional data processing devices, the value of the stack pointer is updated during processing at the execution stage, so
The execution time of the push instruction increases, and there is a possibility that stack pointer conflicts may occur in address calculations for instructions after the push instruction, which hinders speeding up.

この発明は上記の問題点を解決するためになされたもの
で、プッシュ命令を高速に行うと共にプッシュ命令以降
の命令でスタックポインタのコンフリクトを起こさない
ようなデータ処理装置を得ることを目的とする。
The present invention has been made to solve the above-mentioned problems, and an object of the present invention is to provide a data processing device that can execute push instructions at high speed and that does not cause stack pointer conflicts in instructions after the push instruction.

(課題を解決するための手段〕 本発明におけるデータ処理装置は、パイプライン中のア
ドレス計算ステージ以降のステージに作業用のスタック
ポインタを設け、アドレス計算ステージのスタックポイ
ンタがアドレス加算部とは独立にインクリメントあるい
はデクリメント可能にし、このスタックポインタの値が
バイブライン中の命令の流れに同期して各ステージのス
タックポインタに転送されるようにしたものである。
(Means for Solving the Problems) The data processing device of the present invention provides a working stack pointer in a stage after the address calculation stage in the pipeline, so that the stack pointer in the address calculation stage is independent of the address addition section. The stack pointer can be incremented or decremented, and the value of this stack pointer is transferred to the stack pointer of each stage in synchronization with the flow of instructions in the vibe line.

〔作用] この発明におけるデータ処理装置は、ソースアドレスを
アドレス計算ステージのアドレス加算部において計算し
、デスティネーションアドレスをアドレス計算ステージ
のスタックポインタを更新することにより得る。
[Operation] The data processing device according to the present invention calculates the source address in the address addition section of the address calculation stage, and obtains the destination address by updating the stack pointer of the address calculation stage.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明をその実施例を示す図面に基づいて詳述す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described in detail below based on drawings showing embodiments thereof.

(1)「本発明のデータ処理装置の命令フォーマット」
本発明のデータ処理装置の命令は16ビツト単位で可変
長となっており、奇数バイト長の命令は使用しない。
(1) “Instruction format of the 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 shortening high-frequency instructions. 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 format of the data processing device of the present invention are as follows.

:オペレーションコードが入ル部分 #;リテラルまたは即値が入る部分 Ea:8ミニ8ビツト形のアドレッシングモードでオペ
ランドを指定する部分 Sh:6ビツトの短縮形のアドレッシングモードでオペ
ランドを指定する部分 Rn:レジスタ上のオペランドをレジスタ番号で指定す
る部分 フォーマットは、第3図に示す如く右側がLSB側で且
つ高いアドレスになっている。アドレスNとアドレスN
+1の2バイトを見ないと命令フォー゛7ツトが判別で
きないようになっているが、これは前述の如く、命令が
必ず16ビツト(2バイト)単位でフェッチ及びデコー
ドされることを前提どしているためである。
: Part where operation code is entered #; Part where literal or immediate value is entered Ea: Part that specifies the operand in 8 mini 8-bit addressing mode Sh: Part that specifies the operand in 6-bit abbreviated addressing mode Rn: Register In the partial format in which the upper operand is specified by a register number, as shown in FIG. 3, the right side is the LSB side and the higher address. address N and address N
The instruction format cannot be determined without looking at the +1 2 bytes, but this is based on the assumption that instructions are always fetched and decoded in units of 16 bits (2 bytes), as mentioned above. This is because

本発明のデータ処理装置では、いずれのフォーマットの
場合も、各オペランドの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
ハーフワードにfialを含み、第2ハーフワードにE
a2を含み、第3ハーフワードまである6バイト命令の
場合を考える。Ealに多段間接モードを使用したため
、普通の拡張部の他に多段間接モードの拡張部も付くも
のとすると、実際の命令ビットパターンは、命令の第1
ハーフワード(Ealの基本部を含む)I 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
Contains fial in halfword and E in second halfword
Consider the case of a 6-byte instruction including a2 and up to the third halfword. Since the multi-stage indirect mode is used for Eal, assuming that the multi-stage indirect mode extension part is attached in addition to the normal extension part, the actual instruction bit pattern is the first bit pattern of the instruction.
Halfword (contains the base of Eal) I Extension of Eal, multi-indirect mode extension of Eal, second halfword of instruction (contains base of Ea2) + extension of Eal, third halfword of instruction The order is as follows.

(1,1) r短縮形2オペランド命令」第4図から第
7図は2オペランド命令の短縮形フォーマットを示す模
式図である。
(1,1) r Shortened Two-Operand Instruction" FIGS. 4 to 7 are schematic diagrams showing the shortened format of a two-operand instruction.

第4図はメモリーレジスタ間演算命令のフォーマットを
示す模式図である。このフォーマットには、ソースオペ
ランド側がメモリとなるL−formatと、デスティ
ネーションオペランド側がメモリとなるS−forma
tとがある。
FIG. 4 is a schematic diagram showing the format 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−format)を示す模式図である。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図はリテラル−メモリ間演算命令のフォーマット(
ローformat)を示す模式図である。間はディステ
ィネーションオペランドサイズの指定フィールド、1l
lllはリテラルによるソースオペランドの指定フィー
ルド、shはデスティネーションオペランドの指定フィ
ールドである。
Figure 6 shows the format of literal-memory operation instructions (
FIG. 2 is a schematic diagram showing a low format. The space between is the destination operand size specification field, 1l.
lll is a literal source operand specification field, and sh is a destination operand specification field.

第7図は即値−メモリ間演算命令のフォーマット(1−
format)を示す模式図である。聞はオペランドサ
イズの指定フィールド(ソース、ディスティネーション
で共通) 、shはデスティネーションオペランドの指
定フィールドである。[−formatの即値のサイズ
はデスティネーション側のオペランドのサイズと共通に
8.16.32ビツトとなり、ゼロ拡張及び符号拡張は
行なわれない。
Figure 7 shows the format of an immediate-memory operation instruction (1-
FIG. sh is the operand size specification field (common for source and destination), and sh is the destination operand specification field. The size of the immediate value of [-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図はlオ
ペランド命令の一般形フオーマット(Gl−forma
t)を示す模式図である。MMはオペランドサイズの指
定フィールドである。一部のGlformat命令では
、Haの拡張部以外にも拡張部がある。また、財を使用
しない命令もある。
(1, 2) r-ship type 1-operand instruction” Figure 8 shows the general format of the l-operand instruction (Gl-forma
It is a schematic diagram showing t). MM is a field specifying the operand size. Some Glformat instructions have extensions in addition to the Ha extension. There are also orders not to use goods.

(1,3) r−船形2オペランド命令」第9図から第
11図は2オペランド命令の一般形フオーマットを示す
模式図である。このフォーマントに含まれるのは、8ビ
ツトで指定する一般形アドレッシングモードのオペラン
ドが最大2つ存在する命令である。オペランドの総数自
体は3つ以上になる場合がある。
(1, 3) r-Ship Type 2-Operand Instruction" FIGS. 9 to 11 are schematic diagrams showing the general format of the 2-operand instruction. This formant includes instructions that have a maximum of two operands in general addressing mode specified by 8 bits. The total number of operands itself may be three or more.

第9図は第1オペランドがメモリ読み出しを必要とする
命令のフォーマット(G−format)を示す模式図
である。EaMはデスティネーションオペランドの指定
フィールド、財はデスティネーションオペランドサイズ
の指定フィールド、F!、aRはソースオペランド指定
フィールド、RRはソースオペランドサイズの指定フィ
ールドである。一部のG−format命令では、Ea
MあるいはEaRの拡張部以外にも拡張部がある。
FIG. 9 is a schematic diagram showing the format (G-format) of an instruction whose first operand requires memory reading. EaM is the specified field of the destination operand, goods is the specified field of the destination operand size, and F! , aR is a source operand specification field, and RR is a source operand size specification field. In some G-format instructions, Ea
There are extensions other than those of M or EaR.

第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 specification field, Open is a destination operand size specification field, and . . . 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 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. That is, the E-format assumes 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)を示す模式図
である。Ea−はデスティネーションオペランドの指定
フィールド、四はデスティネーションオペランドサイズ
の指定フィールド、Ea八はソースオペランドの指定フ
ィールドである。ソースオペランドとしては実行アドレ
スの計算結果自体が使用される。
FIG. 11 is a schematic diagram showing the format (GA-format) of an instruction whose first operand is only address calculation. Ea- is a destination operand designation field, 4 is a destination operand size designation field, and Ea8 is a source operand designation 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 format 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 the bit pattern is doubled. Let it be a displacement 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 format diagram are as follows.

Rn:レジスタ指定 mem HA : EAで示されるアドレスのメモリ内
容(Sh)  76ビツトの短縮形アドレッシングモー
ドでの指定方法 (Ha)  :8ビツトの一般形アドレッシングモード
での指定方法 フォーマットの図において破線にて囲繞された部分は拡
張部を示す。
Rn: Register specification mem HA: Memory contents of the address indicated by EA (Sh) Specification method in 76-bit abbreviated addressing mode (Ha): Specification method in 8-bit general addressing mode The dashed line in the format diagram The enclosed area indicates the 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 these, 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 counter) relative indirect mode, and stack pop. mode and stack push mode.

レジスタ直接モードはレジスタの内容をそのままオペラ
ンドとする。フォーマットの模式図を第13図に示す。
In register direct mode, the contents of the register are used as operands. A schematic diagram of the format is shown in FIG.

Rnは汎用レジスタの番号を示す。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 formant is shown in FIG. 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. 15, where Rn indicates the number of the general-purpose register. disp:16 and disp:32 each indicate a 16-bit displacement value or a 32-bit displacement value. Displacement values are treated as signed.

即値モードは命令コード中で指定されるビットパターン
をそのまま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 bit pattern specified in the instruction code. A schematic diagram of the format is shown in Figure 17, a.
bs:16 and abs:32 indicate a 16-bit or 32-bit address value, respectively.

abs : 16でアドレスが示される時はI旨定され
たアドレス値を32ビツトに符号拡張する。
abs: When an address is indicated by 16, the specified address value is sign-extended to 32 bits.

11c相対間接モードはディスプレースメント値が16
ビツトか32ビツトかにより2種類ある。それぞれ、プ
ログラムカウンタの内容に16ビツトまたは32ビツト
のディスプレースメント値を加えた値をアドレスとする
メモリの内容をオペランドとする。
11c relative indirect mode has a displacement value of 16
There are two types depending on whether it is bit or 32 bit. Each operand is the contents of the memory whose address is the value obtained by adding a 16-bit or 32-bit displacement value to the contents of the program counter.

フォーマットの模式図を第18図に示す。disp :
 16とdisp : 32とはそれぞれ16ビツトの
ディスプレースメント値または32ビツトのディスプレ
ースメント値を示す。ディスプレースメント値は符号付
きとして扱う。PC相対間接モードにおいて、参照され
るプログラムカウンタの値はそのオペランドを含む命令
の先頭アドレスである。多段間接アドレッシングモード
においてプログラムカウンタの値が参照される場合にも
、同じように命令の先頭のアドレスをPC相対の基準値
として使用する。
A schematic diagram of the format is shown in FIG. disp:
16 and disp:32 each indicate a 16-bit displacement value or a 32-bit displacement value. Displacement values are treated as signed. 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.

スタックポツプモードはスタックポインタ(SP)の内
容をアドレスとするメモリの内容をオペランドとする。
The stack pop mode uses the contents of the memory whose address is the contents of the stack pointer (SP) as the operand.

オペランドアクセス後、スタックポインタをオペランド
サイズだけインクリメントする。
After accessing the operand, increment the stack pointer by the operand size.

例えば、32ビツトデータを扱う場合には、オペランド
アクセス後にSPが+4だけ更新(インクリメント)さ
れる。B、Hのサイズのオペランドに対するスタックポ
ツプモードの指定も可能であり、それぞれSPが+1.
+2だけ更新(インクリメント)される。フォーマット
の模式図を第19図に示す。オペランドに対しスタック
ポツプモードが意味を持たないものに関しては予約命令
例外が発生される。
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 for which the stack pop mode 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.

スタックプッシュモードはスタックポインタの内容をオ
ペランドサイズだけデクリメントした内容をアドレスと
するメモリの内容をオペランドとする。スタックプッシ
ュモードでは、オペランドアクセス前にスタックポイン
タがデクリメントされる。例えば、32ビツトデータを
扱う場合には、オペランドアクセス前にSPが−4だけ
更新(デクリメント)される。B、)(のサイスのオペ
ランドに対するスタックプッシュモードの指定も可能で
あり、それぞれSPが−1,−2だけ更新(デクリメン
ト)される。フォーマットの模式図を第20図に示す。
In stack push mode, the operand is the contents of the memory whose address is the contents obtained by decrementing the contents of the stack pointer by the operand size. In stack push 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 stack push mode for operands of size B, )(, and SP is updated (decremented) by -1 and -2, respectively. A schematic diagram of the format is shown in FIG.

オペランドに対してスタックプッシュモードが意味を持
たないものに関しては、予約命令例外が発生される。具
体的に予約命令例外となるのは、readオペランド、
read−modify−writeオペランドに対す
スタックプッシュモード指定である。
For operands for which the stack push mode has no meaning, a reserved instruction exception is generated. Specifically, reserved instruction exceptions include the read operand,
This is a stack push mode specification for the read-modify-write operand.

(1,4,2) r多段間接アドレッシングモード」如
何に複雑なアドレッシングも、基本的には加算と間接参
照の組み合わせに分解される。従って、加算と間接参照
のオペレーションをアドレッシングのプリミティブとし
て与えておき、それを任意に組み合わせることができれ
ば、如何なる複雑なアドレッシングモードをも実現可能
となる。本発明のデータ処理装置の多段間接アドレッシ
ングモードはこの様な考え方に基づいたアドレッシング
モードである。複雑なアドレッシングモードはモジヱー
ル間のデータ参照あるいはAl (人工知能)言語の処
理系に特に有用である。
(1, 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 references. 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 addressing mode of the data processing device of the present invention is an addressing 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は汎用レジスタの番号を示す。
The 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 format 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. The second schematic diagram of the format
Shown in Figure 2.

絶対ベース多段間接モードはゼロを拡張する多段間接ア
ドレッシングのベース値とするアドレッシングモードで
ある。フォーマットの模式図を第23図に示す。
The absolute base 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 the format 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図
に示す。各フィールドは以下に示す意味を持つ。
One-stage multi-stage indirect mode allows displacement addition and index register scaling (Xi,
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  *  5
cale  ==>  tmp1=1  :メモリ間接
参照あり mem  tip  +  disp  +  Rx 
 率 5cale  ==>tmpM=0  :  <
Rx>をインデクスとして使用トl :特殊なインデク
ス <Rx>=Oインデクス値を加算しな い  (Rx=O) <Rx>・1  プログラムカウンタをインデクス値と
して使用 (Rx=PC) <Rx>=2〜reserved 0.0 7多段間接モード中の4ビツトのフィールドd
4の値を4倍してディスプレースメント値とし、これを
加算する d4は符号付きとして扱い、オペラン ドのサイズとは関係なく必ず4倍して 使用する D・1 :多段間接モードの拡張部で指定されたd 1
spx (16/32ビツト)をディスプレースメント
値とし、これを加算する 拡張部のサイズはd4フィールドで指 定する d4=ooo1   dispxは16ビツトd4□0
010   dispxは32ビットXx:インデクス
のスケール(scale=1/2/4/8)プログラム
カウンタに対してx2. x4. x Bのスケーリン
グを行なった場合には、その段の処理終了後の中間値(
t+*p)として不定値が入る。この多段間接モードに
よって得られる実効アドレスは予測できない値となるが
、例外は発生しない。プログラムカウンタに対するスケ
ーリングの指定は行なっではいけない。
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 * 5
cale ==> tmp1=1: Memory indirect reference mem tip + disp + Rx
Rate 5cale ==>tmpM=0: <
Rx> is used as the index: Special index <Rx>=O Do not add the index value (Rx=O) <Rx>・1 Use the program counter as the index value (Rx=PC) <Rx>=2~ reserved 0.0 7 4-bit field d in multi-stage indirect mode
The value of 4 is multiplied by 4 to create a displacement value, and this is added. d4 is treated as signed, and is always multiplied by 4 regardless of the operand size. D・1: Specified in the extension part of multi-stage indirect mode. d 1
spx (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=ooo1 dispx is 16 bits d4□0
010 dispx is 32 bits Xx: index scale (scale=1/2/4/8) x2. x4. When x B is scaled, the intermediate value (
An undefined value is entered as t+*p). Although the effective address obtained by this multi-stage indirect mode is an unpredictable value, no exceptions occur. Do not specify scaling for the program counter.

多段間接モードによる命令フォーマットのバリエーショ
ンを第25図、第26図に示す。
Variations of instruction formats in the multi-stage indirect mode are shown in FIGS. 25 and 26.

第25図は、多段間接モードが継続するか終了するかの
バリエーションを示す。
FIG. 25 shows variations on whether the multi-stage indirect mode continues or ends.

第26図は、ディスプレースメントのサイズのバリエー
ションを示す。
FIG. 26 shows variations in displacement size.

任意段数の多段間接モードが利用できれば、コンパイラ
の中で段数による場合分けが不要になるので、コンパイ
ラの負担が軽減されるというメリットがある。多段の間
接参照の頻度が非常に少ないとしても、コンパイラとし
ては必ず正しいコードを発生できなければならないから
である。このため、フォーマット上では任意の段数が可
能になっている。
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種の例外処理とシステム障害とを総称
してEITと称する。
(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 handling is re-execution of instruction processing (exception).
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 EIT.

(2)「機能ブロックの構成」 第1図は本発明のデータ処理装置の構成を示すブロック
図である。
(2) "Configuration of Functional Blocks" FIG. 1 is a block diagram showing the configuration of the data processing device of the present invention.

本発明のデータ処理装置の内部を機能的に大きく分ける
と、命令フェッチ部101.命令デコード部102、P
C計算部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, P
C calculation section 103. Operand address calculation unit 104゜Micro ROM unit 105. Data calculation unit 106. It is divided into an external bus interface section 107.

第1図では、その他にCPu外部にアドレスを出力する
ためのアドレス出力回路108と、CPU外部とデータ
を入出力するためのデータ入出力回路109とを他の機
能ブロック部と分けて示した。
In addition, in FIG. 1, an address output circuit 108 for outputting an address to the outside of the CPU, and a data input/output circuit 109 for inputting and outputting data to and from the outside of the CPU are shown separately from other functional blocks.

(2,1)’命令フェッチ部」 命令フェッチ部101にはブランチバッファ、命令キュ
ー301とその制御部等があり、次にフェッチすべき命
令のアドレスを決定してブランチバッファあるいはCP
u外部のメモリから命令をフェッチする。またブランチ
バッファへの命令登録をも行う。
(2, 1) 'Instruction fetch unit' The instruction fetch unit 101 includes a branch buffer, an instruction queue 301 and its control unit, and determines the address of the next instruction to be fetched and transfers it to the branch buffer or CP.
u Fetch instructions from external memory. 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.

次にフェッチすべき命令のアドレスは、命令キュー30
1に入力すべき命令のアドレスとして専用のカウンタに
て計算される。分岐あるいはジャンプが発生した場合に
は、新たな命令のアドレスがPC計算部103あるいは
データ演算部106から転送されてくる。
The address of the next instruction to be fetched is stored in the instruction queue 30.
It is calculated by a dedicated counter as the address of the instruction to be input into the address number 1. When a branch or jump occurs, the address of a new instruction is transferred from the PC 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.
The instruction code is output from the U and fetched from the data input/output circuit 109. Then, among the buffered instruction codes, the instruction code to be decoded next is output to the instruction decoding unit 102.

(2,2) r命令デコード部」 命令デコード部102では、基本的には16ビツト(ハ
ーフワード)単位で命令コードをデコードする。このブ
ロックには第1ハーフワードに含まれるオペレーション
コードをデコードするFHWデコーダ、第2.第3ハー
フワードに含まれるオペレーションコードをデコードす
るNFHWデコーダ、アドレッシングモードをデコード
するアドレッシングモードデコーダが含まれる。これら
FIIWデコーダ、N P II Wデコーダ、アドレ
ッシングモードデコーダを纏めて第1デコーダ303と
いう。
(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 FHW decoder that decodes the operation code contained in the first halfword, a second . It includes an NFHW decoder that decodes the operation code included in the third halfword, and an addressing mode decoder that decodes the addressing mode. These FIIW decoder, N P II W decoder, and addressing mode decoder are collectively referred to as a first decoder 303 .

Fl+−デコーダあるいはNFHWデコーダの出力を更
にデコードして、マイクロROMのエントリアドレスを
計算する第2デコーダ305、条件分岐命令の分岐予測
を行う分岐予測機構、オペランドアドレス計算の際のバ
イブラインコンフリクトをチエツクするアドレス計算コ
ンフリクトチエツク機構も含まれる。
A second decoder 305 further decodes the output of the Fl+- decoder or the NFHW decoder to calculate the entry address of the micro ROM, a branch prediction mechanism that predicts the branch of a conditional branch instruction, and a bib line conflict check when calculating the operand address. Also included is an address calculation conflict checking mechanism.

命令デコード部102は命令フェッチ部101から入力
された命令コードを2クロツク(1ステツプ)につきO
〜6バイトずつデコードする。デコード結果の内、デー
タ演算部106での演算に関する情報がマイクロROM
部105に、オペランドアドレス計算に関係する情報が
オペランドアドレス計算部104に、pc計算に関係す
る情報がPC計算部103にそれぞれ出力される。
The instruction decode unit 102 reads the instruction code input from the instruction fetch unit 101 every two clocks (one step).
~Decode 6 bytes at a time. Among the decoding results, information regarding the calculation in the data calculation unit 106 is stored in the micro ROM.
Information related to the operand address calculation is output to the operand address calculation section 104, and information related to the PC calculation is output to the PC calculation section 103.

(2,3) rマイクロROM部」 マイクロROM部105には、主にデータ演算部106
を制御するマイクロプログラムが格納されているマイク
ロROM、マイクロシーケンサ、マイクロ命令デコーダ
等が含まれる。マイクロ命令はマイクロROMから2ク
ロツク(lステップ)に1度読出される。マイクロシー
ケンサはマイクロプログラムで示されるシーケンス処理
の他に、例外、割込及びトラップ(この3つを合わせて
BITと称する)の処理をハードウェア的に受付ける。
(2, 3) ``Micro ROM section'' The micro ROM section 105 mainly includes a data calculation section 106.
It includes a micro ROM, a micro sequencer, a micro instruction decoder, etc. in which a micro program for controlling the micro program is stored. A microinstruction is read from the microROM once every two clocks (l 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 BIT) using hardware.

またマイクロROM部105はストアバッファの管理も
行う。マイクロROM部105には命令コードに依存し
ない割込みあるいは演算実行結果によるフラッグ情報と
、第2デコーダ305の出力等の命令デコード部の出力
が人力される。マイクロデコーダの出力は主にデータ演
算部106に対して出力されるが、ジャンプ命令の実行
による他の先行処理中止情報等の一部の情報は他のブロ
ックへも出力される。
The micro ROM unit 105 also manages store buffers. The micro ROM unit 105 is manually supplied with flag information based on interrupts or arithmetic execution results that do not depend on instruction codes, and outputs from the instruction decoding unit such as the output from the second decoder 305. 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のアドレ
スデコーダ等から出力されたオペランドアドレス計算に
関係する情報によりハードワイヤード制御される。この
ブロックではオペランドのアドレス計算に関するほとん
どの処理が行われる。メモリ間接アドレシングのための
メモリアクセスのアドレス及びオペランドアドレスがメ
モリにマツプされたI / Ofi、ff域に入るか否
かのチエツクも行われる。
(2, 4) r Operand Address Calculation 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 address of the memory access for memory indirect addressing and the operand address fall into the I/Ofi, ff area mapped to memory.

アドレス計算結果は外部バスインターフェイス部107
に送られる。アドレス計算に必要な汎用レジスタ及びプ
ログラムカウンタの値はデータ演算部より入力される。
The address calculation result is sent to the external bus interface section 107.
sent to. The general purpose register and program counter values necessary for address calculation are input 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 unit 107, and the indirect address value input from the data input/output unit 109 is fetched through the instruction decoding unit 102. .

(2,5)  rpc計算部」 PC計算部103は命令デコード部102から出力され
るPC計算に関係する情報によりハードワイヤードに制
御され、命令のpc値を計算する。本発明のデータ処理
装置は可変長命令セットを有しており、命令をデコード
しなければその命令の長さが判らない。このため、PC
計算部103は命令デコード部102から出力される命
令長をデコード中の命令のpc値に加算することにより
次の命令のpc値を作り出す。また、命令デコード部1
02が分岐命令をデコードしてデコード段階での分岐を
指示した場合は、命令長の代わりに分岐変位を分岐命令
の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 calculates the pc value of the instruction. The data processing device of the present invention has a variable length instruction set, and the length of the instruction cannot be determined unless the instruction is decoded. For this reason, PC
The 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 1
When 02 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 apparatus of the present invention, branching to a branch instruction at the instruction decoding stage is called a branch branch.

このブリブランチの手法については特願昭61−204
500号及び特願昭61−200557号で詳しく述べ
られている。
Regarding this Bribranch method, please refer to the patent application No. 61-204.
500 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で計算された
アドレスをバスインクフェイス部がアドレス出力回路l
O8から出力して、CPu外部のメモリからフェッチし
たオペランドをデータ入出力回路109から得る。
(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 hash interface unit 107 and obtained. In addition, when the operand to be calculated is in the memory outside the CPU, the address calculated by the address calculation unit 104 is sent to the address output circuit l by the bus ink face unit.
The data input/output circuit 109 obtains the operands outputted from O8 and fetched from the memory outside the CPU.

演算器としては^LIJ313、バレルシフタ、プライ
オリティエンコーダあるいはカウンタ、シフトレジスタ
などがある。レジスタと主な演算器の間は3バスで結合
されており、1つのレジスタ間演算を指示する1マイク
ロ命令を2クロツク(1ステツプ)で処理する。
Examples of arithmetic units include LIJ313, barrel shifter, priority encoder or counter, and shift register. The registers and the main arithmetic unit are connected by three buses, and one microinstruction that instructs one register-to-register operation is processed in two clocks (one step).

データ演算時にCPU外部のメモリをアクセスする必要
がある場合は、マイクロプログラムの指示により外部バ
スインターフェイス部107を通してアドレス出力回路
108からアドレスをCI)U外部に出力し、データ入
出力回路109を通して目的のデータをフェッチする。
When it is necessary to access memory external to the CPU during data calculation, the address is output from the address output circuit 108 to the outside of CI) U through the external bus interface section 107 according to instructions from the microprogram, and the address is output to the outside of the CI) U through the data input/output circuit 109. Fetch data.

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 storeba sofa.

ジャンプ命令の処理あるいは例外処理等を行って新たな
命令アドレスをデータ演算部106が得た場合は、これ
を命令フェッチ部101とpc計算部103へ出力する
When the data calculation unit 106 obtains a new instruction address by performing jump instruction processing or exception processing, it outputs this to the instruction fetch unit 101 and the pc calculation unit 103.

(以下余白) (2,7) r外部バスインターフェイス部」外部バス
インター−フェイス部107は本発明のデータ処理装置
の外部バスでの通信を制御する。メモリのアクセスはす
べてクロック同期で行われ、最小2クロックサイクル(
1ステツプ)で行うことができる。
(Left below) (2, 7) ``External Bus Interface Section'' The external bus interface section 107 controls communications on the external bus of the data processing apparatus of the present invention. All memory accesses are performed in clock synchronization, with a minimum of two clock cycles (
It can be done in one step).

メモリに対するアクセス要求は命令フェア千部101、
オペランドアドレス計算部104及びデータ演算部10
6から独立に生じる。外部バスインターフェイス部10
7はこれらのメモリアクセス要求を調停する。更にメモ
リとCPUとを結ぶデータバスサイズである32ビツト
(1ワード)の整置境界を跨ぐメモリ番地にあるデータ
のアクセスは、このブロック内で自動的にワード境界を
跨ぐことを検知して2回のメモリアクセスに分解して行
う。
The access request to the memory is the instruction fair 101,
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 the memory and the CPU, it is automatically detected within this block that it straddles a word boundary. This is done by breaking it down into multiple 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)[パイプライン機構j 本発明のデータ処理装置のパイプライン処理機能は第2
図に模式的に示される如くである。
(3) [Pipeline mechanism j The pipeline processing function of the data processing device of the present invention is
As schematically shown in the figure.

命令のブリフェッチを行う命令フヱッチステージ(IF
ステージ)201.命令のデコードを行うデコードステ
ージ(、Dステージ)202.オペランドのアドレス計
算を行うオペランドアドレス計算ステージ(へステージ
)203.マイクロROMアクセス(特にRステージ2
06と呼ぶ)を行う部分とオペランドのブリフェッチ(
特にOFステージ207と称す)を行う部分とからなる
オペランドフェッチステージ(Fステージ)204.命
令を実行する実行ステージ(Eステージ)205の5段
構成をパイプライン処理の基本とする。
The instruction fetch stage (IF
Stage) 201. Decode stage (D stage) 202 for decoding instructions. Operand address calculation stage (to stage) 203 for calculating addresses of operands. Micro ROM access (especially R stage 2)
06) and the operand briefetch (
Operand fetch stage (F stage) 204. A five-stage configuration of an execution stage (E stage) 205 for executing instructions is the basis of pipeline processing.

Eステージ205では1段のストアバッファがある他、
高機能命令の一部は命令の実行自体をパイプライン化す
るため、実際には5段以上のパイプライン処理効果があ
る。
In addition to having a one-stage store buffer in the E stage 205,
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 multiple memory operands is decomposed into multiple pipeline processing units (step codes) based on the number of memory operands and subjected to vibe line processing.

パイプライン処理単位の分解方法に関しては特願昭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ステージ2
02からAステージ203に渡される情報は、命令で指
定された演算に関するもの(Dコード212と称す)と
、オペランドのアドレス計算に関係するもの(Aコード
213と称す)との2つがある。
The information passed from the IF stage 201 to the D stage 202 is the instruction code 211 itself. D stage 2
There are two types of information passed from 02 to the A stage 203: information related to the operation specified by the instruction (referred to as D code 212), and information related to operand address calculation (referred to as A code 213).

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.

Eステージ205以外のステージで検出されたEl↑は
、そのコードがEステージ205に到達する迄はBIT
処理を起動しない。Eステージ205で処理されている
命令のみが実行段階の命令であり、IFステージ201
からFステージ204までの間で処理されている命令は
まだ実行段階に至っていないからである。従って、Eス
テージ205以外で検出されたBITは、それが検出さ
れたことがステップコード中に記録されて次のステージ
に伝えられるのみである。
El↑ detected at a stage other than E stage 205 is BIT until the code reaches 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,l)
 r命令コードフィールドの分類」本発明のデータ処理
装置のパイプライン処理単位は命令セットのフォーマッ
トの特徴を利用して決定されている。
(3,1) r pipeline processing unit” (3,1,l)
Classification of Instruction Code Fields The pipeline processing unit of the data processing apparatus of the present invention is determined using the format characteristics of the instruction set.

(1)節で述べた如く、本発明のデータ処理装置の命令
は2バイト単位の可変長命令であり、基本的には″2バ
イトの命令基本部+0〜4バイトのアドレシング拡張部
”を1〜3回反復することにより命令が構成されている
As described in section (1), the instructions of the data processing device of the present invention are variable-length instructions in 2-byte units, and basically consist of "2-byte basic instruction part + 0 to 4-byte addressing extension part". An instruction is constructed by repeating ~3 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-byte multi-stage indirect mode specification part" is used instead of the addressing extension part. +0 to 4 bytes of addressing extension” is optionally added. Also, depending on the command, 2 or 4
An instruction-specific extension of bytes is appended 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 codes 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個のステップコードに分かれる。多段間接モー
ド指定が行われた場合はそれだけステップコードが増加
する。但し、これは後で述べる様にデコード段階のみで
ある。
In the D stage 202, “2-byte instruction basic part +0 to 4
"byte addressing extension", "multi-stage indirect mode specification section + 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 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 only occurs 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,
Therefore, the value of the program counter is managed for each step code. 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各バイブラインステージの処理」各パイ
プラインステージの人出カステップコードには第2図に
示したように便宜上名前が付けられている。また、ステ
ップコードはオペレーションコードに関する処理を行い
、マイクロプログラムのエントリアドレス及びEステー
ジ205に対するパラメータなどになる系列とEステー
ジ205のマイクロ命令に対するオペランドになる系列
との2系列がある。
(3, 2) Processing of Each Vibration Line Stage The turnout step codes of 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は命令をメモリある
いはブランチバッファからフェッチして命令キュー30
1に入力し、Dステージ202に対して命令コードを出
力する。命令キュー301の人力は整置された4バイト
単位で行う。メモリから命令をフェッチする場合は、整
置された4バイトにつき最小2クロック(lステップ)
を要する。
(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 30.
1 and outputs the instruction code to the D stage 202. The manual operation of the instruction queue 301 is performed in aligned 4-byte units. When fetching instructions from memory, a minimum of 2 clocks (l steps) per 4 aligned bytes
It takes.

ブランチバッファがヒツトした場合は、整置された4バ
イトにつきlクロックでフェッチ可能である。命令キュ
ー301の出力単位は2バイト毎に可変であり、2クロ
ツクの間に最大6バイトまで出力できる。また、分岐の
直後には命令キュー301をバイパスして命令基本部2
バイトを直接命令デコーダに転送することも可能である
If the branch buffer is hit, it can be fetched in 1 clock per aligned 4 bytes. The output unit of the instruction queue 301 is variable every 2 bytes, and up to 6 bytes can be output during 2 clocks. Immediately after a branch, the instruction queue 301 is bypassed and the instruction basic unit 2
It is also possible to transfer the bytes directly to the instruction decoder.

ブランチバッファへの命令の登録及びクリア等の制御、
ブリフェッチ先の命令のアドレスの管理や命令キュー3
01の制御もIFステージ201で行う。
Control of registering and clearing instructions in the branch buffer,
Management of the address of the instruction to be fetched and instruction queue 3
01 is also controlled by the IF stage 201.

IFステージ201で検出するEITには、命令をメモ
リからフェッチする際のバスアクセス例外あるいはメモ
リ保護違反などによるアドレス変換例外がある。
EITs detected at 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ステージ)202は■Fステージ201
から入力された命令コードをデコードする。デコードは
命令デコード部102のFHWデコーダ、NFHWデコ
ーダ及びアドレッシングモードデコーダを合わせた第1
デコーダ303を使用して、2クロツク(1ステツプ)
単位に1度行ない、1回のデコード処理で、0〜6バイ
トの命令コードを消費する()IET命令の復帰先アド
レスを含むステップコードの出力処理などでは命令コー
ドを消費しない)。1回のデコードでAステージ203
に対してアドレス計算情報としてのAコード213であ
る制御コードとアドレス修飾情報と、オペレーションコ
ードの中間デコード結果としての1〕コード212であ
る制御コードと8ビツトのリテラル情報とを出力する。
(3, 2, 2) "r instruction decode stage" instruction decode stage (D stage) 202 is ■F stage 201
Decodes the instruction code input from. Decoding is carried out using the first unit that combines the FHW decoder, NFHW decoder, and addressing mode decoder of the instruction decoding unit 102.
2 clocks (1 step) using decoder 303
This is performed once per unit, and one decoding process consumes an instruction code of 0 to 6 bytes (no instruction code is consumed in output processing of a step code including the return destination address of an IET instruction, etc.). A stage 203 with one decoding
In response, a control code and address modification information, which is the A code 213 as address calculation information, and a control code and 8-bit literal information, which are the 1] code 212 as the intermediate decoding result of the operation code, are output.

Dステージ202では、各命令のPC計算部103の制
御、分岐予測処理、ブリブランチ命令に対するブリブラ
ンチ処理、命令キュー301からの命令コード出力処理
をも行う。
The D stage 202 also performs control of the PC calculation unit 103 for each instruction, branch prediction processing, branch processing for a branch instruction, and instruction code output processing from the instruction queue 301.

Dステージ202で検出するEITには、予約命令例外
及びブリブランチ時の奇数アドレスジャンプトラップが
ある。また、IFステージ201より転送されてきた各
種BITはステップコード内にエンコードする処理をし
てAステージ203に転送する。
EITs detected in the D stage 202 include reserved instruction exceptions and odd address jump traps at the time of a branch. Further, various BITs transferred from the IF stage 201 are encoded into step codes and transferred to the A stage 203.

(3,2,3) rオペランドアドレス計算ステージ」
オペランドアドレス計算ステージ(Aステージ)203
は処理機能が大きく2つに分かれる。1つは命令デコー
ド部102の第2デコーダ305を使用してオペレーシ
ョンコードの後段デコードを行う処理で、他方はオペラ
ンドアドレス計算部104でオペランドアドレスの計算
を行う処理である。
(3, 2, 3) r operand address calculation stage”
Operand address calculation stage (A stage) 203
The processing functions are broadly divided into two. One is a process in which the second decoder 305 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の出
力を行う。なお、レジスタあるいはメモリの書込み予約
は、アドレス計算で参照したレジスタやメモリの内容が
パイプライン上を先行する命令で書換えられることによ
り誤ったアドレス計算が行われるのを防ぐためのもので
ある。レジスタあるいはメモリの書込み予約はデッドロ
ックを避けるため、ステップコード毎ではなく命令毎に
行う。レジスタ及びメモリへの書込み予約については特
願昭62−144394号で詳しく述べられている。
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 intended to prevent incorrect address calculation from being performed due to the contents of the register or memory referenced in address calculation being rewritten by a preceding instruction on the pipeline. Register or memory write reservations are made for each instruction, not for each step code, to avoid deadlock. The reservation of writing to registers and memory is described in detail in Japanese Patent Application No. 144394/1983.

オペランドアドレス計算処理はAコード213を入力と
し、Aコード213に従いオペランドアドレス計算部1
04で加算あるいはメモリ間接参照を組合わせてアドレ
ス計算を行い、その計算結果をFコード215として出
力する。この際、アドレス計算に伴うレジスタ及びメモ
リの読出し時にコンフリクトチエツクを行い、先行命令
がレジスタあるいはメモリに書込み処理を終了していな
いためコンフリクトが指示されれば、先行命令がEステ
ージ205で書込み処理を終了するまで待つ。また、オ
ペランドアドレス及びメモリ間接参照のアドレスがメモ
リにマツプされたl10SI域に入るか否かのチエツク
も行う。
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.
Address calculation is performed in combination with addition or memory indirect reference in step 04, and the calculation result is output 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 executes the writing process at E stage 205. Wait until it finishes. It also checks whether the operand address and the memory indirect reference address fall within the l10SI 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, bus access exception, address translation exception,
There is a debug trap due to an operand breakpoint hit 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ステージ)204も処
理が大きく2つに分かれる。一方はマイクロROMのア
クセス処理であり、特にRステージ206と称する。他
方はオペランドブリフェッチ処理であり、特にOFステ
ージ207と称する。Rステージ206とOFステージ
207とは必ずしも同時に動作するわけではな(、メモ
リアクセス権が獲得できるか否か等に依存して独立に動
作する。
(3, 2, 4) r Micro ROM access stage
The operand fetch stage (F stage) 204 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. The other is operand briefetch processing, particularly referred to as OF stage 207. The R stage 206 and the OF stage 207 do not necessarily operate simultaneously (they operate independently depending on whether memory access rights can be acquired, etc.).

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. Micro ROM access to R code 214 occurs during the last micro instruction execution 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, micro ROM accesses to the R code 214 are often executed one after another.

Rステージ206で新たに検出するBITはない。There is no new BIT detected in the R stage 206.

Rコード214が命令処理再実行型のEITを示してい
る時は、そのEIT処理に対するマイクロプログラムが
実行されるので、Rステージ206はそのRコード21
4に従ったマイクロ命令をフェッチする。
When the R code 214 indicates an instruction processing re-execution type EIT, the microprogram for that EIT processing is executed, so the R stage 206
Fetch the microinstruction according to 4.

Rコード214が奇数アドレスジャンプトラップを示し
ている場合、Rステージ206はそれをEコード216
によって伝える。これはブリブランチに対するもので、
Eステージ205ではそのEコード216で分岐が生じ
なければそのブリブランチを有効として奇数アドレスジ
ャンプトラップを発生する。
If R code 214 indicates an odd address jump trap, R stage 206 sends it to E code 216.
convey by. This is for Bribranch,
In the E stage 205, if a branch does not occur in the E code 216, the 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 The operand fetch stage (OF stage) 207 performs operand prefetch processing of the above two processes performed in the F stage 204.

オペランドブリフェッチはFコード215を入力とし、
フェッチしたオペランドとそのアドレスをSコード21
7として出力する。1つのFコード215ではワード境
界を跨いでも良いが4バイト以下のオペランドフェッチ
を指定する。Fコード215にはオペランドのアクセス
を行うか否かの指定も含まれており、Aステージ203
で計算したオペランドアドレス自体あるいは即値をEス
テージ205に転送する場合にはオペランドブリフェッ
チは行わず、Fコード215の内容をSコード217と
して転送する。ブリフェッチしようとするオペランドと
、Eステージ205が書き込み処理を行おうとするオペ
ランドとが一致する場合は、オペランドブリフェッチは
メモリから行わずバイパスして行う。また、[10領域
に対してはオペランドプリフェッチを遅延させ、先行命
令がすべて完了するまで待ってオペランドフェッチを行
う。
Operand briefetch 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 operand fetch of 4 bytes or less, although it may span 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, the 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 pre-fetched matches the operand to be written by the E stage 205, the operand pre-fetch is not performed from memory but is bypassed. In addition, for the [10 area, operand prefetch is delayed, and operand fetch is performed after waiting until all preceding instructions are completed.

OFステージ207で検出されるBITには、ハ′スア
クセス例外、アドレス変換例外、オペランドブリフェッ
チに対するブレイクポイントヒツトによるデバッグトラ
ップがある。Fコード215がデバッグトラップ以外の
EITを示している時は、それをSコード217に転送
し、オペランドプリフェッチは行わない。Fコード21
5がデバッグトラップを示している時は、そのFコード
215に対してBITを示していない場合と同じ処理を
すると共にデバラグトラップをSコード217に伝える
The BITs detected in the OF stage 207 include a bus access exception, an address translation exception, and a debug trap caused by a breakpoint hit for operand briefetch. When the F code 215 indicates an EIT other than a debug trap, it is transferred to the S code 217 and no operand prefetch is performed. F code 21
When 5 indicates a debug trap, the same processing as when BIT is not indicated is performed for the F code 215, and the debug trap is transmitted to the S code 217.

(3,2,6) r実行ステージ」 実行ステージ(Eステージ)205はEコード216及
びSコード217を入力として動作する。このEステー
ジ205が命令を実行するステージであり、Fステージ
204以前のステージで行われた処理は全てEステージ
205のための前処理である。Eステージ205でジャ
ンプ命令が実行されたり、あるいはBIT処理が起動さ
れたりした場合は、IFステージ201からFステージ
204までの処理は全て無効化される。Eステージ20
5はマイクロプログラムにより制御され、Rコード21
4に示されたマイクロプログラムのエントリアドレスか
らの一連のマイクロプログラムを実行することにより命
令を実行する。
(3, 2, 6) r Execution Stage” The execution stage (E stage) 205 operates with the E code 216 and the 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 or BIT processing is started at E stage 205, all processing from IF stage 201 to F stage 204 is invalidated. E stage 20
5 is controlled by a microprogram, R code 21
The instructions are executed by executing a series of microprograms starting from the microprogram entry address shown in 4.

マイクロRO?Iの読み出しとマイクロ命令の実行とは
パイプライン化されて行われる。従ってマイクロプログ
ラムで分岐が起きた場合は、1マイクロステツプの空き
ができる。また、Eステージ205はデータ演算部10
6にあるストアバッファを利用して、4バイト以内のオ
ペランドストアと次のマイクロ命令実行をパイプライン
処理することもできる。
Micro RO? The reading of I and the execution of microinstructions are performed in a pipelined manner. Therefore, when a branch occurs in a microprogram, one microstep becomes vacant. In addition, the E stage 205 includes the data calculation section 10
Using the store buffer in 6, it is also possible to perform pipeline processing for storing operands within 4 bytes and executing the next microinstruction.

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には、バスアクセ
ス例外、アドレス変換例外、デバッグトラップ、奇数ア
ドレスジャンプトラップ、予約機能例外、不正オペラン
ド例外、予約スタックフォーマット例外、ゼロ除算トラ
ップ、無条件トラップ、条件トラップ、遅延コンテキス
トトラップ、外部割込、遅延割込、リセット割込、シス
テム障害がある。
BITs detected in the E stage 205 include bus access exceptions, address translation exceptions, debug traps, odd address jump traps, reserved function exceptions, illegal operand exceptions, reserved stack format exceptions, divide-by-zero traps, unconditional traps, and conditional traps. There are , delayed context traps, external interrupts, delayed interrupts, reset interrupts, and system failures.

Eステージ205で検出されたBITは全てBIT処理
されるが、Eステージ以前のIFステージ201からF
ステージ2040間で検出され、Rコード214あるい
はSコード217に反映されているBITは必ずしもB
IT処理されるとは限らない。IPステージ201から
Fステージ204の間で検出されたが、先行の命令がE
ステージ205でジャンプ命令が実行されたなどの原因
でEステージ205まで到達しなかったBITは全てキ
ャンセルされる。そのIEITを起こした命令はそもそ
も実行されなかったことになる。
All BITs detected at E stage 205 are processed, but BITs from IF stage 201 before E stage
BIT detected between stages 2040 and reflected in R code 214 or S code 217 is not necessarily BIT.
It does not necessarily have to be processed by IT. It was detected between IP stage 201 and F stage 204, but the preceding instruction was
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 IEIT was never executed in the first place.

外部割込及び遅延割込は命令の切れ目でEステージ20
5に直接受は付けられ、マイクロプログラムにより必要
な処理が実行される。その他の各種EITの処理はマイ
クロプログラムにより行われる。
External interrupts and delayed interrupts are processed at E stage 20 at the end of instructions.
5 is directly accepted, and the necessary processing is executed by the microprogram. Other various EIT processes are performed by microprograms.

(3,3) r各パイプラインステージの状態制御」パ
イプラインの各ステージは入力ラッチと出力ラッチとを
有し、他のステージとは独立に動作することを基本とす
る。各ステージは1つ前に行った処理が終わり、その処
理結果を出力ランチから次のステージの入力ラッチに転
送し、自分のステージの入力ラッチに次の処理に必要な
入力信号がすべて揃えば次の処理を開始する。
(3, 3) rState control of each pipeline stage Each stage of the pipeline has an input latch and an output latch, and basically operates independently of other stages. Each stage completes the previous processing and transfers the processing result from the output lunch to the input latch of the next stage, and when the input latch of its own stage has all the input signals necessary for the next processing, the next stage is started. start processing.

つまり各ステージは、1つ前段のステージから出力され
てくる次の処理に対する人力信号が全て有効となり、今
の処理結果を後段のステージの入力ラッチに転送して出
力ラッチが空になると次の処理を開始する。
In other words, in each stage, all human input signals for the next process output from the previous stage are valid, the current processing result is transferred to the input latch of the next stage, and when the output latch becomes 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 next stage's manual latch, the input lunch of the next stage must be free, and even if the input latch of the next stage is not free, the pipeline stage will wait. state (waiting for output). If a necessary memory access right cannot be acquired, 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プッシュ、プッシュA命令に関す
るステップコード処理」 第28図は、本発明を説明するためのブロック図である
。61はオペランドアドレス計算ステージ(Aステージ
203)の作業用ステージスタックポインタ(ASP)
であり、Aステージ203で実行中の命令に付随するス
タックポインタの値を示す。62はオペランドフェッチ
ステージ(Fステージ204)の作業用ステージスタッ
クポインタ(FSP)、63は実行ステージ(Eステー
ジ205)の作業用ステージスタックポインタ(C3P
)であり、それぞれ各ステージで実行中の命令に付随す
るスタックポインタの値を示す。64はソフトウェアか
らみたレベルのスタックポインタ群、70はFステージ
204のアドレスレジスタ(FAレジスタ)、71はS
コード217としてオペランドアドレスを格納するアド
レスレジスタ(SAレジスタ)、72はEステージ20
5のアドレスレジスタ(AAレジスタ)、73は外部と
やり取りされるデータのためのEステージ205のデー
タレジスタ(DDレンジング、74はFステージ204
でメモリからフェッチされたオペランドをいれるデータ
レジスタ(SDレジスタ)、75はAステージ203の
アドレス加算部、80〜87は内部データバスである。
(3, 4), Step Code Processing Regarding Push r, Push A Instructions” FIG. 28 is a block diagram for explaining the present invention. 61 is a working stage stack pointer (ASP) of the operand address calculation stage (A stage 203)
, which indicates the value of the stack pointer associated with the instruction being executed in the A stage 203. 62 is a working stage stack pointer (FSP) of the operand fetch stage (F stage 204), and 63 is a working stage stack pointer (C3P) of the execution stage (E stage 205).
), each indicating the value of the stack pointer associated with the instruction being executed at each stage. 64 is a stack pointer group at the software level, 70 is an address register (FA register) of the F stage 204, and 71 is an S
Address register (SA register) that stores the operand address as code 217, 72 is E stage 20
5 address register (AA register), 73 a data register (DD ranging) of the E stage 205 for data exchanged with the outside, and 74 a data register of the F stage 204.
75 is an address adder of the A stage 203, and 80 to 87 are internal data buses.

102は命令デコード部、106は実行ステージ205
のデータ演算部、108はアドレス出力回路、109は
データ入出力回路である。
102 is an instruction decoding unit, 106 is an execution stage 205
108 is an address output circuit, and 109 is a data input/output circuit.

第32図は、本発明のデータ処理装置において処理され
るプッシュ、プッシュ^命令の命令フォーマット図であ
る。
FIG. 32 is an instruction format diagram of push and push^ instructions processed in the data processing device of the present invention.

また第29図、第30図、第31図は本発明のデータ処
理装置において実施されるプッシュ、プッシュ^命令の
、各ステージでの動作を示すフローチャートであり第2
9図はソースがメモリ、第30図はソースがレジスタ、
第31図はプッシュ命令の場合である。またステップ5
100〜5105はAステージ203、ステップ520
0〜5205はFステージ204及びステップ5300
〜5307はEステージ205での動作を夫々示してい
る。
Further, FIGS. 29, 30, and 31 are flowcharts showing operations at each stage of the push and push^ commands executed in the data processing device of the present invention.
In Figure 9, the source is memory, in Figure 30, the source is register,
FIG. 31 shows the case of a push command. Also step 5
100 to 5105 are A stage 203, step 520
0 to 5205 are F stage 204 and step 5300
5307 indicate the operations at the E stage 205, respectively.

本発明のデータ処理装置において処理されるプッシュ、
プッシュ八命令は第32図に示すフォーマットを持ち、
命令の中で指定されたソースオペランドをスタックトッ
プにストアする。プッシュ命令ではソースアトレンジン
グモードが示す値がソースオペランドに、またプッシュ
^命令ではソースアドレスがソースオペランドとなる。
Push processed in the data processing device of the present invention,
The push eight command has the format shown in Figure 32,
Stores the source operand specified in the instruction to the top of the stack. In a push instruction, the value indicated by the source ranging mode becomes the source operand, and in a push^ instruction, the source address becomes the source operand.

またデスティネーションのアドレスとしては、スタック
ポインタの値をオペランドのサイズ分デクリメントした
値が使用される。このようにプッシュ、プッシュ命令は
、メモリーメモリ間転送が可能な命令であり2つのアド
レス計算が必要なため、本来なら2つのステップコード
を必要とする。
Further, as the destination address, a value obtained by decrementing the value of the stack pointer by the size of the operand is used. In this way, the push and push instructions are instructions that can be transferred between memories and require two address calculations, so they originally require two step codes.

しかし、本発明においてはASI’61にデクリメント
機能を設け、Aステージ33でのアドレス演算と八5l
)61のブリデクリメントを1つのステ・ンブコードで
同時に行う。
However, in the present invention, the ASI'61 is provided with a decrement function, and the address calculation in the A stage 33 and the 85l
) 61 bride-decrements are performed simultaneously in one stem code.

プッシュ、プッシュA命令を第2図、第28図、第29
図、第30図及び第31図により、バイブラインの流れ
に沿ってみていく。まず命令デコード部102でプッシ
ュ、プッシュツA命令をデコードしたら、アドレシッシ
ングモード情報、ASP61の更新制御情報等を1つの
ステップコード(Aコード213)として、Aステージ
203のアドレス加算部75とASP61へ出力する。
Push, Push A commands in Figures 2, 28, and 29
30 and 31, we will follow the flow of the vibe line. First, after decoding the push and push to A instructions in the instruction decoding unit 102, addressing mode information, update control information of the ASP61, etc. are converted into one step code (A code 213) and sent to the address addition unit 75 of the A stage 203 and the ASP61. Output.

命令のオペコード側の情報はDコード212として出力
される。
Information on the opcode side of the instruction is output as a D code 212.

この後の各ステージの動作を第29図、第30図、第3
1図に示す。Eステージ205における1つのEコード
216の処理を1ステツプと呼ぶこととする。
The operation of each stage after this is shown in Figures 29, 30, and 3.
Shown in Figure 1. The processing of one E code 216 in the E stage 205 is called one step.

まず第30図にプッシュ命令でソースがレジスタである
場合を示す。
First, FIG. 30 shows a case where the source is a register in a push instruction.

Aステージ203ではAコード213の^sp更新制御
情報により、^5P61をオペランドのサイズ分デクリ
メントする。そしてこのデクリメントされた八5P61
の値をステップコードのパイプライン中の流れと同期し
てFSP62に転送する(S103)  、またソース
のレジスタ番号等をRコード214として出力する(5
102)。
In the A stage 203, ^5P61 is decremented by the size of the operand according to the ^sp update control information of the A code 213. And this decremented 85P61
The value of is transferred to the FSP 62 in synchronization with the flow of the step code in the pipeline (S103), and the source register number etc. is output as the R code 214 (S103).
102).

Fステージ204ではFSP62の値をステップコード
のパイプライン中の流れと同期してC3P63に転送す
る(S203)  。またRコード214からソースの
レジスタをアクセスする信号を含むEコード216を生
成し出力する(S202)。
In the F stage 204, the value of the FSP62 is transferred to the C3P63 in synchronization with the flow of the step code in the pipeline (S203). Furthermore, an E code 216 including a signal for accessing the source register is generated and outputted from the R code 214 (S202).

Eステージ205でAAレジスタ72にはデスティネー
ションアドレスとしてC5P63の値を書き込む。
At the E stage 205, the value of C5P63 is written into the AA register 72 as the destination address.

この時の経路は、 C3P63→Stバス82→AAレジスタ72となる。The route at this time is C3P63→St bus 82→AA register 72.

またEコード216で指定されたレジスタの値をDDレ
ジスタ73に書き込む。この時の経路は、レジスタ76
→S2バス87→データ演算部106→DOバス85→
DDレジスタ73 となる。この2つの経路はぶつからないので1ステツプ
で実行される(S303)。
Further, the value of the register specified by the E code 216 is written to the DD register 73. The path at this time is register 76
→S2 bus 87→data calculation unit 106→DO bus 85→
It becomes DD register 73. Since these two routes do not collide, they are executed in one step (S303).

次にAAレジスタ72の指すアドレスにDDレジスタ7
3の値を書き込む(S304)。このストア処理はEス
テージ205でのデータ演算処理とは独立して実行可能
であり、ストア処理と並列に次の命令の処理を行うこと
ができる。
Next, the DD register 7 is set to the address pointed to by the AA register 72.
A value of 3 is written (S304). This store processing can be executed independently of the data calculation processing at the E stage 205, and the next instruction can be processed in parallel with the store processing.

次に、第29図にプッシュ命令でソースがメモリの場合
を示す。
Next, FIG. 29 shows a case where the source is a memory in a push instruction.

Aステージ203では、Aコード213の^sp更新制
御情報により、ASP61をオペランドのサイズ分デク
リメントする。そしてこのデクリメントされたASP6
1の値をステップコードのバイ′ブライン中の流れと同
期してFSP62に転送する(S101)。またアドレ
ス加算部75にてソースアドレスを計算しく5100)
、Fコード215として出力する。
In the A stage 203, the ASP 61 is decremented by the size of the operand according to the ^sp update control information of the A code 213. And this decremented ASP6
The value of 1 is transferred to the FSP 62 in synchronization with the flow in the by-line of the step code (S101). Also, the address addition unit 75 calculates the source address (5100).
, is output as F code 215.

Fステージ204ではFSP62の値はステップコード
のパイプライン中の流れと同期してC3P63に転送さ
れる(S201)。Fコード215のソースアドレスを
FAレジスタ70に格納し、その値に基づきソースオペ
ランドをメモリからフェッチして来てSロレジスタ74
にいれる(S200)。
In the F stage 204, the value of the FSP 62 is transferred to the C3P 63 in synchronization with the flow of the step code in the pipeline (S201). The source address of the F code 215 is stored in the FA register 70, and the source operand is fetched from memory based on the value and sent to the S lo register 74.
(S200).

Eステージ205ではAAレジスタ72ζこデスティネ
ーションアドレスとしてC5P63の値を書き込む(S
300)。この時の経路は、 C3P63→Slバス82→AAレジスタ72となる。
In the E stage 205, the value of C5P63 is written as the destination address of the AA register 72ζ (S
300). The route at this time is C3P63→Sl bus 82→AA register 72.

Fステージ204でフェッチされたソースオペランドは
SDレジスタ(74)からDDレジスタ73に転送され
る(S301)。この時の経路は、 SOレジスタ73→S1バス87→テータ演算部106
→D。
The source operand fetched in the F stage 204 is transferred from the SD register (74) to the DD register 73 (S301). The route at this time is: SO register 73 → S1 bus 87 → theta calculation unit 106
→D.

バス85→00レジスタ73 となる。Bus 85 → 00 register 73 becomes.

この2つの経路は両方S1バス82を含むのでステップ
を2つに分けて実行する。ただし、SDレジスタ74に
はS2バス87を通る経路もあるが、実行ステージ20
5ではレジスタ直接とそれ以外という分は方が実行し易
いため上記の経路をとる。レジスタ直接以外でSlバス
82シか経路のない場合として、ソースが即値の場合が
ある。即値データはアドレス加算部75からそのまま出
力され、AOババス3→F^レジスタ70→SAレジス
タ71とわたってS1パス82に出力される。この時は
C5P63→AAレジスタ72もS1バス82を使う経
路しかないため、2つのステップに分けて実行される。
Since these two paths both include the S1 bus 82, the steps are performed in two parts. However, although the SD register 74 also has a path that passes through the S2 bus 87,
In 5, the above route is taken because it is easier to execute the register directly and other parts. As a case where there is no route to the SL bus 82 other than directly to the register, there is a case where the source is an immediate value. The immediate value data is output as is from the address adder 75, passes through the AO bus 3→F^ register 70→SA register 71, and is output to the S1 path 82. At this time, since the C5P63→AA register 72 only has a route that uses the S1 bus 82, the process is divided into two steps and executed.

この即値等に合わせてメモリの場合も2つのステップで
実行する。
In accordance with this immediate value, etc., the memory case is also executed in two steps.

そしてAAレジスタ72の指すアドレスにDDレジスタ
73の値を書き込む(S302)。
Then, the value of the DD register 73 is written to the address pointed to by the AA register 72 (S302).

本実施例ではSlバス82のコンフリクトが起こるため
に2つのステップがEステージ205で必要となる。し
かしS2バス87を延長するなどの方法で、SAレジス
タ71→データ演算部106 とC5P63→静レジス
タ72を1つのステップで行えれば、Eステージ205
のステップを1つにすることができる。
In this embodiment, two steps are required in the E stage 205 due to a conflict on the Sl bus 82. However, if the SA register 71 → data calculation unit 106 and C5P63 → static register 72 can be performed in one step by extending the S2 bus 87, then the E stage 205
can be combined into one step.

次に、第31図にプッシュA命令の場合を示す。Next, FIG. 31 shows the case of the push A command.

Aステージ203でハAコード213の^sp更新制御
情報により、ASP61をオペランドのサイズ分デクリ
メントする。そしてこのデクリメントされた^5P61
の値をステップコードのパイプライン中の流れと同期し
てFSP (62)に転送する(S105)。またアド
レス加算部75にてソースアドレスを計算しFコード2
15として出力する(S104)。
At the A stage 203, the ASP 61 is decremented by the size of the operand according to the ^sp update control information of the A code 213. And this decremented ^5P61
The value of is transferred to the FSP (62) in synchronization with the flow of the step code in the pipeline (S105). In addition, the address adder 75 calculates the source address and F code 2.
15 (S104).

Fステージ204ではFSP62の値をステップコード
のパイプライン中の流れと同期してC5P63に転送す
る(S205)。Fコード215のソースアドレスをF
Aレジスタ70に格納し、その値をSAレジスタ71に
転送する(5204)。この値がソースオペランドとな
る。
In the F stage 204, the value of the FSP62 is transferred to the C5P63 in synchronization with the flow of the step code in the pipeline (S205). F code 215 source address
The value is stored in the A register 70 and transferred to the SA register 71 (5204). This value becomes the source operand.

Eステージ205ではAAレジスタ72にデスティネー
ションアドレスとしてC5P63の値を書き込む(S3
05)。この時の経路は、 C5P63→Slバス82→AAレジスタ72となる。
In the E stage 205, the value of C5P63 is written to the AA register 72 as the destination address (S3
05). The route at this time is C5P63→Sl bus 82→AA register 72.

SAレジスタ71の値をソースオペランドとしてロロレ
ジスタ73に送る(S306)。この時の経路は、SA
レジスタ71→S1バス87→テータ演算部106→ロ
0バス85→DOレジスタ73 となる。この2つの経路は両方S1バス82を含むので
2ステツプで実行する。
The value of the SA register 71 is sent to the Rolo register 73 as a source operand (S306). The route at this time is SA
The sequence is as follows: register 71→S1 bus 87→theta calculation unit 106→RO bus 85→DO register 73. Since these two paths both include the S1 bus 82, it is executed in two steps.

AAレジスタ72の指すアドレスにDDレジスタ73の
値を書き込む(S307)。
The value of the DD register 73 is written to the address pointed to by the AA register 72 (S307).

このようにプッシュ、プッシュA命令がAステージ20
3で処理を終わった時点で、この命令終了時のスタック
ポインタの値がASP61に格納されている。そのため
後の命令のステップコードがスタックポインタをAステ
ージ203で参照しても、プッシュ、プッシュA命令が
Fステージ204又はEステージ205でASP61の
値を書き換えることはないので、スタックポインタに関
するコンフリクトは起こらない。例えば次の命令のアド
レシッシングモードが(SP + disp)であって
も、(ASP +disp)をアドレス加算部75で実
行することにより、プッシュ、プッシュ^命令の実行終
了を待たなくても、正しいアドレスが得られる。
In this way, push, push A command is A stage 20
When the process ends in step 3, the value of the stack pointer at the end of this instruction is stored in the ASP 61. Therefore, even if the step code of a later instruction refers to the stack pointer at the A stage 203, a conflict regarding the stack pointer will not occur because the push or push A instruction will not rewrite the value of ASP61 at the F stage 204 or E stage 205. do not have. For example, even if the addressing mode of the next instruction is (SP + disp), by executing (ASP + disp) in the address adder 75, it will be correct without waiting for the end of execution of the push, push^ instruction. You will get an address.

また、プッシュ命令でソースがレジスタの場合は各ステ
ージでの実行ステップ数は1ステツプであり、この時の
命令実行時間は最小2クロックということになる。つま
りアドレス加算部75での計算とASP61の更新を1
つのステップコードで行うことにより、これをソース側
とデスティネーション側との2つのステップコードを生
成する場合に生じる、Aステージ203での実行ステッ
プの増加(1ステツプ→2ステツプ)によるプッシュ命
令の高速化をはかることができる。
Furthermore, when the source of a push instruction is a register, the number of execution steps at each stage is one step, and the instruction execution time at this time is a minimum of two clocks. In other words, the calculation in the address adder 75 and the update in the ASP 61 are
By doing this with one step code, the push instruction is faster due to the increase in execution steps (1 step → 2 steps) in the A stage 203, which occurs when generating two step codes for the source side and the destination side. It is possible to make changes.

[発明の効果] 以上のようにこの発明によれば、プッシュ、プッシュ八
命令処理時にアドレス計算ステージにおいて、アドレス
加算部でのオペランドアドレスの計算と、アドレス計算
ステージのスタックポインタの更新とを行い、スタック
ポインタの値をパイプラインの流れに同期して転送する
ことにより、プッシュ、プッシュA命令の後の命令がア
ドレス計算ステージでスタックポインタに関するコンフ
リクトを起こすことなくパイプラインの処理効率を上げ
ることができ、またプッシュ命令を最小1ステツプで実
行できるため、データ処理装置の性能が向上するという
効果がある。
[Effects of the Invention] As described above, according to the present invention, in the address calculation stage during push and push eight instruction processing, the operand address is calculated in the address adder and the stack pointer in the address calculation stage is updated. By transferring the stack pointer value in synchronization with the flow of the pipeline, the instructions after the push and push A instructions can improve pipeline processing efficiency without causing conflicts regarding the stack pointer at the address calculation stage. Furthermore, since a push command can be executed in at least one step, the performance of the data processing device is improved.

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

第1図は本発明の一実施例によるデータ処理装置の全体
ブロック図、第2図は本発明の一実施例によるデータ処
理装置のパイプライン概要図、第3図〜第27図は本発
明の一実施例によるデータ処理装置の命令フォーマット
の特徴を示す図、第28図は本発明の一実施例によるデ
ータ処理装置のスタックポインタ関連部分の構成図、第
29図、第30図、第31図は本発明のデータ処理装置
において実施されるプッシュ、プッシュ^命令の実行フ
ローチャート、第32図は本発明のデータ処理装置にお
いて実施されるプッシュ、プッシュ八命令の命令フォー
マント図、第33図は従来のデータ処理装置のブロック
図、第34図は従来のプッシュ命令の実行フローチャー
トである。 203・・・アドレス計算ステージ(Aステージ)20
5・・・実行ステージ(Eステージ)212〜217・
・・パイプライン処理の単位であるステップコード 6
1・・・Aステージの作業用ステージスタックポインタ
 63・・・Eステージの作業用ステージスタックポイ
ンタ 75・・・Aステージのアドレス加算部である。 なお、図中同一符号は、同一、または相当部分を示す。
FIG. 1 is an overall block diagram of a data processing device according to an embodiment of the present invention, FIG. 2 is a schematic diagram of a pipeline of a data processing device according to an embodiment of the present invention, and FIGS. FIG. 28 is a diagram showing the characteristics of the instruction format of a data processing device according to an embodiment of the present invention; FIG. 28 is a configuration diagram of a stack pointer-related portion of a data processing device according to an embodiment of the present invention; FIGS. 32 is an execution flowchart of the push and push^ instructions executed in the data processing device of the present invention, FIG. 32 is an instruction form diagram of the push and push eight instructions executed in the data processing device of the present invention, and FIG. 33 is a conventional FIG. 34 is a block diagram of the data processing device of FIG. 34, which is a conventional push instruction execution flowchart. 203... Address calculation stage (A stage) 20
5... Execution stage (E stage) 212-217.
・Step code which is the unit of pipeline processing 6
1...A stage working stage stack pointer 63...E stage working stage stack pointer 75...A stage address addition unit. Note that the same reference numerals in the figures indicate the same or equivalent parts.

Claims (1)

【特許請求の範囲】 1、汎用アドレシッシングモードで指定可能なオペラン
ドの値をメモリ上のスタックにプッシュするプッシュ命
令を備え、命令の実行を行う実行ステージと、該実行ス
テージでの処理に先行してオペランドのアドレス計算を
行うアドレス計算ステージとを含む複数のステージによ
るパイプライン処理により命令を処理するデータ処理装
置において、 前記アドレス計算ステージで制御され、オペランドのア
ドレス計算を行うアドレス加算部と、 前記アドレス計算ステージで制御され、前記汎用アドレ
シッシングモードがスタックプッシュモードのときオペ
ランドの処理に伴うデクリメント処理を行う第1のスタ
ックポインタと、 前記実行ステージが制御する第2のスタックポインタと
を備え、 前記第1のスタックポインタは前記第2のスタックポイ
ンタの更新処理に先行して更新され、 前記プッシュ命令処理時に、前記アドレス計算ステージ
にて、前記アドレス加算部を用いたオペランドのアドレ
ス計算と、前記第1のスタックポインタにおけるプッシ
ュ操作に伴うスタックポインタの更新とをすべくなして
あることを特徴とするデータ処理装置。
[Claims] 1. An execution stage that executes an instruction, which includes a push instruction that pushes operand values that can be specified in general-purpose addressing mode onto a stack in memory, and a process that precedes processing in the execution stage. an address calculation stage that calculates an address of an operand; and an address adder controlled by the address calculation stage that calculates an address of an operand; a first stack pointer that is controlled by the address calculation stage and performs decrement processing in conjunction with operand processing when the general-purpose addressing mode is stack push mode; and a second stack pointer that is controlled by the execution stage. , the first stack pointer is updated prior to the update process of the second stack pointer, and during the push instruction processing, the address calculation of the operand is performed using the address adder in the address calculation stage; A data processing device characterized in that a stack pointer is updated in accordance with a push operation on the first stack pointer.
JP63177941A 1988-07-14 1988-07-14 Data processing device Expired - Lifetime JPH0769801B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63177941A JPH0769801B2 (en) 1988-07-14 1988-07-14 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63177941A JPH0769801B2 (en) 1988-07-14 1988-07-14 Data processing device

Publications (2)

Publication Number Publication Date
JPH0225932A true JPH0225932A (en) 1990-01-29
JPH0769801B2 JPH0769801B2 (en) 1995-07-31

Family

ID=16039748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63177941A Expired - Lifetime JPH0769801B2 (en) 1988-07-14 1988-07-14 Data processing device

Country Status (1)

Country Link
JP (1) JPH0769801B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04260928A (en) * 1991-01-21 1992-09-16 Mitsubishi Electric Corp Data processor

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63308641A (en) * 1987-06-10 1988-12-16 Mitsubishi Electric Corp Data processor having pipeline processing mechanism

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63308641A (en) * 1987-06-10 1988-12-16 Mitsubishi Electric Corp Data processor having pipeline processing mechanism

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04260928A (en) * 1991-01-21 1992-09-16 Mitsubishi Electric Corp Data processor

Also Published As

Publication number Publication date
JPH0769801B2 (en) 1995-07-31

Similar Documents

Publication Publication Date Title
US5091853A (en) Chained addressing mode pipelined processor which merges separately decoded parts of a multiple operation instruction
JPH02173823A (en) Data processor
US5313644A (en) System having status update controller for determining which one of parallel operation results of execution units is allowed to set conditions of shared processor status word
JP3543181B2 (en) Data processing device
US4945511A (en) Improved pipelined processor with two stage decoder for exchanging register values for similar operand instructions
JPH01214932A (en) Data processor
JPH03158928A (en) Data processor
JPH07120284B2 (en) Data processing device
JP2710994B2 (en) Data processing device
JPH0769806B2 (en) Data processing device
US5269008A (en) Method and apparatus for pre-processing the source of a pop instruction in a pipeline computer
JP2504235B2 (en) Data processing device
JPH0225932A (en) Data processor
JP2532560B2 (en) Data processing device for high-performance exception handling
JP2522048B2 (en) Microprocessor and data processing device using the same
JPH0218621A (en) Data processor
JPH0290325A (en) Data processor
JPH0769802B2 (en) Data processing device
JPH0298734A (en) Data processor
JPH0769808B2 (en) Data processing device
JPH01214933A (en) Data processor
JPH0769803B2 (en) Data processing device
JPH0573294A (en) Microprocessor
JPH0769807B2 (en) Data processing device
JPH01281534A (en) Data processor