JPH10254782A - Data processor - Google Patents

Data processor

Info

Publication number
JPH10254782A
JPH10254782A JP9053474A JP5347497A JPH10254782A JP H10254782 A JPH10254782 A JP H10254782A JP 9053474 A JP9053474 A JP 9053474A JP 5347497 A JP5347497 A JP 5347497A JP H10254782 A JPH10254782 A JP H10254782A
Authority
JP
Japan
Prior art keywords
memory
instruction
register
cache memory
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP9053474A
Other languages
Japanese (ja)
Inventor
Toshihiro Ozawa
年弘 小沢
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 JP9053474A priority Critical patent/JPH10254782A/en
Publication of JPH10254782A publication Critical patent/JPH10254782A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent the deterioration of performance owing to the long stay of unnecessary data which are temporarily used in a cache memory and are not used later. SOLUTION: At the time of giving a memory reference instruction from a CPU to the cache memory 3, flag information showing that a register is used for generating a request memory address and the memory address are stored in the pertinent register of a register file 2. On a CPU-side, an instruction for making replacement selection priority on a cache memory 3-side the highest is transmitted to the cache memory 3 on the memory addresses stored in a pair when the contents of a register generating the memory addresses before are changed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、キャッシュメモリ
を有するデータ処理装置(計算機システム)に関する。
The present invention relates to a data processing device (computer system) having a cache memory.

【0002】[0002]

【従来の技術】現在の計算機システムでは、CPUが要
求するデータを高速に供給するためにキャッシュメモリ
を装備することが普通になっている。図9は、従来のデ
ータ処理装置(計算機システム)の構成例を示す図であ
る。図9において、200は命令バッファ、201はレ
ジスタ・ファイル、202は演算パイプラインユニッ
ト、203はロード/ストアパイプラインユニット、2
04はキャッシュメモリ、205は主記憶、300はタ
グ/データ部、301はリプレース制御部である。
2. Description of the Related Art In a current computer system, it is common to equip a cache memory to supply data requested by a CPU at a high speed. FIG. 9 is a diagram illustrating a configuration example of a conventional data processing device (computer system). 9, reference numeral 200 denotes an instruction buffer; 201, a register file; 202, an operation pipeline unit; 203, a load / store pipeline unit;
04 is a cache memory, 205 is a main memory, 300 is a tag / data section, and 301 is a replacement control section.

【0003】通常、命令バッファ200、レジスタ・フ
ァイル201、演算パイプラインユニット202、ロー
ド/ストアパイプラインユニット203を含む部分をC
PUと称している。キャッシュメモリ204のタグ/デ
ータ部300は、アドレス、データおよび有効ビットの
組からなるエントリで構成される。CPUがメモリ読み
出しを行う場合には、キャッシュメモリ204内の図示
しない制御部は、タグ/データ部300中に読み出しア
ドレスと一致するアドレスを持ち、かつ有効ビットがv
alid(有効)であるエントリがあるか否かを探索
し、あればそのデータ部の値をCPUに送る。なければ
主記憶205にリード要求を行い、主記憶205から送
られてきたデータをCPUに送るとともに、リプレース
制御部301でタグ/データ部300のエントリをある
基準で選び(エントリの選択)、アドレスと主記憶から
送られてきたデータをそのエントリに書き込み、そのエ
ントリの有効ビットをvalidにする。
Normally, a portion including an instruction buffer 200, a register file 201, an operation pipeline unit 202, and a load / store pipeline unit 203 is represented by C
Called PU. The tag / data section 300 of the cache memory 204 is configured by an entry including a set of an address, data, and a valid bit. When the CPU performs a memory read, a control unit (not shown) in the cache memory 204 has an address in the tag / data unit 300 that matches the read address, and the valid bit is v
A search is made to see if there is an entry that is valid (valid), and if so, the value of the data part is sent to the CPU. If not, a read request is made to the main memory 205, the data sent from the main memory 205 is sent to the CPU, and the replacement control unit 301 selects an entry of the tag / data unit 300 based on a certain standard (selection of entry), and Is written to the entry, and the valid bit of the entry is set to valid.

【0004】CPUがメモリ書き込みを行う場合は、C
PUはキャッシュメモリ204に書き込みアドレスとデ
ータを送る。図示しないキャッシュ制御部は、タグ/デ
ータ部300に書き込みアドレスと一致するアドレスを
持ち、かつ有効ビットがvalidであるエントリがあ
るか否か探索し、あればそのデータ部の値をCPUから
送られてきたデータで書き換える。なければリプレース
制御部でタグ/データ部300のエントリをある基準で
選び(エントリの選択)、そのエントリにアドレスとC
PUから送られてきたデータを書き込み、そのエントリ
の有効ビットをvalidにする。
When the CPU performs memory writing, C
The PU sends a write address and data to the cache memory 204. The cache control unit (not shown) searches the tag / data unit 300 for an entry that has an address that matches the write address and has an entry whose valid bit is valid, and if so, sends the value of the data unit from the CPU. Rewrite with the data that came. If not, the replacement control unit selects an entry of the tag / data unit 300 based on a certain criterion (selection of an entry), and the address and C
The data sent from the PU is written, and the valid bit of the entry is set to valid.

【0005】新たなエントリを割り当てるエントリの選
択において、どのような基準でエントリを選ぶかは、計
算機システムの性能に影響を与える。direct m
apped cacheと呼ばれるキャッシュメモリで
は、あるアドレスに対して割り当てることができるキャ
ッシュ・エントリは1つしかないので、選択の余地がな
い。このため、そのエントリが現在使用されている場合
には、そのデータを捨ててしまうので、あまり良い性能
が得られない。
[0005] In selecting an entry to which a new entry is to be assigned, what criteria is used to select the entry affects the performance of the computer system. direct m
In a cache memory called an applied cache, there is only one cache entry that can be assigned to a certain address, and there is no choice. Therefore, if the entry is currently used, the data is discarded, so that very good performance cannot be obtained.

