JP3493110B2 - High-speed branch processing unit - Google Patents

High-speed branch processing unit

Info

Publication number
JP3493110B2
JP3493110B2 JP01564297A JP1564297A JP3493110B2 JP 3493110 B2 JP3493110 B2 JP 3493110B2 JP 01564297 A JP01564297 A JP 01564297A JP 1564297 A JP1564297 A JP 1564297A JP 3493110 B2 JP3493110 B2 JP 3493110B2
Authority
JP
Japan
Prior art keywords
instruction
instructions
branch
read
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP01564297A
Other languages
Japanese (ja)
Other versions
JPH10214187A (en
Inventor
美次 荒木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP01564297A priority Critical patent/JP3493110B2/en
Publication of JPH10214187A publication Critical patent/JPH10214187A/en
Application granted granted Critical
Publication of JP3493110B2 publication Critical patent/JP3493110B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、動作周波数の向上
を可能とする高速分岐処理装置に関する。
TECHNICAL FIELD The present invention relates to an improvement in operating frequency.
The present invention relates to a high-speed branch processing device that enables

【0002】[0002]

【従来の技術】近年、マルチメディア時代の到来と共
に、MPEG(Moving Picture ExpertsGroup)処理な
どに代表されるような動画処理において画像の実時間処
理が非常に重要となってきている。このような動画処理
は画像データを取り扱う関係上、処理すべきデータが莫
大であり、このため、マイクロプロセッサには非常に大
きな処理能力が要求される。さらに、処理のすべてをハ
ードウェアで行うとコストの増大が避けられず、そのた
め、できれば処理の一部、若しくは、全ての処理を汎用
のマイクロプロセッサを用いてソフトウェア処理した方
が望ましく、従って、益々マイクロプロセッサの処理能
力の向上が望まれる状況にある。また、PDA(Person
al Digital Assistance )などの携帯機器においても同
様に高速処理が要求されているが、これらの機器におい
てはさらに消費電力の削減も重要である。
2. Description of the Related Art In recent years, with the advent of the multimedia era, real-time image processing has become very important in moving image processing represented by MPEG (Moving Picture Experts Group) processing. Since such moving image processing deals with image data, the amount of data to be processed is enormous, and therefore, a very large processing capability is required for the microprocessor. Further, if all the processing is performed by hardware, an increase in cost is unavoidable. Therefore, if possible, it is desirable to perform some or all of the processing by software using a general-purpose microprocessor, and therefore, more and more. There is a situation where it is desired to improve the processing capability of the microprocessor. In addition, PDA (Person
Similarly, high-speed processing is required for mobile devices such as al Digital Assistance), but it is also important to reduce power consumption in these devices.

【0003】マイクロプロセッサの処理能力を決める重
要な要因には、大別して、動作周波数、実行命令数及び
一命令当たりのサイクル数の3つがある。例えば、動作
周波数は、一般には、システムのクリティカルパス(cr
itical path )の遅延時間により決まるが、マイクロプ
ロセッサでは、特に、条件分岐命令実行時の条件成立時
における命令フェッチがクリティカルパスとなる場合が
多い。
There are roughly three important factors that determine the processing capability of a microprocessor: the operating frequency, the number of executed instructions, and the number of cycles per instruction. For example, the operating frequency is typically determined by the critical path (cr
It is determined by the delay time of itical path), but in microprocessors, instruction fetch is often a critical path, especially when the condition is met during execution of a conditional branch instruction.

【0004】ここで、代表的なRISC(Reduced Inst
ruction Set Computer)プロセッサであるMIPS C
omp.Systems,Inc.のR3000を例に
して上記命令フェッチがクリティカルパスとなる場合に
ついて説明する。
Here, a typical RISC (Reduced Inst
ruction set computer) MIPS C which is a processor
omp. Systems, Inc. A case where the above instruction fetch becomes a critical path will be described by taking R3000 of FIG.

【0005】条件分岐命令実行時の条件成立時における
命令フェッチは、条件分岐命令(bne、beqなど)
の演算ステージでレジスタの比較を行い、比較結果が確
定した後に命令メモリから分岐先アドレスに対する命令
を読み出し、命令レジスタに取り込むことにより行われ
るが、この処理が同一サイクル内で実行されるためにク
リティカルパスとなる場合が多いのである。以下、上記
命令フェッチにおけるデータ及び制御信号の流れについ
て図面を用いて説明する。
The instruction fetch when the condition is satisfied when the conditional branch instruction is executed is a conditional branch instruction (bne, beq, etc.).
It is performed by comparing the registers at the operation stage of, and after the comparison result is confirmed, reading the instruction for the branch destination address from the instruction memory and fetching it into the instruction register, but this processing is executed in the same cycle, so it is critical. It is often a pass. The flow of data and control signals in the above instruction fetch will be described below with reference to the drawings.

【0006】図11は、従来の分岐処理装置のブロック
図である。この分岐処理装置は命令実行時間を短縮する
技法であるパイプライン方式を用いたものであり、現在
実行中の命令のアドレスを格納するプログラムカウンタ
1と、命令を格納する命令メモリ3と、命令メモリ3か
ら読み出された命令が取り込まれる命令レジスタ5と、
命令レジスタ5にセットされた命令をデコードし、各種
制御信号を生成する命令デコーダ7と、加算器9と、加
算器9が出力する分岐先アドレスを取り込む分岐先アド
レスレジスタ11と、条件分岐命令の比較対象である内
容を格納する複数のレジスタ(図示省略)から成るレジ
スタファイル13と、ALU(Arithmetic and Logic U
nit ;算術論理演算装置)15と、ALU15の入力レ
ジスタ17a及び17bと、セレクタ19とから構成さ
れている。
FIG. 11 is a block diagram of a conventional branch processing device. This branch processing device uses a pipeline method, which is a technique for reducing instruction execution time, and includes a program counter 1 for storing an address of an instruction currently being executed, an instruction memory 3 for storing an instruction, and an instruction memory. An instruction register 5 in which the instruction read from 3 is fetched,
An instruction decoder 7 that decodes the instruction set in the instruction register 5 to generate various control signals, an adder 9, a branch destination address register 11 that captures the branch destination address output from the adder 9, and a conditional branch instruction A register file 13 including a plurality of registers (not shown) for storing contents to be compared, and an ALU (Arithmetic and Logic U)
nit; arithmetic and logic unit 15), input registers 17a and 17b of the ALU 15, and a selector 19.

【0007】このような構成である従来の分岐処理装置
は、まず、Fステージ(フェッチステージ)において、
命令メモリ3から命令(条件分岐命令)が読み出され、
命令レジスタ5に取り込まれる。
In the conventional branch processing device having such a configuration, first, in the F stage (fetch stage),
An instruction (conditional branch instruction) is read from the instruction memory 3,
It is taken into the instruction register 5.

【0008】次に、Dステージ(デコードステージ)に
おいて、命令レジスタ5中の命令を命令デコーダ7でデ
コードし、アドレス計算を行うための各制御信号を出力
する。命令中に指定されているindex値とプログラ
ムカウンタ1に格納されたアドレスを加算器9により加
算することにより分岐先アドレスが求められ、分岐先ア
ドレスレジスタ11に取り込まれる。また、同時に、命
令デコーダ7から与えられる制御信号によりレジスタフ
ァイル13から比較対象である2つのレジスタに格納さ
れた値がALU15の入力レジスタ17A及び17Bに
取り込まれる。
Next, in the D stage (decode stage), the instruction in the instruction register 5 is decoded by the instruction decoder 7 and each control signal for performing address calculation is output. The branch destination address is obtained by adding the index value specified in the instruction and the address stored in the program counter 1 by the adder 9, and the branch destination address is stored in the branch destination address register 11. At the same time, the values stored in the two registers to be compared are fetched from the register file 13 into the input registers 17A and 17B of the ALU 15 by the control signal given from the instruction decoder 7.

【0009】次に、Eステージ(実行ステージ)におい
て、ALU15は、入力レジスタ17A及び17Bに格
納された2つの値を入力し、演算結果を得る。この演算
結果は分岐判定の制御信号となり、分岐が成立しない場
合の命令メモリ3の読み出しアドレスであるプログラム
カウンタ1の示すアドレスと、分岐が成立した場合の命
令メモリ3の読み出しアドレスである分岐先アドレスレ
ジスタ11に格納された分岐先アドレスのいずれか一方
が、制御信号である演算結果に基づきセレクタ19を通
して選択される。ここで、分岐が成立した場合には、命
令メモリ3の分岐先アドレスにアクセスされ、分岐先の
命令が読み出され、上記と同様に命令レジスタ5に格納
される。
Next, in the E stage (execution stage), the ALU 15 inputs the two values stored in the input registers 17A and 17B and obtains the operation result. The result of this operation becomes a control signal for branch determination, and the address indicated by the program counter 1 which is the read address of the instruction memory 3 when the branch is not taken and the branch destination address which is the read address of the instruction memory 3 when the branch is taken One of the branch destination addresses stored in the register 11 is selected through the selector 19 based on the operation result which is the control signal. If the branch is taken, the branch destination address of the instruction memory 3 is accessed, the branch destination instruction is read out, and stored in the instruction register 5 in the same manner as described above.

【0010】以上説明したように、従来の分岐処理装置
では、条件分岐命令が実行される場合、同一サイクル内
で分岐判定のためのALU演算と分岐が成立した場合に
おける分岐先の命令のキャッシュ読み出しの処理とを直
列に行う必要があるため、このパスの遅延が大きく、ク
リティカルパスとなる場合が多い。従って、条件分岐命
令実行時において、分岐が成立した場合の命令フェッチ
がネックとなり、動作周波数を上げることが非常に難し
かった。
As described above, in the conventional branch processing device, when a conditional branch instruction is executed, an ALU operation for branch determination in the same cycle and a cache read of a branch destination instruction when the branch is taken. Since it is necessary to perform the processing of 1 and 3 in series, the delay of this path is large and it often becomes a critical path. Therefore, when executing a conditional branch instruction, the instruction fetch when the branch is taken becomes a bottleneck, and it is very difficult to raise the operating frequency.

