JPH0225934A - Data processor - Google Patents

Data processor

Info

Publication number
JPH0225934A
JPH0225934A JP17794288A JP17794288A JPH0225934A JP H0225934 A JPH0225934 A JP H0225934A JP 17794288 A JP17794288 A JP 17794288A JP 17794288 A JP17794288 A JP 17794288A JP H0225934 A JPH0225934 A JP H0225934A
Authority
JP
Japan
Prior art keywords
stage
instruction
stack pointer
value
operand
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP17794288A
Other languages
Japanese (ja)
Other versions
JPH0769802B2 (en
Inventor
Yukari Watanabe
渡辺 由香里
Masahito Matsuo
雅仁 松尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to 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)

Abstract

PURPOSE:To accurately and quickly carry out an instruction with a small quantity of hardware by controlling the stack pointer where the transfer of value is controlled by an address calculation stage to the stack pointer controlled by an execution stage based on the presence or absence of replacement of the address calculation stage. CONSTITUTION:The value of a stack pointer is transferred to another stack pointer which is controlled by an execution stage 205 synchronously with the flow of an instruction in a pipeline only in the case the stage stack pointer ASP of an address calculation stage 203 is replaced when an address is calculated at the stage 203. Thus it is possible to obtain a data processor which performs the correct control of the stack pointer without stopping the relevant instruction at the stage 203 with a small quantity of hardware and even in the case the instruction following the instruction which rewrites the value of the stack pointer at the execution stage produces no conflict related to the stack pointer.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は高度なパイプライン処理機構により高い処理
能力を実現したデータ処理装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a data processing device that achieves high processing capacity by using 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. 145852/1983.

第33図は従来のスタックポインタ計算部のブロック図
である。従来例に示すデータ処理装置は、パイプライン
処理により命令の実行を行い、命令フェッチステージ(
IFステージ)、命令デコードステージ(Dステージ)
、オペランドアドレス計算ステージ(Aステージ)、オ
ペランドフェッチステージ(Fステージ)、実行ステー
ジ(Eステージ)の順に処理される。 61はアドレス
計算ステージで管理されているステージスタックポイン
タ(ASP)、62はASP出力ラッチ、63はオペラ
ンドフェッチステージで管理されているステージスタッ
クポインタ(FSP)、64はFSP出力ラッチ、65
は実行ステージで管理されているステージスタックポイ
ンタ(C5P)、66.67.68はソフトウェアから
見たレベルのスタックポインタ(SPI、 SPO,5
PI)である。
FIG. 33 is a block diagram of a conventional stack pointer calculation section. The data processing device shown in the conventional example executes instructions by pipeline processing, and the 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 (ASP) managed in the address calculation stage, 62 is an ASP output latch, 63 is a stage stack pointer (FSP) managed in the operand fetch stage, 64 is an FSP output latch, 65
is the stage stack pointer (C5P) managed in the execution stage, and 66.67.68 is the stack pointer at the software level (SPI, SPO, 5).
PI).

第34図はスタックブツシュを含む命令、例えばレジス
タの値をスタックトップ(スタックポインタの値をデク
リメントした値が指すところ)に書き込むMOV命令(
MOV:Rn −> 1il−5P  Rnはn番のレ
ジスタを表し、a−spはスタックポインタをデクリメ
ントした値が指すアドレスを示す)を実行した場合の各
ステージのスタックポインタの動作を示すフローチャー
トである。命令実行前のASl’61の値を1nitS
Pとし、この命令の直前の命令終了時のスタックポイン
タ値と整合がとれていることとする。
Figure 34 shows an instruction that includes a stack bush, such as the MOV instruction (which writes the value of a register to the top of the stack (pointed to by the value obtained by decrementing the value of the stack pointer)).
MOV:Rn -> 1il-5P (Rn represents the nth register, a-sp represents the address pointed to by the value obtained by decrementing the stack pointer) is a flowchart showing the operation of the stack pointer at each stage. . The value of ASl'61 before instruction execution is 1nitS
It is assumed that the stack pointer value is consistent with the stack pointer value at the end of the instruction immediately before this instruction.

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

Fステージではレジスタ指定信号を受けてレジスタアク
セス信号を次のEステージに送る。命令がEステージに
達するとき、同時にFSP63の値(iriitsP−
4)もEステージのC5P65に送られる。
The F stage receives a 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 (iriitsP-
4) is also sent to C5P65 in the E stage.

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

また、5P166.5PO67,5P16Bに関して、
命令実行中はこれらのスタックポインタには前の値を保
っておき、各命令の処理の最後にCSl’65の値をソ
フトウェアからみたレベルのスタックポインタ(SPI
、SPO、,5PI)の1つに設定する。
Also, regarding 5P166.5PO67, 5P16B,
During instruction execution, these stack pointers retain their previous values, and at the end of each instruction, the value of CSl'65 is changed to the stack pointer (SPI) at the level seen from the software.
, SPO, ,5PI).

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

Aステージでは即値“100”が次のFステージへ送ら
れる。ASP61は変化しないでFSP63に転送され
る。
At the A stage, the immediate value "100" is sent to the next F stage. The ASP 61 is transferred to the FSP 63 without change.

この命令ではAステージのスタックポインタ(ASP6
1)の値は、命令が終了しスタックポインタに値が書き
込まれるまでは前の値を保ったままなので、後の命令が
スタックポインタを参照する命令の場合(スタックポイ
ンタに関するコンフリクトを生じている場合)に、AS
P61を参照してアドレス計算を行ってしまうと誤った
値が生成されることになる。そのため、命令が終了して
スタックポインタの値が書き換わってしまうまではスタ
ックポインタの書き込み予約を行っておき、後の命令が
スタックポインタを参照する場合は、この書き込み予約
が解除されるまではAステージでアドレス計算を行わず
に待っている。そして書き込み予約が解除されてからA
ステージでのアドレス計算を始める。
This instruction uses the A stage stack pointer (ASP6
The value of 1) remains the previous value until the instruction ends and the value is written to the stack pointer, so if the subsequent instruction refers to the stack pointer (if there is a conflict regarding the stack pointer) ), AS
If address calculation is performed with reference to P61, an incorrect value will be generated. Therefore, the stack pointer is reserved for writing until the instruction ends and the value of the stack pointer is rewritten, and if a later instruction refers to the stack pointer, the write reservation is canceled until the write reservation is canceled. Waiting on stage without performing address calculation. Then, after the write reservation is canceled, A
Start address calculation on stage.

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

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

Eステージでは、データ“100”は口0バス85を通
してASP61 、 C3P65に同時に書き込まれる
In the E stage, data "100" is simultaneously written to the ASP 61 and C3P 65 through the port 0 bus 85.

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