【0006】n set associative c
acheと呼ばれるキャッシュメモリは、あるアドレス
に対して割り当てることができるキャッシュ・エントリ
がn個存在する方式である。n個の候補のうち、今後最
も使用されそうにないデータの乗っているエントリを選
んで、新データを書き込むことによって、direct
mapped cacheより、良い性能が得られる
ようになっている。しかし、nを大きくすることは、多
量のハードウェアを必要とするので、nを小さくしたま
まで、適切なエントリを選択することが求められる。
[0006] n set associative c
The cache memory called “ache” is a system in which there are n cache entries that can be assigned to a certain address. By selecting an entry having data that is least likely to be used in the future from among the n candidates and writing new data, direct
Better performance can be obtained than with mapped cache. However, increasing n requires a large amount of hardware, so it is required to select an appropriate entry while n is kept small.

【0007】set associative cac
heのエントリの選択において、これまでの方式は、L
RU方式を基本としている。つまり、最近使用されたデ
ータは再び使用される可能性が高いと仮定して、最後に
使用された時間が最も古いエントリを高い優先度で選択
する。
[0007] set associative cac
In selecting an entry for he, the conventional method is L
It is based on the RU method. That is, assuming that recently used data is likely to be used again, an entry with the oldest used time is selected with a higher priority.

【0008】[0008]

【発明が解決しようとする課題】しかし、この方式で
は、本当に一時的にのみ使用されるデータであっても使
用された直後にはキャッシュメモリに載せられ、時間が
経つまで、なかなか選択の対象にならない。このこと
は、不要なデータがキャッシュメモリに長時間保持され
ていることになり、性能低下を招くことになる。
However, in this method, even data that is used only temporarily is stored in a cache memory immediately after being used, and it is difficult to select data until a certain time elapses. No. This means that unnecessary data is held in the cache memory for a long time, which leads to performance degradation.

【0009】一例として以下の2つの命令が連続して実
行される場合を考える。 store reg1 + 100, reg2 add reg1, 32, reg1 のストア命令(store )は、第1オペランドで指定さ
れるメモリアドレスに第2オペランドの値を格納する命
令である。の命令の例では、レジスタreg1の内容に定
数値100を加えた値からなるメモリアドレスにレジス
タreg2の内容を格納する動作を実行する。の加算命令
(add )は、第1オペランドと第2オペランドの値を加
算して第3オペランドに格納する命令である。の命令
の例では、レジスタreg1の内容に定数値32が加算さ
れ、その加算結果がレジスタreg1に格納される。
As an example, consider the case where the following two instructions are executed consecutively. The store instruction (store) of store reg1 + 100, reg2 add reg1, 32, reg1 is an instruction to store the value of the second operand at the memory address specified by the first operand. In the instruction example, the operation of storing the contents of the register reg2 at a memory address consisting of a value obtained by adding a constant value 100 to the contents of the register reg1 is executed. Is an instruction for adding the value of the first operand and the value of the second operand and storing the result in the third operand. In this example, the constant value 32 is added to the contents of the register reg1, and the result of the addition is stored in the register reg1.

【0010】の命令の実行時に、レジスタreg1の内容
がメモリアドレス生成に使用され、そのメモリアドレス
でキャッシュメモリへのアクセスが実行されることによ
り、レジスタreg1の内容に基づくメモリアドレスのリプ
レース選択順位は最も低くなる。次に、の命令が実行
されると、レジスタreg1の内容は異なる値に書き換えら
れてしまうことになる。その場合、レジスタreg1の書き
換え前の値が近い将来再び、メモリアドレス生成のため
に使用される可能性はほとんどなくなってしまう。
When the instruction of (1) is executed, the contents of the register reg1 are used for generating a memory address, and the access to the cache memory is executed at the memory address, whereby the replacement selection order of the memory address based on the contents of the register reg1 is changed. Lowest. Next, when the instruction is executed, the content of the register reg1 is rewritten to a different value. In that case, there is almost no possibility that the value before rewriting of the register reg1 will be used again for generating the memory address in the near future.

【0011】その結果、キャッシュメモリにおいては、
近い将来において使用される可能性が極めて小さいメモ
リアドレスが最もリプレース選択されない優先順位に留
まることになり、ある時間が経過して自メモリアドレス
のリプレース選択順位が最も高くなるまで、キャッシュ
メモリに使用されないまま残されることになる。本発明
は、上記のような、キャッシュメモリに不要なデータが
長く留まることによる性能低下を防ぐことを目的とす
る。
As a result, in the cache memory,
A memory address that is extremely unlikely to be used in the near future will remain at the priority that is not replaced the most, and will not be used for cache memory until a certain time elapses and the replacement selection order of the own memory address becomes the highest. Will be left as is. SUMMARY OF THE INVENTION It is an object of the present invention to prevent performance degradation caused by unnecessary data remaining in a cache memory for a long time.

【0012】[0012]

【課題を解決するための手段】本発明では、CPUから
キャッシュメモリへ送出するコマンドであって、あるア
ドレスの乗っているキャッシュ・エントリに対してその
選択の優先度を高めることを指示するコマンド(pri
orityコマンド)を用意する。そのコマンドを用い
ることにより、CPUからキャッシュメモリ内のリプレ
ース制御をある程度行うことによって、不要なデータの
キャッシュからの追い出しを迅速にさせる。
According to the present invention, a command transmitted from a CPU to a cache memory, which instructs a cache entry having a certain address to increase the priority of the selection (refer to FIG. 1). pri
Ority command) is prepared. By using the command, the CPU performs the replacement control in the cache memory to some extent, thereby expediting the eviction of unnecessary data from the cache.