【0011】[0011]

【発明が解決しようとする課題】上述したように、従来
の分岐処理装置では、同一サイクル内で分岐判定、それ
に続いて、分岐先のアドレスに対する命令をフェッチを
しなければならないようなパイプライン構成をとってい
た場合、このパスがクリティカルパスとなり、マイクロ
プロセッサ全体としての動作周波数を十分に上げること
ができなかった。
As described above, in the conventional branch processing device, the pipeline structure is such that the branch judgment must be made in the same cycle, and subsequently the instruction to the branch destination address must be fetched. If this is the case, this path becomes a critical path, and the operating frequency of the microprocessor as a whole cannot be raised sufficiently.

【0012】 本発明は上記事情に鑑みて成されたもの
であり、その目的は、動作周波数の向上を可能とし、さ
らに、消費電力の削減をも実現することができる高速分
岐処理装置を提供することにある。
The present invention has been made in view of the above circumstances.
And its purpose is to enable an increase in operating frequency,
In addition, high-speed components that can also reduce power consumption
The purpose is to provide a processing unit.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するため
に、本発明の第1の特徴は、命令を記憶する命令メモリ
と、前記命令メモリへのアドレスを保持するプログラム
カウンタと、前記命令メモリから読み出されてデコード
される命令を格納する命令レジスタとを備えた高速分岐
処理装置において、前記命令メモリからアドレスが連続
する所定の数の命令を一度に読み出す読み出し制御手段
と、前記読み出し制御手段により前記命令メモリから読
み出された複数個の命令を一時的に記憶する2つの命令
バッファと、前記2つの命令バッファのうちいずれか一
方を選択し、さらに選択された命令バッファに記憶され
た複数個の命令のうちいずれか1個の命令を選択し、該
命令を前記命令レジスタに出力する命令バッファ選択手
段とを有し、前記プログラムカウンタにより前記複数個
の命令の先頭アドレスが指定されると、その第1の複数
個の命令を前記読み出し制御手段が前記命令メモリから
読み出し、前記第1の複数個の命令を前記2つの命令バ
ッファのうち最後のアクセス時点の古い方に記憶し、前
記命令バッファ選択手段が前記第1の複数個の命令をア
ドレス順に前記命令レジスタに出力、デコードされた
命令が条件分岐命令である場合には条件分岐判定が終了
する前にその分岐先アドレスを含む連続するアドレスの
第2の複数個の命令を前記読み出し制御手段が前記命令
メモリから読み出し、前記第2の複数個の命令を前記2
つの命令バッファのうち最後のアクセス時点の古い方に
記憶し、前記命令バッファ選択手段が前記第2の複数個
の命令をアドレス順に前記命令レジスタに出力すると共
に、命令メモリに格納された命令のアドレス配置は、第
1の複数個の命令の読み出しと第2の複数個の命令の読
み出しとが一致しないものとなっている高速分岐処理装
置であることを要旨とする
In order to achieve the above object, a first feature of the present invention is to provide an instruction memory for storing instructions, a program counter for holding an address to the instruction memory, and the instruction memory. In a high-speed branch processing device including an instruction register for storing an instruction read from and decoded from the instruction memory, a read control means for reading a predetermined number of instructions with consecutive addresses from the instruction memory at once, and the read control means. Two instruction buffers for temporarily storing a plurality of instructions read from the instruction memory, and one of the two instruction buffers selected, and a plurality of instruction buffers stored in the selected instruction buffer. An instruction buffer selecting unit for selecting any one of the instructions and outputting the instruction to the instruction register, When the start address of said plurality of instructions by program counter is specified, reads a first plurality of instructions that from said read control means said instruction memory, said first plurality of instructions of the two instructions when stored towards old last access time of the buffer, the instruction buffer selecting means is output to the instruction register to the first plurality of instructions in the address order, the decoded instruction is a conditional branch instruction Is the address of consecutive addresses including the branch destination address before the conditional branch judgment is completed.
The read control means reads a second plurality of instructions from the instruction memory, and the second plurality of instructions is read by the second controller.
One of the stores in the older of the last access time of the instruction buffer, co if the instruction buffer selection means outputs to the instruction register to the second plurality of instruction address order
The address allocation of the instruction stored in the instruction memory is
Read multiple instructions of 1 and read multiple instructions of 2
A high-speed branch processing device whose protrusion does not match
The main point is that it is a table .

【0014】上記構成によれば、クリティカルパスとな
る場合の多い条件分岐命令における分岐成立時の分岐先
アドレスのフェッチ処理をコストの上昇を招くことなく
高速化を図ることができる。従って、マイクロプロセッ
サの動作周波数を向上させることができる。
According to the above configuration, the fetch processing of the branch destination address when the branch is taken in the conditional branch instruction which often becomes the critical path can be speeded up without increasing the cost. Therefore, the operating frequency of the microprocessor can be improved.

【0015】[0015]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面を用いて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings.

【0016】ここで、本実施の形態に係る高速分岐処理
装置は、基本的には次に示す5段(5ステージ)パイプ
ラインの構成を有し、例えばMIPS Comp.Sy
stems,Inc.のR3000のような一般的なR
ISCプロセッサにて用いられるパイプライン構成であ
る。
Here, the high-speed branch processing device according to the present embodiment basically has the following five-stage (five-stage) pipeline configuration, for example, MIPS Comp. Sy
stems, Inc. General R such as R3000
This is a pipeline configuration used in the ISC processor.

【0017】(1)Fステージ(フェッチステージ):
命令をメモリ(キャッシュ)からフェッチして命令レジ
スタにセットする命令を入力するステージである。 (2)Dステージ(デコードステージ):命令レジスタ
上の命令をデコードし、各制御信号を生成するステージ
である。 (3)Eステージ(実行ステージ):演算を実行する。
またはメモリ(キャッシュ)に対するアクセスのアドレ
スを生成するステージである。 (4)Mステージ(メモリステージ):メモリ(キャッ
シュ)に対するアクセスを行うステージである。 (5)WBステージ(ライトバックステージ):レジス
タへのデータの書き込みを行うステージである。
(1) F stage (fetch stage):
This is a stage for inputting an instruction that fetches the instruction from the memory (cache) and sets it in the instruction register. (2) D stage (decode stage): This stage decodes the instruction on the instruction register and generates each control signal. (3) E stage (execution stage): executes an operation.
Alternatively, it is a stage for generating an address for access to the memory (cache). (4) M stage (memory stage): This is a stage for accessing the memory (cache). (5) WB stage (write back stage): a stage for writing data to the register.

【0018】第1の実施の形態 図1は、本実施の形態に係る高速分岐処理装置のブロッ
ク図である。図1において、本実施の形態に係る高速分
岐処理装置は現在実行中の命令のアドレスを格納するプ
ログラムカウンタ1と、命令を格納する命令メモリ3
と、命令メモリ3から読み出された命令が取り込まれる
命令レジスタ5と、命令レジスタ5にセットされた命令
をデコードし、各種制御信号を生成する命令デコーダ7
と、加算器9と、加算器9が出力する分岐先アドレスを
取り込む分岐先アドレスレジスタ11と、条件分岐命令
の比較対象である内容を格納する複数のレジスタ(図示
省略)から成るレジスタファイル13と、ALU(Arit
hmetic and Logic Unit ;算術論理演算装置)15と、
ALU15の入力レジスタ17a及び17bと、プログ
ラムカウンタ1の示すアドレスと分岐先アドレスレジス
タ11に格納された分岐先アドレスのどちらか一方を選
択するセレクタ19と、命令メモリ3から読み出された
連続する複数の命令を取り込む命令バッファ21A及び
21Bと、命令バッファ21A及び21Bに取り込まれ
た複数の命令のうち一つを選択するセレクタ23A及び
23Bと、セレクタ23A及び23Bにより選択された
2つの命令のうちどちらか一方を選択するセレクタ25
と、セレクタ25の制御を行う制御回路27と、命令デ
コーダ7から出力される分岐命令フラグを取り込む分岐
命令フラグレジスタ29とから構成されている。
First Embodiment FIG. 1 is a block diagram of a high-speed branch processing device according to this embodiment. In FIG. 1, a high-speed branch processing device according to the present embodiment has a program counter 1 for storing the address of an instruction currently being executed and an instruction memory 3 for storing the instruction.
And an instruction register 5 for fetching the instruction read from the instruction memory 3, and an instruction decoder 7 for decoding the instruction set in the instruction register 5 and generating various control signals.
A register file 13 including an adder 9, a branch destination address register 11 for fetching a branch destination address output from the adder 9, and a plurality of registers (not shown) for storing contents to be compared with the conditional branch instruction. , ALU (Arit
hmetic and Logic Unit) 15 and
Input registers 17a and 17b of the ALU 15, a selector 19 for selecting one of the address indicated by the program counter 1 and the branch destination address stored in the branch destination address register 11, and a plurality of consecutive memory read from the instruction memory 3. Of the two instructions selected by the selectors 23A and 23B, the instruction buffers 21A and 21B for fetching the instruction of, the selectors 23A and 23B for selecting one of the plurality of instructions fetched in the instruction buffers 21A and 21B, and Selector 25 for selecting either
And a branch instruction flag register 29 for fetching a branch instruction flag output from the instruction decoder 7, and a control circuit 27 for controlling the selector 25.

