JPS61269735A - Instruction queue control system of electronic computer - Google Patents

Instruction queue control system of electronic computer

Info

Publication number
JPS61269735A
JPS61269735A JP11026085A JP11026085A JPS61269735A JP S61269735 A JPS61269735 A JP S61269735A JP 11026085 A JP11026085 A JP 11026085A JP 11026085 A JP11026085 A JP 11026085A JP S61269735 A JPS61269735 A JP S61269735A
Authority
JP
Japan
Prior art keywords
queue
instruction
counter
disp
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.)
Pending
Application number
JP11026085A
Other languages
Japanese (ja)
Inventor
Sadanobu Ikeda
池田 貞信
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP11026085A priority Critical patent/JPS61269735A/en
Publication of JPS61269735A publication Critical patent/JPS61269735A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To shorten the stop time of an instruction read out wait operation by changing a pointer without flashing a queue and executing branching operation or flashing the queue and reading an instruction out of a memory newly. CONSTITUTION:When a branch instruction is generated, a branch address DISP is given. The DISP is supplied to adding circuits 14 and 15 together with its sign and the circuit 14 adds the DISP to the contents of a counter CB for the remaining number of instructions. When the DISP is negative and A+B is positive, a signal 271 becomes active to indicate that the branch destination instruction is an address CR+DISP indicated by a read out counter among instructions in a queue memory 1 which are already executed. Similarly, the circuit 15 subtracts the DISP from the number CP of pre-fetch instructions and checks whether the DISP is within the range of the CF. The DISP should be a positive value and an AND gate 28 signifies a signal C=1 indicating that the subtraction result is >=0 when the DISP is positive, namely, when S=0, thereby indicating that the branch destination instruction is in an address CF+ DISP among pre-fetch instructions in the queue memory.

Description

【発明の詳細な説明】 〔発明の属する技術分野〕 本発明は、電子計算機における命令の読取りを効率よく
高速に実行するための命令キュー制御方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field to which the Invention Pertains] The present invention relates to an instruction queue control method for efficiently and quickly reading instructions in an electronic computer.

〔従来技術〕[Prior art]

従来、電子計算機は、高性能化のため並列処理可能な機
能に分割され、これらの機能がいわゆる・!イブライン
構造により並列動作するようになっているものが多い。
Conventionally, electronic computers have been divided into functions that can be processed in parallel to improve performance, and these functions have been divided into so-called ! Many of them are designed to operate in parallel due to their eveline structure.

この種の電子計算機は、第2図のブロック図に示すよう
に、バスの制御、データの読み取りや書き込みを行なう
パスインターフェースユニット(BIU) 、命令を先
取シしてファーストインファーストアウトメモリ(FI
FO)に貯えておく命令キューユニット(IQU) 、
命令の解読及びオペランドアクセス要求を出す命令解読
部(IDU) 。
As shown in the block diagram of Figure 2, this type of computer has a path interface unit (BIU) that controls the bus, reads and writes data, and a first-in-first-out memory (FIU) that preempts instructions.
Instruction queue unit (IQU) stored in FO),
Instruction decoding unit (IDU) that decodes instructions and issues operand access requests.

IDUからのアドレスを変換(例えば仮想アドレスカラ
実アドレスへ)したり、アクセスの種類を識別してBI
Uに伝えるアドレス変換ユニット(ATU)。
Convert the address from the IDU (for example, from a virtual address to a real address), identify the type of access, and use BI
Address Translation Unit (ATU) that communicates to the U.

およびIDUが解読した命令に従ってBIUから読取っ
てきた第4ランドを処理し、その結果をBIUに与える
命令実行部(EXU)から構成されるCPUと。
and a CPU consisting of an instruction execution unit (EXU) that processes the fourth land read from the BIU according to the instructions decoded by the IDU and provides the results to the BIU.

BIUを経由して接続されたメモリ及びIlo (MI
O)とから構成されている。これらの各ユニットが円滑
に並列動作するために、各ユニット間には適当な長さの
キューが設けられているが9通常命令キューはCPUが
相対的にMIOよりも高速であるため特に種々の考慮が
必要である。
Memory and Ilo (MI
O). In order for each of these units to operate smoothly in parallel, a queue of an appropriate length is provided between each unit.9 Normally, the instruction queue is used to process various commands because the CPU is relatively faster than MIO. Needs consideration.

この種のパイプライン構造を有する電子計算機は、パイ
プの流れが乱されたとき、一時的に性能が急激に低下す
る。しかしながら、電子計算機が実行するプログラムに
は一般に数ステップごとに分岐命令が入るといわれてお
り、パイプの流れの乱れによる性能低下は重要な問題と
なることが知られている。特に、頻繁に現われるのが、
第3図(a) 、 (b)および(c)に示すようなプ
ログラムであり。
In an electronic computer having this kind of pipeline structure, when the flow of the pipe is disturbed, the performance temporarily and sharply decreases. However, it is said that a program executed by an electronic computer generally includes a branch instruction every few steps, and it is known that performance degradation due to pipe flow disturbances becomes a serious problem. In particular, what appears frequently is
The program is as shown in FIGS. 3(a), (b), and (c).

しかも分岐が繰返し実施されることが多く、この間・母
イブの流れは乱されたままになる恐れがある。
Moreover, branching is often repeated, and during this time, the flow of the mother eve may remain disturbed.