【0013】図1は、本発明の第1の原理構成を示す図
である。図1において、1は演算ユニット、2はレジス
タ・ファイル、3はキャッシュメモリ、4は主記憶であ
る。演算ユニット1およびレジスタ・ファイル2を含む
部分がCPUを構成する。図1の構成において、CPU
からキャッシュメモリ3へ要求を出すときに、要求のア
ドレスを生成するのに使用したレジスタ名とアドレスを
CPU側で記憶しておく。CPU側では、アドレスを生
成するのに使用したレジスタに関して、そのレジスタ内
容(値)が変化した場合、対になって記憶していたアド
レスについて、キャッシュメモリ3での選択優先度を高
めるコマンド(priorityコマンド)をキャッシ
ュメモリ3へ送る。
FIG. 1 is a diagram showing a first principle configuration of the present invention. In FIG. 1, 1 is an arithmetic unit, 2 is a register file, 3 is a cache memory, and 4 is a main memory. The portion including the arithmetic unit 1 and the register file 2 constitutes a CPU. In the configuration of FIG.
When the CPU issues a request to the cache memory 3, the CPU stores the register name and the address used to generate the address of the request. On the CPU side, when the register contents (value) of the register used to generate the address change, a command (priority) for increasing the selection priority in the cache memory 3 for the address stored as a pair. Command) to the cache memory 3.

【0014】これは、メモリをアクセスする場合、アド
レスをあるレジスタ(もしくはレジスタ+定数値)によ
って示すが、そのレジスタの値が変化したということ
は、変更前の値によって示されるアドレスをアクセスし
なくなるという可能性が高いことに基づく制御である。
図1のレジスタ・ファイル2には、通常のデータを入れ
るフィールドの他に、アドレス・フィールド、バリッド
フラグ(有効ビット)が付加される。そのレジスタの値
(もしくはレジスタ+定数値)でメモリ参照された場合
には、アドレスをアドレス・フィールドに書き込み、有
効ビットをvalid状態にする。その後、そのレジス
タの値が書き換わったときには、有効ビットをinva
lidにする。このとき、有効ビットが元々valid
であったならば、対応するアドレス・フィールド値とと
もに、キャッシュメモリでの選択優先度を高めることを
指示するコマンドをキャッシュメモリに送る。
This means that when accessing the memory, the address is indicated by a certain register (or register + constant value). However, the fact that the value of the register has changed means that the address indicated by the value before the change is not accessed. This is the control based on the high possibility.
An address field and a valid flag (valid bit) are added to the register file 2 in FIG. 1 in addition to a field for storing normal data. When the memory is referred to by the value of the register (or the register + constant value), the address is written into the address field, and the valid bit is set to the valid state. Thereafter, when the value of the register is rewritten, the valid bit is set to inva.
lid. At this time, the valid bit is originally valid
If so, a command for increasing the selection priority in the cache memory is sent to the cache memory together with the corresponding address field value.

【0015】図2は、本発明の第2の原理構成を示す図
である。図1と同様に、1は演算ユニット、2はレジス
タ・ファイル、3はキャッシュメモリ、4は主記憶であ
り、演算ユニット1およびレジスタ・ファイル2を含む
部分がCPUを構成する。図2の構成においては、CP
Uからのメモリ参照要求に、キャッシュメモリ3での選
択優先度を高めるかどうかの情報をつける(prior
ity付きキャッシュ・リクエスト)。また、命令とし
て、通常のメモリ参照命令に加えて、priority
付きキャッシュ・リクエスト付きのメモリ参照命令を加
える。
FIG. 2 is a diagram showing a second principle configuration of the present invention. As in FIG. 1, 1 is an operation unit, 2 is a register file, 3 is a cache memory, 4 is a main memory, and a portion including the operation unit 1 and the register file 2 constitutes a CPU. In the configuration of FIG.
Information on whether to increase the selection priority in the cache memory 3 is added to the memory reference request from U (priority
cache request with ity). As an instruction, in addition to a normal memory reference instruction, priority
Add a memory reference instruction with a cache request.

【0016】コンパイラによるコード生成においては、
各変数への書き込み回数などの解析を行っている。この
解析において、その変数への最後の参照となる命令に
は、priority付きキャッシュ・リクエスト付き
のメモリ参照命令を発行するようにする。図2に示すよ
うに、CPUからキャッシュメモリ3への信号線には、
通常のアクセスアドレス/データの信号線の他に、リク
エストがpriority付きであるか否かを示すプラ
イオリティ変更制御指示線(priorityビット)
が加わる。このビットの値に従って、キャッシュメモリ
内のリプレース制御部は、選択優先度を制御する。
In code generation by a compiler,
We analyze the number of times of writing to each variable. In this analysis, a memory reference instruction with a cache request with priority is issued for the last reference to the variable. As shown in FIG. 2, signal lines from the CPU to the cache memory 3 include:
In addition to the normal access address / data signal line, a priority change control instruction line (priority bit) indicating whether or not the request has priority
Is added. The replacement control unit in the cache memory controls the selection priority according to the value of this bit.

【0017】[0017]