【0019】ここで、命令メモリ3から命令バッファ2
1A及び命令バッファ21Bへの命令の取り込みはLR
U(Least Recently Used )方式により実行される。L
RU方式は、命令バッファ21Aと21Bのうち最後の
取り込み時点の古い方のバッファに命令を取り込む方式
である。
Here, from the instruction memory 3 to the instruction buffer 2
1A and instruction buffer 21B fetches instructions by LR
It is executed by the U (Least Recently Used) method. L
The RU method is a method of fetching an instruction in the older one of the instruction buffers 21A and 21B at the time of the last fetch.

【0020】次に、本実施の形態に係る高速分岐処理装
置の動作について説明する。まず最初に、図1に示す命
令メモリ3の読み出しについて図2を用いて説明する。
図2は、図1に示す命令メモリ3の読み出し動作を示す
概念図であり、読み出し信号がEnable状態の時に、指定
されたアドレスを含む連続したアドレスの複数個の命令
が一度に読み出される。一度に読み出される命令の数は
任意であるが、例えば、図2においては4個である。
Next, the operation of the high-speed branch processing device according to this embodiment will be described. First, reading of the instruction memory 3 shown in FIG. 1 will be described with reference to FIG.
FIG. 2 is a conceptual diagram showing the read operation of the instruction memory 3 shown in FIG. 1, and when the read signal is in the Enable state, a plurality of instructions at consecutive addresses including the designated address are read at once. The number of instructions read at one time is arbitrary, but is four in FIG. 2, for example.

【0021】読み出し信号がEnable状態となるのは2つ
の場合があり、一つは図1のプログラムカウンタ1に格
納されたアドレスが一度に読み出される複数個の命令の
アドレス境界に来た場合、他の一つは分岐命令による分
岐先アドレスの命令をフェッチする場合である。
There are two cases where the read signal is in the Enable state. One is when the address stored in the program counter 1 of FIG. 1 comes to the address boundary of a plurality of instructions which are read at a time, and the other. One is when fetching an instruction at a branch destination address by a branch instruction.

【0022】プログラムカウンタ1のアドレスが一度に
読み出される複数個の命令のアドレス境界に来た場合と
は、例えば、図3(a)に示すような命令列に分岐命令
がない命令シーケンスにおいて、プログラムカウンタ1
のアドレスが「80008000」を示すと、読み出し
信号がEnable状態となり、アドレスが「8000800
0」、「80008004」、「80008008」、
「8000800c」である4個の命令が一度に読み出
される。その後パイプラインが進み、プログラムカウン
タ1のアドレスが「80008010」を示すと、再
度、読み出し信号がEnable状態となり、アドレスが「8
0008010」、「80008014」、「8000
8018」、「8000801c」である4個の命令が
同様に一度に読み出される。このように、命令メモリ3
への読み出しはプログラムカウンタ1のアドレスが一度
に読み出される4個の命令のアドレス境界に来た時に行
なわれるので、命令メモリ3へのアクセスは従来と比べ
て減少する。
When the address of the program counter 1 reaches the address boundary of a plurality of instructions which are read at once, for example, in the instruction sequence in which there is no branch instruction in the instruction sequence as shown in FIG. Counter 1
When the address of "8008000" indicates that the read signal is in the Enable state, the address is "8000800".
0 "," 80008004 "," 800008008 ",
Four instructions of "8000800c" are read at one time. After that, when the pipeline progresses and the address of the program counter 1 indicates "80008010", the read signal becomes the enable state again and the address becomes "8.
"0008010", "80008014", "8000
Similarly, four instructions “8018” and “8000801c” are read at once. In this way, the instruction memory 3
The access to the instruction memory 3 is reduced as compared with the conventional case because the address of the program counter 1 is read at the address boundary of four instructions which are read at once.

【0023】一方、分岐命令による分岐先アドレスの命
令をフェッチする場合とは、例えば、次のような場合で
ある。図3(b)に示すような命令列に分岐命令がある
命令のシーケンスにおいて、プログラムカウンタ1のア
ドレスが「80008000」を示すと、図3(a)と
同様読み出し信号がEnable状態となり、アドレスが「8
0008000」、「80008004」、「8000
8008」、「8000800c」の4個の命令が一度
に読み出される。この時、読み出された命令に分岐命令
(アドレスが「80008004」の命令)があるとそ
の分岐命令が実行され分岐先の命令(図中targetで示す
アドレスが「80008104」の命令)が読み出され
るが、この場合にも読み出し信号がEnable状態となるの
である。また、その分岐先の命令が図3(a)に示すよ
うな上述したアドレス境界にない場合にはアドレスが
「80008104」である分岐先命令を含む4個の命
令、つまり、アドレス「80008100」、「800
08104」、「80008108」、「800081
c」の4個の命令が一度に読み出される。このように分
岐先命令のアドレスを先頭アドレスとして連続するアド
レスが「80008104」、「80008108」、
「800081c」、「80008200」の4個の命
令ではなく、分岐先命令を含むアドレスが「80008
100」、「80008104」、「8000810
8」、「800081c」の4個の命令を一度に読み出
すのは、それにより命令メモリ3のimplement
を容易にすることができるからである。
On the other hand, the case of fetching the instruction of the branch destination address by the branch instruction is, for example, the following case. When the address of the program counter 1 indicates "8008000" in the sequence of instructions having a branch instruction in the instruction sequence as shown in FIG. 3B, the read signal is in the enable state as in FIG. "8
00080000 "," 80008004 "," 8000
Four instructions "8008" and "8000800c" are read at one time. At this time, if the read instruction includes a branch instruction (instruction with address “80008004”), the branch instruction is executed and the branch destination instruction (instruction with address “800008104” indicated by target in the figure) is read. However, even in this case, the read signal is in the Enable state. Further, when the instruction of the branch destination is not on the above-mentioned address boundary as shown in FIG. 3A, four instructions including the branch destination instruction whose address is “800008104”, that is, the address “80008100”, "800
08104 "," 80008108 "," 800081 "
Four instructions of "c" are read at one time. In this way, consecutive addresses with the address of the branch destination instruction as the start address are “800008104”, “800008108”,
Instead of the four instructions “80081c” and “80008200”, the address including the branch destination instruction is “80008c”.
100 "," 80008104 "," 80000810 "
The four instructions “8” and “80081c” are read at a time because the instruction of the instruction memory 3 is implemented.
This can be facilitated.

【0024】次に、本実施の形態に係る高速分岐処理装
置における条件分岐命令のフェッチ、条件分岐命令実
行、そして、分岐先の命令がフェッチされるまでのデー
タ及び制御信号の流れについて図1を参照しつつ説明す
る。ここで、前提条件として、現在、プログラムカウン
タ1は、一度に読み出される4個の命令の先頭アドレス
を示しているものとし、かつ、その先頭アドレスに格納
されている命令は条件分岐命令であるとする。但し、先
行する2つ前の命令は分岐命令でないとする。また、仮
想アドレスと物理アドレスは同じものとしているが、仮
にアドレス変換が必要であったとしても本願発明の内容
が変わることはない。
Next, FIG. 1 shows the flow of data and control signals until the instruction of the conditional branch instruction is fetched, the conditional branch instruction is executed, and the instruction at the branch destination is fetched in the high-speed branch processing apparatus according to the present embodiment. The description will be made with reference. Here, as a precondition, it is assumed that the program counter 1 currently indicates the head addresses of four instructions read at one time, and the instructions stored at the head addresses are conditional branch instructions. To do. However, it is assumed that the preceding two instructions are not branch instructions. Further, although the virtual address and the physical address are the same, the contents of the present invention do not change even if address conversion is required.

【0025】まず最初に、Fステージ(フェッチステー
ジ)において、プログラムカウンタ1が示すアドレスと
分岐先アドレスレジスタ11に格納された分岐先アドレ
スとがセレクタ19にそれぞれ入力され制御信号aによ
りどちらか一方が選択される。制御信号aは、先行命
令、すなわち、Eステージ(実行ステージ)にある命令
が分岐命令であるか否かを示す信号であり、セレクタ1
9は制御信号aが先行命令は分岐命令であると示す場合
には分岐先アドレスレジスタ11に格納された分岐先ア
ドレスを選択し、分岐命令ではないと示す場合にはプロ
グラムカウンタ1が示すアドレスを選択する。ここで
は、上述した前提条件により先行する2つの命令は分岐
命令ではないとしているので、制御信号aにより命令メ
モリ3にはその読み出しアドレスとしてプログラムカウ
ンタ1が示すアドレスが入力される。さらに、そのアド
レスは前提条件によりアドレス境界の先頭アドレスであ
ることから、命令メモリ3の読み出し信号はEnable状態
となり、プログラムカウンタ1の示すアドレスに続く4
個の命令が命令メモリ3から読み出される。命令メモリ
3から読み出された4個の命令は命令バッファ21Aま
たは21Bに取り込まれる。読み出された命令を取り込
む命令バッファの選択は上述したLRU方式により実行
される。例えば、命令バッファ21Aの前サイクルにお
いて最後の取り込みのほうが古い場合には、命令バッフ
ァ21Aに入力される取り込み信号cがEnable状態、命
令バッファ21Bに入力される取り込み信号dがDisabl
e 状態となり、その結果、読み出された命令は命令バッ
ファ21Aに取り込まれることになる。
First, in the F stage (fetch stage), the address indicated by the program counter 1 and the branch destination address stored in the branch destination address register 11 are input to the selector 19 and either one of them is controlled by the control signal a. To be selected. The control signal a is a signal indicating whether or not the preceding instruction, that is, the instruction at the E stage (execution stage) is a branch instruction.
Reference numeral 9 selects the branch destination address stored in the branch destination address register 11 when the control signal a indicates that the preceding instruction is a branch instruction, and selects the address indicated by the program counter 1 when it indicates that it is not a branch instruction. select. Here, since the preceding two instructions are not branch instructions according to the above-mentioned preconditions, the address indicated by the program counter 1 is input to the instruction memory 3 by the control signal a as the read address. Further, since that address is the start address of the address boundary according to the precondition, the read signal of the instruction memory 3 is in the Enable state, and it follows the address indicated by the program counter 4
Instructions are read from the instruction memory 3. The four instructions read from the instruction memory 3 are loaded into the instruction buffer 21A or 21B. The selection of the instruction buffer for fetching the read instruction is executed by the above-mentioned LRU method. For example, if the last fetch in the previous cycle of the instruction buffer 21A is older, the fetch signal c input to the instruction buffer 21A is in the Enable state, and the fetch signal d input to the instruction buffer 21B is Disabl.
The state becomes e, and as a result, the read instruction is taken into the instruction buffer 21A.

