JPH05313888A - Instruction buffer system - Google Patents

Instruction buffer system

Info

Publication number
JPH05313888A
JPH05313888A JP11621792A JP11621792A JPH05313888A JP H05313888 A JPH05313888 A JP H05313888A JP 11621792 A JP11621792 A JP 11621792A JP 11621792 A JP11621792 A JP 11621792A JP H05313888 A JPH05313888 A JP H05313888A
Authority
JP
Japan
Prior art keywords
instruction
fetch
write
pointer
bytes
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.)
Withdrawn
Application number
JP11621792A
Other languages
Japanese (ja)
Inventor
Tsuyoshi Mori
強 森
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP11621792A priority Critical patent/JPH05313888A/en
Publication of JPH05313888A publication Critical patent/JPH05313888A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)
  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To simplify circuit constitution and to enable high integration by constituting an instruction by a specified register file or a RAM and controlling the register file or the RAM by write and read pointers. CONSTITUTION:The system is provided with a memory for storing programs and an instruction buffer for taking out the instruction from the memory to be stored prior to the execution of the instruction. The instruction buffer is constituted of register files 600, 610,... or the RAM with the width of the minimum unit (2 bytes for example) of the instruction length in the arrangement so as to be the width (8 bytes) capable of fetching the instruction from the memory at one time. A write pointer 700 indicates a head position for writing at the next fetch of the instruction and a write address circuit 701 controls the write address of the register file and a write enable signal with the value of the pointer. A read pointer 800 indicates the head position of the instruction to be executed next and a read address circuit 801 controls the read address with the value.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプログラム記憶方式の計
算機に係り、特に命令をその実行に先立ってメモリから
バッファに順次取り出す命令バッファ方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program storage system computer, and more particularly to an instruction buffer system in which instructions are sequentially fetched from a memory into a buffer prior to execution.

【0002】[0002]

【従来の技術】プログラム記憶方式の計算機において
は、そのプログラムの実行に際して、マシン命令をメモ
リより取り出す、すなわち命令フェッチを行う必要があ
る。 この取り出しは命令の実行の直前において取り出
すことも可能であるが、計算機の性能を上げるために
は、これを前もって取り出して命令バッファと呼ばれる
FIFO(first in first out) 方式のバッファに蓄
え、このバッファから順次命令を取り出して実行する命
令バッファ方式なるものが考案されている。従来では、
この命令バッファはフリップフロップ(以下、FFと記
す)からなるシフトレジスタから構成されていた。
2. Description of the Related Art In a computer of a program storage system, it is necessary to fetch a machine instruction from a memory, that is, perform an instruction fetch when executing the program. This fetching can be done immediately before the execution of the instruction, but in order to improve the performance of the computer, this fetching is done in advance and stored in a FIFO (first in first out) type buffer called an instruction buffer. There has been devised an instruction buffer system in which instructions are sequentially fetched from and executed. Traditionally,
This instruction buffer was composed of a shift register composed of flip-flops (hereinafter referred to as FF).

【0003】従来例として、2バイトを単位としたシフ
トレジスタ構成の命令バッファを以下に示し、各動作に
ついて説明を加える。図10では、命令長が2バイト単
位で、2,4,及び6バイトという値をとる計算機シス
テムで、命令フェッチを一度に2バイトを単位として最
大8バイトを行うことができ、命令バッファの大きさが
16バイトである命令バッファの例を示す。
As a conventional example, an instruction buffer having a shift register structure in units of 2 bytes is shown below, and each operation will be described. In FIG. 10, in a computer system in which the instruction length is a unit of 2 bytes and the values are 2, 4, and 6 bytes, the instruction fetch can be performed up to 8 bytes in units of 2 bytes at a time, and the size of the instruction buffer can be increased. An example of an instruction buffer whose size is 16 bytes is shown.

【0004】図10に於いて、100〜107はそれぞ
れ2バイトの幅を持つレジスタ、110〜117はそれ
ぞれレジスタ100〜107の入力セレクタ、110−
x〜117−xはそれぞれセレクタ110〜117の入
力、200はフェッチ回路、300は分岐先フェッチ回
路、400は有効長制御フラグ群、410は有効長更新
回路、500はシフト量制御回路である。
In FIG. 10, 100 to 107 are registers each having a width of 2 bytes, 110 to 117 are input selectors of the registers 100 to 107, and 110-.
x to 117-x are inputs to the selectors 110 to 117, 200 is a fetch circuit, 300 is a branch destination fetch circuit, 400 is an effective length control flag group, 410 is an effective length update circuit, and 500 is a shift amount control circuit.

【0005】有効長制御フラグ群400は、シフトレジ
スタの内部において、まだ実行されていない命令を保持
しているレジスタを示すフラグ群のことで、2バイト単
位の各レジスタについてそれぞれ有効フラグを設ける場
合や、先頭からどの位置までが有効であるかを示すポイ
ンタとして構成させる場合などが考えられる。ここで
は、ポインタ方式として、その値によって以下の状態を
示すものとする。
The effective length control flag group 400 is a flag group showing registers which hold an instruction which has not been executed in the shift register. When an effective flag is provided for each register of 2 bytes. Alternatively, it may be configured as a pointer indicating which position from the beginning is effective. Here, the pointer system is assumed to indicate the following states depending on its value.

【0006】[0006]

【表1】 [Table 1]