第4図は、第3図(、)の具体的なグログラムの例であ
る。即ち9本プログラムは100行及び101行でWO
RK及びC0UNTが初期化され、102行から104
行の間で所定回数だけ5ALEを加算後、結果をTOT
ALに格納するもので、162行から104行の命令が
N回繰返される。第5図(1)〜(6)は、そのときの
IQHのキュー内部の状態の遷移の例を表わしている。
FIG. 4 is a specific example of the gramogram shown in FIG. 3 (,). In other words, the 9 programs have WO in lines 100 and 101.
RK and COUNT are initialized and from line 102 to 104
After adding 5ALE a predetermined number of times between rows, TOT the result.
This is stored in AL, and the instructions from line 162 to line 104 are repeated N times. FIGS. 5(1) to 5(6) show an example of the state transition inside the IQH queue at that time.

図は深さが6語のキューの例で、最上段が命令の入口、
最下段が出口のFIFOである。
The figure shows an example of a queue with a depth of 6 words, with the top row being the entry for instructions,
The bottom row is a FIFO with an exit.

ωは101番地の命令を実行しようとする場合のキュー
の状態であ#)、既に105番地の命令まで先読みされ
てキューに格納されている。■は。
ω is the state of the queue when the instruction at address 101 is to be executed (#), and the instruction at address 105 has already been read ahead and stored in the queue. ■Ha.

100番地の命令の解読が終ると、101番地がキーー
読堰りの先頭になシ、新たに106番地の命令が読込ま
れる。(3)は、同様にして命令の解読を続けて、10
4番地の命令を解読する状態になる。104番地の分岐
が起ると、(4)においてキューは総てクリアされて無
効になる。これをフラッシュという。(5)は、再度1
02番地の命令が読まれて来るのを待って解読実行され
る。(6)は、J@次キーz空いてるとき、命令の解読
実行と並行して命令が先読みされてキューに積みこまれ
ていく状態を示している。
When the instruction at address 100 has been decoded, address 101 is placed at the beginning of the key reading, and the instruction at address 106 is newly read. For (3), continue to decode the command in the same way, and 10
The command at address 4 will be decoded. When the branch at address 104 occurs, all queues are cleared and invalidated in (4). This is called a flash. (5) is 1 again
The decoding is executed after waiting for the instruction at address 02 to be read. (6) shows a state in which when J@next key z is vacant, instructions are prefetched and loaded into the queue in parallel with decoding and execution of instructions.

しかし乍ら、このように分岐命令が解読実行されると、
実行されることのない無駄な命令の読取りのためのメモ
リサイクルが発生し、かつ、キューがフラッシュされた
あと、新しく命令が読み取られるまで処理が停止するこ
とになる。このような分岐が頻発すると、結果的に大き
な性能低下が発生するという欠点があった。なお0回路
量に限度のあるLSIマイクロコンピュータでは、キュ
ーの深さを数バイトに抑えて無駄なメモリアクセスを少
なくさせるというような消極的な対応策しか採ることが
できず、十分な性能改善が期待できなかったO 〔発明の目的〕 本発明の目的は1分岐命令発生時に命令キーーーに読み
込まれるが、実行されなかった命令を可能な限シ有効に
活用することにより、高価なキャッジ−メモリ回路等を
設けなくとも、外部メモリのアクセスを減少し、命令読
取り待ちによるCPUの動作停止時間を短縮して小ルー
プのプログラムを実行することのできる経済的な電子計
算機における命令キュー制御方式を提供することにある
However, when a branch instruction is decoded and executed like this,
There will be memory cycles to read useless instructions that will never be executed, and after the queue has been flushed, processing will stall until a new instruction is read. If such branches occur frequently, there is a drawback that a large performance deterioration occurs as a result. Note that for LSI microcomputers with a limited amount of circuitry, it is only possible to take passive measures such as limiting the depth of the queue to a few bytes to reduce wasteful memory accesses, and it is not possible to achieve sufficient performance improvement. [Objective of the Invention] The object of the present invention is to utilize as effectively as possible the instructions that are read into the instruction key when a branch instruction occurs, but are not executed. To provide an economical instruction queue control method in an electronic computer capable of executing a small loop program by reducing external memory access and shortening the CPU operation stop time due to waiting for instructions to be read, even without the need to provide an instruction queue control system. There is a particular thing.

〔発明の構成〕 本発明の電子計算機における命令キュー制御方式は、先
取りされてまだ実行されていない命令が書き込まれ、解
読実行のために読み出された命令を記憶する記憶回路と
、該記憶回路に書込みアドレスを与えるキュー書込みカ
ウンタと、前記記憶回路に読取シアドレスを与えるキ、
−読取りカウンタと、先取りされてまだ未実行のまま前
記記憶回路にある命令の数を示すキュー先取シカウンタ
と、解読、又は実行済であるが、まだ前記記憶回路に残
っている命令の数を示すキュー実行済カウンタと、これ
等の要素を制御する制御回路とから構成され1分岐命令
を解読したとき、その分岐アドレスの指す命令が前記記
憶回路内にあるか否かを、前記キュー先取りカウンタ及
び前記キュー実行済カウンタと該分岐アドレスとを比較
することにより判断し、前記記憶回路にある場合には前
記キュー読取りカウンタ、前記キュー先取りカウンタお
よび前記キュー実行済カウンタを該分岐アドレスをもと
に加算、又は減算することにより更新し。前記記憶回路
内にない場合には前記4つのカウンタ総てをクリアし、
該キュー先取シカウンタの内容により命令の解読実行の
続行、停止または命令の先取りを要求することを特徴と
する。
[Structure of the Invention] The instruction queue control method for an electronic computer of the present invention includes a memory circuit in which prefetched and unexecuted instructions are written and stores instructions read out for decoding and execution, and the memory circuit. a queue write counter for providing a write address to the memory circuit; and a key for providing a read seat address to the storage circuit.
- a read counter, a queue preemption counter indicating the number of instructions that have been prefetched and are still unexecuted in said storage circuit, and a queue preemption counter that indicates the number of instructions that have been decoded or executed but still remain in said storage circuit; It consists of a queue execution counter and a control circuit that controls these elements.When a single branch instruction is decoded, the queue prefetch counter and Judgment is made by comparing the queue executed counter and the branch address, and if the queue is stored in the storage circuit, the queue read counter, the queue prefetch counter, and the queue executed counter are added based on the branch address. , or update by subtracting. If it is not in the memory circuit, clear all four counters,
The present invention is characterized in that, depending on the contents of the queue prefetch counter, a request is made to continue or stop the decoding and execution of the instruction, or to prefetch the instruction.

〔発明の概略的な作用〕[Schematic operation of the invention]

本発明は命令の解読実行後も命令をキュー内に保持し、
命令の相対分岐が発生したとき分岐アドレスが実行前及
び実行後のキューの範囲にあるか否かを判定し、範囲内
にあればキューをフラッシュせずにキューのポインタを
変更することにより分岐を実行し、範囲外であればキュ
ーをフラッシュしてメモリから新たに命令を読取る。す
なわち。
The present invention retains instructions in a queue even after the instruction is decoded and executed;
When a relative branch of an instruction occurs, it is determined whether the branch address is within the range of the pre-execution and post-execution queues, and if it is within the range, the branch is executed by changing the queue pointer without flushing the queue. execute, and if it is out of range, flush the queue and read a new instruction from memory. Namely.

命令キューに命令キャッシュの性格が付加されたもので
ある。
It has the characteristics of an instruction cache added to the instruction queue.

〔発明の実施例〕[Embodiments of the invention]

次に1本発明による命令キュー制御方式について実施例
を挙げ9図面を参照して詳細に説明する。
Next, an instruction queue control system according to the present invention will be described in detail by way of an embodiment with reference to nine drawings.

まず1本発明の論理的な動作について第6図(a)。First, FIG. 6(a) shows the logical operation of the present invention.

(b)および第7図α)〜(4)を参照して説明する。This will be explained with reference to (b) and FIGS. 7 α) to (4).