【0026】そして、命令バッファ21Aに格納されて
いる4個の命令はセレクタ23Aに、命令バッファ21
Bに格納されている4個の命令はセレクタ23Bにそれ
ぞれ入力され、制御信号e及びfにより指定されたアド
レスの命令が1個選択される。各セレクタにより選択さ
れた2個の命令はセレクタ25に出力される。セレクタ
25は制御回路27から出力される制御信号gにより2
個の命令のうちどちらか一方を選択し、命令レジスタ5
に出力する。制御回路27は、Eステージ(実行ステー
ジ)におけるALU回路15の演算結果である条件分岐
判定信号hと、Eステージ(実行ステージ)の命令が分
岐命令であることを示す制御信号aと、命令バッファ2
1A、21Bのうちどちらの最後の取り込み命令が古い
かを示す制御信号iとを入力し、Eステージ(実行ステ
ージ)の命令が非分岐命令であるかもしくは、分岐命令
で分岐成立と判定された場合には、2つの命令バッファ
うち取り込みが現サイクルにおいて新しい方のバッファ
を選択し、Eステージ(実行ステージ)の命令が分岐命
令で非分岐と判定された場合には、現サイクルにおいて
古い方のバッファを選択する制御信号gを生成してセレ
クタ25に出力する。ここでは、前提条件としてEステ
ージ(実行ステージ)には分岐命令がないことを仮定し
ているので、その結果、現サイクルにおいて最後の取り
込みが新しい方である命令バッファ21Aから出力され
る命令がセレクタ25により選択され、命令レジスタ5
に取り込まれる。
Then, the four instructions stored in the instruction buffer 21A are sent to the selector 23A and the instruction buffer 21
The four instructions stored in B are input to the selector 23B, and one instruction at the address specified by the control signals e and f is selected. The two instructions selected by each selector are output to the selector 25. The selector 25 outputs 2 according to the control signal g output from the control circuit 27.
Instruction register 5
Output to. The control circuit 27 receives a conditional branch determination signal h, which is the operation result of the ALU circuit 15 in the E stage (execution stage), a control signal a indicating that the instruction in the E stage (execution stage) is a branch instruction, and an instruction buffer. Two
A control signal i indicating which one of 1A and 21B is the last fetched instruction is input, and it is determined that the instruction at the E stage (execution stage) is a non-branch instruction or the branch instruction is a branch taken instruction. In this case, of the two instruction buffers, fetching selects the newer buffer in the current cycle, and when the E stage (execution stage) instruction is determined to be a non-branch by a branch instruction, the oldest one in the current cycle is selected. A control signal g for selecting a buffer is generated and output to the selector 25. Since it is assumed here that there is no branch instruction in the E stage (execution stage) as a precondition, as a result, the instruction output from the instruction buffer 21A whose fetch is the latest in the current cycle is the selector. 25, the instruction register 5
Is taken into.

【0027】次に、Dステージ(デコードステージ)に
おいて、命令レジスタ5に取り込まれている命令を命令
デコーダ7がデコードし、各種制御信号を生成する。命
令デコーダ7は命令中のindex値を加算器9に出力
し、加算器9はそのindex値とプログラムカウンタ
1の示すアドレスを加算し、分岐先アドレスを決定す
る。分岐先アドレスは分岐先アドレスレジスタ11に取
り込まれ、同時に、当該命令が分岐命令であることを示
す分岐命令フラグが分岐命令フラグレジスタ29に取り
込まれる。一方、命令デコーダ7は次のEステージ(実
行ステージ)で条件分岐判定をするためにレジスタファ
イル13に制御信号jを入力する。レジスタファイル1
3は該当する2組のレジスタの値を読み出し、ALU1
5の入力レジスタ17A及び17Bに格納する。
Next, in the D stage (decode stage), the instruction decoder 7 decodes the instruction stored in the instruction register 5 to generate various control signals. The instruction decoder 7 outputs the index value in the instruction to the adder 9, and the adder 9 adds the index value and the address indicated by the program counter 1 to determine the branch destination address. The branch destination address is fetched in the branch destination address register 11, and at the same time, the branch instruction flag indicating that the instruction is a branch instruction is fetched in the branch instruction flag register 29. On the other hand, the instruction decoder 7 inputs the control signal j to the register file 13 to make a conditional branch decision at the next E stage (execution stage). Register file 1
3 reads the values of the corresponding two sets of registers, and ALU1
5 in the input registers 17A and 17B.

【0028】次に、Eステージ(実行ステージ)におい
て、ALU15において演算が実行され、演算結果hが
出力される。ここで、本発明の特徴はこの演算が行われ
ている時に同時に次に示す処理を行う点にあり、以下続
けて説明する。
Next, in the E stage (execution stage), the arithmetic operation is executed in the ALU 15, and the arithmetic result h is output. Here, the feature of the present invention resides in that the following processing is performed at the same time when this calculation is performed, and will be continuously described below.

【0029】上述したように命令デコーダ7は入力され
た命令が分岐命令であることを示す分岐命令フラグをレ
ジスタ29に出力するが、この分岐命令フラグを受けて
命令メモリ3の読み出し信号bはEnable状態となる。す
なわち、図7に示す従来技術では、Eステージ(実行ス
テージ)におけるALU15の演算が終了するのを待
ち、その演算結果に基づき分岐成立時のみこの読み出し
信号をEnable状態としていたが、本実施の形態では、E
ステージ(実行ステージ)の命令が分岐命令である場合
には分岐の成立・非成立にかかわらず読み出し信号bは
Enable状態となる。従って、ALU15による演算の終
了を待つことなく分岐先アドレスの命令が読み出される
ことになる。一方、分岐先アドレスレジスタ11に取り
込まれた分岐先アドレスとプログラムカウンタの示すア
ドレスは共に上記セレクタ19に入力され、分岐命令フ
ラグレジスタ29に格納された分岐命令フラグに基づき
制御信号aにより分岐先アドレスが選択され、命令メモ
リ3に出力される。従って、この分岐先アドレスが命令
メモリ3に対する読み出しアドレスとなる。そして、分
岐先アドレスを含む連続する4個の命令が命令メモリ3
から読み出される。命令メモリ3から読み出された4個
の命令は命令バッファ21Aまたは21Bに取り込まれ
る。読み出された命令を取り込む命令バッファの選択は
上述したLRU方式により実行される。命令バッファ2
1Bの方が前サイクルにおける最後の取り込みが古い場
合には、命令バッファ21Bに入力される取り込み信号
がEnable状態、命令バッファ21Aに入力される取り込
み信号がDisable 状態となり、その結果、読み出された
命令は命令バッファ21Bに取り込まれることになる。
As described above, the instruction decoder 7 outputs a branch instruction flag indicating that the input instruction is a branch instruction to the register 29. In response to this branch instruction flag, the read signal b of the instruction memory 3 is enabled. It becomes a state. That is, in the conventional technique shown in FIG. 7, the read signal is enabled only when the branch is taken based on the result of the operation, waiting for the completion of the operation of the ALU 15 in the E stage (execution stage). Then E
When the stage (execution stage) instruction is a branch instruction, the read signal b is
It will be in the Enable state. Therefore, the instruction at the branch destination address is read without waiting for the completion of the operation by the ALU 15. On the other hand, the branch destination address fetched in the branch destination address register 11 and the address indicated by the program counter are both input to the selector 19, and the branch destination address is set by the control signal a based on the branch instruction flag stored in the branch instruction flag register 29. Is selected and output to the instruction memory 3. Therefore, this branch destination address becomes the read address for the instruction memory 3. Then, four consecutive instructions including the branch destination address are stored in the instruction memory 3
Read from. The four instructions read from the instruction memory 3 are loaded into the instruction buffer 21A or 21B. The selection of the instruction buffer for fetching the read instruction is executed by the above-mentioned LRU method. Instruction buffer 2
When the last fetch in the previous cycle is older in 1B, the fetch signal input to the instruction buffer 21B is in the Enable state and the fetch signal input to the instruction buffer 21A is in the Disable state, and as a result, it is read. The instruction will be fetched into the instruction buffer 21B.

【0030】 そして、命令バッファ21Aに格納され
た4個の命令はセレクタ23Aに、命令バッファ21B
に格納された4個の命令はセレクタ23Bにそれぞれ入
力され、制御信号e及びfにより指定されたアドレスの
命令が1個選択される。各セレクタにより選択された2
個の命令はセレクタ25に出力される。セレクタ25は
制御回路27から出力される制御信号gにより2個の命
令のうちどちらか一方を選択し、命令レジスタ5に出力
する。ここで、条件分岐が成立する場合には、制御回路
27は2つの命令バッファのうち取り込みが新しい方の
バッファを選択する制御信号gを生成するので、分岐先
の命令が選択され命令レジスタ5に出力される。
Then, the four instructions stored in the instruction buffer 21A are stored in the selector 23A and stored in the instruction buffer 21B.
The four instructions stored in are input to the selector 23B, and one instruction at the address specified by the control signals e and f is selected. 2 selected by each selector
This instruction is output to the selector 25. The selector 25 selects one of the two instructions according to the control signal g output from the control circuit 27 and outputs it to the instruction register 5. Here, if the conditional branch is established, the control circuit
27 generates a control signal g for selecting the buffer of the two instruction buffers that has been fetched later, so that the branch destination instruction is selected and output to the instruction register 5.