【発明の実施の形態】以下、図面を参照しながら、本発
明の実施の形態を説明する。図3は、本発明の第1の実
施例の構成図である。図3において、10は命令バッフ
ァ、11はレジスタ・ファイル、12は演算パイプライ
ンユニット、13はロード/ストアパイプラインユニッ
ト、14はプライオリティ制御判定部、15はキャッシ
ュメモリ、16は主記憶、17はタグ/データ部、18
はリプレース制御部、20はレジスタ・ファイル中の通
常処理用フィールド、21はアドレス保持用フィール
ド、22は有効フラグ保持フィールド、30はデータ信
号線、31はアドレス信号線、32はプライオリティ変
更制御指示線、33はプライオリティ変更対象アドレス
信号線である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 3 is a configuration diagram of the first embodiment of the present invention. 3, reference numeral 10 denotes an instruction buffer, 11 denotes a register file, 12 denotes an operation pipeline unit, 13 denotes a load / store pipeline unit, 14 denotes a priority control determination unit, 15 denotes a cache memory, 16 denotes a main memory, and 17 denotes a main memory. Tag / data part, 18
Is a replacement control unit, 20 is a normal processing field in the register file, 21 is an address holding field, 22 is a valid flag holding field, 30 is a data signal line, 31 is an address signal line, and 32 is a priority change control instruction line. , 33 are priority change target address signal lines.

【0018】図3において、キャッシュメモリ15、主
記憶16以外の部分がCPUを構成している。命令バッ
ファ10内の命令が演算命令の場合には、レジスタ・フ
ァイル11の通常処理用フィールド20の内容に対して
演算パイプラインユニット12が指定された演算処理を
実行する。命令バッファ10内の命令がロード命令の場
合は、ロード/ストアパイプラインユニット13がキャ
ッシュメモリ15からデータを読み出して、レジスタ・
ファイル11の通常処理用フィールド20に格納する。
命令バッファ10内の命令がストア命令の場合は、ロー
ド/ストアパイプラインユニット13がレジスタ・ファ
イル11の通常処理用フィールド20の内容を読み出し
て、キャッシュメモリ15に格納する。
In FIG. 3, parts other than the cache memory 15 and the main memory 16 constitute a CPU. When the instruction in the instruction buffer 10 is an arithmetic instruction, the arithmetic pipeline unit 12 executes the specified arithmetic processing on the contents of the normal processing field 20 of the register file 11. If the instruction in the instruction buffer 10 is a load instruction, the load / store pipeline unit 13 reads out data from the cache memory 15 and
It is stored in the normal processing field 20 of the file 11.
If the instruction in the instruction buffer 10 is a store instruction, the load / store pipeline unit 13 reads out the contents of the normal processing field 20 of the register file 11 and stores it in the cache memory 15.

【0019】本発明の第1の実施例においては、レジス
タ・ファイル11に、通常処理用フィールド20の他に
アドレス保持用フィールド21および有効フラグ保持フ
ィールド22が設けられており、各命令動作時にこれら
のフィールドへの参照動作が行われる。アドレス保持用
フィールド21には、そのレジスタの値(通常処理用フ
ィールド20に格納されている値)を元にメモリ参照ア
ドレスを生成した場合には、そのメモリ参照アドレスそ
のものを格納する。具体的には、ロード/ストア命令の
オペランドとして渡されたレジスタのアドレス保持用フ
ィールド21に、その命令でのメモリ参照アドレスを書
き込むことになる。
In the first embodiment of the present invention, the register file 11 is provided with an address holding field 21 and a valid flag holding field 22 in addition to the normal processing field 20. Is referred to. When a memory reference address is generated based on the value of the register (the value stored in the normal processing field 20), the address holding field 21 stores the memory reference address itself. Specifically, the memory reference address of the instruction is written into the address holding field 21 of the register passed as the operand of the load / store instruction.

【0020】有効フラグ保持フィールド22に格納され
る有効ビットは、対応するアドレス保持用フィールド2
1の値が有効か否かを示すものである。ロード/ストア
命令によりアドレス保持用フィールド21にメモリ参照
アドレスが書き込まれたときに「1」にセットされ、そ
れ以外の命令により通常処理用フィールド20に値が書
き込まれたとき「0」にセットされる。
The valid bits stored in the valid flag holding field 22 correspond to the corresponding address holding field 2
It indicates whether the value of 1 is valid or not. Set to “1” when a memory reference address is written to the address holding field 21 by a load / store instruction, and set to “0” when a value is written to the normal processing field 20 by another instruction. You.

【0021】そして、有効フラグ保持フィールド22の
有効ビットが「1」から「0」に遷移した場合に、プラ
イオリティ制御判定部14の制御のもとに、アドレス保
持用フィールド21の値とプライオリティ変更制御指示
情報(priorityコマンド)とを、プライオリテ
ィ変更対象アドレス信号線33、プライオリティ変更制
御指示線32によりキャッシュメモリ15へ送出する。
When the valid bit of the valid flag holding field 22 changes from "1" to "0", the value of the address holding field 21 and the priority change control are controlled under the control of the priority control determining unit 14. The instruction information (priority command) is transmitted to the cache memory 15 through the priority change target address signal line 33 and the priority change control instruction line 32.

【0022】キャッシュメモリ15は、プライオリティ
変更制御指示情報(priorityコマンド)を受け
取ったとき、付随して送られてきたアドレスで通常動作
時と同様にタグ/データ部17を検索する。そのアドレ
スがタグ/データ部17上に存在しなければ何もしな
い。一方、そのアドレスがタグ/データ部17上に存在
する場合には、リプレース制御部18はタグ/データ部
17上のそのアドレスの選択の優先度を所定の順位(例
えば、最上位)に変更する。
When the cache memory 15 receives the priority change control instruction information (priority command), the cache memory 15 searches the tag / data section 17 with the address transmitted in the same manner as in the normal operation. If the address does not exist on the tag / data section 17, nothing is performed. On the other hand, if the address exists on the tag / data section 17, the replacement control section 18 changes the priority of selection of the address on the tag / data section 17 to a predetermined order (for example, the highest order). .

