JPH06110686A - Register interference preventing device - Google Patents

Register interference preventing device

Info

Publication number
JPH06110686A
JPH06110686A JP25608192A JP25608192A JPH06110686A JP H06110686 A JPH06110686 A JP H06110686A JP 25608192 A JP25608192 A JP 25608192A JP 25608192 A JP25608192 A JP 25608192A JP H06110686 A JPH06110686 A JP H06110686A
Authority
JP
Japan
Prior art keywords
register
instruction
timing
bus
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP25608192A
Other languages
Japanese (ja)
Inventor
Mikio Ogisu
幹雄 荻須
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP25608192A priority Critical patent/JPH06110686A/en
Publication of JPH06110686A publication Critical patent/JPH06110686A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To interrupt the backward program execution in case of a reference interference at a pipeline processing and to prevent the register interference by re-execution by occupying one CPU with plural register files and permitting the plural register files to parallely process plural tasks. CONSTITUTION:Address information outputted from a bus 1 address generation section 5 and from a bus 3 address generation section 7 is inputted to a register file 10 and to an address comparison section 11 as well. A register file selection number outputted by a register file selection section 17 is also inputted to the address comparison section 11. Only when the address information and the register file number coincide, an address output delay signal 16 is inputted to the bus 1 address generation section 5, preventing the register interference.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はパイプライン処理でのレ
ジスタ干渉があった場合、後方のプログラム実行を中断
し、再実行することによりレジスタ干渉を回避するレジ
スタ干渉回避装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a register interference avoiding apparatus for avoiding register interference by interrupting and re-executing backward program execution when register interference occurs in pipeline processing.

【0002】[0002]

【従来の技術】パイプライン処理の場合、現在実行中の
命令のレジスタへの書き込み動作と次に実行する命令の
レジスタからの読み出し動作が同一タイミングで発生す
る場合がある。さらに、次に実行する命令が、現在実行
中の演算結果(レジスタの値)を参照して実行されてい
くようにプログラムが組まれている場合、現在実行中の
命令が書き込んでいるレジスタと次に実行する命令が読
み出しているレジスタが同一レジスタ(同じレジスタア
ドレスを持つ)場合、データの書き込みと読み出しが同
一レジスタに対し同タイミングで行われているため、読
み出されたデータの値が書き込まれたデータの値と一致
しない場合が存在した。
2. Description of the Related Art In pipeline processing, a write operation of a currently executed instruction to a register and a read operation of an instruction to be executed next may occur at the same timing. In addition, if the program to be executed next is executed by referring to the operation result (register value) that is currently being executed, the register that is currently being executed and the next If the register read by the instruction to be executed in the same register is the same register (has the same register address), the value of the read data is written because the data writing and reading are performed to the same register at the same timing. There was a case where it did not match the value of the data.

【0003】従来、このようなレジスタ干渉といわれる
現象を回避する手段として、次のものが考えられてい
る。
Conventionally, the following means have been considered as means for avoiding such a phenomenon called register interference.

【0004】(1)現在実行中の命令が書き込んでいる
レジスタと次に実行する命令が読み出しているレジスタ
が一致(レジスタアドレスが同一)の場合、次に実行す
る命令のレジスタの読み出し動作を中断し、現在実行中
の命令がレジスタにデータを書き込んだ後、別タイミン
グで次に実行する命令によるレジスタの読み出しを再度
実行する手段。
(1) When the register being written by the instruction currently being executed and the register being read by the instruction to be executed next match (register addresses are the same), the read operation of the register for the instruction to be executed next is interrupted. Then, after the instruction currently being executed writes data to the register, a means for re-reading the register by the instruction to be executed next at a different timing.

【0005】(2)現在実行中の命令が書き込んでいる
レジスタと次に実行する命令が読み出しているレジスタ
が一致(レジスタアドレスが同一)の場合、次に実行す
る命令はレジスタからデータを読み出すのではなく、現
在実行中の命令によるレジスタへのデータ書き込み経路
から直接データを読み取ることで、読み出しタイミング
を確保する手段。
(2) When the register being written by the instruction currently being executed and the register being read by the instruction to be executed next match (the register address is the same), the instruction to be executed next reads data from the register. Rather, a means to secure the read timing by reading the data directly from the data write path to the register by the instruction currently being executed.

【0006】これらの手段は、現在実行中の命令が書き
込んでいるレジスタアドレスと、次に実行する命令が読
み出すレジスタアドレスとを比較して、一致しているか
どうかを判断し、レジスタ干渉を回避するというもので
あった。
These means compare the register address written by the instruction currently being executed with the register address read by the instruction to be executed next, judge whether they match, and avoid register interference. It was that.

【0007】[0007]

【発明が解決しようとする課題】しかしながら前記のよ
うに、複数のレジスタファイルを持つ場合、現在実行中
の命令が書き込んでいるレジスタと次に実行する命令が
読み出しているレジスタが一致(レジスタアドレスが同
一)した場合でも、レジスタファイルが異なる場合があ
り、この場合、従来のようなレジスタ干渉回避動作は不
要である。本発明は、このような従来の課題を解決する
レジスタ干渉回避装置を提供するものである。
However, as described above, in the case of having a plurality of register files, the register written by the instruction currently being executed and the register read by the instruction to be executed next match (register address is Even if the same), the register file may be different, and in this case, the conventional register interference avoiding operation is unnecessary. The present invention provides a register interference avoidance device that solves such conventional problems.

【0008】[0008]

【課題を解決するための手段】本発明は前記課題を解決
するために、(1)レジスタファイルが同一であるかど
うかという判断とレジスタアドレスによりレジスタ干渉
が発生するかの判断を行なう。さらには、(2)レジス
タファイルの切り替えタイミングを示すフラグを設け、
このフラグとレジスタアドレスによりレジスタ干渉が発
生するかの判断をする。手段を備えたものである。
In order to solve the above problems, the present invention (1) determines whether the register files are the same and whether the register interference causes register interference. Furthermore, (2) a flag indicating the switching timing of the register file is provided,
It is determined from this flag and the register address whether register interference will occur. It is equipped with means.