第6図は1本発明による深さ8の命令キューをランダム
アクセスメモリ(RAM)で実現した場合の状態を示す
。CW(書込カウンタ)は次にメモリから読込まれた命
令を書込む番地を指し、RW(読取カウンタ)は次にI
DUが解読する命令が格納された番地をさし、命令が書
込まれるとCWは+1され、命令が解  1読されると
RWが+1される。カウンタは8を法とするルーズカウ
ンタであlる。第6図(a)には、第4図のプログラム
の実行状態が示されている。ここでは、 CRで指され
ている104番地の命令が解読されようとしており 、
cwで指されている1つ前の内容、即ち107番地まで
命令が先取りされている。ioo番地〜102番地は解
読が終了しており、103番地は通常解読中か実行中で
ある。
FIG. 6 shows a state in which an instruction queue with a depth of 8 according to the present invention is implemented using a random access memory (RAM). CW (write counter) points to the next address to write the instruction read from memory, and RW (read counter) points to the next address to write the instruction read from memory.
DU points to the address where the instruction to be decoded is stored. When the instruction is written, CW is incremented by 1, and when the instruction is decoded and read, RW is incremented by 1. The counter is a loose counter modulo 8. FIG. 6(a) shows the execution state of the program shown in FIG. Here, the instruction at address 104 pointed to by CR is about to be decoded.
The instruction is prefetched up to the previous contents pointed to by cw, that is, address 107. The decoding of addresses ioo to 102 has been completed, and the decoding of address 103 is normally in progress.

本発明によれば、この先読みされたキューに格納された
命令の数を示すカウンタCFと、実際に実行された命令
でキューにまだ残っている命令の数を示すカウンタCB
とが2分岐アドレスと比べて分岐アドレスが指す新しい
番地の命令がキューの内にあるか否かを判定することに
ある。このとき。
According to the present invention, a counter CF indicates the number of instructions stored in the read-ahead queue, and a counter CB indicates the number of actually executed instructions still remaining in the queue.
The second step is to compare the two branch addresses and determine whether the instruction at the new address pointed to by the branch address is in the queue. At this time.

CF=CW−CR(キューの深さを法とする)であるが
、 CB≦CR−CW(キューの深さを法とする)であ
ることに注意することが必要である。
Although CF=CW-CR (modulo the queue depth), it is necessary to note that CB≦CR-CW (modulo the queue depth).

