[go: up one dir, main page]

JPH09101888A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH09101888A
JPH09101888A JP25772595A JP25772595A JPH09101888A JP H09101888 A JPH09101888 A JP H09101888A JP 25772595 A JP25772595 A JP 25772595A JP 25772595 A JP25772595 A JP 25772595A JP H09101888 A JPH09101888 A JP H09101888A
Authority
JP
Japan
Prior art keywords
bus
microprocessor
branch
program counter
data bus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP25772595A
Other languages
Japanese (ja)
Inventor
Hiroshi Hayakawa
浩史 早川
Harutsugu Fukumoto
晴継 福本
Hiroaki Tanaka
裕章 田中
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP25772595A priority Critical patent/JPH09101888A/en
Priority to US08/725,709 priority patent/US6003127A/en
Publication of JPH09101888A publication Critical patent/JPH09101888A/en
Priority to US09/429,022 priority patent/US6308263B1/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PROBLEM TO BE SOLVED: To increase response speed for a branch instruction and exception processing. SOLUTION: A data bus 6-9 and bidirectional switches 5-7, 5-8 for setting up an immediate value in a program counter 2-3 directly from a decoder 1 without passing a data bus 6-6 to an operation part 2-1 are added to a microprocessor for executing exception processing by the use of a branch instruction and an internal vector. The microprocessor is also provided with a data bus 6-10 and a switch 5-9 for setting up a register value in the counter 2-3 directly from a register file 2-2 without passing the data bus 6-6 of the operation part 2-1. Consequently the branched address of an immediate branch instruction is set up in the counter 2-3 directly from the decoder 1 through the data bus 6-9 and that of a register direct branch instruction is set up in the counter 2-3 directly from the register file 2-2 through the data bus 6-10.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロプロセッ
サにおいて分岐命令と内部べクタにより実施される例外
処理の応答速度の高速化技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for speeding up the response speed of exception handling executed by a branch instruction and an internal vector in a microprocessor.

【0002】[0002]

【従来の技術】従来、マイクロプロセッサにおける命令
アドレス演算には、通常命令における命令アドレスとの
一定値演算と、分岐命令などの不定値演算とがある。一
般に通常命令はIF(命令読み出し)ステージで、また
分岐命令などはEX(演算)ステージで命令アドレス計
算を行う。分岐命令の中にはプログラムカウンタ相対分
岐、イミディエート分岐、レジスタ直接分岐などのアド
レッシングモードがある。プログラムカウンタ相対分岐
はEXステージでプログラムカウンタと相対値との演算
をする。一方、イミデイエート分岐とレジスタ直接分岐
は、分岐アドレスは絶対値であるため、EXステージで
絶対値をプログラムカウンタにセットする処理を行って
いる(「H8/327,SH7032プログラミングマ
ニュアル,RISCシステム:海文堂」)。
2. Description of the Related Art Conventionally, instruction address arithmetic in a microprocessor includes constant value arithmetic with an instruction address in a normal instruction and indefinite value arithmetic such as a branch instruction. Generally, a normal instruction is calculated at the IF (instruction read) stage, and a branch instruction or the like is calculated at the EX (operation) stage. Among branch instructions, there are addressing modes such as program counter relative branch, immediate branch, and register direct branch. The program counter relative branch calculates the program counter and the relative value in the EX stage. On the other hand, in the immediate branch and the register direct branch, since the branch address is an absolute value, processing is performed to set the absolute value in the program counter at the EX stage (“H8 / 327, SH7032 programming manual, RISC system: Kaibundou”). ).

【0003】こうした従来技術の例として、5段パイプ
ライン処理を採用したマイクロプロセッサについて述べ
る。5つのステージはそれぞれIF(命令読み出し)、
ID(命令解読)、EX(演算)、MA(メモリアクセ
ス)、WB(ライトバック)に分割されており、通常の
パイプラインステージの流れは図5の様になる。
As an example of such a conventional technique, a microprocessor adopting 5-stage pipeline processing will be described. The five stages are IF (instruction read),
It is divided into ID (instruction decoding), EX (operation), MA (memory access), and WB (write back), and the normal pipeline stage flow is as shown in FIG.