しかし後の命令がスタックポインタを使用しない場合は
、スタックポインタの書き込み予約が行われていても、
Aステージでアドレス計算を行わずに待っている必要は
ない。そのため先の命令がEステージで処理されASP
61が書き換わった時点では、すでにアドレス計算ステ
ージまたはオペランドフェッチステージでの処理を終了
している場合がある。そうするとこの命令は正しくない
スタックポインタの値を伴って実行ステージに到達する
ことになり、誤った値がC3P65に転送され、命令終
了時に誤った値がSP!66.5PO67,5P168
のいずれかに書き込まれてしまう。
However, if the later instruction does not use the stack pointer, even if the stack pointer is reserved for writing,
There is no need to wait without performing address calculation in the A stage. Therefore, the previous instruction is processed in the E stage and the ASP
By the time 61 is rewritten, processing at the address calculation stage or operand fetch stage may have already been completed. The instruction would then reach the execution stage with an incorrect stack pointer value, the incorrect value would be transferred to the C3P65, and the incorrect value would be sent to SP! at the end of the instruction. 66.5PO67, 5P168
will be written to either.

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

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

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

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

〔課題を解決するための手段〕[Means to solve the problem]

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

〔作用〕[Effect]

この発明におけるデータ処理装置は、アドレス計算ステ
ージでのアドレス演算時に、このステージのステージス
タックポインタ(ASP)を更新した場合のみ、バイブ
ライン中の命令の流れと同期してスタックポインタの値
を実行ステージが管理しているスタックポインタに転送
する。
The data processing device according to the present invention is an execution stage in which the value of the stack pointer is synchronized with the flow of instructions in the vibe line only when the stage stack pointer (ASP) of this stage is updated during address calculation in the address calculation stage. Transfer to the stack pointer managed by .

[発明の実施例] 以下、本発明をその実施例を示す図面に基づいて詳述す
る。
[Embodiments of the Invention] Hereinafter, the present invention will be described in detail based on drawings showing embodiments thereof.

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

本発明のデータ処理装置では高頻度命令を短いフォーマ
ットとする目的で特に工夫された命令フォーマット体系
を存する。例えば、2オペランド命令に関しては基本的
に“4ハイド+拡張部”の構成を有して総てのアドレッ
シングモードが利用可能な一般形フオーマットと、使用
頻度の高い命令及びアドレッシングモードのみが使用可
能な短藩宿形フォーマットの2つのフォーマットとがあ
る。
The data processing device of the present invention has an instruction format system that is particularly devised for the purpose of shortening high-frequency instructions. For example, for 2-operand instructions, there is a general format that basically has a configuration of "4 hides + extension part" and all addressing modes can be used, and a general format in which only frequently used instructions and addressing modes can be used. There are two formats: short-han-shuku-gata format.

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

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

本発明のデータ処理装置では、いずれのフォーマットの
場合も、各オペランドのEaまたはshの拡張部は必ず
そのEaまたはshの基本部を含むハーフワードの直後
に位置される。これは、命令により暗黙に指定される即
値データあるいは命令の拡張部に優先する。従って、4
ハイド以上の命令では、Eaの拡張部によって命令のオ
ペレーションコードが分断される場合がある。
In the data processing apparatus of the present invention, in any format, the extended part of Ea or sh of each operand is always located immediately after the halfword containing the basic part of Ea or sh. This overrides any immediate data or extensions of the instruction implicitly specified by the instruction. Therefore, 4
For instructions of Hyde or higher, the operation code of the instruction may be separated by the extension part of Ea.

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

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

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

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

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

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

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

第7図は即値−メモリ間演算命令のフォーマツ) (1
4ormat)を示す模式図である。財はオペランドサ
イズの指定フィールド(ソース、ディスティネーション
で共通) 、shはデスティネーションオペランドの指
定フィールドである。I−formatの即値のサイズ
はデスティネーション側のオペランドのサイズと共通に
8.16.32ビツトとなり、ゼロ拡張及び符号拡張は
行なわれない。
Figure 7 shows the format of the immediate value-memory operation instruction) (1
4ormat). property is the operand size specification field (common to source and destination), and sh is the destination operand specification field. The size of the immediate value of I-format is 8.16.32 bits, which is the same as the size of the destination operand, and zero extension and sign extension are not performed.

(1,2) r−船形1オペランド命令」第8図は1オ
ペランド命令の一膜形フオーマット(Gl−forma
t)を示す模式図である。財はオペランドサイズの指定
フィールドである。一部のGl−format命令では
、Eaの拡張部以外にも拡張部がある。また、■を使用
しない命令もある。
(1, 2) r-ship-shaped one-operand instruction” Figure 8 shows the single-layer format (Gl-forma) of the one-operand instruction.
It is a schematic diagram showing t). Goods is a specified field of operand size. Some Gl-format instructions have extensions in addition to the Ea extension. There are also instructions that do not use ■.

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

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

第10図は第1オペランドが8ビツト即値の命令のフォ
ーマット(E−format)を示す模式図である。
FIG. 10 is a schematic diagram showing the format (E-format) of an instruction whose first operand is an 8-bit immediate value.

EaM Lよデスティネーションオペランドの指定フィ
ールド、財はデスティネーションオペランドサイズの指
定フィールド、■・・・はソースオペランド値である。
EaML is a destination operand specification field, item is a destination operand size specification field, and . . . is a source operand value.

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

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

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

(1,4) rアドレッシングモード」本発明のデータ
処理装置のアドレッシングモード指定方法には、レジス
タを含めて6ビツトで指定する短縮形と、8ピントで指
定する一般形とがある。
(1, 4) r Addressing Mode There are two methods for specifying the addressing mode of the data processing device of the present invention: a short form in which the addressing mode is specified using 6 bits including registers, and a general form in which the addressing mode is specified using 8 pins.

未定義のアドレッシングモードが指定された場合、ある
いは意味的に考えて明らかに不適当なアトレンジングモ
ードの組み合わせが指定された場合には、未定義命令が
実行された場合同様に予約命令例外が発生され、例外処
理が起動される。
If an undefined addressing mode is specified, or if a semantically inappropriate combination of addressing modes is specified, a reserved instruction exception will occur in the same way as when an undefined instruction is executed. and exception handling is triggered.

これに8亥当するのは、デスティネーションが即値モー
ドの場合、アドレス計算を伴うべきアドレッシングモー
ド指定フィールドで即値モードを使用した場合等である
This applies in cases where the destination is in immediate mode, or when immediate mode is used in the addressing mode designation field that should involve address calculation.

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

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

(1,4,1)  r基本アドレッシングモード」本発
明のデータ処理装置は様々なアドレッシングモードをサ
ポートする。それらの内、本発明のデータ処理装置でサ
ポートする基本アドレッシングモードには、レジスタ直
接モード、レジスタ間接モード、レジスタ相対間接モー
ド、即値モード、絶対モード、PC(プログラムカウン
タ)、相対間接モード、スタックポツプモード及びスタ
ックブツシュモードがある。
(1, 4, 1) r Basic Addressing Mode” The data processing device of the present invention supports various addressing modes. Among them, the basic addressing modes supported by the data processing device of the present invention include register direct mode, register indirect mode, register relative indirect mode, immediate value mode, absolute mode, PC (program counter), relative indirect mode, and stack point. There are push mode and stack mode.

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

Rnは汎用レジスタの番号を示す。Rn indicates the number of a general-purpose register.

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

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

即値モードは命令コード中で指定されるビットパターン
をそのまま2進数と見なしてオペランドとする。フォー
マットの模式図を第16図に示す。
In the immediate mode, the bit pattern specified in the instruction code is treated as a binary number and used as an operand. A schematic diagram of the format is shown in FIG.