第7図は、第6図(、)と同じく、第4図のプログラム
の実行状態を示し、上記カウンタの内容の遷移を表わし
たものである。第7図(1)は、第6図(、)から命令
解読が1つ進んだ状態である。104番地の分岐命令が
実行されると、第7図(2)に遷移する。即ち4分岐ア
ドレス(disp)は−3であるから。
Like FIG. 6(,), FIG. 7 shows the execution state of the program in FIG. 4, and shows the transition of the contents of the counter. FIG. 7(1) shows a state in which instruction decoding has proceeded by one step from FIG. 6(,). When the branch instruction at address 104 is executed, the process transitions to FIG. 7(2). That is, the 4-branch address (disp) is -3.

実行済命令のカウンタCBと比較され、その範囲にある
のでキューはフラッシュされず、第7図(1)と同じ内
容を保持する。CRはdispが加えられ、102番地
の命令の入ったキューの番地7を指し、CWはは変化し
ない。CFはdisp (−3)が減じられて6となり
、 CBはdiap(−3)が加えられて2となる。
It is compared with the counter CB of executed instructions, and since it is within that range, the queue is not flushed and retains the same contents as in FIG. 7(1). CR points to address 7 of the queue containing the instruction at address 102 to which disp has been added, and CW does not change. CF becomes 6 by subtracting disp (-3), and CB becomes 2 by adding diap (-3).

次に、解読する命令は十分あるため、 CFを判断し一
定値以上であるならば命令読取の要求が出されず、CW
は更新されない。第7図(3)は、このようにして命令
の実行が進んだ場合を示し、ルーズを通り抜けて105
番地の命令を解読している状態を示す。この場合には、
CWが変化しておらず、CRが進んだ分だけCFが城り
、CBが増加したことを示す。
Next, since there are enough instructions to decode, the CF is determined and if it is above a certain value, no request is issued to read the instructions, and the CW
is not updated. FIG. 7(3) shows the case where the instruction execution progresses in this way, passing through the loose and 105
Shows the state in which the instruction at the address is being decoded. In this case,
This shows that CW has not changed, CF has decreased and CB has increased by the amount that CR has progressed.

第7図(4)はCFの値が少なくなったので、命令の解
読と読取りが同時に進んだ場合であり、CF、CBが変
化しなかった例を示す。なお5以上の動作を厳密に表現
すると。
FIG. 7(4) shows an example in which decoding and reading of the instruction proceed simultaneously because the value of CF has decreased, and CF and CB do not change. In addition, if we strictly express the actions of 5 or more.

(1)命令を読取ると、キューに格納してカウンタを更
新する。
(1) When an instruction is read, it is stored in a queue and the counter is updated.

以下余日 CW=CW+l  CR=CRCF=CF+ 1CB 
=CB−1(CF+CB= Qの深さの時)CB=CB
   (CF士CB<Qの深さの時)(2)分岐命令以
外の命令をキューから出して解読すると、カウンタを更
新する。
The remaining days CW=CW+l CR=CRCF=CF+ 1CB
=CB-1 (CF+CB=When depth is Q) CB=CB
(When the depth of CF operator CB<Q) (2) When an instruction other than a branch instruction is taken out of the queue and decoded, the counter is updated.

CW=CW  CR=CR+I  CF=CF−1CB
=CB+1 (3)分岐命令を解読実行するとカウンタを更新する。
CW=CW CR=CR+I CF=CF-1CB
=CB+1 (3) When the branch instruction is decoded and executed, the counter is updated.

(A)  disp)CF、又は−disp)CBの場
合。
(A) In the case of disp)CF or -disp)CB.

CW=CR=CF=CB=0 (B)0≦disp≦CF、又は0≦−disp≦CB
の場合。
CW=CR=CF=CB=0 (B) 0≦disp≦CF, or 0≦-disp≦CB
in the case of.

CW=CW     CR=CR+ dispCF =
CF−disp  CB=CB+dispのようになる
。上記いずれの場合も、 diapは符号付の相対分岐
アドレスである。
CW=CW CR=CR+dispCF=
CF-disp CB=CB+disp. In any of the above cases, diap is a signed relative branch address.

第8図は、第2図の電子計算機に本発明による命令キュ
ーユニッ) IQUを適用した場合の他のユニットとの
インターフェース信号の例を示したものである。このI
QUは、 BIUに対して命令の読取要求REQ −R
D倍信号出力し、これに答えてBfUから読取りデータ
(命令) R−DATA及びデータを保証してキューに
書き込み可を示す■ITE −Q信号が与えられる。一
方、 IQUからキューにデーIがあるど、 IDUは
Q −READY信号を受ける。It)Uが命令引取り
要求READ −QをIQUに与えると。
FIG. 8 shows an example of interface signals with other units when the instruction queue unit (IQU) according to the present invention is applied to the electronic computer shown in FIG. 2. This I
QU sends an instruction read request REQ-R to BIU.
A D times signal is output, and in response, the BfU provides read data (command) R-DATA and a ITE-Q signal that guarantees read data (instruction) and data and indicates that writing to the queue is possible. On the other hand, when there is data I in the queue from the IQU, the IDU receives a Q-READY signal. It) When U gives an instruction takeover request READ-Q to IQU.