【0004】従来例のマイクロプロセッサの構成は、図
6に示す様に、デコーダ1とデータパス2とから構成さ
れる。データパス2は、論理演算,算術演算,シフト演
算等を行う演算部2−1と、演算結果を格納するレジス
タファイル2−2と、現在のプログラムのアドレスをカ
ウントするプログラムカウンタ2−3と、演算部2−1
またはプログラムカウンタ2−3からアドレスバス4へ
の出力切り替えを行うアドレスユニット2−4を備えて
いる。演算部2−1〜アドレスユニット2−4は、それ
ぞれ、デコーダ1からの制御バス7−1〜7−4によっ
て制御される様になっている。
As shown in FIG. 6, the conventional microprocessor has a decoder 1 and a data path 2. The data path 2 includes an arithmetic unit 2-1 that performs logical operation, arithmetic operation, shift operation, etc., a register file 2-2 that stores the operation result, a program counter 2-3 that counts the address of the current program, Calculation unit 2-1
Alternatively, an address unit 2-4 for switching the output from the program counter 2-3 to the address bus 4 is provided. The arithmetic units 2-1 to address units 2-4 are controlled by the control buses 7-1 to 7-4 from the decoder 1, respectively.

【0005】そして、マイクロプロセッサは、アドレス
バス4介してデータを出力することによりメモリ(図示
せず)中のアドレスを指定し、当該アドレスに格納され
ている命令をデータバス3を経由してメモリから読み込
み、この命令をデコーダ1で解読し、データパス2に対
する制御を行っている。
Then, the microprocessor specifies an address in a memory (not shown) by outputting data via the address bus 4, and the instruction stored at the address is stored in the memory via the data bus 3. The decoder 1 decodes this instruction to control the data path 2.

【0006】また、デコーダ1から演算部2−1へはイ
ミディエートバス6−1が設けられ、レジスタファイル
2−2からデータを読み出すリードバス6−2,6−4
と、演算部2−1への入力バス6−3,6−5と、演算
部2−1の演算結果の出力バス6−7と、プログラムカ
ウンタ2−3からのリードバス6−7と、アドレスユニ
ット2−4への入力バス6−8とを備え、図示の通り、
双方向スイッチ5−1〜5−6にて前述のバス6−1,
6−2,6−4,6−5,6−6,6−7を切り替える
様に構成されている。
Further, an immediate bus 6-1 is provided from the decoder 1 to the arithmetic unit 2-1, and read buses 6-2 and 6-4 for reading data from the register file 2-2.
An input bus 6-3, 6-5 to the arithmetic unit 2-1; an output bus 6-7 for the arithmetic result of the arithmetic unit 2-1; a read bus 6-7 from the program counter 2-3; An input bus 6-8 to the address unit 2-4 is provided, and as shown in the figure,
In the bidirectional switches 5-1 to 5-6, the above-mentioned bus 6-1 and
6-2, 6-4, 6-5, 6-6, 6-7 are configured to be switched.

【0007】IF〜WBの各ステージと、データパス2
中の各ユニット2−1〜2−4の動作タイミングとの対
応は、次の通りである。即ち、IFステージ時はプログ
ラムカウンタユニット2−3が、IDステージ時は制御
部(デコーダ1)とレジスタファイル2−2が、EXス
テージ時は演算部2−1が、MAステージ時はアドレス
ユニット2−4が、WBステージ時はレジスタファイル
2−2がそれぞれ動作する。
Each stage of IF to WB and data path 2
Correspondence with the operation timings of the respective units 2-1 to 2-4 is as follows. That is, the program counter unit 2-3 at the IF stage, the control unit (decoder 1) and the register file 2-2 at the ID stage, the arithmetic unit 2-1 at the EX stage, and the address unit 2 at the MA stage. -4, and the register file 2-2 operates during the WB stage.