【0023】図4は、第1の実施例における処理の流れ
を示す図である。CPU側の処理として、ステップ1
(S1)で命令種別を判定し、ロード/ストア命令であ
れば、ステップ2でメモリ参照アドレスをオペランドの
レジスタのアドレス保持用フィールド21に書き込む。
さらにステップ3でオペランドのレジスタの有効フラグ
保持フィールド22に有効ビット「1」を設定する。
FIG. 4 is a diagram showing a flow of processing in the first embodiment. As processing on the CPU side, step 1
The instruction type is determined in (S1), and if the instruction is a load / store instruction, the memory reference address is written to the address holding field 21 of the operand register in step 2.
Further, in step 3, a valid bit "1" is set in the valid flag holding field 22 of the operand register.

【0024】ステップ1(S1)による命令種別判定で
レジスタに値を設定する命令と判定したときは、ステッ
プ4(S4)でオペランドのレジスタの有効フラグ保持
フィールド22の有効ビットの値を判定する。有効ビッ
トが「1」であれば、ステップ5(S5)でプライオリ
ティ変更制御指示情報(priorityコマンド)と
アドレス保持用フィールド21の内容をキャッシュメモ
リ15へ送出する。そしてステップ6(S6)でオペラ
ンドのレジスタの有効フラグ保持フィールド22の有効
ビットを「0」にする。
If it is determined in step 1 (S1) that the instruction is to set a value in the register, the value of the valid bit in the valid flag holding field 22 of the operand register is determined in step 4 (S4). If the valid bit is "1", the priority change control instruction information (priority command) and the contents of the address holding field 21 are sent to the cache memory 15 in step 5 (S5). Then, in step 6 (S6), the valid bit of the valid flag holding field 22 of the operand register is set to "0".

【0025】キャッシュメモリ15側の処理として、ス
テップ7(S7)で要求種別を判定し、リード/ライト
要求であれば、通常のキャッシュ処理を行う。ステップ
7(S7)の要求種別判定で、要求種別がプライオリテ
ィ変更要求であれば、ステップ9(S9)で、プライオ
リティ変更対象アドレス信号線33で送られてくるアド
レスについて、対応するキャッシュエントリを通常のキ
ャッシュ処理と同様にして求める。
As the processing on the cache memory 15 side, the request type is determined in step 7 (S7), and if it is a read / write request, normal cache processing is performed. If the request type is determined to be a priority change request in step 7 (S7), then in step 9 (S9), the corresponding cache entry for the address sent on the priority change target address signal line 33 is changed to the normal cache entry. It is obtained in the same manner as the cache processing.

【0026】ステップ10(S10)で対応するエント
リがキャッシュメモリ上に存在するか否かを判定する。
キャッシュメモリ上に存在しなければ何もしないが、キ
ャッシュメモリ上に存在する場合は、ステップ11(S
11)でそのエントリのリプレース選択優先度を最上に
する。図5は、レジスタ・ファイル11の内容の変化の
一例を示す図である。初期状態ではレジスタ1の通常処
理用フィールド20に「100」がセットされ、有効フ
ラグ保持フィールド22に「0」がセットされていると
する。ここで、上記した命令、 store reg1 + 100, reg2 が実行されたとする。の命令実行後に、レジスタ1の
通常処理用フィールド20の値は変化しないが、アドレ
ス保持用フィールド21には生成されたメモリアドレス
値の「200」がセットされ、有効フラグ保持フィール
ド22に有効ビット「1」がセットされる。
In step 10 (S10), it is determined whether the corresponding entry exists in the cache memory.
If it does not exist in the cache memory, nothing is done. If it exists in the cache memory, step 11 (S
In 11), the replacement selection priority of the entry is set to the highest. FIG. 5 is a diagram showing an example of a change in the contents of the register file 11. In the initial state, it is assumed that “100” is set in the normal processing field 20 of the register 1 and “0” is set in the valid flag holding field 22. Here, it is assumed that the above-mentioned instruction, store reg1 + 100, reg2, has been executed. After execution of the instruction, the value of the normal processing field 20 of the register 1 does not change, but the generated memory address value “200” is set in the address holding field 21, and the valid bit “ "1" is set.

【0027】次に、上記した2番目の命令、 add reg1, 32, reg1 が実行されたとする。の命令実行後に、レジスタ1の
通常処理用フィールド20には加算結果の値の「13
2」がセットされる。このとき、有効フラグ保持フィー
ルド22の値が「1」であるため、アドレス保持用フィ
ールド21の値「200」がキャッシュメモリに送出さ
れ、その後、有効フラグ保持フィールド22の値は
「0」にセットされる。
Next, it is assumed that the above-mentioned second instruction, add reg1, 32, reg1, has been executed. After the execution of the instruction, the normal processing field 20 of the register 1 stores "13" of the value of the addition result.
2 "is set. At this time, since the value of the valid flag holding field 22 is “1”, the value “200” of the address holding field 21 is sent to the cache memory, and then the value of the valid flag holding field 22 is set to “0”. Is done.

【0028】上記した第1の実施例の処理により、その
アドレスの指していたレジスタの値が変更されたことを
契機にして、対応するキャッシュ・エントリのリプレー
ス選択の優先度が高くなるので、次に、新たなキャッシ
ュ・エントリが必要になったときには、このキャッシュ
・エントリが使用され、不要なデータがキャッシュメモ
リから追い出されることになる。
The priority of the replacement selection of the corresponding cache entry becomes higher when the value of the register pointed to by the address is changed by the processing of the first embodiment. When a new cache entry is needed, this cache entry is used and unnecessary data is evicted from the cache memory.