IQUは解読すべき命令Q −OUTを出力する。I 
IM、Jは命令を解読し1分岐命令の場合にはそれを示
す信号BRNCHと分岐アドレスDISPとをIQUに
与える。
IQU outputs the instruction Q-OUT to be decoded. I
IM and J decode the instruction and, in the case of a one-branch instruction, provide a signal BRNCH indicating it and a branch address DISP to IQU.

その他に、先読み命令が多くなりすぎないように。In addition, avoid too many read-ahead instructions.

最適値を与える信号OPT −KやIQUを強制的に初
期化する信号INZがある。
There is a signal OPT-K that gives the optimum value and a signal INZ that forcibly initializes IQU.

第1図(、)および(b)は1本発明による命令キュー
ユニットの実施例をブロック図により示したものである
。この図において5キユーメモリ1 (Q−M)は読取
、書込みが可能な一般のメモリであり、読取りデータ(
命令) R−DATAがBTUがら与えられると、 W
RITE−Q信号K ヨクテ書込’!れ、 READ−
Q信号によってQ −OUTに読取りデータを出力する
FIGS. 1(a) and 1(b) are block diagrams showing an embodiment of an instruction queue unit according to the present invention. In this figure, 5 queue memory 1 (Q-M) is a general memory that can be read and written.
command) When R-DATA is given as BTU, W
RITE-Q signal K Yokute write'! Read, READ-
The Q signal outputs read data to Q-OUT.

カウンタ2,3,4.5は夫々CW、 CR,CB 、
 CFを構成しており、CWがQ−Mの書込みアドレス
Counters 2, 3, 4.5 are CW, CR, CB, respectively.
CF is configured, and CW is the write address of Q-M.

CRが読取りアドレスを与える。13は符号付の加算回
路を示し1分岐命令時のCRの値を計算する。
CR gives the read address. Reference numeral 13 denotes a signed adder circuit which calculates the value of CR at the time of one branch instruction.

14及び15は夫々CB及びCFと2分岐アドレスの範
囲を判定したり9分岐後の夫々CB’およびCFの値を
決めるだめの符号付の加算回路である。16はCBとC
Fの加算回路であり、加算結果を17の比較回路により
Q−Mの深さを示すQ−8IZEと比較することによっ
て、 CBの更新を制御するために使用される。18は
CFが0″か否かをチェックするデコーダであシ、命令
解読部(IDU)が命令キューを読出せるか否かを判断
するQ −READ″1′信号を作る。
Signed adder circuits 14 and 15 are used to determine the range of CB and CF and two-branch addresses, respectively, and to determine the values of CB' and CF, respectively, after nine branches. 16 is CB and C
It is an adder circuit of F and is used to control the update of CB by comparing the addition result with Q-8IZE indicating the depth of QM by a comparator circuit of 17. A decoder 18 checks whether CF is 0'' or not, and generates a Q-READ''1' signal which determines whether the instruction decoding unit (IDU) can read the instruction queue.

19は比較回路を示し、 CFが一定値以下であれば。19 indicates a comparison circuit, if CF is below a certain value.

BIIJに命令の読取りを要求する信号REQ −RD
を出力する。比較される定数OPT −Kは、他のパス
使用状況により動的に変化することもある。カウンタ2
〜5は夫々第6図で説明したものと同じ動作をする1゜ さて、オアケ”−)26に初期化信号INZが与えうり
、ると、信号261がアクテ(プになね、総てのカウン
タはクリアされてCW=CR=CB=CF −“0″と
なる。従って、初期化後は比較回路19によ!+ (O
PX−K)−OF ) Oとなり、 BIUに対してR
EQ−RD倍信号アクティブにして命令の読取りを催促
すると同時に、デコーダ18がCF=Oを検出してイン
バータ31の出力信号Q −READYをインアクティ
ブにし、 IDUに解読すべき命令がQ−Mに存在しな
いことを知らせる。BIUが命令を読み取ると。
Signal REQ-RD requesting BIIJ to read instructions
Output. The constant OPT-K that is compared may change dynamically depending on other path usage conditions. counter 2
5 operate in the same way as explained in FIG. The counter is cleared and becomes CW = CR = CB = CF - "0". Therefore, after initialization, the comparator circuit 19!+ (O
PX-K)-OF) becomes O, and R for BIU
At the same time, the decoder 18 detects CF=O and makes the output signal Q-READY of the inverter 31 inactive, and the instruction to be decoded by the IDU is sent to the Q-M. Let me know that it doesn't exist. When BIU reads the command.

IQUにR−DATAを与えて■ITE −Q信号をア
クティブにし、これに従ってQ−Mに命令が書込まれる
3゜書込みが終了する頃に遅延回路20を通って遅らせ
られたWRITE −Q信号201がCWとCF(7)
I端子に与えられ、+1(加算)される。CWは次に書
き込むQMの番地を指す。この結果CFが0でなくなる
から、デコーダ18の出力はインアクティブになシ、従
ってQ −READY信号がアクティブにな、りてID
Uは命令解読を開始できるようになる。I Dt、iが
命令引き取りの信号READ −Qを出力すると、 Q
−MはCRの指す番地の命令を出力してIDUに与える
R-DATA is applied to IQU to activate ■ITE-Q signal, and a command is written to Q-M accordingly. WRITE-Q signal 201 is delayed through delay circuit 20 around the time when writing is completed. is CW and CF (7)
It is given to the I terminal and +1 (added). CW indicates the address of the QM to be written next. As a result, since CF is no longer 0, the output of the decoder 18 becomes inactive, so the Q-READY signal becomes active, and the ID
U can now start decoding instructions. When I Dt,i outputs the command read signal READ -Q, Q
-M outputs the instruction at the address pointed to by CR and gives it to the IDU.