imm−dataは即値を示す。i+u+−dataの
サイズは、オペランドサイズとして命令中で指定される
imm-data indicates an immediate value. The size of i+u+-data is specified in the instruction as the operand size.

絶対モードはアドレス値が16ビツトで示されるか32
ビツトで示されるかにより2種類ある。それぞれ、命令
コード中で指定される16ビツトまたは32ビツトのビ
ットパターンをアドレスとするメモリの内容をオペラン
ドとする。フォーマットの模式図を第17図に示す。a
bs:16とabs :32とはそれぞれ16ビツトま
たは32ビツトのアドレス値を示す。
In absolute mode, the address value is indicated by 16 bits or 32
There are two types depending on whether it is indicated by a bit. Each operand is the contents of the memory whose address is a 16-bit or 32-bit bit pattern specified in the instruction code. A schematic diagram of the format is shown in FIG. a
bs:16 and abs:32 indicate a 16-bit or 32-bit address value, respectively.

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

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

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

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

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

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

具体的に予約命令例外となるのは、writeオペラン
ド、read−modify−writeオペランドに
対するスタックポツプモード指定である。
Specifically, the reserved instruction exception is the stack pop mode specification for the write operand and read-modify-write operand.

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

(1,4,2) r多段間接アドレッシングモード」如
何に複雑なアドレッシングも、基本的には加算と間接参
照の組み合わせに分解される。従って、加算と間接参照
のオペレーションをアドレッシングのプリミティブとし
て与えておき、それを任意に組み合わせることができれ
ば、如何なる複雑なアドレッシングモードをも実現可能
となる。本発明のデータ処理装置の多段間接アドレッシ
ングモードはこの様な考え方に基づいたアドレッシング
モードである。複雑なアドレッシングモードはモジュー
ル間のデータ参照あるいはAI (人工知能)言語の処
理系に特に有用である。
(1, 4, 2) Multi-stage indirect addressing mode No matter how complex addressing is, it is basically broken down into a combination of addition and indirect references. Therefore, if addition and indirect reference operations are provided as addressing primitives and can be combined arbitrarily, any complex addressing mode can be realized. The multi-stage indirect addressing mode of the data processing device of the present invention is an addressing mode based on this idea. Complex addressing modes are particularly useful for inter-module data references or AI (artificial intelligence) language processing systems.

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

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

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

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

拡張する多段間接モード指定フィールドは16ビツトを
単位としており、これを任意回反復する。
The multi-stage indirect mode specification field to be expanded has a unit of 16 bits, and this is repeated any number of times.

1段の多段間接モードにより、ディスプレースメントの
加算、インデクスレジスタのスケーリング(XI、 X
2. X4. X8)と加算、メモリの間接参照を行な
う。多段間接モードのフォーマットの模式図を第24図
に示す。各フィールドは以下に示す意味を持つ。
One-stage multi-stage indirect mode allows displacement addition and index register scaling (XI,
2. X4. X8) and performs indirect reference to memory. A schematic diagram of the format of the multi-stage indirect mode is shown in FIG. Each field has the meaning shown below.

E=0  :多段間接モード継続 E・1 ニアドレス計算終了 tmp ==> address  of opera
nd■・0 :メモリ間接参照なし tmp + disp + Rx * 5cale =
=> tmpI・1 :メモリ間接参照あり nelltmp + disp + RX * 5ca
le ==>tmpM=0  :  <RX>をインデ
クスとして使用M、1  :特殊なインデクス <Rx>=Oインデクス値を加算しな い  (Rx=0) <Rx>= 1   プログラムカウンタをインデクス
値として使用 (Rx=PC) <Rx>=2〜  reserved 口20:多段間口上0ド中の4ビツトのフィールドd4
の値を4倍してディスプレースメント値とし、これを加
算する d4は符号付きとして扱い、オペラン ドのサイズとは関係なく必ず4倍して 使用する 0、1  :多段間接モードの拡張部で指定されたd 
1spx (16/32ビツト)をディスプレースメン
ト値とし、これを加算する 拡張部のサイズはd4フィールドで指 定する d4=0001   dispxは16ビツトd4=0
010   dispxは32ビツト×x ;インデク
スのスケール(scale=1/2/4/8)プログラ
ムカウンタに対してX2. X4. X 8のスケーリ
ングを行なった場合には、その段の処理終了後の中間値
(tmp)として不定値が入る。この多段間接モードに
よって得られる実効アドレスは予測できない値となるが
、例外は発生しない。プログラムカウンタに対するスケ
ーリングの指定は行なってはいけない。
E=0: Continuation of multi-stage indirect mode E・1 Near address calculation end tmp ==> address of opera
nd■・0: No memory indirect reference tmp + disp + Rx * 5cale =
=> tmpI・1: With memory indirect reference nelltmp + disp + RX * 5ca
le ==>tmpM=0: Use <RX> as index M, 1: Special index <Rx>=O Do not add index value (Rx=0) <Rx>= 1 Use program counter as index value ( Rx=PC) <Rx>=2~ reserved Port 20: 4-bit field d4 in the top 0 code of the multi-stage frontage
The value of is multiplied by 4 as a displacement value, and this is added. d4 is treated as signed and is always multiplied by 4 regardless of the size of the operand. 0, 1: Specified in the extension part of multi-stage indirect mode. d
The displacement value is 1spx (16/32 bits), and the size of the extension section to which this is added is specified in the d4 field. d4=0001 dispx is 16 bits d4=0
010 dispx is 32 bits×x; index scale (scale=1/2/4/8) X2. X4. When scaling by x8 is performed, an undefined value is entered as the intermediate value (tmp) after the processing of that stage is completed. Although the effective address obtained by this multi-stage indirect mode is an unpredictable value, no exceptions occur. Do not specify scaling for the program counter.

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

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

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

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

(1,5) r例外処理」 本発明のデータ処理装置はソフトウェア負荷の軽減のた
め豊富な例外処理機能を有する。本発明のデータ処理装
置では、例外処理は命令処理を再実行するもの(例外)
、命令処理を完了するもの(トラップ)及び割込の3種
類に分けて名称をつけている。また本発明のデータ処理
装置では、この3種の例外処理とシステム障害とを総称
してBITと称する。
(1, 5) r Exception Handling” The data processing device of the present invention has abundant exception handling functions to reduce the software load. In the data processing device of the present invention, exception handling is re-execution of instruction processing (exception).
They are divided into three types and named: , those that complete instruction processing (traps), and interrupts. Furthermore, in the data processing apparatus of the present invention, these three types of exception handling and system failure are collectively referred to as BIT.

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

本発明のデータ処理装置の内部を機能的に大きく分ける
と、命令フェッチ部101.命令デコード部102、P
C計算部103.オペランドアドレス計算部104゜マ
イクロROM部105.データ演算部106.外部バス
インターフェイス部107に分かれる。
Functionally, the inside of the data processing device of the present invention can be roughly divided into an instruction fetch unit 101. Instruction decoding unit 102, P
C calculation section 103. Operand address calculation unit 104゜Micro ROM unit 105. Data calculation unit 106. It is divided into an external bus interface section 107.

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

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

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

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

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

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

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

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

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