【0007】表1から分かるように、ポインタ(有効長
制御フラグ400)が0−−−(−はdon't careを表し
ている)なら、レジスタ100〜107の内容は全部無
効である。有効長制御フラグ400が1001なら、レ
ジスタ100の内容だけ有効であり、即ち命令バッファ
の有効長が2バイトである。また、有効長制御フラグ4
00が1010なら、レジスタ100とレジスタ101
の内容は有効であり、ほかのレジスタの内容は無効であ
り、即ち命令バッファの有効長が4バイトである。
As can be seen from Table 1, if the pointer (effective length control flag 400) is 0 ---- (-represents don't care), the contents of registers 100-107 are all invalid. If the effective length control flag 400 is 1001, only the contents of the register 100 are effective, that is, the effective length of the instruction buffer is 2 bytes. Also, the effective length control flag 4
If 00 is 1010, register 100 and register 101
Is valid and the contents of other registers are invalid, that is, the effective length of the instruction buffer is 4 bytes.

【0008】命令フェッチはフェッチ回路200によっ
て行われ、フェッチ量(フェッチされた命令のバイト
数)が信号502によってシフト量制御回路500、及
び有効長更新回路410に送られる。シフト量制御回路
500は、信号502の値、及び有効長フラグ群400
の値によって以下の表2のように入力セレクタ110〜
117を制御する。但し、命令バッファの容量(ここで
は16バイト)を超えるような命令フェッチは発生しな
いものとする。
The instruction fetch is performed by the fetch circuit 200, and the fetch amount (the number of bytes of the fetched instruction) is sent to the shift amount control circuit 500 and the effective length updating circuit 410 by a signal 502. The shift amount control circuit 500 uses the value of the signal 502 and the effective length flag group 400.
The input selectors 110 to 110 as shown in Table 2 below depending on the value of
Control 117. However, it is assumed that an instruction fetch that exceeds the capacity of the instruction buffer (16 bytes in this case) does not occur.

【0009】[0009]

【表2】 [Table 2]

【0010】表2から分かるように、ポインタ(有効長
制御フラグ400)が0−−−で、フェッチ量信号50
2が2バイトなら、レジスタ100のセレクタ入力11
0−1を選択し、しかもフェッチ後のポインタの値が0
−−−から1001にセットされる。もしポインタが0
−−−で、かつフェッチ量信号502が4バイトなら、
レジスタ100のセレクタ入力110−1とレジスタ1
01のセレクタ入力111−2を選択し、しかもフェッ
チ後のポインタの値が0−−−から1010にセットさ
れる。もしポインタは1001で、かつフェッチ量信号
502は2バイトなら、レジスタ101のセレクタ入力
111−1を選択し、しかも、フェッチ後のポインタの
値が1001から1010にセットされる。
As can be seen from Table 2, the pointer (effective length control flag 400) is 0 ---, and the fetch amount signal 50
If 2 is 2 bytes, selector input 11 of register 100
0-1 is selected and the value of the pointer after fetch is 0
It is set from --- to 1001. If the pointer is 0
--- and the fetch amount signal 502 is 4 bytes,
Selector input 110-1 of register 100 and register 1
The selector input 111-2 of 01 is selected, and the value of the pointer after fetching is set from 0 --- to 1010. If the pointer is 1001 and the fetch amount signal 502 is 2 bytes, the selector input 111-1 of the register 101 is selected, and the pointer value after fetch is set to 1001 to 1010.

【0011】そして、命令が実行される場合には、命令
長に応じて命令バッファを構成するレジスタ100〜1
07から命令を読み出して実行する。実行される命令の
命令長は信号501によってシフト量制御回路500、
及び有効長更新回路410に送られる。同時に他の命令
に対応するレジスタの値が順次にこの実行されている命
令長と同じ単位でシフトされる。
When the instruction is executed, the registers 100 to 1 forming the instruction buffer according to the instruction length.
The instruction is read from 07 and executed. The instruction length of the instruction to be executed is determined by the signal 501 by the shift amount control circuit 500,
And the effective length update circuit 410. At the same time, the register values corresponding to the other instructions are sequentially shifted in the same unit as the length of the executed instruction.

【0012】シフト量制御回路500は、信号501の
値によって以下の表3のように、入力セレクタ110〜
117を制御する。表3から分かるように、実行命令の
命令長を示す信号501は2バイトなら、この命令が実
行されてから、レジスタ100のセレクタ入力110−
5、レジスタ101のセレクタ入力111−5、レジス
タ102のセレクタ入力112−5、レジスタ103の
セレクタ入力113−5・・・レジスタ106の入力セ
レクタ116−5を選択し、また、ポインタの値がこの
命令を実行する前のポインタの値から1を減らしてセッ
トされる。即ち、レジスタ101の内容をレジスタ10
0へ移動し、レジスタ102の内容をレジスタ101へ
移動し、ポインタの値がこの命令を実行する前のポイン
タの値から1減らしてセットされる。実行命令の命令長
を示す信号501が4バイトなら、レジスタ102の内
容をレジスタ101へ移動し、レジスタ103の内容レ
ジスタ101へ移動し、レジスタ104の内容をレジス
タ102へ移動し、しかも、ポインタの値がこの命令を
実行する前のポインタの値から2を減らしてセットされ
る。このポインタの減算原理は表4に示されている。例
えば、ポインタが1001なら、減算後のポインタ値が
0000になる。但し、命令バッファ内の有効命令長が
実行されるべき命令の命令長に満たない場合には命令の
実行は開始されないものとする。すなわちこの命令の一
部分だけが命令バッファに記憶されているので、この命
令を実行することができない。従って、この命令を再度
メモリからフェッチしなければならない。
The shift amount control circuit 500 operates according to the value of the signal 501 as shown in Table 3 below.
Control 117. As can be seen from Table 3, if the signal 501 indicating the instruction length of the execution instruction is 2 bytes, the selector input 110-
5, selector input 111-5 of register 101, selector input 112-5 of register 102, selector input 113-5 of register 103 ... Input selector 116-5 of register 106 is selected, and the value of the pointer is It is set by subtracting 1 from the value of the pointer before executing the instruction. That is, the contents of the register 101 are stored in the register 10
Move to 0, move the contents of register 102 to register 101, and set the value of the pointer by subtracting 1 from the value of the pointer before executing this instruction. If the signal 501 indicating the instruction length of the execution instruction is 4 bytes, the contents of the register 102 are moved to the register 101, the contents of the register 103 are moved to the register 101, the contents of the register 104 are moved to the register 102, and the pointer The value is set by subtracting 2 from the value of the pointer before executing this instruction. The principle of this pointer subtraction is shown in Table 4. For example, if the pointer is 1001, the pointer value after subtraction will be 0000. However, if the effective instruction length in the instruction buffer is less than the instruction length of the instruction to be executed, the execution of the instruction is not started. That is, this instruction cannot be executed because only a portion of this instruction is stored in the instruction buffer. Therefore, this instruction must be fetched again from memory.

【0013】[0013]

【表3】 [Table 3]

【0014】[0014]

【表4】 [Table 4]

【0015】実際には命令フェッチと命令の実行開始は
同時に行われる、すなわち、命令を実行しながら、メモ
リから命令を命令バッファへフェッチすることが多く、
実行される命令の命令長とフェッチ量によって表5〜表
8のような制御が行われる。尚、どちらか一方のみが行
われるケースは前述の表2に示した通りである。即ち、
表5〜表8は命令を実行しながら、メモリから命令を命
令バッファへフェッチする場合に実行される命令長と信
号501とフェッチ量502信号によって、ポインタ4
00と各レジスタのセレクタ入力を制御する関係を示し
ている。例えば、ポインタの値が1001であり、実行
命令長信号501は2バイトであり、フェッチ量信号5
02は2バイトである場合には、レジスタ100のセレ
クタ入力110−1を選択し、また、更新後のポインタ
の値は1001となる。
Actually, the instruction fetch and the instruction execution start are performed at the same time, that is, the instruction is often fetched from the memory to the instruction buffer while executing the instruction.
Controls shown in Tables 5 to 8 are performed according to the instruction length and the fetch amount of the executed instruction. The case where only one of them is performed is as shown in Table 2 above. That is,
Tables 5 to 8 show the pointer 4 according to the instruction length and the signal 501 and the fetch amount 502 signal which are executed when the instruction is fetched from the memory into the instruction buffer while executing the instruction.
00 and the selector input of each register are controlled. For example, the pointer value is 1001, the execution instruction length signal 501 is 2 bytes, and the fetch amount signal 5
If 02 is 2 bytes, the selector input 110-1 of the register 100 is selected, and the updated pointer value is 1001.

【0016】[0016]

【表5】 [Table 5]

【0017】[0017]

【表6】 [Table 6]

【0018】[0018]

【表7】 [Table 7]

【0019】[0019]

【表8】 [Table 8]

【0020】次に、分岐先命令のフェッチについて説明
する。分岐命令の実行において、分岐が成立した場合に
は、分岐先命令を命令バッファに取り込む必要がある
が、ここではその分岐先命令は、分岐先フェッチ回路3
00でフェッチされるものとする。
Next, fetching of a branch destination instruction will be described. When executing a branch instruction, if a branch is taken, it is necessary to fetch the branch destination instruction into the instruction buffer. Here, the branch destination instruction is the branch destination fetch circuit 3
00 shall be fetched.

【0021】この分岐先フェッチ回路300はそのフェ
ッチ量を信号503によってシフト量制御回路500、
及び有効長更新回路410に送る。以下の表9には、こ
の分岐先フェッチ量信号530が選択されるセレクタ入
力110−t,111−tと112−tやフェッチ後の
ポインタの値との関係を示している。ここでは、分岐先
命令が命令バッファにある前提とする。分岐先命令を命
令バッファに取り込むのは分岐が成立した場合のみに限
られるため、図示しない分岐判定回路からの分岐判定結
果信号700がシフト量制御回路500及び有効長更新
回路410に送られる。表5から分かるように、分岐先
フェッチ量信号503は2バイトなら、レジスタ100
のセレクタ入力110−tを選択し、フェッチ後のポイ
ンタの値が1001となる。分岐先フェッチ信号503
は4バイトなら、レジスタ100のセレクタ入力110
−tとレジスタ101のセレクタ入力111−tを選択
し、フェッチ後のポインタの値が1010となる。
The branch destination fetch circuit 300 shifts the fetch amount according to the signal 503 to the shift amount control circuit 500,
And the effective length update circuit 410. Table 9 below shows the relationship between the selector inputs 110-t, 111-t and 112-t from which the branch destination fetch amount signal 530 is selected, and the pointer value after fetch. Here, it is assumed that the branch destination instruction is in the instruction buffer. Since the branch destination instruction is taken into the instruction buffer only when the branch is taken, the branch determination result signal 700 from the branch determination circuit (not shown) is sent to the shift amount control circuit 500 and the effective length update circuit 410. As can be seen from Table 5, if the branch destination fetch amount signal 503 is 2 bytes, the register 100
The selector input 110-t is selected, and the pointer value after fetching becomes 1001. Branch destination fetch signal 503
Is 4 bytes, the selector input 110 of the register 100
-T and the selector input 111-t of the register 101 are selected, the value of the pointer after fetching becomes 1010.

【0022】[0022]

【表9】 [Table 9]

【0023】分岐先命令の構成方法によっては分岐先命
令もフェッチ回路200からフェッチされるケース、即
ち、分岐先命令が命令バッファにないケースもあるが、
その場合、分岐成立によってそれまでの命令バッファ内
の値を無効(つまり、有効長フラグ群400の値を“0
・・・・”)とみなして命令フェッチのケースと同じに
セレクタとポインタを制御すればよい。
Depending on the method of constructing the branch target instruction, the branch target instruction may be fetched from the fetch circuit 200, that is, the branch target instruction may not be in the instruction buffer.
In that case, the value in the instruction buffer until then is invalidated by the branch taken (that is, the value of the effective length flag group 400 is set to "0
····· ”), the selector and pointer may be controlled in the same manner as in the case of instruction fetch.

【0024】[0024]

【発明が解決しようとする課題】上記の従来の命令バッ
ファにおいては、次のような問題を有する。 問題(1) バッファの容量は、命令実行速度(命令の実行が開始さ
れる速度)にもよるが、適度に大きいことが望ましい。
しかし、最近のLSIによっても回路規模は小さいこと
が望ましい。すなわち、回路規模と容量のトレードオフ
を決定することが重要である。しかし、上記の従来の命
令バッファはFF(フリップフロップ)からなるので、
動作の速度は速いが、回路の規模が大きくなる。 問題(2) 命令長が固定でない計算機の場合には、バッファ内のシ
フト量も固定でなくなるため、FIFOレジスタの構成
が複雑になる。例えば図10に示すように、このFIF
Oを構成するために、いくつかのセレクタが使われる。
また、FF間に沢山の配線を必要とする。
The above conventional instruction buffer has the following problems. Problem (1) It is desirable that the buffer capacity be reasonably large, although it depends on the instruction execution speed (speed at which instruction execution starts).
However, even with recent LSIs, it is desirable that the circuit scale be small. That is, it is important to determine the trade-off between circuit scale and capacity. However, since the conventional instruction buffer described above consists of FFs (flip-flops),
The operation speed is high, but the circuit scale is large. Problem (2) In the case of a computer whose instruction length is not fixed, the shift amount in the buffer is also not fixed, which complicates the structure of the FIFO register. For example, as shown in FIG.
Several selectors are used to construct O.
Also, many wirings are required between the FFs.

【0025】本発明は、回路構成を簡単にして、LSI
化した場合に高集積化が可能であるとともに、高速に動
作する命令バッファ方式を提供することを目的とする。
The present invention simplifies the circuit configuration and enables the LSI
It is an object of the present invention to provide an instruction buffer system that can be highly integrated and operates at a high speed when it is realized.

【0026】[0026]

【課題を解決するための手段及び作用】本発明は上記の
問題点を解決するために、FFに代わり、レジスタファ
イルまたはRAMを使って命令バッファを構成する。こ
のレジスタファイルまたはRAMへ命令を書き込むか又
はレジスタファイルまたはRAMから命令を読み出すた
めに、ライトポインタとリードポインタをセットする。
これらのポインタがあるので、従来のようなFFのシフ
ト動作が不要となる。従って、回路の規模が小さくな
る。また、これらのポインタを利用すれば、分岐命令に
ついての処理も容易にできる。レジスタファイルやRA
MはFFに比べて読み出し速度が遅いので、本発明によ
る命令バッファ方式では、次に実行しようとする命令の
一部または全部をFFで記憶する。
In order to solve the above problems, the present invention uses a register file or a RAM instead of an FF to form an instruction buffer. A write pointer and a read pointer are set in order to write an instruction to this register file or RAM or read an instruction from the register file or RAM.
Since these pointers are provided, the conventional FF shift operation is unnecessary. Therefore, the scale of the circuit is reduced. Further, by using these pointers, the processing for branch instructions can be easily performed. Register file or RA
Since the read speed of M is slower than that of FF, the instruction buffer method according to the present invention stores some or all of the next instruction to be executed in FF.

【0027】本発明はレジスタファイルやRAMが、通
常のゲートやFF(Flip-Flop)に比べて高集積であるこ
とを利用するものである。本発明の命令バッファがライ
ト側、リード側の両方を満足させる幅を持つようにレジ
スタファイル(あるいはRAM)を並べて構成される。
ライト側では、命令長の最小長を単位とする幅を持つレ
ジスタファイル(あるいはRAM)を、メモリ装置から
一度にフェッチできる幅になるように並べる。例えば
2,4,6バイト長の命令を持つシステムにおいては、
2バイトを単位とし、一度にフェッチできる幅が8バイ
トであれば、最低4個のレジスタファイル(あるいはR
AM)を並べる。
The present invention utilizes the fact that the register file and the RAM are highly integrated as compared with the normal gate and FF (Flip-Flop). The instruction buffer of the present invention is configured by arranging register files (or RAM) so that the instruction buffer has a width that satisfies both the write side and the read side.
On the write side, register files (or RAM) having a width with the minimum instruction length as a unit are arranged so that the width can be fetched at once from the memory device. For example, in a system with instructions of 2, 4, 6 bytes long,
If the width that can be fetched at one time is 8 bytes in units of 2 bytes, at least 4 register files (or R
AM) are arranged.

【0028】リード側では、最大命令長の命令が一度に
読み出させる幅を持つようにレジスタファイル(あるい
はRAM)を並べる。例えば2,4,6バイト長の命令
を持つシステムにおいて、2バイトを単位とした場合に
は、最低3個のレジスタファイル(あるいはRAM)を
並べる必要がある。
On the read side, the register files (or RAM) are arranged so that the instruction with the maximum instruction length can be read at one time. For example, in a system having an instruction having a length of 2, 4, or 6 bytes, if 2 bytes are used as a unit, it is necessary to arrange at least three register files (or RAM).

【0029】各レジスタファイル(あるいはRAM)の
容量は、要求される命令バッファの容量として、使用す
るレジスタファイル(あるいはRAM)の個数と幅で除
した数より大きい(2の累乗算の)ワード数を選ぶ。 (例) 要求される命令バッファ容量 :30バイト 使用するレジスタファイル(RAM)の数:4個 使用するレジスタファイル(RAM)の幅:2バイト 30/4/2=3.75→4ワード ポインタとして、ライト側およびリード側にレジスタを
設けるが、そのビット幅は命令バッファの総容量をレジ
スタファイル(あるいはRAM)の幅で除した値をその
組み合わせで表わし得るビット数とする。 (例) 前記の幅2バイト、ワード数4ワード、個数4で構成さ
れる例の場合、 総容量は、2バイト×4ワード×4コ=32バイト log2(32/2)≦4 よって4ビット幅となる。
The capacity of each register file (or RAM) is the number of words (cumulative multiplication of 2) that is larger than the number of register files (or RAM) used and the width of the required instruction buffer capacity. Choose. (Example) Required instruction buffer capacity: 30 bytes Number of register files (RAM) used: 4 Width of register file (RAM) used: 2 bytes 30/4/2 = 3.75 → 4 words As a pointer Registers are provided on the write side and the read side, and the bit width is the number of bits that can be represented by the combination of a value obtained by dividing the total capacity of the instruction buffer by the width of the register file (or RAM). (Example) In the case of the example configured with the width of 2 bytes, the number of words of 4 words, and the number of 4 as described above, the total capacity is 2 bytes × 4 words × 4 = 32 bytes log2 (32/2) ≦ 4 and thus 4 bits. Width.

【0030】ライトポインタは、次の命令フェッチで書
き込みを行う先頭位置を示すものである。メモリ装置か
らの転送指示に従って、そのフェッチ量を使用するレジ
スタファイル(あるいはRAM)の幅で除した数だけ更
新する。
The write pointer indicates the head position where writing is performed in the next instruction fetch. According to the transfer instruction from the memory device, the fetch amount is updated by the number divided by the width of the register file (or RAM) used.

【0031】リードポインタは、次に実行すべき命令の
先頭位置を示すものである。命令実行制御装置からの命
令実行開始指示に従って、実行が開始された命令の長さ
を使用するレジスタファイル(あるいはRAM)の幅で
除した数だけ更新する。
The read pointer indicates the head position of the next instruction to be executed. According to an instruction execution start instruction from the instruction execution control device, the length of the instruction whose execution has started is updated by the number divided by the width of the register file (or RAM) used.

【0032】ライトポインタの値からリードポインタの
値を減じたものが、命令バッファ内の有効な命令列の長
さとなるが、これでは、両方のポインタが同じ値を指し
たときに、それが全てが有効であることを示すのか、全
てが無効であることを示すのか、判定できない。
The value obtained by subtracting the value of the read pointer from the value of the write pointer becomes the length of the valid instruction sequence in the instruction buffer. However, when both pointers point to the same value, it is all It is not possible to determine whether is valid or all are invalid.

【0033】そこで命令バッファ内にフェッチされた有
効な命令が存在することを示す有効フラグを設ける(も
ちろん、命令バッファ内に命令が一杯になったことを示
すフラグを用意してもよい)。
Therefore, a valid flag indicating that there is a valid instruction fetched in the instruction buffer is provided (of course, a flag indicating that the instruction is full in the instruction buffer may be prepared).

【0034】次に、ライトアライン及びリードアライン
について説明する。命令バッファ方式では、フェッチデ
ータは複数のレジスタファイル(あるいはRAM)に分
割して同時にライトする必要がある。フェッチ回路から
送られてくるフェッチデータのバイト位置とライトすべ
きレジスタファイル(あるいRAM)が常に一致するの
は以下の場合のみである。
Next, the write align and the read align will be described. In the instruction buffer method, fetch data needs to be divided into a plurality of register files (or RAM) and written simultaneously. It is only in the following cases that the byte position of fetch data sent from the fetch circuit and the register file (or RAM) to be written always match.

【0035】つまり、フェッチ量が常に一定で、かつ、
その幅がこの命令バッファ方式を構成するレジスタファ
イル(あるいはRAM)の合計の書き込み幅(2バイト
幅のレジスタファイル(あるいはRAMを4個並べた場
合には8バイト)と同じ場合である。
That is, the fetch amount is always constant, and
This width is the same as the total write width of the register files (or RAM) forming this instruction buffer system (register file of 2 byte width (or 8 bytes when four RAMs are arranged)).

【0036】この場合以外ではフェッチデータのバイト
位置とライトすべきレジスタファイル(あるいはRA
M)は一致しない。例えば、2バイト幅のレジスタファ
イル(あるいはRAM)をA,B,C,及びDの4個並
べた構成の場合、最初に2バイトのフェッチが行われる
と、この2バイトがAのレジスタファイル(あるいはR
AM)にライトし、続いて4バイトのフェッチが行われ
ると、その最初の2バイトがBのレジスタファイル(あ
るいはRAM)に、後半の2バイトはCのレジスタファ
イル(あるいはRAM)にそれぞれライトする必要があ
る。
In other cases, the byte position of fetch data and the register file to be written (or RA
M) does not match. For example, in the case of a configuration in which four 2-byte-wide register files (or RAMs) A, B, C, and D are arranged, when the first 2-byte fetch is performed, the 2-byte register file ( Or R
AM) and then fetch 4 bytes, write the first 2 bytes to B register file (or RAM) and the latter 2 bytes to C register file (or RAM). There is a need.

【0037】また、続いて4バイトのフェッチが行われ
ると、その最初の2バイトが今度はDのレジスタファイ
ル(あるいはRAM)にまた後半の2バイトはAのレジ
スタファイル(あるいはRAM)にそれぞれライトする
必要がある。
When 4 bytes are fetched subsequently, the first 2 bytes are written to the D register file (or RAM) this time, and the latter 2 bytes are written to the A register file (or RAM). There is a need to.

【0038】このため、フェッチ回路からのフェッチデ
ータを、そのときのライトポインタの値によって並べ替
える回路すなわちライトアラインを設けることとする。
この命令バッファ方式では、レジスタファイル(あるい
はRAM)からの命令の取り出しはリードポインタの値
によって取り出すべきレジスタファイル(あるいはRA
M)とそれらのアドレスを指示するとともに、取り出さ
れたデータを正しい順番に並び替えて命令制御装置へ送
る必要がある。この並び替えの回路をリードアラインと
呼ぶことにする。
Therefore, a circuit for rearranging the fetch data from the fetch circuit according to the value of the write pointer at that time, that is, a write align is provided.
In this instruction buffer method, when fetching an instruction from the register file (or RAM), the register file (or RA that should be fetched according to the value of the read pointer).
M) and their addresses, and the fetched data must be rearranged in the correct order and sent to the instruction controller. This rearrangement circuit is called read-align.

【0039】リード側の並び替えが必要な理由は以下の
ような場合で説明できる。2バイト幅のレジスタファイ
ル(あるいはRAM)をA,B,C及びDの4個並べた
構成の場合、最初にAからの2バイト命令を実行したと
すると、次の命令はBから開始されることになり、ここ
で4バイト命令が実行される場合には、その命令の最初
の2バイトはBから、次の2バイトはCから取り出す必
要がある。また、その次に4バイト命令が実行されるな
らば、その最初の2バイトはDから、次の2バイトはA
から取り出す必要がある。
The reason why rearrangement on the read side is necessary can be explained in the following cases. In the case of a configuration in which four 2-byte-wide register files (or RAMs) A, B, C, and D are arranged, if the 2-byte instruction from A is executed first, the next instruction starts from B. Thus, if a 4-byte instruction is executed here, the first 2 bytes of the instruction must be taken from B and the next 2 bytes from C. If a 4-byte instruction is executed next, the first 2 bytes are from D and the next 2 bytes are from A.
You need to take it out from.

【0040】このように実行される命令が取り出される
レジスタファイル(あるいはRAM)は毎回違うことに
なる。従って、リード側にも、並び替えが必要となる。
命令バッファから命令を取り出す場合には、通常デコー
ドサイクルと呼ばれ、このサイクルにおいてアドレス計
算用の汎用レジスタの読み出しや、マイクロ計算機にお
いてはマイクロ命令の読み出しなど、数多くの処理を行
う必要があるサイクルであり、命令バッファからの命令
取り出し速度によって、マシンサイクルを決定すること
にもなりかねない。しかしながら、一般にレジスタファ
イルやRAMはFFに比べて読み出し速度が遅い。従っ
て、単純にFFに代わりにRAMまたはレジスタファイ
ルを使うと、命令を命令バッファから読み出す速度が遅
くになってしまう。本発明では、実行が開始される命令
の一部または全部をレジスタファイル(あるいはRA
M)ではなく、FF(Flip-Flop)に保持する構成とす
る。これはFF((Flip-Flop)の読み出しがレジスタフ
ァイルやRAMに比べて高速であることを利用するもの
である。
The register file (or RAM) from which the instructions executed in this way are fetched is different every time. Therefore, rearrangement is also required on the lead side.
When fetching an instruction from the instruction buffer, it is usually called a decode cycle. In this cycle, it is necessary to perform a lot of processing such as reading a general-purpose register for address calculation and reading a micro instruction in a micro computer. The machine cycle may be determined by the instruction fetch speed from the instruction buffer. However, generally, the read speed of the register file and the RAM is slower than that of the FF. Therefore, if the RAM or the register file is simply used instead of the FF, the speed of reading the instruction from the instruction buffer becomes slow. According to the present invention, a part or all of the instructions whose execution is started are stored in the register file (or RA
Instead of M), the FF (Flip-Flop) is used. This utilizes the fact that reading of FF ((Flip-Flop) is faster than that of a register file or RAM.

【0041】高速化が必要な部分をFFとし、命令の実
行開始サイクルの直前に命令バッファ内よりその部分を
セットする。また、レジスタファイル(あるいはRA
M)で構成された命令バッファのリード側を上記のFF
化の必要な幅だけ余計にリードできるように構成する。
The portion requiring high speed is set as FF, and that portion is set from the instruction buffer immediately before the instruction execution start cycle. In addition, register file (or RA
The read side of the instruction buffer composed of
It will be configured so that it can lead an extra amount of width that needs to be converted.

【0042】FFの容量は、例えば、命令コードの先頭
の1バイトのみを高速化すればよいケースでは、その1
バイトとなる。命令バッファが空の場合、あるいは分岐
先命令のフェッチの場合には、命令バッファへのフェッ
チ時に、最初の命令の該当する部分のフェッチデータを
FFにセットする。命令バッファに命令が詰まっている
場合には、命令が開始されたときに、その次の命令の該
当する部分を前述のリード側に設けた部分からFFにセ
ットする。
The capacity of the FF is, for example, 1 in the case where only the first byte of the instruction code needs to be speeded up.
It becomes a part-time job. If the instruction buffer is empty or if the branch destination instruction is fetched, the fetch data of the corresponding portion of the first instruction is set to FF when fetching to the instruction buffer. If the instruction buffer is full of instructions, when the instruction is started, the relevant portion of the next instruction is set in the FF from the portion provided on the read side.

【0043】命令バッファから読み出し制御を行うため
には、レジスタファイル(あるいはRAM)で構成され
た命令バッファのリード側は、前述の最大命令長によっ
て決定した読み出し幅をこのFFで構成する部分の長さ
に合わせるように拡張される。
In order to perform the read control from the instruction buffer, the read side of the instruction buffer constituted by the register file (or RAM) has the length of the portion constituted by this FF which is the read width determined by the maximum instruction length described above. It is expanded to suit the size.

【0044】例えば、前述の例によって1バイト幅のレ
ジスタファイル(あるいはRAM)を3個並べた場合
に、1バイトのFF化が必要なケースではもう1つのレ
ジスタファイル(あるいはRAM)を追加し、また、3
バイトのFF化が必要なケースではもう2つのレジスタ
ファイル(あるいはRAM)を追加する。
For example, when three register files (or RAMs) each having a 1-byte width are arranged according to the above-mentioned example, another register file (or RAM) is added when 1 byte FF conversion is required, Also, 3
In the case where FF conversion of bytes is necessary, another two register files (or RAM) are added.

【0045】また、本発明によって、ライトポインタと
リードポインタを用いることに応じて、新たな分岐先命
令のフェッチの手法を用いた。すなわち、通常の命令先
取りのためのフェッチ手段からのフェッチと分岐先命令
列のフェッチ手段からのフェッチを選択して命令バッフ
ァに格納する手段を設け、ライトポインタ/リードポイ
ンタ/有効フラグを分岐判定動作に加味したものとす
る。例えば、分岐判定サイクルと分岐先命令列のフェッ
チが同じサイクルなどの場合、その分岐判定が成立する
場合には分岐先命令列のフェッチ手段からのフェッチデ
ータを命令バッファに登録するが、その際のライトアド
レスを0番地からにし、リードポインタをそのアドレス
にセットし、ライトポインタはフェッチ量を加算したも
のとすることで、直前まで命令バッファ内に存在してい
た命令列をキャンセルする。
According to the present invention, a new branch destination instruction fetch method is used in response to the use of the write pointer and the read pointer. That is, a unit for selecting the fetch from the fetch unit for normal instruction prefetching and the fetch from the fetch unit of the branch destination instruction string and storing it in the instruction buffer is provided, and the write pointer / read pointer / valid flag is used for the branch determination operation. It has been taken into consideration. For example, in the case where the branch determination cycle and the fetch of the branch target instruction sequence are the same cycle, if the branch determination is satisfied, the fetch data from the fetch unit of the branch target instruction sequence is registered in the instruction buffer. The write address is set to the address 0, the read pointer is set to that address, and the write pointer is obtained by adding the fetch amount, thereby canceling the instruction string existing in the instruction buffer until immediately before.

【0046】[0046]

【実施例1】 (命令バッファの幅がフェッチ量に等しい幅を持つケー
スの実施例)図1は、命令長の最小単位が2バイト、一
度にフェッチできる幅が8バイト、最大命令長が6バイ
ト、高速化のために命令の先頭の1バイトをFFで構成
する命令バッファの実施例を示す。
First Embodiment (Embodiment of Case where Width of Instruction Buffer Has Width Equal to Fetch Amount) FIG. 1 shows that the minimum unit of instruction length is 2 bytes, the width that can be fetched at one time is 8 bytes, and the maximum instruction length is 6 bytes. An embodiment of an instruction buffer in which the first byte of the instruction is composed of FF for speeding up the byte is shown.

【0047】ライト側の条件としては、2バイト幅のレ
ジスタファイル600,610,620,630(ある
いはRAM:以下これをRFと表記する。)を8バイト
幅になるように4個以上並べる必要がある。
As a condition on the write side, it is necessary to arrange four or more 2-byte width register files 600, 610, 620, 630 (or RAM: hereinafter referred to as RF) so as to have an 8-byte width. is there.

【0048】リード側の条件としては、2バイトを単位
とすると、最大命令長の6バイトと、次の命令のための
1バイトを同時に読み出せるように4個以上のRF60
0,610,620,630を並べる必要がある。
As a condition on the read side, assuming that 2 bytes is a unit, 6 bytes, which is the maximum instruction length, and 4 or more RF60s, so that 1 byte for the next instruction can be read at the same time.
It is necessary to arrange 0, 610, 620, and 630.

【0049】容量としては、ライト/リード側の条件に
よって、2バイト幅のRFを4個以上並べる必要があ
る。必要以上に並べることもないので個数は4とする。
2バイト幅のRFを4個並べると、このRFはワード数
から以下のような容量を選択できることになる。表10
は本実施例の場合にワード数と総容量の対応関係を示し
ている。例えば、ワード数を4とすると、総容量が32
バイトとなる。
As the capacity, it is necessary to arrange four or more RFs each having a 2-byte width depending on the conditions on the write / read side. The number is 4 because there is no need to arrange more than necessary.
By arranging four 2-byte width RFs, the RF can select the following capacity from the number of words. Table 10
Indicates the correspondence between the number of words and the total capacity in the case of this embodiment. For example, if the number of words is 4, the total capacity is 32.
It becomes a part-time job.

【0050】[0050]

【表10】 [Table 10]

【0051】図1の構成ではワード、総容量32バイト
を選択する。すなわち、一度にフェッチする幅が8バイ
トであるので、一度にフェッチできる幅は1ワードとな
る。この実施例では命令バッファの総容量は4ワードと
しているので、2バイト幅のRFを四つ並べて構成され
る基本単位を更に四つ横に並べて命令バッファを構成す
る。なお、図1中のRF600,610,620及び6
30の中に示される(0),(1),・・・(f)はR
F内の各ワードにつけられた名前であり、これは丁度
(0),(1),・・・(f)続いて(0),(1),
・・・というように循環レジスタ(すなわちモードは1
6である)を構成していることになる。ポインタ図1に
示すような16個の最小単位(0),(1),・・・
(f)をアドレッシングすることを可能とするためにポ
インタ(ライトポインタ700及びリードポインタ80
0)の幅は4ビットであることになる。
In the configuration of FIG. 1, a word and a total capacity of 32 bytes are selected. That is, since the width fetched at one time is 8 bytes, the width that can be fetched at one time is one word. In this embodiment, since the total capacity of the instruction buffer is 4 words, four basic units each composed of four RFs each having a width of 2 bytes are arranged side by side to form an instruction buffer. In addition, RF600, 610, 620 and 6 in FIG.
(0), (1), ... (f) shown in 30 are R
It is the name given to each word in F, which is just (0), (1), ... (f) followed by (0), (1),
... and so on. Circular register (ie mode is 1
6) is configured. Pointer 16 minimum units (0), (1), ... As shown in FIG.
In order to be able to address (f), pointers (write pointer 700 and read pointer 80
The width of 0) will be 4 bits.

【0052】ライトポインタ700は、次の命令のフェ
ッチで書き込みを行う先頭位置を示すものである。フェ
ッチ回路200における信号201で示されるフェッチ
量に応じて+1(2バイトフェッチの場合)、+2(4
バイト)、+3(6バイト)、及び+4(8バイト)す
る回路705を設ける。すなわちある命令を書き込んで
から、その書き込んだ命令の長さ(バイト数)をライト
ポインタ700に加える。
The write pointer 700 indicates the head position where writing is performed by fetching the next instruction. Depending on the fetch amount indicated by the signal 201 in the fetch circuit 200, +1 (in the case of 2-byte fetch), +2 (4
A circuit 705 for providing (byte), +3 (6 bytes), and +4 (8 bytes) is provided. That is, after writing a certain instruction, the length (number of bytes) of the written instruction is added to the write pointer 700.

【0053】ライトアドレス回路701は、このポイン
タの値によってRFのライトアドレス及びライトイネー
ブル信号を制御する。RF600,610,620,及
び630に対するライトアドレスはそれぞれ601,6
11,621,及び631で、またライトイネーブルは
それぞれ602,612,622,及び632で示され
る。
The write address circuit 701 controls the RF write address and write enable signal according to the value of this pointer. The write addresses for RF600, 610, 620, and 630 are 601 and 6 respectively.
11, 621, and 631, and write enables are indicated at 602, 612, 622, and 632, respectively.

【0054】ライトポインタ700とライトアドレス6
01,611,612及び631と、及びライトイネー
ブル602,612,622,及び632の関係を図2
に示す。すなわちアドレス601,611,621,及
び631はそれぞれRF600((0),(4),
(8),(c))、RF610((1),(5),
(9),(d))、RF620((2),(6),
(a),(e))及びRF630((3),(7),
(b),(f))をポイントする局所アドレスである。
これらのアドレス601,611,621及び631の
値はライトポインタ700に対応して計算される。
Write pointer 700 and write address 6
The relationship between 01, 611, 612 and 631 and write enable 602, 612, 622 and 632 is shown in FIG.
Shown in. That is, the addresses 601, 611, 621, and 631 are RF600 ((0), (4),
(8), (c)), RF610 ((1), (5),
(9), (d)), RF620 ((2), (6),
(A), (e)) and RF630 ((3), (7),
It is a local address that points to (b) and (f).
The values of these addresses 601, 611, 621 and 631 are calculated corresponding to the write pointer 700.

【0055】図2はこの計算関係を示す。例えば、ライ
トポインタ700は0000なら、RF600、RF6
10、RF620及びRF630のアドレス601、6
11、612及び631はそれぞれ0,0,0,0,で
ある。601が0であるということはアドレス601が
RF600のワード(0)を指すことを意味する。61
1が0であるということはアドレス611がRF610
のワード(1)を指すことを意味する。ライトポインタ
700によって、各RFのアドレスが選択されたが、各
RFのライトイネーブル信号によって、各RFへ命令を
書き込むかどうかのを決める。これらのライトイネーブ
ル信号が図2の2番目の表によって決められる。例え
ば、フェッチ量信号201(表2の(2))が00な
ら、かつライトポインタの下位2ビット(表2の
(1))が00なら、RF600、RF610、RF6
20及びRF630のライトイネーブル信号602、6
12、622、632がそれぞれ1、0、0、0とな
る。即ち、RF600だけを選択する。
FIG. 2 shows this calculation relationship. For example, if the write pointer 700 is 0000, RF600, RF6
10, addresses 601 and 6 of RF620 and RF630
11, 612 and 631 are 0, 0, 0, 0, respectively. A 601 of 0 means that address 601 points to word (0) of RF 600. 61
If 1 is 0, it means that address 611 is RF610
Means to refer to the word (1) of. Although the address of each RF is selected by the write pointer 700, whether to write a command to each RF is determined by the write enable signal of each RF. These write enable signals are determined by the second table in FIG. For example, if the fetch amount signal 201 ((2) in Table 2) is 00 and the lower 2 bits of the write pointer ((1) in Table 2) is 00, RF600, RF610, RF6
20 and write enable signals 602, 6 of RF630
12, 622 and 632 are 1, 0, 0 and 0, respectively. That is, only RF600 is selected.

【0056】リードポインタ800は、次に実行すべき
命令の先頭位置を示すものである。図示しない命令実行
制御部からの指示で命令が実行される場合、その命令の
命令長(通常これは実行される命令の命令コードから判
明するため、この例では命令の取り出しを制御するリー
ドアライン回路1000からの信号1001で示され
る)に応じて、+1(2バイト命令の場合)、+2(4
バイト)、及び+3(6バイト)する回路805を設け
る。すなわちある命令を読み出してから、この読み出し
た命令の長さ(バイト数)をリードポインタ800に加
える。
The read pointer 800 indicates the head position of the next instruction to be executed. When an instruction is executed according to an instruction from an instruction execution control unit (not shown), the instruction length of the instruction (normally this is found from the instruction code of the instruction to be executed, so in this example, a read-align circuit that controls the fetching of the instruction +1 (for a 2-byte instruction), +2 (4
And a circuit 805 for performing +3 (6 bytes). That is, after reading a certain instruction, the length (number of bytes) of the read instruction is added to the read pointer 800.

【0057】リードアドレス回路801は、このポイン
タの値によってRFのリードアドレスを制御する。RF
600,610,620,及び630に対するリードア
ドレスはそれぞれ603、613,623,及び633
で示される。リードアドレス回路801とライトアドレ
ス603,613,623,及び633との関係を図5
に示す。リードアドレス603,613,623,及び
633はそれぞれRF600,RF610,RF620
及びRF630にポイントする局所アドレスである。図
5から分かるように、リードポインタ800が0000
なら、RF600、RF610、RF620及びRF6
30のリードアドレス603、613、623及び63
3がそれぞれ0、0、0、0、である。603が0であ
るということはリードアドレス603がRF600のワ
ード(0)を指すことを意味する。613が0であると
いうことはリードアドレス613がRF610のワード
(1)を指すことを意味するなど。
The read address circuit 801 controls the RF read address according to the value of this pointer. RF
The read addresses for 600, 610, 620, and 630 are 603, 613, 623, and 633, respectively.
Indicated by. FIG. 5 shows the relationship between the read address circuit 801 and the write addresses 603, 613, 623, and 633.
Shown in. Read addresses 603, 613, 623, and 633 are RF600, RF610, and RF620, respectively.
And a local address pointing to RF 630. As can be seen from FIG. 5, the read pointer 800 is 0000.
Then RF600, RF610, RF620 and RF6
30 read addresses 603, 613, 623 and 63
3 is 0, 0, 0, 0, respectively. The fact that 603 is 0 means that the read address 603 points to the word (0) of the RF 600. The fact that 613 is 0 means that the read address 613 points to word (1) of RF 610, and so on.

【0058】有効フラグ1150は、命令バッファ内に
有効なデータを保持していることを示すフラグであり、
このフラグが0の場合には有効なデータを保持していな
いものとする。
The valid flag 1150 is a flag indicating that valid data is held in the instruction buffer.
When this flag is 0, it is assumed that valid data is not held.

【0059】有効フラグ1150は有効フラグ更新回路
1155でその値が決定されるが、有効フラグ更新回路
1155にはフェッチ量信号201、実行命令長信号1
001のほかに、ライトポインタ700、リードポイン
タ800、また分岐命令の分岐成立などによって強制的
に命令バッファの内容を無効化させる信号1159が与
えられている。
The value of the valid flag 1150 is determined by the valid flag updating circuit 1155. The valid flag updating circuit 1155 has a fetch amount signal 201 and an execution instruction length signal 1
In addition to 001, a write pointer 700, a read pointer 800, and a signal 1159 for forcibly invalidating the contents of the instruction buffer when a branch of a branch instruction is taken are given.

【0060】このフラグの更新条件を以下に示す。 (セット条件) 〔(分岐判定でない)+(分岐不成立)〕 & 〔(命令バッファ内に保持されているバイト数)+(ライトされるバイト数) −(実行が開始される命令長)>0〕 +〔分岐成立〕&〔分岐先フェッチが行われる〕 (リセット) 〔(分岐判定でない)+(分岐不成立)〕 & 〔(命令バッファ内に保持されているバイト数)+(ライトされるバイト数) −(実行が開始される命令長)=0〕 +〔分岐成立〕&〔分岐先フェッチが行われない〕 命令バッファ内に保持されているバイト数はライトポイ
ンタ700、リードポインタ800の差、及び有効フラ
グ1150の値から図7のように求めることができる。
The conditions for updating this flag are shown below. (Set condition) [(No branch judgment) + (No branch taken)] & [(Number of bytes held in the instruction buffer) + (Number of bytes written)-(Instruction length at which execution starts)> 0 ] + [Branch taken] & [Branch destination fetch is performed] (Reset) [(No branch judgment) + (Branch not taken)] & [(Number of bytes held in the instruction buffer) + (Bytes written Number)-(instruction length at which execution is started) = 0] + [branch taken] & [branch destination fetch not performed] The number of bytes held in the instruction buffer is the difference between the write pointer 700 and the read pointer 800. , And the value of the valid flag 1150, as shown in FIG.

【0061】フェッチ回路200から送られてくるフェ
ッチデータ210をRFにライトできるように並び替え
るライトアライン回路900は、RF600,610,
620、及び630のためのライトデータをそれぞれ9
10,911,912、及び913に出力する。
The write-align circuit 900 that rearranges the fetch data 210 sent from the fetch circuit 200 so that it can be written to RF includes RF 600, 610,
Write data for 620 and 630 for 9
Output to 10, 911, 912, and 913.

【0062】ライトアライン回路900は、フェッチ量
201,ライトポインタ700の値で制御されるが、フ
ェッチ回路200の構成次第ではフェッチ回路200か
ら送られてくる先頭位置アドレス211も必要となる。
The write align circuit 900 is controlled by the fetch amount 201 and the value of the write pointer 700, but depending on the configuration of the fetch circuit 200, the head position address 211 sent from the fetch circuit 200 is also required.

【0063】フェッチ回路200からフェッチデータと
しては図4(a) のようにフェッチデータ線210のバイ
ト0には常にフェッチの先頭データが送られてくる場合
には、ライトアライン回路900は図3のライトアライ
ン(A)のように制御すればよい。この場合には、専ら
ライトポインタの下位2ビットのみがその制御に使用さ
れることになる。−一方、フェッチ回路200からフェ
ッチデータがフェッチデータ線210に図4(b) のよう
に送られてくる場合、ライトアライン回路900は図3
のライトアライン(B)のように制御すればよい。即
ち、図3は並び替えためのライトアライン回路900の
動作を示している。次には、この動作をより詳しく説明
する。
As the fetch data from the fetch circuit 200, if the leading data of the fetch is always sent to the byte 0 of the fetch data line 210 as shown in FIG. 4A, the write align circuit 900 causes the write align circuit 900 of FIG. It may be controlled like the write align (A). In this case, only the lower 2 bits of the write pointer are exclusively used for the control. On the other hand, when the fetch data is sent from the fetch circuit 200 to the fetch data line 210 as shown in FIG. 4B, the write align circuit 900 operates as shown in FIG.
It may be controlled like the write align (B). That is, FIG. 3 shows the operation of the write align circuit 900 for rearranging. Next, this operation will be described in more detail.

【0064】フェッチ回路200からの転送データの先
頭が必ずバイト0にある場合(A)には、フェッチ量信
号201の値(00:2バイト,01:4バイト,1
0:6バイト,11対8バイト)で指定されたバイト数
だけでフェッチ回路200からの転送データをライトア
ライン回路900の出力910,911,912または
913に送出する。また、転送データのバイトと出力9
10,911,912及び913との対応関係は、ライ
トポインタの下位2ビット(図3中の(2))によって
決められる。例えば、図3のライトライン(A)から分
かるように、ライトポインタ700の下位2ビット(図
3の(1))が00で、かつフェッチ量信号201(図
3の(2))が01なら、フェッチされたデータの先頭
2バイト(I01)を910へ出力し、転送されたデー
タの後2バイト(I23)を911へ出力する。また、
ライトポインタ700の下位2ビット(図3の(1))
が01で、かつフェッチ量信号201(図3の(2))
が01なら、転送されたデータの先頭2バイト(I0
1)を911へ出力し、転送されたデータの後2バイト
(I23)を912へ出力する。
When the start of the transfer data from the fetch circuit 200 is always in byte 0 (A), the value of the fetch amount signal 201 (00: 2 bytes, 01: 4 bytes, 1
The transfer data from the fetch circuit 200 is sent to the output 910, 911, 912 or 913 of the write align circuit 900 only by the number of bytes designated by 0: 6 bytes, 11 to 8 bytes). Also, transfer data byte and output 9
The correspondence with 10, 911, 912 and 913 is determined by the lower 2 bits ((2) in FIG. 3) of the write pointer. For example, as can be seen from the write line (A) in FIG. 3, if the lower 2 bits ((1) in FIG. 3) of the write pointer 700 are 00 and the fetch amount signal 201 ((2) in FIG. 3) is 01. The first 2 bytes (I01) of the fetched data are output to 910, and the last 2 bytes (I23) of the transferred data are output to 911. Also,
Lower 2 bits of the write pointer 700 ((1) in FIG. 3)
Is 01 and the fetch amount signal 201 ((2) in FIG. 3)
Is 01, the first 2 bytes of the transferred data (I0
1) is output to 911, and 2 bytes (I23) after the transferred data are output to 912.

【0065】一方、フェッチ回路200からの転送デー
タの先頭バイトが必ずしもバイト0ではない場合(B)
には図3のライトアライン(B)に示されるように、フ
ェッチ位置信号210の値(00:バイト0が先頭、0
1:バイト2が先頭、10:バイト4が先頭、11:バ
イト6が先頭)に指定された先頭バイトの位置とはライ
トポインタの下位2ビットによって、ライトアライン回
路900が転送されたデータを並び替える。例えば、フ
ェッチ位置信号211(図3の(3))が01なら、図
4(b)に示されるように、先頭バイトがバイト2にあ
る。この場合には、もしライトポインタの下位2ビット
(図3の(1))が00なら、転送されたデータのI2
3号(実は先頭2バイトである)を出力線910へ出力
し、I45を出力線911へ出力し、I67を出力線9
12へ出力し、I01を出力線913へ出力する(この
場合には、並び替える動作が表している)。もしライト
ポインタの下位2ビットが01なら、転送されたデータ
のI23(実は先頭2バイトである)を出力線911へ
出力し、I45を出力線912へ出力し、I67を出力
線913へ出力し、I12を出力線910へ出力する。
即ち、フェッチされたデータの先頭位置信号211とラ
イトポインタの下位2ビットによって、ライトアライン
回路900はフェッチされたデータを並び替える。図4
の(a)は、図3(A)の場合にフェッチ回路200に
あるデータとフェッチ量を示す図であり、図4の(b)
は図3(B)の場合にフェッチ回路200にあるデータ
とデータの先頭位置およびフェッチ量を示す図である。
リードアライン回路1000RF600,610,62
0,及び630から取り出された命令列はこのリードア
ライン回路1000で並び替えられて図示しない命令実
行制御部に送られる。リードアライン回路1000で
は、取り出すべき命令の先頭部分を出力線1010に、
また次の部分を出力線1011に、またその次の部分を
出力線1012にそれぞれ出力する。(出力線101
1,出力線1012を必要とするかは取り出すべき命令
の最大長による。この例では最小単位を2バイトとし、
最大6バイトの命令があることを想定しているため、出
力線1010,出力線1011,出力線1012という
2バイト幅の出力を3組設定している。)リードアライ
ン回路1000での並び替え制御は、リードポインタ8
00の値によって行われる。
On the other hand, when the first byte of the transfer data from the fetch circuit 200 is not always byte 0 (B)
As shown in the write align (B) of FIG. 3, the value of the fetch position signal 210 (00: byte 0 is the beginning, 0
The position of the head byte designated as 1: byte 2 is the head, 10: byte 4 is the head, 11: byte 6 is the head) and the data transferred by the write align circuit 900 is arranged by the lower 2 bits of the write pointer. Change. For example, if the fetch position signal 211 ((3) in FIG. 3) is 01, the first byte is in byte 2, as shown in FIG. 4 (b). In this case, if the lower 2 bits of the write pointer ((1) in FIG. 3) are 00, I2 of the transferred data
No. 3 (actually the first 2 bytes) is output to the output line 910, I45 is output to the output line 911, and I67 is output to the output line 9
12 and outputs I01 to the output line 913 (in this case, the rearrangement operation is shown). If the lower 2 bits of the write pointer are 01, I23 (actually the first 2 bytes) of the transferred data is output to the output line 911, I45 is output to the output line 912, and I67 is output to the output line 913. , I12 to the output line 910.
That is, the write align circuit 900 rearranges the fetched data according to the head position signal 211 of the fetched data and the lower 2 bits of the write pointer. Figure 4
4A is a diagram showing the data and the fetch amount in the fetch circuit 200 in the case of FIG. 3A, and FIG.
FIG. 4 is a diagram showing the data in the fetch circuit 200, the head position of the data, and the fetch amount in the case of FIG. 3B.
Read-align circuit 1000RF600, 610, 62
The instruction sequences fetched from 0 and 630 are rearranged by the read align circuit 1000 and sent to an instruction execution control unit (not shown). In the read align circuit 1000, the head portion of the instruction to be fetched is output to the output line 1010,
The next part is output to the output line 1011 and the next part is output to the output line 1012. (Output line 101
1, whether the output line 1012 is required depends on the maximum length of the instruction to be fetched. In this example, the minimum unit is 2 bytes,
Since it is assumed that there is a maximum 6-byte instruction, three sets of 2-byte width output line 1010, output line 1011 and output line 1012 are set. The rearrangement control in the read align circuit 1000 is performed by the read pointer 8
A value of 00 is used.

【0066】高速化レジスタ1100を持つ構成におい
ては、実行のために取り出される命令に続く部分を取り
出して高速化レジスタに送る必要があるが、このために
リードアライン回路1000に出力1020を設ける。
In the structure having the speed-up register 1100, it is necessary to fetch the part following the instruction fetched for execution and send it to the speed-up register. For this purpose, the read-align circuit 1000 is provided with an output 1020.

【0067】この出力1020は、リードポインタ80
0の値と通常取り出された命令の命令コードから判明す
る命令長によって制御される。これらの制御のようすを
図6に示す。すなわち、リードポインタの下位2ビット
(図6の(1))と命令長信号1001(図6の
(2))によってリードアライン回路の出力1010,
1011,1012及び1020は、命令バッファの出
力RF600,610,RF620,RF630との対
応関係(1対1ではない)を示している。例えば、リー
ドポインタの下位2ビット(図6の(1))が00な
ら、かつ命令長信号1001が01(2バイト)なら、
RF600の出力を1010へ出力し、RF610の出
力を1011へ出力し、RF620の出力を1012へ
出力する。また、RF610の出力を1020へ出力
し、即ち、次に実行すべき命令・先頭2バイトを102
0へ出力して、高速レジスタ1160へ書き込む。リー
ドポインタの下位2ビットが01なら、かつ命令長信号
1001が16(4バイト)なら、RF610の出力を
1010へ出力し、RF620の出力を1011出力
し、RF630の出力を1012へ出力する。またRF
630の出力を1020へ出力する。この場合には、並
び替える動作が表している。
This output 1020 is the read pointer 80.
It is controlled by the value of 0 and the instruction length which is usually found from the instruction code of the fetched instruction. The state of these controls is shown in FIG. That is, the lower 10 bits of the read pointer ((1) in FIG. 6) and the instruction length signal 1001 ((2) in FIG. 6) output 1010,
Reference numerals 1011 to 1012 and 1020 indicate the correspondences (not one-to-one correspondence) with the outputs RF600, 610, RF620 and RF630 of the instruction buffer. For example, if the lower 2 bits ((1) in FIG. 6) of the read pointer is 00 and the instruction length signal 1001 is 01 (2 bytes),
The output of RF600 is output to 1010, the output of RF610 is output to 1011, and the output of RF620 is output to 1012. Also, the output of the RF 610 is output to 1020, that is, the next command to be executed and the first 2 bytes are 102
Output to 0 and write to the high speed register 1160. If the lower 2 bits of the read pointer are 01 and the instruction length signal 1001 is 16 (4 bytes), the output of RF610 is output to 1010, the output of RF620 is output to 1011 and the output of RF630 is output to 1012. Also RF
The output of 630 is output to 1020. In this case, a rearrangement operation is represented.

【0068】命令バッファからの命令読み出しを高速化
するため、命令バッファの先頭部分(ここでは前述のよ
うに1バイトとする)をラッチするレジスタである。こ
のレジスタには、ライトアライン回路900の出力91
0(詳細後述)の先頭の1バイトとリードアライン回路
1000の出力1020(1バイト幅)が選択的に入力
される。
In order to speed up the instruction reading from the instruction buffer, this is a register for latching the head portion (here, 1 byte as described above) of the instruction buffer. This register has an output 91 of the write align circuit 900.
The leading 1 byte of 0 (described later in detail) and the output 1020 (1 byte width) of the read align circuit 1000 are selectively input.

【0069】RAMはレジスタより命令を読み出す速度
が遅いので、命令バッファの先頭部分をレジスタにラッ
チする。このレジスタの内容はリードアライン回路10
00の出力1020またはライトアライン回路900の
出力910の先頭の1バイトである。通常はこのレジス
タの内容をリードアライン回路1000の出力1020
である。分岐命令が分岐成立の場合にはすなわちバッフ
ァ内の命令が無効である場合には、このレジスタの内容
はライトアライン回路900の出力914にセットされ
る。
Since the RAM is slower in reading the instruction than the register, the head portion of the instruction buffer is latched in the register. The contents of this register are read align circuit 10
It is the first 1 byte of the output 1020 of 00 or the output 910 of the write align circuit 900. Normally, the contents of this register are output 1020 of the read align circuit 1000.
Is. If the branch instruction is a branch taken, that is, if the instruction in the buffer is invalid, the content of this register is set to the output 914 of the write align circuit 900.

【0070】次に、図1を参照して命令バッファの全体
の動作について説明する。 制御 (初期値) ライトポインタ700=0000 リードポインタ800=0000 有効フラグ1150=0 命令フェッチ フェッチ回路200からのフェッチが行われると、命令
バッファは図示されない信号でこれを知り、RF600
〜630へのライトとライトポインタ700及び有効フ
ラグ1150の更新を行う。
Next, the overall operation of the instruction buffer will be described with reference to FIG. Control (initial value) Write pointer 700 = 0000 Read pointer 800 = 0000 Valid flag 1150 = 0 Instruction fetch When the fetch from the fetch circuit 200 is performed, the instruction buffer knows this by a signal not shown, and RF600
To 630 and the write pointer 700 and the valid flag 1150 are updated.

【0071】ライトアドレスとライトイネーブルの制御
については図2から分かるように、ライトアドレス回路
701はライトポインタによって、RF600,RF6
10,RF620トRF630のそれぞれのライトアド
レスを決定する。また、このライトアドレス回路701
はライトポインタとフェッチされる命令の命令長によっ
てこれらのRF600,RF610,RF620とRF
630のライトイネーブル信号を制御する。有効フラグ
1150は、フェッチが行われる場合には通常オンとな
る。これは前述の式においてライトされるバイト数が0
以上のとき、実行される命令長はすでに命令バッファ内
に保持されたバイト数以下でしかないためである。
As to the control of the write address and the write enable, as can be seen from FIG. 2, the write address circuit 701 uses the write pointer to control the RF600 and RF6.
10, write addresses of RF620 and RF630 are determined. In addition, this write address circuit 701
Are RF600, RF610, RF620 and RF depending on the write pointer and the instruction length of the fetched instruction.
The write enable signal of 630 is controlled. The valid flag 1150 is normally turned on when a fetch is performed. This is because the number of bytes written in the above equation is 0.
This is because, in the above case, the instruction length to be executed is no more than the number of bytes already held in the instruction buffer.

【0072】高速化レジスタに、ライトアライン回路9
00の出力である910の最初の1バイトを直接ライト
するのは命令バッファが空の場合、及び実行される命令
の命令長が保持されているバイト数に等しい場合、及び
分岐先命令のフェッチの場合のみである。これは、高速
化レジスタ1100に保持される値が実行される命令の
先頭バイトであることから、通常の命令バッファ内に命
令が保持されている場合には、リードアライン回路10
00の出力1020から実行される命令の続きの部分の
1バイトを得てこれをセットし、命令バッファが空の場
合にはフェッチされた命令バッファに書き込まれるとき
にその先頭部分をこれにセットし、また命令の実行に伴
ってちょうド命令バッファが空になる場合のフェッチで
はこのフェッチデータが次の命令の先頭部分となるため
にこれをセットし、また、分岐が成立した時には今まで
保持されていた非分岐側の命令を破棄し、新たにフェッ
チされた分岐先命令が次に実行されるため、その先頭部
分をセットすることによる。 通常命令の実行 通常命令の長さはその命令コードをみることで判明す
る。例えば命令コードの最初の2ビットの値によって以
下のようにその命令長を知ることができる。
The write align circuit 9 is added to the speed-up register.
The first byte of 910, which is the output of 00, is directly written when the instruction buffer is empty, and when the instruction length of the instruction to be executed is equal to the number of bytes held, and when the branch destination instruction is fetched. Only in case. This is because the value held in the speed-up register 1100 is the first byte of the instruction to be executed. Therefore, when the instruction is held in the normal instruction buffer, the read-align circuit 10 is used.
Output 1020 of 00 to get 1 byte of the subsequent part of the instruction to be executed and set it, and if the instruction buffer is empty, set it to the beginning when it is written to the fetched instruction buffer In fetching when the instruction instruction buffer becomes empty as the instruction is executed, this fetch data is set because it becomes the beginning of the next instruction, and it is retained until the branch is taken. This is because the instruction on the non-branch side that had been abandoned is discarded and the newly fetched branch destination instruction is executed next, so the leading part is set. Execution of normal instruction The length of a normal instruction can be found by looking at the instruction code. For example, the instruction length can be known as follows from the value of the first two bits of the instruction code.

【0073】[0073]

【表11】 [Table 11]

【0074】この命令長が命令バッファ内に保持されて
いるバイト長以下で、かつ、その他の命令開始条件が整
ったとき、図示しない命令実行制御部から命令の取り出
しが指示され、リードポインタ800、有効フラグ11
50、及び高速化レジスタ1100が更新される。リー
ドアドレスの制御は図5に示す。リードアライン回路の
制御は図6に示す。即ち、図5から分かるように、リー
ドアドレス回路801はリードポインタによって各RF
の局所リードアドレスを決定する。また、図6から分か
るように、リードアライン回路1000はリードポイン
タと命令長信号によって、リードアライン回路を制御す
る。 分岐命令の実行 分岐命令の実行で分岐が不成立の場合には通常の命令の
フェッチ及び実行が行われる。分岐命令の実行で分岐が
成立した場合には、次のような制御が行われる。 分岐成功時に分岐先フェッチがあるケース これは分岐判定サイクルで分岐が成立した場合、そのサ
イクルにフェッチ回路200からのフェッチデータが分
岐先のものである構成の場合をいう。 データライトとポインタ操作 フェッチ回路200からはフェッチデータ210、フェ
ッチ量201、及びフェッチ位置211が送られてくる
ことは通常のフェッチのケースと同じとする。ライトイ
ネーブル、ライトポインタ、リードポインタの制御には
複数の方法が考えられるがここでは以下の3つの例を挙
げることにする。 (第1の例)ライト位置をそのときのライトポインタの
値から、通常の場合と同じく図2のように制御し、更新
前のライトポインタの値を新しいリードポインタの値と
する方法。
When this instruction length is equal to or less than the byte length held in the instruction buffer and the other instruction start conditions are satisfied, the instruction execution control unit (not shown) gives an instruction to fetch the instruction and the read pointer 800, Valid flag 11
50 and the speed-up register 1100 are updated. The control of the read address is shown in FIG. The control of the read align circuit is shown in FIG. That is, as can be seen from FIG. 5, the read address circuit 801 uses the read pointer to read each RF.
Determine the local read address of. Further, as can be seen from FIG. 6, the read align circuit 1000 controls the read align circuit by the read pointer and the instruction length signal. Execution of branch instruction If the branch is not taken due to the execution of the branch instruction, normal instruction fetch and execution are performed. When a branch is taken by executing the branch instruction, the following control is performed. Case where branch destination fetch is performed when branch is successful This means a case where, when a branch is taken in a branch determination cycle, the fetch data from the fetch circuit 200 is the branch destination in that cycle. Data write and pointer operation It is assumed that the fetch data 210, the fetch amount 201, and the fetch position 211 are sent from the fetch circuit 200 as in the case of normal fetch. Although a plurality of methods can be considered for controlling the write enable, the write pointer, and the read pointer, the following three examples will be given here. (First example) A method of controlling the write position from the value of the write pointer at that time as in the normal case as shown in FIG. 2 and setting the value of the write pointer before update to the value of the new read pointer.

【0075】この方法はライト位置を通常の方法と同じ
方法で行い、リードポインタをライトした位置にするこ
とによって次に実行すべき命令の先頭をいまライトした
位置とする方法である。 (第2の例)ライトアドレスを0に固定し、ライトアド
レス及びライトイネーブルを図2のライトポインタが0
000のケースて制御し、ライトポインタをフェッチ量
だけ更新し、リードポインタは0000にする方法。
This method is a method in which the write position is the same as the normal method, and the read pointer is set to the written position so that the head of the next instruction to be executed is the written position. (Second example) The write address is fixed to 0, and the write address and write enable are set to 0 by the write pointer in FIG.
In this case, the write pointer is updated by the fetch amount and the read pointer is set to 0000.

【0076】この方法は分岐成立によってポインタを初
期化したように動作させる方法である。 (第3の例)フェッチ量201,及びフェッチ位置21
1から図8のようにライトアドレス、ライトイネーブル
を制御し、ライトポインタ、リードポインタを更新する
方法。すなわちフェッチ位置211はバイト0ならば、
リードポインタを0にセットし、バイト2ならば1にセ
ットし、バイト4ならば2にセットし、バイト6ならば
3にセットする。また、ライトポインタは((リードポ
インタ)+フェッチ量/2)と等しい値でセットされ
る。例えば、フェッチ位置信号211がバイト2なら、
かつフェッチ量信号201から4バイトなら、リードポ
インタを1にセットし、ライトポインタを(1+4/
2)でセットする。同時に、RF600、RF610、
RF620およびRF630のライトアドレスがそれぞ
れ1、0、0、0にセットされ、RF600、RF61
0、RF620及びRF630のライトイネーブル信号
がそれぞれoff,on,on,off にセットされる。即ち、4バ
イトデータをそれぞれRF610の0位置とRF620
の0位置に書き込む。
This method is a method of operating as if the pointer was initialized by the branch taken. (Third example) fetch amount 201 and fetch position 21
A method of updating the write pointer and the read pointer by controlling the write address and the write enable as shown in FIGS. That is, if the fetch position 211 is byte 0,
The read pointer is set to 0, byte 1 is set to 1, byte 4 is set to 2, byte 6 is set to 3. The write pointer is set to a value equal to ((read pointer) + fetch amount / 2). For example, if the fetch position signal 211 is byte 2,
If the fetch amount signal 201 is 4 bytes, the read pointer is set to 1 and the write pointer is set to (1 + 4 /
Set in 2). At the same time, RF600, RF610,
The write address of RF620 and RF630 is set to 1, 0, 0, 0 respectively, and RF600, RF61
The write enable signals of 0, RF620, and RF630 are set to off, on, on, and off, respectively. That is, 4-byte data is set to the 0 position of RF610 and RF620, respectively.
Write at 0 position of.

【0077】フェッチ量=0:00,1:01,2:1
0,3:11である。この方法はフェッチデータを実質
的に並び替えない方法であり、図8に示すように、フェ
ッチ回路200からフェッチされたデータを順序を変わ
らないままにRF600,RF610,RF620及び
RF630に書き込むので、ライトアライン回路900
ではフェッチデータを並び替える必要はない。従ってフ
ェッチ動作が早く終了する。この第三の手法は分岐成立
時のフェッチ動作に時間的余裕がないケースで有効であ
る。従って、次の命令をフェッチするのに要する時間は
厳しい場合に有効である。
Fetch amount = 0: 00, 1:01, 2: 1
0, 3:11. This method is a method in which the fetch data is not substantially rearranged. As shown in FIG. 8, since the data fetched from the fetch circuit 200 is written in the RF600, RF610, RF620 and RF630 without changing the order, the write data is written. Align circuit 900
Then, it is not necessary to rearrange the fetch data. Therefore, the fetch operation ends early. This third method is effective in the case where there is no time margin in the fetch operation when the branch is taken. Therefore, the time required to fetch the next instruction is effective in a severe case.

【0078】[0078]

【実施例2】 命令バッファの幅がフェッチ量より広い書き込み幅を持
つケースの実施例 図9は8バイト幅でフェッチできるマシンにおいて、4
ワード 2バイト幅のレジスタファイルを5個並べたこ
とによって書き込み幅が10バイト命令バッファを示し
ている。この命令バッファの容量は20ワードとなっ
た。なお、実施例2中のRF600,610,620,
630及び640の中に示される(0),
(1),....,(19)は図1の場合と同じく、R
F内の各ワードにつけられた名前であり、これはちょう
ど(0),(1),....,(19)つづいて
(0),(1),...というように、環レジスタを構
成していることになる。実施例2は実施例1と異なるの
はRF640を使っている点である。これに伴って、ア
ドレスの生成やライトイネーブルの生成やライトアライ
やリードアラインなどが変る必要がある。図9において
は、図1と同じ部分は同じ番号を使っている。次には、
実施例2の各部分を実施例1の説明より簡単に説明す
る。
Embodiment 2 Embodiment of the case where the width of the instruction buffer has a write width wider than the fetch amount FIG.
A write width indicates a 10-byte instruction buffer by arranging five register files each having a word width of 2 bytes. The capacity of this instruction buffer is 20 words. The RF 600, 610, 620,
(0) shown in 630 and 640,
(1) ,. . . . , (19) are the same as in the case of FIG.
The name given to each word in F, which is just (0), (1) ,. . . . , (19) and then (0), (1) ,. . . In this way, it constitutes the ring register. The second embodiment differs from the first embodiment in that RF640 is used. Along with this, it is necessary to change address generation, write enable generation, write align, read align, and the like. In FIG. 9, the same parts as those in FIG. 1 use the same numbers. Next,
Each part of the second embodiment will be briefly described from the description of the first embodiment.

【0079】20ワードをアドレスするために、ポイン
タは5ビット構成となる。また、ここではひとつの例と
して表12に示されるようなポインタとアドレスの関係
を使用することにする。
To address 20 words, the pointer has a 5-bit structure. Further, here, as an example, the relationship between the pointer and the address as shown in Table 12 is used.

【0080】[0080]

【表12】 [Table 12]

【0081】この表12に示されている関係はポインタ
の上位2ビットは各RF内のアドレスを指し、下位3ビ
ットはRFの位置を示している。本実施例2では、命令
バッファの幅が10バイトであり、フェッチ量の幅が8
バイトので、5つのRF中には、必ず1つのRFが使わ
れない。この点において、本アドレスの生成方法(表1
2)は実施例1のアドレスの生成方法(図2と図5)と
異なる。表12には、( )を付かれたアドレスに対応
するRFがこの使われていないRFである。また、この
( )内の値がデーコードし易い値である。本実施例2
では、リードアドレスとライトアドレスがこの表12に
より生成される。
In the relationship shown in Table 12, the upper 2 bits of the pointer indicate the address in each RF, and the lower 3 bits indicate the RF position. In the second embodiment, the width of the instruction buffer is 10 bytes and the width of the fetch amount is 8 bytes.
Since it is a byte, one RF is not always used among the five RFs. In this respect, the method of generating this address (Table 1
2) is different from the address generation method of the first embodiment (FIGS. 2 and 5). In Table 12, the RF corresponding to the address marked with () is the unused RF. Further, the value in the parentheses is a value that is easy to date code. Example 2
Then, the read address and the write address are generated by this table 12.

【0082】ライトポインタ700は次の命令フェッチ
で書き込みを行う先頭位置を示すものである。フェッチ
回路200から示されるフェッチ量(信号201で示さ
れる)に応じて、+1(2バイトフェッチの場合),+
2(4バイト),+3(6バイト),及び+4(8バイ
ト)する回路705を設ける。
The write pointer 700 indicates the head position where writing is performed in the next instruction fetch. +1 (in the case of 2-byte fetch), + according to the fetch amount (indicated by the signal 201) indicated by the fetch circuit 200
A circuit 705 for 2 (4 bytes), +3 (6 bytes), and +4 (8 bytes) is provided.

【0083】ライトアドレス回路801は、このポイン
タの値によってRFのライトアドレス及びライトイネー
ブル信号を制御する。RF600,610,620,6
30,及び640に対するライトアドレスはそれぞれ6
01,611,621,631,及び642で示され
る。ライトイネーブルはそれぞれ102,112,12
2,ライトポインタ800とライトイネーブル602,
612,622,632,及び642の関係は表13に
示す。
The write address circuit 801 controls the RF write address and write enable signal according to the value of this pointer. RF600, 610, 620, 6
The write addresses for 30 and 640 are 6 respectively.
01, 611, 621, 631, and 642. Write enable is 102, 112, 12 respectively
2, write pointer 800 and write enable 602
Table 13 shows the relationship between 612, 622, 632, and 642.

【0084】[0084]

【表13】 [Table 13]

【0085】リードポインタ800は、次に実行すべき
命令の先頭位置を示すものである。図示しない命令実行
制御部からの指示で命令が実行される場合、その命令の
命令長(通常これは実行される命令の命令コードから判
明する為、この例では命令の取り出しを制御するリード
アライン回路600からの信号601で示される)に応
じて、+1(2バイト命令の場合),+2(4バイ
ト),及び+3(6バイト)する回路805を設ける。
The read pointer 800 indicates the head position of the next instruction to be executed. When an instruction is executed by an instruction from an instruction execution control unit (not shown), the instruction length of the instruction (normally this is found from the instruction code of the instruction to be executed, so in this example, a read-align circuit that controls the fetching of the instruction A circuit 805 for +1 (in the case of a 2-byte instruction), +2 (4 bytes), and +3 (6 bytes) is provided according to the signal 601 from 600.

【0086】リードアドレス回路801は、このポイン
タの値によってRFのリードアドレスを制御する。RF
600,610,620,及び630に対するリードア
ドレスはそれぞれ603,613,623,633,及
び643で示される。これらの関係はライトポインタの
それと同じであり、表12の関係を使用できる。
The read address circuit 801 controls the RF read address according to the value of this pointer. RF
Read addresses for 600, 610, 620, and 630 are shown as 603, 613, 623, 633, and 643, respectively. These relationships are the same as those of the write pointer, and the relationships in Table 12 can be used.

【0087】有効フラグ1150は命令バッファ内に有
効なデータを保持していることを示すフラグであり、こ
のフラグが0の場合には有効なデータを保持していない
ものとする。
The valid flag 1150 is a flag indicating that valid data is held in the instruction buffer, and when this flag is 0, it is assumed that valid data is not held.

【0088】有効フラグ1150は有効フラグ更新回路
1155でその値が決定されるが、有効フラグ更新回路
1155にはフェッチ量信号201,実行命令信号10
01の他に、ライトポインタ700,リードポインタ8
00,また分岐命令の分岐成立などによって強制的に命
令バッファの内容を無効化させる信号159が与えられ
ている。
The value of the valid flag 1150 is determined by the valid flag update circuit 1155, but the valid flag update circuit 1155 has a fetch amount signal 201 and an execution instruction signal 10.
01, write pointer 700, read pointer 8
00, and a signal 159 for forcibly invalidating the contents of the instruction buffer when the branch of the branch instruction is taken.

【0089】このフラグの更新条件については実施例1
と同じである。命令バッファ内に保持されているバイト
数はライトポインタ700,リードポインタ800,及
び有効フラグ1150の値からは表14〜表17のよう
に求めることができる。
The update condition of this flag is described in the first embodiment.
Is the same as. The number of bytes held in the instruction buffer can be obtained as shown in Tables 14 to 17 from the values of the write pointer 700, read pointer 800, and valid flag 1150.

【0090】[0090]

【表14】 [Table 14]

【0091】[0091]

【表15】 [Table 15]

【0092】[0092]

【表16】 [Table 16]

【0093】[0093]

【表17】 [Table 17]

【0094】高速化レジスタ1100は命令バッファか
らの命令読み出しを高速化するため、命令バッファの先
頭部分(ここでは前例と同様に1バイトとする)をラッ
チするレジスタである。
The speed-up register 1100 is a register for latching the head portion (here, 1 byte as in the previous example) of the instruction buffer in order to speed up the instruction reading from the instruction buffer.

【0095】このレジスタには、フェッチ回路200の
先頭の1バイト(後述)とリードアライン回路1000
の出力620(1バイト幅)が選択的に入力される。ラ
イトアライン回路900は、フェッチ量201,ライト
ポインタ700の値で制御されるが、フェッチ回路20
0の構成次第では、フェッチ回路200から送られてく
る先頭位置アドレス211も必要となる。
In this register, the first 1 byte (described later) of the fetch circuit 200 and the read align circuit 1000 are stored.
Output 620 (1 byte width) is selectively input. The write align circuit 900 is controlled by the fetch amount 201 and the value of the write pointer 700.
Depending on the configuration of 0, the head position address 211 sent from the fetch circuit 200 is also required.

【0096】フェッチ回路200からフェッチデータが
4(a)のようにフェッチデータ線210のバイト0に
は常にフェッチの先頭データが送られてくる場合には、
ライトアライン回路900は表18のライトアライン
(A)のように制御すればよい。この場合には専らライ
トポインタの下位3ビットのみがその制御に使用される
ことになる。
When the fetch head data is always sent from the fetch circuit 200 to byte 0 of the fetch data line 210 as in the case of fetch data 4 (a),
The write align circuit 900 may be controlled as in the write align (A) in Table 18. In this case, only the lower 3 bits of the write pointer are exclusively used for the control.

【0097】[0097]

【表18】 [Table 18]

【0098】一方、フェッチ回路200からフェッチデ
ータがフェッチデータ線210に図4(b)のように送
られてくる場合、ライトアライン回路900は表(1
1)のライトアライン(B)のように制御すればよい。
表19のライトアライン(A)制御関係とライトアライ
ン(B)の制御関係は、それぞれ実施例1の図3のライ
トアライン(A)の制御関係とライトアライン(B)の
制御関係とそれぞれ違う。
On the other hand, when the fetch data is sent from the fetch circuit 200 to the fetch data line 210 as shown in FIG. 4B, the write align circuit 900 causes the table (1
It may be controlled like the write align (B) of 1).
The write-align (A) control relationship and the write-align (B) control relationship in Table 19 are different from the write-align (A) control relationship and the write-align (B) control relationship in FIG. 3 of the first embodiment, respectively.

【0099】[0099]

【表19】 [Table 19]

【0100】高速化レジスタ1100へ送る先頭バイト
1020とは、フェッチデータの先頭の1バイトであ
り、(A)のタイプのアラインでは常にバイト0の値
が、(B)のタイプのアラインではフェッチ位置のバイ
トがそれぞれ送られる。
The first byte 1020 to be sent to the speed-up register 1100 is the first byte of the fetch data, and the value of byte 0 is always in the (A) type alignment, and the fetch position in the (B) type alignment. Bytes of each are sent.

【0101】RF600,610,620,630,及
び640から取り出された命令列はリードアライン回路
1000で並び替えられて図示しない命令実行制御部に
送られる。
The instruction sequences extracted from the RFs 600, 610, 620, 630, and 640 are rearranged by the read-align circuit 1000 and sent to an instruction execution control unit (not shown).

【0102】リードアライン回路1000では、取り出
すべき命令の先頭部分を610に、また次の部分を61
1に、またその次の部分を612にそれぞれ出力する。
出力線611,出力線612などを必要とするかは取り
出すべき命令の最大長による。この例では最小単位を2
バイトとし、最大6バイトの命令があることを想定して
いる為、610,611,612という2バイト幅の出
力を3組設定している。
In the read align circuit 1000, the head portion of the instruction to be fetched is 610 and the next portion is 61.
1 and the next part to 612.
Whether the output line 611, the output line 612, or the like is needed depends on the maximum length of the instruction to be fetched. In this example, the minimum unit is 2
Since it is assumed that there is a maximum of 6 bytes for each instruction, 3 sets of 2-byte width outputs 610, 611 and 612 are set.

【0103】リードアライン回路600での並び替え制
御は、リードポインタ800の値によって行われる。高
速化レジスタ1100を持つ構成においては、実行のた
めに取り出される命令に続く部分を取り出して高速化レ
ジスタに送る必要があるが、この為にリードアライン回
路1000に出力1020を設ける。
The rearrangement control in the read align circuit 600 is performed by the value of the read pointer 800. In the configuration having the speed-up register 1100, it is necessary to fetch the part following the instruction fetched for execution and send it to the speed-up register. For this purpose, the read-align circuit 1000 is provided with an output 1020.

【0104】これらの制御の様子を表20に示す。実施
例2のリードアラインの制御関係を表12に、命令バッ
ファ内の命令保持量を表13に示すが、これらは実施例
1の説明から明らかであるから説明を省略する。
Table 20 shows the states of these controls. Table 12 shows the read-alignment control relationship of the second embodiment and Table 13 shows the instruction holding amount in the instruction buffer. However, since these are clear from the description of the first embodiment, the description thereof will be omitted.

【0105】[0105]

【表20】 [Table 20]

【0106】[0106]

【発明の効果】本発明によれば、命令バッファをレジス
タファイルあるいはRAMで構成したので、高集積化が
可能となる。また、本発明では高速化の必要な部分はF
Fで構成したので、高集積化したうえに高速化を図るこ
とができる。
According to the present invention, since the instruction buffer is composed of a register file or RAM, high integration can be achieved. Further, in the present invention, the portion requiring high speed is F
Since it is composed of F, it is possible to achieve high integration and high speed.

【0107】さらに、本発明によって命令バッファをレ
ジスタファイルあるいはRAMで構成した場合にも分岐
命令の効率的な処理を図ることができる。
Further, according to the present invention, it is possible to efficiently process a branch instruction even when the instruction buffer is composed of a register file or a RAM.

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

【図1】本発明の実施例1である。FIG. 1 is a first embodiment of the present invention.

【図2】ライトアドレス回路701の制御を示してい
る。
FIG. 2 shows control of a write address circuit 701.

【図3】ライトアライン回路900の制御を示してい
る。
FIG. 3 shows control of a write align circuit 900.

【図4】フェッチ量とフェッチ位置によってフェッチ線
210にあるデータの分布状態を示している。
FIG. 4 shows a distribution state of data on a fetch line 210 according to a fetch amount and a fetch position.

【図5】リードアドレス回路501の制御を示してい
る。
FIG. 5 shows control of a read address circuit 501.

【図6】リードアライン回路1100の制御を示してい
る。
FIG. 6 shows control of the read align circuit 1100.

【図7】ライトポインタとリードポインタの差と命令バ
ッファにあるバイトの数の対応関係を示している。
FIG. 7 shows the correspondence relationship between the difference between the write pointer and the read pointer and the number of bytes in the instruction buffer.

【図8】分岐成立時にライト側に並び替えがいらないラ
イト,ポインタの制御を示している。
FIG. 8 shows control of a write and a pointer that do not require rearrangement on the write side when a branch is taken.

【図9】本発明の実施例2である。FIG. 9 is Embodiment 2 of the present invention.

【図10】従来の例である。FIG. 10 is a conventional example.

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

200 フェッチ回路 600,610,620,630 レジスタファイ
ル 700 ライトポインタ 701 ライトアドレス回路 800 リードポインタ 801 リードアドレス回路 900 ライトアライン回路 1000 リードアライン回路 1100 高速化レジスタ 1150 有効フラグ 1155 有効フラグ更新回路
200 fetch circuit 600, 610, 620, 630 register file 700 write pointer 701 write address circuit 800 read pointer 801 read address circuit 900 write align circuit 1000 read align circuit 1100 speed-up register 1150 valid flag 1155 valid flag update circuit

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 プログラムを記憶するメモリと、該メモ
リより命令の実行に先立って命令を取り出して格納する
命令バッファとを備え、この命令バッファは命令長の最
小長を単位とする幅を持つレジスタファイルあるいはR
AMを、メモリから一度に命令をフェッチできる幅にな
るように並べて構成し、該レジスタファイルあるいはR
AMをライトポインタおよびリードポインタによって制
御することを特徴とする命令バッファ方式。
1. A memory for storing a program, and an instruction buffer for fetching and storing an instruction from the memory prior to execution of the instruction, the instruction buffer having a width with a minimum instruction length as a unit. File or R
AMs are arranged side by side so that instructions can be fetched from memory at one time.
An instruction buffer system characterized in that AM is controlled by a write pointer and a read pointer.
【請求項2】 前記命令バッファは、実行が開始される
命令の一部または全部を格納するフリップフロップを有
することを特徴とする請求項1記載の命令バッファ方
式。
2. The instruction buffer system according to claim 1, wherein the instruction buffer has a flip-flop for storing a part or all of an instruction whose execution is started.
【請求項3】 分岐命令の実行に際して、分岐判定と同
じサイクルまたはそれ以前のサイクルで分岐先命令列の
フェッチを行うパイプライン制御方式にあって、分岐成
立時にポインタ制御によってすでにフェッチされている
非分岐側の命令列を無効化することを特徴とする請求項
1記載の命令バッファ方式。
3. A pipeline control method for fetching a branch destination instruction sequence in the same cycle as the branch determination or in a cycle before the branch determination, when a branch instruction is executed. 2. The instruction buffer system according to claim 1, wherein the instruction stream on the branch side is invalidated.
【請求項4】 メモリからのフェッチ量が一定でない、
あるいは命令バッファの幅が一度にフェッチされる幅よ
りも大きい場合に、そのフェッチ量とライトポインタの
値からフェッチデータを並び替えて目的のレジスタファ
イルあるいはRAMにライトすることを特徴とする請求
項1記載の命令バッファ方式。
4. The fetch amount from the memory is not constant,
Alternatively, when the width of the instruction buffer is larger than the width fetched at one time, the fetch data is rearranged based on the fetch amount and the value of the write pointer, and the data is written to the target register file or RAM. The instruction buffer method described.
【請求項5】 実行すべき命令をレジスタファイルある
いはRAMから取り出す際にリードポインタの値によっ
て並び替えながら取り出すことを特徴とする請求項1記
載の命令バッファ方式。
5. The instruction buffer system according to claim 1, wherein when fetching an instruction to be executed from a register file or a RAM, the instructions are rearranged according to the value of the read pointer.
JP11621792A 1992-05-08 1992-05-08 Instruction buffer system Withdrawn JPH05313888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11621792A JPH05313888A (en) 1992-05-08 1992-05-08 Instruction buffer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11621792A JPH05313888A (en) 1992-05-08 1992-05-08 Instruction buffer system

Publications (1)

Publication Number Publication Date
JPH05313888A true JPH05313888A (en) 1993-11-26

Family

ID=14681735

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11621792A Withdrawn JPH05313888A (en) 1992-05-08 1992-05-08 Instruction buffer system

Country Status (1)

Country Link
JP (1) JPH05313888A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6530013B1 (en) 1998-12-17 2003-03-04 Fujitsu Limited Instruction control apparatus for loading plurality of instructions into execution stage

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6530013B1 (en) 1998-12-17 2003-03-04 Fujitsu Limited Instruction control apparatus for loading plurality of instructions into execution stage

Similar Documents

Publication Publication Date Title
US4524416A (en) Stack mechanism with the ability to dynamically alter the size of a stack in a data processing system
US5664215A (en) Data processor with an execution unit for performing load instructions and method of operation
US5896529A (en) Branch prediction based on correlation between sets of bunches of branch instructions
EP0438961A2 (en) Hardware data string operation controller
US6272596B1 (en) Data processor
US4037213A (en) Data processor using a four section instruction format for control of multi-operation functions by a single instruction
KR100346515B1 (en) Temporary pipeline register file for a superpipe lined superscalar processor
JPH0814801B2 (en) Programmable access memory
JPH0668736B2 (en) Apparatus and method for providing a cache memory unit with a write operation utilizing two system clock cycles
US5459847A (en) Program counter mechanism having selector for selecting up-to-date instruction prefetch address based upon carry signal of adder which adds instruction size and LSB portion of address register
US4240137A (en) Computer for directly executing a program including a plurality of structured blocks
JPH05313888A (en) Instruction buffer system
US4737908A (en) Buffer memory control system
JPS6211736B2 (en)
JP2901247B2 (en) Discharge control method
JP3132566B2 (en) Instruction precedence controller
JPS63261430A (en) Method and apparatus for information processing
JPS62145430A (en) Data processor
JPS5935055B2 (en) data processing system
JPH0816392A (en) Computer system, computer-system operating method and computer-instruction-sequence execution method
JP2576589B2 (en) Virtual storage access control method
JPH08137690A (en) Program execution control method
JP2583614B2 (en) Vector arithmetic unit
JP2763450B2 (en) Pipeline processing data processing device
JPS6120155A (en) Memory access control device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990803