遅延回路21によって適当に遅れたRgAI) −Q信
号はCR、CBのI端子に与えられて+1(加算)され
、 CFのD端子に与えられて−1(減算)される。
The RgAI)-Q signal, which has been appropriately delayed by the delay circuit 21, is applied to the I terminals of CR and CB for +1 (addition), and is applied to the D terminal of CF for -1 (subtraction).

即ち、CRは次に読取るべきQ−Mのアドレスを指し。That is, CR indicates the address of QM to be read next.

CBが1つ増え、CFが1つ減る。このような操作が進
むと、CF十〇Bはキューの深さになるが(CF士CB
=Q−3IZE) 、 CF + CB ≦Q −5I
ZE テなければならないため、以後CFが1つ増えれ
ばCBが1つ減る。
CB increases by 1 and CF decreases by 1. As this operation progresses, CF 10B becomes the depth of the queue (CF officer CB
=Q-3IZE), CF + CB ≦Q-5I
Since ZE must be used, if the number of CF increases by one, the number of CB decreases by one.

即ち、加算回路16でCFとCBが加算され、比較回路
17でQ −5IZEと比較されて一致が検出されると
、Q−FULL信号がアクティブとなり、アンドr−1
22を通してWRITE −Q信号発生時にCBを−1
させるようにする。
That is, when CF and CB are added in the adder circuit 16 and compared with Q-5IZE in the comparator circuit 17 and a match is detected, the Q-FULL signal becomes active and the AND r-1
CB -1 when the WRITE -Q signal is generated through 22
Let them do it.

分岐命令が発生すると、 IDUからのBRNCH信号
がアクティブになり9分岐アドレスDISPが与えられ
る。DISPは符号付きのままで加算回路14.15に
与えられる。加算回路14はCBとDISPの加算を行
なうが、 DISPの符号ビット3 = l (DIS
Pが負であることを示す)のときにのみアンドデート2
7は加算回路のキャリ出力を有効にしている。即ち。
When a branch instruction occurs, the BRNCH signal from the IDU becomes active and provides the 9 branch address DISP. DISP is applied to adder circuits 14 and 15 without being signed. The adder circuit 14 adds CB and DISP, but the sign bit 3 of DISP = l (DIS
and date 2 only if P is negative)
7 enables the carry output of the adder circuit. That is.

DISPが負で、かつA+B (実際にはDISPが負
なのでCB −IDl5PI )の結果が正、つまシキ
ャリ出力がアクティブのときに271信号がアクティブ
になって1分岐先の命令がQ−M内の実施済の命令の中
でCR+DISP番地にあることを示す。同様にして加
算回路15は、 CFとDISPの減算を行ないDIS
PがCFの範囲に入りているかチェックを行なう。
When DISP is negative and the result of A+B (Actually, since DISP is negative, CB - IDl5PI) is positive, the 271 signal becomes active and the instruction one branch ahead is in Q-M. Indicates that the instruction is at address CR+DISP among the executed instructions. Similarly, the adder circuit 15 subtracts CF and DISP to obtain DIS
Check whether P is within the range of CF.

従ってDISPは正の値である必要があシ、アンドr−
ト28はDISPの符号が正(S=0)のとき減算結果
が“0”以上であることを示す信号C”=1を有効にし
、281信号がアクティブになって9分岐先の命令がQ
−M内の先取りした命令の中でCF+DISP番地にあ
ることを示す。即ち、結果として。
Therefore, DISP must be a positive value, and r-
In step 28, when the sign of DISP is positive (S=0), the signal C"=1 which indicates that the subtraction result is "0" or more is enabled, and the signal 281 becomes active and the instruction at the 9th branch destination becomes Q.
-Indicates that the prefetched instruction in M is at address CF+DISP. That is, as a result.

加算回路14.15は実際の演算が減算になった  −
ときにのみ有効となる。信号271.又は281のどち
らかがアクティブになると6オアf−ト30を経由して
分岐先の命令がQ−M内にあるととを示す信号HITが
アクティブになυ1分岐命令BRNCHがアクティブで
あることからアンド?−)23の出力231がアクティ
ブになり1分岐先のアドレスに対応するCR、CB 、
 CFの値が加算回路13.14.15で夫々計算され
てセットされる。
For addition circuits 14 and 15, the actual operation is subtraction.
Valid only occasionally. Signal 271. or 281 becomes active, the signal HIT indicating that the branch destination instruction is in Q-M via 6 or f-to 30 becomes active.Since the υ1 branch instruction BRNCH is active. and? -) 23 output 231 becomes active and CR, CB, corresponding to the address of one branch destination,
The value of CF is calculated and set in adder circuits 13, 14, and 15, respectively.

CRはキfのサイズを法とする値が設定されるが。CR is set to a value modulo the size of f.

