JPH0746315B2 - Instruction prefetch control method for computer - Google Patents
Instruction prefetch control method for computerInfo
- Publication number
- JPH0746315B2 JPH0746315B2 JP61198720A JP19872086A JPH0746315B2 JP H0746315 B2 JPH0746315 B2 JP H0746315B2 JP 61198720 A JP61198720 A JP 61198720A JP 19872086 A JP19872086 A JP 19872086A JP H0746315 B2 JPH0746315 B2 JP H0746315B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- stage
- address
- buffer memory
- block transfer
- 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 - Lifetime
Links
Landscapes
- Advance Control (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は電子計算機の命令読出し制御方法に係り、特に
メインメモリとその一部内容の写しを格納するバッファ
メモリを備えた電子計算機における命令の先読み制御方
法に関する。Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction reading control method for an electronic computer, and more particularly to an instruction reading method for an electronic computer provided with a main memory and a buffer memory for storing a copy of a part of its contents. The present invention relates to a prefetch control method.
電子計算機における処理の高速化の一つの方法としてバ
ッファ記憶方式がある。これはメインメモリ上の命令あ
るいはデータの一部の写しを高速バッファメモリに格納
しておき、所望の命令あるいはバッファメモリから読み
出すというものである。なお、目的の命令あるいはデー
タがバッファメモリに存在しない場合は、メインメモリ
からバッファメモリへブロック転送が行われる。There is a buffer storage method as one method for speeding up the processing in an electronic computer. In this method, a copy of a part of an instruction or data on the main memory is stored in a high-speed buffer memory and then read out from the desired instruction or buffer memory. If the target instruction or data does not exist in the buffer memory, block transfer is performed from the main memory to the buffer memory.
電子計算機における処理の高速化の他の方法としては命
令の先読み方式があるが、上記バッファメモリを備えた
電子計算機では、命令の先読みはバッファメモリに対し
て行われる。この種命令の先読み方式の従来技術につい
ては、例えば「日経エレクトロニクス」1979年12月24日
号の104〜130頁に“LSI技術の助けを借りてパイプライ
ン方式を強化した最高速の商用汎用コンピュータ”と題
して記載されている。As another method of speeding up the processing in the electronic computer, there is an instruction prefetching method. In an electronic computer equipped with the buffer memory, the instruction prefetching is performed in the buffer memory. For the prior art of this type of instruction look-ahead system, see, for example, “Nikkei Electronics” December 24, 1979, pages 104 to 130, “The fastest commercial general-purpose computer with an enhanced pipeline system with the help of LSI technology. It is described as ".
従来の命令先読み方式においては、上記文献にも見られ
るように、多くのレジスタ、バッファメモリの半サイク
ル切替え制御、複雑な制御等が必要であり、コスト、開
発の難しさの問題があった。In the conventional instruction prefetching method, as seen in the above-mentioned document, many registers, half-cycle switching control of buffer memory, complicated control, etc. are required, and there are problems of cost and development difficulty.
本発明の目的は、バッファメモリを備えた電子計算機に
おいて、少ない金物量、簡単な制御で性能のよい命令の
先読み制御を実現しようとするものである。SUMMARY OF THE INVENTION An object of the present invention is to realize a prefetch control of an instruction having high performance with a small amount of metal and a simple control in an electronic computer equipped with a buffer memory.
本発明は、バッファメモリに命令読出しの対象命令が存
在する場合にはバッファメモリから当該命令を読出す
が、バッファメモリに命令読出しの対象命令が存在しな
い場合には、該命令読出しの対象命令よりも先行する命
令を処理中でないときはメインメモリからバッファメモ
リへのブロック転送を起動し、該命令読出しの対象命令
よりも先行する命令を処理中のときはブロック転送を起
動しないで読出しを無効とするものである。The present invention reads the instruction from the buffer memory when the instruction to be read exists in the buffer memory, but when the instruction to read from the buffer memory does not exist, the instruction to read from When the preceding instruction is not being processed, block transfer from the main memory to the buffer memory is activated, and when an instruction preceding the instruction to be read is being processed, block transfer is not activated and reading is disabled. To do.
バッファメモリに命令読出しの対象命令が存在する場合
には、先行する命令が処理中でも、該処理中の命令オペ
ランド読出しのバッファメモリ・アクセスの間隙をぬっ
てバッファメモリより命令を先読みする。一方、バッフ
ァメモリに命令読出しの対象命令が存在しない場合に
は、メインメモリからバッファメモリへのブロック転送
を必要とするが、該ブロック転送の実施を場合分し、先
行する命令が処理中の場合にはブロック転送を行わずに
命令の先読みを無効とし、先行する命令が処理中でない
場合、ブロック転送を実行して命令を先読み出しする。
ただし、先行する命令が分岐命令の場合には、該分岐命
令のターゲット命令である分岐先命令がバッファメモリ
に存在しない場合、分岐命令の処理の中で該分岐先命令
のブロック転送を実行する。これにより、少ない金物
量、簡単な制御で、性能のよい命令の先読出し処理が実
現する。When the instruction read target instruction exists in the buffer memory, even if the preceding instruction is being processed, the instruction is prefetched from the buffer memory through the buffer memory access gap of the instruction operand read during the processing. On the other hand, if there is no instruction read target instruction in the buffer memory, block transfer from the main memory to the buffer memory is required. However, if the block transfer is executed, the preceding instruction is being processed. In this case, prefetching of an instruction is disabled without performing block transfer, and if the preceding instruction is not being processed, block transfer is executed to prefetch the instruction.
However, when the preceding instruction is a branch instruction, if the branch destination instruction that is the target instruction of the branch instruction does not exist in the buffer memory, the block transfer of the branch destination instruction is executed during the processing of the branch instruction. As a result, the pre-reading process of a command with good performance is realized with a small amount of metal and simple control.
以下、本発明の一実施例について図面により説明する。 An embodiment of the present invention will be described below with reference to the drawings.
第1図は本発明の一実施例のブロック図を示す。図で1
は本発明の一実施例のブロック図を示す。図で1はメイ
ンメモリ、2はメインメモリ1の写しを格納する高速ア
クセスタイムのバッファメモリ(BS)、3はBS2の登録
アドレスを保持するアドレスアレイ(AA)、4と5は共
に8バイトの命令バッファレジスタ(IBRA,IBRB)、6
と7はIBRA4とIBRB5の有効性表示子(IBVA,IBVB)であ
る。80はオペランドバッファレジスタ(OBR)である。
8は命令切出し回路、16は命令切出しポインタ(IP)、
9は切出した命令を保持する4バイトの命令レジスタ
(IR)である。10は命令アドレスレジスタ(NIA)、11
は命令読出しアドレスを計算するインクレメンタ(INC
A)、12はNIA10を更新するインクレメンタ(INCB)を示
す。14はオペランドアドレスレジスタ(ADR)である。1
7はオペランドアドレス制御回路である。50は命令処理
の制御を司どる制御回路(ICTL)を、51はAA3、BS2の制
御を行う制御回路(BCTL)を示す。70は命令のブロック
転送下でデコード成功の表示子(TS)である。FIG. 1 shows a block diagram of an embodiment of the present invention. 1 in the figure
Shows a block diagram of an embodiment of the present invention. In the figure, 1 is a main memory, 2 is a fast access time buffer memory (BS) that stores a copy of the main memory 1, 3 is an address array (AA) that holds the registered address of BS2, and 4 and 5 are both 8 bytes. Instruction buffer register (IBRA, IBRB), 6
And 7 are validity indicators (IBVA, IBVB) of IBRA4 and IBRB5. 80 is an operand buffer register (OBR).
8 is an instruction cutout circuit, 16 is an instruction cutout pointer (IP),
Reference numeral 9 is a 4-byte instruction register (IR) that holds the cut out instruction. 10 is the instruction address register (NIA), 11
Is the incrementer (INC
A) and 12 indicate an incrementer (INCB) that updates the NIA 10. 14 is an operand address register (ADR). 1
7 is an operand address control circuit. Reference numeral 50 indicates a control circuit (ICTL) that controls the instruction processing, and 51 indicates a control circuit (BCTL) that controls AA3 and BS2. Reference numeral 70 is a decode success indicator (TS) under the block transfer of the instruction.
次に、動作を第2図により説明する。第2図(イ)は4
バイト長の命令がメインメモリ1に入っている状態を示
す。この写しがBS2にも入っており、該アドレスがAA3に
登録されている。Next, the operation will be described with reference to FIG. Figure 2 (a) is 4
Indicates that a byte length instruction is stored in the main memory 1. This copy is also included in BS2, and the address is registered with AA3.
いま、命令アドレスがNIA10に、初期値として100番地を
セットして、命令実行スタートがかゝった場合について
説明する。Now, the case where the instruction address is set to NIA10 and the address 100 is set as the initial value and the instruction execution is started will be described.
初期状態は、IBVA6,IBVB7が共に“0"である。即ち、IBR
A4,IBRB5が共に空状態である。スタート指示で、第2図
(ハ)の命令読出しステージが起動される。即ち、IC
TL50にて、NIA10の内容(100番地が入っている)をINCA
11にて第2図(ロ)の加算(本ケースはNIA+0)を行
い、このアドレス(100番地)をセレクタ15を経由し
て、線22にてAA3に送る制御を行う。これと同時に、ICT
L50からBCTL51に制御線60にて、命令読出し指示(AI指
示)が出される。これを受けて、BCTL51では該アドレス
にてAA3の参照を行う。また、アドレス線22の8バイト
単位での偶・奇を示すビット値をフリップフロップIFP1
3にセットしておく。(本ケースでは、100番地ゆえ、IF
P13は“0"になる。) 以上が、第2図(ハ)の第1サイクルのAIステージの
動作である。サイクルでは、LIステージの動作を行
う。このステージでは、ICTL50からBCTL51に、LIステー
ジの指示が出される。これを受けたBCTL51では、AIステ
ージでのAA3の参照結果に基づいて、100番地がAA3に登
録されていれば、BS2から該命令を8バイト読出して、I
BRA44及びIBRB5に送る。同時にICTL50に、線61を通じて
その旨の報告を行う。これにより、ICTL50では、事前に
セットしてあったIFP13の値(本ケースでは“0")に従
い、IBRA4に8バイトのデータを取込み、同時にIBVA6を
“1"にセットする。In the initial state, both IBVA6 and IBVB7 are “0”. IBR
Both A4 and IBRB5 are empty. The instruction reading stage of FIG. 2C is activated by the start instruction. That is, IC
At TL50, INCA the contents of NIA10 (containing 100 addresses)
The addition (NIA + 0 in this case) of FIG. 2 is performed at 11 and the control is performed to send this address (address 100) to AA3 via line 22 via the selector 15. At the same time, ICT
An instruction read instruction (AI instruction) is issued from L50 to BCTL51 via control line 60. In response to this, the BCTL 51 refers to AA3 at the address. In addition, the bit value indicating even / odd in units of 8 bytes of the address line 22 is set to the flip-flop IFP1.
Set to 3. (In this case, since the address is 100, the IF
P13 becomes “0”. ) The above is the operation of the AI stage in the first cycle of FIG. In the cycle, the operation of the LI stage is performed. In this stage, the ICTL50 gives BCTL51 instructions for the LI stage. In response to this, the BCTL51 reads 8 bytes of the instruction from BS2 if 100 is registered in AA3 based on the reference result of AA3 in the AI stage,
Send to BRA44 and IBRB5. At the same time, it will be reported to ICTL 50 via line 61. As a result, the ICTL50 fetches 8 bytes of data into IBRA4 according to the value of IFP13 set in advance (“0” in this case), and simultaneously sets IBVA6 to “1”.
もし、100番地がAA3に登録されていなければ、BCTL51は
該アドレスをメインメモリ1に送り、メインメモリ1か
らBS2へブロック転送を行う。そして、アドレスをAA3に
登録する。この間、BCTL51からのブロック転送指示で、
ICTL50は動作を一時停止する。このブロック転送は後
で、詳述する。If the address 100 is not registered in AA3, the BCTL 51 sends the address to the main memory 1 and transfers the block from the main memory 1 to BS2. Then, the address is registered in AA3. During this time, a block transfer instruction from BCTL51
ICTL50 suspends operation. This block transfer will be described later in detail.
以上のようにして、AI−LIステージによりIBRA4に8バ
イトの命令がセットされる。As described above, an 8-byte instruction is set in IBRA4 by the AI-LI stage.
一方、スタートと同時に、ICTL50では、第2図(ハ)に
示すように、サイクルからのDステージが起動され
る。これは、命令解読ステージであり、IBRA4,IBRB5か
ら命令切出しポインタIP16に従って、命令切出し回路8
にて命令(命令(1))を切出してIR9にセットし、さ
らにそのオペランドをアドレス制御回路17に送り、この
中でオペランドアドレスを算出し、結果をADR14にセッ
トする。このDステージは、サイクルではまた命令読
出しが成功していないからDステージ失敗となる。サイ
クルでも同様である。そして、命令がIBRA4に取込み
れた後のサイクルにてDステージは成功する。この
時、IP16は初期状態“0"になっている(100番地スター
トゆえ)ため、IBRA4の先頭4バイトがIR9に切出されて
セットされる。この切出し後、IP16は、命令長分だけ更
新されて“4"がセットされる。On the other hand, at the same time as the start, in the ICTL50, the D stage from the cycle is activated as shown in FIG. This is the instruction decoding stage, and the instruction cutout circuit 8 from IBRA4, IBRB5 according to the instruction cutout pointer IP16.
At, the instruction (instruction (1)) is cut out and set in IR9, and its operand is sent to the address control circuit 17, in which the operand address is calculated and the result is set in ADR14. In this D stage, since the instruction reading is not successful in the cycle, the D stage fails. The same applies to cycles. Then, the D stage succeeds in the cycle after the instruction is taken into IBRA4. At this time, since the IP16 is in the initial state “0” (because it starts at address 100), the first 4 bytes of IBRA4 are cut out and set to IR9. After this cutout, the IP16 is updated by the instruction length and set to "4".
ICTL50では、サイクルのDステージが成功したので、
サイクルではAステージを起動する。即ち、オペラン
ドアドレスをADR14から、セレクタ15を経由してAA3に送
る。同時に、BCTL51にA動作を指示する。BCTL51では、
該アドレスでのAA3の参照動作を行う。次のサイクル
では、L動作がICTL50からBCTL51に指示され、BCTL51で
は、該アドレスがAA3にあれば、対応するデータをBS2か
ら読出し、OBR80にセットし、AA3になければブロック転
送処理が行われる。次のサイクルでは、ICTL50からマ
イクロプログラム制御回路に指示が出されて、マイクロ
プログラムに従った動作が行われる。In ICTL50, the D stage of the cycle was successful, so
In the cycle, the A stage is activated. That is, the operand address is sent from the ADR 14 to the AA 3 via the selector 15. At the same time, the BCTL 51 is instructed to perform the A operation. In BCTL51,
The reference operation of AA3 at the address is performed. In the next cycle, the L operation is instructed from ICTL50 to BCTL51. In BCTL51, if the address is in AA3, the corresponding data is read from BS2 and set in OBR80. If it is not in AA3, block transfer processing is performed. In the next cycle, the ICTL 50 issues an instruction to the microprogram control circuit, and the operation according to the microprogram is performed.
次命令(命令(2))のDステージはサイクルでICTL
50にて開始される。これは、命令(1)の命令コードを
みて、命令(1)のEステージが1マシンサイクルで完
了することを認確して開始するものである。もし、Eが
2サイクル以上の命令においては、最終Eステージの直
前のステージにて、マイクロプログラムによる次命令の
Dステージ起動がICTL50に出される。The D stage of the next instruction (instruction (2)) is a cycle of ICTL
It starts at 50. This is to start by observing the instruction code of the instruction (1) and confirming that the E stage of the instruction (1) is completed in one machine cycle. If E is an instruction of 2 cycles or more, the D stage activation of the next instruction by the microprogram is issued to ICTL50 in the stage immediately before the final E stage.
以上のようにして、次々と命令が処理されていく。命令
(2)のDステージ成功時に、IBVA6は“0"にリセット
される。(IBRA4を使い切ったゝめ) 一方、命令読出し第2図(ハ)の,サイクルのAI−
LI以降は、以下のように行われる。As described above, the commands are processed one after another. IBVA6 is reset to "0" when the D stage of the instruction (2) is successful. (Insufficient use of IBRA4) On the other hand, AI for the cycle of instruction read in Fig. 2 (c)
After LI, the procedure is as follows.
即ち、サイクルの先頭では、まだDステージが成功し
ていないので、サイクルにて再度AIステージを起動す
る。但し、このときのINCA11の動作は第2図(ロ)に示
すように、IBVA6が“1"のため、NIA+8(即ち、108番
地)が出力される。このアドレスにてAA3が参照され
る。一方、IFP13は“1"にセットされる。That is, at the beginning of the cycle, since the D stage has not succeeded yet, the AI stage is activated again in the cycle. However, in the operation of INCA 11 at this time, as shown in FIG. 2B, since IBVA6 is "1", NIA + 8 (that is, address 108) is output. AA3 is referenced at this address. On the other hand, IFP13 is set to "1".
サイクルの終りでDステージ成功状態になると、サイ
クルではLp指示がICTL50からBCTL51に出される。この
Lp指示を受けたBCTL51は、AA3の参照結果で以下の動作
を行う。即ち、該アドレス(108番地)が、AA3上にあれ
ば該当データ(命令)をBS2から読出して命令バッファ
に送るが、もしAA3上になければ何もしない。つまり、
ブロック転送を発生しない。When the D stage is in a successful state at the end of the cycle, the Lp instruction is issued from ICTL50 to BCTL51 in the cycle. this
The BCTL 51 that has received the Lp instruction performs the following operation according to the reference result of AA3. That is, if the address (address 108) is on AA3, the corresponding data (instruction) is read from BS2 and sent to the instruction buffer, but if it is not on AA3, nothing is done. That is,
Do not generate block transfer.
今、108番地がAA3上にあるとすると、BS2から読出した
8バイトの命令はIFP13が“1"のため、IBRBに取込ま
れ、同時にIBVB7が“1"にセットされる。Now, assuming that address 108 is on AA3, the 8-byte instruction read from BS2 is taken into IBRB because IFP13 is "1", and at the same time IBVB7 is set to "1".
NIA10は、命令処理のLステージにて、INCB12にて、命
令長だけ加算される。即ち、100に4が加えられ、サイ
クルで104に更新される。分岐命令時は、分岐先アド
レスがADR14からのパスでNIA10にセットされる。次にIC
TL50にて、Aステージのサイクルの次サイクルで次
の命令読出しが起動される。このときは、先行命令
(1)のA〜Eステージ中であるため、ICTL50にて、次
サイクルでAp指示が出される。アドレスは第2図
(ロ)により116である。At the L stage of instruction processing, NIA10 adds the instruction length at INCB12. That is, 4 is added to 100 and updated to 104 in the cycle. At the time of a branch instruction, the branch destination address is set in NIA10 by the path from ADR14. Next IC
In TL50, the next instruction read is activated in the cycle next to the cycle of the A stage. At this time, since the A to E stages of the preceding instruction (1) are being performed, the Ap instruction is issued by the ICTL50 in the next cycle. The address is 116 according to FIG.
これは、先行命令(1)のEステージが完了していない
ときの命令先取り指示であり、AIステージとの差は、Ap
の次ステージは必ずLpステージになり、ApステージのAA
3の参照の結果、該命令アドレスがAA3にないことが判明
しても、次命令(2)のDステージの成功、不成功に拘
らずブロック転送は起動されない。This is an instruction prefetch instruction when the E stage of the preceding instruction (1) is not completed. The difference from the AI stage is Ap.
The next stage is always the Lp stage, and the Ap stage AA
As a result of the reference of 3, even if it is found that the instruction address is not in AA3, the block transfer is not activated regardless of the success or failure of the D stage of the next instruction (2).
Ap−Lpは、先行制御用命令先取りとして、第2図(ハ)
の,,,で起動される。Ap-Lp is shown in Fig. 2 (c) as a preemptive command prefetch.
It is started with ,,,.
然るに、命令先取り動作のAp−Lpをみてみると、第2
図(ロ)に従い、のAIのアドレスは、NIA+16、即
ち、104+16=120番地であり、IP16は“0"を指してい
る。Lpステージ(第サイクル)でBS2から読出してき
た8バイトの命令(アドレス120番地)は、IP16が“0"
のため、IBRA4に取込もうとする。然るに、IBVA6が“1"
のまゝのため、IBRA4には取込めず、読出したダータ
(命令)は捨てられる。However, looking at Ap-Lp of the instruction prefetching operation,
According to the figure (b), the AI address is NIA + 16, that is, 104 + 16 = 120 address, and IP16 indicates “0”. The 8-byte instruction (address 120) read from BS2 in the Lp stage (cycle 1) has an IP16 of "0".
Therefore, I try to import it into IBRA4. However, IBVA6 is "1"
Therefore, it cannot be loaded into IBRA4 and the read data (instruction) is discarded.
このようにして、第2図(ハ)に示すように命令が処理
されてゆく。In this way, the instructions are processed as shown in FIG.
分岐命令での分岐成功のように、命令アドレスがシーケ
ンシャルに更新されない場合は、IBVA6,IBVB7は共に一
担“0"にリセットされた後、新しく読出された命令がIB
RA4,IBRB5にセットされる。この読出しは、分岐命令タ
イプによっては、オペランド読出しとしてBS2から読出
されたデータが、命令読出しに化かされて、そのまゝIB
RA4またはIBRB5に取込まれる。詳細は公知の技術につき
省略する。If the instruction address is not updated sequentially, as in the case of successful branching in a branch instruction, IBVA6 and IBVB7 are both reset to "0" and the newly read instruction is IB.
It is set to RA4 and IBRB5. Depending on the branch instruction type, this read may be performed by converting the data read from BS2 as an operand read into an instruction read.
Incorporated into RA4 or IBRB5. Details are omitted because they are known techniques.
次に、命令先取りAp−Lpで該当アドレスがAA3上になか
った場合について述べる。このときは該命令読出しは失
敗とする。そして、新たにAp−Lpを起動しても、(オペ
ランドの読出しでのブロック転送で該命令が同じブロッ
クのために持ってこられる場合を除いて)成功はしな
い。そのうちに、IBRA4,IBRB5上の先取り命令を使い切
ると、第3図(イ)に示すように、命令(2)のステー
ジの先行制御を失敗し、命令(1)終了後、改めて命令
読出しがAI−LIの形で起動され、命令(2)がブロッ
ク転送により読出されることになる。Next, the case where the corresponding address is not on AA3 in the instruction prefetch Ap-Lp will be described. At this time, the instruction reading fails. Then, even if Ap-Lp is newly activated, it is not successful (except when the instruction is brought for the same block in the block transfer in the reading of the operand). When the prefetch instructions on IBRA4 and IBRB5 are used up, the pre-control of the stage of instruction (2) fails and the instruction read is restarted after the instruction (1) is completed. -Started in the form of LI, instruction (2) will be read by block transfer.
ブロック転送では、メインメモリ1から64バイト(以
下、バイトはBと略す)がBS2に転送されて書込まれ
る。この時、パス20を8Bとすると、8回に分けて転送さ
れてくる。従って、データの転送順は、所望の8Bが一番
目に転送されるとは限らない。ブロック転送中は、所望
の8BがBS2に届くまでは、ICTL50は待ち状態となる。所
望の8Bが転送されてくると、ICTL50は再び動き出し、命
令処理のDステージを起動する。これ以降の処理は、命
令アドレスの値、次命令の処理タイプによる異なってく
る。In block transfer, 64 bytes (hereinafter, byte is abbreviated as B) from the main memory 1 are transferred to BS2 and written. At this time, if the path 20 is 8B, it is transferred in 8 times. Therefore, in the data transfer order, the desired 8B is not always transferred first. During the block transfer, the ICTL50 is in a waiting state until the desired 8B reaches BS2. When the desired 8B is transferred, the ICTL 50 starts operating again and activates the D stage of instruction processing. Subsequent processing depends on the value of the instruction address and the processing type of the next instruction.
ブロック転送での所望の8Bデータがメモリ1から転送さ
れたとき、該データ(8バイト)は、BS2に書込まれる
とともにそのまま、IFP13の値により、IBRA4(IFP13が
“0の時)または、IBRB5(IFP13が“1""の時)にも取
込まれる。同時に、IFP13の値が“0"の時はIBVA6が“1"
に、IFP13が“1"の時はIBVB7が“1"にセットされる。こ
の状態でICTL50は、Dステージを起動するが、このDス
テージが成功(即ち、次命令が全て命令バッファ上に入
っている)したときは、このDステージでTS70を“1"に
セットする。そして、Aステージを起動する。このAス
テージでは、オペランドをメモリアクセスする命令と、
オペランドをメモリアクセスしない(例えばレジスタの
データを用いる)命令とで動作が異なってくる。メモリ
アクセスしない命令では、Aステージの次にLステージ
に入力、引続いてEステージ(即ち、命令の演算処理)
に入る。そして、この命令処理の裏でAp−Lpが起動され
るが、このAp−Lp動作は、ブロック転送処理が完了して
いなければ無視されて、見かけ上、Ap起動がなかったか
のように(即ち、待ち状態は起きずに)命令処理は継続
されていく。When the desired 8B data in the block transfer is transferred from the memory 1, the data (8 bytes) is written to BS2 and is kept as it is, depending on the value of IFP13, IBRA4 (when IFP13 is “0”) or IBRB5. (When IFP13 is “1” ”) At the same time, when the value of IFP13 is "0", IBVA6 is "1".
IBVB7 is set to “1” when IFP13 is “1”. In this state, the ICTL 50 activates the D stage, but when this D stage succeeds (that is, all the next instructions are in the instruction buffer), TS70 is set to "1" in this D stage. Then, the A stage is activated. In this A stage, an instruction to access the operand memory,
The operation differs depending on the instruction that does not access the operand memory (for example, using register data). For instructions that do not access the memory, input to the L stage after the A stage, and subsequently to the E stage (that is, instruction arithmetic processing)
to go into. Then, Ap-Lp is activated behind the instruction processing, but this Ap-Lp operation is ignored unless the block transfer processing is completed, and apparently, as if Ap activation did not occur (that is, Command processing continues without waiting.
第3図(イ)を更に詳述する。AI−LIステージによ
り、ブロック転送が行われ、データが8Bずつ8回転送さ
れてBS2に書込まれる。今、所望の8Bが、にて転送さ
れてくると、該データはBSに書込まれると同時に、そ
のままIBRA4にも取り込まれ、IBVA6が“1"にセットされ
る。そして、命令(2)はDステージ成功となり、TS70
を“1"にセットする。このTS70は、ブロック転送終了時
に“0"にリセットされる。命令(2),命令(3)は共
にオペランドとしてBS2をアクセスしない命令ゆえ、命
令ステージD−A−L−Eと流れるが、命令(4)はオ
ペランドがメモリアクセスを必要とすると、命令(4)
のDステージ終了後に、ブロック転送の完了待ち状態と
なり、命令(3)のEステージ、命令(4)のEステー
ジが、ブロック転送完了まで待される。ブロック転送が
完了すると、命令(4)のオペランドのBS2アクセスが
A−Lステージとして処理され、命令(3)のEステー
ジも実行される。FIG. 3 (a) will be described in more detail. Block transfer is performed by the AI-LI stage, data is transferred 8B by 8B and written to BS2. Now, when the desired 8B is transferred by, the data is written into the BS, and at the same time, taken into the IBRA4 as it is, and IBVA6 is set to "1". And the instruction (2) succeeded in D stage, and TS70
Set to “1”. This TS70 is reset to "0" at the end of the block transfer. Since both the instruction (2) and the instruction (3) do not access BS2 as an operand, they flow to the instruction stage D-AL-E. However, the instruction (4) does not operate if the operand requires memory access. )
After the end of the D stage, the block transfer completion waiting state is entered, and the E stage of the instruction (3) and the E stage of the instruction (4) are waited until the block transfer is completed. When the block transfer is completed, the BS2 access of the operand of the instruction (4) is processed as the AL stage, and the E stage of the instruction (3) is also executed.
また、命令のブロック転送時、所望の8Bデータが来て
も、Dステージが不成功になるときがある。例えば、デ
コード対象命令が8B境界をクロスしている場合である。
このときは、所望の8Bデータ(これを、ターゲットアド
レスの指す8Bと言う)に隣接したアドレス(ターゲット
アドレス+8)の指す8Bデータが転送されてきて、これ
がIFP13の指す反対側のIBRA4またはIBRB5に取込まれた
時点でDステージが成功となる。このDステージが成功
するまで、命令制御ステージはDステージが連続するこ
とになる。第3図(ロ)にこのケースを示す。ブロック
転送のデータで所望の8Bが、データでターゲットア
ドレス+8のデータが転送されて来たケースである。命
令(3)は、オペランドがBS2へアクセスするたる、待
ち状態が発生している。Also, in the block transfer of an instruction, the D stage may fail even if the desired 8B data comes. For example, this is the case when the instruction to be decoded crosses the 8B boundary.
At this time, the 8B data pointed to by the address (target address + 8) adjacent to the desired 8B data (this is called 8B pointed by the target address) is transferred, and this is transferred to IBRA4 or IBRB5 on the opposite side pointed to by IFP13. The D stage becomes successful when it is captured. Until the D stage is successful, the instruction control stage will be continuous with the D stage. This case is shown in FIG. In this case, the desired 8B of block transfer data and the target address + 8 of data have been transferred. The instruction (3) has a waiting state in which the operand accesses BS2.
次に、命令のブロック転送が完了しても、Dステージが
成功しない場合を説明する。この場合はデコード対象命
令が64B境界をまたがって存在しているケースである。
このケースでは、ブロック転送の完了後、改めてAIステ
ージを起動する。即ち、TA70が“0"のまゝ、命令読出し
のブロック転送が終了する場合、終了時のAIステージを
開始する。このAI−LIにより、デコード対象命令の未フ
ェッチ分がBS2から命令バッファ4または5にフェッチ
される。このとき、再び、該当ブロックがBS2の中にな
ければ、ブロック転送が起動される。Next, a case where the D stage does not succeed even if the block transfer of the instruction is completed will be described. In this case, the decoding target instruction exists across the 64B boundary.
In this case, the AI stage is activated again after the block transfer is completed. That is, when TA70 is "0" and the block transfer for instruction read is completed, the AI stage at the end is started. By this AI-LI, the unfetched portion of the instruction to be decoded is fetched from BS2 to the instruction buffer 4 or 5. At this time, if the corresponding block is not in BS2 again, block transfer is activated.
次に、分岐命令のターゲット命令(分岐成功時の分岐先
命令)の読出しで、該ブロックがBS2にないときの動作
について述べる。この場合は、分岐命令の完了を待たず
に分岐命令自身のA−Lステージ(これは本来、オペラ
ンドステージであるが、分岐命令ではターゲット命令の
フェッチ動作となる)にて、ターゲット命令のブロック
転送を行う。第4図(イ)にこの例を示す。分岐命令の
分岐成功、不成功はLステージにて判定する。分岐成功
で且つ、ターゲット命令がBS2にないと、ブロック転送
を起動し、データにてターゲット命令がフェッチされ
ると、分岐命令自身のEステージ及びターゲット命令の
Dステージを起動する。Next, the operation when the target instruction of the branch instruction (the branch destination instruction when the branch is successful) is not present in BS2 will be described. In this case, the block transfer of the target instruction is performed at the A-L stage of the branch instruction itself (this is originally an operand stage, but the target instruction is fetched by the branch instruction) without waiting for the completion of the branch instruction. I do. This example is shown in FIG. The success or failure of the branch of the branch instruction is determined in the L stage. When the branch is successful and the target instruction is not in BS2, the block transfer is activated, and when the target instruction is fetched by the data, the E stage of the branch instruction itself and the D stage of the target instruction are activated.
第4図(ロ)には、ターゲット命令がブロック境界をま
たがるケースについて図示してある。この時は、ブロッ
ク転送終了後、改めてターゲットアドレス+8のアドレ
スにて、AI−LIステージが起動される。FIG. 4B shows a case where the target instruction crosses block boundaries. At this time, after the block transfer is completed, the AI-LI stage is activated again at the target address + 8 address.
また、マイクロプログラムで制御するEステージが1サ
イクルで終らないときは、第5図に示すように、マイク
ロプログラム指示で命令読出しや、次命令(2)のD
ステージが起動される。Further, when the E stage controlled by the microprogram does not end in one cycle, as shown in FIG. 5, instruction reading by the microprogram instruction or D of the next instruction (2) is performed.
The stage is activated.
本実施例では、命令バッファレジスタは8バイトが2本
としたが、これは任意の構成でも適用できることは明白
である。In this embodiment, the instruction buffer register has two 8 bytes, but it is obvious that this can be applied to any configuration.
また、実行制御は、基本命令処理で2マシンサイクルず
らして次命令を起動するとしたが、これは1マシンサイ
クルまたは3マシンサイクル以上ずらしてもよい。な
お、1マシンサイクルずらす場合、オペランドの読出し
が必要で、且つ、演算サイクルが1マシンサイクルの命
令が連続するとき、バッファメモリは毎サイクルがオペ
ランド読出しで占有されて、命令先取りアクセスが行わ
れないことになる。しかし、オペランドのバッファメモ
リアクセスが不要な命令(例えば、レジスタ−レジスタ
オペランド同士の演算命令)が一つでも現われると、そ
のA−Lステージそのものが、Ap−Lpステージとして動
作させることができる。Further, the execution control is to shift the next instruction by two machine cycles in the basic instruction processing, but this may be shifted by one machine cycle or three machine cycles or more. When shifting by one machine cycle, it is necessary to read the operand, and when the operation cycle is one machine cycle of instructions, the buffer memory is occupied by the operand read every cycle, and the instruction prefetch access is not performed. It will be. However, when even one instruction (for example, an arithmetic instruction between register-register operands) that does not require access to the buffer memory of the operand appears, the A-L stage itself can operate as an Ap-Lp stage.
上記実施例では、命令ブロック転送のデータは、連続し
て転送されるとしたが、これはメモリ構成によっては途
中で途切れることがある。また、所望データは常に先頭
に転送されてくるような構成でも本発明は適用されるこ
とは明らかである。また、転送ピッチは1マシンサイク
ルとしたが、任意のピッチで転送する場合でも、またデ
ータ幅、ブロック・サイズが任意の場合にも、本発明の
実施は可能である。In the above embodiment, the data of the instruction block transfer is assumed to be transferred continuously, but this may be interrupted in the middle depending on the memory configuration. Further, it is obvious that the present invention can be applied to a configuration in which desired data is always transferred to the head. Although the transfer pitch is one machine cycle, the present invention can be implemented even when transferring at an arbitrary pitch, or when the data width and block size are arbitrary.
また、ステージはD−A−L−Eとしたが、これは任意
でもよい。例えば、DはD−Mと2つのステージ(Dは
デコード、Mはオペランドアドレス計算)に分けて行
い、次命令とは2ステージずらして流す場合にも適用で
きる。Although the stage is D-AL-E, this may be arbitrary. For example, it is also applicable to a case where D is divided into D-M and two stages (D is decoding, M is operand address calculation) and is shifted by two stages from the next instruction.
以上述べたように、本発明によれば、命令の先取りを、
先行命令のオペランドのメモリアクセスを乱さないよう
に間隙をぬってバッファメモリをアクセスして行い、命
令がバッファメモリ上にないときは、先行命令の処理の
有無によってブロック転送を起動するか無効とするかの
場合分けを行うことにより、先行する命令を処理中で、
この先行命令によるバッファアクセスが発生していたと
しても、命令先取りのブロック転送は抑止されるため、
バッファメモリ上での制御および命令系レジスタでの制
御が簡単になり、性能の良い命令読出し処理を実現でき
る。As described above, according to the present invention, prefetching of instructions is
The buffer memory is accessed through a gap so as not to disturb the memory access of the operand of the preceding instruction, and when the instruction is not in the buffer memory, block transfer is activated or invalidated depending on whether the preceding instruction is processed. By dividing the case, the preceding instruction is being processed,
Even if the buffer access by the preceding instruction occurs, the block transfer of the instruction prefetch is suppressed,
The control on the buffer memory and the control on the instruction system register are simplified, and a high-performance instruction reading process can be realized.
第1図は本発明の一実施例のブロック図、第2図は本発
明の基本動作を説明する図、第3図は命令のブロック転
送処理の動作を説明する図、第4図は分岐命令の動作を
説明する図、第5図は演算サイクルが1サイクルで終ら
ない場合の動作を説明する図を示す。 1…メインメモリ、2…バッファメモリ、3…アドレス
・アレイ、4,5…命令バッファ、6,7…命令バッファ有効
性表示子、8…命令切出し回路、9…命令レジスタ、10
…命令アドレスレジスタ、11…アドレスインクレメン
タ、70…命令のブロック転送下のデコード成功の表示
子。FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram for explaining the basic operation of the present invention, FIG. 3 is a diagram for explaining the operation of instruction block transfer processing, and FIG. 4 is a branch instruction. 5 is a diagram for explaining the operation of FIG. 5, and FIG. 5 is a diagram for explaining the operation when the operation cycle does not end in one cycle. 1 ... Main memory, 2 ... Buffer memory, 3 ... Address array, 4,5 ... Instruction buffer, 6,7 ... Instruction buffer validity indicator, 8 ... Instruction cutout circuit, 9 ... Instruction register, 10
… Instruction address register, 11… Address incrementer, 70… Indicator of successful decoding under instruction block transfer.
Claims (2)
の写しを格納するバッファメモリを備えた電子計算機に
おける命令の先読み制御方法であって、 バッファメモリに命令読出しの対象命令が存在する場合
には該バッファメモリから当該命令の読出しを行い、 バッファメモリに命令読出しの対象命令が存在しない場
合には、該命令読出しの対象命令よりも先行する命令を
処理中でないときはブロック転送を起動して、メインメ
モリから当該命令のブロックを読み出してバッファメモ
リへ転送し、前記命令読出しの対象命令よりも先行する
命令を処理中のときは前記ブロック転送を起動しないで
読出しを無効とする、 ことを特徴とする電子計算機の命令先読み制御方法。1. A method for prefetching instructions in an electronic computer comprising a main memory and a buffer memory for storing a copy of part of the contents of the main memory, wherein the instruction read target instruction exists in the buffer memory. Reads the instruction from the buffer memory, and if there is no instruction read target instruction in the buffer memory, activates block transfer if an instruction preceding the instruction read target instruction is not being processed. Reading the block of the instruction from the main memory and transferring it to the buffer memory, and invalidating the reading without activating the block transfer when the instruction preceding the instruction of the instruction reading is being processed. A method for prefetching instructions in a computer.
命令先読み出し制御方法において、命令読出しの対象命
令が分岐命令のターゲット命令である分岐先命令で、該
分岐先命令がバッファメモリに存在しない場合には、前
記分岐命令のオペランド読出し処理としてブロック転送
を起動することを特徴とする電子計算機の命令先読み制
御方法。2. An instruction destination read control method for an electronic computer according to claim 1, wherein the instruction read target instruction is a branch destination instruction which is a target instruction of a branch instruction, and the branch destination instruction is stored in a buffer memory. If not present, a block transfer is activated as an operand read process of the branch instruction, and an instruction prefetch control method for a computer is characterized.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61198720A JPH0746315B2 (en) | 1986-08-25 | 1986-08-25 | Instruction prefetch control method for computer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61198720A JPH0746315B2 (en) | 1986-08-25 | 1986-08-25 | Instruction prefetch control method for computer |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6354632A JPS6354632A (en) | 1988-03-09 |
| JPH0746315B2 true JPH0746315B2 (en) | 1995-05-17 |
Family
ID=16395880
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61198720A Expired - Lifetime JPH0746315B2 (en) | 1986-08-25 | 1986-08-25 | Instruction prefetch control method for computer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0746315B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5027270A (en) * | 1988-10-11 | 1991-06-25 | Mips Computer Systems, Inc. | Processor controlled interface with instruction streaming |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS524741A (en) * | 1975-06-30 | 1977-01-14 | Hitachi Ltd | Memory control system |
-
1986
- 1986-08-25 JP JP61198720A patent/JPH0746315B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6354632A (en) | 1988-03-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH06236268A (en) | Apparatus and method for determining instruction length | |
| KR910006144B1 (en) | Loosely coupled pipeline processor | |
| JPS6125169B2 (en) | ||
| JPH02287626A (en) | Pipeline system branch instruction controller | |
| JPH06161779A (en) | Interruption control system for data processor | |
| JPH0746315B2 (en) | Instruction prefetch control method for computer | |
| US5197133A (en) | Control store addressing from multiple sources | |
| JPH02214937A (en) | Data processor | |
| JP2814683B2 (en) | Instruction processing unit | |
| JPH0769825B2 (en) | Parallel processor | |
| JPS63163929A (en) | Microprocessor | |
| JPS6277648A (en) | Instruction read control method | |
| JP2532560B2 (en) | Data processing device for high-performance exception handling | |
| JPS5896345A (en) | Hierarchical calculation method | |
| JP3078293B2 (en) | Storage controller | |
| JP3739556B2 (en) | Information processing device | |
| JP2535593B2 (en) | Information processing device | |
| JP2835179B2 (en) | Parallel processing computer | |
| JPH0248733A (en) | information processing equipment | |
| JP2763450B2 (en) | Pipeline processing data processing device | |
| JPH0235330B2 (en) | ||
| JPH07104783B2 (en) | Pipeline control equipment | |
| JPH024011B2 (en) | ||
| JPH0752402B2 (en) | Data processing device | |
| JPS6020245A (en) | Instruction control circuit of data processor |