JPH0954694A - Pipeline processor and its processing method - Google Patents

Pipeline processor and its processing method

Info

Publication number
JPH0954694A
JPH0954694A JP20888995A JP20888995A JPH0954694A JP H0954694 A JPH0954694 A JP H0954694A JP 20888995 A JP20888995 A JP 20888995A JP 20888995 A JP20888995 A JP 20888995A JP H0954694 A JPH0954694 A JP H0954694A
Authority
JP
Japan
Prior art keywords
read
flag
stage
instruction
data
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
JP20888995A
Other languages
Japanese (ja)
Inventor
Junichiro Minamitani
淳一郎 南谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP20888995A priority Critical patent/JPH0954694A/en
Publication of JPH0954694A publication Critical patent/JPH0954694A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve the performance of a CISC type processor for pipeline control by providing a means which efficiently detects a hazard accompanying the execution of a read-modify-write instruction. SOLUTION: This processor is equipped with an L flag which can be set or reset for every entry into a cache memory. This process includes a step S14 for setting the L flag in a cache read stage 114 wherein an RMW instruction is being executed and a step S17 for resetting the L flag after data writing is completed in a cache write stage 115.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はパイプラインプロセ
ッサおよびその処理方法に関し、特にリードモディファ
イライト処理を行うCISC型のパイプラインプロセッ
サおよびその処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pipeline processor and its processing method, and more particularly to a CISC type pipeline processor for performing a read modify write process and its processing method.

【0002】[0002]

【従来の技術】この種のCISC型のパイプラインプロ
ッセッサは、命令の解釈・実行を複数の手順(以下、ス
テージ)に分割し、それらのステージを並列に実行する
ことにより、複数個の命令の同時実行を実現している。
なお、この後の説明では、説明の便宜上、アクセス対象
メモリ上のデータはすべてキャッシュメモリ(以下キャ
ッシュ)内に複写されているものとする。
2. Description of the Related Art A CISC type pipeline processor of this type divides an instruction interpretation / execution into a plurality of procedures (hereinafter referred to as stages), and executes those stages in parallel to obtain a plurality of instructions. It realizes the simultaneous execution of.
In the following description, for convenience of explanation, it is assumed that all data in the access target memory are copied in the cache memory (hereinafter referred to as cache).

【0003】一般的なパイプラインプロセッサの動作を
説明するためのプログラムの一例およびこのプログラム
の各命令のパイプラインステージの構成を示す図4
(A)〜(C)を参照すると、(A)に示すプログラム
は命令11,12から成り、命令11(INC [12
34])は、メモリの1234番地の内容に1を加算
し、その加算結果を元の1234番地に再び書き戻す動
作を行うことを指示するリードモディファイライト(R
MW)命令である。命令12(MOV A,[123
4])は、メモリの1234番地の内容を読出し、プロ
セッサのレジスタAにその内容を書込むことを指示する
ムーブ(MV)命令である。メモリの1234番地に数
値100が予め書込まれていると、命令11の実行によ
り、メモリの1234番地の内容は101に変化する。
次に命令12を実行すると、メモリの1234番地から
読みだされた数値101がレジスタAに書込まれる。
FIG. 4 showing an example of a program for explaining the operation of a general pipeline processor and the configuration of the pipeline stage of each instruction of this program.
Referring to (A) to (C), the program shown in (A) is composed of instructions 11 and 12, and the instruction 11 (INC [12
34]) adds 1 to the contents of the address 1234 of the memory, and writes the addition result back to the original address 1234 again.
MW) command. Command 12 (MOV A, [123
4]) is a move (MV) instruction for reading the contents of the address 1234 of the memory and writing the contents in the register A of the processor. If the numerical value 100 is written in advance at the address 1234 of the memory, the content of the address 1234 of the memory is changed to 101 by the execution of the instruction 11.
Next, when the instruction 12 is executed, the numerical value 101 read from the address 1234 of the memory is written in the register A.

【0004】命令11(INC [1234])の動作
タイミングを示す図4(B)を参照すると、この図で示
す時間の経過は左から右の方向であり、この命令11は
その解釈・実行がオペコードフエッチステージ111
と、デコードステージ112と、キャッシュリードステ
ージ113と、演算ステージ114と、キャッシュライ
トステージ115との5個のステージに分割されてい
る。プロセッサはそれぞれのステージ111〜115を
左から右の方向へ実行する。
Referring to FIG. 4B showing the operation timing of the instruction 11 (INC [1234]), the passage of time shown in this figure is from left to right, and this instruction 11 is not interpreted or executed. Opcord etch stage 111
, A decode stage 112, a cache read stage 113, a calculation stage 114, and a cache write stage 115. The processor executes each stage 111-115 from left to right.