【0008】この従来のマイクロプロセッサにおけるイ
ミデイエート分岐は、図7のようなパイプラインステー
ジの流れとなっている。即ち、デコーダ1で解読された
分岐先アドレスは、これに続くEXステージ301にお
いてイミディエートバス6−1から演算部2−1に入
り、出力バス6−6を経由してプログラムカウンタ2−
3にセットされる。
Immediate branching in this conventional microprocessor has a pipeline stage flow as shown in FIG. That is, the branch destination address decoded by the decoder 1 enters the arithmetic unit 2-1 from the immediate bus 6-1 in the subsequent EX stage 301, and passes through the output bus 6-6 to the program counter 2-.
Set to 3.

【0009】同じく、この従来のマイクロプロセッサに
おけるレジスタ直接分岐は、分岐先アドレスをレジスタ
ファイル2−2から読み出し、バス6−4,6−5を通
つて演算部2−1に入力し、演算部2−1からバス6−
6を経由してプログラムカウンタ2−3にセットするよ
うに構成されている。
Similarly, in the register direct branch in the conventional microprocessor, the branch destination address is read from the register file 2-2 and is input to the arithmetic unit 2-1 through the buses 6-4 and 6-5. 2-1 to Bus 6-
6 is set in the program counter 2-3 via 6.

【0010】[0010]

【発明が解決しようとする課題】このように、従来のマ
イクロプロセッサでは、分岐命令や例外処理に対する応
答は、必ず演算部2−1を経由してプログラムカウンタ
2−3にアドレスをセットするように構成されているた
め、処理ステージで見ると、必ずEXステージを経なけ
ればならず、処理速度が遅くなるという問題があった。
As described above, in the conventional microprocessor, the response to the branch instruction or the exception processing must always set the address in the program counter 2-3 via the operation unit 2-1. Since it is configured, there is a problem in that the processing speed must be slowed when viewed from the processing stage without fail.

【0011】そこで、本発明は、分岐命令及び例外処理
の応答速度を高速化することを目的とする。
Therefore, an object of the present invention is to speed up the response speed of branch instructions and exception handling.

【0012】[0012]

【課題を解決するための手段】かかる目的を達成するた
め、本発明は、演算部の出力バスを経ることなく、デコ
ーダからプログラムカウンタにイミデイエート値を直接
セットするためのバスと、該バスと前記出力バスとを切
り替えるスイッチとを備え、あるいは、同じく演算部の
出力バスを経ることなく、レジスタファイルからプログ
ラムカウンタにレジスタ値を直接セットするためのバス
と、該バスと前記出力バスとを切り替えるスイッチとを
備えることを特徴とする。
In order to achieve the above object, the present invention provides a bus for directly setting an immediate value from a decoder to a program counter without passing through an output bus of an arithmetic unit, and the bus and the above-mentioned bus. A switch for switching between the output bus and the output bus, or a bus for setting a register value directly from the register file to the program counter without passing through the output bus of the arithmetic unit, and a switch for switching the bus and the output bus. And is provided.

【0013】前者の構成によれば、イミデイエート分岐
を行う場合、出力バスをクローズにし、デコーダからの
直接セット用に追加したバスをオープンにすることによ
り、演算部を経由することなくデコーダから直接、プロ
グラムカウンタに対して分岐先アドレスをセットするこ
とができる。
According to the former configuration, when the immediate branch is performed, the output bus is closed and the bus added for direct setting from the decoder is opened, so that the decoder can directly output the signal without passing through the arithmetic unit. The branch destination address can be set in the program counter.

【0014】また、後者の構成によれば、レジスタ直接
分岐を行う場合、出力バスをクローズにし、レジスタか
らの直接セット用に追加したバスをオープンにすること
により、演算部を経由することなくレジスタから直接、
プログラムカウンタに対して分岐先アドレスをセットす
ることができる。
Further, according to the latter configuration, when the register direct branch is performed, the output bus is closed and the bus added for direct setting from the register is opened so that the register is not passed through the arithmetic unit. Directly from
The branch destination address can be set in the program counter.