CB 、 CFは常に桁上がりが発生しない時有効値が
セントされる。逆に分岐アドレス先の命令がQ−M内に
なければ、 HIT信号がインアクティブになるため、
アンドゲート25の出力がアクティブになる。従って信
号261がアクティブになることにより、総てのカウン
タCW、 CR,CB 、 CFがクリアされてQ−M
内の命令は使用可能なものがない初期状態と同じになる
For CB and CF, valid values are always sent when no carry occurs. Conversely, if the instruction at the branch address destination is not in Q-M, the HIT signal becomes inactive, so
The output of AND gate 25 becomes active. Therefore, when signal 261 becomes active, all counters CW, CR, CB, and CF are cleared and Q-M
The commands inside will be the same as the initial state when no commands are available.

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

以上の説明により明らかなように1本発明によれば、第
3図に見られるような近接した分岐を行なう場合、その
分岐アドレスがCB 、 CFの範囲にある限りQ−M
をフランシュして再度読取ることなく命令を続行でき1
次のような効果を得ることができる。
As is clear from the above description, according to the present invention, when taking adjacent branches as shown in FIG. 3, as long as the branch address is within the range of CB and CF,
You can continue the command without franchising and rereading 1
The following effects can be obtained.

(1)  CPUの処理速度が高速になった時、処理す
べきデータの転送が間に合わないというパスネックが改
善される。
(1) When the processing speed of the CPU increases, the pathneck of not being able to transfer data to be processed in time is improved.

(2)特に近接したアドレスの分岐が連続する処理や、
制御命令のスキップ等の処理において必要とする命令が
Q−Mに残っており、直ちに実行可能な状態にあるので
高速処理が可能である。
(2) Processing that involves consecutive branches of particularly close addresses,
The instructions necessary for processing such as skipping of control instructions remain in the Q-M and are ready to be executed immediately, so high-speed processing is possible.

(3)一般のキャッジ−メモリに比較して回路量が少な
(、LSI化が容易である。通常の命令キューに若干の
回路を付加するだけでよい。
(3) It requires less circuitry than a general cache memory (and can be easily integrated into an LSI. Only a few circuits need to be added to a normal instruction queue).

(4)  キューサイズを可変にすることにより、最適
な性能をチューニングすることができる。
(4) Optimal performance can be tuned by making the queue size variable.

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

第1図(a)および(b)は1本発明による実施例の構
成を示すブロック図、第2図は従来のパイプライン構造
を有する電子計算器の構成例を示すブロック図、第3図
(a) # (b)および(c)は、ツクイブラインの
流れを乱す要素となるプログラム例のフローチャート、
第4図は、第3図(a)のフローチャートの具体的なプ
ログラムの例、第5図(1)〜(6)は、第2図の電子
計算機により第4図のプログラムが実行された時の命令
キューの動きを説明するための図。 第6図(、)および(b)は9本発明による命令キュー
を制御するカウンタの動作を説明するだめの図、第7図
(1)〜(4)は2本発明によシ第4図のプログラムを
実施した場合の第6図で定義したカウンタとキューの動
作を説明するだめの図、第8図は本発明による命令キュ
ーユニットと他のユニットとのインターフェース信号の
例を示す図である。 図において、1はキューメモリ(Q−M)、2はキュー
書込カウンタ(CW)、 3はキュー読取カウンタ(C
R)、4はキュー先取シカウンタ(CB)、5はキュー
実行済カウンタ(CF)、13〜16は加算回路、17
.19は比較回路、18はデコーダ。 20.21は遅延回路である。 第1図(b) 第2図 第3図 (a)        (b)           
  (C)第4区 第5図 第7図
1(a) and (b) are block diagrams showing the configuration of an embodiment according to the present invention, FIG. 2 is a block diagram showing an example of the configuration of an electronic computer having a conventional pipeline structure, and FIG. a) # (b) and (c) are flowcharts of example programs that are elements that disturb the flow of the Tsukubu line;
Figure 4 is an example of a specific program of the flowchart in Figure 3 (a), and Figures 5 (1) to (6) are examples of when the program in Figure 4 is executed by the computer in Figure 2. FIG. 3 is a diagram for explaining the movement of an instruction queue. 6(,) and (b) are 9 diagrams for explaining the operation of a counter that controls the instruction queue according to the present invention, and FIGS. 7(1) to (4) are 2 diagrams according to the present invention. FIG. 8 is a diagram illustrating an example of an interface signal between the instruction queue unit and other units according to the present invention. . In the figure, 1 is the queue memory (Q-M), 2 is the queue write counter (CW), and 3 is the queue read counter (C
R), 4 is a queue preemption counter (CB), 5 is a queue execution counter (CF), 13 to 16 are addition circuits, 17
.. 19 is a comparison circuit, and 18 is a decoder. 20.21 is a delay circuit. Figure 1 (b) Figure 2 Figure 3 (a) (b)
(C) Ward 4, Figure 5, Figure 7

Claims (1)

