JPS6114536B2 - - Google Patents

Info

Publication number
JPS6114536B2
JPS6114536B2 JP370878A JP370878A JPS6114536B2 JP S6114536 B2 JPS6114536 B2 JP S6114536B2 JP 370878 A JP370878 A JP 370878A JP 370878 A JP370878 A JP 370878A JP S6114536 B2 JPS6114536 B2 JP S6114536B2
Authority
JP
Japan
Prior art keywords
address
instruction
branch
microinstruction
microprogram
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
Application number
JP370878A
Other languages
Japanese (ja)
Other versions
JPS5497341A (en
Inventor
Kazuhide Iwata
Shigeki Shibayama
Nobuo Okuda
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
Tokyo Shibaura Electric Co Ltd
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 Tokyo Shibaura Electric Co Ltd filed Critical Tokyo Shibaura Electric Co Ltd
Priority to JP370878A priority Critical patent/JPS5497341A/en
Publication of JPS5497341A publication Critical patent/JPS5497341A/en
Publication of JPS6114536B2 publication Critical patent/JPS6114536B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 本発明は、マイクロプログラム方式の計算機制
御方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a microprogram type computer control system.

マイクロプログラム方式の計算機では、演算の
アルゴリズムをあらかじめマイクロプログラムメ
モリに記憶させておき、それを順次読み出すこと
により、演算処理を完遂しようとするものであ
る。演算速度向上のため、ある命令を実行中に次
に実行すべき命令を読み出すパイプライン方式が
とられる。第1図はパイプライン形マイクロプロ
グラム計算機の基本構成図を、第2図は動作のタ
イミングを示したものである。その動作の概要は
次のとうりである。
In a microprogram type computer, an arithmetic algorithm is stored in advance in a microprogram memory, and the arithmetic processing is completed by sequentially reading out the algorithm. To improve calculation speed, a pipeline method is used in which the next instruction to be executed is read while a certain instruction is being executed. FIG. 1 shows the basic configuration of a pipelined microprogram computer, and FIG. 2 shows the timing of its operation. The outline of its operation is as follows.

パイプラインレジスタ1に、前のサイクルでマ
イクロプログラムメモリ2から読み出されたマイ
クロ命令iがセツトされているとき、次番地選択
情報によりアドレスコントローラ3が動作し、次
に実行するマイクロ命令i+1が読み出される。
これと同時にマイクロ命令iは演算器4に送られ
命令が実行される。マイクロ命令iの実行と、マ
イクロ命令i+1の読み出しが終了した時点でマ
イクロ命令i+1がパイプラインレジスタ1にセ
ツトされ、つぎのサイクルに入る。
When the microinstruction i read from the microprogram memory 2 in the previous cycle is set in the pipeline register 1, the address controller 3 operates according to the next address selection information, and the microinstruction i+1 to be executed next is read out. It can be done.
At the same time, the microinstruction i is sent to the arithmetic unit 4 and the instruction is executed. When execution of microinstruction i and reading of microinstruction i+1 are completed, microinstruction i+1 is set in pipeline register 1, and the next cycle begins.

この方式では、マイクロプログラムの読み出し
と、命令が同時に行なわれるので動作速度は速く
なるが、分岐が行なわれるとき、次のような問題
が生じる。すなわち条件により分岐する場合、現
在実行中のマイクロプログラム命令の処理が終了
しなければ、条件の真偽が判らず、次に実行する
マイクロ命令のアドレスを決定することができな
い。
In this method, the reading of the microprogram and the instruction are performed simultaneously, so the operating speed is increased, but when a branch is taken, the following problem occurs. That is, when branching due to a condition, the truth of the condition cannot be determined and the address of the next microinstruction to be executed cannot be determined unless the processing of the microprogram instruction currently being executed is completed.

たとえば、マイクロ命令i+1による演算結果
が零のときは次のステツプでマイクロ命令nの実
行をするという条件のある場合、マイクロ命令i
+1の実行が終了するまで次に実行する命令が、
マイクロ命令nかマイクロ命令i+2であるかが
判らず、1サイクル休む必要がある。したがつて
あるマイクロ命令を実行した結果によつてプログ
ラムの分岐を行なう割合の大きな場合には時間の
損失が大きくなる。この時間損失を少なくするた
めに従来よりいくつかの方法が考えられている。
For example, if there is a condition that if the operation result of microinstruction i+1 is zero, microinstruction n is executed in the next step, then microinstruction i
The next instruction to be executed until the execution of +1 is completed is
It is not clear whether it is microinstruction n or microinstruction i+2, so it is necessary to rest for one cycle. Therefore, when a large proportion of programs are branched depending on the result of executing a certain microinstruction, time loss becomes large. Several methods have been considered to reduce this time loss.

まず分岐条件が決定される前にその結果を予測
して次に実行するマイクロ命令を読みだす方法で
ある。前例においてマイクロ命令i+1が実行さ
れる前に、マイクロ命令i+2かマイクロ命令n
のいずれかを予測して読み出しておく。しかし一
般に演算結果が零のとき分岐する命令(BZ…
branch on Zero)と零でないとき分岐する命令
(BNZ…branch on Not Zero)があるので、次に
実行するのが連続番地(マイクロ命令i+2)が
飛び先番地(マイクロ命令n)のいずれかが判ら
ない。
First, before the branch condition is determined, the result is predicted and the next microinstruction to be executed is read. In the previous example, before microinstruction i+1 is executed, microinstruction i+2 or microinstruction n
Predict and read out one of the following. However, in general, instructions that branch when the operation result is zero (BZ...
branch on Zero) and an instruction that branches when it is not zero (BNZ...branch on Not Zero), so it is difficult to know whether the next consecutive address (microinstruction i + 2) is the destination address (microinstruction n). do not have.

また、マイクロプログラム・メモリを複数個の
バンクに分けて、次に実行される可能性のある複
数個の分岐先のマイクロ命令を同時に読み出すこ
とができるようにしておき、分岐命令の時点で同
時に複数個のマイクロ命令を読み出し、分岐命令
の終了時、その条件に合つた命令を選択して、次
に実行できるようにする方法がある。しかしこの
方法ではメモリ容量が大きくなり、ハードウエア
の価格が増加する欠点を持つている。
In addition, the microprogram memory is divided into multiple banks so that microinstructions for multiple branch destinations that may be executed next can be read simultaneously. There is a method of reading out micro-instructions, and when a branch instruction ends, selecting an instruction that meets the conditions to be executed next. However, this method has the drawback of increasing memory capacity and hardware cost.

本発明は、このような従来の欠点を解消するた
めになされたもので、分岐番地を指定するような
制御ビツトをもうけ、プログラムに応じて、ソフ
トウエアで分岐先の指定をできるようにし、従来
の分岐アドレス予測法の欠点を改良したマイクロ
プログラム制御方式を提供することを目的とす
る。
The present invention has been made in order to eliminate such conventional drawbacks, and it provides a control bit for specifying a branch address so that the branch destination can be specified by software according to the program. The purpose of this invention is to provide a microprogram control method that improves the drawbacks of the branch address prediction method.

以下図面を参照して本発明を詳細に説明する。
第3図は本発明の制御方式の基本概念を説明する
ためのプログラム例を示す図で、今、本図に示さ
れているように、START番地でRに100をセツ
トして、A番地でRの値を1づつ減じ、(A+
1)番地でRが零であるか否かによつて、連続番
地(A+2番地)か飛び先番地(LOOP番地)に
分岐する場合を考えてみる。このときRが零にな
る確率は1/100であるから、LOOP番号へ分岐す
る可能性が多いことは明らかである。それ故、ハ
ードウエア的に、通常はLOOP番地へ分岐するよ
うにしておいて、Rの値が零になつたときのみ、
すでに読み出されている命令を実行しないで、あ
らたに(A+2)番地のマイクロ命令を読み出す
ことにすると、損失は100回に1回となる。しか
しRの値が零か否かによつて分岐するにしても、
BNZ(Branch on Not Zero:零でなければ分
岐)と、BZ(Branch on Zero:零のとき分岐)
の命令があり、連続番地か飛び先番地のどちらに
分岐するかは、プログラムに依存する。したがつ
て、ハードウエアで、一方的に先読みすべき分岐
番地を決めておくと、最適なマイクロプログラム
を作成しようとする場合、プログラムに負担がか
かることになる。
The present invention will be described in detail below with reference to the drawings.
FIG. 3 is a diagram showing an example program for explaining the basic concept of the control method of the present invention. As shown in this figure, R is set to 100 at the START address, and Decrease the value of R by 1 and obtain (A+
1) Consider the case of branching to a continuous address (address A+2) or a jump address (LOOP address) depending on whether or not R is zero at the address. Since the probability that R becomes zero at this time is 1/100, it is clear that there is a high possibility of branching to the LOOP number. Therefore, in terms of hardware, it is normally configured to branch to the LOOP address, and only when the value of R becomes zero,
If we decide to read a new microinstruction at address (A+2) without executing the instruction that has already been read, the loss will be 1 in 100. However, even if it branches depending on whether the value of R is zero or not,
BNZ (Branch on Not Zero: Branch if it is not zero) and BZ (Branch on Zero: Branch when it is zero)
There are 2 instructions, and whether to branch to a consecutive address or a jump address depends on the program. Therefore, if the branch address to be prefetched is unilaterally determined by hardware, a burden will be placed on the program when trying to create an optimal microprogram.

マイクロプログラムをユーザが書き換えること
のできる計算機では、ハードウエアで分岐番地の
先読み制御をするより、プログラムに応じてソフ
トウエア制御できるようにした方が柔軟性が増す
ことになる。これ故、本発明ではマイクロ命令
(分岐命令)において命令コード以外に分岐アド
レスを指定する予測ビツトBASを追加し、マイ
クロプログラムが分岐命令の先読み制御を行なえ
るようにしている。そしてBASの値が1のとき
飛び先番地のマイクロ命令の先読みを、また
BASの値が0のとき連続番地のマイクロ命令の
先読みを行なうようにする。
In a computer where the microprogram can be rewritten by the user, it is more flexible to have software control according to the program rather than prefetch control of branch addresses using hardware. Therefore, in the present invention, a prediction bit BAS that specifies a branch address is added to the microinstruction (branch instruction) in addition to the instruction code, so that the microprogram can perform prefetch control of the branch instruction. When the BAS value is 1, the microinstruction at the jump address is read ahead, and
When the BAS value is 0, microinstructions at consecutive addresses are prefetched.

第4図は本発明のマイクロプログラム制御方式
の具体的構成の一実施例を示したもので、マイク
ロプログラム・メモリ10、パイプライン・レジ
スタ11、インストラクシヨン・デコーダ12、
アドレス・レジスタ13、インクリメンタ14、
サブルーチン・レジスタ15、マルチプレクサ1
6、コンパレータ17、および分岐処理回路18
から構成されている。ここでマイクロプログラ
ム・メモリ10はマイクロ命令を記憶させておく
メモリ、パイプライン・レジスタ11はマイクロ
プログラム・メモリ10から読み出された命令を
保持するレジスタ、インストラクシヨン・デコー
ダ12はマイクロ命令コードの解読(デコード)
を行い、それに対応した制御信号を各部に送るも
ので、本発明の特徴である分岐命令の時は、マイ
クロ命令の中にもうけられた分岐先を予測するビ
ツト(BAS)により、まず予測したアドレスが
選択されるようにマルチプレクサ16を動作さ
せ、次に図示しない演算回路からの実行結果フラ
グを受け取つてこれと命令コード(分岐条件)に
従つてマルチプレクサ16を再び動作させて正し
い実行アドレスを出力させ、更に予測したアドレ
スと正しい実行アドレスが一致しているかどうか
の信号を後述する分岐処理回路18より受取つ
て、予測が間違つていた場合にはパイプラインレ
ジスタ11の内容をクリヤしてその命令の実行を
中止し、正しいアドレスによる命令の読出しを指
示する回路、アドレス・レジスタ13はメモリを
読み出しているとき、そのアドレスを保持してい
るレジスタでカレントアドレスをその出力として
出すもの、インクリメンタ14はカレント・アド
レスに1を加える回路で、その出力としてコンテ
イニユー・アドレスを出すもの、サブルーチン・
レジスタ15はサブルーチン・ジヤンプをすると
き、そのリターン・アドレスを保持するもので、
サブルーチン・リターン・アドレスをその出力と
して出すもの、マルチプレクサ16は、インスト
ラクシヨンデコーダ12によるマイクロ命令を解
読して作られた信号により、コンテイニユー・ア
ドレス、サブルーチン・リターン・アドレス、お
よびジヤンプ・アドレス(分岐命令に含まれてい
る)のいずれか一つを選択して、次のアドレスを
決める回路、コンパレータ17は、ジヤンプ・ア
ドレスとカレント・アドレスの比較を行なう回路
であり、その出力として、もしジヤンプ・アドレ
スとカレント・アドレスが等しいなら1、そうで
なければ0というMATCH信号を出すもの、分岐
処理回路18は論理ゲートからなるものであり、
分岐命令のとき予測したアドレスが実際実行すべ
きアドレスになつているかどうかを判定し、その
結果をインストラクシヨン・デコーダ12に送る
回路である。
FIG. 4 shows an embodiment of the specific configuration of the microprogram control system of the present invention, which includes a microprogram memory 10, a pipeline register 11, an instruction decoder 12,
address register 13, incrementer 14,
Subroutine register 15, multiplexer 1
6, comparator 17, and branch processing circuit 18
It consists of Here, the microprogram memory 10 is a memory for storing microinstructions, the pipeline register 11 is a register for holding instructions read from the microprogram memory 10, and the instruction decoder 12 is a memory for storing microinstruction codes. deciphering (decoding)
When using a branch instruction, which is a feature of the present invention, the predicted address is first detected using a bit (BAS) that predicts the branch destination included in the microinstruction. is selected, and then receives an execution result flag from an arithmetic circuit (not shown) and operates the multiplexer 16 again according to this and the instruction code (branch condition) to output the correct execution address. Furthermore, a signal indicating whether the predicted address matches the correct execution address is received from the branch processing circuit 18 (described later), and if the prediction is wrong, the contents of the pipeline register 11 are cleared and the instruction is executed. The address register 13 is a circuit that stops the execution of the memory and instructs to read the instruction at the correct address.The address register 13 is a register that holds the address when reading the memory and outputs the current address as its output.The incrementer 14 is a circuit that adds 1 to the current address and outputs a continue address as its output, a subroutine
Register 15 holds the return address when subroutine jump is performed.
The multiplexer 16, which outputs the subroutine return address as its output, uses a signal generated by decoding the microinstruction by the instruction decoder 12 to output the continue address, subroutine return address, and jump address. Comparator 17 is a circuit that compares the jump address and the current address by selecting one of the addresses (included in the instruction) to determine the next address. The branch processing circuit 18, which outputs a MATCH signal that is 1 if the address and the current address are equal, and 0 otherwise, is composed of logic gates.
This circuit determines whether the address predicted at the time of a branch instruction is the address to be actually executed, and sends the result to the instruction decoder 12.

次に本発明の特徴である分岐命令の処理に関す
るハードウエアについて説明する。分岐命令で
BASの値を1、すなわちジヤンプ・アドレスを
予測した場合、コンパレータの出力MATCHによ
り、MATCHの値が1であれば予測が正しかつた
ことになり、またMATCHの値が0のとき予測が
はずれたことになる。逆にBASの値を0、すな
わち、コンテイニユー・アドレスを予測した場
合、MATCHの値が1のとき予測がはずれたこと
になり、またMATCHの値が0のとき予測が正し
かつたことになる。
Next, hardware related to branch instruction processing, which is a feature of the present invention, will be explained. with a branch instruction
If the value of BAS is 1, that is, the jump address is predicted, the comparator output MATCH indicates that the prediction was correct if the value of MATCH is 1, and the prediction was wrong if the value of MATCH is 0. That means that. Conversely, if the value of BAS is 0, that is, the continued address is predicted, the prediction will be incorrect if the value of MATCH is 1, and the prediction will be correct if the value of MATCH is 0. .

したがつて、分岐処理回路18は前述した予測
ビツトBASとMATCHの排他的論理和
(Exclusive OR)をとり、その出力をインストラ
クシヨン・デコーダ12に送ればよい。すなわ
ち、その出力は、“1”のとき予測して読み出し
ておいたマイクロ命令が間違つていたことを、
“0”のとき正しかつたことを示すので、インス
トラクシヨン・デコーダは信号“1”を受け取つ
た場合に間違つて読み出したマイクロ命令の実行
の中止、正しいマイクロ命令の読み出し等の制御
を行うことができる。
Therefore, the branch processing circuit 18 may perform an exclusive OR of the predicted bits BAS and MATCH, and send the output to the instruction decoder 12. In other words, the output indicates that the microinstruction that was predicted and read when it was "1" was incorrect.
When it is “0”, it indicates that the instruction was correct, so when the instruction decoder receives the signal “1”, it can control the execution of the incorrectly read microinstruction and read the correct microinstruction. It can be carried out.

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

第1図はパイプライン形マイクロプログラム計
算機の基本構成図、第2図はその動作のタイミン
グを示したものであり、第3図は分岐命令を含む
マイクロプログラムのプログラム例を示す。第4
図は本発明の一実施例を示す具体的な回路構成図
である。 10……マイクロプログラム・メモリ、11…
…パイプライン・レジスタ、12……インストラ
クシヨン・デコーダ、13……アドレス・レジス
タ、14……インタリメンタ、15……サブルー
チン・レジスタ、16……マルチプレクサ、17
……コンパレータ、18……分岐処理回路。
FIG. 1 is a basic configuration diagram of a pipeline type microprogram computer, FIG. 2 shows the timing of its operation, and FIG. 3 shows an example of a microprogram including a branch instruction. Fourth
The figure is a specific circuit configuration diagram showing one embodiment of the present invention. 10...Microprogram memory, 11...
... Pipeline register, 12 ... Instruction decoder, 13 ... Address register, 14 ... Intermenter, 15 ... Subroutine register, 16 ... Multiplexer, 17
... Comparator, 18 ... Branch processing circuit.

Claims (1)

【特許請求の範囲】[Claims] 1 次に実行すべきマイクロ命令のアドレスとし
て分岐先アドレス又は連続アドレスを予測したビ
ツト及び命令コードからなる分岐命令を記憶し、
与えられたアドレスに対応するマイクロ命令を読
出すマイクロプログラムメモリと、このマイクロ
プログラムメモリより読出されたマイクロ命令を
一時保持するパイプラインレジスタと、このパイ
プラインレジスタに保持されたマイクロ命令を実
行する演算回路と、前記マイクロプログラムメモ
リに与えられたアドレスを一時保持するアドレス
レジスタと、このアドレスレジスタに保持された
アドレスを歩進した連続アドレスを出力するイン
クリメンタと、このインクリメンタより出力され
た連続アドレスと前記マイクロプログラムメモリ
より読出された分岐命令の分岐先アドレスのいず
れかを選択的に前記マイクロプログラムメモリへ
出力するマルチプレクサと、このマルチプレクサ
に対し連続アドレス又は分岐先アドレスの選択指
示を前記マイクロプログラムメモリより読出され
た分岐命令の予測ビツトに従つて行い、更に命令
コード及び前記演算回路による分岐命令の実行結
果に従つて再び行うインストラクシヨンデコーダ
とを備えたマイクロプログラム制御方式におい
て、このインストラクシヨンデコーダにより再び
選択されて前記アドレスレジスタに保持されたア
ドレスと前記分岐先アドレスを比較してMATCH
信号を出力するコンパレータと、このコンパレー
タより出力されたMATCH信号と前記予測ビツト
の論理出力を得る論理ゲートとを備え、この論理
ゲートの論理出力に従い前記インストラクシヨン
デコーダは前記パイプラインレジスタに対し予測
ビツトに従つて選択されたマイクロ命令をクリヤ
することを特徴とするマイクロプログラム制御方
式。
1. Store a branch instruction consisting of bits and instruction codes that predict a branch destination address or continuous address as the address of the microinstruction to be executed next,
A microprogram memory that reads a microinstruction corresponding to a given address, a pipeline register that temporarily holds the microinstruction read from this microprogram memory, and an operation that executes the microinstruction held in this pipeline register. a circuit, an address register that temporarily holds an address given to the microprogram memory, an incrementer that outputs continuous addresses obtained by incrementing the address held in this address register, and continuous addresses output from this incrementer. and a multiplexer that selectively outputs one of the branch destination addresses of the branch instructions read from the microprogram memory to the microprogram memory, and a multiplexer that instructs the multiplexer to select a continuous address or a branch destination address to the microprogram memory. In a microprogram control system, the instruction decoder is provided with an instruction decoder that executes the instruction according to the prediction bit of the branch instruction read from the instruction code and the instruction code and the execution result of the branch instruction by the arithmetic circuit. Compare the address selected again by the decoder and held in the address register with the branch destination address and MATCH
The instruction decoder includes a comparator that outputs a signal, and a logic gate that obtains the logic output of the MATCH signal output from the comparator and the prediction bit, and according to the logic output of the logic gate, the instruction decoder performs prediction for the pipeline register. A microprogram control method characterized by clearing selected microinstructions according to bits.
JP370878A 1978-01-19 1978-01-19 Microprogram control system Granted JPS5497341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP370878A JPS5497341A (en) 1978-01-19 1978-01-19 Microprogram control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP370878A JPS5497341A (en) 1978-01-19 1978-01-19 Microprogram control system

Publications (2)

Publication Number Publication Date
JPS5497341A JPS5497341A (en) 1979-08-01
JPS6114536B2 true JPS6114536B2 (en) 1986-04-19

Family

ID=11564838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP370878A Granted JPS5497341A (en) 1978-01-19 1978-01-19 Microprogram control system

Country Status (1)

Country Link
JP (1) JPS5497341A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895785A (en) * 1994-09-29 1996-04-12 Nec Software Ltd Branch predicting device

Also Published As

Publication number Publication date
JPS5497341A (en) 1979-08-01

Similar Documents

Publication Publication Date Title
KR100395763B1 (en) A branch predictor for microprocessor having multiple processes
JP2603626B2 (en) Data processing device
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
US4775927A (en) Processor including fetch operation for branch instruction with control tag
US4179731A (en) Microprogrammed control system
EP0320098B1 (en) Jump prediction
EP0094535B1 (en) Pipe-line data processing system
US4739470A (en) Data processing system
KR100570906B1 (en) Apparatus and method for controlling conditional part execution in a data processor
US5146570A (en) System executing branch-with-execute instruction resulting in next successive instruction being execute while specified target instruction is prefetched for following execution
EP0297943B1 (en) Microcode reading control system
US5644759A (en) Apparatus and method for processing a jump instruction preceded by a skip instruction
US5142630A (en) System for calculating branch destination address based upon address mode bit in operand before executing an instruction which changes the address mode and branching
JPH031231A (en) Microprogram controller
JPS6114536B2 (en)
KR920006770B1 (en) System for controlling instruction fetch controlling
JP2001100994A (en) Device and method for instruction processing controlling branch instruction changing mode
WO2002039272A9 (en) Method and apparatus for reducing branch latency
JP3335735B2 (en) Arithmetic processing unit
JPH07262006A (en) Data processor with branch target address cache
JP2772100B2 (en) Parallel instruction fetch mechanism
US20030018883A1 (en) Microcode branch prediction indexing to macrocode instruction addresses
EP0211487A1 (en) Conditional operations in computers
JP3558481B2 (en) Data processing device