[go: up one dir, main page]

JPH0769802B2 - Data processing device - Google Patents

Data processing device

Info

Publication number
JPH0769802B2
JPH0769802B2 JP63177942A JP17794288A JPH0769802B2 JP H0769802 B2 JPH0769802 B2 JP H0769802B2 JP 63177942 A JP63177942 A JP 63177942A JP 17794288 A JP17794288 A JP 17794288A JP H0769802 B2 JPH0769802 B2 JP H0769802B2
Authority
JP
Japan
Prior art keywords
stage
instruction
operand
stack pointer
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63177942A
Other languages
Japanese (ja)
Other versions
JPH0225934A (en
Inventor
由香里 渡辺
雅仁 松尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP63177942A priority Critical patent/JPH0769802B2/en
Publication of JPH0225934A publication Critical patent/JPH0225934A/en
Publication of JPH0769802B2 publication Critical patent/JPH0769802B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

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

〔従来の技術〕 従来の技術として特願昭62-145852に示すスタックポイ
ンタの回路がある。
[Prior Art] As a prior art, there is a stack pointer circuit shown in Japanese Patent Application No. 62-145852.

第33図は従来のスタックポインタ計算部のブロック図で
ある。従来例に示すデータ処理装置は、パイプライン処
理により命令の実行を行い、命令フェッチステージ(IF
ステージ)、命令デコードステージ(Dステージ)、オ
ペランドアドレス計算ステージ(Aステージ)、オペラ
ンドフェッチステージ(Fステージ)、実行ステージ
(Eステージ)の順に処理される。61はアドレス計算ス
テージで管理されているステージスタックポインタ(AS
P)、62はASP出力ラッチ、63はオペランドフェッチステ
ージで管理されているステージスタックポインタ(FS
P)、64はFSP出力ラッチ、65は実行ステージで管理され
ているステージスタックポインタ(CSP)、66、67、68
はソフトウェアから見たレベルのスタックポインタ(SP
I,SP0,SP1)である。
FIG. 33 is a block diagram of a conventional stack pointer calculator. The data processing device shown in the conventional example executes an instruction by pipeline processing and executes an instruction fetch stage (IF
Stage), instruction decode stage (D stage), operand address calculation stage (A stage), operand fetch stage (F stage), and execution stage (E stage). 61 is a stage stack pointer (AS
P), 62 is an ASP output latch, and 63 is a stage stack pointer (FS) managed by the operand fetch stage.
P), 64 is the FSP output latch, 65 is the stage stack pointer (CSP) managed by the execution stage, 66, 67, 68
Is the stack pointer (SP
I, SP0, SP1).

第34図はスタックプッシュを含む命令、例えばレジスタ
の値をスタックトップ(スタックポインタの値をデクリ
メントした値が指すところ)に書き込むMOV命令(MOV:R
n->@‐SP Rnはn番のレジスタを表し、@‐SPはスタ
ックポインタをデクリメントした値が指すアドレスを示
す)を実行した場合の各ステージのスタックポインタの
動作を示すフローチャートである。命令実行前のASP61
の値をinitSPとし、この命令の直前の命令終了時のスタ
ックポインタ値と整合がとれていることとする。
Figure 34 shows an instruction that includes stack push, for example, the MOV instruction (MOV: R that writes the register value to the stack top (where the value decremented the stack pointer value points).
n-> @-SP Rn represents the nth register, and @ -SP represents the address indicated by the value obtained by decrementing the stack pointer.) is a flowchart showing the operation of the stack pointer in each stage. ASP 61 before command execution
It is assumed that the value of is the initSP and that it is consistent with the stack pointer value at the time of the end of the instruction immediately before this instruction.

まずこの命令はソースがレジスタであるので、Aステー
ジではレジスタ指定信号を次のステージFステージに送
る。ASP61の値はデクリメントし(initSP-4)とし、命
令の流れと同期してデクリメントされたASP61の値(ini
tSP-4)はFSP63へ転送される。
First, since the source of this instruction is a register, the register designation signal is sent to the next stage F stage in the A stage. The value of ASP61 is decremented (initSP-4), and the value of ASP61 decremented in synchronization with the flow of instructions (ini
tSP-4) is transferred to FSP63.

Fステージではレジスタ指定信号を受けてレジスタアク
セス信号を次のEステージに送る。命令がEステージに
達するとき、同時にFSP63の値(initSP-4)もEステー
ジのCSP65に送られる。
The F stage receives the register designation signal and sends a register access signal to the next E stage. When the instruction reaches the E stage, the value of FSP63 (initSP-4) is also sent to the CSP65 of the E stage at the same time.

EステージではCSP65の値(initSP-4)をデスティネー
ションアドレスとして命令を実行する。つまり、指定さ
れたレジスタの値をデータレジスタに書き込み、CSP61
の値をアドレスレジスタに書き込み、アドレスレジスタ
の示すアドレスにデータレジスタの値をストアする。
At the E stage, the instruction is executed using the value of CSP65 (initSP-4) as the destination address. That is, the value of the specified register is written to the data register, and the CSP61
The value of is written to the address register, and the value of the data register is stored at the address indicated by the address register.

また、SPI 66、SP0 67、SP1 68に関して、命令実行中は
これらのスタックポインタには前の値を保っておき、各
命令の処理の最後にCSP65の値をソフトウェアからみた
レベルのスタックポインタ(SPI、SP0、SP1)の1つに
設定する。
Regarding SPI 66, SP0 67, and SP1 68, these stack pointers retain the previous values during instruction execution, and at the end of the processing of each instruction, the CSP65 value is the stack pointer (SPI , SP0, SP1).