【0005】図4(B)を参照して命令11の実行を各
ステージに沿って説明すると、最初に、プロセッサはオ
ペコードフエッチステージ111でメモリから命令11
の機械語を読出す。ただし、プロッセッサはこの段階で
はこの読出した機械語が命令11であることは判らな
い。次のデコードステージ112で先に読込んだ機械語
をデコードし、プロセッサは命令11であること、すな
はち実行すべき動作を認識する。次のキャッシュリード
ステージ113で、キャッシュメモリに存在するデータ
をリードし、プロセッサ内の一時作業用のレジスタtm
p(図示省略)にロードする。次の演算ステージ114
でレジスタtmpの内容に1を加算する。次のキャッシ
ュライトステージ115でレジスタtmpの内容を元の
アドレスに書戻す。
Explaining the execution of the instruction 11 along each stage with reference to FIG. 4 (B), first, the processor executes the instruction 11 from the memory at the opcode etch stage 111.
Read the machine language of. However, the processor does not know that the read machine language is the instruction 11 at this stage. In the next decoding stage 112, the previously read machine language is decoded, and the processor recognizes that it is the instruction 11, that is, the operation to be executed. At the next cache read stage 113, the data existing in the cache memory is read, and the temporary work register tm in the processor is read.
p (not shown). Next calculation stage 114
Then, 1 is added to the contents of the register tmp. At the next cache write stage 115, the contents of the register tmp are written back to the original address.

【0006】命令12(MOV A,[1234])の
動作タイミングを示す図4(C)を参照すると、この図
に示す命令12はその解釈・実行がオペコードフエッチ
ステージ121と、デコードステージ122と、キャッ
シュリードステージ123と、演算ステージ124との
4個のステージに分割されている。
Referring to FIG. 4C showing the operation timing of the instruction 12 (MOV A, [1234]), the instruction 12 shown in this figure is interpreted and executed by the opcode etch stage 121 and the decode stage 122. , Cache read stage 123 and operation stage 124 are divided into four stages.

【0007】図4(C)を参照して命令12の実行を各
ステージに沿って説明すると、まず、オペコードフエッ
チステージ121およびデコードステージ122までは
命令11と同一である。次のキャッシュリードステージ
123で、キャッシュメモリから指定されたアドレスの
データを作業用のレジスタtmpにロードする。次の演
算ステージ124で、レジスタtmpからレジスタAに
値を複写する。
Explaining the execution of the instruction 12 along each stage with reference to FIG. 4C, the operation up to the opcode etch stage 121 and the decode stage 122 is the same as the instruction 11. At the next cache read stage 123, the data at the specified address is loaded from the cache memory into the work register tmp. In the next arithmetic stage 124, the value is copied from register tmp to register A.

【0008】以上、説明した図4(A)のRMW命令を
含むプログラムを単純にパイプライン演算実行すると、
図5(A)で示すタイミングになる。しかし、このタイ
ミングではRMW命令11の演算ステージ114と次の
MV命令12のキャッシュリードステージ123とが同
時に実行され、最初の命令11による更新前の1234
番地の内容が読出されるため誤った結果すなわちハザー
ドを発生する。すなわち、このタイミングで実行する
と、レジスタAの内容は100となってしまう。
When the program including the RMW instruction of FIG. 4A described above is simply pipelined,
The timing is as shown in FIG. However, at this timing, the operation stage 114 of the RMW instruction 11 and the cache read stage 123 of the next MV instruction 12 are simultaneously executed, and 1234 before updating by the first instruction 11 is performed.
Since the contents of the address are read, an incorrect result, that is, a hazard is generated. That is, if it is executed at this timing, the content of the register A becomes 100.

【0009】従来のパイプラインプロセッサではこのよ
うなハザードの発生を避けるため、図4(A)のRMW
命令およびMV命令を含むプログラムを図5(B)に示
すようにデコードステージ122とキャッシュリードス
テージ123との間に停止ステージ126,127を挿
入したタイミングで実行する。この場合は、最初のRM
W命令11のキャッシュライトステージ115の実行が
完了してから、MV命令12のキャッシュリードステー
ジ123を実行する。この場合、命令12の実行は2ス
テージ分だけ停止してしまう。
In the conventional pipeline processor, in order to avoid such a hazard, the RMW of FIG.
A program including an instruction and an MV instruction is executed at the timing when stop stages 126 and 127 are inserted between the decode stage 122 and the cache read stage 123 as shown in FIG. 5B. In this case, the first RM
After the execution of the cache write stage 115 of the W instruction 11 is completed, the cache read stage 123 of the MV instruction 12 is executed. In this case, the execution of the instruction 12 is stopped for two stages.