【0029】図6は、本発明の第2の実施例の構成図で
ある。図6において、10は命令バッファ、11はレジ
スタ・ファイル、12は演算パイプラインユニット、1
3はロード/ストアパイプラインユニット、15はキャ
ッシュメモリ、16は主記憶、17はタグ/データ部、
18はリプレース制御部、30はデータ信号線、31は
アドレス信号線、32はプライオリティ変更制御指示
線、40は命令バッファ中のプライオリティ変更制御指
示ビット部、41はロード/ストアパイプラインユニッ
ト中のプライオリティ変更制御指示ビット部である。
FIG. 6 is a block diagram of a second embodiment of the present invention. 6, 10 is an instruction buffer, 11 is a register file, 12 is an operation pipeline unit, 1
3 is a load / store pipeline unit, 15 is a cache memory, 16 is a main memory, 17 is a tag / data section,
18 is a replacement control unit, 30 is a data signal line, 31 is an address signal line, 32 is a priority change control instruction line, 40 is a priority change control instruction bit unit in the instruction buffer, and 41 is a priority in the load / store pipeline unit. This is a change control instruction bit section.

【0030】図6において、キャッシュメモリ15、主
記憶16以外の部分がCPUを構成している。命令バッ
ファ10内の命令が演算命令の場合には、レジスタ・フ
ァイル11の内容に対して演算パイプラインユニット1
2が指定された演算処理を実行する。命令バッファ10
内の命令がロード命令の場合は、ロード/ストアパイプ
ラインユニット13がキャッシュメモリ15からデータ
を読み出して、レジスタ・ファイル11に格納する。命
令バッファ10内の命令がストア命令の場合は、ロード
/ストアパイプラインユニット13がレジスタ・ファイ
ル11のの内容を読み出して、キャッシュメモリ15に
格納する。
In FIG. 6, portions other than the cache memory 15 and the main memory 16 constitute a CPU. If the instruction in the instruction buffer 10 is an operation instruction, the operation pipeline unit 1
2 executes the designated arithmetic processing. Instruction buffer 10
Is a load instruction, the load / store pipeline unit 13 reads data from the cache memory 15 and stores it in the register file 11. If the instruction in the instruction buffer 10 is a store instruction, the load / store pipeline unit 13 reads out the contents of the register file 11 and stores it in the cache memory 15.

【0031】本発明の第2の実施例では、通常のメモリ
参照命令に加えて、キャッシュメモリでのリプレース選
択優先度を最上にする機能を加えたメモリ参照命令(p
riority付きキャッシュ・リクエスト付きメモリ
参照命令)を設ける。ハードウェアとしては、図6に示
すように、命令バッファ10およびロード/ストアパイ
プラインユニット13にプライオリティ変更制御指示ビ
ット部40、41が設けられ、またCPUからキャッシ
ュメモリへの信号線として、リクエストがpriori
ty付きであるか否かを示すプライオリティ変更制御指
示線32が加わる。
In the second embodiment of the present invention, in addition to a normal memory reference instruction, a memory reference instruction (p
(memory reference instruction with cache request with priority). As hardware, as shown in FIG. 6, priority change control instruction bit units 40 and 41 are provided in the instruction buffer 10 and the load / store pipeline unit 13, and a request is sent as a signal line from the CPU to the cache memory. priori
A priority change control instruction line 32 indicating whether or not ty is attached is added.

【0032】priority付きキャッシュ・リクエ
スト付きメモリ参照命令は、priorityビットが
「1」でキャッシュメモリにリクエストを出すことだけ
が通常のメモリ参照命令と異なる。コンパイラは、各変
数への最後の参照となる命令には、priority付
きキャッシュ・リクエスト付きメモリ参照命令を発行す
る。図7および図8にコンパイルの一例を示す。図7は
条件分岐がない場合、図8は条件分岐がある場合であ
る。
A memory reference instruction with a cache request with priority differs from a normal memory reference instruction only in that a request is issued to the cache memory when the priority bit is "1". The compiler issues a cache reference with priority and a memory reference with cache request for the last reference to each variable. FIGS. 7 and 8 show an example of compiling. 7 shows a case where there is no conditional branch, and FIG. 8 shows a case where there is a conditional branch.

【0033】図7において、コンパイラは元のプログラ
ム中より同一の変数を参照する命令群(a[0] = 1, a[0]
= 2, ... a[0] = n )を検出し、その最後の参照命令
(図7の例では、a[0] = n)にはpriority付き
キャッシュ・リクエスト付きメモリ参照命令(図7の例
では、priority-store reg1 + 0, a )を発行する。図
8の場合も図7の場合と同様に、元のプログラム中より
同一の変数を参照する命令群を検出するが、条件分岐が
ある場合には2つの分岐先の両方のメモリ参照命令に対
してpriority付きキャッシュ・リクエスト付き
メモリ参照命令(図8の例では、priority-store reg1
+ 0, 10 と priority-store reg1+ 0, 9 )を発行
する。
In FIG. 7, the compiler sets an instruction group (a [0] = 1, a [0]) that refers to the same variable from the original program.
.. A [0] = n), and the last reference instruction (a [0] = n in the example of FIG. 7) includes a memory reference instruction with a cache request with priority (FIG. 7). Issues priority-store reg1 + 0, a). In the case of FIG. 8, as in the case of FIG. 7, an instruction group that refers to the same variable is detected from the original program. 8, a memory reference instruction with a cache request with priority (in the example of FIG. 8, priority-store reg1
+ 0, 10 and priority-store reg1 + 0, 9).