【0031】このように、従来では、Eステージ(実行
ステージ)における分岐判定のためのALU演算の終了
を持ち、その演算結果により分岐成立と判定された後に
行われていた条件分岐命令の条件判定成立時のおける分
岐先アドレスの命令フェッチを、本実施の形態によれ
ば、Dステージ(デコードステージ)の命令が条件分岐
命令である場合には次のEステージ(実行ステージ)に
おけるALU演算の結果を待つことなく独立に実行し、
条件判定成立・非成立にかかわらず分岐先アドレスの命
令を命令メモリ3から読み出すようにしているので、A
LU演算がかかる命令メモリ読み出し処理に隠れるた
め、分岐先の命令のフェッチを高速に行うことが可能と
なる。従って、マイクロプロセッサにおいて、クリティ
カルパスとなりがちな条件分岐命令による分岐成立時の
分岐先命令のフェッチをコストの上昇を招くことなく高
速に実行することができるようになる。それにより、マ
イクロプロセッサの動作周波数を向上することができ
る。
As described above, conventionally, the condition judgment of the conditional branch instruction is made after the ALU operation for branch judgment at the E stage (execution stage) is completed and the branch is judged from the result of the operation. According to the present embodiment, when the instruction at the branch destination address when taken is satisfied, the result of the ALU operation at the next E stage (execution stage) when the instruction at the D stage (decode stage) is a conditional branch instruction. Run independently without waiting for
The instruction at the branch destination address is read from the instruction memory 3 regardless of whether the condition determination is satisfied or not satisfied.
Since the LU operation is hidden by the instruction memory reading process, the instruction at the branch destination can be fetched at high speed. Therefore, in the microprocessor, the fetching of the branch destination instruction when the branch is taken by the conditional branch instruction that tends to become the critical path can be executed at high speed without increasing the cost. Thereby, the operating frequency of the microprocessor can be improved.

【0032】ここで、図4は、分岐先命令のフェッチの
動作を示すタイミングチャートであり、(a)が図11
に示す従来の分岐処理装置の動作を示すものであり、
(b)が図1に示す本実施の形態に係る分岐処理装置の
動作を示すものである。図4(a)に示すように、従来
分岐処理装置では、時刻t1 〜t2 においてALU15
による演算、時刻t2 〜t3 においてセレクタ19によ
る選択、時刻t3 〜t4 において命令メモリ3からの命
令の読み出し、時刻t4 〜t5 において命令レジスタ5
への命令の取り込みが順次行われている。一方、図4
(b)に示すように、本実施の形態に係る分岐処理装置
では、時刻T1 〜T2 において命令メモリ3からの命令
の読み出し、時刻T2 〜T3 においてセレクタ25によ
る選択、時刻T3 〜T4 において命令レジスタ5への命
令の取り込みは順次行われているが、ALU15による
演算(図中Aで示す期間)は命令メモリ3からの命令の
読み出しが行われる期間中に実行され、見かけ上命令メ
モリ3からの命令の読み出しに隠れている。従って、図
4(a)及び(b)から明らかなように、本実施の形態
のほうが動作周波数を高くすることが可能である。
Here, FIG. 4 is a timing chart showing the fetch operation of the branch destination instruction, and FIG.
The operation of the conventional branch processing device shown in
FIG. 3B shows the operation of the branch processing device according to the present embodiment shown in FIG. As shown in FIG. 4A, in the conventional branch processing device, the ALU 15 is operated at times t 1 to t 2 .
Instruction register operation, selected by the selector 19 at time t 2 ~t 3, read instructions from the instruction memory 3 at time t 3 ~t 4, at time t 4 ~t 5 by 5
Commands are being sequentially fetched into. On the other hand, FIG.
(B), the branched processing apparatus according to this embodiment, the time T 1 through T reading of instructions from the instruction memory 3 in 2, selected by the selector 25 at time T 2 through T 3, time T 3 Although instructions are sequentially fetched into the instruction register 5 at T 4 to T 4 , the operation by the ALU 15 (the period indicated by A in the figure) is executed during the period in which the instructions are read from the instruction memory 3 and is apparent. It is hidden in the reading of the instruction from the upper instruction memory 3. Therefore, as apparent from FIGS. 4A and 4B, the operating frequency can be increased in this embodiment.

【0033】第2の実施の形態 本実施の形態に係る高速分岐処理装置は、図1に示す命
令メモリ3に格納された条件分岐命令を、命令メモリ3
の読み出し信号がEnable状態となる2つの場合、すなわ
ち、図1のプログラムカウンタ1に格納されたアドレス
が一度に読み出される複数個の命令のアドレス境界に来
た場合と分岐命令による分岐先アドレスの命令をフェッ
チする場合とが一致しないようなアドレスに配置した構
成としたものである。
Second Embodiment A high-speed branch processing device according to the present embodiment stores the conditional branch instruction stored in the instruction memory 3 shown in FIG.
In the two cases in which the read signal is in the Enable state, that is, when the address stored in the program counter 1 in FIG. 1 comes to the address boundary of a plurality of instructions to be read at once, and the instruction of the branch destination address by the branch instruction. Are arranged at addresses that do not match when fetching.

【0034】命令メモリ3に格納される実行プログラム
の命令の配置を上記構成とすることにより、第1の実施
の形態では発生する、アドレス境界による読み出しと分
岐命令実行による読み出しとの競合を回避することがで
きる。従って、ハードウェアコストの上昇を招くことな
く、高速な分岐処理を実現することができる。
By arranging the instructions of the execution program stored in the instruction memory 3 as described above, the conflict between the read by the address boundary and the read by the branch instruction execution which occurs in the first embodiment is avoided. be able to. Therefore, high-speed branch processing can be realized without increasing the hardware cost.

【0035】というのは、図5(a)に示すように分岐
命令(図中branchで示すアドレス「80008008」
の命令)が一度に読み出される複数個の命令のアドレス
境界の最後から2番目に分岐命令がある場合には、分岐
命令がEステージ(実行ステージ)に来たときに、Fス
テージ(フェッチステージ)のプログラムカウンタが示
すアドレスがアドレス境界の先頭番地に来るため、第1
の実施の形態に係る分岐処理装置では、上述したように
アドレス境界による読み出しと分岐命令実行による読み
出しとの競合が生じる。しかし、図5(b)〜(c)に
示すように、分岐命令をアドレス境界の後ろから2番目
以外に配置することにより上記競合が生じることはない
のである。
This is because, as shown in FIG. 5A, a branch instruction (address "800008008" indicated by branch in the figure) is used.
When the branch instruction reaches the E stage (execution stage), the F stage (fetch stage) Since the address indicated by the program counter of is at the beginning address of the address boundary,
In the branch processing device according to the embodiment of the present invention, as described above, contention occurs between the reading by the address boundary and the reading by executing the branch instruction. However, as shown in FIGS. 5B to 5C, the above conflict does not occur by arranging the branch instruction other than the second from the end of the address boundary.

【0036】第3の実施の形態 上述した第2の実施の形態に係る高速分岐処理装置にお
いては、分岐命令をアドレス境界の後ろから2番目以外
に配置することによりアドレス境界による読み出しと分
岐命令実行による読み出しとの競合を回避するようにし
ている。図6は、上記図5(a)に示すアドレス配置を
分岐命令がアドレス境界の後ろから2番目以外に配置さ
れるようにnop(No OPeration;無操作)命令を挿入
することにより上記2つの読み出しが競合しないように
したアドレス配置を示す図である。このようにすること
により、上記競合を回避することができるが、その一方
でプログラムのコードサイズの増大を招く恐れがある。
Third Embodiment In the high-speed branch processing device according to the second embodiment described above, by arranging a branch instruction at a position other than the second from the end of the address boundary, reading and execution of the branch instruction at the address boundary are performed. The conflict with the read by is avoided. FIG. 6 shows the above-mentioned two read operations by inserting the nop (No OPeration) instruction so that the branch instruction is placed at a position other than the second from the end of the address boundary, as shown in FIG. 5 (a). FIG. 3 is a diagram showing an address arrangement in which no conflict occurs. By doing so, the above conflict can be avoided, but on the other hand, the code size of the program may increase.

【0037】そこで、本実施の形態では、ハードウェア
により上記2つの読み出しの競合の検出及びその競合に
対しての処理を行う構成とすることにより、上記第2の
実施の形態において起こり得るプログラムのコードサイ
ズの増大を招くことなく、上記競合を回避することを可
能とする。
Therefore, in the present embodiment, by adopting a configuration in which the hardware detects the conflict between the two readings and processes the conflict, the program that may occur in the second embodiment is stored. It is possible to avoid the above conflict without increasing the code size.