【0009】[0009]

【作用】前記構成により、複数のレジスタファイル構成
において、真にレジスタ干渉があったときのみ、再実行
によるレジスタ干渉回避が実行されるため、実行効率の
よいシステムを実現することができる。
With the above configuration, in a plurality of register file configurations, register interference avoidance by re-execution is executed only when there is true register interference, so that a system with high execution efficiency can be realized.

【0010】[0010]

【実施例】以下本発明の一実施例について図面を参照し
ながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0011】図1は本発明のレジスタファイル番号とレ
ジスタ番号によりレジスタ干渉の判断を行なうレジスタ
干渉回避装置の構成図である。図2は本発明のレジスタ
干渉回避装置のレジスタファイル構成図である。図3、
図4は本発明のレジスタファイル番号とレジスタ番号に
よりレジスタ干渉の判断を行なうレジスタ干渉回避装置
の実行タイミングを示した図である。
FIG. 1 is a block diagram of a register interference avoidance apparatus for judging register interference according to the register file number and the register number of the present invention. FIG. 2 is a register file configuration diagram of the register interference avoidance apparatus of the present invention. Figure 3,
FIG. 4 is a diagram showing a register file number and execution timing of the register interference avoiding apparatus for judging register interference according to the register number of the present invention.

【0012】図1において、バス1に送り出すアドレス
データを生成・出力するバス1アドレス生成部5と、バ
ス2に送り出すアドレスデータを生成・出力するバス2
アドレス生成部6と、バス3に送り出すアドレスデータ
を生成・出力するバス3アドレス生成部7と、バス3ア
ドレス生成部7が生成・出力したアドレス情報を一旦ラ
ッチし、バス3アドレス生成部7のバス3ドライブタイ
ミングとは異なるタイミングでバス4にラッチしたアド
レス情報を出力するアドレスラッチ部8からアドレス生
成部9は構成されている。本発明では1つのレジスタ
(複数のレジスタはレジスタファイル10を構成)を選
択する情報を“アドレスデータ”と定義する。従って本
発明では、いわゆるレジスタ番号もアドレスデータの1
つであるとする。パイプラインタイミングに応じてアド
レス生成部9から出力された各アドレスデータはバス1
〜4を介してレジスタファイル10とアドレス比較部1
1に入力される。
In FIG. 1, a bus 1 address generator 5 for generating and outputting address data to be sent to the bus 1 and a bus 2 for generating and outputting address data to be sent to the bus 2.
The address generation unit 6, the bus 3 address generation unit 7 that generates and outputs address data to be sent to the bus 3, and the address information generated and output by the bus 3 address generation unit 7 are temporarily latched, and the bus 3 address generation unit 7 The address generation unit 9 is composed of the address latch unit 8 that outputs the address information latched on the bus 4 at a timing different from the bus 3 drive timing. In the present invention, information for selecting one register (a plurality of registers constitutes the register file 10) is defined as "address data". Therefore, in the present invention, the so-called register number is also 1 of the address data.
Suppose Each address data output from the address generation unit 9 according to the pipeline timing is the bus 1
Register file 10 and address comparison unit 1 through
Input to 1.

【0013】各バスの役割は、次のとおりである。 バス1:レジスタに格納されたデータが示すアドレスに
演算に必要なデータが格納されている場合に、そのレジ
スタを読み出す際に使用する(読み出すレジスタには演
算するデータは直接格納されていない)。
The role of each bus is as follows. Bus 1: Used when the data required for the operation is stored in the address indicated by the data stored in the register (the data to be operated is not directly stored in the register to be read).

【0014】バス2:演算に必要なデータがレジスタ
(あるいはメモリ、メモリは図示せず)に直接格納され
ている場合に使用する(第1演算データ)。
Bus 2: Used when data required for calculation is directly stored in a register (or memory, memory is not shown) (first calculation data).

【0015】バス3:演算に必要なデータがレジスタに
直接格納されている場合に使用する(第2演算デー
タ)。
Bus 3: Used when data required for calculation is directly stored in the register (second calculation data).

【0016】バス4:演算結果をレジスタに直接格納す
る場合に使用する。同一命令の場合、バス3のアドレス
情報とバス4のアドレス情報は同じものを使用する(バ
ス3の第2演算データのアドレスと同一)。 これらのバスを使用する命令のパイプライン動作とし
て、次の2つの命令を定義する。
Bus 4: Used when the operation result is directly stored in the register. In the case of the same instruction, the same address information on the bus 3 and the address information on the bus 4 are used (the same as the address of the second operation data on the bus 3). The following two instructions are defined as the pipeline operation of the instructions using these buses.

【0017】(命令1) タイミング1:バス1を使用し、レジスタの内容を読み
出す。
(Instruction 1) Timing 1: Bus 1 is used to read the contents of the register.

【0018】タイミング2:バス2を使用し、レジスタ
(メモリ)の内容を読み出す。バス3を使用し、レジス
タの内容を読み出す。
Timing 2: Bus 2 is used to read the contents of the register (memory). The contents of the register are read using the bus 3.

【0019】タイミング3:バス4を使用し、レジスタ
にデータを書き込む(ここで、タイミング1〜3はパイ
プラインの時間経過を示している。) (命令2) タイミング1:バス1〜4未使用。
Timing 3: Bus 4 is used to write data to the register (here, timings 1 to 3 indicate the passage of time in the pipeline.) (Instruction 2) Timing 1: Buses 1 to 4 Not used .

【0020】タイミング2:バス2を使用し、レジスタ
の内容を読み出す。 タイミング3:バス4を使用し、レジスタにデータを書
き込む。
Timing 2: Bus 2 is used to read the contents of the register. Timing 3: Bus 4 is used to write data to the register.