またマイクロ120M部105はストアバッファの管理
も行う。マイクロROM部105には命令コードに依存
しない割込みあるいは演算実行結果によるフラッグ情報
と、第2デコーダ305の出力等の命令デコード部の出
力が人力される。マイクロデコーダの出力は主にデータ
演算部106に対して出力されるが、ジャンプ命令の実
行による他の先行処理中止情報等の一部の情報は他のブ
ロックへも出力される。
The micro 120M unit 105 also manages store buffers. The micro ROM unit 105 is manually supplied with flag information based on interrupts or arithmetic execution results that do not depend on instruction codes, and outputs from the instruction decoding unit such as the output from the second decoder 305. The output of the micro-decoder is mainly output to the data calculation unit 106, but some information, such as other preceding processing stop information due to execution of a jump instruction, is also output to other blocks.

(2,4) rオペランドアドレス計算部」オペランド
アドレス計算部104は命令デコード部102のアドレ
スデコーダ等から出力されたオペランドアドレス計算に
関係する情報によりハードワイヤード制御される。この
ブロックではオペランドのアドレス計算に関するほとん
どの処理が行われる。メモリ間接アドレシングのための
メモリアクセスのアドレス及びオペランドアドレスがメ
モリにマツプされたl10Sff域に入るか否かのチエ
ツクも行われる。
(2, 4) r Operand Address Calculation Unit The operand address calculation unit 104 is hard-wired controlled by information related to operand address calculation output from the address decoder of the instruction decoding unit 102, etc. This block performs most of the processing related to operand address calculation. A check is also made to see if the address of the memory access for memory indirect addressing and the operand address fall within the l10Sff area mapped to memory.

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

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

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

このブリブランチの手法については特願昭612045
00号及び特願昭61−200557号で詳しく述べら
れている。
Regarding this Bribranch method, please refer to Japanese Patent Application No. 612045.
00 and Japanese Patent Application No. 61-200557.

pc計算部103の計算結果は各命令のpc値とじて命
令のデコード結果と共に出力される他、ブリブランチ時
には、次にデコードすべき命令のアドレスとして命令フ
ェッチ部101へ出力される。また、次に命令デコード
部102でデコードされる命令の分岐予測のためのアド
レスにも使用される。
The calculation result of the pc calculation unit 103 is output as the pc value of each instruction together with the instruction decoding result, and at the time of branching, it is output to the instruction fetch unit 101 as the address of the next instruction to be decoded. It is also used as an address for branch prediction of the next instruction to be decoded by the instruction decoding unit 102.

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

(2,6) rデータ演算部」 データ演算部106はマイクロプログラムにより制御さ
れ、マイクロROM部105の出力情報に従って各命令
の機能を実現するに必要な演算をレジスタと演算器で実
行する。演算対象となるオペランドがアドレスあるいは
即値である場合は、オペランドアドレス計算部オペラン
ドアドレス計算部104で計算されたアドレスあるいは
即値を外部パスインクフェイス部107を通過させて得
る。また、演算対象となるオペランドがCPt1外部の
メモリにある場合は、アドレス計算部104で計算され
たアドレスをパスインタフェイス部がアドレス出力回路
108から出力して、CPU外部のメモリからフエンチ
したオペランドをデータ入出力回路109から得る。
(2, 6) r Data Operation Unit The data operation unit 106 is controlled by a microprogram, and uses registers and arithmetic units to execute operations necessary to realize the function of each instruction according to the output information of the micro ROM unit 105. When the operand to be operated on is an address or an immediate value, the address or immediate value calculated by the operand address calculation unit 104 is passed through the external path ink face unit 107 and obtained. Furthermore, if the operand to be operated on is in the memory outside the CPt1, the path interface section outputs the address calculated by the address calculation section 104 from the address output circuit 108, and reads the quenched operand from the memory outside the CPU. It is obtained from the data input/output circuit 109.

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

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

CPU外部のメモリにデータをストアする場合は、外部
ハスインターフェイス部107を通してアドレス出力回
路108よりアドレスを出力すると同時に、データ入出
力回路109からデータをCPU外部に出力する。オペ
ランドストアを効率的に行うため、データ演算部106
には4バイトのストアバッファが備えられている。
When storing data in a memory external to the CPU, an address is output from the address output circuit 108 through the external hash interface section 107, and at the same time, data is output from the data input/output circuit 109 to the outside of the CPU. In order to efficiently store operands, the data calculation unit 106
is equipped with a 4-byte store buffer.

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

(以 下 余2; 白) (2,7) r外部パスインターフェイス部」外部パス
インターフェイス部107は本発明のデータ処理装置の
外部パスでの通信を制御する。メモリのアクセスはすべ
てクロック同期で行われ、最小2クロックサイクル(1
ステツプ)で行うことができる。
(Remainder 2 below; white) (2, 7) r External path interface unit The external path interface unit 107 controls communication on the external path of the data processing device of the present invention. All memory accesses are performed in clock synchronization, with a minimum of 2 clock cycles (1
This can be done in steps).

メモリに対するアクセス要求は命令フェッチ部101、
オペランドアドレス計算部104及びデータ演算部10
6から独立に生じる。外部パスインターフェイス部10
7はこれらのメモリアクセス要求を調停する。更にメモ
リとCPUとを結ぶデータバスサイズである32ビツト
(1ワード)の整置境界を跨ぐメモリ番地にあるデータ
のアクセスは、このブロック内で自動的にワード境界を
跨ぐことを検知して2回のメモリアクセスに分解して行
う。
The instruction fetch unit 101 issues an access request to the memory.
Operand address calculation unit 104 and data calculation unit 10
arises independently from 6. External path interface section 10
7 arbitrates these memory access requests. Furthermore, when accessing data at a memory address that straddles a 32-bit (1 word) aligned boundary, which is the data bus size that connects the memory and the CPU, it is automatically detected within this block that it straddles a word boundary. This is done by breaking it down into multiple memory accesses.

ブリフェッチするオペランドとストアするオペランドと
が重なる場合のコンフリクト防止処理及びストアオペラ
ンドからフェッチオペランドへのバイパス処理も行う。
It also performs conflict prevention processing when the pre-fetch operand and store operand overlap, and bypass processing from the store operand to the fetch operand.

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

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

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

各ステージは他のステージとは独立に動作し、理論上は
5つのステージが完全に独立動作する。
Each stage operates independently of the other stages, and in theory the five stages operate completely independently.