【0034】図6のキャッシュメモリ15は、プライオ
リティ変更制御指示線32上のpriorityビット
が「1」でリクエストを受け取ると、通常のキャッシュ
処理を行った後、対応するキャッシュ・エントリのリプ
レース選択の優先度を最上にする。これにより、次に、
新たなキャッシュ・エントリが必要になったときには、
このキャッシュ・エントリが使用され、不要なデータが
キャッシュから追い出されることになる。
When a request is received with the priority bit on the priority change control instruction line 32 being "1", the cache memory 15 of FIG. 6 performs normal cache processing, and then performs priority selection for replacement selection of the corresponding cache entry. To the highest degree. This, in turn,
When a new cache entry is needed,
This cache entry is used, and unnecessary data is evicted from the cache.

【0035】[0035]

【発明の効果】以上説明したように、本発明によれば、
不要なデータをキャッシュメモリから早く追い出すこと
ができるようになり、キャッシュメモリの有効利用度が
向上し、高速なデータ処理ができるようになる。
As described above, according to the present invention,
Unnecessary data can be quickly expelled from the cache memory, the effective use of the cache memory is improved, and high-speed data processing can be performed.

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

【図1】本発明の第1の原理構成を示す図である。FIG. 1 is a diagram showing a first principle configuration of the present invention.

【図2】本発明の第2の原理構成を示す図である。FIG. 2 is a diagram showing a second principle configuration of the present invention.

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

【図4】本発明の第1の実施例における処理の流れを示
す図である。
FIG. 4 is a diagram showing a processing flow in the first embodiment of the present invention.

【図5】本発明の第1の実施例におけるレジスタ・ファ
イルの内容の一例を示す図である。
FIG. 5 is a diagram showing an example of the contents of a register file according to the first embodiment of the present invention.

【図6】本発明の第2の実施例の構成図である。FIG. 6 is a configuration diagram of a second embodiment of the present invention.

【図7】本発明の第2の実施例におけるコンパイル動作
例(その1)を示す図である。
FIG. 7 is a diagram illustrating an example (part 1) of a compile operation according to the second embodiment of the present invention;

【図8】本発明の第2の実施例におけるコンパイル動作
例(その2)を示す図である。
FIG. 8 is a diagram illustrating a compile operation example (part 2) according to the second embodiment of the present invention.

【図9】従来のデータ処理装置の構成例を示す図であ
る。
FIG. 9 is a diagram illustrating a configuration example of a conventional data processing device.

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

1 演算ユニット 2 レジスタ・ファイル 3 キャッシュメモリ 4 主記憶 21 アドレス保持用フィールド 22 有効フラグ保持フィールド 32 プライオリティ変更制御指示線 40、41 プライオリティ変更制御指示ビット部 DESCRIPTION OF SYMBOLS 1 Operation unit 2 Register file 3 Cache memory 4 Main memory 21 Address holding field 22 Valid flag holding field 32 Priority change control instruction line 40, 41 Priority change control instruction bit section

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 処理ユニットからキャッシュメモリへメ
モリ参照命令を出すときに、要求メモリアドレスを生成
するために使用したレジスタであることを指示するアド
レス生成レジスタ指示情報と、そのメモリアドレスとを
該当レジスタに関連付けて記憶しておく手段を備え、 処理ユニットにおいて、以前にメモリアドレスを生成し
たレジスタに関して、そのレジスタへの書き込み動作が
実行されたことを上記アドレス生成レジスタ指示情報に
もとづいて検出したとき、 該当レジスタに関連付けて記憶しておいたメモリアドレ
スと、 当該メモリアドレスに関するリプレース選択優先度を高
めることを指示する情報とをキャッシュメモリへ送出す
るように構成したことを特徴とするデータ処理装置。
When a memory reference instruction is issued from a processing unit to a cache memory, address generation register instruction information indicating that a register has been used to generate a requested memory address, and the memory address are stored in a corresponding register. When the processing unit detects, based on the address generation register instruction information, that a write operation to the register has been performed with respect to a register for which a memory address has been previously generated, A data processing device configured to send, to a cache memory, a memory address stored in association with a corresponding register and information instructing to increase the replacement selection priority for the memory address.
【請求項2】 レジスタ・ファイルを内蔵する処理ユニ
ットと、キャッシュメモリと、主記憶を備え、処理対象
データがキャッシュメモリに存在するときはレジスタ・
ファイルとキャッシュメモリの間でリード/ライト操作
を行い、処理対象データがキャッシュメモリに存在しな
いときは主記憶から当該処理対象データを読み出し、キ
ャッシュメモリに書き込む構成を有するデータ処理装置
であって、 レジスタ・ファイルの各エントリに、メモリアドレス保
持領域と、該メモリアドレス保持領域の内容の有効性を
示す有効フラグを保持する有効フラグ保持領域を設け、 ロード命令およびストア命令実行時に、メモリアドレス
を生成するために使用したレジスタのメモリアドレス保
持領域に当該生成したメモリアドレスを書き込むととも
に、対応する有効フラグ保持領域の有効フラグをオン状
態とし、 ロード命令およびストア命令以外の命令によりレジスタ
・ファイルへの書き込み操作を行うとき、レジスタ・フ
ァイル中の該当エントリの有効フラグがオン状態であれ
ば、対応するメモリアドレス保持領域に書き込まれてい
るメモリアドレスをキャッシュメモリに送出し、キャッ
シュメモリにおける当該メモリアドレスのリプレース優
先度を高めるよう指示するとともに、レジスタ・ファイ
ル中の該当エントリの有効フラグをオフ状態とすること
を特徴とするデータ処理装置。
2. A processing unit having a built-in register file, a cache memory, and a main memory.
A data processing device having a configuration for performing a read / write operation between a file and a cache memory, and when the processing target data does not exist in the cache memory, reading the processing target data from the main storage and writing the data to the cache memory. A memory address holding area and a valid flag holding area for holding a valid flag indicating the validity of the contents of the memory address holding area are provided in each entry of the file, and a memory address is generated when a load instruction and a store instruction are executed. Write the generated memory address to the memory address holding area of the register used for this purpose, turn on the valid flag of the corresponding valid flag holding area, and write to the register file using instructions other than load and store instructions. When doing the register If the valid flag of the corresponding entry in the file is on, the memory address written in the corresponding memory address holding area is sent to the cache memory, and an instruction is given to increase the replacement priority of the memory address in the cache memory. A data processing device for setting a valid flag of a corresponding entry in a register file to an off state.
【請求項3】 レジスタ・ファイルを内蔵する処理ユニ
ットと、キャッシュメモリと、主記憶を備え、処理対象
データがキャッシュメモリに存在するときはレジスタフ
ァイルとキャッシュメモリの間でリード/ライト操作を
行い、処理対象データがキャッシュメモリに存在しない
ときは主記憶から当該処理対象データを読み出し、キャ
ッシュメモリに書き込む構成を有するデータ処理装置で
あって、 キャッシュメモリでのリプレース優先度を高めることを
指示する情報を含むリプレース優先度変更機能付きメモ
リ参照命令を設け、 コンパイル時に、各変数へ一連の参照を行う命令群のう
ち当該変数への最後の参照となる命令には、上記リプレ
ース優先度変更機能付きメモリ参照命令を発行し、 命令実行動作時に、上記リプレース優先度変更機能付き
メモリ参照命令を実行したとき、当該命令で参照したメ
モリアドレスのリプレース優先度を高めるようキャッシ
ュメモリに指示するように構成したことを特徴とするデ
ータ処理装置。
3. A processing unit having a built-in register file, a cache memory, and a main memory. When data to be processed exists in the cache memory, read / write operations are performed between the register file and the cache memory. When the data to be processed does not exist in the cache memory, the data processing apparatus has a configuration in which the data to be processed is read from the main memory and written to the cache memory, and information for instructing to increase the replacement priority in the cache memory is provided. A memory reference instruction with a replace priority change function is provided, and the instruction that becomes the last reference to the variable in the group of instructions that makes a series of references to each variable at compile time refers to the memory with the replace priority change function Issue an instruction, and when executing the instruction, 1. A data processing apparatus, wherein when a functionable memory reference instruction is executed, a cache memory is instructed to increase the replacement priority of a memory address referenced by the instruction.
JP9053474A 1997-03-07 1997-03-07 Data processor Withdrawn JPH10254782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9053474A JPH10254782A (en) 1997-03-07 1997-03-07 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9053474A JPH10254782A (en) 1997-03-07 1997-03-07 Data processor