第35図はスタックポインタを汎用レジスタと見てデータ
をロードする命令の場合である(MOV:“100"->SP“10
0"は即値、SPはスタックポインタ)。
Figure 35 shows the case of an instruction that loads data by looking at the stack pointer as a general-purpose register (MOV: "100"-> SP "10.
0 "is an immediate value, SP is a stack pointer).

Aステージでは即値“100"が次のFステージへ送られ
る。ASP61は変化しないでFSP63に転送される。
In the A stage, the immediate value "100" is sent to the next F stage. ASP61 is transferred unchanged to FSP63.

この命令ではAステージのスタックポインタ(ASP61)
の値は、命令が終了しスタックポインタに値が書き込ま
れるまでは前の値を保ったままなので、後の命令がスタ
ックポインタを参照する命令の場合(スタックポインタ
に関するコンフリクトを生じている場合)に、ASP61を
参照してアドレス計算を行ってしまうと誤った値が生成
されることになる。そのため、命令が終了してスタック
ポインタの値が書き換わってしまうまではスタックポイ
ンタの書き込み予約を行っておき、後の命令がスタック
ポインタを参照する場合は、この書き込み予約が解除さ
れるまではAステージでアドレス計算を行わずに待って
いる。そして書き込み予約が解除されてからAステージ
でのアドレス計算を始める。
In this instruction, stack pointer of A stage (ASP61)
The value of is kept at the previous value until the instruction ends and the value is written to the stack pointer, so if the later instruction is an instruction that refers to the stack pointer (when a conflict regarding the stack pointer occurs). , If you calculate the address by referring to ASP61, an incorrect value will be generated. Therefore, the stack pointer write reservation is made until the instruction ends and the stack pointer value is rewritten, and when the subsequent instruction refers to the stack pointer, A is written until the write reservation is released. Waiting without performing address calculation on stage. Then, after the write reservation is released, the address calculation in the A stage is started.

Fステージでは即値“100"を受け取ってそのまま“100"
を次のEステージに送る。
In the F stage, the immediate value "100" is received and it is "100" as it is.
To the next E stage.

FSP63はCSP65に転送される。FSP63 is transferred to CSP65.

Eステージでは、データ“100"はDOバス85を通してASP6
1,CSP65に同時に書き込まれる。
At the E stage, the data “100” is ASP6 through the DO bus 85.
It is written to 1, CSP65 at the same time.

この命令の後の命令がスタックポインタを参照する場合
は、Aステージでのリソースであるスタックポインタ
(ASP61)がまだ書き換わっておらず、スタックポイン
タを参照するわけにはいかないので、アドレス計算を行
わずAステージで待っている。そして書き込み予約が解
除になって、アドレス計算を開始した時点で正しい値が
ASP61には入っているため、この命令がEステージに到
達したときは正しいスタックポインタの値を伴ってお
り、その値がSPI 66、SP0 67、SP1 68のいずれかに書き
込まれる。
If the instruction after this instruction references the stack pointer, the stack pointer (ASP61), which is the resource at the A stage, has not been rewritten, and the stack pointer cannot be referenced, so the address is calculated. I'm waiting on the A stage. Then, when the write reservation is released and the address calculation is started, the correct value is
Since it is in ASP61, it has the correct stack pointer value when it reaches the E stage, and that value is written to either SPI 66, SP0 67, or SP1 68.

しかし後の命令がスタックポインタを使用しない場合
は、スタックポインタの書き込み予約が行われていて
も、Aステージでアドレス計算を行わずに待っている必
要はない。そのため先の命令がEステージで処理されAS
P61が書き換わった時点では、すでにアドレス計算ステ
ージまたはオペランドフェッチステージでの処理を終了
している場合がある。そうするとこの命令は正しくない
スタックポインタの値を伴って実行ステージに到達する
ことになり、誤った値がCSP65に転送され、命令終了時
に誤った値がSPI 66、SP0 67、SP1 68のいずれかに書き
込まれてしまう。
However, if the subsequent instruction does not use the stack pointer, it is not necessary to wait without performing address calculation in the A stage even if the stack pointer is reserved for writing. Therefore, the previous instruction is processed in E stage and AS
By the time P61 is rewritten, the processing in the address calculation stage or the operand fetch stage may have already been completed. This would cause the instruction to reach the execute stage with an incorrect stack pointer value, which would transfer the incorrect value to the CSP65, and at the end of the instruction the incorrect value to either SPI 66, SP0 67, or SP1 68. Will be written.

そこでこれを回避するためには、Eステージでスタック
ポインタの値が書き換えられる場合、各命令が処理され
ているステージのステージスタックポインタが必ずその
命令に付随する値を示すように、すべてのステージスタ
ックポインタと各スタックポインタ出力ラッチに同時に
値をいれるか、あるいは、スタックポインタの書き込み
予約が行なわれている場合には次の命令が必ずアドレス
計算ステージで止まるようにしておき、ASP61の値が書
き換わってから次の命令はAステージ33での処理を開始
する必要がある。
Therefore, in order to avoid this, when the value of the stack pointer is rewritten in the E stage, all stage stacks must be set so that the stage stack pointer of the stage in which each instruction is processed always indicates the value associated with that instruction. Either write a value to the pointer and each stack pointer output latch at the same time, or make sure that the next instruction always stops at the address calculation stage when the stack pointer is reserved for writing, and the value of ASP61 is rewritten. Then, the next instruction must start processing in the A stage 33.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

以上のように従来のパイプライン処理中でのスタックポ
インタの処理では、実行ステージにおいてスタックポイ
ンタの値を更新した場合に、その次の命令実行時に実行
ステージのステージスタックポインタの値をその命令に
付随した正しい値とするために、すべてのステージスタ
ックポインタとステージスタックポインタ出力ラッチに
値を書き込むか、次の命令を必ずアドレス計算ステージ
で止めておかなければならないという問題点があった。
As described above, in the conventional stack pointer processing during pipeline processing, when the stack pointer value is updated in the execution stage, the value of the stage stack pointer of the execution stage is attached to the instruction when the next instruction is executed. In order to obtain the correct value, there is a problem that it is necessary to write the values to all the stage stack pointers and the stage stack pointer output latches, or be sure to stop the next instruction at the address calculation stage.

この発明は上記の問題点を解決するためになされたもの
で、少ないハードウェアで、かつ実行ステージでスタッ
クポインタの値を書き換える命令の次の命令が、スタッ
クポインタに関するコンフリクトを起こさないときも、
アドレス計算ステージでその命令を止めることなく正し
くスタックポインタの管理をするデータ処理装置を得る
ことを目的とする。
The present invention has been made to solve the above-mentioned problems. Even when the instruction next to the instruction that rewrites the value of the stack pointer in the execution stage with less hardware does not cause a conflict regarding the stack pointer,
It is an object to obtain a data processing device which manages a stack pointer correctly without stopping the instruction at the address calculation stage.

〔課題を解決するための手段〕[Means for Solving the Problems]

この発明にかかるデータ処理装置は、パイプライン中の
アドレス計算ステージに作業用のステージスタックポイ
ンタを備え、アドレス計算ステージで管理されているス
タックポインタをアドレス計算ステージで更新したとき
のみ更新された値を実行ステージが管理しているスタッ
クポインタに転送するようにした。
The data processing device according to the present invention is provided with a stage stack pointer for work in the address calculation stage in the pipeline, and updates the updated value only when the stack pointer managed in the address calculation stage is updated in the address calculation stage. Transfer to the stack pointer managed by the execution stage.

〔作用〕[Action]

この発明におけるデータ処理装置は、アドレス計算ステ
ージでのアドレス演算時に、このステージのステージス
タックポインタ(ASP)を更新した場合のみ、パイプラ
イン中の命令の流れと同期してスタックポインタの値を
実行ステージが管理しているスタックポインタに転送す
る。
The data processor according to the present invention executes the value of the stack pointer in synchronization with the instruction flow in the pipeline only when the stage stack pointer (ASP) of this stage is updated at the time of address calculation in the address calculation stage. It is transferred to the stack pointer managed by.

〔発明の実施例〕Example of Invention

以下、本発明をその実施例を示す図面に基づいて詳述す
る。
Hereinafter, the present invention will be described in detail with reference to the drawings showing an embodiment thereof.

(1)「本発明のデータ処理装置の命令フォーマット」 本発明のデータ処理装置の命令は16ビット単位で可変長
となっており、奇数バイト長の命令は使用しない。
(1) "Instruction format of data processing device of the present invention" The instruction of the data processing device of the present invention has a variable length in units of 16 bits, and an instruction of odd byte length is not used.

本発明のデータ処理装置では高頻度命令を短いフォーマ
ットとする目的で特に工夫された命令フォーマット体系
を有する。例えば、2オペランド命令に関しては基本的
に“4バイト+拡張部”の構成を有して総てのアドレッ
シングモードが利用可能な一般形フォーマットと、使用
頻度の高い命令及びアドレッシングモードのみが使用可
能な短縮形フォーマットの2つのフォーマットとがあ
る。
The data processing apparatus of the present invention has an instruction format system devised especially for the purpose of making a high-frequency instruction into a short format. For example, with respect to a two-operand instruction, it has a general format of "4 bytes + extended part" and all addressing modes can be used, and only frequently used instructions and addressing modes can be used. There are two formats, a shortened format.

本発明のデータ処理装置の命令フォーマット中に現われ
る記号の意味は次の通りである。
The meanings of the symbols appearing in the instruction format of the data processor of the present invention are as follows.

−:オペレーションコードが入る部分 #:リテラルまたは即値が入る部分 Ea:8ビットの一般形のアドレッシングモードでオペラン
ドを指定する部分 Sh:6ビットの短縮形のアドレッシングモードでオペラン
ドを指定する部分 Rn:レジスタ上のオペランドをレジスタ番号で指定する
部分 フォーマットは、第3図に示す如く右側がLSB側で且つ
高いアドレスになっている。アドレスNとアドレスN+
1の2バイトを見ないと命令フォーマットが判別できな
いようになっているが、これは前述の如く、命令が必ず
16ビット(2バイト=ハーフワード)単位でフェッチ及
びデコードされることを前提としているためである。
-: Operation code entry part #: Literal or immediate value entry part Ea: Part that specifies operand in 8-bit general addressing mode Sh: Part that specifies operand in 6-bit compact addressing mode Rn: Register In the partial format in which the upper operand is designated by the register number, the right side is the LSB side and the high address as shown in FIG. Address N and address N +
The instruction format cannot be identified unless the 2 bytes of 1 are seen.
This is because it is premised on fetching and decoding in units of 16 bits (2 bytes = halfword).

本発明のデータ処理装置では、いずれのフォーマットの
場合も、各オペランドのEaまたはShの拡張部は必ずその
EaまたはShの基本部を含むハーフワードの直後に位置さ
れる。これは、命令により暗黙に指定される即値データ
あるいは命令の拡張部に優先する。従って、4バイト以
上の命令では、Eaの拡張部によって命令のオペレーショ
ンコードが分断される場合がある。
In the data processor of the present invention, the extension of Ea or Sh of each operand is always
It is located immediately after the halfword containing the base of Ea or Sh. This takes precedence over immediate data implied by the instruction or the extension of the instruction. Therefore, for an instruction of 4 bytes or more, the operation code of the instruction may be divided by the extension part of Ea.

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

(1.1)「短縮形2オペランド命令」 第4図から第7図は2オペランド命令の短縮形フォーマ
ットを示す模式図である。
(1.1) "Short form 2-operand instruction" FIGS. 4 to 7 are schematic diagrams showing a short form of a 2-operand instruction.

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

L-formatでは、Shはソースオペランドの指定フィールド
を、Rnはデスティネーションオペランドのレジスタの指
定フィールドを、RRはShのオペランドサイズの指定をそ
れぞれ表す。レジスタ上に位置されたデスティネーショ
ンオペランドのサイズは32ビットに固定されている。レ
ジスタ側とメモリ側とのサイズが異なり、ソース側のサ
イズが小さい場合に符号拡張が行なわれる。
In the L-format, Sh represents the designation field of the source operand, Rn represents the designation field of the register of the destination operand, and RR represents the designation of the operand size of Sh. The size of the destination operand located in the register is fixed at 32 bits. When the size of the register side is different from that of the memory side and the size of the source side is small, sign extension is performed.

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

第5図はレジスタ−レジスタ間演算命令のフォーマット
(R-format)を示す模式図である。Rnはデスティネーシ
ョンレジスタの指定フィールド、Rmはソースレジスタの
指定フィールドである。オペランドサイズは32ビットの
みである。
FIG. 5 is a schematic diagram showing a format (R-format) of a register-register arithmetic instruction. Rn is a designation field of the destination register, and Rm is a designation field of the source register. Operand size is only 32 bits.

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

第7図は即値−メモリ間演算命令のフォーマット(I-fo
rmat)を示す模式図である。MMはオペランドサイズの指
定フィールド(ソース,ディスティネーションで共
通)、Shはデスティネーションオペランドの指定フィー
ルドである。I-formatの即値のサイズはデスティネーシ
ョン側のオペランドのサイズと共通に8,16,32ビットと
なり、ゼロ拡張及び符号拡張は行なわれない。
Figure 7 shows the format of the immediate-memory operation instruction (I-fo
FIG. MM is an operand size specification field (common to the source and destination), and Sh is a destination operand specification field. The size of the immediate value of I-format is 8, 16 or 32 bits in common with the size of the operand on the destination side, and zero extension and sign extension are not performed.

(1.2)「一般形1オペランド命令」 第8図は1オペランド命令の一般形フォーマット(G1-f
ormat)を示す模式図である。MMはオペランドサイズの
指定フィールドである。一部のG1-format命令では、Ea
の拡張部以外にも拡張部がある。また、MMを使用しない
命令もある。
(1.2) "General-type 1-operand instruction" Figure 8 shows the general-format of 1-operand instruction (G1-f
FIG. MM is a field for specifying the operand size. Ea for some G1-format instructions
There is an extension part other than the extension part. Also, some instructions do not use MM.

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

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

第10図は第1オペランドが8ビット即値の命令のフォー
マット(E-format)を示す模式図である。EaMはデステ
ィネーションオペランドの指定フィールド、MMはデステ
ィネーションオペランドサイズの指定フィールド、##
…はソースオペランド値である。
FIG. 10 is a schematic diagram showing the format (E-format) of an instruction whose first operand is an 8-bit immediate value. EaM is the destination operand specification field, MM is the destination operand size specification field, # #
... is the source operand value.

E-formatとI-formatとは機能的には類似しているが、考
え方の点では大きく違っている。具体的には、E-format
はあくまでも2オペランド一般形(G-format)の派生形
であり、ソースオペランドのサイズが8ビット固定、デ
ィスティネーションオペランドのサイズが8/16/32ビッ
トからの選択となっている。つまり、E-formatは異種サ
イズ間の演算を前提とし、デスティネーションオペラン
ドのサイズに合わせて8ビットのソースオペランドがゼ
ロ拡張または符号拡張される。一方、I-formは、特に転
送命令及び比較命令で頻度の多い即値のパターンを短縮
形にしたものであり、ソースオペランドとディスティネ
ーションオペランドのサイズが等しい。
Although E-format and I-format are functionally similar, they differ greatly in terms of thinking. Specifically, E-format
Is a derivative of the 2-operand general type (G-format), and the size of the source operand is fixed at 8 bits and the size of the destination operand is selected from 8/16/32 bits. That is, the E-format is premised on an operation between different sizes, and the 8-bit source operand is zero-extended or sign-extended according to the size of the destination operand. On the other hand, the I-form is a shortened form of an immediate value pattern that is frequently used especially for transfer instructions and comparison instructions, and the source operand and the destination operand have the same size.

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

第12図は、ショートブランチ命令のフォーマットを示す
模式図である。ccccはブランチ条件指定フィールド、di
sp:8はジャンプ先との変位指定フィールドであり、本発
明のデータ処理装置では8ビットで変位を指定する場合
には、ビットパターンでの指定値を2倍して変位値とす
る。
FIG. 12 is a schematic diagram showing the format of a short branch instruction. cccc is the branch condition specification field, di
sp: 8 is a displacement designation field with the jump destination, and when the displacement is designated by 8 bits in the data processing apparatus of the present invention, the designated value in the bit pattern is doubled to obtain the displacement value.

(1.4)「アドレッシングモード」 本発明のデータ処理装置のアドレッシングモード指定方
法には、レジスタを含めて6ビットで指定する短縮形
と、8ビットで指定する一般形とがある。
(1.4) "Addressing Mode" The addressing mode designating method of the data processing device of the present invention includes a short form designating in 6 bits including a register and a general form designating in 8 bits.

未定義のアドレッシングモードが指定された場合、ある
いは意味的に考えて明らかに不適当なアドレッシングモ
ードの組み合わせが指定された場合には、未定義命令が
実行された場合同様に予約命令例外が発生され、例外処
理が起動される。
If an undefined addressing mode is specified, or if a combination of addressing modes that is apparently improper in meaning is specified, a reserved instruction exception is generated as if an undefined instruction was executed. , Exception processing is started.

これに該当するのは、デスティネーションが即値モード
の場合、アドレス計算を伴うべきアドレッシングモード
指定フィールドで即値モードを使用した場合等である。
This corresponds to the case where the destination is the immediate mode, the case where the immediate mode is used in the addressing mode designation field which should accompany the address calculation, and the like.

フォーマットの図中で使われる記号の意味は次の通りで
ある。
The meanings of the symbols used in the format diagrams are as follows.

Rn :レジスタ指定 mem EA:EAで示されるアドレスのメモリ内容 (Sh) :6ビットの短縮形アドレッシングモードでの指
定方法 (Ea) :8ビットの一般形アドレッシングモードでの指
定方法 フォーマットの図において破線にて囲繞された部分は拡
張部を示す。
Rn: Register specification mem EA: Memory content of the address indicated by EA (Sh): Specification method in 6-bit compact addressing mode (Ea): Specification method in 8-bit general type addressing mode Dashed line in format diagram The part surrounded by indicates the expanded part.

(1.4.1)「基本アドレッシングモード」 本発明のデータ処理装置は様々なアドレッシングモード
をサポートする。それらの内、本発明のデータ処理装置
でサポートする基本アドレッシングモードには、レジス
タ直接モード、レジスタ間接モード、レジスタ相対間接
モード、即値モード、絶対モード、PC(プログラムカウ
ンタ)相対間接モード、スタックポップモード及びスタ
ックプッシュモードがある。
(1.4.1) "Basic Addressing Mode" The data processing device of the present invention supports various addressing modes. Among them, 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 value mode, absolute mode, PC (program counter) relative indirect mode, and stack pop mode. And there is a stack push mode.

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

レジスタ間接モードはレジスタの内容をアドレスとする
メモリの内容をオペランドとする。フォーマットの模式
図を第14図に示す。Rnは汎用レジスタの番号を示す。
In the register indirect mode, the contents of the memory whose address is the contents of the register are the operands. A schematic diagram of the format is shown in FIG. Rn indicates the general register number.

レジスタ相対間接モードはディスプレースメント値が16
ビットであるか32ビットであるかにより2種類がある。
それぞれ、レジスタの内容に16ビットまたは32ビットの
ディスプレースメント値を加えた値をアドレスとするメ
モリの内容をオペランドとする。フォーマットの模式図
を第15図に示す。Rnは汎用レジスタの番号を示す。dis
p:16とdisp:32とはそれぞれ各々16ビットのディスプレ
ースメント値または32ビットのディスプレースメント値
を示す。ディスプレースメント値は符号付きとして扱
う。
In the register relative indirect mode, the displacement value is 16
There are two types depending on whether it is bit or 32 bit.
Each of them uses the contents of the memory whose address is a value obtained by adding a displacement value of 16 bits or 32 bits to the contents of the register as an operand. A schematic diagram of the format is shown in FIG. Rn indicates the general register number. dis
p: 16 and disp: 32 respectively indicate a displacement value of 16 bits or a displacement value of 32 bits. The displacement value is treated as signed.

即値モードは命令コード中で指定されるビットパターン
をそのまま2進数と見なしてオペランドとする。フォー
マットの模式図を第16図に示す。imm-dataは即値を示
す。imm-dataのサイズは、オペランドサイズとして命令
中で指定される。
In the immediate mode, the bit pattern specified in the instruction code is regarded as a binary number as it is and used as an operand. A schematic diagram of the format is shown in FIG. 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図に示す。abs:16とab
s:32とはそれぞれ16ビットまたは32ビットのアドレス値
を示す。abs:16でアドレスが示される時は指定されたア
ドレス値を32ビットに符号拡張する。
There are two types of absolute modes depending on whether the address value is indicated by 16 bits or 32 bits. The contents of the memory whose address is the 16-bit or 32-bit bit pattern specified in the instruction code are used as operands. A schematic diagram of the format is shown in FIG. abs: 16 and ab
s: 32 indicates a 16-bit or 32-bit address value, respectively. When the address is indicated by abs: 16, the specified address value is sign-extended to 32 bits.

PC相対間接モードはディスプレースメント値が16ビット
か32ビットかにより2種類ある。それぞれ、プログラム
カウンタの内容に16ビットまたは32ビットのディスプレ
ースメント値を加えた値をアドレスとするメモリの内容
をオペランドとする。フォーマットの模式図を第18図に
示す。disp:16とdisp:32とはそれぞれ16ビットのディス
プレースメント値または32ビットのディスプレースメン
ト値を示す。ディスプレースメント値は符号付きとして
扱う。PC相対間接モードにおいて、参照されるプログラ
ムカウンタの値はそのオペランドを含む命令の先頭アド
レスである。多段間接アドレッシングモードにおいてプ
ログラムカウンタの値が参照される場合にも、同じよう
に命令の先頭のアドレスをPC相対の基準値として使用す
る。
There are two types of PC relative indirect mode depending on whether the displacement value is 16 bits or 32 bits. The contents of the memory whose address is a value obtained by adding a displacement value of 16 bits or 32 bits to the contents of the program counter are used as operands. A schematic diagram of the format is shown in FIG. disp: 16 and disp: 32 represent a displacement value of 16 bits or a displacement value of 32 bits, respectively. The displacement value is treated as signed. In the PC relative indirect mode, the value of the referenced program counter is the start address of the instruction containing the operand. Even when the value of the program counter is referenced in the multi-stage indirect addressing mode, the start address of the instruction is used as the PC relative reference value in the same manner.

スタックポップモードはスタックポインタ(SP)の内容
をアドレスとするメモリの内容をオペランドとする。オ
ペランドアクセス後、スタックポインタをオペランドサ
イズだけインクリメントする。例えば、32ビットデータ
を扱う場合には、オペランドアクセス後にSPが+4だけ
更新(インクリメント)される。B,H(バイト、ハーフ
ワード)のサイズのオペランドに対するスタックポップ
モードの指定も可能であり、それぞれSPが+1,+2だけ
更新(インクリメント)される。フォーマットの模式図
を第19図に示す。オペランドに対しスタックポップモー
ドが意味を持たないものに関しては予約命令例外が発生
される。具体的に予約命令例外となるのは、writeオペ
ランド、read-modify-writeオペランドに対するスタッ
クポップモード指定である。
In the stack pop mode, the content of the memory whose address is the content of the stack pointer (SP) is the operand. After accessing the operand, increment the stack pointer by the operand size. For example, when handling 32-bit data, SP is updated (incremented) by +4 after operand access. It is also possible to specify the stack pop mode for operands of B and H (byte, halfword) size, and SP is updated (incremented) by +1 and +2, respectively. A schematic diagram of the format is shown in FIG. If the stack pop mode has no meaning for the operand, a reserved instruction exception is generated. Specifically, the reserved instruction exception is the stack pop mode specification for the write operand and the read-modify-write operand.

スタックプッシュモードはスタックポインタの内容をオ
ペランドサイズだけデクリメントした内容をアドレスと
するメモリの内容をオペランドとする。スタックプッシ
ュモードでは、オペランドアクセス前にスタックポイン
タがデクリメントされる。例えば、32ビットデータを扱
う場合には、オペランドアクセス前にSPが−4だけ更新
(デクリメント)される。B,Hのサイズのオペランドに
対するスタックプッシュモードの指定も可能であり、そ
れぞれSPが−1,−2だけ更新(デクリメント)される。
フォーマットの模式図を第20図に示す。オペランドに対
してスタックプッシュモードが意味を持たないものに関
しては、予約命令例外が発生される。具体的に予約命令
例外となるのは、readオペランド、read-modify-write
オペランドに対すスタックプッシュモード指定である。
In the stack push mode, the contents of the memory whose address is the contents of the stack pointer decremented by the operand size are the operands. 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 sizes B and H, and SP is updated (decremented) by -1 and -2, respectively.
Figure 20 shows a schematic diagram of the format. If the stack push mode has no meaning for the operand, a reserved instruction exception is generated. Specifically, reserved instruction exceptions are read operands and read-modify-write.
It is a stack push mode specification for the operand.

(1.4.2)「多段間接アドレッシングモード」 如何に複雑なアドレッシングも、基本的には加算と間接
参照の組み合わせに分解される。従って、加算と間接参
照のオペレーションをアドレッシングのプリミティブと
して与えておき、それを任意に組み合わせることができ
れば、如何なる複雑なアドレッシングモードをも実現可
能となる。本発明のデータ処理装置の多段間接アドレッ
シングモードはこの様な考え方に基づいたアドレッシン
グモードである。複雑なアドレッシングモードはモジュ
ール間のデータ参照あるいはAI(人工知能)言語の処理
系に特に有用である。
(1.4.2) “Multistage indirect addressing mode” Basically, even complicated addressing is decomposed into a combination of addition and indirect reference. Therefore, if the operations of addition and indirect reference are given as addressing primitives and they can be arbitrarily combined, any complicated addressing mode can be realized. The multi-stage indirect addressing mode of the data processor of the present invention is an addressing mode based on such a concept. Complex addressing modes are especially useful for data references between modules or AI (artificial intelligence) language processors.

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

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

PCベース多段間接モードはプログラムカウンタの値を拡
張する多段間接アドレッシングのベース値とするアドレ
ッシングモードである。フォーマットの模式図を第22図
に示す。
The PC-based multi-stage indirect mode is an addressing mode that uses the base value of multi-stage indirect addressing that extends the value of the program counter. A schematic diagram of the format is shown in FIG.

絶対ベース多段間接モードはゼロを拡張する多段間接ア
ドレッシングのベース値とするアドレッシングモードで
ある。フォーマットの模式図を第23図に示す。
The absolute base multistage indirect mode is an addressing mode that uses zero as a base value for multistage indirect addressing. A schematic diagram of the format is shown in FIG.

拡張する多段間接モード指定フィールドは16ビットを単
位としており、これを任意回反復する。1段の多段間接
モードにより、ディスプレースメントの加算、インデク
スレジスタのスケーリング(×1,×2,×4,×8)と加
算、メモリの間接参照を行なう。多段間接モードのフォ
ーマットの模式図を第24図に示す。各フィールドは以下
に示す意味を持つ。
The multi-stage indirect mode specification field to be expanded has 16 bits as a unit, and this is repeated any number of times. Addition of displacement, scaling (× 1, × 2, × 4, × 8) and addition of index register, and indirect reference of memory are performed by the one-stage multi-stage indirect mode. A schematic diagram of the format of the multistage indirect mode is shown in FIG. Each field has the following meaning.

E=0:多段間接モード継続 E=1:アドレス計算終了 tmp==> address of operand I=0:メモリ間接参照なし tmp+disp+Rx*Scale==>tmp I=1:メモリ間接参照あり mem tmp+disp+Rx*Scale==>tmp M=0:<Rx>をインデクスとして使用 M=1:特殊なインデックス <Rx>=0 インデクス値を加算しない(Rx=0) <Rx>=1 プログラムカウンタをインデクス値とし
て使用(Rx=PC) <Rx>=2〜 reserved D=0:多段間接モード中の4ビットのフィールドd4の値
を4倍してディスプレースメント値とし、これを加算す
るd4は符号付きとして扱い、オペランドのサイズとは関
係なく必ず4倍して使用する D=1:多段間接モードの拡張部で指定されたdispx(16/
32ビット)をディスプレースメント値とし、これを加算
する拡張部のサイズはd4フィールドで指定する d4=0001 dispxは16ビット d4=0010 dispxは32ビット xx:インデクスのスケール(scale=1/2/4/8) プログラムカウンタに対して×2,×4,×8のスケーリン
グを行なった場合には、その段の処理終了後の中間値
(tmp)として不定値が入る。この多段間接モードによ
って得られる実効アドレスは予測できない値となるが、
例外は発生しない。プログラムカウンタに対するスケー
リングの指定は行なってはいけない。
E = 0: Multi-stage indirect mode continued E = 1: Address calculation end tmp ==> address of operand I = 0: No memory indirect reference tmp + disp + Rx * Scale ==> tmp I = 1: Memory indirect reference mem tmp + disp + Rx * Scale = => Tmp M = 0: Use <Rx> as index M = 1: Special index <Rx> = 0 Do not add index value (Rx = 0) <Rx> = 1 Use program counter as index value (Rx = PC) <Rx> = 2 to reserved D = 0: The value of the 4-bit field d4 in the multi-stage indirect mode is multiplied by 4 to make a displacement value, and this is added. D4 is treated as a signed value, and the operand size Always use 4 times regardless of D = 1: dispx (16 /
(32 bits) is used as the displacement value, and the size of the extension to be added is specified in the d4 field. D4 = 0001 dispx is 16 bits d4 = 0010 dispx is 32 bits xx: Index scale (scale = 1/2/4 / 8) When the program counter is scaled by x2, x4, x8, an indeterminate value is entered as the intermediate value (tmp) after the processing of that stage. Although the effective address obtained by this multistage indirect mode has an unpredictable value,
No exception is raised. Do not specify scaling for the program counter.

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

第25図は、多段間接モードが継続するか終了するかのバ
リエーションを示す。
FIG. 25 shows a variation in which the multistage indirect mode continues or ends.

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

任意段数の多段間接モードが利用できれば、コンパイラ
の中で段数による場合分けが不要になるので、コンパイ
ラの負担が軽減されるというメリットがある。多段の間
接参照の頻度が非常に少ないとしても、コンパイラとし
ては必ず正しいコードを発生できなければならないから
である。このため、フォーマット上では任意の段数が可
能になっている。
If the multi-stage indirect mode with an arbitrary number of stages can be used, it is not necessary to divide the case depending on the number of stages in the compiler, which has the advantage of reducing the load on the compiler. This is because the compiler must be able to generate correct code even if the frequency of multiple indirect references is extremely low. Therefore, an arbitrary number of stages is possible in the format.

(1.5)「例外処理」 本発明のデータ処理装置はソフトウエア負荷の軽減のた
め豊富な例外処理機能を有する。本発明のデータ処理装
置では、例外処理は命令処理を再実行するもの(例
外)、命令処理を完了するもの(トラップ)及び割込の
3種類に分けて名称をつけている。また本発明のデータ
処理装置では、この3種の例外処理とシステム障害とを
総称してEITと称する。
(1.5) "Exception Processing" The data processing device of the present invention has abundant exception processing functions to reduce software load. In the data processing device of the present invention, the exception processing is divided into three types, that is, one that re-executes instruction processing (exception), one that completes instruction processing (trap), and interrupt. Further, in the data processing device of the present invention, these three types of exception processing and system failure are collectively referred to as EIT.

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

本発明のデータ処理装置の内部を機能的に大きく分ける
と、命令フェッチ部101,命令デコード部102,PC計算部10
3,オペランドアドレス計算部104,マイクロROM部105,デ
ータ演算部106,外部バスインターフェイス部107に分か
れる。
Functionally roughly dividing the inside of the data processing device of the present invention, an instruction fetch unit 101, an instruction decoding unit 102, a PC calculation unit 10
3, it is divided into an operand address calculation unit 104, a micro ROM unit 105, a data operation unit 106, and an external bus interface unit 107.

第1図では、その他にCPU外部にアドレスを出力するた
めのアドレス出力回路108と、CPU外部とデータを入出力
するためのデータ入出力回路109とを他の機能ブロック
部と分けて示した。
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 / outputting data to / from the outside of the CPU are shown separately from the other functional block parts.

(2.1)「命令フェッチ部」 命令フェッチ部101にはブランチバッファ、命令キュー
とその制御部等があり、次にフェッチすべき命令のアド
レスを決定してブランチバッファあるいはCPU外部のメ
モリから命令をフェッチする。またブランチバッファへ
の命令登録をも行う。
(2.1) "Instruction Fetch Unit" The instruction fetch unit 101 has a branch buffer, an instruction queue and its control unit, etc., determines the address of the instruction to be fetched next, and fetches the instruction from the branch buffer or a memory outside the CPU. To do. It also registers instructions in the branch buffer.

ブランチバッファは小規模であるためセレクティブキャ
ッシュとして動作する。ブランチバッファの動作の詳細
は特願昭61-202041号で詳しく述べられている。
Since the branch buffer is small, it operates as a selective cache. Details of the operation of the branch buffer are described in detail in Japanese Patent Application No. 61-202041.

次にフェッチすべき命令のアドレスは、命令キューに入
力すべき命令のアドレスとして専用のカウンタにて計算
される。分岐あるいはジャンプが発生した場合には、新
たな命令のアドレスがPC計算部103あるいはデータ演算
部106から転送されてくる。
The address of the instruction to be fetched next is calculated by a dedicated counter as the address of the instruction to be input to the instruction queue. When a branch or jump occurs, the address of the new instruction is transferred from the PC calculation unit 103 or the data calculation unit 106.

CPU外部のメモリから命令をフェッチする場合は、外部
バスインターフェイス部107を通して、フェッチすべき
命令のアドレスをアドレス出力回路108からCPU外部へ出
力し、データ入出力回路109から命令コードをフェッチ
する。そして、バッファリングした命令コードの内、次
にデコードすべき命令コードを命令デコード部102に出
力する。
When fetching an instruction from the memory outside the CPU, the address of the instruction to be fetched is output from the address output circuit 108 to the outside of the CPU through the external bus interface unit 107, and the instruction code is fetched from the data input / output circuit 109. Then, of the buffered instruction codes, the instruction code to be decoded next is output to the instruction decoding unit 102.

(2.2)「命令デコード部」 命令デコード部102では、基本的には16ビット(ハーフ
ワード)単位で命令コードをデコードする。このブロッ
クには第1ハーフワードに含まれるオペレーションコー
ドをデコードするFHWデコーダ、第2,第3ハーフワード
に含まれるオペレーションコードをデコードするNFHWデ
コーダ、アドレッシングモードをデコードするアドレッ
シングモードデコーダが含まれる。これらFHWデコー
ダ、NFHWデコーダ、アドレシッシングモードデコーダを
纏めて第1デコーダという。
(2.2) "Instruction Decoding Unit" The instruction decoding unit 102 basically decodes the instruction code in 16-bit (halfword) units. This block includes an FHW decoder that decodes the operation code included in the first halfword, an NFHW decoder that decodes the operation code included in the second and third halfwords, and an addressing mode decoder that decodes the addressing mode. The FHW decoder, NFHW decoder, and addressing mode decoder are collectively referred to as the first decoder.

FHWデコーダあるいはNFHWデコーダの出力を更にデコー
ドして、マイクロROMのエントリアドレスを計算する第
2デコーダ、条件分岐命令の分岐予測を行う分岐予測機
構、オペランドアドレス計算の際のパイプラインコンフ
リクトをチェックするアドレス計算コンフリクトチェッ
ク機構も含まれる。
A second decoder that further decodes the output of the FHW decoder or the NFHW decoder to calculate the entry address of the micro ROM, a branch prediction mechanism that performs branch prediction of conditional branch instructions, and an address that checks pipeline conflicts when calculating operand addresses. A calculation conflict check mechanism is also included.

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

(2.3)「マイクロROM部」 マイクロROM部105には、主にデータ演算部106を制御す
るマイクロプログラムが格納されているマイクロROM、
マイクロシーケンサ、マイクロ命令デコーダ等が含まれ
る。マイクロ命令はマイクロROMから2クロック(1ス
テップ)に1度読出される。マイクロシースケンサはマ
イクロプログラムで示されるシーケンス処理の他に、例
外、割込及びトラップ(この3つを合わせてEITと称す
る)の処理をハードウエア的に受付ける。またマイクロ
ROM部105はストアバッファの管理も行う。マイクロROM
部105には命令コードに依存しない割込みあるいは演算
実行結果によるフラッグ情報と、第2デコーダの出力等
の命令デコード部の出力が入力される。マイクロデコー
ダの出力は主にデータ演算部106に対して出力される
が、ジャンプ命令の実行による他の先行処理中止情報等
の一部の情報は他のブロックへも出力される。
(2.3) "Micro ROM section" The micro ROM section 105 stores a micro ROM that mainly stores a micro program for controlling the data calculation section 106,
A micro sequencer, a micro instruction decoder, etc. are included. Micro instructions are read from the micro ROM once every two clocks (one step). In addition to the sequence processing indicated by the microprogram, the microsequencer accepts processing of exception, interrupt and trap (these three are collectively called EIT) by hardware. Also micro
The ROM unit 105 also manages the store buffer. Micro ROM
The flag information based on an interrupt or an operation execution result that does not depend on the instruction code and the output of the instruction decoding unit such as the output of the second decoder are input to the unit 105. The output of the microdecoder is mainly output to the data operation unit 106, but some information such as other preceding process stop information due to execution of the jump instruction is also output to other blocks.

(2.4)「オペランドアドレス計算部」 オペランドアドレス計算部104は命令デコード部102のア
ドレスデコーダ等から出力されたオペランドアドレス計
算に関係する情報によりハードワイヤード制御される。
このブロックではオペランドのアドレス計算に関するほ
とんどの処理が行われる。メモリ間接アドレシングのた
めのメモリアクセスのアドレス及びオペランドアドレス
がメモリにマップされたI/O領域に入るか否かのチェッ
クも行われる。
(2.4) "Operand Address Calculation Unit" The operand address calculation unit 104 is hard-wired controlled by the information related to the operand address calculation output from the address decoder of the instruction decoding unit 102.
In this block, most of the processing for calculating the address of the operand is performed. It is also checked whether the memory access address and the operand address for the memory indirect addressing enter the I / O area mapped in the memory.

アドレス計算結果は外部バスインターフェイス部107に
送られる。アドレス計算に必要な汎用レジスタ及びプロ
グラムカウンタの値はデータ演算部より入力される。
The address calculation result is sent to the external bus interface unit 107. The values of the general-purpose register and the program counter required for address calculation are input from the data calculation unit.

メモリ間接アドレッシングを行う際は外部バスインター
フェイス部107を通してアドレス出力回路108からCPU外
部へ参照すべきメモリアドレスを出力し、データ入出力
部109から入力された間接アドレス値を命令デコード部1
02を通してフェッチする。
When performing memory indirect addressing, the memory address to be referred to outside the CPU is output from the address output circuit 108 through the external bus interface unit 107, and the indirect address value input from the data input / output unit 109 is output to the instruction decoding unit 1.
Fetch through 02.

(2.5)「PC計算部」 PC計算部103は命令デコード部102から出力されるPC計算
に関係する情報によりハードワイヤードに制御され、命
令のPC値を計算する。本発明のデータ処理装置は可変長
命令セットを有しており、命令をデコードしなければそ
の命令の長さが判らない。このため、PC計算部103は命
令デコード部102から出力される命令長をデコード中の
命令のPC値に加算することにより次の命令のPC値を作り
出す。また、命令デコード部102が分岐命令をデコード
してデコード段階での分岐を指示した場合は、命令長の
代わりに分岐変位を分岐命令のPC値に加算することによ
り分岐先命令のPC値を計算する。分岐命令に対して命令
デコード段階で分岐を行うことを本発明のデータ処理装
置ではプリブランチと称する。
(2.5) "PC Calculation Unit" The PC calculation unit 103 is hard-wired controlled by the information related to the PC calculation output from the instruction decoding unit 102, and calculates the PC value of the instruction. The data processor of the present invention has a variable length instruction set, and the length of the instruction cannot be known unless the instruction is decoded. Therefore, the PC calculation unit 103 creates the PC value of the next instruction by adding the instruction length output from the instruction decoding unit 102 to the PC value of the instruction being decoded. When the instruction decoding unit 102 decodes a branch instruction and instructs branching 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. To do. In the data processing apparatus of the present invention, branching a branch instruction at the instruction decoding stage is called pre-branch.

このプリブランチの手法については特願昭61-204500号
及び特願昭61-200557号で詳しく述べられている。
This pre-branching method is described in detail in Japanese Patent Application Nos. 61-204500 and 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-branching,
The address of the next instruction to be decoded is output to the instruction fetch unit 101. Further, it is also used as an address for branch prediction of an instruction decoded next by the instruction decoding unit 102.

分岐予測の手法については特願昭62-8394号で詳しく述
べられている。
The branch prediction method is described in detail in Japanese Patent Application No. 62-8394.

(2.6)「データ演算部」 データ演算部106はマイクロプログラムにより制御さ
れ、マイクロROM部105の出力情報に従って各命令の機能
を実現するに必要な演算をレジスタと演算器で実行す
る。演算対象となるオペランドがアドレスあるいは即値
である場合は、オペランドアドレス計算部104で計算さ
れたアドレスあるいは即値を外部バスインタフェイス部
107を通過させて得る。また、演算対象となるオペラン
ドがCPU外部のメモリにある場合は、アドレス計算部104
で計算されたアドレスをバスインタフェイス部がアドレ
ス出力回路108から出力して、CPU外部のメモリからフェ
ッチしたオペランドをデータ入出力回路109から得る。
(2.6) "Data operation unit" The data operation unit 106 is controlled by a micro program, and executes the operations required to realize the functions of the respective instructions by the register and the operation unit according to the output information of the micro ROM unit 105. When the operand to be operated is an address or an immediate value, the address or immediate value calculated by the operand address calculation unit 104 is used as the external bus interface unit.
Get through 107. If the operand to be operated is in the memory outside the CPU, the address calculation unit 104
The bus interface unit outputs the address calculated in step 1 from the address output circuit 108, and the operand fetched from the memory outside the CPU is obtained from the data input / output circuit 109.

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

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

CPU外部のメモリにデータをストアする場合は、外部バ
スインターフェイス部107を通してアドレス出力回路108
よりアドレスを出力すると同時に、データ入出力回路10
9からデータをCPU外部に出力する。オペランドストアを
効率的に行うため、データ演算部106には4バイトのス
トアバッファが備えられている。
When the data is stored in the memory outside the CPU, the address output circuit 108 is passed through the external bus interface unit 107.
Data output circuit 10
Outputs data from 9 to outside the CPU. In order to perform the operand store efficiently, the data operation unit 106 is provided with a 4-byte store buffer.

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

(2.7)「外部バスインターフェイス部」 外部バスインターフェイス部107は本発明のデータ処理
装置の外部バスでの通信を制御する。メモリのアクセス
はすべてクロック同期で行われ、最小2クロックサイク
ル(1ステップ)で行うことができる。
(2.7) “External Bus Interface Unit” The external bus interface unit 107 controls communication on the external bus of the data processing device of the present invention. All memory accesses are performed in clock synchronization, and can be performed in a minimum of 2 clock cycles (1 step).

メモリに対するアクセス要求は命令フェッチ部101、オ
ペランドアドレス計算部104及びデータ演算部106から独
立に生じる。外部バスインターフェイス部107はこれら
のメモリアクセス要求を調停する。更にメモリとCPUと
を結ぶデータバスサイズである32ビット(1ワード)の
整置境界を跨ぐメモリ番地にあるデータのアクセスは、
このブロック内で自動的にワード境界を跨ぐことを検知
して2回のメモリアクセスに分解して行う。
The memory access request is independently generated from the instruction fetch unit 101, the operand address calculation unit 104, and the data calculation unit 106. The external bus interface unit 107 arbitrates these memory access requests. Furthermore, access to data at a memory address that crosses a 32 bit (1 word) alignment boundary, which is the data bus size connecting the memory and the CPU,
In this block, it is automatically detected that a word boundary is crossed, and the memory access is decomposed into two memory accesses.

プリフェッチするオペランドとストアするオペランドと
が重なる場合のコンフリクト防止処理及びストアオペラ
ンドからフェッチオペランドへのバイパス処理も行う。
A conflict prevention process and a bypass process from the store operand to the fetch operand when the prefetch operand and the store operand overlap each other are also performed.

(3)「パイプライン機構」 本発明のデータ処理装置のパイプライン処理機能は第2
図に模式図に示される如くである。
(3) "Pipeline mechanism" The pipeline processing function of the data processing device of the present invention is the second
It is as shown in the figure.

命令のプリフェッチを行う命令フェッチステージ(IFス
テージ)201,命令のデコードを行うデコードステージ
(Dステージ)202,オペランドのアドレス計算を行うオ
ペランドアドレス計算ステージ(Aステージ)203,マイ
クロROMアクセス(特にRステージ206と呼ぶ)を行う部
分とオペランドのプリフェッチ(特にOFステージ207と
称す)を行う部分とからなるオペランドフェッチステー
ジ(Fステージ)204,命令を実行する実行ステージ(E
ステージ)205の5段構成をパイプライン処理の基本と
する。
Instruction fetch stage (IF stage) 201 that prefetches instructions, decode stage (D stage) 202 that decodes instructions, operand address calculation stage (A stage) 203 that performs operand address calculation, micro ROM access (especially R stage) Operand fetch stage (F stage) 204, which is composed of a portion for performing an instruction (206) and a portion for performing an operand prefetch (specifically, OF stage 207), and an execution stage (E) for executing an instruction.
The five stages of stages 205 are the basics of pipeline processing.

Eステージ205では1段のストアバッファがある他、高
機能命令の一部は命令の実行自体をパイプライン化する
ため、実際には5段以上のパイプライン処理効果があ
る。
In the E stage 205, there is a one-stage store buffer, and since some high-performance instructions pipeline the instruction execution itself, there is actually a pipeline processing effect of five or more stages.

各ステージは他のステージとは独立に動作し、理論上は
5つのステージが完全に独立動作する。各ステージは1
回の処理を最小2クロック(1ステップ)で行うことが
できる。従って理想的には2クロック(1ステップ)毎
に次々とパイプライン処理が進行する。
Each stage operates independently of the other stages, and theoretically five stages operate completely independently. Each stage is 1
It is possible to perform the processing twice with a minimum of 2 clocks (1 step). Therefore, ideally, pipeline processing progresses one after another every two clocks (one step).

本発明のデータ処理装置には、メモリ−メモリ間演算あ
るいはメモリ間接アドレッシング等の如く1回の基本パ
イプライン処理のみでは処理し得ない命令もあるが、本
発明のデータ処理装置はこれらの処理に対してもなるべ
く均衡のとれたパイプライン処理が行える様に設計され
ている。複数のメモリオペランドを持つ命令に対しては
メモリオペランドの数に基づいてデコード段階で複数の
パイプライン処理単位(ステップコード)に分解してパ
イプライン処理を行う。
The data processing device of the present invention has some instructions that cannot be processed by only one basic pipeline process such as memory-memory operation or memory indirect addressing. It is also designed so that balanced pipeline processing can be performed as much as possible. An instruction having a plurality of memory operands is decomposed into a plurality of pipeline processing units (step codes) in the decoding stage based on the number of memory operands and pipeline processing is performed.

パイプライン処理単位の分解方法に関しては特願昭61-2
36456号で詳しく述べられている。
Regarding the method of disassembling pipeline processing units, Japanese Patent Application No. 61-2
It is described in detail in No. 36456.

IFステージ201からDステージ202に渡される情報は、命
令コード211そのものである。Dステージ202から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. The information passed from the D stage 202 to the A stage 203 is related to an operation designated by an instruction (called a D code 212) and information related to operand address calculation (called an A code 213).
There is one.

Aステージ203からFステージ204に渡される情報はマイ
クロプログラムのエントリアドレスあるいはマイクロプ
ログラムのパラメータ等を含むRコード214と、オペラ
ンドのアドレスとアクセス方法指示情報等を含むFコー
ド215との2つである。
Information passed from the A stage 203 to the F stage 204 is an R code 214 including an entry address of a microprogram or a parameter of the microprogram, and an F code 215 including an 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 includes an E code 216 including operation control information and a literal and an S code 217 including an operand or an operand address.
And two.

Eステージ205以外のステージで検出されたEITは、その
コードがEステージ205に到達する迄はEIT処理を起動し
ない。Eステージ205で処理されている命令のみが実行
段階の命令であり、IFステージ201からFステージ204ま
での間に処理されている命令はまだ実行段階に至ってい
ないからである。従って、Eステージ205以外で検出さ
れたEITは、それが検出されたことがステップコード中
に記録されて次のステージに伝えられるのみである。
The EIT detected in a stage other than the E stage 205 does not start the EIT processing until the code reaches the E stage 205. This is because only the instruction processed in the E stage 205 is the instruction in the execution stage, and the instruction processed in the IF stage 201 to the F stage 204 has not reached the execution stage yet. Therefore, the EIT detected in other than the E stage 205 is only recorded in the step code and transmitted to the next stage.

(3.1)「パイプライン処理単位」 (3.1.1)「命令コードフィールドの分類」 本発明のデータ処理装置のパイプライン処理単位は命令
セットのフォーマットの特徴を利用して決定されてい
る。
(3.1) "Pipeline processing unit" (3.1.1) "Instruction code field classification" The pipeline processing unit of the data processing device of the present invention is determined by utilizing the characteristics of the format of the instruction set.

(1)節で述べた如く、本発明のデータ処理装置の命令
は2バイト単位の可変長命令であり、基本的には“2バ
イトの命令基本部+0〜4バイトのアドレシング拡張
部”を1〜3回反復することにより命令が構成されてい
る。
As described in section (1), the instruction of the data processing device of the present invention is a variable length instruction in units of 2 bytes, and basically, "2 byte instruction basic part + 0 to 4 byte addressing extension part" is 1 An instruction is constructed by repeating ~ 3 times.

命令基本部には多くの場合、オペレーションコード部と
アドレッシングモード指定部とがあり、インデックスア
ドレシッシングあるいはメモリ間接アドレッシングが必
要な場合にはアドレッシング拡張部の代わりに“2バイ
トの多段間接モード指定部+0〜4バイトのアドレッシ
ング拡張部”が任意個付く。また、命令により2または
4バイトの命令固有の拡張部が最後に付く。
In many cases, the basic instruction section has an operation code section and an addressing mode designating section. When index addressing or memory indirect addressing is required, a “2-byte multi-stage indirect mode designating section is used instead of the addressing extension section. An arbitrary number of +0 to 4 bytes of addressing extension part "is attached. In addition, depending on the instruction, a 2-byte or 4-byte extension section peculiar to the instruction is added at the end.

命令基本部には命令のオペレーションコード、基本アド
レッシングモード、リテラルなどが含まれる。アドレッ
シング拡張部はディスプレースメント、絶対アドレス、
即値、分岐命令の変位のいずれかである。命令固有の拡
張部にはレジスタマップ、I-format命令の即値指定等が
ある。第27図は、本発明のデータ処理装置の基本的命令
フォーマットの特徴を示す模式図である。
The instruction basic part includes an operation code of the instruction, a basic addressing mode, a literal, and the like. Addressing extensions are displacements, absolute addresses,
It is either an immediate value or a displacement of a branch instruction. The instruction-specific extension part includes a register map, immediate value specification of an I-format instruction, and the like. FIG. 27 is a schematic diagram showing characteristics of the basic instruction format of the data processing device of the present invention.

(3.1.2)「ステップコードへの命令の分解」 本発明のデータ処理装置では、上記の命令フォーマット
の特徴を生かしたパイプライン処理を行う。
(3.1.2) “Decomposition of instruction into step code” In the data processing device of the present invention, pipeline processing is performed by making the most of the characteristics of the above instruction format.

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 part", "multistage indirect mode designation +
The addressing extension unit "or the instruction-specific extension unit is processed as one decoding unit. The decoding result of each time is called a step code, and after the A stage 203, this step code is a unit of pipeline processing. Is unique to each instruction, and if the multi-stage indirect mode is not specified, one instruction is at least 1 and maximum is 3
It is divided into individual step codes. If the multi-stage indirect mode is specified, the step code increases accordingly. However, this is only the decoding stage as described later.

(3.1.3)「プログラムカウンタの管理」 本発明のデータ処理装置のパイプライン上に存在するス
テップコードは全て別命令に対するものである可能性が
あり、このためプログラムカウンタの値はステップコー
ド毎に管理される。全てのステップコードは、そのステ
ップコードのもとになった命令のプログラムカウンタ値
を有する。ステップコードに付属してパイプラインの各
ステージを流れるプログラムカウンタ値はステッププロ
グラムカウンタ(SPC)と称する。SPCはパイプラインス
テージ間を次々と受け渡されていく。
(3.1.3) “Management of program counter” All step codes existing on the pipeline of the data processing device of the present invention may be for different instructions, and therefore the value of the program counter is different for each step code. Managed. Every step code has the program counter value of the instruction that caused the step code. The program counter value that is attached to the step code and flows through each stage of the pipeline is called a step program counter (SPC). SPCs are passed between pipeline stages one after another.

(3.2)「各パイプラインステージの処理」 各パイプラインステージの入出力ステップコードには第
2図に示したように便宜上名前が付けられている。ま
た、ステップコードはオペレーションコードに関する処
理を行い、マイクロプログラムのエントリアドレス及び
Eステージ205に対するパラメータなどになる系列とE
ステージ205のマイクロ命令に対するオペランドになる
系列との2系列がある。
(3.2) “Processing of each pipeline stage” The input / output step code of each pipeline stage is named for convenience as shown in FIG. In addition, the step code performs processing related to the operation code, and becomes a sequence such as an entry address of the microprogram and parameters for the E stage 205
There are two series, a series that becomes an operand for the micro instruction of the stage 205.

(3.2.1)「命令フェッチステージ」 命令フェッチステージ(IFステージ)201は命令をメモ
リあるいはブランチバッファからフェッチして命令キュ
ーに入力し、Dステージ202に対して命令コードを出力
する。命令キューの入力は整置された4バイト単位で行
う。メモリから命令をフェッチする場合は、整置された
4バイトにつき最小2クロック(1ステップ)を要す
る。ブランチバッファがヒットした場合は、整置された
4バイトにつき1クロックでフェッチ可能である。命令
キューの出力単位は2バイト毎に可変であり、2クロッ
クの間に最大6バイトまで出力できる。また、分岐の直
後には命令キューをバイパスして命令基本部2バイトを
直接命令デコーダに転送することも可能である。
(3.2.1) “Instruction Fetch Stage” The instruction fetch stage (IF stage) 201 fetches an instruction from the memory or branch buffer, inputs it to the instruction queue, and outputs an instruction code to the D stage 202. Input to the instruction queue is performed in aligned 4-byte units. When fetching an instruction from memory, a minimum of 2 clocks (1 step) is required for each aligned 4 bytes. When the branch buffer is hit, it is possible to fetch in 1 clock for each aligned 4 bytes. The output unit of the instruction queue is variable every 2 bytes, and up to 6 bytes can be output during 2 clocks. Immediately after branching, it is possible to bypass the instruction queue and directly transfer the 2 bytes of the basic instruction portion to the instruction decoder.

ブランチバッファへの命令の登録及びクリア等の制御、
プリフェッチ先の命令のアドレスの管理や命令キューの
制御もIFステージ201で行う。
Control such as registering and clearing instructions in the branch buffer,
The IF stage 201 also manages the addresses of prefetch destination instructions and controls the instruction queue.

IFステージ201で検出するEITには、命令をメモリからフ
ェッチする際のバスアクセス例外あるいはメモリ保護違
反などによるアドレス変換例外がある。
The EIT detected in the IF stage 201 includes a bus access exception when fetching an instruction from memory or an address translation exception due to a memory protection violation.

(3.2.2)「命令デコードステージ」 命令デコードステージ(Dステージ)202はIFステージ2
01から入力された命令コードをデコードする。デコード
は命令デコード部102のFHWデコーダ、NFHWデコーダ及び
アドレッシングモードデコーダを合わせた第1デコーダ
を使用して、2クロック(1ステップ)単位に1度行な
い、1回のデコード処理で、0〜6バイトの命令コード
を消費する(RET命令の復帰先アドレスを含むステップ
コードの出力処理などでは命令コードを消費しない)。
1回のデコードでAステージ203に対してアドレス計算
情報としてのAコード213である制御コードとアドレス
修飾情報と、オペレーションコードの中間デコード結果
としてのDコード212である制御コードと8ビットのリ
テラル情報とを出力する。
(3.2.2) "Instruction decode stage" The instruction decode stage (D stage) 202 is the IF stage 2
Decode the instruction code input from 01. Decoding is performed once every 2 clocks (1 step) using the first decoder that combines the FHW decoder, NFHW decoder and addressing mode decoder of the instruction decoding unit 102, and 0 to 6 bytes in one decoding process. Consume the instruction code (does not consume the instruction code in the output processing of the step code including the return address of the RET instruction).
Control code and address modification information which are A code 213 as address calculation information for A stage 203 in one decoding, control code which is D code 212 as an intermediate decoding result of operation code, and 8-bit literal information. And output.

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

Dステージ202で検出するEITには、予約命令例外及びプ
リブランチ時の奇数アドレスジャンプトラップがある。
また、IFステージ201より転送されてきた各種EITはステ
ップコード内にエンコードする処理をしてAステージ20
3に転送する。
The EIT detected by the D stage 202 includes a reserved instruction exception and an odd address jump trap at the time of pre-branch.
In addition, various EITs transferred from the IF stage 201 are processed to be encoded in the step code and the A stage 20
Transfer to 3.

(3.2.3)「オペランドアドレス計算ステージ」 オペランドアドレス計算ステージ(Aステージ)203は
処理機能が大きく2つに分かれる。1つは命令デコード
部102の第2デコーダを使用してオペレーションコード
の後段デコードを行う処理で、他方はオペランドアドレ
ス計算部104でオペランドアドレスの計算を行う処理で
ある。
(3.2.3) “Operand address calculation stage” The operand address calculation stage (A stage) 203 is roughly divided into two processing functions. One is a process of performing the subsequent decoding of the operation code using the second decoder of the instruction decoding unit 102, and the other is a process of calculating the operand address in the operand address calculation unit 104.

オペレーションコードの後段デコード処理はDコード21
2を入力とし、レジスタ,メモリの書込み予約及びマイ
クロプログラムのエントリアドレスとマイクロプログラ
ムに対するパラメータなどを含むRコード214の出力を
行う。なお、レジスタあるいはメモリの書込み予約は、
アドレス計算で参照したレジスタやメモリの内容がパイ
プライン上を先行する命令で書換えられることにより誤
ったアドレス計算が行われるのを防ぐためのものであ
る。レジスタあるいはメモリの書込み予約はデッドロッ
クを避けるため、ステップコード毎ではなく命令毎に行
う。レジスタ及びメモリへの書込み予約については特願
昭62-144394号で詳しく述べられている。
D-code 21 for the subsequent decoding of the operation code
2 is input, and the R code 214 including the register reservation of the memory and the memory, the entry address of the microprogram and the parameters for the microprogram is output. In addition, write reservation of register or memory is
This is to prevent erroneous address calculation by rewriting the contents of the register or memory referred to in the address calculation by a preceding instruction on the pipeline. In order to avoid deadlock, write reservation of the register or memory is performed not for each step code but for each instruction. The reservation of writing to the register and the memory is described in detail in Japanese Patent Application No. 62-144394.

オペランドアドレス計算処理はAコード213を入力と
し、Aコード213に従いオペランドアドレス計算部104で
加算あるいはメモリ間接参照を組合わせてアドレス計算
を行い、その計算結果をFコード215として出力する。
この際、アドレス計算に伴うレジスタ及びメモリの読出
し時にコンフリクトチェックを行い、先行命令がレジス
タあるいはメモリに書込み処理を終了していないためコ
ンフリクトが指示されれば、先行命令がEステージ205
で書込み処理を終了するまで待つ。また、オペランドア
ドレス及びメモリ間接参照のアドレスがメモリにマップ
されたI/O領域に入るか否かのチェックも行う。
In the operand address calculation process, the A code 213 is input, the address calculation is performed by the operand address calculation unit 104 according to the A code 213 in combination with the memory indirect reference, and the calculation result is output as the F code 215.
At this time, a conflict check is performed at the time of reading the register and the memory associated with the address calculation, and if the conflict is instructed because the preceding instruction has not finished the writing process to the register or the memory, the preceding instruction causes the E stage 205.
Wait until the writing process is completed with. Further, it is also checked whether the operand address and the memory indirect reference address enter the I / O area mapped in the memory.

Aステージ203で検出するEITには予約命令例外、特権命
令例外、バスアクセス例外、アドレス変換例外、メモリ
間接アドレッシングの時のオペランドブレイクポイント
ヒットによるデバッグトラップがある。Dコード212又
はAコード213自体がEITを起こしたことを示していれ
ば、Aステージ203はそのコードに対してアドレス計算
処理をせず、そのEITをRコード214及びFコード215に
伝える。
The EIT detected by the A stage 203 includes a reserved instruction exception, a privileged instruction exception, a bus access exception, an address translation exception, and a debug trap due to an operand breakpoint hit during indirect memory addressing. If the D code 212 or the A code 213 itself indicates that the EIT has occurred, the A stage 203 does not perform the address calculation process on the code, and transmits the EIT to the R code 214 and the F code 215.

(3.2.4)「マイクロROMアクセスステージ」 オペランドフェッチステージ(Fステージ)204も処理
が大きく2つに分かれる。一方はマイクロROMのアクセ
ス処理であり、特にRステージ206と称する。他方はオ
ペランドプリフェッチ処理であり、特にOFステージ207
と称する。Rステージ206とOFステージ207とは必ずしも
同時に動作するわけではなく、メモリアクセス権が獲得
できるか否か等に依存して独立に動作する。
(3.2.4) “Micro ROM access stage” The operand fetch stage (F stage) 204 is also roughly divided into two processes. One of them is a micro ROM access process, which is particularly called an R stage 206. The other is the operand prefetch process, especially the OF stage 207.
Called. The R stage 206 and the OF stage 207 do not always operate simultaneously, but operate independently depending on whether or not a memory access right can be acquired.

Rステージ206の処理であるマイクロROMアクセス処理
は、Rコード214に対して次のEステージ205での実行に
使用する実行制御コードであるEコード216を生成する
ためのマイクロROMアクセスとマイクロ命令デコード処
理である。1つのRコード214に対する処理が2つ以上
のマイクロプログラムステップに分解される場合、マイ
クロROMはEステージ205で使用され、次のRコード214
はマイクロROMアクセス待ちになる。Rコード214に対す
るマイクロROMアクセスが行われるのは、その前のEス
テージ205での最後のマイクロ命令実行の時である。本
発明のデータ処理装置では、ほとんどの基本命令は1マ
イクロプログラムステップで行われるため、実際にはR
コード214に対するマイクロROMアクセスが次々と行われ
ることが多い。
The micro ROM access process, which is the process of the R stage 206, is the micro ROM access and the micro instruction decoding for generating the E code 216 which is the execution control code used for the execution of the next E stage 205 for the R code 214. Processing. When the processing for one R code 214 is decomposed into two or more microprogram steps, the micro ROM is used in the E stage 205 and the next R code 214 is used.
Waits for micro ROM access. The micro ROM access to the R code 214 is performed at the last micro instruction execution in the E stage 205 before that. In the data processor of the present invention, most of the basic instructions are executed in one microprogram step, so in practice R
Micro ROM access to code 214 is often made one after another.

Rステージ206で新たに検出するEITはない。Rコード21
4が命令処理再実行型のEITを示している時は、そのEIT
処理に対するマイクロプログラムが実行されるので、R
ステージ206はそのRコード214に従ったマイクロ命令を
フェッチする。Rコード214が奇数アドレスジャンプト
ラップを示している場合、Rステージ206はそれをEコ
ード216によって伝える。これはプリブランチに対する
もので、Eステージ205ではそのEコード216で分岐が生
じなければそのプリブランチを有効として奇数アドレス
ジャンプトラップを発生する。
There is no EIT newly detected in the R stage 206. R code 21
When 4 indicates an EIT of instruction processing re-execution type, that EIT
Since the microprogram for processing is executed, R
The stage 206 fetches the micro instruction according to the R code 214. If R-code 214 indicates an odd address jump trap, R-stage 206 signals it by E-code 216. This is for a pre-branch, and in the E stage 205, if no branch occurs in the E code 216, the pre-branch is validated and an odd address jump trap is generated.

(3.2.5)「オペランドフェッチステージ」 オペランドフェッチステージ(OFステージ)207はFス
テージ204で行う上記の2つの処理の内のオペランドプ
リフェッチ処理を行う。
(3.2.5) "Operand fetch stage" The operand fetch stage (OF stage) 207 performs the operand prefetch process of the above two processes performed in the F stage 204.

オペランドプリフェッチはFコード215を入力とし、フ
ェッチしたオペランドとそのアドレスをSコード217と
して出力する。1つのFコード215ではワード境界を跨
いでも良いが4バイト以下のオペランドフェッチを指定
する。Fコード215にはオペランドのアクセスを行うか
否かの指定も含まれており、Aステージ203で計算した
オペランドアドレス自体あるいは即値をEステージ205
に転送する場合にはオペランドプリフェッチは行わず、
Fコード215の内容をSコード217として転送する。プリ
フェッチしようとするオペランドと、Eステージ205が
書き込み処理を行おうとするオペランドとが一致する場
合は、オペランドプリフェッチはメモリから行わずバイ
パスして行う。また、I/O領域に対してはオペランドプ
リフェッチを遅延させ、先行命令がすべて完了するまで
待ってオペランドフェッチを行う。
In the operand prefetch, the F code 215 is input, and the fetched operand and its address are output as the S code 217. One F code 215 may cross word boundaries, but an operand fetch of 4 bytes or less is designated. The F code 215 also includes designation of whether or not to access the operand. The operand address itself or the immediate value calculated in the A stage 203 is used in the E stage 205.
When transferring to, do not perform operand prefetch
The contents of the F code 215 are transferred as the S code 217. When the operand to be prefetched matches the operand to be written by the E stage 205, the operand prefetch is bypassed from the memory. Also, the operand prefetch is delayed for the I / O area, and the operand fetch is performed after waiting for the completion of all the preceding instructions.

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

(3.2.6)「実行ステージ」 実行ステージ(Eステージ)205はEコード216及びSコ
ード217を入力として動作する。このEステージ205が命
令を実行するステージであり、Fステージ204以前のス
テージで行われた処理は全てEステージ205のための前
処理である。Eステージ205でジャンプ命令が実行され
たり、あるいはEIT処理が起動されたりした場合は、IF
ステージ201からFステージ204までの処理は全て無効化
される。Eステージ205はマイクロプログラムにより制
御され、Rコード214に示されたマイクロプログラムの
エントリアドレスからの一連のマイクロプログラムを実
行することにより命令を実行する。
(3.2.6) "Execution Stage" The execution stage (E stage) 205 operates by inputting the E code 216 and the S code 217. The E stage 205 is a stage for executing instructions, and all the processes performed in the stages before the F stage 204 are pre-processes for the E stage 205. If a jump instruction is executed in the E stage 205 or EIT processing is activated, the IF
All the processes from stage 201 to F stage 204 are invalidated. The E stage 205 is controlled by the microprogram and executes instructions by executing a series of microprograms from the microprogram entry address indicated by the R code 214.

マイクロROMの読み出しとマイクロ命令の実行とはパイ
プライン化されて行われる。従ってマイクロプログラム
で分岐が起きた場合は、1マイクロステップの空きがで
きる。また、Eステージ205はデータ演算部106にあるス
トアバッファを利用して、4バイト以内のオペランドス
トアと次のマイクロ命令実行をパイプライン処理するこ
ともできる。
The reading of the micro ROM and the execution of the micro instructions are pipelined. Therefore, when a branch occurs in the microprogram, there is a space of 1 microstep. Further, the E stage 205 can use the store buffer in the data operation unit 106 to pipeline the operand store within 4 bytes and the next microinstruction execution.

Eステージ205では、Aステージ203で行ったレジスタ及
びメモリに対する書込み予約をオペランドの書き込み後
に解除する。
In the E stage 205, the write reservation for the register and the memory made in the A stage 203 is canceled after writing the operand.

また、条件分岐命令がEステージ205で分岐を発した場
合は、その条件分岐命令に対する分岐予測が誤っていた
のであるから、分岐履歴の書換えを行う。
When the conditional branch instruction causes a branch at the E stage 205, the branch prediction for the conditional branch instruction was incorrect, and the branch history is rewritten.

Eステージ205で検出されるEITには、バスアクセス例
外、アドレス変換例外、デバッグトラップ、奇数アドレ
スジャンプトラップ、予約機能例外、不正オペランド例
外、予約スタックフォーマット例外、ゼロ除算トラッ
プ、無条件トラップ、条件トラップ、遅延コンテキスト
トラップ、外部割込、遅延割込、リセット割込、システ
ム障害がある。
The EIT detected by the E stage 205 includes bus access exception, address translation exception, debug trap, odd address jump trap, reserved function exception, illegal operand exception, reserved stack format exception, divide by zero trap, unconditional trap, and condition trap. , Delayed context trap, external interrupt, delayed interrupt, reset interrupt, system failure.

Eステージ205で検出されたEITは全てEIT処理される
が、Eステージ以前のIFステージ201からFステージ204
の間で検出され、Rコード214あるいはSコード217に反
映されているEITは必ずしもEIT処理されるとは限らな
い。IFステージ201からFステージ204の間で検出された
が、先行の命令がEステージ205でジャンプ命令が実行
されたなどの原因でEステージ205まで到達しなかったE
ITは全てキャンセルされる。そのEITを起こした命令は
そもそも実行されなかったことになる。
All EITs detected by E stage 205 are processed by EIT, but IF stages 201 to 204 before E stage are processed.
The EIT detected between the R code 214 and the S code 217 is not always subjected to the EIT process. Detected between IF stage 201 and F stage 204, but the preceding instruction did not reach E stage 205 due to a jump instruction being executed at E stage 205.
All IT will be canceled. The instruction that caused the EIT was not executed in the first place.

外部割込及び遅延割込は命令の切れ目でEステージ205
に直接受け付けられ、マイクロプログラムにより必要な
処理が実行される。その他の各種EITの処理はマイクロ
プログラムにより行われる。
External interrupts and delayed interrupts are E-stage 205 at instruction breaks.
Is directly received by the microprogram and the required processing is executed by the microprogram. The processing of other various EITs is performed by the microprogram.

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

つまり各ステージは、1つ前段のステージから出力され
てくる次の処理に対する入力信号が全て有効となり、今
の処理結果を後段のステージの入力ラッチに転送して出
力ラッチが空になると次の処理を開始する。
In other words, in each stage, all the input signals for the next processing output from the previous stage become valid, the current processing result is transferred to the input latch of the subsequent stage, and the next processing is performed when the output latch becomes empty. To start.

各ステージが動作を開始する1つ前のクロックタイミン
グで入力信号が全て揃っている必要がある。入力信号が
揃っていない場合、そのステージは待ち状態(入力待
ち)になる。出力ラッチから次のステージの入力ラッチ
への転送を行う場合には次のステージの入力ラッチが空
き状態になっている必要があり、次のステージの入力ラ
ッチが空きでない場合もパイプラインステージは待ち状
態(出力待ち)になる。必要なメモリアクセス権が獲得
できなかったり、処理しているメモリアクセスにウエイ
トが挿入されたり、その他のパイプラインコンフリクト
が生じると各ステージの処理自体が遅延する。
It is necessary that all input signals be completed at the clock timing immediately before the start of operation of each stage. If the input signals are not complete, the stage enters the waiting state (waiting for input). When transferring from the output latch to the input latch of the next stage, the input latch of the next stage must be empty.The pipeline stage waits even if the input latch of the next stage is not empty. The status (waiting for output) is entered. If the necessary memory access right cannot be acquired, a wait is inserted in the memory access being processed, or another pipeline conflict occurs, the processing itself of each stage is delayed.

(3.4)スタックポインタの動作 第28図は、本発明の一実施例を示すブロック図である。
61はオペランドアドレス計算ステージ(Aステージ20
3)の作業用ステージスタックポインタASPであり、Aス
テージ203で実行中の命令に付随するスタックポインタ
の値を示す。63はオペランドフェッチステージ(Fステ
ージ204)の作業用ステージスタックポインタ(FSP)、
65は実行ステージ(Eステージ205)の作業用ステージ
スタックポインタCSPである。66はソフトウェアからみ
たレベルのスタックポインタ群(リング、割込み等によ
り複数個のスタックポインタが存在する)、62はASP出
力ラッチ、64はFSP出力ラッチでありそれぞれASP61,FSP
63の出力データを保持するラッチである。
(3.4) Operation of Stack Pointer FIG. 28 is a block diagram showing an embodiment of the present invention.
61 is an operand address calculation stage (A stage 20
It is the work stage stack pointer ASP of 3) and indicates the value of the stack pointer associated with the instruction being executed in the A stage 203. 63 is a work stage stack pointer (FSP) of the operand fetch stage (F stage 204),
Reference numeral 65 is a work stage stack pointer CSP for the execution stage (E stage 205). 66 is a stack pointer group of the level seen from software (a plurality of stack pointers exist due to rings, interrupts, etc.), 62 is an ASP output latch, 64 is an FSP output latch, and ASP61 and FSP respectively.
This is a latch that holds the output data of 63.

72はEステージ205のアドレスレジスタ(AAレジス
タ)、73は外部とやり取りされるデータのためのEステ
ージ205のデータレジスタ(DDレジスタ)、75はAステ
ージ203のアドレス加算部、80〜87は内部データバスで
ある。106はEステージ205のデータ演算部、90a〜90eは
Aステージ203でASP61が更新されたことを示すASP更新
信号である。91はAコード213中のASPインクリメント信
号、92はAコード213中のASPデクリメント信号である。
611,621,631,641は夫々ASP61、ASP出力ラッチ62、FSP6
3、FSP出力ラッチ64の一部としてASP更新信号90aを転送
するラッチである。
72 is the address register (AA register) of the E stage 205, 73 is the data register (DD register) of the E stage 205 for data exchanged with the outside, 75 is the address adder of the A stage 203, and 80 to 87 are internal It is a data bus. 106 is a data operation unit of the E stage 205, and 90a to 90e are ASP update signals indicating that the ASP 61 has been updated in the A stage 203. Reference numeral 91 is an ASP increment signal in the A code 213, and 92 is an ASP decrement signal in the A code 213.
611,621,631,641 are ASP61, ASP output latch 62, FSP6 respectively
3. A latch that transfers the ASP update signal 90a as part of the FSP output latch 64.

第29図、第30図は、本発明のデータ処理装置において実
施されるいくつかの命令の、各ステージにおけるスタッ
クポインタに関する処理を示す図である。(a)はAス
テージ203、(f)はFステージ204、(e)はEステー
ジ205の処理を示す。
FIG. 29 and FIG. 30 are diagrams showing processing relating to the stack pointer in each stage of some instructions executed in the data processing device of the present invention. (A) shows the processing of the A stage 203, (f) shows the processing of the F stage 204, and (e) shows the processing of the E stage 205.

第31図、第32図は第30図の命令の次のステップコードが
スタックポインタを参照する場合と、しない場合とのパ
イプラインの処理の様子を示した図である。は“100"
をスタックポインタに転送する命令に対するステップコ
ード、はの次に処理されるステップコード、は
の次に処理されるステップコード、(a)はAステージ
203、(f)はFステージ204、(e)はEステージ205
におけるスタックポインタの処理を示し、また横軸は時
間の経過を示す。
FIGS. 31 and 32 are diagrams showing the states of pipeline processing when the step code next to the instruction of FIG. 30 refers to the stack pointer and when it does not. Is "100"
To the stack pointer, a step code to be processed next to, a step code to be processed next to, a step code to be processed next to,
203, (f) is F stage 204, (e) is E stage 205
Shows the processing of the stack pointer, and the horizontal axis shows the passage of time.

次に第28図を用いて、スタックポインタに関する処理に
ついて説明する。Aコード213中にはASP61のインクリメ
ント信号91、デクリメント信号92が含まれており、この
信号91,92はASP61の制御を行う。またインクリメント信
号91、デクリメント信号92のORをとることによりASP更
新信号90aを生成する。
Next, the processing relating to the stack pointer will be described with reference to FIG. The A code 213 includes an ASP61 increment signal 91 and a decrement signal 92, and these signals 91 and 92 control the ASP61. Also, an ASP update signal 90a is generated by ORing the increment signal 91 and the decrement signal 92.

インクリメント信号91又はデクリメント信号92が“1"の
とき、つまりAステージ203でASP61を更新したときにAS
P更新信号90aは“1"となる。そしてASP更新信号90aはス
タックポインタの値と共にパイプライン中のステップコ
ードの流れに同期して転送される。Eステージ205にお
いては転送されてきたASP更新信号90eが“1"のときのみ
CSP65にFSP63の値を転送する。
When the increment signal 91 or the decrement signal 92 is "1", that is, when the ASP61 is updated in the A stage 203, the AS
The P update signal 90a becomes "1". Then, the ASP update signal 90a is transferred together with the value of the stack pointer in synchronization with the flow of step code in the pipeline. In the E stage 205, only when the transferred ASP update signal 90e is "1"
Transfer the value of FSP63 to CSP65.

スタックプッシュ・アドレシッシングモードのオペラン
ド指定を含む命令、例えばレジスタの値をスタックトッ
プ(スタックポインタの値をデクリメント値が指すとこ
ろ)に書き込むMOV命令(MOV:Rn->@‐SP Rnはn番の
レジスタを表し、@‐SPはスタックポインタをデクリメ
ントした値が指すアドレスを示す)を実行した場合の各
ステージのスタックポインタに関する処理を第29図に示
す。まずDステージ202はASP61の更新制御等を含むAコ
ード213を生成する。
An instruction that includes the operand specification of the stack push / addressing mode, for example, the MOV instruction that writes the register value to the stack top (where the decrement value points to the stack pointer value) (MOV: Rn-> @-SP Rn is the nth 29, and @ -SP indicates the address indicated by the decremented value of the stack pointer). FIG. 29 shows the processing relating to the stack pointer of each stage. First, the D stage 202 generates an A code 213 including update control of the ASP 61 and the like.

Aステージ203では、レジスタ指定を含むRコード214を
出力する。またAコード213に基づいて、ASP61はオペラ
ンドのサイズ分デクリメントされ、更新後の値がFSP63
に転送される。この時Aステージ203でASP61が更新され
たことを示すASP更新信号90aは“1"となり、この信号は
ASP61の値と共に転送される。ここでFステージ204が前
のステップコードを処理中などですぐにASP61の値を転
送できない場合は、ASP出力ラッチ62で転送可能になる
まで待つ。本発明のデータ処理装置においては、スタッ
クプッシュアドレシッシングモードと他のアドレシッシ
ングモードの処理の共通化のため、ASP61のデクリメン
トと共にアドレス加算部75においても(ASPの値−オペ
ランドサイズ)を実行し、その結果をオペランドアドレ
スとしてFステージ204へ転送する。
The A stage 203 outputs an R code 214 including register designation. Also, based on the A code 213, ASP61 is decremented by the size of the operand, and the updated value is FSP63.
Transferred to. At this time, the ASP update signal 90a indicating that the ASP 61 has been updated at the A stage 203 becomes "1", and this signal is
Transferred with the value of ASP61. If the F stage 204 is not processing the previous step code and cannot immediately transfer the value of ASP61, the ASP output latch 62 waits until transfer becomes possible. In the data processing device of the present invention, in order to make the processes of the stack push addressing mode and other addressing modes common, the address addition unit 75 also executes (ASP value-operand size) together with the decrement of ASP61. Then, the result is transferred to the F stage 204 as an operand address.

Fステージ204では、Rコード214よりレジスタアクセス
信号を含むEコード216を生成し、このEコード216とオ
ペランドアドレスの値を含むSコード217をEステージ2
05に転送する。またASP更新信号90eが“1"であることを
検知して、 FSP63の値をCSP65に転送する。先ほどと同様CSP65にす
ぐ転送できない場合は、FSP出力ラッチ64にて転送可能
になるまで待つ。
In the F stage 204, the E code 216 including the register access signal is generated from the R code 214, and the E code 216 including the E address 216 and the operand address value is added to the E stage 2
Transfer to 05. It also detects that the ASP update signal 90e is "1" and transfers the value of FSP63 to CSP65. If it cannot transfer to CSP65 immediately as before, wait until transfer is possible with FSP output latch 64.

Eステージ205では、指定されたレジスタの値を読み出
しデータ演算部106からDOバス85を介してDDレジスタ73
に書き込む。AAレジスタ72にはFステージ204から転送
されたオペランドアドレスを書き込む。そしてこの命令
の終了時、CSP65の値はソフトウェアからみたスタック
ポインタ群66の1つに転送され、外部からみて命令実行
後のスタックポインタの値が正しく設定される。AAレジ
スタ72の示すアドレスにDDレジスタ73の値をストアす
る。
In the E stage 205, the value of the specified register is read from the data calculation unit 106 via the DO bus 85 and the DD register 73
Write in. The operand address transferred from the F stage 204 is written in the AA register 72. At the end of this instruction, the value of the CSP 65 is transferred to one of the stack pointer group 66 viewed from the software, and the value of the stack pointer after the execution of the instruction is set correctly from the outside. The value of the DD register 73 is stored in the address indicated by the AA register 72.

この命令がAステージ203での処理を終了した時点でこ
の命令の終了時のスタックポインタの値がASP61に格納
されているため、後の命令がスタックポインタを参照す
るアドレシッシングモードを含んでいても、ASP61の値
を参照することにより、正しいアドレスを得ることがで
きる。
Since the stack pointer value at the end of this instruction is stored in ASP61 when this instruction finishes processing at the A stage 203, a later instruction includes an addressing mode in which the stack pointer is referenced. Also, the correct address can be obtained by referring to the value of ASP61.

次に例えば“100"をスタックポインタに書き込む命令
(MOV:“100"->SP“100"は即値、SPはスタックポイン
タ)のスタックポインタに関する処理を第30図に示す。
Next, FIG. 30 shows a process relating to the stack pointer of an instruction (MOV: "100"-> SP "100" is an immediate value, SP is a stack pointer) for writing "100" to the stack pointer.

この命令ではAステージ203での処理の際はASP61の値は
変化しない。FSP63にこのASP61の値が転送される。また
後の命令がスタックポインタを参照する場合に間違った
値を参照しないように、スタックポインタの値をEステ
ージ205で書き換えることを示すためにスタックポイン
タ書き込み予約を行う。このときはASP更新信号90aは
“0"である。
With this instruction, the value of ASP61 does not change during the processing in the A stage 203. The value of this ASP61 is transferred to FSP63. In addition, a stack pointer write reservation is made to indicate that the value of the stack pointer is rewritten in the E stage 205 so that the subsequent instruction does not reference the wrong value when the stack pointer is referenced. At this time, the ASP update signal 90a is "0".

Fステージ204では、スタックポインタ書き込み制御等
を含むEコード216と、即値データ“100"を含むSコー
ド217を出力する。この時はASP更新信号90eが“0"なの
でFSP63の値はCSP65へは書き込まれない。
The F stage 204 outputs an E code 216 including stack pointer write control and the like, and an S code 217 including immediate data “100”. At this time, since the ASP update signal 90e is "0", the value of FSP63 is not written to CSP65.

Eステージ205ではEコード216に基づいて即値データ
“100"を読み出し、データ演算部106、DOバス85を通し
てASP61およびCSP65に転送する。そして命令終了時にCS
P65の値をSP群66に転送する。
The E stage 205 reads the immediate data "100" based on the E code 216 and transfers it to the ASP 61 and CSP 65 through the data operation unit 106 and the DO bus 85. And at the end of the command CS
The value of P65 is transferred to the SP group 66.

ここで、この命令の後のステップコードがアドレス計算
時にスタックポインタを使用する場合を第31図に示す。
このとき、次のステップコードは、ステップコード
でスタックポインタの書き込み予約が行われているた
め、ステップコードがEステージ205で処理されてス
タックポインタに値が書き込まれスタックポインタ書き
込み予約が解除されるまでは、Aステージ203で処理を
中断して待っている。そしてステップコードがEステ
ージ205で処理されASP61が書き換わってから、ステップ
コードのAステージ203での処理を開始する。ステッ
プコードではFSP63の値をCSP65に転送する。
Here, FIG. 31 shows the case where the step code after this instruction uses the stack pointer in the address calculation.
At this time, in the next step code, since the stack pointer write reservation is made in the step code, the step code is processed in the E stage 205, a value is written in the stack pointer, and the stack pointer write reservation is released. Waits after interrupting the processing at the A stage 203. Then, after the step code is processed in the E stage 205 and the ASP 61 is rewritten, the processing of the step code in the A stage 203 is started. The step code transfers the value of FSP63 to CSP65.

一方、後のステップコードがスタックポインタを参照し
ない場合を第32図に示す。この時次のステップコード
はスタックポインタを参照しないので、Aステージ203
で待っている必要はなく、ステップコードがAステー
ジ203での処理を終えた時点でAステージ203での処理を
開始する。このステップコードに関してはASP61の値
が、本来その命令実行時に付随すべきスタックポインタ
の値とは異なっている。しかしステップコードではAS
P更新信号は“0"であり、FSP63の値はCSP65には書き込
まれない。そのためステップコードがEステージ205
で処理されるときには、正しいスタックポインタの値
(ステップコードでCSP65に書き込まれた値)がCSP65
に入っている。そして命令終了時にCSP65の値をソフト
ウェアからみたスタックポインタ66に書き込む。
On the other hand, FIG. 32 shows the case where the subsequent step code does not refer to the stack pointer. At this time, the next step code does not refer to the stack pointer, so the A stage 203
It is not necessary to wait at, and the processing in the A stage 203 is started when the step code finishes the processing in the A stage 203. With regard to this step code, the value of ASP61 is different from the value of the stack pointer that should be originally attached when the instruction is executed. But in the step code AS
The P update signal is “0”, and the value of FSP63 is not written to CSP65. Therefore, the step code is E stage 205
The correct stack pointer value (the value written to CSP65 in the step code) is processed by CSP65.
It is in. Then, at the end of the instruction, the value of CSP65 is written to the stack pointer 66 viewed from software.

また、ステップコードもスタックポインタを使用しな
い場合は、ステップコードがAステージ203での処理
を終わったらAステージ203での処理が開始される。ス
テップコードはと同様、ASP更新信号90が“0"であ
り、FSP63からCSP65への値の転送は行われない。
If the step code does not use the stack pointer, the process in the A stage 203 is started when the step code finishes the process in the A stage 203. Similarly to the step code, the ASP update signal 90 is "0", and the value transfer from the FSP63 to the CSP65 is not performed.

このように各ステップコードが、Aステージ203でスタ
ックポインタの値を更新する場合には、Aステージ203
で処理を終わった時点でこの命令終了時のスタックポイ
ンタの値がASP61に書き込まれている。そのため後の命
令のステップコードがAステージ203でスタックポイン
タを参照する場合、ASP61を参照することにより正しい
アドレスを得ることができる。例えば次の命令のアドレ
シッシングモードが(SP+disp)であったら、(ASP+d
isp)をアドレス加算部75で実行することにより、前の
命令の終了を待たなくても、正しいアドレスが得られ
る。
In this way, when each step code updates the stack pointer value in the A stage 203,
The value of the stack pointer at the end of this instruction is written in ASP61 when the processing is completed at. Therefore, when the step code of the subsequent instruction refers to the stack pointer at the A stage 203, the correct address can be obtained by referring to ASP61. For example, if the addressing mode of the next instruction is (SP + disp), (ASP + d
By executing isp) in the address adder 75, the correct address can be obtained without waiting for the end of the previous instruction.

またEステージ205の処理でスタックポインタの値を更
新する場合には、スタックポインタ書き込み予約を行
う。そして次のステップコードがAステージ203でスタ
ックポインタを参照する場合、次のステップコードの処
理はAステージ203でスタックポインタ書き込み予約が
解除されるまで待っている。一方次のステップコードが
スタックポインタを参照しない場合には、Aステージ20
3で待っている必要はなく各ステージでの処理を行い、
そのステップコードがEステージ205へ送られたときにF
SP63からCSP65へのスタックポインタの値の転送を行わ
ないようにする。こうしてCSP65に誤った値を転送しな
いようにし、命令終了時に転送されるソフトウェアから
みたスタックポインタ66の値は正しい値を保つ。
When updating the value of the stack pointer in the processing of the E stage 205, a stack pointer write reservation is made. When the next step code refers to the stack pointer at the A stage 203, the processing of the next step code waits until the stack pointer write reservation is released at the A stage 203. On the other hand, if the next step code does not refer to the stack pointer, the A stage 20
You don't have to wait in 3
F when the step code is sent to the E stage 205
Disable transfer of stack pointer value from SP63 to CSP65. In this way, an incorrect value is prevented from being transferred to the CSP 65, and the value of the stack pointer 66 seen from the software transferred at the end of the instruction is kept correct.

〔発明の効果〕 以上のように、この発明によれば、アドレス計算ステー
ジがスタックポインタを持ち、実行ステージの管理する
スタックポインタへの値の転送を、アドレス計算ステー
ジが管理するスタックポインタをアドレス計算ステージ
が更新したかどうかにより制御することで、少ないハー
ドウェアで高速かつ正確な命令実行を行える効果があ
る。
As described above, according to the present invention, the address calculation stage has the stack pointer, and the transfer of the value to the stack pointer managed by the execution stage is performed by the address calculation by the stack pointer managed by the address calculation stage. By controlling depending on whether or not the stage is updated, there is an effect that high-speed and accurate instruction execution can be performed with less hardware.

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

第1図は本発明の一実施例によるデータ処理装置の全体
ブロック図、第2図は本発明の一実施例によるデータ処
理装置のパイプライン概要図、第3図〜第27図は本発明
の一実施例によるデータ処理装置の命令フォーマットの
特徴を示す図、第28図は本発明の一実施例によるデータ
処理装置のスタックポインタ関連部分の構成図、第29
図、第30図は本発明のデータ処理装置において実施され
るいくつかの命令の実行フローチャート、第31図,第32
図は第30図に示す命令の次のステップコードを含めた実
行フローチャート、第33図は従来例を示すブロック図、
第34図,第35図は従来のプッシュ命令の実行フローチャ
ートである。 203……アドレス計算ステージ(Aステージ)、205……
実行ステージ(Eステージ)、212〜217……パイプライ
ン処理の単位であるステップコード、61……Aステージ
203の作業用ステージスタックポインタ(ASP)、63……
Eステージ205の作業用ステージスタックポインタ(CS
P)、75……Aステージ203のアドレス加算部、90……A
ステージ203でASPを更新することを示すASP更新信号 なお、図中同一符号は、同一、または相当部分を示す。
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 characteristics of an instruction format of a data processing device according to an embodiment, 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, and FIG.
FIG. 30 is an execution flowchart of some instructions executed in the data processor of the present invention, FIG. 31, FIG.
Figure is an execution flow chart including the next step code of the instruction shown in Figure 30, Figure 33 is a block diagram showing a conventional example,
34 and 35 are execution flow charts of conventional push instructions. 203 …… Address calculation stage (A stage), 205 ……
Execution stage (E stage), 212 to 217 ... Step code, which is a unit of pipeline processing, 61 ... A stage
203 working stage stack pointer (ASP), 63 ……
E-stage 205 work stage stack pointer (CS
P), 75 ... A stage 203 address adder, 90 ... A
ASP update signal indicating that ASP is updated in stage 203 Note that the same reference numerals in the drawings indicate the same or corresponding portions.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】スタックポインタによって命令のオペラン
ドを指定すると同時に前記スタックポインタの更新方法
を指定するアドレッシングモードを備え、第1のステー
ジ及び第2のステージで命令の処理をパイプライン処理
によって順次的に行い、 前記第1のステージで参照可能な第1のスタックポイン
タと、 前記第2のステージで参照可能な第2のスタックポイン
タと、 前記第1のステージで制御され、前記第1のスタックポ
インタを更新する第1の更新手段と、 前記第2のステージで制御され、前記第1のスタックポ
インタを更新する第2の更新手段と、 前記第2のステージで制御され、前記第2のスタックポ
インタを更新する第3の更新手段と、 前記第1のスタックポインタの値を前記第2のスタック
ポインタに転送する転送手段とを備えるデータ処理装置
において、 前記第1のスタックポインタが前記第1のステージの制
御により更新された命令の場合のみ、前記命令が前記第
2のステージに転送されるのと同期して前記第1のスタ
ックポインタから前記第2のスタックポインタへの転送
を行う転送制御手段とを備えたことを特徴とするデータ
処理装置。
1. An addressing mode for designating an operand of an instruction by a stack pointer and at the same time an updating method of the stack pointer is provided, and instruction processing is sequentially performed by pipeline processing in a first stage and a second stage. A first stack pointer that can be referenced in the first stage, a second stack pointer that can be referenced in the second stage, and a first stack pointer that is controlled in the first stage First updating means for updating, second updating means controlled by the second stage for updating the first stack pointer, and second controlling means for updating the second stack pointer by the second stage. Third updating means for updating, and transfer means for transferring the value of the first stack pointer to the second stack pointer In the data processing device, the first stack pointer is synchronized with the transfer of the instruction to the second stage only when the first stack pointer is an instruction updated under the control of the first stage. And a transfer control means for transferring from the stack pointer to the second stack pointer.
JP63177942A 1988-07-14 1988-07-14 Data processing device Expired - Lifetime JPH0769802B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
JPH0225934A JPH0225934A (en) 1990-01-29
JPH0769802B2 true JPH0769802B2 (en) 1995-07-31

Family

ID=16039767

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPH0769802B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06100967B2 (en) * 1987-06-10 1994-12-12 三菱電機株式会社 Data processing device having pipeline processing mechanism and processing method

Also Published As

Publication number Publication date
JPH0225934A (en) 1990-01-29

Similar Documents

Publication Publication Date Title
US5091853A (en) Chained addressing mode pipelined processor which merges separately decoded parts of a multiple operation instruction
US5522053A (en) Branch target and next instruction address calculation in a pipeline processor
JP2507638B2 (en) Data processing device
US5321821A (en) System for processing parameters in instructions of different format to execute the instructions using same microinstructions
JP3543181B2 (en) Data processing device
JP2581236B2 (en) Data processing device
US4945511A (en) Improved pipelined processor with two stage decoder for exchanging register values for similar operand instructions
JPH081599B2 (en) Data processing device
JPH01214932A (en) Data processor
JPH07120284B2 (en) Data processing device
JP2556182B2 (en) Data processing device
US5212779A (en) System for guarantee reexecution after interruption by conditionally used store buffer if microinstruction being executed is a memory write and last microinstruction
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
JP2522048B2 (en) Microprocessor and data processing device using the same
JPH0769802B2 (en) Data processing device
JPH0769801B2 (en) Data processing device
JP2532560B2 (en) Data processing device for high-performance exception handling
JPH0769805B2 (en) Data processing device
JPH0769804B2 (en) Data processing device
JPH0573294A (en) Microprocessor
JP2696578B2 (en) Data processing device
JPH0769808B2 (en) Data processing device
JPH0218621A (en) Data processor