【0021】また、パイプライン動作において、先に実
行した命令のタイミング2と後に実行した命令のタイミ
ング1、および、先に実行した命令のタイミング3と後
に実行した命令のタイミング2はタイミングが重なり合
う。図3において最初に実行された命令は、 タイミング1:バス1を使用し、Read3−2(レジ
スタファイル3のレジスタ番号2の読み出し) タイミング2:バス2を使用し、Read3−3(レジ
スタファイル3のレジスタ番号3の読み出し)、バス3
を使用し、Read3−1(レジスタファイル3のレジ
スタ番号1の読み出し) タイミング3:バス4を使用し、Write3−1(レ
ジスタファイル3のレジスタ番号1の読み出し) で実行される(図中1サイクルは1タイミングと同
じ)。
In the pipeline operation, the timing 2 of the previously executed instruction and the timing 1 of the later executed instruction, and the timing 3 of the previously executed instruction and the timing 2 of the later executed instruction overlap each other. The first instruction executed in FIG. 3 is: timing 1: bus 1 is used, Read3-2 (reading register number 2 of register file 3) timing 2: bus 2, read 3-3 (register file 3 Read register number 3), bus 3
And read 3-1 (read register number 1 of register file 3) timing 3: use bus 4 and execute Write 3-1 (read register number 1 of register file 3) (1 cycle in the figure) Is the same as 1 timing).

【0022】図2においてレジスタファイルの構成を示
しており上記図3の命令が操作する各レジスタは、 Read3−2(図3のレジスタファイル3のレジスタ
番号2の読み出し)=(図2の19のレジスタ2) Read3−3(図3のレジスタファイル3のレジスタ
番号3の読み出し)=(図2の20のレジスタ3) Read3−1(図3のレジスタファイル3のレジスタ
番号1の読み出し)=(図2の18のレジスタ1) Write3−1はRead3−1同様図2の18のレ
ジスタ1に対応している。
FIG. 2 shows the structure of the register file, and the registers operated by the above-mentioned instruction of FIG. 3 are: Read3-2 (reading the register number 2 of the register file 3 of FIG. 3) = (19 of FIG. 2) Register 2) Read3-3 (read register number 3 of register file 3 of FIG. 3) = (register 3 of 20 of FIG. 2) Read3-1 (read register number 1 of register file 3 of FIG. 3) = (figure 18 register 1 of 2) Write 3-1 corresponds to register 1 of 18 of FIG. 2 like Read 3-1.

【0023】また、図3おいて2番目に実行される命令
は、 タイミング1:バス1を使用し、Read1−1(レジ
スタファイル1のレジスタ番号1の読み出し)。
The second instruction to be executed in FIG. 3 is: timing 1: bus 1 is used; Read1-1 (read of register number 1 of register file 1).

【0024】タイミング2:バス2を使用し、Read
1−1(レジスタファイル1のレジスタ番号1の読み出
し) バス3を使用し、Read1−2(レジスタファイル1
のレジスタ番号2の読み出し) タイミング3:バス4を使用し、Write1−2(レ
ジスタファイル1のレジスタ番号2の読み出し) で実行される。
Timing 2: Bus 2 is used and Read
1-1 (reading register number 1 of register file 1) Bus 3 is used and Read 1-2 (register file 1
Readout of the register number 2 of the above) Timing 3: It is executed by Write1-2 (readout of the register number 2 of the register file 1) using the bus 4.

【0025】図2において上記2番目に実行される図3
の命令が操作する各レジスタは、 Read1−1(図3のレジスタファイル1のレジスタ
番号1の読み出し)=(図2の21のレジスタ1) Read1−2(図3のレジスタファイル3のレジスタ
番号3の読み出し)=(図2の22のレジスタ2) Write1−2はRead1−2同様図2の22のレ
ジスタ2に対応している。図3において、ここでレジス
タ干渉が発生する可能性として最初の命令のレジスタフ
ァイル3のレジスタ1(図3の23のWrite3−
1、図2のレジスタ18)と第2命令のレジスタファイ
ル1のレジスタ1(図3の24のRead1−1、図2
のレジスタ21)とのレジスタ間でレジスタ干渉がある
かの判断が必要になる。これは、最初の命令実行による
レジスタへの書き込み動作(=タイミング23)をした
あと、タイミング23のレジスタの値を使って第2命令
の実行が行なわれることも考えられ、第2の命令のレジ
スタの読み出しは最初の命令のレジスタへの書き込みよ
りもタイミングが先であることから、最初の命令の結果
が第2命令に反映されない可能性があることによる。し
かしながら、タイミング24とタイミング23では時間
的にレジスタ干渉を判断することが不可能である。タイ
ミング23でのWrite3−1とタイミング25での
Read3−1が同一アドレスを使っていることからタ
イミング24とタイミング25でレジスタ干渉の判断が
行なわれる。このため、アドレス比較の対象となるのは
バス1とバス3となる。従って図1においてバス1とバ
ス3がアドレス比較部11の比較器12に入力され、バ
ス1アドレス生成部5とバス3アドレス生成部7が生成
・出力したアドレスデータ値を比較し、アドレスデータ
が一致していれば“1”をAND回路160に出力す
る。一方、各パイプラインで使用するレジスタのレジス
タファイル番号を管理するため、レジスタファイル選択
部17は各パイプライン動作状況に応じたバスの種類
(本実施例の場合4種)分のレジスタファイル番号をレ
ジスタファイル10に送り出し、レジスタファイルの選
択を行なう。
FIG. 3 which is the second to be executed in FIG.
The registers operated by the instruction are: Read1-1 (read register number 1 of register file 1 of FIG. 3) = (register 1 of 21 of FIG. 2) Read1-2 (register number 3 of register file 3 of FIG. 3) Read) = (Register 2 of 22 in FIG. 2) Write1-2 corresponds to Register 2 of 22 in FIG. 2 like Read1-2. In FIG. 3, the register 1 of the register file 3 of the first instruction is likely to cause register interference (Write 3 of 23 in FIG. 3).
1, register 18 of FIG. 2) and register 1 of register file 1 of the second instruction (Read 1-1 of 24 of FIG. 3, FIG. 2)
It is necessary to judge whether there is register interference between the register 21) and the register 21). This is because it is possible that the second instruction is executed using the value of the register at the timing 23 after the writing operation (= timing 23) to the register by the first instruction execution. This is because the timing of reading the first instruction precedes the writing of the first instruction to the register, so that the result of the first instruction may not be reflected in the second instruction. However, at timing 24 and timing 23, it is impossible to determine the register interference temporally. Since the Write 3-1 at the timing 23 and the Read 3-1 at the timing 25 use the same address, the register interference is determined at the timing 24 and the timing 25. Therefore, the bus 1 and the bus 3 are the targets of the address comparison. Therefore, in FIG. 1, the bus 1 and the bus 3 are input to the comparator 12 of the address comparison unit 11, the address data values generated and output by the bus 1 address generation unit 5 and the bus 3 address generation unit 7 are compared, and the address data is If they match, "1" is output to the AND circuit 160. On the other hand, in order to manage the register file numbers of the registers used in each pipeline, the register file selection unit 17 assigns the register file numbers for the bus types (four types in the case of this embodiment) according to the pipeline operation status. It is sent to the register file 10 and the register file is selected.