Publications (1)

Publication Number Publication Date
JPH10254782A true JPH10254782A (en) 1998-09-25

Family

ID=12943862

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9053474A Withdrawn JPH10254782A (en) 1997-03-07 1997-03-07 Data processor

Country Status (1)

Country Link
JP (1) JPH10254782A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2341867A (en) * 1998-04-30 2000-03-29 Nippon Paint Co Ltd Paint composition containing luster pigment and method for forming composite coating
KR100805027B1 (en) 2005-04-11 2008-02-20 산요덴키가부시키가이샤 Memory address generation device and processor having the same, and memory address generation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2341867A (en) * 1998-04-30 2000-03-29 Nippon Paint Co Ltd Paint composition containing luster pigment and method for forming composite coating
KR100805027B1 (en) 2005-04-11 2008-02-20 산요덴키가부시키가이샤 Memory address generation device and processor having the same, and memory address generation method

Similar Documents

Publication Publication Date Title
US5353426A (en) Cache miss buffer adapted to satisfy read requests to portions of a cache fill in progress without waiting for the cache fill to complete
US6295594B1 (en) Dynamic memory allocation suitable for stride-based prefetching
US6490658B1 (en) Data prefetch technique using prefetch cache, micro-TLB, and history file
US8984261B2 (en) Store data forwarding with no memory model restrictions
JPH0863393A (en) Write method of new word segment due to generation of cache mistake at inside of multilevel cache
JPH09120372A (en) Harmonized software control for hardware architecture cache memory using prefetch instruction
CN1470019A (en) Method and apparatus for pipelining ordered input/output transactions in a cache coherent multi-processor system
US5313602A (en) Multiprocessor system and method of control over order of transfer of data between buffer storages
JP2575598B2 (en) Method and system for increasing concurrency of system memory in a multiprocessor computer system
US6496917B1 (en) Method to reduce memory latencies by performing two levels of speculation
JP3973129B2 (en) Cache memory device and central processing unit using the same
US20080307165A1 (en) Information processor, method for controlling cache flash, and information processing controller
JP2001166989A (en) Memory system having prefetch mechanism and method for operating the system
US7107407B2 (en) Arithmetic unit with reduced startup time and method of loading data
JPH10254782A (en) Data processor
JP3770091B2 (en) Cache control method and cache control circuit
JPH0477344B2 (en)
JP2927160B2 (en) Register device
JP2002007212A (en) Cache memory system and cache memory control method
JP2924708B2 (en) Information processing device
JPH10187531A (en) Prefetch system for cache memory
JP2864548B2 (en) Instruction cache device
JPH06282487A (en) Cache device
JPH06119238A (en) Method and device for controlling main storage
JP2000148587A (en) Storage device and method for determining storage area

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: 20040511