【0010】従来のパイプラインプロセッサの処理方法
は、この例の最初のRMW命令11と2番目のMV命令
12とのように同一アドレスをアクセスする場合だけで
はなく、RMW命令とMV命令の両者で異なるアドレス
をアクセスする場合においても、2つの停止ステージを
有する図5(B)に示すタイミングで実行する。一般的
には、図4(A)のようなRMW命令に続いてMV命令
を実行するシーケンスのプログラムコードに遭遇した場
合、RMW命令とMV命令の各々のアドレスが異なる場
合が非常に多いと考えられる。両者のアドレスが異なっ
ている場合は停止ステージを含まない図5(A)のタイ
ミングで実行しても実行結果は正常である。
The conventional pipeline processor processing method is not limited to the case where the same address is accessed as in the first RMW instruction 11 and the second MV instruction 12 in this example, but in both the RMW instruction and the MV instruction. Even when accessing different addresses, the processing is executed at the timing shown in FIG. 5B having two stop stages. Generally, when encountering a program code of a sequence for executing an MV instruction following an RMW instruction as shown in FIG. 4A, it is considered that the addresses of the RMW instruction and the MV instruction are often different from each other. To be When the addresses of the both are different, the execution result is normal even if the execution is performed at the timing of FIG. 5A that does not include the stop stage.

【0011】したがって、必ず2つの停止ステージを含
むタイミングで実行する従来のプロセッサでは、RMW
命令に続いてMV命令を実行するシーケンスのプログラ
ムコードでは、両命令の同一アドレスのアクセスを含ま
ない多くの場合は命令実行に要するステージ数すなわち
クロック数を無用に増加させ、性能低下要因となってい
る。
Therefore, in the conventional processor which always executes at the timing including the two stop stages, the RMW is
In a program code of a sequence that executes an MV instruction subsequent to an instruction, in many cases that does not include access to the same address of both instructions, the number of stages required for instruction execution, that is, the number of clocks, is unnecessarily increased, which causes a performance deterioration There is.

【0012】以上の処理に関連して、従来のパイプライ
ンプロセッサで用いられているキャッシュのエントリの
一例を示す図6を参照すると、この従来のプロセッサの
キャッシュのエントリは、そのエントリに記憶している
データ201と、複写元の(メイン)メモリのアドレス
202と、キャッシュの動作の制御用に必要な情報、こ
の例の場合はアドレス部とデータ部とそのエントリに記
録している内容が有効か無効かを示すVビット203と
から成っていた。
With reference to FIG. 6 showing an example of an entry of a cache used in a conventional pipeline processor in relation to the above processing, the cache entry of this conventional processor is stored in the entry. Data 201, the address 202 of the (main) memory of the copy source, and information necessary for controlling the cache operation. In this example, the contents recorded in the address part, the data part, and the entry are valid. It consisted of V-bit 203 indicating invalidity.

【0013】[0013]

【発明が解決しようとする課題】上述した従来のパイプ
ラインプロセッサおよびその処理方法は、リードモディ
フアイライト(RMW)命令に続いてムーブ(MV)等
他処理の命令を実行する場合に確率的には非常に小さい
特殊ケースである上記RMW命令と他処理命令の同一ア
ドレスのアクセスによるハザード発生防止のため上記R
MW命令のキャシュリードステージの終了からキャシュ
ライトステージの終了まで上記他処理の命令の実行を停
止するので、これら両命令の実行ステージ数すなわちク
ロック数が増加し性能低下の要因となるという欠点があ
った。
The above-described conventional pipeline processor and its processing method stochastically execute another instruction such as a move (MV) instruction following a read-modify-write (RMW) instruction. Is a very small special case. In order to prevent hazards caused by accessing the same address of the RMW instruction and other processing instructions, the R
Since the execution of the instructions of the above-mentioned other processes is stopped from the end of the cache read stage of the MW instruction to the end of the cache write stage, there is a drawback that the number of execution stages of both these instructions, that is, the number of clocks, increases and causes a performance deterioration. It was

【0014】本発明の目的は、上記特殊ケースを効率良
く検出し命令実行クロック数を低減してプロセッサの性
能向上を実現するパイプラインプロセッサの処理方法を
提供することにある。
An object of the present invention is to provide a processing method of a pipeline processor that efficiently detects the above special case and reduces the number of instruction execution clocks to improve the performance of the processor.

【0015】[0015]