【特許請求の範囲】[Claims] 1、先取りされてまだ実行されていない命令が書き込ま
れ、解読実行のために読み出された命令を記憶する記憶
回路と、該記憶回路に書込みアドレスを与えるキュー書
込みカウンタと、前記記憶回路に読取りアドレスを与え
るキュー読取りカウンタと、先取りされてまだ未実行の
まま前記記憶回路にある命令の数を示すキュー先取りカ
ウンタと、解読、又は実行済であるが、まだ前記記憶回
路に残っている命令の数を示すキュー実行済カウンタと
、これ等の要素を制御する制御回路とから構成され、分
岐命令を解読したとき、その分岐アドレスの指す命令が
前記記憶回路内にあるか否かを、前記キュー先取りカウ
ンタ及び前記キュー実行済カウンタと該分岐アドレスと
を比較することにより判断し、前記記憶回路にある場合
には前記キュー読取りカウンタ、前記キュー先取りカウ
ンタおよび前記キュー実行済カウンタを該分岐アドレス
をもとに加算、又は減算することにより更新し、前記記
憶回路内にない場合には前記4つのカウンタ総てをクリ
アし、該キュー先取りカウンタの内容により命令の解読
実行の続行、停止または命令の先取りを要求することを
特徴とする電子計算機における命令キュー制御方式。
1. A memory circuit in which prefetched and unexecuted instructions are written and which stores instructions read out for decoding execution; a queue write counter that provides a write address to the memory circuit; and a queue write counter that provides a write address to the memory circuit; a queue read counter that provides an address; a queue prefetch counter that indicates the number of instructions that have been prefetched and are still unexecuted in said storage circuit; and a queue preemption counter that indicates the number of instructions that have been decoded or executed but still remain in said storage circuit. When a branch instruction is decoded, the queue execution counter indicates whether or not the instruction pointed to by the branch address is in the storage circuit. The determination is made by comparing the prefetch counter and the queue executed counter with the branch address, and if the queue read counter, the queue preemption counter, and the queue executed counter are stored in the storage circuit, the queue read counter, the queue preemption counter, and the queue executed counter are also updated based on the branch address. If it is not in the storage circuit, all four counters are cleared, and depending on the contents of the queue preemption counter, the instruction decoding execution is continued, stopped, or the instruction preemption is performed. An instruction queue control method for an electronic computer characterized by requesting the following.
JP11026085A 1985-05-24 1985-05-24 Instruction queue control system of electronic computer Pending JPS61269735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11026085A JPS61269735A (en) 1985-05-24 1985-05-24 Instruction queue control system of electronic computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11026085A JPS61269735A (en) 1985-05-24 1985-05-24 Instruction queue control system of electronic computer

Publications (1)

Publication Number Publication Date
JPS61269735A true JPS61269735A (en) 1986-11-29

Family

ID=14531181

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11026085A Pending JPS61269735A (en) 1985-05-24 1985-05-24 Instruction queue control system of electronic computer

Country Status (1)

Country Link
JP (1) JPS61269735A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02275532A (en) * 1989-04-17 1990-11-09 Nec Corp Processor with prefetching function
JPH05241827A (en) * 1992-02-27 1993-09-21 Nec Ibaraki Ltd Command buffer controller
JPH0773034A (en) * 1993-09-07 1995-03-17 Nec Corp Information processor
JP2007257349A (en) * 2006-03-23 2007-10-04 Fujitsu Ltd Processor and processing method thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02275532A (en) * 1989-04-17 1990-11-09 Nec Corp Processor with prefetching function
JPH05241827A (en) * 1992-02-27 1993-09-21 Nec Ibaraki Ltd Command buffer controller
JPH0773034A (en) * 1993-09-07 1995-03-17 Nec Corp Information processor
JP2007257349A (en) * 2006-03-23 2007-10-04 Fujitsu Ltd Processor and processing method thereof

Similar Documents

Publication Publication Date Title
US20210311856A1 (en) Backward compatibility testing of software in a mode that disrupts timing
JP7284199B2 (en) Backwards compatibility through algorithm matching, feature disablement, or performance limitations
US11853763B2 (en) Backward compatibility by restriction of hardware resources
US5027270A (en) Processor controlled interface with instruction streaming
US6959367B2 (en) System having read-modify-write unit
JPS6217252B2 (en)
US20170286114A1 (en) Processors, methods, and systems to allocate load and store buffers based on instruction type
US5729713A (en) Data processing with first level cache bypassing after a data transfer becomes excessively long
US5924120A (en) Method and apparatus for maximizing utilization of an internal processor bus in the context of external transactions running at speeds fractionally greater than internal transaction times
US20040172518A1 (en) Information processing unit and information processing method
JPS61269735A (en) Instruction queue control system of electronic computer
US6721878B1 (en) Low-latency interrupt handling during memory access delay periods in microprocessors
US5421026A (en) Data processor for processing instruction after conditional branch instruction at high speed
US20160210246A1 (en) Instruction cache with access locking
US7124277B2 (en) Method and apparatus for a trace cache trace-end predictor
JPH06324861A (en) System and method for controlling cpu
US20110185104A1 (en) Merging Subsequent Updates To A Memory Location
KR100336743B1 (en) Processing circuit for data
JPH04340145A (en) Cache memory device
JPS61294550A (en) Data reading and writing control system for electronic computer
JPH08286914A (en) Memory controller
JPH05224920A (en) Data processor
JPH05282146A (en) Information processor
JPS58129553A (en) Pipeline computer
JPH05120010A (en) Information processor of pipe line constitution having instruction cache