【0026】また、バス1とバス3でレジスタ干渉が発
生しているかを判定するため、バス1に対応するレジス
タファイル番号14とバス3に対応するレジスタファイ
ル番号15を比較器13にも送り出しレジスタファイル
番号を比較し、レジスタファイル番号データが一致して
いれば“1”をAND回路160に出力する。AND回
路160はアドレスデータとレジスタファイル番号が一
致したときのみ、すなわち、比較器12、13の出力が
“1”のときのみアドレス出力遅延信号16をバス1ア
ドレス生成部5に出力し、バス1アドレス生成部5はこ
れを受けてバス1へのアドレス出力のタイミングを後方
にずらし、レジスタの干渉が起こらないように動作す
る。図3において、タイミング24ではレジスタファイ
ル番号1のレジスタ1を読み出しており、タイミング2
5ではレジスタファイル番号3のレジスタ1を読み出し
ている。この場合レジスタ番号は一致するがレジスタフ
ァイル番号は一致しないので、レジスタ干渉は発生して
おらずタイミング24でのレジスタ1の読み出しは、そ
のまま行なわれる。図4において、タイミング26では
レジスタファイル番号3のレジスタ1を読み出してお
り、タイミング27でもレジスタファイル番号3のレジ
スタ1を読み出している。この場合レジスタ番号とレジ
スタファイル番号の両方が一致しているので、レジスタ
干渉が発生しておりタイミング26でのレジスタ1の読
み出しは、1サイクル遅れてタイミング28で行なわれ
る。単体のレジスタファイルであれば図4のレジスタ干
渉が頻繁に発生し、それを回避することが必要となって
くるが、複数のレジスタファイルに1つのCPUを占有
させ、複数のレジスタファイルにより複数のタスクを並
行処理するように構成すると、図3のように単にレジス
タ番号の比較だけではレジスタ干渉を判断できずレジス
タファイル番号の比較をすることで、真にレジスタファ
イル干渉が発生しているときのみレジスタ干渉回避動作
(図4に示したレジスタの読み出しを1サイクル遅らせ
る)を行なうことでパイプラインの乱れを最小限に押さ
えることができる。
Further, in order to determine whether register interference has occurred between the bus 1 and the bus 3, the register file number 14 corresponding to the bus 1 and the register file number 15 corresponding to the bus 3 are sent to the comparator 13 as well. The file numbers are compared, and if the register file number data match, "1" is output to the AND circuit 160. The AND circuit 160 outputs the address output delay signal 16 to the bus 1 address generator 5 only when the address data and the register file number match, that is, when the outputs of the comparators 12 and 13 are "1". In response to this, the address generation unit 5 shifts the address output timing to the bus 1 backward, and operates so as not to cause register interference. In FIG. 3, at timing 24, the register 1 of the register file number 1 is read, and at timing 2
In 5, the register 1 of the register file number 3 is read. In this case, since the register numbers match but the register file numbers do not match, register interference does not occur and the reading of the register 1 at the timing 24 is performed as it is. In FIG. 4, the register 1 of the register file number 3 is read at the timing 26, and the register 1 of the register file number 3 is also read at the timing 27. In this case, since both the register number and the register file number match, register interference occurs and the reading of register 1 at timing 26 is performed at timing 28 with a delay of one cycle. If there is a single register file, the register interference shown in FIG. 4 frequently occurs and it is necessary to avoid it. If the tasks are configured to be processed in parallel, register interference cannot be determined only by comparing the register numbers as shown in FIG. 3, and the register file numbers are compared, so that only when the register file interference is true. By performing the register interference avoiding operation (delaying the register shown in FIG. 4 for one cycle), the disturbance of the pipeline can be minimized.