【0015】このようにして、本発明では、EXステー
ジの前のステージで分岐先アドレスをセットできるた
め、分岐命令及び例外処理に対する応答速度の高速化を
実現することが可能になる。また、プログラムリセット
時にも、EXステージを経ることなくIDステージで初
期値をセットすることができ、初期値不定の状態が短く
なるという効果もある。
In this way, according to the present invention, since the branch destination address can be set in the stage before the EX stage, the response speed to the branch instruction and the exception processing can be increased. Further, even when the program is reset, the initial value can be set in the ID stage without passing through the EX stage, and there is an effect that the state in which the initial value is indefinite becomes short.

【0016】[0016]

【発明の実施の形態】次に、発明の実施の形態を説明す
る。 [実施の形態1]図1は発明の実施の形態の一例を示す
マイクロプロセッサのブロック図である。このマイクロ
プロセッサは、イミディエート分岐に対する高速化を実
現するためのものである。
BEST MODE FOR CARRYING OUT THE INVENTION Next, embodiments of the present invention will be described. [First Embodiment] FIG. 1 is a block diagram of a microprocessor showing an example of an embodiment of the present invention. This microprocessor is for realizing speeding up for immediate branching.

【0017】このマイクロプロセッサは、図6の従来例
と比較すると分かる様に、デコーダ1からプログラムカ
ウンタ2−3へのイミディエート値直接セット用として
双方スイッチ5−7を備えたイミディエートバス6−9
を追加すると共に、出力バス6−6中に新たな双方向ス
イッチ5−8を設ける点で回路構成を異にするものであ
る。
As can be seen from comparison with the conventional example shown in FIG. 6, this microprocessor has an immediate bus 6-9 having both switches 5-7 for directly setting the immediate value from the decoder 1 to the program counter 2-3.
And the addition of a new bidirectional switch 5-8 in the output bus 6-6.

【0018】このマイクロプロセッサにおけるイミディ
エート分岐の際のパイプラインの流れは図2に示す様に
なる。即ち、イミデイエート分岐命令がIFステージ5
00でフェッチされると、この命令は、IDステージ5
01においてデコーダ1で解読されると同時にイミディ
エートバス6−9を経由してプログラムカウンタ2−3
に直接セットされる。よって、次のEXステージを実行
しなくてよいので、n+2番目の処理サイクルにて直ち
に分岐先アドレスからの命令をフェッチし、処理を開始
できる。なお、このとき、スイッチ5−7をオープンに
すると共に、スイッチ5−8をクローズにし、プログラ
ムカウンタ2−3へのデータの入力バスを切り替えてお
く。
The flow of the pipeline at the time of immediate branch in this microprocessor is as shown in FIG. That is, the immediate branch instruction is the IF stage 5
When fetched at 00, this instruction returns ID stage 5
At the same time, the program counter 2-3 is decoded by the decoder 1 at 01, and at the same time via the immediate bus 6-9.
Is set directly to. Therefore, since it is not necessary to execute the next EX stage, the instruction from the branch destination address can be immediately fetched and the processing can be started in the (n + 2) th processing cycle. At this time, the switch 5-7 is opened and the switch 5-8 is closed to switch the data input bus to the program counter 2-3.

【0019】こうして、この実施の形態1によれば、イ
ミデイエート分岐の高速化が可能となる。 [実施の形態2]図3は発明の実施の形態の他の一例を
示すマイクロプロセッサのブロック図である。このマイ
クロプロセッサは、レジスタ直接分岐に対する高速化を
実現するためのものである。
Thus, according to the first embodiment, the speed of immediate branching can be increased. [Second Embodiment] FIG. 3 is a block diagram of a microprocessor showing another example of the embodiment of the present invention. This microprocessor is for realizing a high speed for the direct branch of the register.