各ステージは1回の処理を最小2クロック(1ステツブ
)で行うことができる。従って理想的には2クロツク(
1ステツプ)毎に次々とパイプライン処理が進行する。
Each stage can perform one process in a minimum of two clocks (one step). Therefore, ideally two clocks (
Pipeline processing progresses one after another for each step (1 step).

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

パイプライン処理単位の分解方法に関しては特願昭61
−236456号で詳しく述べられている。
Regarding the decomposition method of pipeline processing units, please refer to the patent application 1986.
It is described in detail in No.-236456.

IFステージ201からDステージ202に渡される情
報は、命令コード211そのものである。Dステージ2
02からAステージ203に渡される情報は、命令で指
定された演算に関するもの(Dコード212と称す)と
、オペランドのアドレス計算に関係するもの(Aコード
213と称す)との2つがある。
The information passed from the IF stage 201 to the D stage 202 is the instruction code 211 itself. D stage 2
There are two types of information passed from 02 to the A stage 203: information related to the operation specified by the instruction (referred to as D code 212), and information related to operand address calculation (referred to as A code 213).

Aステージ203からFステージ204に渡される情報
はマイクロプログラムのエントリアドレスあるいはマイ
クロプログラムのパラメータ等を含むRコード214と
、オペランドのアドレスとアクセス方法指示情報等を含
むFコード215との2つである。
The information passed from the A stage 203 to the F stage 204 is an R code 214 that includes the microprogram entry address or microprogram parameters, and an F code 215 that includes the operand address and access method instruction information. .

Fステージ204からEステージ205に渡される情報
は、演算制御情報とリテラル等を含むEコード216と
、オペランドあるいはオペランドアドレス等を含むSコ
ード217との2つである。
The information passed from the F stage 204 to the E stage 205 is two types: an E code 216 including arithmetic control information and literals, and an S code 217 including operands or operand addresses.

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

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

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

命令基本部には多くの場合、オペレーションコード部と
アドレッシングモード指定部とがあり、インデックスア
ドレッシングあるいはメモリ間接アドレッシングが必要
な場合にはアドレッシング拡張部の代わりに“2バイト
の多段間接モード指定部子〇〜4ハイドのアトレンジン
グ拡張部”が任意価付く。また、命令により2または4
バイトの命令固有の拡張部が最後に付く。
The instruction basic part often has an operation code part and an addressing mode specification part, and if index addressing or memory indirect addressing is required, a "2-byte multi-stage indirect mode specification part" is used instead of the addressing extension part. ~4 Hyde's Atranging Extension” is optionally available. Also, depending on the command, 2 or 4
An instruction-specific extension of bytes is appended at the end.

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

(3,1,2) rステップコードへの命令の分解」本
発明のデータ処理装置では、上記の命令フォーマットの
特徴を生かしたパイプライン処理を行う。
(3, 1, 2) Decomposition of instructions into r-step codes The data processing device of the present invention performs pipeline processing that takes advantage of the characteristics of the instruction format described above.

Dステージ202では“2ハイドの命令基本部+0〜4
バイトのアドレッシング拡張部”、“多段間接モード指
定部子アドレッシング拡張部”又は命令固有の拡張部を
1つのデコード単位として処理する。各回のデコード結
果をステップコードと称し、Aステージ203以降では
このステップコードをパイプライン処理の単位としてい
る。ステップコードの数は命令毎に固有であり、多段間
接モード指定を行わない場合は、1つの命令は最小1個
、最大3個のステップコードに分かれる。多段間接モー
ド指定が行われた場合はそれだけステップコードが増加
する。但し、これは後で述べる様にデコード段階のみで
ある。
In the D stage 202, “2 Hyde’s instruction basic part +0 to 4
"byte addressing extension", "multi-stage indirect mode specification part addressing extension", or instruction-specific extension are processed as one decoding unit.The decoding result of each time is called a step code, and from the A stage 203 onwards, this step Code is the unit of pipeline processing.The number of step codes is unique for each instruction, and if multi-stage indirect mode is not specified, one instruction is divided into a minimum of 1 step code and a maximum of 3 step codes.Multi-stage When the indirect mode is designated, the step code increases accordingly.However, as will be described later, this only occurs at the decoding stage.

(3,1,3) rプログラムカウンタの管理」本発明
のデータ処理装置のパイプライン上に存在するステップ
コードは全て別命令に対するものである可能性があり、
このためプログラムカウンタの値はステップコート毎に
管理される。全てのステップコードは、そのステップコ
ードのもとになった命令のプログラムカウンタ値を有す
る。ステップコードに付属してパイプラインの各ステー
ジを流れるプログラムカウンタ値はステッププログラム
カウンタ(SPC)と称する。SPCはパイプラインス
テージ間を次々と受は渡されていく。
(3, 1, 3) ``Program counter management'' It is possible that all the step codes existing on the pipeline of the data processing device of the present invention are for different instructions,
Therefore, the value of the program counter is managed for each step coat. Every step code has the program counter value of the instruction that the step code is based on. The program counter value that accompanies the step code and flows through each stage of the pipeline is referred to as the step program counter (SPC). The SPC is passed between pipeline stages one after another.

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

(3,2,1) r命令フェッチステージ」命令フェッ
チステージ(IFステージ)201は命令をメモリある
いはブランチバッファからフェッチして命令キュー30
1に入力し、Dステージ202に対して命令コードを出
力する。命令キュー301の人力は整置された4バイト
単位で行う。メモリから命令をフェッチする場合は、整
置された4バイトにつき最小2クロック(1ステツプ)
を要する。
(3, 2, 1) r instruction fetch stage The instruction fetch stage (IF stage) 201 fetches instructions from memory or branch buffer and stores them in the instruction queue 30.
1 and outputs the instruction code to the D stage 202. The manual operation of the instruction queue 301 is performed in aligned 4-byte units. When fetching instructions from memory, a minimum of 2 clocks (1 step) per 4 aligned bytes
It takes.

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

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

IFステージ201で検出するEITには、命令をメモ
リからフェッチする際のバスアクセス例外あるいはメモ
リ保護違反などによるアドレス変換例外がある。
EITs detected at the IF stage 201 include bus access exceptions when fetching instructions from memory, address translation exceptions due to memory protection violations, and the like.

(3,2,2) r命令デコードステージ」命令デコー
ドステージ(Dステージ)202はIFステージ201
から入力された命令コードをデコードする。デコードは
命令デコート部102のFHWデコーダ、N F I 
Wデコーダ及びアドレッシングモードデコーダを合わせ
た第1デコーダ303を使用して、2クロツク(1ステ
ツプ)単位に1度行ない、1回のデコード処理で、0〜
6バイトの命令コードを消費する(R[iT命令の復帰
先アドレスを含むステップコードの出力処理などでは命
令コードを消費しない)。1回のデコードでAステージ
203に対してアドレス計算情報としてのAコード21
3である制御コードとアドレス修飾情報と、オペレーシ
ョンコードの中間デコード結果としてのDコード212
である制御コードと8ビツトのリテラル情報とを出力す
る。
(3, 2, 2) r instruction decode stage” The instruction decode stage (D stage) 202 is the IF stage 201
Decodes the instruction code input from. Decoding is performed by the FHW decoder of the instruction decoding unit 102, NFI
Using the first decoder 303, which is a combination of a W decoder and an addressing mode decoder, decoding is performed once every two clocks (one step), and in one decoding process, 0 to
A 6-byte instruction code is consumed (the instruction code is not consumed in output processing of a step code including the return destination address of the R[iT instruction, etc.). A code 21 as address calculation information for A stage 203 with one decoding
3, the control code and address modification information, and the D code 212 as the intermediate decoding result of the operation code.
A control code and 8-bit literal information are output.

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

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

(3,2,3) rオペランドアドレス計算ステージ」
オペランドアドレス計算ステージ(へステージ)203
は処理機能が大きく2つに分かれる。1つは命令デコー
ド部102の第2デコーダ305を使用してオペレーシ
ョンコードの後段デコードを行う処理で、他方はオペラ
ンドアドレス計算部104でオペランドアドレスの計算
を行う処理である。
(3, 2, 3) r operand address calculation stage”
Operand address calculation stage (to stage) 203
The processing functions are broadly divided into two. One is a process in which the second decoder 305 of the instruction decoding unit 102 is used to decode the operation code at a later stage, and the other is a process in which the operand address calculation unit 104 calculates an operand address.

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

オペランドアドレス計算処理はAコード213を入力と
し、Aコード213に従いオペランドアドレス計算部1
04で加算あるいはメモリ間接参照を組合わせてアドレ
ス計算を行い、その計算結果をFコード215として出
力する。この際、アドレス計算に伴うレジスタ及びメモ
リの読出し時にコンマリフトチエツクを行い、先行命令
がレジスタあるいはメモリに書込み処理を終了していな
いためコンフリクトが指示されれば、先行命令がEステ
ージ205で書込み処理を終了するまで待つ。また、オ
ペランドアドレス及びメモリ間接参照のアドレスがメモ
リにマツプされたl108N域に入るか否かのチエツク
も行う。
The operand address calculation process takes the A code 213 as input, and operates the operand address calculation unit 1 according to the A code 213.
Address calculation is performed in combination with addition or memory indirect reference in step 04, and the calculation result is output as F code 215. At this time, a comma lift check is performed when reading registers and memory during address calculation, and if a conflict is indicated because the preceding instruction has not finished writing to the register or memory, the preceding instruction performs the writing process at E stage 205. Wait until it finishes. It also checks whether the operand address and the memory indirect reference address fall within the 1108N area mapped to memory.

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

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

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

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

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

Rコード214が奇数アドレスジャンプトラップを示し
ている場合、Rステージ206はそれをEコード216
によって伝える。これはブリブランチに対するもので、
Eステージ205ではそのEコード216で分岐が生じ
なければそのプリブランチを有効として奇数アドレスジ
ャンプトラップを発生する。
If R code 214 indicates an odd address jump trap, R stage 206 sends it to E code 216.
convey by. This is for Bribranch,
In the E stage 205, if a branch does not occur in the E code 216, the pre-branch is made valid and an odd address jump trap is generated.

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

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

叶ステージ207で検出されるBITには、バスアクセ
ス例外、アドレス変換例外、オペランドプリフェッチに
対するブレイクポイントヒントによるデバッグトラップ
がある。Fコード215がデバッグトラップ以外のBI
Tを示している時は、それをSコード217に転送し、
オペランドプリフェッチは行わない。Fコード215が
デバッグトラップを示している時は、そのFコード21
5に対してBITを示していない場合と同じ処理をする
と共にデバッグトラップをSコード217に伝える。
BITs detected in the leaf stage 207 include bus access exceptions, address translation exceptions, and debug traps based on breakpoint hints for operand prefetch. F code 215 is BI other than debug trap
When it shows T, transfer it to S code 217,
Operand prefetch is not performed. When F code 215 indicates a debug trap, the F code 21
5, performs the same processing as when no BIT is indicated, and also transmits a debug trap to the S code 217.

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

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

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

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

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

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

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

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

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

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

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

72はEステージ205のアドレスレジスタ(AA レ
ジスタ)、73は外部とやり取りされるデータのための
Eステージ205のデータレジスタ(DDレジスタ)、
75はAステージ203のアドレス加算部、8087は
内部データ演算部である。106はEステージ205の
データ演算部、90a〜90eはAステージ203でA
SP61が更新されたことを示すASP更新信号である
。91はAコード213中のASPインクリメント信号
、92はAコード213中のASPデクリメント信号で
ある。611,621,631,641は夫々ASP6
1 、へsp出力ラッチ62、FSP63 、FSP出
力ラッチ64の一部としてASP更新信号90aを転送
するラッチである。
72 is an address register (AA register) of the E stage 205; 73 is a data register (DD register) of the E stage 205 for data exchanged with the outside;
75 is an address addition section of the A stage 203, and 8087 is an internal data calculation section. 106 is a data calculation unit of the E stage 205, and 90a to 90e are A stages of the A stage 203.
This is an ASP update signal indicating that SP61 has been updated. 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 respectively ASP6
1, to sp output latch 62, FSP63, 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の処理を示す。
FIGS. 29 and 30 are diagrams showing processing regarding the stack pointer at each stage of several instructions executed in the data processing device of the present invention. (a) is A stage 203, (f) is F stage 204,
(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 pipeline processing when the step code following the instruction in FIG. 30 refers to the stack pointer and when it does not. ■ is the step code for the instruction to transfer "100" to the stack pointer, ■ is the step code processed next to ■, ■ is the step code processed next to ■, (a) is the A stage 203, (f ) is F stage 204, (
e) shows stack pointer processing in the E stage 205, and the horizontal axis shows the passage of time.

次に第28図を用いて、スタックポインタに関する処理
について説明する。Aコード213中には^5l)61
のインクリメント信号91、デクリメント信号92が含
まれており、この信号91.92はASP61の制御を
行う。またインクリメント信号91、デクリメント信号
92のORをとることによりASP更新信号90を生成
する。
Next, processing regarding the stack pointer will be explained using FIG. 28. A code 213 contains ^5l)61
An increment signal 91 and a decrement signal 92 are included, and these signals 91 and 92 control the ASP 61. Further, the ASP update signal 90 is generated by ORing the increment signal 91 and the decrement signal 92.

インクリメント信号91又はデクリメント信号92が′
1″のとき、つまりAステージ203でASP61を更
新したときにASP更新信号90aは“1″ となる。
The increment signal 91 or decrement signal 92 is
1", that is, when the ASP 61 is updated in the A stage 203, the ASP update signal 90a becomes "1".

そしてASP更新信号90aはスタックポインタの値と
共にパイプライン中のステップコードの流れに同期して
転送される。Eステージ205においては転送されてき
たASP更新信号90eが“l”のときのみC5P65
にFSP63の値を転送する。
The ASP update signal 90a is transferred together with the value of the stack pointer in synchronization with the flow of step codes in the pipeline. In the E stage 205, the C5P65 is used only when the transferred ASP update signal 90e is "L".
Transfer the FSP63 value to.

スタックブツシュ・アドレシッシングモードのオペラン
ド指定を含む命令、例えばレジスタの値をスタックトッ
プ(スタックポインタの値をデクリメントした値が指す
ところ)に書き込むNOV命令(MOV:Rn −> 
2−3P  Rnはn番のレジスタを表し、a−spは
スタックポインタをデクリメントした値が指すアドレス
を示す)を実行した場合の各ステージでのスタックポイ
ンタに関する処理を第29図に示す。まずDステージ2
02はASP610更新制御等を含むAコード213を
生成する。
Instructions that include operand specifications for stack addressing mode, such as the NOV instruction (MOV: Rn ->
FIG. 29 shows the processing regarding the stack pointer at each stage when 2-3P Rn represents the nth register and a-sp represents the address pointed to by the value obtained by decrementing the stack pointer. First, D stage 2
02 generates A code 213 including ASP610 update control and the like.

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

Fステージ204では、Rコード214よりレジスタア
クセス信号を含むEコード216を生成し、このEコー
ド216とオペランドアドレスの値を含むSコード21
7をEステージ205に転送する。また^SP更新信号
90eが“1′であることを検知して、FSP63の値
をCSI”65に転送する。先はどと同様C5P65に
すぐ転送できない場合は、FSP出力ラッチ64にて転
送可能になるまで待つ。
In the F stage 204, an E code 216 containing a register access signal is generated from the R code 214, and an S code 21 containing this E code 216 and the value of the operand address is generated.
7 is transferred to the E stage 205. It also detects that the ^SP update signal 90e is "1', and transfers the value of the FSP 63 to the CSI" 65. Similarly to the above, if the data cannot be transferred to the C5P65 immediately, the FSP output latch 64 waits until the data can be transferred.

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

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

次に例えば100”をスタックポインタに書き込む命令
(MOVE”100’−> SP ’100”は即値、
spはスタックポインタ)のスタックポインタに関する
処理を第30図に示す。
Next, for example, an instruction to write 100" to the stack pointer (MOVE"100'->SP '100' is an immediate value,
FIG. 30 shows processing related to the stack pointer (sp is the stack pointer).

この命令ではAステージ203での処理の際はへ5P6
1の(直は変化しない。i’5P63にこのASP61
の値が転送される。また後の命令がスタックポインタを
参照する場合に間違った値を参照しないように、スタッ
クポインタの値をEステージ205で書き換えることを
示すためにスタックポインタ書き込み予約を行う。この
ときはへsp更新信号90aは110#である。
In this instruction, when processing in A stage 203, go to 5P6
1 (Direct does not change. This ASP61 in i'5P63
The value of is transferred. In addition, a stack pointer write reservation is made to indicate that the value of the stack pointer will be rewritten in the E stage 205 so that a later instruction does not refer to an incorrect value when referencing the stack pointer. At this time, the HESP update signal 90a is 110#.

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

Eステージ205ではEコード216に基づいて即値デ
ータ”100″を読み出し、データ演算部106、DO
パス85を通して^5P61およびC3P65に転送す
る。
The E stage 205 reads immediate value data "100" based on the E code 216, and the data calculation unit 106, DO
Transfer to ^5P61 and C3P65 through path 85.

そして命令終了時にC3P65の値をsp群66に転送
する。
Then, at the end of the instruction, the value of C3P65 is transferred to sp group 66.

ここで、この命令の後のステップコードがアドレス計算
時にスタックポインタを使用する場合を第31図に示す
。このとき、次のステップコード■は、ステップコード
■でスタックポインタの書き込み予約が行われているた
め、ステップコード■がEステージ205で処理されて
スタックポインタに値が書き込まれスタックポインタ書
き込み予約が解除されるまでは、Aステージ203で処
理を中断して待っている。そしてステップコート■がE
ステージ205で処理されASP61が書き変わってか
ら、ステップコード■のAステージ203での処理を開
始する。ステップコード■ではFSP63の値をC3P
65に転送する。
FIG. 31 shows a case where the step code after this instruction uses a stack pointer when calculating an address. At this time, the next step code ■ is reserved for writing the stack pointer in the step code ■, so the step code ■ is processed at the E stage 205, a value is written to the stack pointer, and the stack pointer write reservation is released. Until this happens, the process is suspended at the A stage 203 and waits. And the step coat is E
After the process at stage 205 is performed and the ASP61 is rewritten, the process at stage A 203 of step code ■ is started. In step code ■, change the value of FSP63 to C3P
Transfer to 65.

一方、後のステップコードがスタックポインタを参照し
ない場合を第32図に示す。この詩人のステップコード
■はスタックボ・インクを参照しないので、Aステージ
203で待っている必要はなく、ステップコード■がA
ステージ203での処理を終えた時点でAステージ20
3での処理を開始する。
On the other hand, FIG. 32 shows a case where the subsequent step code does not refer to the stack pointer. This poet's step code ■ does not refer to stackbo ink, so there is no need to wait at A stage 203, and the step code ■ does not refer to stackbo ink.
A stage 20 occurs when the processing at stage 203 is completed.
Start the process in step 3.

このステップコード■に関してはASP61の値が、本
来その命令実行時に付随すべきスタックポインタの値と
は異なっている。しかしステップコード■ではASP更
新信号は“0”であり、FSP63の値はC3P65に
は書き込まれない。そのためステップコード■がEステ
ージ205で処理されるときには、正しいスタックポイ
ンタの値(ステップコート■でC3P65に書き込まれ
た値)がC5P65に入っている。そして命令終了時に
C5P65の値をソフトウェアからみたスタックポイン
タ66に書き込む。
Regarding this step code (3), the value of ASP61 is different from the value of the stack pointer that should originally accompany the execution of the instruction. However, in step code ■, the ASP update signal is "0", and the value of FSP63 is not written to C3P65. Therefore, when step code ■ is processed in the E stage 205, the correct stack pointer value (the value written to C3P65 in step code ■) is stored in C5P65. Then, at the end of the instruction, the value of C5P65 is written to the stack pointer 66 seen from the software.

また、ステップコード■もスタックポインタを使用しな
い場合は、ステップコード■がAステージ203での処
理を終わったらAステージ203での処理が開始される
。ステップコード■は■と同様、ASP更新信号90が
”0”であり、FSP63からC3P65への値の転送
は行われない。
Furthermore, if the step code ■ also does not use the stack pointer, the processing at the A stage 203 is started when the step code ■ finishes the processing at the A stage 203. In the step code ■, the ASP update signal 90 is "0" like ■, and no value is transferred from the FSP 63 to the C3P 65.

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

またEステージ205の処理でスタックポインタの値を
更新する場合には、スタックポインタ書き込み予約を行
う。そして次のステップコードがAステージ203でス
タックポインタを参照する場合、次のステップコードの
処理はAステージ203でスタックポインタ書き込み予
約が解除されるまで待っている。一方次のステップコー
ドがスタックポインタを参照しない場合は、Aステージ
203で待っている必要はなく各ステージでの処理を行
い、そのステップコードがEステージ205へ送られた
ときにFSP63からC3P65へのスタックポインタ
の値の転送を行わないようにする。こうしてC5P65
に誤った値を転送しないようにし、命令終了時に転送さ
れるソフトウェアからみたスタックポインタ66の値は
正しい値を保つ。
Furthermore, when updating the value of the stack pointer in the process of the E stage 205, a stack pointer write reservation is made. If the next step code refers to the stack pointer at the A stage 203, 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, there is no need to wait at the A stage 203, and the processing at each stage is performed, and when the step code is sent to the E stage 205, it is transferred from the FSP 63 to the C3P 65. Prevent stack pointer value transfer. Thus C5P65
The value of the stack pointer 66 seen from the software, which is transferred at the end of the instruction, maintains the correct value.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、アドレス計算ステー
ジがスタックポインタを持ち、実行ステージの管理する
スタックポインタへの値の転送を、アドレス計算ステー
ジが管理するスタックポインタをアドレス計算ステージ
が更新し7たかどうかにより制御することで、少ないハ
ードウェアで高速かつ正確な命令実行を行える効果があ
る。
As described above, according to the present invention, the address calculation stage has a stack pointer, and the address calculation stage updates the stack pointer managed by the address calculation stage to transfer a value to the stack pointer managed by the execution stage. By controlling based on whether or not the command is active, it is possible to execute instructions quickly and accurately using less hardware.

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

第1図は本発明の一実施例によるデータ処理装置の全体
ブロック図、第2図は本発明の一実施例によるデータ処
理装置のパイプライン概要図、第3図〜第27図は本発
明の一実施例によるデータ処理装置の命令フォーマット
の特徴を示す図、第28図は本発明の一実施例によるデ
ータ処理装置のスタックポインタ関連部分の構成図、第
29図、第30図は本発明のデータ処理装置において実
施されるいくつかの命令の実行フローチャート、第31
図。 第32図は第30図に示す命令の次のステップコードを
含めた実行フローチャート、第33図は従来例を示すブ
ロック図、第34図、第35図は従来のブツシュ命令の
実行フローチャートである。 203・・・アドレス計算ステージ(Aステージ)20
5・・・実行ステージ(Eステージ)212〜217・
・・パイプライン処理の単位であるステップコード  
61・・・Aステージ203の作業用ステージスタック
ポインタ(ASP)   63・・・Eステージ205
の作業用ステージスタックポインタ(C5P)75・・
・Aステージ203のアドレス加算部 90・・・Aス
テージ203でASPを更新することを示す^sp更新
信号 なお、 図中同一符号は、 同一、 または相当部分 を示ず。 代 理 人 大 岩 増 雄 く通しのビット番号〉 〈バイト毎のビット番号〉 〈アドレス〉 ←低アドレス ←MSB制 高アドレス→ LSB側→ →→命令を哀む方向→→ 図 BYTE: BYTE: BYTE: N+2−1 N+2−1 図 BYTE: N+2−1 BYTE; N+2 N+2+M−1 図 BYTE: N+2−1 BYTE : N+2−1 BYTE: N+2 N+2+1 N+2+2 N+2十M+2−1 図 BYTE: N+2−1 BYTE: N+4−1 図 BYTE: N+2−1 BYTE: N+2 N+2+1 N+2+2 −−−−−−  N+2+M+2−1図 BYTE: 図 図 図 図 (Sh) (Ea) ■= Eエコ 図 (Sh) (Ea) F匣コ 「エコ 図 図 図 図 図 図 図 図 図 図 (2バイト) (0〜4バイト) 図 手 続 補 正 書(自発) 昭和 6%11層・、8
FIG. 1 is an overall block diagram of a data processing device according to an embodiment of the present invention, FIG. 2 is a schematic diagram of a pipeline of a data processing device according to an embodiment of the present invention, and FIGS. FIG. 28 is a diagram showing the characteristics of the instruction format of a data processing device according to an embodiment of the present invention. FIG. 28 is a configuration diagram of a stack pointer-related portion of a data processing device according to an embodiment of the present invention. FIGS. Execution flowchart of several instructions executed in data processing device, No. 31
figure. FIG. 32 is an execution flowchart including the next step code of the instruction shown in FIG. 30, FIG. 33 is a block diagram showing a conventional example, and FIGS. 34 and 35 are execution flowcharts of a conventional bush instruction. 203... Address calculation stage (A stage) 20
5... Execution stage (E stage) 212-217.
・Step code which is the unit of pipeline processing
61... Working stage stack pointer (ASP) of A stage 203 63... E stage 205
Working stage stack pointer (C5P) 75...
-Address addition unit 90 of A stage 203...^sp update signal indicating that ASP is updated in A stage 203 Note that the same reference numerals in the figure do not indicate the same or equivalent parts. Bit number through agent Masuo Oiwa><Bit number for each byte><Address> ← Low address ← MSB system high address → LSB side → → → Direction of instruction → → Figure BYTE: BYTE: BYTE: N+2- 1 N+2-1 Figure BYTE: N+2-1 BYTE; N+2 N+2+M-1 Figure BYTE: N+2-1 BYTE : N+2-1 BYTE: N+2 N+2+1 N+2+2 N+20M+2-1 Figure BYTE: N+2-1 BYTE: N+4-1 Figure BY T.E. : N+2-1 BYTE: N+2 N+2+1 N+2+2 -------- N+2+M+2-1 Figure BYTE: Figure Figure Figure (Sh) (Ea) ■= E Eco Figure (Sh) (Ea) F Box "Eco Figure Figure Figures, figures, figures, figures (2 bytes) (0 to 4 bytes) Illustration procedure correction book (voluntary) Showa 6% 11 layers, 8

Claims (1)

【特許請求の範囲】 1、スタックポインタによって命令のオペランドを指定
すると同時に前記スタックポインタの更新方法を指定す
るアドレッシングモードを備え、第1のステージ及び第
2のステージで命令の処理をパイプライン処理によって
順次的に行うデータ処理装置において、 前記第1のステージで参照可能な第1のスタックポイン
タと、 前記第2のステージで参照可能な第2のスタックポイン
タと、 前記第1のステージで制御され、前記第1のスタックポ
インタを更新する第1の更新手段と、 前記第2のステージで制御され、前記第1のスタックポ
インタを更新する第2の更新手段と、 前記第2のステージで制御され、前記第2のスタックポ
インタを更新する第3の更新手段と、 前記第1のスタックポインタが前記第1の更新手段によ
り更新されたときのみパイプライン処理による命令の処
理と同期して前記第1のスタックポインタの値を前記第
2のスタックポインタに転送する転送手段と を備えたことを特徴とするデータ処理装置。
[Claims] 1. An addressing mode is provided for specifying an operand of an instruction using a stack pointer and at the same time specifying an update method for the stack pointer, and instruction processing is performed by pipeline processing in the first stage and the second stage. A data processing device that performs sequential processing, comprising: 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 second stack pointer that can be referenced in the second stage; a first updating means for updating the first stack pointer; a second updating means controlled by the second stage and updating the first stack pointer; controlled by the second stage; third updating means for updating the second stack pointer, and updating the first stack pointer in synchronization with instruction processing by pipeline processing only when the first stack pointer is updated by the first updating means A data processing device comprising: transfer means for transferring a value of a 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 true JPH0225934A (en) 1990-01-29
JPH0769802B2 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)

Citations (1)

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

Patent Citations (1)

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

Also Published As

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

Similar Documents

Publication Publication Date Title
US5717946A (en) Data processor
JPH0766324B2 (en) Data processing device
JPH02173823A (en) Data processor
JPH04109336A (en) Data processor
JP2507638B2 (en) Data processing device
JP2581236B2 (en) Data processing device
JPH0215331A (en) Data processor
JPH01214932A (en) Data processor
JPH0338725A (en) Data processor and microprocessor
JPH10232821A (en) Data processor
JPH0391029A (en) Data processor
US5212779A (en) System for guarantee reexecution after interruption by conditionally used store buffer if microinstruction being executed is a memory write and last microinstruction
JPH02105937A (en) Data processor
JP2504235B2 (en) Data processing device
JPH0225934A (en) Data processor
JPH04109338A (en) Priority encoder and data processor provided with the encoder
JP2522048B2 (en) Microprocessor and data processing device using the same
JPH0225932A (en) Data processor
JP2532560B2 (en) Data processing device for high-performance exception handling
JPH0290325A (en) Data processor
JPH0218621A (en) Data processor
JP2696578B2 (en) Data processing device
JPH0298734A (en) Data processor
JPH01214933A (en) Data processor
JPH01222332A (en) Data processor having pipe line processing mechanism