【0027】図5は本発明のレジスタファイルの切り替
えタイミングを示すフラグを設けたレジスタ干渉回避装
置の構成を示した図であり、図6、図7は本発明のレジ
スタファイルの切り替えタイミングを示すフラグを設け
たレジスタ干渉回避装置の実行タイミングを示した図で
ある。図5において、バス1に送り出すアドレスデータ
を生成・出力するバス1アドレス生成部5と、バス2に
送り出すアドレスデータを生成・出力するバス2アドレ
ス生成部6と、バス3に送り出すアドレスデータを生成
・出力するバス3アドレス生成部7と、バス3アドレス
生成部7が生成・出力したアドレス情報を一旦ラッチ
し、バス3アドレス生成部7のバス3ドライブタイミン
グとは異なるタイミングでバス4にラッチしたアドレス
情報を出力するアドレスラッチ部8からアドレス生成部
9は構成されている。本発明では1つのレジスタ(複数
のレジスタはレジスタファイル10を構成)を選択する
情報を“アドレスデータ”と定義する。従って本発明で
は、いわゆるレジスタ番号もアドレスデータの1つであ
るとする。パイプラインタイミングに応じてアドレス生
成部9から出力された各アドレスデータはバス1〜4を
介してレジスタファイル10とアドレス比較部31に入
力される。各バスの役割は、 バス1:レジスタに格納されたデータが示すアドレスに
演算に必要なデータが格納されている場合にそのレジス
タを読み出す際に使用する。読み出すレジスタには演算
するデータは直接格納されていない。
FIG. 5 is a diagram showing a configuration of a register interference avoidance device provided with a flag indicating the switching timing of the register file of the present invention, and FIGS. 6 and 7 are flags showing the switching timing of the register file of the present invention. It is a figure showing the execution timing of the register interference avoidance device provided with. In FIG. 5, a bus 1 address generation unit 5 that generates and outputs address data to be sent to the bus 1, a bus 2 address generation unit 6 that generates and outputs address data to be sent to the bus 2, and an address data that is sent to the bus 3 are generated. The output bus 3 address generation unit 7 and the address information generated and output by the bus 3 address generation unit 7 are temporarily latched and latched in the bus 4 at a timing different from the bus 3 drive timing of the bus 3 address generation unit 7. The address generation unit 9 is composed of the address latch unit 8 that outputs address information. In the present invention, information for selecting one register (a plurality of registers constitutes the register file 10) is defined as "address data". Therefore, in the present invention, the so-called register number is also one of the address data. Each address data output from the address generation unit 9 according to the pipeline timing is input to the register file 10 and the address comparison unit 31 via the buses 1 to 4. The role of each bus is used when reading the register when the data required for the operation is stored in the address indicated by the data stored in the bus 1: register. The data to be calculated is not directly stored in the read register.

【0028】バス2:演算に必要なデータがレジスタ
(あるいはメモリ、メモリは図示せず)に直接格納され
ている場合に使用する(第1演算データ)。
Bus 2: Used when data required for calculation is directly stored in a register (or memory, memory is not shown) (first calculation data).

【0029】バス3:演算に必要なデータがレジスタに
直接格納されている場合に使用する(第2演算デー
タ)。
Bus 3: Used when data required for calculation is directly stored in the register (second calculation data).

【0030】バス4:演算結果をレジスタに直接格納す
る場合に使用する。同一命令の場合、バス3のアドレス
情報とバス4のアドレス情報は同じものを使用する(バ
ス3の第2演算データのアドレスと同一)。 である。これらのバスを使用する命令のパイプライン動
作として、次の2つの命令を定義する。
Bus 4: Used when the operation result is directly stored in the register. In the case of the same instruction, the same address information on the bus 3 and the address information on the bus 4 are used (the same as the address of the second operation data on the bus 3). Is. The following two instructions are defined as the pipeline operation of the instructions using these buses.

【0031】(命令1) タイミング1:バス1を使用し、レジスタの内容を読み
出す。
(Instruction 1) Timing 1: Bus 1 is used to read the contents of the register.

【0032】タイミング2:バス2を使用し、レジスタ
(メモリ)の内容を読み出す。バス3を使用し、レジス
タの内容を読み出す。
Timing 2: Bus 2 is used to read the contents of the register (memory). The contents of the register are read using the bus 3.

【0033】タイミング3:バス4を使用し、レジスタ
にデータを書き込む(ここでタイミング1〜3はパイプ
ラインの時間経過を示している)。
Timing 3: The bus 4 is used to write data in the register (timings 1 to 3 show the passage of time in the pipeline).

【0034】(命令2) タイミング1:バス1〜4未使用。(Instruction 2) Timing 1: Buses 1 to 4 not used.

【0035】タイミング2:バス2を使用し、レジスタ
の内容を読み出す。バス3を使用し、レジスタの内容を
読み出す。
Timing 2: Bus 2 is used to read the contents of the register. The contents of the register are read using the bus 3.

【0036】タイミング3:バス4を使用し、レジスタ
にデータを書き込む。 また、パイプライン動作において、先に実行した命令の
タイミング2と後に実行した命令のタイミング1、およ
び、先に実行した命令のタイミング3と後に実行した命
令のタイミング2はタイミングが重なり合う。図6おい
て最初に実行された命令は、 タイミング1:バス1を使用し、Read3−2(レジ
スタファイル3のレジスタ番号2の読み出し) タイミング2:バス2を使用し、Read3−3(レジ
スタファイル3のレジスタ番号3の読み出し)、バス3
を使用し、Read3−1(レジスタファイル3のレジ
スタ番号1の読み出し) タイミング3:バス4を使用し、Write3−1(レ
ジスタファイル3のレジスタ番号1の読み出し) で実行される(図中1サイクルは1タイミングと同
じ)。
Timing 3: Write data to the register using the bus 4. In the pipeline operation, the timing 2 of the instruction executed first and the timing 1 of the instruction executed later, and the timing 3 of the instruction executed first and the timing 2 of the instruction executed later overlap in timing. The first instruction executed in FIG. 6 is: Timing 1: Bus 1 is used, Read 3-2 (read register number 2 of register file 3) Timing 2: Bus 2 is used, Read 3-3 (register file Read register number 3 of 3), bus 3
And read 3-1 (read register number 1 of register file 3) timing 3: use bus 4 and execute Write 3-1 (read register number 1 of register file 3) (1 cycle in the figure) Is the same as 1 timing).