【課題を解決するための手段】本発明のパイプラインプ
ロセッサは、メモリ内の任意のアドレスからデータを読
出しこの読出したデータに所定の演算処理を行ないこの
処理後のデータを前記アドレスに書込むリードモディフ
ァイライト処理を単一のリードモディファイライト命令
で実行するリードモディファイライト処理手段と、前記
メモリのバッファ用のキャッシュメモリとを備え、1つ
の処理を複数の処理ステージに分割し各々のステージ毎
に並列に処理を実行するパイプラインプロセッサにおい
て、前記キャッシュメモリのエントリ毎にセット・リセ
ット可能なフラグを備え、前記リードモディファイライ
ト命令の実行中の前記キャッシュメモリからのデータ読
出時にこのデータ対応の前記フラグをセットするフラグ
セット手段と、前記キャッシュメモリへのデータの書込
みの完了後に前記フラグをリセットするフラグリセット
手段とを備えて構成されている。
A pipeline processor according to the present invention reads data from an arbitrary address in a memory, performs a predetermined arithmetic processing on the read data, and writes the processed data to the address. A read-modify-write processing unit that executes the modify-write processing with a single read-modify-write instruction, and a cache memory for buffering the memory are provided, and one processing is divided into a plurality of processing stages and each stage is parallelized. In a pipeline processor that executes processing, a flag that can be set / reset for each entry of the cache memory is provided, and when reading data from the cache memory during execution of the read modify write instruction, the flag corresponding to this data is set. Flag setting means to set, and It is constituted by a flag resetting means for resetting said flag after completion of data writing to the cache memory.

【0016】本発明のパイプラインプロセッサの処理方
法は、キャッシュメモリ介してメモリ内の任意のアドレ
スからデータを読出しこの読出したデータに所定の演算
処理を行ないこの処理後のデータを前記アドレスに書込
むリードモディファイライト処理を単一のリードモディ
ファイライト命令である第1の命令で実行するとともに
このリードモディファイライト処理を前記データの読
出,演算,書込の各々に対応の第1,第2,第3の処理
ステージを含む複数の処理ステージに分割し各々のステ
ージ毎に並列に処理を実行するパイプラインプロセッサ
の処理方法において、前記キャッシュメモリのエントリ
毎にセット・リセット可能なフラグを配置し、前記第1
の処理ステージが、前記キャッシュメモリのエントリを
アクセスして前記フラグを読出すステップと、前記フラ
グのセット状態を点検するステップと、前記キャッシュ
メモリから前記データを読出すステップと、前記キャッ
シュメモリの前記フラグをセットするステップとを含
み、前記第3の処理ステージが、前記データを前記キャ
シュメモリに書込むステップと、前記キャッシュメモリ
の前記フラグをリセットするステップとを含むことを特
徴とするものである。
According to the processing method of the pipeline processor of the present invention, data is read from an arbitrary address in the memory via the cache memory, a predetermined arithmetic processing is performed on the read data, and the data after this processing is written to the address. The read-modify-write processing is executed by the first instruction, which is a single read-modify-write instruction, and the read-modify-write processing is performed by the first, second, and third operations corresponding to the reading, operation, and writing of the data. In a processing method of a pipeline processor that is divided into a plurality of processing stages including a processing stage and executes processing in parallel for each stage, a settable / resettable flag is arranged for each entry of the cache memory, 1
Processing step of accessing the entry of the cache memory to read the flag, checking the set state of the flag, reading the data from the cache memory, Setting a flag, the third processing stage including the step of writing the data to the cache memory and the step of resetting the flag of the cache memory. .

【0017】[0017]

【発明の実施の形態】次に、本発明の実施の形態を特徴
ずけるパイプラインプロセッサのキャッシュメモリ(以
下キャッシュ)のエントリを図6と共通の構成要素は共
通の文字を付して同様に模式的に示す図2を参照する
と、この実施の形態のパイプラインプロセッサのキャッ
シュのエントリには従来と共通のデータ201と、アド
レス202と、Vビット203とに加えて、リードモデ
ィファイライト(RMW)命令の実行過程におけるアク
セス中表示用のLフラグ204を追加している。
BEST MODE FOR CARRYING OUT THE INVENTION Next, an entry of a cache memory (hereinafter referred to as a cache) of a pipeline processor which characterizes the embodiment of the present invention is the same as that shown in FIG. Referring to FIG. 2 schematically showing, in addition to the data 201, the address 202, and the V bit 203 which are common to the conventional cache entry of the pipeline processor of this embodiment, a read modify write (RMW) is added. An L flag 204 for displaying during access is added in the process of executing an instruction.