【0038】図7は、本実施の形態に係る高速分岐処理
装置における実行命令のアドレス配置の一例を示す図で
あり、図7(a)は分岐が成立したと判定された場合を
示す図、図7(b)は分岐が成立しないと判定された場
合を示す図である。図7(a)及び(b)において、ま
ず、分岐命令(inst2 )のDステージ(デコードステー
ジ)で、分岐先命令(insta )の読み出しとアドレス境
界の先頭命令(inst4)の読み出しとの競合を検出す
る。ここで、この検出は、命令のアドレスと対応する命
令コードが分岐命令であるか否かをチェックすることに
より容易に行うことができる。競合が検出されると、次
のステージで分岐が成立しないと判定された場合に実行
されるアドレス境界の先頭命令(inst4 )の読み出しを
保留し、分岐先命令(insta )を読み出す。そして、分
岐が成立したと判定された場合には、図7(a)に示す
ように、そのまま処理が進む。一方、分岐が成立しない
と判定された場合には、図7(b)に示すように、さら
に、その次のステージで先に読み出された分岐先命令
(insta )を無効化(invalidate)すると共に、保留さ
れていたアドレス境界の先頭命令(inst4 )の読み出し
が実行され、その後処理が進む。
FIG. 7 is a diagram showing an example of the address arrangement of the execution instructions in the high speed branch processing device according to the present embodiment, and FIG. 7 (a) is a diagram showing a case where it is determined that the branch is taken, FIG. 7B is a diagram showing a case where it is determined that the branch is not taken. In FIGS. 7A and 7B, first, in the D stage (decode stage) of the branch instruction (inst2), there is a conflict between the read of the branch target instruction (insta) and the read of the first instruction (inst4) of the address boundary. To detect. Here, this detection can be easily performed by checking whether the instruction code corresponding to the address of the instruction is a branch instruction. When a conflict is detected, the read of the first instruction (inst4) at the address boundary, which is executed when it is determined that the branch is not taken in the next stage, is suspended and the branch destination instruction (insta) is read. Then, when it is determined that the branch is taken, the process proceeds as it is, as shown in FIG. On the other hand, when it is determined that the branch is not taken, as shown in FIG. 7B, the branch destination instruction (insta) read earlier in the next stage is further invalidated. At the same time, the read of the suspended first instruction (inst4) of the address boundary is executed, and then the process proceeds.

【0039】図8は、上述した処理を行う高速分岐処理
装置の一部を示すブロック図であり、この高速分岐処理
装置は、図1に示す高速分岐処理装置を構成するプログ
ラムカウンタ1とセレクタ19との間にさらにセレクタ
31と加算器33を加えた構成となっている。なお、そ
の他の部分は図1の高速分岐処理装置と全く同一であ
る。図8において、分岐命令(inst2 )のEステージ
(実行ステージ)で、プログラムカウンタ1に格納され
たアドレスと分岐先アドレスレジスタ11の格納された
分岐先アドレスがセレクタ19に入力される。ここで、
上述したように、前のDステージ(デコードステージ)
で、分岐先命令(insta )の読み出しとアドレス境界の
先頭命令(inst4 )の読み出しとの競合が検出された場
合には、制御信号lにより優先的に分岐先アドレスが選
択され、命令メモリ(図示省略)にはその読み出しアド
レスとして分岐先アドレスが入力される。また、分岐先
アドレスは加算器33にも入力され、該加算器33によ
り(ここでは4が)加算される。この加算結果とプログ
ラムカウンタ1に格納されたアドレスとがセレクタ31
に入力され、制御信号kによりそのうち一方が選択され
る。このEステージ(実行ステージ)においては同時に
条件分岐判定が行われるが、分岐が成立したと判定され
た場合(図7(a)の場合)には、制御信号kにより上
記加算結果が選択され、プログラムカウンタ1に入力さ
れ、プログラムカウンタの指示するアドレスを上記加算
結果に変更する。一方、分岐が成立しないと判定された
場合(図7(b)の場合)には、プログラムカウンタ1
の格納されているアドレスが選択され、同様にプログラ
ムカウンタ1に入力される。すなわち、プログラムカウ
ンタ1に格納されたアドレスが保持される。さらに、命
令レジスタ(図示省略)に格納されている分岐先命令を
無効化する。
FIG. 8 is a block diagram showing a part of a high-speed branch processing device for performing the above-mentioned processing. This high-speed branch processing device is a program counter 1 and a selector 19 which constitute the high-speed branch processing device shown in FIG. It is configured such that a selector 31 and an adder 33 are further added between and. The other parts are exactly the same as those of the high-speed branch processing device of FIG. In FIG. 8, at the E stage (execution stage) of the branch instruction (inst2), the address stored in the program counter 1 and the branch destination address stored in the branch destination address register 11 are input to the selector 19. here,
As mentioned above, the previous D stage (decode stage)
When a conflict between the read of the branch destination instruction (insta) and the read of the first instruction (inst4) of the address boundary is detected, the branch destination address is preferentially selected by the control signal 1 and the instruction memory (shown in the figure The branch destination address is input as the read address. The branch destination address is also input to the adder 33, and the adder 33 adds (in this case, 4). The addition result and the address stored in the program counter 1 are assigned to the selector 31.
One of them is selected by the control signal k. In the E stage (execution stage), the conditional branch determination is performed at the same time, but when it is determined that the branch is taken (in the case of FIG. 7A), the addition result is selected by the control signal k, The address input to the program counter 1 and designated by the program counter is changed to the above addition result. On the other hand, when it is determined that the branch is not taken (in the case of FIG. 7B), the program counter 1
The address stored in is selected and similarly input to the program counter 1. That is, the address stored in the program counter 1 is held. Further, the branch destination instruction stored in the instruction register (not shown) is invalidated.

【0040】第4の実施の形態 上記第3の実施の形態においては、分岐先命令(insta
)の読み出しとアドレス境界の先頭命令(inst4 )の
読み出しとの競合が生じた場合にいったん保留をするの
はアドレス境界の先頭命令(inst4 )の方であったが、
本実施の形態においては分岐先命令(insta )の読み出
しを保留する構成としたものである。
Fourth Embodiment In the third embodiment, the branch destination instruction (insta
) And the read of the first instruction of the address boundary (inst4) conflicts, the first instruction of the address boundary (inst4) suspends it, but
In this embodiment, the reading of the branch destination instruction (insta) is suspended.

【0041】図9は、本実施の形態に係る高速分岐処理
装置における実行命令のアドレス配置の一例を示す図で
あり、図9(a)は分岐が成立したと判定された場合を
示す図、図9(b)は分岐が成立しないと判定された場
合を示す図である。図9(a)及び(b)において、ま
ず、分岐命令(inst2 )のDステージ(デコードステー
ジ)で、分岐先命令(insta )の読み出しとアドレス境
界の先頭命令(inst4)の読み出しとの競合を検出す
る。ここで、この検出は、命令のアドレスと対応する命
令コードが分岐命令であるか否かをチェックすることに
より容易に行うことができる。競合が検出されると、次
のステージで分岐先命令(insta )の読み出しを保留
し、分岐が成立しないと判定された場合に実行されるア
ドレス境界の先頭命令(inst4 )を読み出す。そして、
分岐が成立したと判定された場合には、図9(a)に示
すように、さらに、その次のステージで先に読み出され
たアドレス境界の先頭命令(inst4 )を無効化(invali
date)されると共に、保留されていた分岐先命令(inst
a )の読み出しが実行され、その後処理が進む。一方、
分岐が成立しないと判定された場合には、図9(b)に
示すように、そのまま処理が進む。
FIG. 9 is a diagram showing an example of the address arrangement of the execution instructions in the high speed branch processing device according to the present embodiment, and FIG. 9 (a) is a diagram showing the case where the branch is determined to be taken, FIG. 9B is a diagram showing a case where it is determined that the branch is not taken. In FIGS. 9A and 9B, first, in the D stage (decode stage) of the branch instruction (inst2), there is a conflict between the read of the branch destination instruction (insta) and the read of the first instruction (inst4) of the address boundary. To detect. Here, this detection can be easily performed by checking whether the instruction code corresponding to the address of the instruction is a branch instruction. When a conflict is detected, the reading of the branch destination instruction (insta) is suspended at the next stage, and the first instruction (inst4) of the address boundary that is executed when it is determined that the branch is not taken is read. And
When it is determined that the branch is taken, as shown in FIG. 9A, the first instruction (inst4) of the address boundary read earlier in the next stage is invalidated (invali).
date) and the branch target instruction (inst
The reading of a) is executed, and then the process proceeds. on the other hand,
When it is determined that the branch is not taken, the process proceeds as it is, as shown in FIG.

【0042】図10は、上述した処理を行う高速分岐処
理装置の一部を示すブロック図であり、この高速分岐処
理装置は、図1に示す高速分岐処理装置を構成するプロ
グラムカウンタ1とセレクタ19との間にさらにセレク
タ35と加算器37を加えた構成となっている。なお、
その他の部分は図1の高速分岐処理装置と全く同一であ
る。図9において、分岐命令(inst2 )のEステージ
(実行ステージ)で、プログラムカウンタ1に格納され
たアドレスと分岐先アドレスレジスタ11の格納された
分岐先アドレスがセレクタ19に入力される。ここで、
上述したように、前のDステージ(デコードステージ)
で、分岐先命令(insta )の読み出しとアドレス境界の
先頭命令(inst4 )の読み出しとの競合が検出された場
合には、制御信号nにより優先的にプログラムカウンタ
1に格納されたアドレスが選択され、命令メモリ(図示
省略)にはその読み出しアドレスとしてプログラムカウ
ンタ1に格納されたアドレスが入力される。また、プロ
グラムカウンタ1に格納されたアドレスは加算器37に
も入力され、該加算器37により(ここでは4)が加算
される。この加算結果と分岐先アドレスとがセレクタ3
5に入力され、制御信号mによりそのうち一方が選択さ
れる。このEステージ(実行ステージ)においては同時
に条件分岐判定が行われるが、分岐が成立したと判定さ
れた場合(図9(a)の場合)には、制御信号mにより
分岐先アドレスが選択され、プログラムカウンタ1に入
力され、プログラムカウンタの指示するアドレスを上記
分岐先アドレスに変更する。さらに、命令レジスタ(図
示省略)に格納されているアドレス境界の先頭命令(in
st4 )を無効化する。一方、分岐が成立しないと判定さ
れた場合(図9(b)の場合)には、上記加算結果が選
択され、同様にプログラムカウンタ1に入力される。
FIG. 10 is a block diagram showing a part of a high-speed branch processing device for performing the above-mentioned processing. This high-speed branch processing device is a program counter 1 and a selector 19 which constitute the high-speed branch processing device shown in FIG. Further, a selector 35 and an adder 37 are added between and. In addition,
The other parts are exactly the same as those of the high-speed branch processing device of FIG. In FIG. 9, at the E stage (execution stage) of the branch instruction (inst2), the address stored in the program counter 1 and the branch destination address stored in the branch destination address register 11 are input to the selector 19. here,
As mentioned above, the previous D stage (decode stage)
When a conflict between the read of the branch destination instruction (insta) and the read of the first instruction (inst4) of the address boundary is detected, the address stored in the program counter 1 is preferentially selected by the control signal n. The address stored in the program counter 1 is input to the instruction memory (not shown) as its read address. The address stored in the program counter 1 is also input to the adder 37, and the adder 37 adds (4 in this case). The result of this addition and the branch destination address are the selector 3
5, and one of them is selected by the control signal m. In the E stage (execution stage), the conditional branch determination is performed at the same time, but when it is determined that the branch is taken (in the case of FIG. 9A), the branch destination address is selected by the control signal m, The address input to the program counter 1 and designated by the program counter is changed to the branch destination address. Furthermore, the first instruction (in the address boundary) stored in the instruction register (not shown)
st4) is invalidated. On the other hand, when it is determined that the branch is not taken (the case of FIG. 9B), the addition result is selected and similarly input to the program counter 1.