【0037】図2においてレジスタファイルの構成を示
しており図6の命令が操作する各レジスタは、 Read3−2(図6のレジスタファイル3のレジスタ
番号2の読み出し)=(図2の19のレジスタ2) Read3−3(図6のレジスタファイル3のレジスタ
番号3の読み出し)=(図2の20のレジスタ3) Read3−1(図6のレジスタファイル3のレジスタ
番号1の読み出し)=(図2の18のレジスタ1) Write3−1はRead3−1同様図2の18のレ
ジスタ1に対応している。
The structure of the register file is shown in FIG. 2 and each register operated by the instruction of FIG. 6 is: Read3-2 (read of register number 2 of register file 3 of FIG. 6) = (register 19 of FIG. 2) 2) Read3-3 (read register number 3 of register file 3 of FIG. 6) = (register 3 of 20 of FIG. 2) Read3-1 (read register number 1 of register file 3 of FIG. 6) = (FIG. 2) 18 of 1) Write 3-1 corresponds to the register 1 of 18 of FIG. 2 like Read 3-1.

【0038】また、図6おいて2番目に実行される命令
は、 タイミング1:バス1を使用し、Read1−1(レジ
スタファイル1のレジスタ番号1の読み出し) タイミング2:バス2を使用し、Read1−1(レジ
スタファイル1のレジスタ番号1の読み出し)、バス3
を使用し、Read1−2(レジスタファイル1のレジ
スタ番号2の読み出し) タイミング3:バス4を使用し、Write1−2(レ
ジスタファイル1のレジスタ番号2の読み出し) で実行される。
The second instruction to be executed in FIG. 6 is: timing 1: bus 1 is used; Read 1-1 (reading register number 1 of register file 1) timing 2: bus 2 is used, Read1-1 (read register number 1 of register file 1), bus 3
And read 1-2 (read register number 2 of register file 1) timing 3: use bus 4 and execute write 1-2 (read register number 2 of register file 1).

【0039】図2において、上記2番目に実行される図
6の命令が操作する各レジスタは、 Read1−1(図6のレジスタファイル1のレジスタ
番号1の読み出し)=(図2の21のレジスタ1) Read1−2(図6のレジスタファイル3のレジスタ
番号3の読み出し)=(図2の22のレジスタ2) Write1−2はRead1−2同様図2の22のレ
ジスタ2に対応している。図6において、ここでレジス
タ干渉が発生する可能性として最初の命令のレジスタフ
ァイル3のレジスタ1(図6の32のWrite3−
1、図2のレジスタ18)と第2命令のレジスタファイ
ル1のレジスタ1(図6の33のRead1−1、図2
のレジスタ21)とのレジスタ間でレジスタ干渉がある
かの判断が必要になる。これは、最初の命令実行による
レジスタへの書き込み動作(=タイミング32)をした
あと、タイミング32のレジスタの値を使って第2命令
の実行が行なわれることも考えられ、第2の命令のレジ
スタの読み出しは最初の命令のレジスタへの書き込みよ
りもタイミングが先であることから最初の命令の結果が
第2命令に反映されない可能性があることによる。しか
しながら、タイミング33とタイミング32では時間的
にレジスタ干渉を判断することが不可能である。タイミ
ング32でのWrite3−1とタイミング34でのR
ead3−1が同一アドレスを使っていることからタイ
ミング33とタイミング34でレジスタ干渉の判断が行
なわれる。このため、アドレス比較の対象となるのはバ
ス1とバス3となる。従って図5においてバス1とバス
3がアドレス比較部11の比較器12に入力され、バス
1アドレス生成部5とバス3アドレス生成部7が生成・
出力したアドレスデータ値を比較し、アドレスデータが
一致していれば“1”をAND回路160に出力する。
一方、レジスタファイル番号が異なればレジスタ名は一
致してもレジスタ干渉を起こさない。従ってレジスタフ
ァイルの切り替えタイミングではレジスタファイル番号
が切り替えの前後では必らず異なるのでレジスタ干渉は
発生しない。レジスタ番号が同じでもレジスタ干渉は発
生しないことから、レジスタファイル切り替えのタイミ
ングで“0”、レジスタファイルが切り替わらないタイ
ミングでは“1”となるレジスタファイル切り替え信号
30をレジスタファイル選択部29から出力し、アドレ
ス比較部31のAND回路160に入力する。AND回
路160はアドレスデータが一致し、かつレジスタファ
イル切り替えのタイミングでないときにのみアドレス出
力遅延信号16をバス1アドレス生成部5に出力し、バ
ス1アドレス生成部5はこれを受けてバス1へのアドレ
ス出力のタイミングを後方にずらし、レジスタの干渉が
起こらないように動作する。図6において、タイミング
33ではレジスタファイル番号1のレジスタ1を読み出
しており、タイミング34ではレジスタファイル番号3
のレジスタ1を読み出している。この場合レジスタ番号
は一致するがレジスタファイル番号は一致しないので、
レジスタ干渉は発生しておらずタイミング33でのレジ
スタ1の読み出しは、そのまま行なわれる。図7におい
て、タイミング35ではレジスタファイル番号3のレジ
スタ1を読み出しており、タイミング36でもレジスタ
ファイル番号3のレジスタ1を読み出している。この場
合レジスタ番号とレジスタファイル番号の両方が一致し
ているので、レジスタ干渉が発生しておりタイミング3
5でのレジスタ1の読み出しは、1サイクル遅れてタイ
ミング37で行なわれる。単体のレジスタファイルであ
れば図7のレジスタ干渉が頻繁に発生し、それを回避す
ることが必要となってくるが、複数のレジスタファイル
に1つのCPUを占有させ、複数のレジスタファイルに
より複数のタスクを並行処理するように構成すると、図
6のように単にレジスタ番号の比較だけではレジスタ干
渉を判断できず、レジスタファイル番号の比較をするこ
とで、真にレジスタファイル干渉が発生しているときの
みレジスタ干渉回避動作(図7に示したレジスタの読み
出しを1サイクル遅らせる)を行なうことでパイプライ
ンの乱れを最小限に押さえることができる。
In FIG. 2, the registers operated by the second instruction executed in FIG. 6 are: Read1-1 (read register number 1 in register file 1 in FIG. 6) = (register 21 in FIG. 2) 1) Read1-2 (reading the register number 3 of the register file 3 in FIG. 6) = (register 2 at 22 in FIG. 2) Write1-2 corresponds to register 2 at 22 in FIG. 2 like Read1-2. In FIG. 6, register 1 of the register file 3 of the first instruction is likely to cause register interference (Write 3 of 32 in FIG. 6).
1, register 18 of FIG. 2) and register 1 of register file 1 of the second instruction (Read 1-1 of 33 of FIG. 6, FIG. 2)
It is necessary to judge whether there is register interference between the register 21) and the register 21). This is because it is possible that the second instruction is executed by using the value of the register at the timing 32 after performing the write operation (= timing 32) to the register by executing the first instruction. This is because the timing of reading the first instruction is earlier than the timing of writing the first instruction to the register, and thus the result of the first instruction may not be reflected in the second instruction. However, at timing 33 and timing 32, it is impossible to determine the register interference temporally. Write 3-1 at timing 32 and R at timing 34
Since the ead 3-1 uses the same address, the register interference is determined at the timing 33 and the timing 34. Therefore, the bus 1 and the bus 3 are the targets of the address comparison. Therefore, in FIG. 5, the buses 1 and 3 are input to the comparator 12 of the address comparator 11, and the bus 1 address generator 5 and the bus 3 address generator 7 generate and
The output address data values are compared, and if the address data match, “1” is output to the AND circuit 160.
On the other hand, if the register file numbers are different, register interference does not occur even if the register names match. Therefore, at the switching timing of the register file, the register file number is always different before and after the switching, so that the register interference does not occur. Since register interference does not occur even if the register numbers are the same, the register file selector 30 outputs the register file switching signal 30 that becomes “0” at the timing of switching the register files and “1” at the timing of not switching the register files. It is input to the AND circuit 160 of the address comparison unit 31. The AND circuit 160 outputs the address output delay signal 16 to the bus 1 address generation unit 5 only when the address data match and it is not the timing of register file switching, and the bus 1 address generation unit 5 receives this and outputs it to the bus 1. The address output timing of is shifted backward so that register interference does not occur. 6, at timing 33, register 1 of register file number 1 is read, and at timing 34, register file number 3 is read.
Register 1 is being read. In this case, the register numbers match but the register file numbers do not match.
No register interference has occurred, and the reading of the register 1 at the timing 33 is performed as it is. In FIG. 7, the register 1 of the register file number 3 is read at the timing 35, and the register 1 of the register file number 3 is also read at the timing 36. In this case, since both the register number and the register file number match, register interference has occurred and timing 3
The reading of the register 1 at 5 is performed at timing 37 with a delay of one cycle. In the case of a single register file, the register interference shown in FIG. 7 frequently occurs, and it is necessary to avoid it. When the tasks are configured to be processed in parallel, register interference cannot be determined only by comparing the register numbers as shown in FIG. 6, and by comparing the register file numbers, the true register file interference occurs. Only by performing the register interference avoiding operation (the reading of the register shown in FIG. 7 is delayed by one cycle), the disturbance of the pipeline can be suppressed to the minimum.