【0018】また、本実施の形態では、説明の便宜上プ
ログラムおよびこのプログラムの各命令の構成ステージ
を従来と共通の図4(A)〜(C)に示したものとす
る。すなわち、プログラムはRMW命令11(INC
[1234])と、MV命令12(MOV A,[12
34])とから成り、命令11はオペコードフエッチス
テージ111と、デコードステージ112と、キャッシ
ュリードステージ113と、演算ステージ114と、キ
ャッシュライトステージ115との5個のステージに分
割されている。命令12はオペコードフエッチステージ
121と、デコードステージ122と、キャッシュリー
ドステージ123と、演算ステージ124との4個のス
テージに分割されている。
Further, in the present embodiment, for convenience of explanation, it is assumed that the program and the constituent stage of each instruction of this program are shown in FIGS. That is, the program is RMW instruction 11 (INC
[1234]) and MV instruction 12 (MOV A, [12
34]), the instruction 11 is divided into five stages: an opcode etch stage 111, a decode stage 112, a cache read stage 113, a calculation stage 114, and a cache write stage 115. The instruction 12 is divided into four stages, an opcode etch stage 121, a decode stage 122, a cache read stage 123, and a calculation stage 124.

【0019】次に、本実施の形態のパイプラインプロセ
ッサの従来と共通のRMW命令11の実行手順をフロー
チャートで示す図1(A)を参照すると、この図に示す
本実施の形態のパイプラインプロセッサのRMW命令1
1の実行手順は、キャッシュリードステージ113がキ
ャッシュアクセス(ステップS11)とLフラグ204
のセット確認(ステップS12)とデータリード(ステ
ップS13)とLフラグ204のセット(ステップS1
4)を、演算ステージ114が演算実行(ステップS1
5)を、キャッシュライトステージ115がキャッシュ
へのデータライト(ステップS16)とLフラグ204
のリセット(ステップS17)をそれぞれ含む。
Next, referring to FIG. 1A which is a flow chart showing the execution procedure of the RMW instruction 11 common to the conventional pipeline processor of this embodiment, referring to FIG. 1A, the pipeline processor of this embodiment shown in FIG. RMW instruction 1
In the execution procedure of No. 1, the cache read stage 113 accesses the cache (step S11) and the L flag 204.
Set confirmation (step S12), data read (step S13), and L flag 204 set (step S1)
4) is executed by the arithmetic stage 114 (step S1).
5), the cache write stage 115 writes the data to the cache (step S16) and the L flag 204.
Resetting (step S17) is included.

【0020】次に、図1(A)を参照して本実施の形態
のパイプラインプロセッサの処理について説明すると、
まず、キャッシュリードステージ113では、キャッシ
ュメモリのLフラグ204をリード(ステップS11)
し、1のセットの有無をチェックする(ステップS1
2)。1がセットされている場合は再度Lフラグ204
のリード(ステップS11)・判定(ステップS12)
を行う。Lフラグ204がセット(1)状態である限り
キャッシュリードステージ113を終了することはな
い。リセット(0)状態の場合は、キャッシュからデー
タを読みだして(ステップS13)tmpレジスタに転
送する。その後キャッシュのLフラグ204を1にセッ
トして(ステップS14)、キャッシュリードステージ
113の実行を終了する。次の演算ステージ114で
は、tmpレジスタに1を加算する(ステップS15)
だけで、従来のプロセッサの動作と同一である。最後の
キャッシュライトステージ115では、最初にキャッシ
ュにデータを書込む(ステップS16)。次にキャッシ
ュ内のLフラグ204を0にリセットする(ステップS
17)。
Next, the processing of the pipeline processor of the present embodiment will be described with reference to FIG.
First, in the cache read stage 113, the L flag 204 of the cache memory is read (step S11).
Then, the presence or absence of the set of 1 is checked (step S1)
2). When 1 is set, L flag 204 is set again
Read (step S11) / judgment (step S12)
I do. As long as the L flag 204 is in the set (1) state, the cache read stage 113 is never finished. In the reset (0) state, the data is read from the cache (step S13) and transferred to the tmp register. After that, the L flag 204 of the cache is set to 1 (step S14), and the execution of the cache read stage 113 is completed. In the next arithmetic stage 114, 1 is added to the tmp register (step S15).
Only the operation of the conventional processor is the same. In the final cache write stage 115, data is first written in the cache (step S16). Next, the L flag 204 in the cache is reset to 0 (step S
17).

【0021】次に、本実施の形態のパイプラインプロセ
ッサのMV命令12の実行手順をフローチャートで示す
図1(B)を参照すると、この図に示すMV命令12の
実行手順は、キャッシュリードステージ123がキャッ
シュアクセス(ステップS21)とLフラグ204のセ
ット確認(ステップS22)とデータリード(ステップ
S23)を、演算ステージ124が演算実行(ステップ
S24)をそれぞれ含む。
Next, referring to FIG. 1B which is a flowchart showing the execution procedure of the MV instruction 12 of the pipeline processor of the present embodiment, the execution procedure of the MV instruction 12 shown in this figure is the cache read stage 123. Includes cache access (step S21), confirmation of setting of the L flag 204 (step S22) and data read (step S23), and the operation stage 124 includes operation execution (step S24).