【0020】このマイクロプロセッサは、図6の従来例
と比較すると分かる様に、まず、実施の形態1と同様
に、演算部2−1からの出力バス6−6中に双方向スイ
ッチ5−8を追加している点で相違している。また、入
力バス6−5中の双方向スイッチ5−4と演算部2−1
との間の点と、出力バス6−6中の双方向スイッチ5−
8とプログラムカウンタ2−3の間の点とを結ぶ様に新
たに直接セット用のバス6−9を追加している。そし
て、この新たに追加したバス6−10には双方向スイッ
チ5−9を設ける。
As can be seen by comparing this microprocessor with the conventional example of FIG. 6, first, as in the first embodiment, the bidirectional switch 5-8 is provided in the output bus 6-6 from the arithmetic unit 2-1. The difference is that is added. In addition, the bidirectional switch 5-4 in the input bus 6-5 and the arithmetic unit 2-1.
Bidirectional switch 5-6 in the output bus 6-6.
8 and a bus 6-9 for direct setting is newly added so as to connect the point between the counter 8 and the program counter 2-3. A bidirectional switch 5-9 is provided on the newly added bus 6-10.

【0021】レジスタ直接分岐処理を行う場合は、双方
向スイッチ5−3及び5−9をオープンにし、双方向ス
イッチ5−8をクローズにする。これにより、レジスタ
ファイル内のデータが新たに追加した直接セット用のバ
ス6−10を経由してプログラムカウンタ2−3へ直接
セットされる。従って、この場合も、実施の形態1で説
明したと同様に、演算部2−1を経由しないので、EX
ステージの前ステージで分岐先アドレスのセットが完了
し、直ちに分岐処理を開始できる。
When register direct branch processing is performed, the bidirectional switches 5-3 and 5-9 are opened and the bidirectional switch 5-8 is closed. As a result, the data in the register file is directly set to the program counter 2-3 via the newly added bus 6-10 for direct setting. Therefore, also in this case, as in the case of the first embodiment, since the calculation unit 2-1 is not used, EX
The branch address can be set immediately after the setting of the branch destination address is completed in the stage before the stage.

【0022】こうして、この実施の形態2によれば、ア
ドレス直接分岐の高速化が可能となる。 [実施の形態3]なお、図4に示すように、実施の形態
1と実施の形態2を組み合わせてやれば、イミディエー
ト分岐及びレジスタ直接分岐の両方について高速化され
たマイクロプロセッサを得ることもでき、この場合、上
述した各実施の形態1,2のそれぞれの効果をどちらも
達成することができる。
Thus, according to the second embodiment, it is possible to accelerate the address direct branching. [Third Embodiment] As shown in FIG. 4, by combining the first and second embodiments, it is possible to obtain a high-speed microprocessor for both immediate branch and register direct branch. In this case, both of the effects of the first and second embodiments described above can be achieved.

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

【図1】 発明の実施の形態1におけるマイクロプロセ
ッサの全体構成を示すブロック図である。
FIG. 1 is a block diagram showing an overall configuration of a microprocessor according to a first embodiment of the invention.

【図2】 発明の実施の形態1におけるイミディエート
分岐の場合のパイプライン処理の動作を示す模式図であ
る。
FIG. 2 is a schematic diagram showing an operation of pipeline processing in the case of immediate branching according to the first embodiment of the present invention.

【図3】 発明の実施の形態2におけるマイクロプロセ
ッサの全体構成を示すブロック図である。
FIG. 3 is a block diagram showing an overall configuration of a microprocessor according to a second embodiment of the invention.

【図4】 発明の実施の形態3におけるマイクロプロセ
ッサの全体構成を示すブロック図である。
FIG. 4 is a block diagram showing an overall configuration of a microprocessor according to a third embodiment of the invention.

【図5】 従来例におけるパイプライン処理の動作を示
す模式図である。
FIG. 5 is a schematic diagram showing an operation of pipeline processing in a conventional example.

【図6】 従来例におけるマイクロプロセッサの全体構
成を示すブロック図である。
FIG. 6 is a block diagram showing an overall configuration of a conventional microprocessor.

【図7】 従来例におけるパイプライン処理の動作を示
す模式図である。
FIG. 7 is a schematic diagram showing an operation of pipeline processing in a conventional example.

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