【0040】[0040]

【発明の効果】本発明の構成により、複数のレジスタフ
ァイル構成において、真にレジスタ干渉があったときの
み、再実行によるレジスタ干渉回避が実行されるため、
パイプラインの乱れを最小限に押さえた、実行効率のよ
いシステムを実現することができる。
According to the configuration of the present invention, register interference avoidance by re-execution is executed only when there is a true register interference in a plurality of register file configurations.
It is possible to realize a system with high execution efficiency, which minimizes the disturbance of the pipeline.

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

【図1】本発明のレジスタファイル番号とレジスタ番号
によりレジスタ干渉の判断を行なうレジスタ干渉回避装
置のブロック図
FIG. 1 is a block diagram of a register interference avoidance device for judging register interference based on a register file number and a register number according to the present invention.

【図2】本発明のレジスタ干渉回避装置のレジスタファ
イル構成図
FIG. 2 is a register file configuration diagram of a register interference avoidance device of the present invention.

【図3】本発明のレジスタファイル番号とレジスタ番号
によりレジスタ干渉の判断を行なうレジスタ干渉回避装
置の実行タイミング図
FIG. 3 is a timing chart of execution of a register interference avoidance device for judging register interference based on a register file number and a register number of the present invention.

【図4】本発明のレジスタファイル番号とレジスタ番号
によりレジスタ干渉の判断を行なうレジスタ干渉回避装
置の実行タイミング図
FIG. 4 is a timing chart of execution of a register interference avoidance device for judging register interference based on a register file number and a register number of the present invention.

【図5】本発明のレジスタファイルの切り替えタイミン
グを示すフラグを設けたレジスタ干渉回避装置のブロッ
ク図
FIG. 5 is a block diagram of a register interference avoidance device provided with a flag indicating a register file switching timing according to the present invention.

【図6】本発明のレジスタファイルの切り替えタイミン
グを示すフラグを設けたレジスタ干渉回避装置の実行タ
イミング図
FIG. 6 is an execution timing chart of a register interference avoidance device provided with a flag indicating a switching timing of a register file of the present invention.

【図7】本発明のレジスタファイルの切り替えタイミン
グを示すフラグを設けたレジスタ干渉回避装置の実行タ
イミング図
FIG. 7 is an execution timing chart of the register interference avoidance device provided with a flag indicating the switching timing of the register file of the present invention.

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