【0022】次に、図1(B)を参照して本実施の形態
のパイプラインプロセッサの処理について説明すると、
まず、キャッシュリードステージ123では、キャッシ
ュのLフラグ204をリードし(ステップS21)、1
のセットの有無をチェックする(ステップS22)。1
がセットされている場合は再度Lフラグ204のリード
(ステップS21)・判定(ステップS22)を行う。
Lフラグ204がセット(1)状態である限りキャッシ
ュリードステージ123を終了することはない。リセッ
ト(0)状態の場合は、キャッシュからデータを読みだ
して(ステップS23)tmpレジスタに転送し、キャ
ッシュリードステージ123の実行を終了する。次の演
算ステージ124では、tmpレジスタからAレジスタ
に転送して(ステップS24)、この演算ステージ12
4を終了する。
Next, the processing of the pipeline processor of the present embodiment will be described with reference to FIG.
First, in the cache read stage 123, the L flag 204 of the cache is read (step S21), 1
It is checked whether or not there is a set (step S22). 1
If is set, the L flag 204 is read again (step S21) and determined (step S22).
As long as the L flag 204 is in the set (1) state, the cache read stage 123 is never finished. In the reset (0) state, the data is read from the cache (step S23), transferred to the tmp register, and the execution of the cache read stage 123 ends. In the next arithmetic stage 124, the data is transferred from the tmp register to the A register (step S24), and the arithmetic stage 12
4 is ended.

【0023】次に、本実施の形態のパイプラインプロセ
ッサの処理方法におけるハザードの検出およびその処理
手順について説明すると、上述の従来の技術で説明した
ように、RMW命令11とこれに続くMV命令12とか
ら成る図4(A)のようなプログラムにおいて、RMW
命令11とMV命令12とのアクセス対象アドレスが異
なる場合は、従来の理想的な動作タイミングである図5
(A)のタイミングで処理を実行しても全く問題は無
い。
Next, the hazard detection and its processing procedure in the processing method of the pipeline processor of the present embodiment will be described. As described in the above-mentioned conventional technique, the RMW instruction 11 and the MV instruction 12 following the RMW instruction 11 are described. In the program shown in FIG.
When the access target addresses of the instruction 11 and the MV instruction 12 are different, the conventional ideal operation timing is shown in FIG.
There is no problem even if the processing is executed at the timing of (A).

【0024】一方、RMW命令11とMV命令12との
アクセス対象アドレスが同一の場合の実行タイミングを
示す図3を参照すると、上述のように、RMW命令11
はキャッシュリードステージ113で該当するエントリ
のLフラグ204を1にセットする。次の演算ステージ
114は、MV命令12のキャッシュリードステージ1
23と並列に実行される。しかし、このキャッシュリー
ドステージ123で読出したLフラグ204は1にセッ
トされている。したがって、MV命令11はこのキャッ
シュリードステージ123を終了できず、次の演算ステ
ージ124に進むことができない。上記Lフラグ204
はRMW命令11のキャッシュライトステージ115に
なって始めて0にリセットされるため、MV命令12の
キャッシュリードステージ123でLフラグ204のリ
セット状態を確認し、データの読出可能となるのはRM
W命令11の実行が終了してからである。したがって、
プロセッサは上記プログラムを正常に実行できる。
On the other hand, referring to FIG. 3 showing the execution timing when the access target addresses of the RMW instruction 11 and the MV instruction 12 are the same, as described above, the RMW instruction 11
Sets the L flag 204 of the corresponding entry to 1 in the cache read stage 113. The next operation stage 114 is the cache read stage 1 of the MV instruction 12.
It is executed in parallel with 23. However, the L flag 204 read by the cache read stage 123 is set to 1. Therefore, the MV instruction 11 cannot complete the cache read stage 123 and cannot proceed to the next operation stage 124. The L flag 204
Is reset to 0 for the first time in the cache write stage 115 of the RMW instruction 11, so the reset state of the L flag 204 is confirmed in the cache read stage 123 of the MV instruction 12 and the data can be read by the RM.
This is after the execution of the W instruction 11 is completed. Therefore,
The processor can execute the above program normally.

【0025】このように、キャッシュリードステージ
で、キャッシュのエントリ内のLフラグ204の値を点
検することによりハザードを効率良く検出できる。
As described above, at the cache read stage, the hazard can be detected efficiently by checking the value of the L flag 204 in the cache entry.

【0026】[0026]