【0043】[0043]

【発明の効果】以上説明したように、本発明によれば、
マイクロプロセッサの動作周波数を律速するクリティカ
ルパスである条件分岐命令の分岐成立時の分岐先アドレ
スのフェッチ処理を高速に行うことができる。また、複
数個の命令を一度に読み出すことにより、命令メモリへ
のアクセスの回数を減少させることができ、それによ
り、消費電力の低減化を図ることができる。さらに、読
み出した複数の命令を一時的に記憶する命令バッファを
2つ設けることにより、命令メモリも2ポート読み出し
ではなく、1ポート読み出しで対処することができるの
で、コストの増大を招くこともない。
As described above, according to the present invention,
The fetch processing of the branch destination address can be performed at high speed when the branch of the conditional branch instruction, which is a critical path that limits the operating frequency of the microprocessor, is taken. Further, by reading out a plurality of instructions at once, the number of times of accessing the instruction memory can be reduced, and thus power consumption can be reduced. Furthermore, by providing two instruction buffers for temporarily storing a plurality of read instructions, the instruction memory can be handled by the one-port reading instead of the two-port reading, so that the cost does not increase. .

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

【図1】本発明の第1の実施の形態に係る高速分岐処理
装置のブロック図である。
FIG. 1 is a block diagram of a high-speed branch processing device according to a first embodiment of the present invention.

【図2】図1に示す命令メモリの読み出し動作を示す概
念図である。
FIG. 2 is a conceptual diagram showing a read operation of the instruction memory shown in FIG.

【図3】図1に示す命令メモリの読み出し動作を説明す
るための図である。
FIG. 3 is a diagram for explaining a read operation of the instruction memory shown in FIG.

【図4】分岐先命令のフェッチの動作を示すタイミング
チャートであり、(a)が図7に示す従来の分岐処理装
置の動作を示すものであり、(b)が図1に示す第1の
実施の形態に係る高速分岐処理装置の動作を示すもので
ある。
4 is a timing chart showing a fetch operation of a branch target instruction, FIG. 4A shows an operation of the conventional branch processing device shown in FIG. 7, and FIG. 4B is the first branch shown in FIG. 3 illustrates an operation of the high-speed branch processing device according to the embodiment.

【図5】本発明の第2の実施の形態に係る高速分岐処理
装置を説明するための図である。
FIG. 5 is a diagram for explaining a high-speed branch processing device according to a second embodiment of the present invention.

【図6】本発明の第3の実施の形態に係る高速分岐処理
装置を説明するための図である。
FIG. 6 is a diagram for explaining a high-speed branch processing device according to a third embodiment of the present invention.

【図7】本発明の第3の実施の形態に係る高速分岐処理
装置を説明するための他の図である。
FIG. 7 is another diagram for explaining the high-speed branch processing device according to the third embodiment of the present invention.

【図8】本発明の第3の実施の形態に係る高速分岐処理
装置の一部を示すブロック図である。
FIG. 8 is a block diagram showing a part of a high-speed branch processing device according to a third embodiment of the present invention.

【図9】本発明の第4の実施の形態に係る高速分岐処理
装置を説明するための図である。
FIG. 9 is a diagram for explaining a high-speed branch processing device according to a fourth embodiment of the present invention.

【図10】本発明の第4の実施の形態に係る高速分岐処
理装置の一部を示すブロック図である。
FIG. 10 is a block diagram showing a part of a high-speed branch processing device according to a fourth embodiment of the present invention.

【図11】従来の分岐処理装置のブロック図である。FIG. 11 is a block diagram of a conventional branch processing device.

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

1 プログラムカウンタ 3 命令メモリ 5 命令レジスタ 7 命令デコーダ 9、33、37 加算器 11 分岐先アドレスレジスタ 13 レジスタファイル 15 ALU(Arithmetic and Logic Unit ;算術論理
演算装置) 17A、17B 入力レジスタ 19、23A、23B、25、31、35 セレクタ 21A、21B 命令バッファ 27 制御回路 29 分岐命令フラグレジスタ
1 Program Counter 3 Instruction Memory 5 Instruction Register 7 Instruction Decoder 9, 33, 37 Adder 11 Branch Destination Address Register 13 Register File 15 ALU (Arithmetic and Logic Unit) 17A, 17B Input Register 19, 23A, 23B , 25, 31, 35 selectors 21A, 21B instruction buffer 27 control circuit 29 branch instruction flag register