1・・・デコーダ、2・・・データパス、2−1・・・
演算部、2−2・・・レジスタファイル、2−3・・・
プログラムカウンタ、2−4・・・アドレスユニット、
3・・・データバス、4・・・アドレスバス、5−1〜
5−9・・・双方向スイッチ、6−1〜6−10・・・
バス、7−1〜7−4・・・制御バス。
1 ... Decoder, 2 ... Data path, 2-1 ...
Calculation unit, 2-2 ... Register file, 2-3 ...
Program counter, 2-4 ... Address unit,
3 ... Data bus, 4 ... Address bus, 5-1 to 5-1
5-9 ... Bidirectional switch, 6-1 to 6-10 ...
Bus, 7-1 to 7-4 ... Control bus.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 分岐命令と内部ベクタによる例外処理を
行うマイクロプロセッサにおいて、 演算部の出力バスを経ることなく、デコーダからプログ
ラムカウンタにイミデイエート値を直接セットするため
のバスと、該バスと前記出力バスとを切り替えるスイッ
チとを備えることを特徴とするマイクロプロセッサ。
1. A microprocessor for performing exception processing by a branch instruction and an internal vector, a bus for directly setting an immediate value from a decoder to a program counter without passing through an output bus of an arithmetic unit, the bus and the output. A microprocessor having a switch for switching between a bus and the bus.
【請求項2】 分岐命令と内部ベクタによる例外処理を
行うマイクロプロセッサにおいて、 演算部の出力バスを経ることなく、レジスタファイルか
らプログラムカウンタにレジスタ値を直接セットするた
めのバスと、該バスと前記出力バスとを切り替えるスイ
ッチとを備えることを特徴とするマイクロプロセッサ。
2. A microprocessor for performing exception processing by a branch instruction and an internal vector, a bus for directly setting a register value from a register file to a program counter without passing through an output bus of an arithmetic unit, the bus and the bus. A microprocessor comprising a switch for switching between an output bus and the output bus.
JP25772595A 1995-10-04 1995-10-04 Microprocessor Pending JPH09101888A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP25772595A JPH09101888A (en) 1995-10-04 1995-10-04 Microprocessor
US08/725,709 US6003127A (en) 1995-10-04 1996-10-04 Pipeline processing apparatus for reducing delays in the performance of processing operations
US09/429,022 US6308263B1 (en) 1995-10-04 1999-10-29 Pipeline processing apparatus for reducing delays in the performance of processing operations

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25772595A JPH09101888A (en) 1995-10-04 1995-10-04 Microprocessor

Publications (1)

Publication Number Publication Date
JPH09101888A true JPH09101888A (en) 1997-04-15

Family

ID=17310237

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25772595A Pending JPH09101888A (en) 1995-10-04 1995-10-04 Microprocessor

Country Status (1)

Country Link
JP (1) JPH09101888A (en)

Similar Documents

Publication Publication Date Title
JPH09237184A (en) Instruction executing method and its device
US6308263B1 (en) Pipeline processing apparatus for reducing delays in the performance of processing operations
JPH09101888A (en) Microprocessor
JPH0218729B2 (en)
JP2564054B2 (en) Register file
JPH1091441A (en) Program execution method and apparatus using the method
JPS6265133A (en) Instruction prefetching device
JPH0324624A (en) Miroprocessor
JP3164915B2 (en) Data processing device and data processing method
JPH04359323A (en) Microcomputer
US6266764B1 (en) Program controller for switching between first program and second program
JPH0651984A (en) Microprocessor
JP2944563B2 (en) Pipeline type information processing device
JPH0793151A (en) Instruction supplying device
JP2924735B2 (en) Pipeline operation device and decoder device
JPH0517574B2 (en)
JPH05241825A (en) Microprocessor
JP2820078B2 (en) Instruction decoding method
JP2005134987A (en) Pipeline processing unit
JPH11327929A (en) Program control unit
JPH0855033A (en) Information processor
JP2004062427A (en) Microprocessor
JPH05197543A (en) Instruction decoding system of information processor
JPH02137028A (en) Command control method
JPS6269354A (en) Information processing system