【発明の効果】以上説明したように、本発明のパイプラ
インプロセッサおよびその処理方法は、キャッシュメモ
リのエントリ毎にセット・リセット可能なフラグを備
え、リードモディファイライト命令の実行中のデータ読
出時に対応のフラグをセットし、データの書込みの完了
後に上記フラグをリセットすることによりこのフラグの
値を点検して、同一アドレスアクセスに起因するハザー
ドを効率良く検出することができるので、処理の大半を
占めハザードの発生のおそれがない異アドレスアクセス
の処理を高速化できるという効果がある。
As described above, the pipeline processor and the processing method thereof according to the present invention are provided with a flag that can be set / reset for each entry of the cache memory, and can cope with data read during execution of a read modify write instruction. By checking the value of this flag by setting the above flag and resetting the above flag after the completion of data writing, the hazards caused by the same address access can be detected efficiently, so it occupies most of the processing. There is an effect that it is possible to speed up the processing of the different address access that does not cause a hazard.

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

【図1】本発明の一実施の形態のパイプラインプロセッ
サの処理方法を示すフローチャートである。
FIG. 1 is a flowchart showing a processing method of a pipeline processor according to an embodiment of the present invention.

【図2】本実施の形態を特徴ずけるキャッシュメモリの
エントリの構成を模式的に示す説明図である。
FIG. 2 is an explanatory diagram schematically showing a configuration of an entry of a cache memory which is a feature of this embodiment.

【図3】本実施の形態のRMW命令とMV命令とのアク
セス対象アドレスが同一の場合の実行タイミングを示す
タイムチャートである。
FIG. 3 is a time chart showing execution timings when the RMW instruction and the MV instruction of the present embodiment have the same access target address.

【図4】一般的なパイプラインプロセッサの動作を説明
するためのプログラムの一例およびこのプログラムの各
命令の対応のパイプラインステージの構成を示す図であ
る。
FIG. 4 is a diagram showing an example of a program for explaining the operation of a general pipeline processor and a configuration of a pipeline stage corresponding to each instruction of the program.

【図5】従来のパイプラインプロセッサの実行タイミン
グの一例を示すタイムチャートである。
FIG. 5 is a time chart showing an example of execution timing of a conventional pipeline processor.

【図6】従来のパイプラインプロセッサのキャッシュメ
モリのエントリの構成を模式的に示す説明図である。
FIG. 6 is an explanatory diagram schematically showing a configuration of an entry of a cache memory of a conventional pipeline processor.

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

11 RMW命令 12 MV命令 111,121 オペコードフエッチステージ 112,122 デコードステージ 113,123 キャッシュリードステージ 114,124 演算ステージ 115 キャッシュライトステージ 201 アドレス 202 データ 203 Vビット 204 Lフラグ 11 RMW instruction 12 MV instruction 111,121 Opcode etch stage 112,122 Decode stage 113,123 Cache read stage 114,124 Operation stage 115 Cache write stage 201 Address 202 Data 203 V bit 204 L flag

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 メモリ内の任意のアドレスからデータを
読出しこの読出したデータに所定の演算処理を行ないこ
の処理後のデータを前記アドレスに書込むリードモディ
ファイライト処理を単一のリードモディファイライト命
令で実行するリードモディファイライト処理手段と、前
記メモリのバッファ用のキャッシュメモリとを備え、1
つの処理を複数の処理ステージに分割し各々のステージ
毎に並列に処理を実行するパイプラインプロセッサにお
いて、 前記キャッシュメモリのエントリ毎にセット・リセット
可能なフラグを備え、 前記リードモディファイライト命令の実行中の前記キャ
ッシュメモリからのデータ読出時にこのデータ対応の前
記フラグをセットするフラグセット手段と、 前記キャッシュメモリへのデータの書込みの完了後に前
記フラグをリセットするフラグリセット手段とを備える
ことを特徴とするパイプラインプロセッサ。
1. A read-modify-write process for reading data from an arbitrary address in a memory and performing a predetermined arithmetic process on the read-out data and writing the processed data to the address with a single read-modify-write instruction. A read-modify-write processing unit that executes the data and a cache memory for buffering the memory are provided.
In a pipeline processor that divides one process into a plurality of processing stages and executes the processes in parallel for each stage, a flag that can be set / reset for each entry of the cache memory is provided, and the read-modify-write instruction is being executed. A flag setting means for setting the flag corresponding to the data at the time of reading data from the cache memory, and a flag reset means for resetting the flag after the writing of the data to the cache memory is completed. Pipeline processor.
【請求項2】 キャッシュメモリ介してメモリ内の任意
のアドレスからデータを読出しこの読出したデータに所
定の演算処理を行ないこの処理後のデータを前記アドレ
スに書込むリードモディファイライト処理を単一のリー
ドモディファイライト命令である第1の命令で実行する
とともにこのリードモディファイライト処理を前記デー
タの読出,演算,書込の各々に対応の第1,第2,第3
の処理ステージを含む複数の処理ステージに分割し各々
のステージ毎に並列に処理を実行するパイプラインプロ
セッサの処理方法において、 前記キャッシュメモリのエントリ毎にセット・リセット
可能なフラグを配置し、 前記第1の処理ステージが、前記キャッシュメモリのエ
ントリをアクセスして前記フラグを読出すステップと、 前記フラグのセット状態を点検するステップと、 前記キャッシュメモリから前記データを読出すステップ
と、 前記キャッシュメモリの前記フラグをセットするステッ
プとを含み、 前記第3の処理ステージが、前記データを前記キャシュ
メモリに書込むステップと、 前記キャッシュメモリの前記フラグをリセットするステ
ップとを含むことを特徴とするパイプラインプロセッサ
の処理方法。
2. A read-modify-write process in which data is read from an arbitrary address in the memory via a cache memory, a predetermined operation process is performed on the read data, and the processed data is written to the address in a single read. The read-modify-write processing is executed by the first instruction which is a modify write instruction, and the read-modify-write processing is performed for the first, second, and third data corresponding to the read, operation, and write of the data.
In a processing method of a pipeline processor that divides into a plurality of processing stages including a processing stage and executes processing in parallel for each stage, a settable / resettable flag is arranged for each entry of the cache memory, The first processing stage accesses the cache memory entry to read the flag; checks the set state of the flag; reading the data from the cache memory; Setting the flag, the third processing stage including writing the data in the cache memory and resetting the flag in the cache memory. Processor processing method.
JP20888995A 1995-08-16 1995-08-16 Pipeline processor and its processing method Pending JPH0954694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20888995A JPH0954694A (en) 1995-08-16 1995-08-16 Pipeline processor and its processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20888995A JPH0954694A (en) 1995-08-16 1995-08-16 Pipeline processor and its processing method