フロントページの続き (56)参考文献 特開 平6−161751(JP,A) 特開 平7−121371(JP,A) 特開 平4−162134(JP,A) 特開 平3−156534(JP,A) 特開 平2−105938(JP,A) 特開 昭63−318634(JP,A) 特開 平5−224927(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/38 Continuation of front page (56) Reference JP-A-6-161751 (JP, A) JP-A-7-121371 (JP, A) JP-A-4-162134 (JP, A) JP-A-3-156534 (JP , A) JP-A-2-105938 (JP, A) JP-A-63-318634 (JP, A) JP-A-5-224927 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB) Name) G06F 9/38

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 命令を記憶する命令メモリと、前記命令
メモリへのアドレスを保持するプログラムカウンタと、
前記命令メモリから読み出されてデコードされる命令を
格納する命令レジスタとを備えた高速分岐処理装置にお
いて、 前記命令メモリからアドレスが連続する所定の数の命令
を一度に読み出す読み出し制御手段と、 前記読み出し制御手段により前記命令メモリから読み出
された複数個の命令を一時的に記憶する2つの命令バッ
ファと、 前記2つの命令バッファのうちいずれか一方を選択し、
さらに選択された命令バッファに記憶された複数個の命
令のうちいずれか1個の命令を選択し、該命令を前記命
令レジスタに出力する命令バッファ選択手段とを有し、 前記プログラムカウンタにより前記複数個の命令の先頭
アドレスが指定されると、その第1の複数個の命令を前
記読み出し制御手段が前記命令メモリから読み出し、前
記第1の複数個の命令を前記2つの命令バッファのうち
最後のアクセス時点の古い方に記憶し、前記命令バッフ
ァ選択手段が前記第1の複数個の命令をアドレス順に前
記命令レジスタに出力し、 デコードされた命令が条件分岐命令である場合には条件
分岐判定が終了する前にその分岐先アドレスを含む連続
するアドレスの第2の複数個の命令を前記読み出し制御
手段が前記命令メモリから読み出し、前記第2の複数個
の命令を前記2つの命令バッファのうち最後のアクセス
時点の古い方に記憶し、前記命令バッファ選択手段が前
記第2の複数個の命令をアドレス順に前記命令レジスタ
に出力すると共に、 前記命令メモリに格納された命令のアドレス配置は、前
記第1の複数個の命令の読み出しと前記第2の複数個の
命令の読み出しとが一致しないものとなっていることを
特徴とする高速分岐処理装置。
1. An instruction memory for storing instructions, a program counter for holding an address to the instruction memory,
A high-speed branch processing device comprising an instruction register for storing an instruction read from the instruction memory and decoded, and a read control unit for reading out a predetermined number of consecutive addresses from the instruction memory at one time, Two instruction buffers for temporarily storing a plurality of instructions read from the instruction memory by the read control means, and one of the two instruction buffers are selected,
An instruction buffer selecting unit that selects any one of the plurality of instructions stored in the selected instruction buffer and outputs the selected instruction to the instruction register; When the start address of each instruction is designated, the read control means reads the first plurality of instructions from the instruction memory, and the first plurality of instructions is read as the last one of the two instruction buffers. The instruction buffer selecting means stores the oldest one at the time of access, outputs the first plurality of instructions to the instruction register in the address order, and determines the conditional branch if the decoded instruction is a conditional branch instruction. Before completion, the read control means reads from the instruction memory a second plurality of instructions at consecutive addresses including the branch destination address, A plurality of instructions are stored in the older one of the two instruction buffers at the time of the last access, and the instruction buffer selecting means outputs the second plurality of instructions to the instruction register in the order of addresses, and A high-speed branch process characterized in that the address arrangement of the instructions stored in the instruction memory is such that the reading of the first plurality of instructions and the reading of the second plurality of instructions do not match. apparatus.
【請求項2】 命令を記憶する命令メモリと、前記命令
メモリへのアドレスを保持するプログラムカウンタと、
前記命令メモリから読み出されてデコードされる命令を
格納する命令レジスタとを備えた高速分岐処理装置にお
いて、 前記命令メモリからアドレスが連続する所定の数の命令
を一度に読み出す読み出し制御手段と、 前記読み出し制御手段により前記命令メモリから読み出
された複数個の命令を一時的に記憶する2つの命令バッ
ファと、 前記2つの命令バッファのうちいずれか一方を選択し、
さらに選択された命令バッファに記憶された複数個の命
令のうちいずれか1個の命令を選択し、該命令を前記命
令レジスタに出力する命令バッファ選択手段とを有し、 前記プログラムカウンタにより前記複数個の命令の先頭
アドレスが指定されると、その第1の複数個の命令を前
記読み出し制御手段が前記命令メモリから読み出し、前
記第1の複数個の命令を前記2つの命令バッファのうち
最後のアクセス時点の古い方に記憶し、前記命令バッフ
ァ選択手段が前記第1の複数個の命令をアドレス順に前
記命令レジスタに出力し、 デコードされた命令が条件分岐命令である場合には条件
分岐判定が終了する前にその分岐先アドレスを含む連続
するアドレスの第2の複数個の命令を前記読み出し制御
手段が前記命令メモリから読み出し、前記第2の複数個
の命令を前記2つの命令バッファのうち最後のアクセス
時点の古い方に記憶し、前記命令バッファ選択手段が前
記第2の複数個の命令をアドレス順に前記命令レジスタ
に出力すると共に、 前記高速分岐処理装置は、さらに、前記第1の複数個の
命令の読み出しと前記第2の複数個の命令の読み出しと
の競合を検出する競合検出手段と、 前記競合検出手段により読み出しの競合が検出された場
合には、条件分岐判定の終了前に、前記第1の複数個の
命令の読み出しを保留し、前記第2の複数個の命令の読
み出しを優先的に行うと共に、条件分岐判定の結果、分
岐非成立の場合には読み出された前記第2の複数個の命
令を無効とし、保留していた前記第1の複数個の命令の
読み出しを行う第1の読み出し手段とを有することを特
徴とする高速分岐処理装置。
2. An instruction memory for storing instructions and the instructions
A program counter that holds the address to memory,
Instructions read from the instruction memory and decoded
In a high-speed branch processing device equipped with an instruction register for storing
And a predetermined number of consecutive addresses from the instruction memory
Read control means for reading at a time, and read from the instruction memory by the read control means.
Two instruction buffers for temporarily storing a plurality of stored instructions.
And one of the two instruction buffers,
In addition, multiple instructions stored in the selected instruction buffer
Select any one of the orders, and
Instruction buffer selecting means for outputting to the instruction register, and the program counter causes the head of the plurality of instructions to be output.
When an address is specified, the first plurality of instructions
The read control means reads from the instruction memory,
The first plurality of instructions are stored in the two instruction buffers.
The instruction buffer is stored in the old one at the time of the last access.
Selecting means precedes the first plurality of instructions in the order of addresses.
If the decoded instruction is a conditional branch instruction, the condition is output to the instruction register.
Consecutive including the branch destination address before the branch judgment is completed
Read control of a second plurality of instructions at an address
Means reads from said instruction memory, said second plurality
Last instruction of the two instruction buffers
The oldest one is stored, and the instruction buffer selection means
The second plurality of instructions in the order of addresses
In addition to the above, the high-speed branch processing device further detects a conflict between the reading of the first plurality of instructions and the reading of the second plurality of instructions, and the conflict detecting means. If a read conflict is detected by, the read of the first plurality of instructions is suspended and the read of the second plurality of instructions is preferentially performed before the end of the conditional branch determination. As a result of the conditional branch determination, if the branch is not taken, the read second plurality of instructions are invalidated, and the suspended first instruction is read. And a high-speed branching processing device.
【請求項3】 命令を記憶する命令メモリと、前記命令
メモリへのアドレスを保持するプログラムカウンタと、
前記命令メモリから読み出されてデコードされる命令を
格納する命令レジスタとを備えた高速分岐処理装置にお
いて、 前記命令メモリからアドレスが連続する所定の数の命令
を一度に読み出す読み出し制御手段と、 前記読み出し制御手段により前記命令メモリから読み出
された複数個の命令を一時的に記憶する2つの命令バッ
ファと、 前記2つの命令バッファのうちいずれか一方を選択し、
さらに選択された命令バッファに記憶された複数個の命
令のうちいずれか1個の命令を選択し、該命令を前記命
令レジスタに出力する命令バッファ選択手段とを有し、 前記プログラムカウンタにより前記複数個の命令の先頭
アドレスが指定されると、その第1の複数個の命令を前
記読み出し制御手段が前記命令メモリから読み出し、前
記第1の複数個の命令を前記2つの命令バッファのうち
最後のアクセス時点の古い方に記憶し、前記命令バッフ
ァ選択手段が前記第1の複数個の命令をアドレス順に前
記命令レジスタに出力し、 デコードされた命令が条件分岐命令である場合には条件
分岐判定が終了する前にその分岐先アドレスを含む連続
するアドレスの第2の複数個の命令を前記読み出し制御
手段が前記命令メモリから読み出し、前記第2の複数個
の命令を前記2つの命令バッファのうち最後のアクセス
時点の古い方に記憶し、前記命令バッファ選択手段が前
記第2の複数個の命令をアドレス順に前記命令レジスタ
に出力すると共に、 前記高速分岐処理装置は、さらに、前記第1の複数個の
命令の読み出しと前記第2の複数個の命令の読み出しと
の競合を検出する競合検出手段と、 前記競合検出手段により読み出しの競合が検出された場
合には、条件分岐判定の終了前に、前記第2の複数個の
命令の読み出しを保留し、前記第1の複数個の命令の読
み出しを優先的に行うと共に、条件分岐判定の結果、分
岐成立の場合には読み出された前記第1の複数個の命令
を無効とし、保留していた前記第2の複数個の命令の読
み出しを行う第2の読み出し手段とを有することを特徴
とする高速分岐処理装置。
3. An instruction memory for storing instructions and the instructions
A program counter that holds the address to memory,
Instructions read from the instruction memory and decoded
In a high-speed branch processing device equipped with an instruction register for storing
And a predetermined number of consecutive addresses from the instruction memory
Read control means for reading at a time, and read from the instruction memory by the read control means.
Two instruction buffers for temporarily storing a plurality of stored instructions.
And one of the two instruction buffers,
In addition, multiple instructions stored in the selected instruction buffer
Select any one of the orders, and
Instruction buffer selecting means for outputting to the instruction register, and the program counter causes the head of the plurality of instructions to be output.
When an address is specified, the first plurality of instructions
The read control means reads from the instruction memory,
The first plurality of instructions are stored in the two instruction buffers.
The instruction buffer is stored in the old one at the time of the last access.
Selecting means precedes the first plurality of instructions in the order of addresses.
If the decoded instruction is a conditional branch instruction, the condition is output to the instruction register.
Consecutive including the branch destination address before the branch judgment is completed
Read control of a second plurality of instructions at an address
Means reads from said instruction memory, said second plurality
Last instruction of the two instruction buffers
The oldest one is stored, and the instruction buffer selection means
The second plurality of instructions in the order of addresses
In addition to the above, the high-speed branch processing device further detects a conflict between the reading of the first plurality of instructions and the reading of the second plurality of instructions, and the conflict detecting means. If a read conflict is detected by, the read of the second plurality of instructions is suspended and the read of the first plurality of instructions is preferentially performed before the end of the conditional branch determination. As a result of the conditional branch determination, if the branch is taken, the first plurality of instructions that have been read are invalidated, and the second plurality of instructions that have been suspended are read. And a high-speed branching processing device.
JP01564297A 1997-01-29 1997-01-29 High-speed branch processing unit Expired - Fee Related JP3493110B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01564297A JP3493110B2 (en) 1997-01-29 1997-01-29 High-speed branch processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01564297A JP3493110B2 (en) 1997-01-29 1997-01-29 High-speed branch processing unit

Publications (2)

Publication Number Publication Date
JPH10214187A JPH10214187A (en) 1998-08-11
JP3493110B2 true JP3493110B2 (en) 2004-02-03

Family

ID=11894378

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01564297A Expired - Fee Related JP3493110B2 (en) 1997-01-29 1997-01-29 High-speed branch processing unit

Country Status (1)

Country Link
JP (1) JP3493110B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3760999B2 (en) * 2004-06-15 2006-03-29 セイコーエプソン株式会社 Information processing apparatus, microcomputer and electronic device

Also Published As

Publication number Publication date
JPH10214187A (en) 1998-08-11

Similar Documents

Publication Publication Date Title
US5961637A (en) Split branch system utilizing separate set branch, condition and branch instructions and including dual instruction fetchers
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
US5706459A (en) Processor having a variable number of stages in a pipeline
JPH05143336A (en) Digital computer and branching-instruction executing method
KR100259306B1 (en) Data processor having a branch command buffer
EP2220556B1 (en) A method and a system for accelerating procedure return sequences
JP2006520964A (en) Method and apparatus for branch prediction based on branch target
JP3486690B2 (en) Pipeline processor
JPH03129432A (en) Branch control circuit
JP2001060152A (en) Information processor and information processing method capable of suppressing branch prediction
US20080065870A1 (en) Information processing apparatus
JP3493110B2 (en) High-speed branch processing unit
JP3708022B2 (en) Processor
JPH10124312A (en) Central processor
JPH05241827A (en) Command buffer controller
JP2591325B2 (en) Branch control device
JP2508021B2 (en) Data processing device
JPH06131180A (en) Instruction processing system and instruction processor
JP2001022577A (en) Information processor
JP3568737B2 (en) Microprocessor with conditional execution instruction
JPH0774992B2 (en) Data processing device
JPH0991139A (en) Information processor
JPH04213727A (en) Information processor
JP2001034474A (en) Data processor and data processing method
JPH10283182A (en) Pipeline information processor

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071114

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081114

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091114

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101114

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101114

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111114

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121114

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees