JP2000347941A - Cache memory device - Google Patents

Cache memory device

Info

Publication number
JP2000347941A
JP2000347941A JP11155286A JP15528699A JP2000347941A JP 2000347941 A JP2000347941 A JP 2000347941A JP 11155286 A JP11155286 A JP 11155286A JP 15528699 A JP15528699 A JP 15528699A JP 2000347941 A JP2000347941 A JP 2000347941A
Authority
JP
Japan
Prior art keywords
data
priority
cache memory
lru
processor
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
JP11155286A
Other languages
Japanese (ja)
Inventor
Akira Naruse
彰 成瀬
Koichi Kumon
耕一 久門
Mitsuru Sato
充 佐藤
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 JP11155286A priority Critical patent/JP2000347941A/en
Publication of JP2000347941A publication Critical patent/JP2000347941A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve the effectiveness of a cache memory by making it possible to set a LRU(least recently used) priority so as to be an appropriate priority. SOLUTION: This cache memory device 1 is provided with a LRU priority deciding means 13 which derives the next LRU priority not by making the LRU priority of data best unconditionally but by using the current LRU priority of the data, the attribute of the data, an accessing means to the data, the state of a processor or all of them or a part of information about them in the case of recording or re-recording the data in a cache memory 20. A cache controlling means 11 records or re-records data as data having the LRU priority decided by the means 13 in the memory 20.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は,キャッシュメモリ
を制御する装置に関するものである。特に,キャッシュ
メモリから追い出すデータを決定する際に使用される,
LRU (Least Recently Used)方式によるLRU優先度
を積極的に操作することにより,キャッシュメモリの有
効性を高めることに貢献する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for controlling a cache memory. In particular, it is used to determine data to be evicted from cache memory.
The present invention relates to a device that contributes to increasing the effectiveness of a cache memory by actively operating the LRU priority using an LRU (Least Recently Used) method.

【0002】[0002]

【従来の技術】一般に,キャッシュメモリはプロセッサ
と主記憶との間に位置し,主記憶に記録されているデー
タのうち,過去にプロセッサが使用したデータを記録し
ておき,プロセッサが再度そのデータを使用するとき
に,主記憶に代わってプロセッサへデータを転送する。
キャッシュメモリは,動作が高速であるため,プロセッ
サへのデータ転送を短時間で済ませることができるが,
主記憶に比べ小容量である。したがって,データがキャ
ッシュメモリに記録されており,キャッシュメモリから
データを転送できれば,主記憶からデータを転送する場
合と比べて,プロセッサのデータ待ち時間を短縮するこ
とができ,処理時間を短縮し,処理性能を向上すること
ができる。
2. Description of the Related Art Generally, a cache memory is located between a processor and a main memory. Of the data recorded in the main memory, data used by the processor in the past is recorded, and the processor re-stores the data. When using, transfer data to the processor instead of main memory.
The cache memory operates at high speed, so data transfer to the processor can be completed in a short time.
Smaller capacity than main memory. Therefore, if the data is recorded in the cache memory and the data can be transferred from the cache memory, the data waiting time of the processor can be reduced as compared with the case where the data is transferred from the main memory, and the processing time can be reduced. Processing performance can be improved.

【0003】キャッシュメモリの容量を有効に活用する
ため,キャッシュメモリに記録されるデータはLRU方
式により管理されることが多い。LRU方式は,「最近
使用されたデータは,そうでないデータに比べ近い将来
再度使用される確率が高い」という経験則に基づく方式
である。
In order to effectively utilize the capacity of the cache memory, data recorded in the cache memory is often managed by the LRU method. The LRU method is a method based on an empirical rule that "data used recently is more likely to be used again in the near future than data not used".

【0004】キャッシュメモリは,主記憶より小容量で
あるため,既に記録されているデータを削除しないと新
たにデータを記録することができない場合がよく発生す
る。図17に,キャッシュメモリに新たにデータを記録
する場合の例を示す。新たにデータEをキャッシュメモ
リに記録する場合に,LRU優先度が最も低いデータA
がキャッシュメモリから追い出され,新データEはLR
U優先度が最高のデータとしてキャッシュメモリに記録
される。
[0004] Since the cache memory has a smaller capacity than the main memory, it is often the case that new data cannot be recorded unless data already recorded is deleted. FIG. 17 shows an example in which data is newly recorded in the cache memory. When new data E is recorded in the cache memory, data A having the lowest LRU priority
Is evicted from the cache memory, and the new data E is LR
The U priority is recorded in the cache memory as the highest data.

【0005】近年では,このキャッシュメモリに,これ
までプロセッサが使用したデータだけではなく,これか
らプロセッサが使用するであろうデータを記録すること
で,キャッシュメモリからプロセッサへデータを転送で
きる機会をさらに増やす方法が採用されている。
In recent years, not only data used by the processor but also data that the processor will use from now on is recorded in the cache memory, so that the chance of transferring data from the cache memory to the processor is further increased. The method has been adopted.

【0006】この方法の代表的なものがプリフェッチで
ある。プリフェッチとは,プロセッサが実際にデータを
使用するよりも前に,主記憶からデータをキャッシュメ
モリに転送させ,そのデータをキャッシュメモリに記録
する方式のことである。
A typical example of this method is prefetch. The prefetch is a method in which data is transferred from a main memory to a cache memory before the processor actually uses the data, and the data is recorded in the cache memory.

【0007】プリフェッチを行わない場合には,プロセ
ッサがこれまでに使用したことのないデータを使用する
ときには,キャッシュメモリにデータが記録されている
ことはなく,主記憶からデータが転送されるのを待つほ
かない。しかし,プリフェッチを用いれば,このような
ときでも,キャッシュメモリにデータを記録させておく
ことが可能となる。このプリフェッチにより事前にキャ
ッシュメモリにデータを記録させておけば,主記憶から
データが転送されるのを待つ必要がなくなるので,プロ
セッサのデータ待ち時間をさらに短縮し,性能を向上さ
せることができる。
When prefetching is not performed, when the processor uses data that has never been used before, no data is recorded in the cache memory, and the data is transferred from the main memory. I have to wait. However, if prefetching is used, even in such a case, data can be recorded in the cache memory. If the data is recorded in the cache memory in advance by this prefetch, it is not necessary to wait for the data to be transferred from the main memory, so that the data waiting time of the processor can be further reduced and the performance can be improved.

【0008】[0008]

【発明が解決しようとする課題】しかし,従来の技術に
は,以下のような問題がある。
However, the prior art has the following problems.

【0009】(1)プリフェッチによる問題 例えばプリフェッチなどのように,プロセッサが実際に
使用する際にキャッシュメモリにデータを記録するので
はなく,使用の可能性に基づいてデータをキャッシュメ
モリに記録する方式では,プロセッサが実際にはそのデ
ータを使用しない可能性もあり,このような場合には,
キャッシュメモリに記録されたデータは,キャッシュメ
モリの容量を無駄に使用することになる。
(1) Problems caused by prefetch A method of recording data in a cache memory based on the possibility of use, instead of recording the data in a cache memory when the processor actually uses the data, such as prefetch, for example. It is possible that the processor may not actually use that data, in which case,
The data recorded in the cache memory wastefully uses the capacity of the cache memory.

【0010】図18に,プリフェッチによりキャッシュ
メモリの有効性が損なわれる例を示す。図18では,キ
ャッシュメモリに,LRU優先度の高い順に,データ
D,データC,データB,データAが記録されている状
態で,データEをプリフェッチした後,プロセッサが順
番にデータA,データB,データC,データDを操作し
た場合の様子を示している。
FIG. 18 shows an example in which the effectiveness of a cache memory is impaired by prefetching. In FIG. 18, in the state where data D, data C, data B, and data A are recorded in the cache memory in descending order of the LRU priority, after prefetching data E, the processor sequentially executes data A, data B , Data C, and data D are shown.

【0011】データEのプリフェッチにより,LRU優
先度が最も低いデータAがキャッシュメモリから追い出
されてしまい,次のデータAの操作では,データAはキ
ャッシュミスヒットしてしまう。さらに,この操作のた
めのデータAのフェッチの際に,LRU優先度の最も低
いデータBをキャッシュから追い出すことになり,次の
データBの操作においても,キャッシュミスヒットが生
じてしまう。このようにして,データC,データDの操
作も,キャッシュミスヒットを発生させる結果となって
しまう。これは,データEのプリフェッチにより,次に
操作されるべきデータが次々と追い出されて,キャッシ
ュメモリが汚されてしまったからである。
By prefetching data E, data A having the lowest LRU priority is evicted from the cache memory, and in the next operation of data A, data A results in a cache miss hit. Further, at the time of fetching the data A for this operation, the data B having the lowest LRU priority is evicted from the cache, and a cache miss occurs even in the operation of the next data B. In this way, operations on data C and data D also result in cache misses. This is because the data to be operated next is expelled one after another by the prefetch of the data E, and the cache memory is polluted.

【0012】一方,図19は,プリフェッチなしでキャ
ッシュメモリが有効に利用される例を示す。図19の例
では,LRU優先度の高い順に,データD,データC,
データB,データAがキャッシュメモリに記録されてい
る状態で,データEをプリフェッチすることなく,プロ
セッサが順番にデータA,データB,データC,データ
Dを操作した場合の様子を示している。データA,デー
タB,データC,データDを操作した結果は,すべてキ
ャッシュヒットを発生させる結果となっている。
FIG. 19 shows an example in which a cache memory is effectively used without prefetch. In the example of FIG. 19, data D, data C,
In the state where the data B and the data A are recorded in the cache memory, the processor sequentially operates the data A, the data B, the data C, and the data D without prefetching the data E. The results of manipulating data A, data B, data C, and data D all result in cache hits.

【0013】このように,プリフェッチ等で得たデータ
を単純にキャッシュメモリに記録すると,キャッシュメ
モリの容量を無駄使いするだけでなく,キャッシュメモ
リの有効性をも損ねてしまうことがある。
When data obtained by prefetching or the like is simply recorded in the cache memory, not only the capacity of the cache memory is wasted, but also the effectiveness of the cache memory may be impaired.

【0014】これを回避する方法としては,キャッシュ
メモリに記録するデータを厳選し,プロセッサが使用す
る可能性の低いデータを記録しないという方法がある。
この方法によれば,キャッシュメモリの有効性を損ねる
可能性は低くなるものの,投機処理による性能向上の機
会を逃すことになる。
As a method of avoiding this, there is a method of carefully selecting data to be recorded in the cache memory and not recording data which is unlikely to be used by the processor.
According to this method, although the possibility of impairing the effectiveness of the cache memory is reduced, an opportunity for performance improvement by speculative processing is missed.

【0015】また,キャッシュメモリに直接データを記
録するのではなく,いったん小容量の専用バッファに記
録しておき,実際にプロセッサがそのデータを使った段
階でキャッシュメモリにデータを記録する方式もある。
この方式によれば,キャッシュメモリの容量を無駄にす
ることはなくなるものの,キャッシュメモリの制御が複
雑になるという問題がある。
There is also a method in which data is not recorded directly in the cache memory but is recorded in a small-capacity dedicated buffer, and the data is recorded in the cache memory when the processor actually uses the data. .
According to this method, the capacity of the cache memory is not wasted, but the control of the cache memory is complicated.

【0016】(2)投機的実行による問題 さらに別の状況として,投機的実行を行うプロセッサで
のキャッシュメモリ更新の問題がある。近年のプロセッ
サが実行の高速化のため採用する投機的実行方式は,前
述したプリフェッチの場合と同様の問題が起こる。
(2) Problems Due to Speculative Execution As another situation, there is a problem of updating a cache memory in a processor that performs speculative execution. The speculative execution method adopted by recent processors for high-speed execution has the same problem as the above-described prefetch case.

【0017】投機的実行方式は,実行しないかもしれな
いメモリ操作命令を投機的に実行し,後に実行するべき
ではなかったことが判明した際に,実行結果により生じ
た影響を残さないように元の状態に復帰させるものであ
る。しかし,キャッシュメモリのLRU優先度に関して
は,投機的実行により更新された優先度を復元しなくて
も論理的な間違いが起きるわけではないので,間違った
投機的実行を行なった場合であっても,LRU優先度を
復元しない場合がほとんどである。
The speculative execution method executes a memory operation instruction that may not be executed speculatively, and prevents the influence caused by the execution result from being left when it is found that the instruction should not be executed later. Is returned to the state shown in FIG. However, regarding the LRU priority of the cache memory, a logical mistake does not occur even if the priority updated by the speculative execution is not restored, so even if the wrong speculative execution is performed. , LRU priority is not restored in most cases.

【0018】その結果,実際に使用しないデータによ
り,不必要にキャッシュメモリ領域が占有される,ある
いは,他の必要なデータのLRU優先度が下がるという
問題がある。
As a result, there is a problem that the cache memory area is unnecessarily occupied by data that is not actually used, or the LRU priority of other necessary data is lowered.

【0019】この問題を解決する方法として,投機的実
行前の状態を保存しておき,投機的実行が誤りであった
と判明したら,状態を投機的実行前に戻す,いわゆるロ
ールバック方式が知られている。しかし,この方式には
状態を元に戻す制御が複雑であるという問題がある。
As a method for solving this problem, a so-called rollback method is known in which the state before speculative execution is saved, and if the speculative execution is found to be incorrect, the state is returned to the state before speculative execution. ing. However, this method has a problem that control for restoring the state is complicated.

【0020】(3)データの属性による問題 さらに別の状況として,データアクセスの性質として,
キャッシュメモリ制御方式を変更した方がよい場合があ
る。例えば,データ処理の内容によっては,メモリが順
次参照される場合がある。典型的な例としては,メモリ
領域のデータの消去である。消去すべきデータの量がキ
ャッシュメモリの容量を越える場合,LRU方式による
キャッシュメモリでは,消去を開始する前にキャッシュ
メモリに記録されていた他のデータは,この消去が進む
につれてキャッシュメモリから次々と追い出され,最終
的にキャッシュメモリから全て追い出されてしまう。
(3) Problems Due to Data Attributes As another situation, the nature of data access is as follows.
It may be better to change the cache memory control method. For example, depending on the contents of the data processing, the memory may be sequentially referred to. A typical example is erasure of data in a memory area. When the amount of data to be erased exceeds the capacity of the cache memory, in the cache memory based on the LRU method, other data recorded in the cache memory before the start of erasure is sequentially removed from the cache memory as the erasure progresses. It is evicted and eventually all is evicted from the cache memory.

【0021】このような場合に,キャッシュメモリにデ
ータを経由せずにアクセスを行うことで回避する手法も
ある。しかし,小量のデータ消去の場合と,大量のデー
タ消去の場合とでは,キャッシュメモリを使うか使わな
いかの条件を変えた方がよいことが多いにもかかわら
ず,その制御が困難であるという問題がある。
In such a case, there is a method of avoiding the problem by accessing the cache memory without passing through data. However, in the case of erasing a small amount of data and in the case of erasing a large amount of data, it is often difficult to control whether the cache memory is used or not, but it is difficult to control it. There is a problem.

【0022】また,このような順次アクセスを認識し,
キャッシュメモリに記録されたデータに特殊な印をつ
け,キャッシュメモリからデータを追い出す際に,LR
U制御と合わせてこの印の情報をもとに,追い出すデー
タを決定する方法も知られているが,印をつけるための
領域が必要であること,単純なLRU制御に比べ制御が
複雑になることが問題となる。
Further, such sequential access is recognized,
When a special mark is given to the data recorded in the cache memory and the data is expelled from the cache memory, the LR
There is also known a method of determining data to be kicked out based on the information of the mark together with the U control. However, since an area for marking is required, the control becomes more complicated than simple LRU control. That is a problem.

【0023】本発明は上記問題点の解決を図り,キャッ
シュメモリから追い出すデータを決めるのに使われるL
RU優先度が,キャッシュメモリへのデータの記録また
は再記録の際に,適当な優先度になるように設定するこ
とを可能にすることにより,キャッシュメモリの有効性
を高めることを目的とする。
The present invention solves the above-mentioned problem, and uses L to determine data to be evicted from the cache memory.
An object of the present invention is to increase the effectiveness of a cache memory by enabling the RU priority to be set to an appropriate priority when recording or re-recording data in the cache memory.

【0024】[0024]

【課題を解決するための手段】図1は,本発明の概要を
説明するためのブロック構成例を示す図である。1は本
発明に係るキャッシュメモリ装置,10はキャッシュコ
ントローラ,20はデータを保持するキャッシュメモ
リ,30はデータを操作(読み書き)するプロセッサ,
40はシステムバスを表す。また,11はキャッシュメ
モリ20へのデータの記録および再記録を制御するキャ
ッシュ制御手段,12は導出方式設定手段,13はLR
U優先度決定手段を表す。
FIG. 1 is a diagram showing an example of a block configuration for explaining the outline of the present invention. 1 is a cache memory device according to the present invention, 10 is a cache controller, 20 is a cache memory that holds data, 30 is a processor that operates (reads and writes) data,
Reference numeral 40 denotes a system bus. Reference numeral 11 denotes a cache control unit for controlling recording and re-recording of data in the cache memory 20, 12 denotes a derivation method setting unit, and 13 denotes an LR.
Represents U priority determination means.

【0025】キャッシュメモリ装置1は,キャッシュメ
モリ20に新たにデータを記録する際に,もしくは,キ
ャッシュヒットしてデータを再記録する際に,そのデー
タのLRU優先度を無条件に最高にするのではなく,デ
ータの現在のLRU優先度,そのデータの属性,そのデ
ータへのアクセス手段,プロセッサの状態,またはこれ
らのすべてもしくは一部の情報を用いて,次のLRU優
先度を導出するLRU優先度決定手段13を備え,キャ
ッシュ制御手段11は,このLRU優先度決定手段13
が決定したLRU優先度を持つデータとして,キャッシ
ュメモリ20にデータを記録または再記録する。
When newly recording data in the cache memory 20 or when re-recording data due to a cache hit, the cache memory device 1 unconditionally sets the LRU priority of the data to the highest. Instead, the LRU priority that derives the next LRU priority using the current LRU priority of the data, the attribute of the data, the means for accessing the data, the state of the processor, or all or some of these information The LRU priority determination means 13 includes a LRU priority determination means 13.
Is recorded or re-recorded in the cache memory 20 as data having the determined LRU priority.

【0026】ここで,データのLRU優先度は,キャッ
シュメモリ20からデータを追い出すことが必要になっ
た場合に,どの順番で追い出すかを決めるためのもの
で,最低のLRU優先度を持つデータが最初に追い出さ
れる。また,データの現在のLRU優先度として,キャ
ッシュメモリ20上にないデータは「優先度なし」とい
うLRU優先度を持つデータであるとする。
Here, the data LRU priority is used to determine the order in which data should be evicted from the cache memory 20 when the data needs to be evicted. Be kicked out first. Further, as the current LRU priority of data, it is assumed that data that is not in the cache memory 20 has LRU priority of “no priority”.

【0027】通常の場合,データのLRU優先度が最高
であるとは,他のデータに比べて最も最近に使用された
データであることを意味し,データのLRU優先度が最
低であるとは,他のデータに比べて最も過去に使用され
たデータあることを意味するが,ここでは必ずしもそう
ではない。本明細書では,従来技術との対比において説
明をわかりやすくするために,従来技術におけるLRU
優先度と多少意味が異なるが,機能としては同様である
ので,LRU優先度という言葉を用いる。
Normally, the fact that the data has the highest LRU priority means that the data is the most recently used data compared to other data, and that the data has the lowest LRU priority. , Which means that there is data that has been used in the past in comparison with other data, but this is not necessarily the case here. In this specification, in order to make the explanation easy to understand in comparison with the prior art, the LRU in the prior art is described.
Although the meaning is slightly different from the priority, the function is the same, so the term LRU priority is used.

【0028】また,本発明は,LRU優先度決定手段1
3において,次のLRU優先度を導出するのに使用する
方式を任意に変更・設定することができる導出方式設定
手段12を備え,キャッシュメモリ20にデータを記録
する際に,そのデータのLRU優先度が,キャッシュメ
モリ装置1を使用するシステムまたはそのときに動作し
ているプログラムに応じて適当な優先度になるようにす
る。
The present invention also provides an LRU priority determining means 1
3, a derivation method setting means 12 for arbitrarily changing and setting a method used for deriving the next LRU priority is provided. When data is recorded in the cache memory 20, the LRU priority of the data is set. The priority is set to an appropriate priority according to the system using the cache memory device 1 or the program running at that time.

【0029】キャッシュメモリ装置1のキャッシュコン
トローラ10は,具体的には以下のような構成からな
る。
The cache controller 10 of the cache memory device 1 has the following configuration.

【0030】第1の例では,特に,データのアドレスか
らデータのプライオリティを決定するアドレス解析部を
備え,LRU優先度決定手段13は,キャッシュメモリ
にデータを記録(再記録を含む。以下,同様)する際
に,このアドレス解析部が出力するデータのプライオリ
ティと,データの現在のLRU優先度とを用いて,デー
タの次のLRU優先度を決定する。
In the first example, in particular, an address analysis unit for determining the priority of data from the address of the data is provided, and the LRU priority determination means 13 records the data in the cache memory (including re-recording. The same applies to the following. ), The next LRU priority of the data is determined by using the priority of the data output from the address analysis unit and the current LRU priority of the data.

【0031】第2の例では,特に,プロセッサ30がプ
リフェッチ命令を持つプロセッサである場合に,プロセ
ッサ30からキャッシュメモリ20へのアクセスが,プ
リフェッチ命令によるアクセスであるか否かを識別する
プリフェッチ識別部を備え,LRU優先度決定手段13
は,キャッシュメモリ20にデータを記録する際に,こ
のプリフェッチ識別部の識別結果とデータの現在のLR
U優先度とを用いて,データの次のLRU優先度を決定
する。
In the second example, especially when the processor 30 is a processor having a prefetch instruction, a prefetch identification unit for identifying whether or not the access from the processor 30 to the cache memory 20 is an access by the prefetch instruction. LRU priority determination means 13
When the data is recorded in the cache memory 20, the identification result of the prefetch identification unit and the current LR of the data are used.
The next LRU priority of the data is determined using the U priority.

【0032】第3の例では,特に,プロセッサ30から
キャッシュメモリ20へのこれまでのアクセス履歴に基
づき,プロセッサ30が使用する可能性の高いデータの
アドレスを予測し,そのアドレスのデータを先読みする
プリフェッチ制御部を備え,LRU優先度決定手段13
は,キャッシュメモリ20にデータを記録する際に,こ
のプリフェッチ制御部がロードしたデータであるか否か
と,データの現在のLRU優先度とを用いて,データの
次のLRU優先度を決定する。
In the third example, an address of data likely to be used by the processor 30 is predicted based on the access history of the processor 30 to the cache memory 20 so far, and the data at the address is prefetched. A LRU priority determination unit 13 having a prefetch control unit;
Determines the next LRU priority of the data by using whether or not the data is loaded by the prefetch control unit and the current LRU priority of the data when recording the data in the cache memory 20.

【0033】第4の例では,特に,プロセッサ30から
キャッシュメモリ20へのアクセスを発した命令の種類
を識別する命令識別部を備え,LRU優先度決定手段1
3は,キャッシュメモリ20にデータを記録する際に,
この命令識別部の識別結果とデータの現在のLRU優先
度とを用いて,データの次のLRU優先度を決定する。
In the fourth example, the LRU priority determining means 1 is provided with an instruction identifying unit for identifying the type of an instruction which has issued an access from the processor 30 to the cache memory 20.
3 is for recording data in the cache memory 20;
The next LRU priority of the data is determined using the identification result of the instruction identification unit and the current LRU priority of the data.

【0034】第5の例では,特に,プロセッサ30が投
機的命令実行機能を持ったものである場合に,プロセッ
サ30からキャッシュメモリ20へのアクセスが,プロ
セッサ30が投機的命令実行中に発したアクセスである
か否かを識別する投機実行識別部を備え,LRU優先度
決定手段13は,キャッシュメモリ20にデータを記録
する際に,この投機実行識別部の識別結果と,データの
現在のLRU優先度とを用いて,データの次のLRU優
先度を決定する。
In the fifth example, especially when the processor 30 has a speculative instruction execution function, an access from the processor 30 to the cache memory 20 occurs while the processor 30 executes the speculative instruction. An LRU priority determining means 13 includes a speculative execution identifying unit for identifying whether the access is an access or not. The next LRU priority of the data is determined using the priority.

【0035】第6の例では,バス結合された並列計算機
である場合に,LRU優先度決定手段13は,他プロセ
ッサがバスに要求を出した際に,その他プロセッサが出
した要求の種類と,そのスヌーピングの結果と,データ
の現在のLRU優先度とを用いて,データの次のLRU
優先度を決定し,キャッシュメモリ20にデータを記録
する。
In the sixth example, when a parallel computer is connected to a bus, the LRU priority determining means 13 determines, when another processor issues a request to the bus, the type of request issued by the other processor, Using the result of the snooping and the current LRU priority of the data, the next LRU of the data is used.
The priority is determined, and the data is recorded in the cache memory 20.

【0036】以上の例において,LRU優先度決定手段
13がデータの次のLRU優先度を決定する際には,導
出方式設定手段12によって設定された方式によってL
RU優先度を決定するように構成することができる。
In the above example, when the LRU priority determining means 13 determines the next LRU priority of the data, the LRU priority is determined according to the method set by the derivation method setting means 12.
It can be configured to determine RU priority.

【0037】このように,本発明では,プリフェッチや
投機処理により,使用しないかもしれないデータがキャ
ッシュメモリ20に記録される場合に,本当に必要なデ
ータがキャッシュメモリ20上から追い出されることを
防ぐことが可能となり,キャッシュメモリ20の有効性
が向上する。さらに,キャッシュメモリ20においてL
RU優先度を記録する手法は従来と同様であるため,L
RU優先度を記録するために必要な記憶容量は増加する
ことはない。
As described above, according to the present invention, when data that may not be used is recorded in the cache memory 20 by prefetching or speculative processing, it is possible to prevent the really necessary data from being evicted from the cache memory 20. And the effectiveness of the cache memory 20 is improved. Further, in the cache memory 20, L
Since the method of recording the RU priority is the same as the conventional one,
The storage capacity required to record the RU priority does not increase.

【0038】例えば,キャッシュメモリ20に新たにデ
ータを記録する際,従来の手法では,そのデータをLR
U優先度が最高のデータとして記録するが,そのデータ
がプリフェッチにより得られたデータであれば,LRU
優先度が最低のデータとして記録するのである。これに
より,たとえプリフェッチで得たデータをプロセッサ3
0が実際には使用しなかったとしても,データはキャッ
シュメモリ20から追い出され易い状態で記録してある
ため,キャッシュメモリ20の容量を無駄にする割合が
減り,有効性を損ねる可能性も下がる。
For example, when new data is recorded in the cache memory 20, the data is stored in the LR
The U priority is recorded as the highest data. If the data is obtained by prefetching, the LRU
The data with the lowest priority is recorded. As a result, even if the data obtained by the prefetch is
Even if 0 is not actually used, data is recorded in a state where it is easily evicted from the cache memory 20. Therefore, the ratio of wasting capacity of the cache memory 20 is reduced, and the possibility of losing effectiveness is reduced. .

【0039】あるいは,順次アクセスが行なわれる場合
においては,一度アクセスしたデータは後から参照され
る可能性が低い。しかし,次々と新しいデータをアクセ
スするため,従来のLRU方式による制御では,キャッ
シュメモリ20はこの順次アクセスによって得られたデ
ータで埋め尽くされ,キャッシュメモリ20に記録され
ていた他のデータは追い出されてしまう。したがって,
本発明では,順次アクセスによって得られたはデータ
は,例えばLRU優先度が最低位とその次の優先度のみ
に設定するとして記録することにより,もし4ウェイセ
ットアソシアティブ・キャッシュメモリを用いていると
すると,全キャッシュメモリ容量の2/4を越えない範
囲でのみデータを記録するといった制限を課すこともで
きる。
Alternatively, in the case where sequential access is performed, it is unlikely that data once accessed will be referred to later. However, in order to access new data one after another, in the control by the conventional LRU method, the cache memory 20 is filled with the data obtained by the sequential access, and the other data recorded in the cache memory 20 is evicted. Would. Therefore,
According to the present invention, data obtained by sequential access is recorded, for example, assuming that the LRU priority is set to only the lowest priority and the next priority, so that the 4-way set associative cache memory is used. Then, it is possible to impose a limitation that data is recorded only in a range not exceeding 2/4 of the total cache memory capacity.

【0040】図2は,本発明の動作原理を説明するため
の図である。図2には,図18に示す場合と同様に,キ
ャッシュメモリ20に,LRU優先度の高い順に,デー
タD,データC,データB,データAが記録されている
状態で,データEをプリフェッチした後,プロセッサ3
0が順番にデータA,データB,データC,データDを
操作した場合の動作例を示している。図18に示す場合
の動作と違うのは,本発明では,プリフェッチするデー
タEを,LRU優先度が最低のデータとしてキャッシュ
メモリ20に記録することである。
FIG. 2 is a diagram for explaining the operation principle of the present invention. In FIG. 2, as in the case shown in FIG. 18, data E is prefetched in a state where data D, data C, data B, and data A are recorded in the cache memory 20 in descending order of LRU priority. Later, processor 3
0 indicates an operation example when data A, data B, data C, and data D are sequentially operated. The difference from the operation in the case shown in FIG. 18 is that, in the present invention, the data E to be prefetched is recorded in the cache memory 20 as data having the lowest LRU priority.

【0041】図2に示すとおり,本発明では,データE
のLRU優先度を低く設定してプリフェッチを行う。デ
ータEをプリフェッチする際に,データAがキャッシュ
メモリ20から追い出されてしまい,次のデータAの操
作の場合には,データAはキャッシュミスヒットとな
る。しかし,プリフェッチしたデータEのLRU優先度
を低く設定することで,データAの操作の場合にLRU
優先度の低いデータEを追い出すこととなり,次のデー
タBの操作は,キャッシュヒットとなる。続くデータ
C,データDの操作もキャッシュヒットとなる。
As shown in FIG. 2, in the present invention, the data E
The LRU priority is set low and prefetch is performed. When prefetching the data E, the data A is evicted from the cache memory 20, and in the case of the next operation of the data A, the data A becomes a cache miss. However, by setting the LRU priority of the prefetched data E low, the LRU
The data E having the lower priority is evicted, and the next operation on the data B results in a cache hit. Subsequent operations on data C and data D also result in cache hits.

【0042】図18に示す場合には,全操作がキャッシ
ュミスヒットとなっていたのと比較すると,本発明によ
り,キャッシュメモリ20の有効率が改善されることが
わかる。
In the case shown in FIG. 18, it can be seen that the effectiveness of the cache memory 20 is improved by the present invention as compared with the case where all the operations result in cache misses.

【0043】[0043]

【発明の実施の形態】以下に,本発明のいくつかの実施
の形態を順に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Several embodiments of the present invention will be described below in order.

【0044】(1)第1の実施の形態 図3は,本発明の第1の実施の形態のブロック構成図で
ある。本例では,キャッシュメモリ装置100のキャッ
シュコントローラ110に,データのアドレスからデー
タのプライオリティを決定するアドレス解析部114
と,データのプライオリティと現LRU優先度から次L
RU優先度を決定するLRU優先度決定部116を備え
る。導出方式設定部118は,レンジレジスタ115お
よびLRU優先度テーブル117に値を設定する手段で
あり,後述するように,これに対する値の設定によって
LRU優先度の導出方式を変えることができる。すなわ
ち,どのような状態のときにLRU優先度をどのような
値にするかを,レンジレジスタ115およびLRU優先
度テーブル117への値の設定によって変更することが
できる。
(1) First Embodiment FIG. 3 is a block diagram of a first embodiment of the present invention. In this example, the cache controller 110 of the cache memory device 100 has an address analysis unit 114 that determines the priority of data from the address of the data.
And the next L based on the data priority and the current LRU priority
An LRU priority determining unit 116 that determines an RU priority is provided. The derivation method setting unit 118 is a means for setting a value in the range register 115 and the LRU priority table 117. As described later, the derivation method of the LRU priority can be changed by setting a value for this. In other words, what value the LRU priority is set to in what state can be changed by setting the values in the range register 115 and the LRU priority table 117.

【0045】キャッシュ制御管理部112は,キャッシ
ュコントローラ110における主な制御を行う部分であ
り,キャッシュメモリ120へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部112の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)111は,プ
ロセッサ130とキャッシュ制御管理部112との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)113は,シス
テムバス140を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 112 is a part that performs main control in the cache controller 110, and controls recording (or re-recording) of data in the cache memory 120. The internal structure of the cache control management unit 112 is basically the same as the conventional one. The processor interface (processor IF) 111 is an interface for exchanging data and control signals between the processor 130 and the cache control management unit 112, and the bus interface (bus IF) 113 is connected to a main memory (system IF) via a system bus 140. (Not shown) for exchanging data and control signals.

【0046】データをキャッシュメモリ120に記録
(もしくは再記録)する際には,まず,アドレス解析部
114が,データのプライオリティを決定する。具体的
には,アドレス解析部114は,アドレス範囲,および
その範囲のプライオリティを記録するレジスタセットで
あるレンジレジスタ115を備え,レンジレジスタ11
5に記録された値に基づき,データのアドレスからデー
タのプライオリティを導出する。なお,レンジレジスタ
115に記録されている値は,任意に設定することが可
能であり,または,予め定められた値とすることも可能
である。
When recording (or re-recording) data in the cache memory 120, first, the address analysis unit 114 determines the priority of the data. Specifically, the address analysis unit 114 includes a range register 115 which is a register set for recording an address range and a priority of the range.
Based on the value recorded in 5, the priority of the data is derived from the address of the data. The value recorded in the range register 115 can be set arbitrarily, or can be a predetermined value.

【0047】次に,LRU優先度決定部116が,その
データの次LRU優先度を決定する。具体的には,LR
U優先度決定部116は,図4に示すようなLRU優先
度テーブル117を参照し,LRU優先度テーブル11
7に記録された値に基づき,現LRU優先度とアドレス
解析部114が判定したデータのプライオリティから次
LRU優先度を決定する。ここでは,LRU優先度テー
ブル117は,データのプライオリティが高い(Hig
h)なら,現LRU優先度にかかわらず高いLRU優先
度(=3)を設定し,データのプライオリティが中程度
(Middle)なら,現LRU優先度(3,2,1,
0,なし)に応じて,(3,2,1,1,1)を設定
し,データのプライオリティが低度(Low)なら,現
LRU優先度(3,2,1,0,なし)に応じて,
(3,2,1,0,0)を設定するようにしている。な
お,LRU優先度テーブル117に記録されている値
は,導出方式設定部118によって,任意に設定するこ
とが可能である。または,予め定められた値とすること
も可能である。導出方式設定部118の実現方法として
は,例えばプロセッサ130から初期設定時もしくはプ
ログラムの起動時に値を設定する方法,あるいはキャッ
シュメモリ装置100の実装時にROM等を用いてLR
U優先度テーブル117を組み込む方法などが考えられ
る。
Next, the LRU priority determining section 116 determines the next LRU priority of the data. Specifically, LR
The U priority determining unit 116 refers to the LRU priority table 117 as shown in FIG.
7, the next LRU priority is determined from the current LRU priority and the priority of the data determined by the address analysis unit 114. Here, the LRU priority table 117 indicates that the priority of the data is high (Hig
h), a high LRU priority (= 3) is set irrespective of the current LRU priority, and if the data priority is medium (Middle), the current LRU priority (3, 2, 1, 1)
(3,2,1,1,1) is set in accordance with (0, none), and if the priority of data is low (Low), the current LRU priority (3, 2, 1, 0, none) is set. Depending on,
(3, 2, 1, 0, 0) is set. The values recorded in the LRU priority table 117 can be arbitrarily set by the derivation method setting unit 118. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 118, for example, a method of setting a value at the time of initial setting or at the time of starting a program from the processor 130, or at the time of mounting the cache memory device 100 using a ROM
A method of incorporating the U priority table 117 is conceivable.

【0048】最後に,キャッシュ制御管理部112が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ120に記録
(もしくは再記録)する。
Finally, the cache control management unit 112
The data is recorded (or re-recorded) in the cache memory 120 as data having the LRU priority obtained by the above procedure.

【0049】(2)第2の実施の形態 図5は,本発明の第2の実施の形態のブロック構成図で
ある。本例では,キャッシュメモリ装置200のキャッ
シュコントローラ210に,データのアドレスからデー
タのプライオリティを決定するアドレス解析部214
と,データのプライオリティと現LRU優先度から次L
RU優先度を決定するLRU優先度決定部216を備え
る。導出方式設定部218は,ページテーブル215の
一部およびLRU優先度テーブル217に値を設定する
手段であり,後述するように,これに対する値の設定に
よってLRU優先度の導出方式を変えることができる。
(2) Second Embodiment FIG. 5 is a block diagram of a second embodiment of the present invention. In this example, the cache controller 210 of the cache memory device 200 has an address analysis unit 214 that determines the priority of data from the address of the data.
And the next L based on the data priority and the current LRU priority
An LRU priority determining unit 216 for determining an RU priority is provided. The derivation method setting unit 218 is means for setting a value in a part of the page table 215 and the LRU priority table 217. As described later, the derivation method of the LRU priority can be changed by setting a value for this. .

【0050】キャッシュ制御管理部212は,キャッシ
ュコントローラ210における主な制御を行う部分であ
り,キャッシュメモリ220へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部212の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)211は,プ
ロセッサ230とキャッシュ制御管理部212との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)213は,シス
テムバス240を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 212 is a part that performs main control in the cache controller 210, and controls recording (or re-recording) of data in the cache memory 220. The internal structure of the cache control management unit 212 is basically the same as the conventional one. The processor interface (processor IF) 211 is an interface for exchanging data and control signals between the processor 230 and the cache control management unit 212. The bus interface (bus IF) 213 is connected to the main memory (system IF) via the system bus 240. (Not shown) for exchanging data and control signals.

【0051】データをキャッシュメモリ220に記録
(もしくは再記録)する際には,まず,アドレス解析部
214がデータのプライオリティを決定する。具体的に
は,ページテーブル215の各エントリには,ページの
プライオリティを示すフィールドが付与されており,ア
ドレス解析部214は,ページテーブル215を検索
し,データのアドレスに対応するページエントリのプラ
イオリティ・フィールド値をそのデータのプライオリテ
ィとする。なお,ページエントリのプライオリティ値は
任意に設定することが可能であり,または,予め定めら
れた値とすることも可能である。
When recording (or re-recording) data in the cache memory 220, first, the address analysis unit 214 determines the priority of the data. More specifically, each entry of the page table 215 is provided with a field indicating the priority of the page. The address analysis unit 214 searches the page table 215 and determines the priority of the page entry corresponding to the address of the data. The field value is the priority of the data. The priority value of the page entry can be set arbitrarily, or can be set to a predetermined value.

【0052】次に,LRU優先度決定部216が,その
データの次LRU優先度を決定する。具体的には,LR
U優先度決定部216は,図6に示すようなLRU優先
度テーブル217を参照し,LRU優先度テーブル21
7に記録された値に基づき,現LRU優先度とアドレス
解析部214が判定したデータのプライオリティから次
LRU優先度を決定する。ここでは,LRU優先度テー
ブル217は,データのプライオリティが高い(Hig
h)なら,現LRU優先度にかかわらず高いLRU優先
度を設定し,データのプライオリティが中程度(Mid
dle)なら,現LRU優先度(3,2,1,0,な
し)に応じて,(2,2,1,1,1)を設定し,デー
タのプライオリティが低度(Low)なら,現LRU優
先度(3,2,1,0,なし)に応じて,(1,1,
1,0,0)を設定するようにしている。なお,LRU
優先度テーブル217に記録されている値は,導出方式
設定部218によって,任意に設定することが可能であ
る。または,予め定められた値とすることも可能であ
る。導出方式設定部218の実現方法としては,例えば
プロセッサ230から初期設定時もしくはプログラムの
起動時に値を設定する方法,あるいはキャッシュメモリ
装置200の実装時にROM等を用いてLRU優先度テ
ーブル217を組み込む方法などが考えられる。
Next, the LRU priority determining section 216 determines the next LRU priority of the data. Specifically, LR
The U priority determining unit 216 refers to the LRU priority table 217 as shown in FIG.
7, the next LRU priority is determined from the current LRU priority and the priority of the data determined by the address analysis unit 214. Here, the LRU priority table 217 indicates that the priority of the data is high (Hig
h), a high LRU priority is set regardless of the current LRU priority, and the data priority is medium (Mid
dle), (2, 2, 1, 1, 1) is set according to the current LRU priority (3, 2, 1, 0, none), and if the data priority is low (Low), Depending on the LRU priority (3, 2, 1, 0, none), (1,1,
(1, 0, 0). In addition, LRU
The value recorded in the priority table 217 can be arbitrarily set by the derivation method setting unit 218. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 218, for example, a method of setting a value at the time of initial setting or program startup from the processor 230, or a method of incorporating the LRU priority table 217 using a ROM or the like at the time of mounting the cache memory device 200 And so on.

【0053】最後に,キャッシュ制御管理部212が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ220に記録
(もしくは再記録)する。
Finally, the cache control management unit 212
The data is recorded (or re-recorded) in the cache memory 220 as data having the LRU priority obtained by the above procedure.

【0054】なお,ページテーブル215にデータのプ
ライオリティを示すプライオリティ・フィールドを設け
るだけではなく,仮想記憶のメモリマッピングの高速化
に使用するTLB(Translation Lookaside Buffer)にも
プライオリティ・フィールドを設け,これを利用するこ
とで,同様にLRU優先度更新を高速化することが可能
である。
It is to be noted that not only a priority field indicating the priority of data is provided in the page table 215, but also a priority field is provided in a TLB (Translation Lookaside Buffer) used for speeding up the memory mapping of the virtual memory. By using this, it is possible to speed up LRU priority update similarly.

【0055】(3)第3の実施の形態 図7は,本発明の第3の実施の形態のブロック構成図で
ある。本例におけるプロセッサ330は,その命令セッ
トにデータプリフェッチ用の命令を備えた装置である。
キャッシュメモリ装置300のキャッシュコントローラ
310は,プリフェッチ命令によるアクセスか否かを識
別するプリフェッチ識別部314と,プリフェッチ識別
部314の識別結果とデータの現在のLRU優先度から
次LRU優先度を決定するLRU優先度決定部316を
備える。導出方式設定部318は,LRU優先度テーブ
ル317に値を設定する手段であり,後述するように,
これに対する値の設定によってLRU優先度の導出方式
を変えることができる。
(3) Third Embodiment FIG. 7 is a block diagram of a third embodiment of the present invention. The processor 330 in this example is a device provided with an instruction for data prefetch in its instruction set.
The cache controller 310 of the cache memory device 300 includes a prefetch identification unit 314 for identifying whether the access is performed by a prefetch instruction, and an LRU for determining the next LRU priority from the identification result of the prefetch identification unit 314 and the current LRU priority of the data. A priority determining unit 316 is provided. The derivation method setting unit 318 is means for setting a value in the LRU priority table 317, and as described later,
By setting a value for this, the method of deriving the LRU priority can be changed.

【0056】キャッシュ制御管理部312は,キャッシ
ュコントローラ310における主な制御を行う部分であ
り,キャッシュメモリ320へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部312の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)311は,プ
ロセッサ330とキャッシュ制御管理部312との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)313は,シス
テムバス340を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 312 is a part that performs main control in the cache controller 310, and controls recording (or re-recording) of data in the cache memory 320. The internal structure of the cache control management unit 312 is basically the same as the conventional one. The processor interface (processor IF) 311 is an interface for exchanging data and control signals between the processor 330 and the cache control management unit 312, and the bus interface (bus IF) 313 is connected to the main memory (system bus 340) via the system bus 340. (Not shown) for exchanging data and control signals.

【0057】データをキャッシュメモリ320に記録
(もしくは再記録)する際には,まず,プリフェッチ識
別部314が,そのデータへのアクセスがプロセッサ3
30のプリフェッチ命令によるものなのか否かを識別す
る。具体的には,プロセッサ330からキャッシュメモ
リ装置300へプリフェッチ命令によるアクセスか否か
を通知する信号線が存在し,その信号線のシグナルによ
り,プリフェッチ識別部314は,プリフェッチ命令に
よるアクセスか否かを識別する。
When recording (or re-recording) data in the cache memory 320, first, the prefetch identification unit 314 determines whether the access to the data is
It is determined whether or not this is due to 30 prefetch instructions. Specifically, there is a signal line for notifying the cache memory device 300 of the access by the prefetch instruction or not from the processor 330, and the signal of the signal line allows the prefetch identification unit 314 to determine whether or not the access is by the prefetch instruction. Identify.

【0058】次に,LRU優先度決定部316がそのデ
ータの次LRU優先度を決定する。具体的には,LRU
優先度決定部316は,例えば図8に示すようなLRU
優先度テーブル317を参照し,LRU優先度テーブル
317に記録された値に基づき,現LRU優先度とプリ
フェッチ識別部314の識別結果から次LRU優先度を
決定する。
Next, the LRU priority determining section 316 determines the next LRU priority of the data. Specifically, LRU
For example, the priority determining unit 316 performs LRU as shown in FIG.
With reference to the priority table 317, the next LRU priority is determined from the current LRU priority and the identification result of the prefetch identification unit 314 based on the value recorded in the LRU priority table 317.

【0059】ここでは,LRU優先度テーブル317
は,プリフェッチ命令のアクセスである場合には,現L
RU優先度に応じたLRU優先度(ただし,優先度なし
の場合,最低レベルの優先度=0)を設定し,プリフェ
ッチ命令のアクセスではない場合には,現LRU優先度
にかかわらず高いLRU優先度を設定するようにしてい
る。なお,LRU優先度テーブル317に記録されてい
る値は,導出方式設定部318によって,任意に設定す
ることが可能である。または,予め定められた値とする
ことも可能である。導出方式設定部318の実現方法と
しては,例えばプロセッサ330から初期設定時もしく
はプログラムの起動時に値を設定する方法,あるいはキ
ャッシュメモリ装置300の実装時にROM等を用いて
LRU優先度テーブル317を組み込む方法などが考え
られる。
Here, the LRU priority table 317
Is the current L if the access is for a prefetch instruction.
Set the LRU priority according to the RU priority (however, if there is no priority, the lowest priority = 0), and if the access is not a prefetch instruction, the LRU priority is high regardless of the current LRU priority. The degree is set. Note that the values recorded in the LRU priority table 317 can be arbitrarily set by the derivation method setting unit 318. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 318, for example, a method of setting a value at the time of initial setting or starting of a program from the processor 330, or a method of incorporating the LRU priority table 317 using a ROM or the like at the time of mounting the cache memory device 300 And so on.

【0060】最後に,キャッシュ制御管理部312が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ320に記録
(もしくは再記録)する。
Finally, the cache control management unit 312
The data is recorded (or re-recorded) in the cache memory 320 as data having the LRU priority obtained by the above procedure.

【0061】(4)第4の実施の形態 図9は,本発明の第4の実施の形態のブロック構成図で
ある。本例では,キャッシュメモリ装置400のキャッ
シュコントローラ410は,プロセッサ430に先んじ
てデータの先読みを実行するプリフェッチ制御部414
と,プリフェッチするデータのアドレスを決定するアド
レス予測部415と,データの次LRU優先度を決定す
るLRU優先度決定部416とを備える。導出方式設定
部418は,LRU優先度テーブル417に値を設定す
る手段であり,後述するように,これに対する値の設定
によって,LRU優先度の導出方式を変えることができ
る。
(4) Fourth Embodiment FIG. 9 is a block diagram of a fourth embodiment of the present invention. In the present example, the cache controller 410 of the cache memory device 400 executes a prefetch control unit 414 that executes prefetching of data prior to the processor 430.
And an address prediction unit 415 for determining the address of the data to be prefetched, and an LRU priority determination unit 416 for determining the next LRU priority of the data. The derivation method setting unit 418 is means for setting a value in the LRU priority table 417. As described later, the derivation method of the LRU priority can be changed by setting a value for this.

【0062】キャッシュ制御管理部412は,キャッシ
ュコントローラ410における主な制御を行う部分であ
り,キャッシュメモリ420へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部412の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)411は,プ
ロセッサ430とキャッシュ制御管理部412との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)413は,シス
テムバス440を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 412 is a part that performs main control in the cache controller 410, and controls recording (or re-recording) of data in the cache memory 420. The internal structure of the cache control management unit 412 is basically the same as the conventional one. A processor interface (processor IF) 411 is an interface for exchanging data and control signals between the processor 430 and the cache control management unit 412, and a bus interface (bus IF) 413 is connected to a main memory (system IF) via a system bus 440. (Not shown) for exchanging data and control signals.

【0063】アドレス予測部415は,これまでのプロ
セッサ430のアクセス履歴に基づき,先読みすべきデ
ータのアドレスを決定する。プリフェッチ制御部414
は,このアドレス予測部415が導き出したアドレスの
データを先読みすべきか否かを決定・実行する。
The address prediction unit 415 determines the address of the data to be pre-read based on the access history of the processor 430 so far. Prefetch control unit 414
Determines and executes whether or not the data of the address derived by the address prediction unit 415 should be read ahead.

【0064】プロセッサ430のアクセス,もしくは,
プリフェッチ制御部414のアクセスにより,データを
キャッシュメモリ420に記録(もしくは再記録)する
際には,LRU優先度決定部416がデータの次LRU
優先度を決定する。具体的には,LRU優先度決定部4
16は,図10に示すようなLRU優先度テーブル41
7を参照し,LRU優先度テーブル417に記録された
値に基づき,現LRU優先度とプリフェッチ制御部41
4からのプリフェッチによるアクセスか否かを示す情報
とから,次LRU優先度を決定する。ここでは,LRU
優先度テーブル417は,プリフェッチ制御部414に
よるアクセスである場合には,現LRU優先度に応じた
LRU優先度(ただし,優先度なしの場合,最低レベル
の優先度=0)を設定し,プリフェッチ制御部414に
よるアクセスではない場合には,現LRU優先度にかか
わらず高いLRU優先度を設定するようにしている。
Access of the processor 430, or
When data is recorded (or re-recorded) in the cache memory 420 by the access of the prefetch control unit 414, the LRU priority determination unit 416 determines the next LRU of the data.
Determine priority. Specifically, the LRU priority determination unit 4
16 is an LRU priority table 41 as shown in FIG.
7, the current LRU priority and the prefetch control unit 41 based on the value recorded in the LRU priority table 417.
Then, the next LRU priority is determined from the information indicating whether or not the access is made by prefetching from L4. Here, LRU
In the priority table 417, when the access is performed by the prefetch control unit 414, the LRU priority according to the current LRU priority (however, if there is no priority, the lowest priority = 0) is set. When the access is not by the control unit 414, a high LRU priority is set regardless of the current LRU priority.

【0065】なお,LRU優先度テーブル417に記録
されている値は,導出方式設定部418によって,任意
に設定することが可能である。または,予め定められた
値とすることも可能である。導出方式設定部418の実
現方法としては,例えばプロセッサ430から初期設定
時もしくはプログラムの起動時に値を設定する方法,あ
るいはキャッシュメモリ装置400の実装時にROM等
を用いてLRU優先度テーブル417を組み込む方法な
どが考えられる。
Note that the values recorded in the LRU priority table 417 can be arbitrarily set by the derivation method setting unit 418. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 418, for example, a method of setting a value at the time of initial setting or program startup from the processor 430, or a method of incorporating the LRU priority table 417 using a ROM or the like at the time of mounting the cache memory device 400 And so on.

【0066】最後に,キャッシュ制御管理部412が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ420に記録
(もしくは再記録)する。
Finally, the cache control management unit 412
The data is recorded (or re-recorded) in the cache memory 420 as data having the LRU priority obtained by the above procedure.

【0067】(5)第5の実施の形態 図11は,本発明の第5の実施の形態のブロック構成図
である。本例では,プロセッサ530は命令を out-of-
order で実行する投機的命令実行部531を備える。キ
ャッシュメモリ装置500のキャッシュコントローラ5
10は,特に,投機的命令実行中のアクセスか否かを識
別する投機実行識別部514と,次LRU優先度を決定
するLRU優先度決定部516とを備える。導出方式設
定部518は,LRU優先度テーブル517に値を設定
する手段であり,後述するように,これに対する値の設
定によって,LRU優先度の導出方式を変えることがで
きる。
(5) Fifth Embodiment FIG. 11 is a block diagram of a fifth embodiment of the present invention. In this example, the processor 530 sends out-of-of-
It has a speculative instruction execution unit 531 that executes in order. Cache controller 5 of cache memory device 500
In particular, the LRU 10 includes a speculative execution identifying unit 514 for identifying whether an access is being performed during speculative instruction execution and an LRU priority determining unit 516 for determining the next LRU priority. The derivation method setting unit 518 is a unit that sets a value in the LRU priority table 517. As described later, the derivation method of the LRU priority can be changed by setting a value for this.

【0068】キャッシュ制御管理部512は,キャッシ
ュコントローラ510における主な制御を行う部分であ
り,キャッシュメモリ520へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部512の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)511は,プ
ロセッサ530とキャッシュ制御管理部512との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)513は,シス
テムバス540を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 512 is a part for performing main control in the cache controller 510, and controls recording (or re-recording) of data in the cache memory 520. The internal structure of the cache control management unit 512 is basically the same as the conventional one. A processor interface (processor IF) 511 is an interface for exchanging data and control signals between the processor 530 and the cache control management unit 512, and a bus interface (bus IF) 513 is provided via a system bus 540 for main storage ( (Not shown) for exchanging data and control signals.

【0069】データをキャッシュメモリ520に記録
(もしくは再記録)する際には,まず,投機実行識別部
514が,そのデータへのアクセスがプロセッサが投機
的命令実行中に出したアクセスか否かを識別する。具体
的には,プロセッサ530からキャッシュメモリ装置5
00へ,投機的命令実行中であるか否かを通知する信号
線が存在し,その信号線のシグナルにより,投機実行識
別部514は,投機的命令実行中に生じたアクセスか否
かを判定する。
When recording (or re-recording) data in the cache memory 520, first, the speculative execution identifying unit 514 determines whether or not the access to the data is an access issued during execution of the speculative instruction by the processor. Identify. Specifically, the processor 530 sends the cache memory device 5
00, there is a signal line for notifying whether or not the speculative instruction is being executed, and the speculative execution identifying unit 514 determines whether or not the access has occurred during the execution of the speculative instruction based on the signal of the signal line. I do.

【0070】次に,LRU優先度決定部516がそのデ
ータの次LRU優先度を決定する。具体的には,LRU
優先度決定部516は,図12に示すようなLRU優先
度テーブル517を参照し,LRU優先度テーブル51
7に記録された値に基づき,現LRU優先度と投機実行
識別部514の識別結果から次LRU優先度値を決定す
る。ここでは,LRU優先度テーブル517は,投機的
命令実行中のアクセスである場合には,現LRU優先度
に応じたLRU優先度(ただし,優先度なしの場合,最
低レベルの優先度=0)を設定し,投機的命令実行中の
アクセスではない場合には,現LRU優先度にかかわら
ず高いLRU優先度を設定するようにしている。
Next, the LRU priority determining section 516 determines the next LRU priority of the data. Specifically, LRU
The priority determining unit 516 refers to the LRU priority table 517 as shown in FIG.
7, the next LRU priority value is determined from the current LRU priority and the result of identification by the speculative execution identification unit 514. Here, the LRU priority table 517 indicates that the LRU priority according to the current LRU priority when the access is during execution of a speculative instruction (however, when there is no priority, the lowest priority = 0) Is set, and when the access is not during execution of a speculative instruction, a high LRU priority is set regardless of the current LRU priority.

【0071】なお,LRU優先度テーブル517に記録
されている値は,導出方式設定部518によって,任意
に設定することが可能である。または,予め定められた
値とすることも可能である。導出方式設定部518の実
現方法としては,例えばプロセッサ530から初期設定
時もしくはプログラムの起動時に値を設定する方法,あ
るいはキャッシュメモリ装置500の実装時にROM等
を用いてLRU優先度テーブル517を組み込む方法な
どが考えられる。
The values recorded in the LRU priority table 517 can be arbitrarily set by the derivation method setting unit 518. Alternatively, it may be a predetermined value. As a method of implementing the derivation method setting unit 518, for example, a method of setting a value at the time of initial setting or program startup from the processor 530, or a method of incorporating the LRU priority table 517 using a ROM or the like at the time of mounting the cache memory device 500 And so on.

【0072】最後に,キャッシュ制御管理部512が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ520に記録
(もしくは再記録)する。
Finally, the cache control management unit 512
The data is recorded (or re-recorded) in the cache memory 520 as data having the LRU priority obtained by the above procedure.

【0073】(6)第6の実施の形態 図13は,本発明の第6の実施の形態のブロック構成図
である。本例では,キャッシュメモリ装置600のキャ
ッシュコントローラ610は,アクセスの発生原因であ
るプロセッサの命令種類を識別する命令識別部614
と,データの次LRU優先度を決定するLRU優先度決
定部616とを備える。導出方式設定部618は,LR
U優先度テーブル617に値を設定する手段であり,後
述するように,これに対する値の設定によって,LRU
優先度の導出方式を変えることができる。
(6) Sixth Embodiment FIG. 13 is a block diagram of a sixth embodiment of the present invention. In the present example, the cache controller 610 of the cache memory device 600 has an instruction identification unit 614 that identifies the instruction type of the processor that is the cause of the access.
And an LRU priority determining unit 616 for determining the next LRU priority of the data. The derivation method setting unit 618 determines the
This is a means for setting a value in the U priority table 617. As described later, the LRU is set by setting a value for this.
The method of deriving the priority can be changed.

【0074】キャッシュ制御管理部612は,キャッシ
ュコントローラ610における主な制御を行う部分であ
り,キャッシュメモリ620へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部612の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)611は,プ
ロセッサ630とキャッシュ制御管理部612との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)613は,シス
テムバス640を介して主記憶(図示省略)との間でデ
ータおよび制御信号をやりとりするインタフェースであ
る。
The cache control management unit 612 is a part that performs main control in the cache controller 610, and controls recording (or re-recording) of data in the cache memory 620. The internal structure of the cache control management unit 612 is basically the same as the conventional one. A processor interface (processor IF) 611 is an interface for exchanging data and control signals between the processor 630 and the cache control management unit 612, and a bus interface (bus IF) 613 is provided via a system bus 640 for main storage ( (Not shown) for exchanging data and control signals.

【0075】データをキャッシュメモリ620に記録
(もしくは再記録)する際には,まず,命令識別部61
4が,データ・アクセスの起因となったプロセッサの命
令種類を識別する。具体的には,プロセッサ630から
キャッシュメモリ装置600へ,プロセッサの命令種類
を通知する信号線が存在し,その信号線のシグナルによ
り,命令識別部614は,プロセッサ630の命令の種
類を識別・判定する。
When recording (or re-recording) data in the cache memory 620, first, the instruction identification unit 61
4 identifies the instruction type of the processor that caused the data access. Specifically, there is a signal line for notifying the instruction type of the processor from the processor 630 to the cache memory device 600, and the instruction identification unit 614 identifies and determines the type of the instruction of the processor 630 according to the signal of the signal line. I do.

【0076】次に,LRU優先度決定部616がデータ
の次LRU優先度を決定する。具体的には,LRU優先
度決定部616は,図14に示すようなLRU優先度テ
ーブル617を参照し,LRU優先度テーブル617に
記録された値に基づき,現LRU優先度と命令識別部6
14の識別結果から次LRU優先度を決定する。
Next, the LRU priority determining section 616 determines the next LRU priority of the data. Specifically, the LRU priority determination unit 616 refers to the LRU priority table 617 as shown in FIG. 14 and, based on the value recorded in the LRU priority table 617, determines the current LRU priority and the instruction identification unit 6.
The next LRU priority is determined from the identification result of No. 14.

【0077】ここでは,LRU優先度テーブル617
は,命令がプリフェッチであるならば,現LRU優先度
に応じたLRU優先度(ただし,優先度なしの場合,最
低レベルの優先度=0)を設定し,命令がブロック転送
であるならば,比較的低いLRU優先度を設定し,それ
以外の命令であるならば,現LRU優先度にかかわらず
高いLRU優先度を設定するようにしている。
Here, the LRU priority table 617
Sets the LRU priority according to the current LRU priority if the instruction is prefetch (however, if there is no priority, the lowest priority = 0), and if the instruction is a block transfer, A relatively low LRU priority is set, and for other instructions, a high LRU priority is set regardless of the current LRU priority.

【0078】なお,LRU優先度テーブル617に記録
されている値は,導出方式設定部618が,任意に設定
することが可能である。または,予め定められた値とす
ることも可能である。導出方式設定部618の実現方法
としては,例えばプロセッサ630から初期設定時もし
くはプログラムの起動時に値を設定する方法,あるいは
キャッシュメモリ装置600の実装時にROM等を用い
てLRU優先度テーブル617を組み込む方法などが考
えられる。
The values recorded in the LRU priority table 617 can be arbitrarily set by the derivation method setting unit 618. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 618, for example, a method of setting a value at the time of initial setting or program startup from the processor 630, or a method of incorporating the LRU priority table 617 using a ROM or the like at the time of mounting the cache memory device 600 And so on.

【0079】最後に,キャッシュ制御管理部612が,
上記の手順により求められたLRU優先度を持つデータ
として,そのデータをキャッシュメモリ620に記録
(もしくは再記録)する。
Finally, the cache control management unit 612
The data is recorded (or re-recorded) in the cache memory 620 as data having the LRU priority determined by the above procedure.

【0080】なお,公知技術としてプロセッサの命令セ
ットを拡張し,メモリ操作命令にレベルを付与し,その
レベルによりLRU優先度設定方法を変更する方式があ
るが,本発明では,命令セットを拡張することなく,既
存の命令種類によってLRU優先度設定方法を変更する
ものであり,前記公知技術とは異なる。
As a well-known technique, there is a method of extending an instruction set of a processor, assigning a level to a memory operation instruction, and changing an LRU priority setting method according to the level. In the present invention, the instruction set is extended. Without changing the LRU priority setting method according to the existing instruction type, this is different from the above-mentioned known technology.

【0081】(7)第7の実施の形態 図15は,本発明の第7の実施の形態のブロック構成図
である。本例のシステム構成は,システムバス740に
より複数のプロセッサが結合されたバス結合型の並列計
算機であり,バスはスヌーピングバスで,キャッシュの
コヒーレンスプロトコルは無効化型である。キャッシュ
メモリ装置700は,各プロセッサとシステムバス74
0との間に位置し(またはプロセッサ内蔵でもよい),
他プロセッサノード750のバス要求を傍受する他プロ
セッサバス要求傍受部714と,次LRU優先度を決定
するLRU優先度決定部716とを備える。導出方式設
定部718は,LRU優先度テーブル717に値を設定
する手段であり,後述するように,これに対する値の設
定によって,LRU優先度の導出方式を変えることがで
きる。
(7) Seventh Embodiment FIG. 15 is a block diagram of a seventh embodiment of the present invention. The system configuration of this example is a bus-coupled parallel computer in which a plurality of processors are coupled by a system bus 740, the bus is a snooping bus, and the cache coherence protocol is invalid. The cache memory device 700 includes a processor and a system bus 74.
0 (or it may be built in the processor),
It includes an other processor bus request interception unit 714 that intercepts a bus request from the other processor node 750, and an LRU priority determination unit 716 that determines the next LRU priority. The derivation method setting unit 718 is a unit that sets a value in the LRU priority table 717. As described later, the derivation method of the LRU priority can be changed by setting a value for this.

【0082】キャッシュ制御管理部712は,キャッシ
ュコントローラ710における主な制御を行う部分であ
り,キャッシュメモリ720へのデータの記録(もしく
は再記録)を制御する。キャッシュ制御管理部712の
内部構造は,基本的には従来のものと同様である。プロ
セッサインタフェース(プロセッサIF)711は,プ
ロセッサ730とキャッシュ制御管理部712との間で
データおよび制御信号をやりとりするインタフェースで
あり,バスインタフェース(バスIF)713は,シス
テムバス740を介して主記憶(図示省略)または他プ
ロセッサノード750との間でデータおよび制御信号を
やりとりするインタフェースである。
The cache control management unit 712 is a part that performs main control in the cache controller 710, and controls recording (or re-recording) of data in the cache memory 720. The internal structure of the cache control management unit 712 is basically the same as the conventional one. A processor interface (processor IF) 711 is an interface for exchanging data and control signals between the processor 730 and the cache control management unit 712, and a bus interface (bus IF) 713 is provided via a system bus 740 for main storage ( It is an interface for exchanging data and control signals with another processor node 750 (not shown).

【0083】なお,自プロセッサ730からの要求によ
りキャッシュメモリ720にデータを記録(もしくは再
記録)する場合の処理は,従来行われている一般的なキ
ャッシュ制御と同様であり,通常の動作であるので説明
を省略する。
The process of recording (or re-recording) data in the cache memory 720 in response to a request from the own processor 730 is the same as the usual cache control performed conventionally, and is a normal operation. Therefore, the description is omitted.

【0084】他プロセッサノード750がシステムバス
740に出す要求は,他プロセッサバス要求傍受部71
4が読み取る。他プロセッサバス要求傍受部714は,
他プロセッサノード750がシステムバス740に送出
した要求を傍受すると,その結果をLRU優先度決定部
716に送る。
The request issued by the other processor node 750 to the system bus 740 is sent to the other processor bus request
4 reads. The other processor bus request interception unit 714
When the other processor node 750 intercepts the request sent to the system bus 740, the result is sent to the LRU priority determination unit 716.

【0085】LRU優先度決定部716は,図16に示
すようなLRU優先度テーブル717を備え,LRU優
先度テーブル717に記録された値に基づき,現LRU
優先度と他プロセッサバス要求傍受部714からの情報
からデータの次LRU優先度を決定する。
The LRU priority determining section 716 has an LRU priority table 717 as shown in FIG. 16, and based on the value recorded in the LRU priority table 717, the current LRU priority is determined.
The next LRU priority of the data is determined from the priority and the information from the other processor bus request interception unit 714.

【0086】ここでは,LRU優先度テーブル717
は,次のように設定されている。説明を簡単にするた
め,データの要求の種類は,データの読み出し(READ)
とする。データの書き込み(WRITE) の場合も基本的に同
様である。自プロセッサ730と他プロセッサノード7
50のどちらからもデータの要求がなければ,もちろん
何もしない。他プロセッサノード750からデータの読
み出し要求があり,そのデータを自プロセッサ730用
のキャッシュメモリ720が保持している場合,現LR
U優先度は元の値のままとする。他プロセッサノード7
50からデータの読み出し要求があり,そのデータを自
プロセッサ730用のキャッシュメモリ720が保持し
ていない場合,そのデータをキャッシュメモリ720に
取り込み,そのデータの現LRU優先度を0にする。こ
の例では,保持するデータが cleanの場合(すなわち主
記憶のデータと値が一致する場合)にもdirty の場合
(すなわち主記憶のデータと値が一致しない可能性があ
る場合)にも,次LRU優先度は同じ値が設定される
が,LRU優先度テーブル717への設定値により区別
することも可能である。データ要求が他プロセッサノー
ド750からではなく,自プロセッサ730からであれ
ば,従来と同様に,次LRU優先度を最も高い値(=
3)に設定する。
Here, the LRU priority table 717
Is set as follows. For simplicity, the type of data request is data read (READ).
And The same applies to the case of writing data (WRITE). Own processor 730 and other processor node 7
If there is no data request from either of the 50, of course, do nothing. When there is a data read request from another processor node 750 and the data is held in the cache memory 720 for the own processor 730, the current LR
The U priority remains at the original value. Other processor node 7
If there is a data read request from 50 and the cache memory 720 for the own processor 730 does not hold the data, the data is fetched into the cache memory 720 and the current LRU priority of the data is set to 0. In this example, both when the retained data is clean (that is, when the data and the value in the main memory match) and when the data that is retained is dirty (that is, when the data and the value in the main memory may not match), Although the same value is set for the LRU priority, the LRU priority can be distinguished by the value set in the LRU priority table 717. If the data request is not from the other processor node 750 but from the own processor 730, the next LRU priority is set to the highest value (=
Set to 3).

【0087】もし,他プロセッサノード750のデータ
読み出し要求によって,データをキャッシュメモリ72
0に記録 (再記録ではない)するのであれば,他プロセ
ッサバス要求傍受部714は,システムバス740上で
転送されるデータを読み取り,キャッシュ制御管理部7
12は,そのデータをLRU優先度決定部716によっ
て上記の手順により求めたLRU優先度を持つデータと
して,キャッシュメモリ720に記録する。
If the data is read from another processor node 750, the data is stored in the cache memory 72.
If the data is to be recorded in 0 (not a re-recording), the other processor bus request interception unit 714 reads the data transferred on the system bus 740, and
12, the data is recorded in the cache memory 720 as data having the LRU priority determined by the LRU priority determining unit 716 according to the above procedure.

【0088】例えば,LRU優先度なし (すなわち,自
キャッシュメモリ720上に持っていない状態)のデー
タに対して,他プロセッサノード750からデータの読
み出し(READ)が送出され,かつ,スヌーピングの結果
が「他 clean」 (他プロセッサがデータをclean で持っ
ていた)もしくは「他 dirty」 (他プロセッサがデータ
をdirty で持っていた)の場合には,図16に示すよう
に,データはLRU優先度が最も低い“0”のデータと
してキャッシュメモリ720に記録される。なお,この
ときキャッシュメモリ720に記録されるデータは,シ
ステムバス740上を転送されているデータを他プロセ
ッサバス要求傍受部714が読み取ったものである。
For example, data read (READ) is sent from the other processor node 750 to data without the LRU priority (that is, the data has no LRU priority in its own cache memory 720), and the result of snooping is In the case of “other clean” (other processor has data in clean) or “other dirty” (other processor has data in dirty), data is given the LRU priority as shown in FIG. Is recorded in the cache memory 720 as data of the lowest “0”. Note that the data recorded in the cache memory 720 at this time is obtained by reading the data transferred on the system bus 740 by the other processor bus request interception unit 714.

【0089】なお,LRU優先度テーブル717に記録
されている値は,導出方式設定部718が,任意に設定
することが可能である。または,予め定められた値とす
ることも可能である。導出方式設定部718の実現方法
としては,例えばプロセッサ730から初期設定時もし
くはプログラムの起動時に値を設定する方法,あるいは
キャッシュメモリ装置700の実装時にROM等を用い
てLRU優先度テーブル717を組み込む方法などが考
えられる。
The values recorded in the LRU priority table 717 can be arbitrarily set by the derivation method setting unit 718. Alternatively, it may be a predetermined value. As a method of realizing the derivation method setting unit 718, for example, a method of setting a value at the time of initial setting or program startup from the processor 730, or a method of incorporating the LRU priority table 717 using a ROM or the like at the time of mounting the cache memory device 700 And so on.

【0090】[0090]

【発明の効果】以上説明したように,本発明によれば,
キャッシュメモリから追い出すデータを決めるときに使
用されるLRU優先度の値を積極的に操作することが可
能となる。例えば,使用される可能性の低いデータをキ
ャッシュメモリに記録(もしくは再記録)するときに
は,そのデータのLRU優先度を低く設定することで,
他の必要なデータがキャッシュメモリから追い出される
のを防ぐことができる。この制御は,データにアクセス
したときのLRU優先度の変更を制御することにより実
現しているため,キャッシュメモリにおけるLRU制御
のための情報の記録容量は従来と変わらず実現できる。
したがって,キャッシュメモリの容量をより有効に使う
ことが可能となり,その結果としてシステムの性能を向
上させることができる。
As described above, according to the present invention,
The value of the LRU priority used when determining data to be evicted from the cache memory can be positively operated. For example, when data that is unlikely to be used is recorded (or re-recorded) in the cache memory, by setting the LRU priority of the data low,
It is possible to prevent other necessary data from being evicted from the cache memory. Since this control is realized by controlling the change of the LRU priority when accessing data, the recording capacity of information for LRU control in the cache memory can be realized as before.
Therefore, the capacity of the cache memory can be used more effectively, and as a result, the performance of the system can be improved.

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

【図1】本発明のブロック構成例を示す図である。FIG. 1 is a diagram illustrating an example of a block configuration according to the present invention.

【図2】本発明の動作原理を説明するための図である。FIG. 2 is a diagram for explaining the operation principle of the present invention.

【図3】本発明の第1の実施の形態のブロック構成図で
ある。
FIG. 3 is a block diagram of the first embodiment of the present invention.

【図4】第1の実施の形態におけるLRU優先度テーブ
ルの例を示す図である。
FIG. 4 is a diagram illustrating an example of an LRU priority table according to the first embodiment.

【図5】本発明の第2の実施の形態のブロック構成図で
ある。
FIG. 5 is a block diagram of a second embodiment of the present invention.

【図6】第2の実施の形態におけるLRU優先度テーブ
ルの例を示す図である。
FIG. 6 is a diagram illustrating an example of an LRU priority table according to the second embodiment.

【図7】本発明の第3の実施の形態のブロック構成図で
ある。
FIG. 7 is a block diagram of a third embodiment of the present invention.

【図8】第3の実施の形態におけるLRU優先度テーブ
ルの例を示す図である。
FIG. 8 is a diagram illustrating an example of an LRU priority table according to the third embodiment.

【図9】本発明の第4の実施の形態のブロック構成図で
ある。
FIG. 9 is a block diagram of a fourth embodiment of the present invention.

【図10】第4の実施の形態におけるLRU優先度テー
ブルの例を示す図である。
FIG. 10 is a diagram illustrating an example of an LRU priority table according to a fourth embodiment.

【図11】本発明の第5の実施の形態のブロック構成図
である。
FIG. 11 is a block diagram of a fifth embodiment of the present invention.

【図12】第5の実施の形態におけるLRU優先度テー
ブルの例を示す図である。
FIG. 12 is a diagram illustrating an example of an LRU priority table according to the fifth embodiment.

【図13】本発明の第6の実施の形態のブロック構成図
である。
FIG. 13 is a block diagram of a sixth embodiment of the present invention.

【図14】第6の実施の形態におけるLRU優先度テー
ブルの例を示す図である。
FIG. 14 is a diagram illustrating an example of an LRU priority table according to a sixth embodiment.

【図15】本発明の第7の実施の形態のブロック構成図
である。
FIG. 15 is a block diagram of a seventh embodiment of the present invention.

【図16】第7の実施の形態におけるLRU優先度テー
ブルの例を示す図である。
FIG. 16 is a diagram illustrating an example of an LRU priority table according to a seventh embodiment.

【図17】キャッシュメモリに新たにデータを記録する
場合の例を示す図である。
FIG. 17 is a diagram illustrating an example of a case where data is newly recorded in a cache memory.

【図18】プリフェッチによりキャッシュメモリの有効
性が損なわれる例を示す図である。
FIG. 18 is a diagram illustrating an example in which the effectiveness of a cache memory is impaired by prefetching.

【図19】プリフェッチなしでキャッシュメモリが有効
に利用される例を示す図である。
FIG. 19 is a diagram showing an example in which a cache memory is effectively used without prefetch.

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

1 キャッシュメモリ装置 10 キャッシュコントローラ 11 キャッシュ制御手段 12 導出方式設定手段 13 LRU優先度決定手段 20 キャッシュメモリ 30 プロセッサ 40 システムバス DESCRIPTION OF SYMBOLS 1 Cache memory device 10 Cache controller 11 Cache control means 12 Derivation method setting means 13 LRU priority determination means 20 Cache memory 30 Processor 40 System bus

───────────────────────────────────────────────────── フロントページの続き (72)発明者 佐藤 充 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 Fターム(参考) 5B005 JJ11 KK12 MM01 NN22 QQ02 QQ04  ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Mitsuru Sato 4-1-1, Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa F-term in Fujitsu Limited (Reference) 5B005 JJ11 KK12 MM01 NN22 QQ02 QQ04

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 LRU方式により制御されるキャッシュ
メモリ装置において,キャッシュメモリに新たにデータ
を記録する際に,またはキャッシュヒットしてデータを
再記録する際に,前記データの現在のLRU優先度,前
記データの属性,前記データへのアクセス手段,プロセ
ッサの状態,またはこれらのすべてもしくは一部の情報
を用いて,次のLRU優先度を導出するLRU優先度決
定部を備え,前記LRU優先度決定部が決定したLRU
優先度を持つデータとして,キャッシュメモリ内にデー
タを記録または再記録することを特徴とするキャッシュ
メモリ装置。
In a cache memory device controlled by the LRU method, when new data is recorded in a cache memory or when data is re-recorded after a cache hit, the current LRU priority of the data is determined. An LRU priority determining unit for deriving the next LRU priority using the attribute of the data, the means for accessing the data, the state of the processor, or all or a part of the information; LRU determined by the department
A cache memory device characterized by recording or re-recording data in a cache memory as data having priority.
【請求項2】 請求項1に記載するキャッシュメモリ装
置において,前記LRU優先度決定部が次のLRU優先
度を導出するのに使用する方式を,任意に変更し,また
は設定する導出方式設定部を備えることを特徴とするキ
ャッシュメモリ装置。
2. The derivation method setting unit according to claim 1, wherein the method used by the LRU priority determination unit to derive the next LRU priority is arbitrarily changed or set. A cache memory device comprising:
【請求項3】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,データのアドレスからデー
タのプライオリティを決定するアドレス解析部を備え,
前記LRU優先度決定部は,キャッシュメモリにデータ
を記録または再記録する際に,少なくとも,前記アドレ
ス解析部が出力するデータのプライオリティと,データ
の現在のLRU優先度とを用いて,データの次のLRU
優先度を決定することを特徴とするキャッシュメモリ装
置。
3. The cache memory device according to claim 1, further comprising: an address analysis unit that determines a priority of the data from an address of the data.
The LRU priority determining unit, when recording or re-recording data in the cache memory, uses at least the priority of the data output by the address analysis unit and the current LRU priority of the data, LRU
A cache memory device for determining a priority.
【請求項4】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,プロセッサがプリフェッチ
命令の機能を持つ場合に,前記プロセッサからキャッシ
ュメモリへのアクセスが,プリフェッチ命令によるアク
セスであるか否かを識別するプリフェッチ識別部を備
え,前記LRU優先度決定部は,キャッシュメモリにデ
ータを記録または再記録する際に,少なくとも,前記プ
リフェッチ識別部の識別結果と,データの現在のLRU
優先度とを用いて,データの次のLRU優先度を決定す
ることを特徴とするキャッシュメモリ装置。
4. The cache memory device according to claim 1, wherein when the processor has a function of a prefetch instruction, whether the processor accesses the cache memory by a prefetch instruction. The LRU priority determining unit, when recording or re-recording data in the cache memory, includes at least the identification result of the prefetch identifying unit and the current LRU of the data.
A cache memory device for determining a next LRU priority of data by using the priority.
【請求項5】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,プロセッサからキャッシュ
メモリへのこれまでのアクセス履歴に基づき,プロセッ
サが使用する可能性の高いデータのアドレスを予測し,
そのアドレスのデータを先読みするプリフェッチ制御部
を備え,前記LRU優先度決定部は,キャッシュメモリ
にデータを記録または再記録する際に,少なくとも,前
記プリフェッチ制御部がロードしたデータであるか否か
と,データの現在のLRU優先度とを用いて,データの
次のLRU優先度を決定することを特徴とするキャッシ
ュメモリ装置。
5. The cache memory device according to claim 1, wherein an address of data which is highly likely to be used by the processor is predicted based on a past access history from the processor to the cache memory,
A prefetch control unit that prefetches the data at the address; the LRU priority determination unit determines whether or not the data is loaded by the prefetch control unit when recording or re-recording the data in the cache memory; A cache memory device for determining a next LRU priority of data using a current LRU priority of data.
【請求項6】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,プロセッサからキャッシュ
メモリへのアクセスを発した命令の種類を識別する命令
識別部を備え,前記LRU優先度決定部は,キャッシュ
メモリにデータを記録または再記録する際に,少なくと
も,前記命令識別部の識別結果と,データの現在のLR
U優先度とを用いて,データの次のLRU優先度を決定
することを特徴とするキャッシュメモリ装置。
6. The cache memory device according to claim 1, further comprising: an instruction identification unit that identifies a type of an instruction that has issued an access from the processor to the cache memory, wherein the LRU priority determination unit includes: When recording or re-recording data in the cache memory, at least the identification result of the instruction identification unit and the current LR of the data
A cache memory device for determining a next LRU priority of data using a U priority.
【請求項7】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,プロセッサが投機的命令実
行機能を持つ場合に,前記プロセッサからキャッシュメ
モリへのアクセスが,プロセッサが投機的命令実行中に
発したアクセスであるか否かを識別する投機実行識別部
を備え,前記LRU優先度決定部は,キャッシュメモリ
にデータを記録または再記録する際に,少なくとも,前
記投機実行識別部の識別結果と,データの現在のLRU
優先度とを用いて,データの次のLRU優先度を決定す
ることを特徴とするキャッシュメモリ装置。
7. The cache memory device according to claim 1, wherein when the processor has a speculative instruction execution function, the processor accesses the cache memory while the processor executes the speculative instruction. A speculative execution identifying unit for identifying whether the access is issued or not, wherein the LRU priority determining unit determines at least the identification result of the speculative execution identifying unit when recording or re-recording data in the cache memory. , The current LRU of the data
A cache memory device for determining a next LRU priority of data by using the priority.
【請求項8】 請求項1または請求項2に記載するキャ
ッシュメモリ装置において,プロセッサがバス結合され
た並列計算機である場合に,他プロセッサのバス要求を
傍受する他プロセッサバス要求傍受部を備え,前記LR
U優先度決定部は,他プロセッサがバスに要求を出した
際に,少なくとも,その他プロセッサが出した要求の種
類と,そのスヌーピングの結果と,データの現在のLR
U優先度とを用いて,データの次のLRU優先度を決定
することを特徴とするキャッシュメモリ装置。
8. The cache memory device according to claim 1, further comprising, when the processor is a bus-connected parallel computer, another processor bus request interception unit that intercepts a bus request of another processor. The LR
When another processor issues a request to the bus, the U priority determining unit determines at least the type of the request issued by the other processor, the result of the snooping, and the current LR of the data.
A cache memory device for determining a next LRU priority of data using a U priority.
JP11155286A 1999-06-02 1999-06-02 Cache memory device Withdrawn JP2000347941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11155286A JP2000347941A (en) 1999-06-02 1999-06-02 Cache memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11155286A JP2000347941A (en) 1999-06-02 1999-06-02 Cache memory device

Publications (1)

Publication Number Publication Date
JP2000347941A true JP2000347941A (en) 2000-12-15

Family

ID=15602589

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11155286A Withdrawn JP2000347941A (en) 1999-06-02 1999-06-02 Cache memory device

Country Status (1)

Country Link
JP (1) JP2000347941A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059077A (en) * 2007-08-30 2009-03-19 Toshiba Corp Cache system
JP2017097066A (en) * 2015-11-19 2017-06-01 ルネサスエレクトロニクス株式会社 Image processing device and image processing method
US11704235B2 (en) 2021-03-18 2023-07-18 Kioxia Corporation Memory system and storage device
JP7406206B2 (en) 2020-04-28 2023-12-27 日本電信電話株式会社 Reference image cache, deletion destination determination method, and computer program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059077A (en) * 2007-08-30 2009-03-19 Toshiba Corp Cache system
JP2017097066A (en) * 2015-11-19 2017-06-01 ルネサスエレクトロニクス株式会社 Image processing device and image processing method
JP7406206B2 (en) 2020-04-28 2023-12-27 日本電信電話株式会社 Reference image cache, deletion destination determination method, and computer program
US11704235B2 (en) 2021-03-18 2023-07-18 Kioxia Corporation Memory system and storage device

Similar Documents

Publication Publication Date Title
JP4297968B2 (en) Coherency maintenance device and coherency maintenance method
JP3587591B2 (en) Method of controlling cache miss and computer system thereof
RU2427892C2 (en) Method and device to establish caching policy in processor
US4466059A (en) Method and apparatus for limiting data occupancy in a cache
JP5536658B2 (en) Buffer memory device, memory system, and data transfer method
US20100217937A1 (en) Data processing apparatus and method
US8621152B1 (en) Transparent level 2 cache that uses independent tag and valid random access memory arrays for cache access
US6748496B1 (en) Method and apparatus for providing cacheable data to a peripheral device
JP2008502069A (en) Memory cache controller and method for performing coherency operations therefor
US11036639B2 (en) Cache apparatus and method that facilitates a reduction in energy consumption through use of first and second data arrays
JP4666511B2 (en) Memory caching in data processing
US6256710B1 (en) Cache management during cache inhibited transactions for increasing cache efficiency
JP2000347941A (en) Cache memory device
US7328310B2 (en) Method and system for cache utilization by limiting number of pending cache line requests
US5950227A (en) CPU write-back cache coherency mechanism that transfers data from a cache memory to a main memory after access of the main memory by an alternative bus master
US8214597B2 (en) Cache tentative read buffer
JPH08328959A (en) Disk cache controller
JP2002268943A (en) Cache memory device
JP2000047942A (en) Device and method for controlling cache memory
JP6451475B2 (en) Arithmetic processing device, information processing device, and control method of arithmetic processing device
JPH0784879A (en) Cache memory device
JPH06282487A (en) Cache device
JPH0728701A (en) Computer system
KR20040047398A (en) Method for data access using cache memory
CN110688155A (en) Merging method for storage instruction accessing non-cacheable 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: 20060905