Publications (1)

Publication Number Publication Date
JPH0954694A true JPH0954694A (en) 1997-02-25

Family

ID=16563809

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20888995A Pending JPH0954694A (en) 1995-08-16 1995-08-16 Pipeline processor and its processing method

Country Status (1)

Country Link
JP (1) JPH0954694A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100491323B1 (en) * 2002-03-13 2005-05-24 (주) 네오시스트 Computer having a storage type using the independent pipeline
US6959367B2 (en) 2001-12-25 2005-10-25 Kabushiki Kaisha Toshiba System having read-modify-write unit
JP2012123719A (en) * 2010-12-10 2012-06-28 Hitachi Ltd Programmable controller
US8645796B2 (en) 2010-06-24 2014-02-04 International Business Machines Corporation Dynamic pipeline cache error correction

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6959367B2 (en) 2001-12-25 2005-10-25 Kabushiki Kaisha Toshiba System having read-modify-write unit
KR100491323B1 (en) * 2002-03-13 2005-05-24 (주) 네오시스트 Computer having a storage type using the independent pipeline
US8645796B2 (en) 2010-06-24 2014-02-04 International Business Machines Corporation Dynamic pipeline cache error correction
JP2012123719A (en) * 2010-12-10 2012-06-28 Hitachi Ltd Programmable controller

Similar Documents

Publication Publication Date Title
JPS6239780B2 (en)
US5761467A (en) System for committing execution results when branch conditions coincide with predetermined commit conditions specified in the instruction field
JPH0348537B2 (en)
JPH0954694A (en) Pipeline processor and its processing method
JP2001306334A (en) Emulation device
JP2553200B2 (en) Information processing device
JP3497087B2 (en) Instruction control apparatus and method
KR950000088B1 (en) Data processing system
JP2000029690A (en) Method and device for data processing
JP2915680B2 (en) RISC processor
JP3130798B2 (en) Bus transfer device
JPH06324861A (en) System and method for controlling cpu
JP3705263B2 (en) Sequencer
JP3428253B2 (en) Sequencer
JPH06149569A (en) Register number changing device
JP2806690B2 (en) Microprocessor
JPH0535499A (en) Data processing device and method
JP2504570B2 (en) Storage area write inspection processing method
JPS6149695B2 (en)
JPH08297583A (en) Processor and method for interruption processing
JPH0916399A (en) Computer
JPS63276126A (en) Instruction decoding circuit
JPH10254698A (en) Information processor
JPH03164945A (en) Data processor
JPH02254541A (en) Control system for conditional branch instruction

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19981027