1〜4 バス 5〜8 バス出力アドレス生成部 9 アドレス生成部 10 レジスタファイル 11 アドレス比較部 12、13 比較器 14、15 レジスタファイル番号 160 AND回路 16 アドレス出力遅延信号 17 レジスタファイル選択部 18〜22 レジスタ 29 レジスタファイル選択部 30 レジスタファイル切り替え信号 31 アドレス比較部 1-4 bus 5-8 bus output address generation unit 9 address generation unit 10 register file 11 address comparison unit 12, 13 comparator 14, 15 register file number 160 AND circuit 16 address output delay signal 17 register file selection unit 18-22 Register 29 Register file selection unit 30 Register file switching signal 31 Address comparison unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】複数のレジスタファイルに1つのCPUを
占有させ、前記複数のレジスタファイルにより複数のタ
スクを並行処理するように構成するとともに、パイプラ
イン処理により命令が実行され、現在実行中の命令のレ
ジスタへの書き込みタイミングの際に、次に実行する命
令によるレジスタからの読み出しが既に終了しているパ
イプライン処理タイミングが存在し、前記現在実行中の
命令が書き込むレジスタと前記次に実行する命令が読み
出しているレジスタが同一レジスタ名であり、かつ使用
しているレジスタファイルが同一であった場合には前記
次に実行する命令によるレジスタからの読み出しを中断
し、前記現在実行中の命令がレジスタに書き込んだ後、
次の命令を再実行する第1の手段と、前記現在実行中の
命令が書き込むレジスタと前記次に実行する命令が読み
出しているレジスタが同一レジスタ名であるが、使用し
ているレジスタファイルが同一でない場合には前記次に
実行する命令によるレジスタからの読み出しを実行する
第2の手段を備えたことを特徴とするレジスタ干渉回避
装置。
1. A single CPU is occupied by a plurality of register files, a plurality of tasks are concurrently processed by the plurality of register files, and instructions are executed by pipeline processing, and an instruction currently being executed. There is pipeline processing timing at which the reading from the register by the instruction to be executed next is already completed at the timing of writing to the register, and the register written by the currently executing instruction and the instruction to be executed next. If the register being read has the same register name and the register files being used are the same, the reading from the register by the instruction to be executed next is interrupted, and the instruction currently being executed is After writing in
The first means for re-executing the next instruction, the register written by the currently executing instruction and the register read by the next instruction to be executed have the same register name, but the register file used is the same. If not, the register interference avoiding device further comprises second means for executing reading from the register according to the instruction to be executed next.
【請求項2】複数のレジスタファイルに1つのCPUを
占有させ、前記複数のレジスタファイルにより複数のタ
スクを並行処理するように構成するとともに、前記複数
のレジスタファイルの中から1つのレジスタファイルを
選択して、1つのCPUを占有させる際のレジスタファ
イルの切り替えタイミングを示すフラグを備え、パイプ
ライン処理により命令が実行され、現在実行中の命令の
レジスタへの書き込みタイミングの際に、次に実行する
命令によるレジスタからの読み出しが既に終了している
パイプライン処理タイミングが存在し、前記現在実行中
の命令が書き込むレジスタと前記次に実行する命令が読
み出しているレジスタが同一レジスタ名であった場合、
前記次に実行する命令によるレジスタからの読み出しを
中断するかあるいは継続して実行するかを前記レジスタ
ファイルの切り替えタイミングを示すフラグを参照し
て、レジスタファイルの切り替えタイミングであれば命
令実行を継続する第1の手段と、レジスタファイルの切
り替えタイミングでなければ、前記現在実行中の命令が
レジスタを書き込んだ後、前記次に実行する命令を再実
行する手段を備えたことを特徴とするレジスタ干渉回避
装置。
2. A CPU is occupied by a plurality of register files, the plurality of register files are configured to perform a plurality of tasks in parallel, and one register file is selected from the plurality of register files. Then, a flag indicating the switching timing of the register file when occupying one CPU is provided, the instruction is executed by pipeline processing, and the instruction is executed next when the instruction currently being executed is written to the register. When there is a pipeline processing timing in which the reading from the register by the instruction is already completed, and the register written by the currently executing instruction and the register read by the next executed instruction have the same register name,
The flag indicating the switching timing of the register file is referred to as to whether the reading from the register by the instruction to be executed next is interrupted or continuously executed, and if the switching timing of the register file is set, the instruction execution is continued. Register interference avoidance, comprising: first means and means for re-executing the next instruction to be executed after the currently executing instruction writes a register unless it is the timing of switching the register file. apparatus.
JP25608192A 1992-09-25 1992-09-25 Register interference preventing device Pending JPH06110686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25608192A JPH06110686A (en) 1992-09-25 1992-09-25 Register interference preventing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25608192A JPH06110686A (en) 1992-09-25 1992-09-25 Register interference preventing device

Publications (1)

Publication Number Publication Date
JPH06110686A true JPH06110686A (en) 1994-04-22

Family

ID=17287631

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25608192A Pending JPH06110686A (en) 1992-09-25 1992-09-25 Register interference preventing device

Country Status (1)

Country Link
JP (1) JPH06110686A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874879B2 (en) 2010-11-11 2014-10-28 Fujitsu Limited Vector processing circuit, command issuance control method, and processor system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874879B2 (en) 2010-11-11 2014-10-28 Fujitsu Limited Vector processing circuit, command issuance control method, and processor system

Similar Documents

Publication Publication Date Title
JPH05342084A (en) Device and method for storing data
JPH06110686A (en) Register interference preventing device
US5386521A (en) Instruction prefetching circuit with a next physical address precalculating circuit
JPH1196006A (en) Information processor
CA2157435C (en) Vector data bypass mechanism for vector computer
JP2812610B2 (en) Pipeline control method
JP3169878B2 (en) Memory control circuit
JPH07114509A (en) Memory access device
JP3366235B2 (en) Data read control device
JP2719227B2 (en) Processing equipment
JPS6391756A (en) Partial write instruction processing system for storage device
JPH02217924A (en) Storing processing system for data processor
JPS61131047A (en) Pipeline controlling system
JPH0269825A (en) Pipe line control system
JPS6086625A (en) Data processing device
JPH09146769A (en) Pipeline processor
JPH07248976A (en) Storage controller
JPH0467661B2 (en)
JPS6246353A (en) Memory read system
JPH0520205A (en) Detecting circuit for memory error address
JPH0444125A (en) Microprocessor
JPH0773095A (en) List vector processor
JPH04246764A (en) Data processor
JPH04332060A (en) Arithmetic unit for data
JPH01232445A (en) Pseudo-error generation system