JP2000035918A - Cache memory device - Google Patents
Cache memory deviceInfo
- Publication number
- JP2000035918A JP2000035918A JP10201417A JP20141798A JP2000035918A JP 2000035918 A JP2000035918 A JP 2000035918A JP 10201417 A JP10201417 A JP 10201417A JP 20141798 A JP20141798 A JP 20141798A JP 2000035918 A JP2000035918 A JP 2000035918A
- Authority
- JP
- Japan
- Prior art keywords
- data
- block
- address
- cache
- tag
- 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
Links
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
(57)【要約】
【課題】 キャッシュメモリ装置に関するものであり、
キャッシュヒット率を向上させ、先読みによるデータ転
送量を少なくすることを目的とする。
【解決手段】 メインメモリの内容の一部を保持し、メ
インメモリの代わりにプロセッサとの間でデータのやり
とりをするキャッシュメインメモリにおいて、プロセッ
サからの要求アドレスをもとにメインメモリからデータ
を先読みする時に、要求アドレスの上位と下位アドレス
のデータを読み出して保持する構成をもつ。
(57) [Summary] The present invention relates to a cache memory device,
It is an object of the present invention to improve a cache hit rate and reduce a data transfer amount due to prefetching. SOLUTION: In a cache main memory which holds a part of contents of a main memory and exchanges data with a processor instead of the main memory, data is prefetched from the main memory based on an address requested from the processor. In such a case, the data of the upper and lower addresses of the request address is read and held.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、プロセッサとメイ
ンメモリの間に配置され、高速、小容量のメモリで構成
され、メインメモリのデータを一時的に保持してメイン
メモリの代わりにプロセッサとデータのやりとりをする
キャッシュメモリ装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a high-speed, small-capacity memory which is disposed between a processor and a main memory, temporarily stores data in the main memory, and replaces the main memory with the processor and the data. The present invention relates to a cache memory device that exchanges data.
【0002】[0002]
【従来の技術】計算機システムのプロセッサ速度は向上
し、それに対応して高速な記憶装置が必要とされてい
る。しかし、メインメモリのアクセス速度はプロセッサ
ほどには高速化されてなく、その時間差はますます広が
っている。そのため、メインメモリのデータをいかに高
速に供給できるかがシステム全体の性能を左右する。そ
のため、メインメモリのアクセス時間を短縮することが
計算機システムにとって重要である。2. Description of the Related Art The processor speed of computer systems has increased, and correspondingly high-speed storage devices have been required. However, the access speed of the main memory is not as fast as that of the processor, and the time difference is increasing. Therefore, how fast the data in the main memory can be supplied affects the performance of the entire system. Therefore, it is important for the computer system to shorten the access time of the main memory.
【0003】キャッシュメモリは、プロセッサのこのア
クセス時間を短縮するために用いられる高速、小容量の
メモリであり、プロセッサとメインメモリの間に位置す
る。そして、メインメモリの内容の一部をコピーして保
持し、メインメモリの代わりにプロセッサとの間でデー
タをやりとりし、高速なデータアクセスを実現するもの
である。[0003] The cache memory is a high-speed, small-capacity memory used to reduce the access time of the processor, and is located between the processor and the main memory. Then, a part of the contents of the main memory is copied and held, and data is exchanged with a processor instead of the main memory to realize high-speed data access.
【0004】図15は従来のキャッシュメモリを備える
計算機システムを示す。図15(a)は従来の計算機シ
ステムを示し、図15(b)は従来の計算機システムの
先読みの動作を説明するものである。FIG. 15 shows a computer system having a conventional cache memory. FIG. 15A illustrates a conventional computer system, and FIG. 15B illustrates a prefetch operation of the conventional computer system.
【0005】プロセッサ110からメインメモリ120
に対するアクセス要求が発行されると、まずキャッシュ
装置111において、制御装置113がそのアクセス要
求を受け取る。制御装置113はキャッシュメモリ11
2を検索し、キャッシュメモリ112に要求アドレスに
対応するデータが保持されているかどうか調べる。もし
キャッシュメモリ112に要求アドレスに対応するデー
タが保持されていれば、制御装置113はメインメモリ
120にアクセスすることなく、キャッシュメモリ11
2からデータを取り出し、プロセッサ110に返す。こ
の場合、キャッシュメモリ112はメインメモリ120
より高速なため、メインメモリ120にアクセスするよ
りも速い時間でデータを返すことができる。[0005] From the processor 110 to the main memory 120
Is issued, first, in the cache device 111, the control device 113 receives the access request. The control device 113 controls the cache memory 11
2 is searched to determine whether data corresponding to the requested address is held in the cache memory 112. If data corresponding to the requested address is held in the cache memory 112, the control device 113 does not access the main memory 120 and
2 and return it to the processor 110. In this case, the cache memory 112 is
Because of the higher speed, data can be returned in a shorter time than accessing the main memory 120.
【0006】キャッシュメモリ112に要求データが保
持されていなければ、制御装置113はメインメモリ1
20に対してデータを要求し、返ってきたデータをプロ
セッサ110に転送するとともに、キャッシュメモリ1
12にも格納する。これは、一度、要求があったアドレ
スに対しては、近い将来に、またアクセスがある可能性
が高いというメモリアクセスの時間的局所性を利用し、
キャッシュヒット率を向上させるためである。If the requested data is not held in the cache memory 112, the control device 113
Requesting data from the cache memory 1 and transferring the returned data to the processor 110;
12 is also stored. This takes advantage of the temporal locality of memory access, which is likely to be accessed in the near future for the address once requested,
This is to improve the cache hit rate.
【0007】制御装置113がキャッシュメモリ112
に要求アドレスに対応するデータを見つけた場合をキャ
ッシュヒットと呼び、見つけることができなかった場合
をキャッシュミスヒットと呼ぶ。また、全体のアクセス
要求回数に対してキャッシュヒットした回数をキャッシ
ュヒット率と呼ぶ。[0007] The control device 113
The case where data corresponding to the requested address is found is called a cache hit, and the case where it cannot be found is called a cache miss. The number of cache hits with respect to the total number of access requests is called a cache hit ratio.
【0008】このキャッシュヒット率が向上すると、低
速なメインメモリ120の代わりに高速なキャッシュメ
モリ112からデータを供給できる回数が増えることに
なるので、平均アクセス時間が短縮する。従って、キャ
ッシュヒット率の向上は、メモリシステムの高速化につ
ながり、ひいてはシステム全体の性能の向上につなが
る。そのため、これまでキャッシュヒット率向上の工夫
がさまざまになされてきた。When the cache hit rate is improved, the number of times data can be supplied from the high-speed cache memory 112 instead of the low-speed main memory 120 increases, so that the average access time is reduced. Therefore, an improvement in the cache hit rate leads to an increase in the speed of the memory system, and further to an improvement in the performance of the entire system. For this reason, various attempts have been made to improve the cache hit rate.
【0009】ヒット率の向上の工夫の最も大きなもの
は、メモリアクセスの空間的局所性の利用である。メモ
リアクセスの空間的局所性とは、一般に一度アクセスさ
れたメモリアドレスに近いメモリアドレスは、近い未来
にアクセスされる可能性が高いという性質である。この
性質を利用する方式のもっとも広く用いられているもの
としては、ブロック単位のアクセスがある。これは、キ
ャッシュミスが発生した場合、ミスを生じたアドレスに
対応するデータだけでなく、近い将来アクセスされるで
あろうアドレスに対応するデータ、つまりアクセスされ
たアドレスの近傍に位置するアドレスに対応するデータ
をまとめてキャッシュメモリ112に保存するという方
式である。一般には、メインメモリ120をある固定長
のブロックごとに分割し、アクセス要求が発生したアド
レスに相当するメモリが含まれるブロック全てをキャッ
シュメモリに格納するという方法をとる。The greatest contrivance for improving the hit ratio is to utilize the spatial locality of memory access. The term "spatial locality of memory access" generally means that a memory address close to a memory address once accessed is likely to be accessed in the near future. The most widely used method utilizing this property is access in block units. This means that when a cache miss occurs, not only the data corresponding to the address where the miss occurred, but also the data corresponding to the address that will be accessed in the near future, that is, the address located near the accessed address. This is a method in which data to be processed are collectively stored in the cache memory 112. In general, a method is used in which the main memory 120 is divided into blocks each having a fixed length, and all blocks including a memory corresponding to the address at which the access request is generated are stored in the cache memory.
【0010】メモリアクセスの空間的局所性をさらに利
用するためには、ブロックサイズを大きくすれば良い。
しかし、単純にブロックサイズを大きくするだけでは、
キャッシュメモリ112からメインメモリ120へ書き
戻しする時に、無駄なトラフィックを発生しやすいなど
の問題が生じる。そのため、ブロックの大きさは、ある
程度までしか大きくすることができない。そのため、空
間的局所性をさらに利用しようとした場合には、メイン
メモリ120への書き戻しを小さな単位で行えるよう、
ブロックの大きさを小さいままにし、メインメモリ12
0からキャッシュメモリ112に読み出しを行うときに
複数のブロックを同時に読み出すという手法を用いる。In order to further utilize the spatial locality of memory access, the block size may be increased.
However, simply increasing the block size,
When writing back from the cache memory 112 to the main memory 120, there arises a problem that wasteful traffic is likely to occur. Therefore, the size of the block can only be increased to a certain extent. Therefore, when the spatial locality is to be further utilized, writing back to the main memory 120 can be performed in small units.
The block size is kept small and the main memory 12
When reading from 0 to the cache memory 112, a method of reading a plurality of blocks simultaneously is used.
【0011】この時、同時に読み出すのは隣接したブロ
ックだけではなく、次にアクセスされやすいブロックを
予測し、アクセスのあったブロックと共にメインメモリ
120から読み出し、キャッシュメモリ112に格納す
るという方式も考えられる。At this time, it is also conceivable to simultaneously read not only the adjacent blocks but also the next accessible block, read the block with the accessed block from the main memory 120, and store it in the cache memory 112. .
【0012】このように、アクセス要求があったアドレ
スが含まれているブロックだけでなく、それ以外のブロ
ックもまとめてメインメモリからキャッシュメモリに転
送する方式を先読み(プリフェッチ)と呼ぶ。先読み
は、プロセッサからメインメモリに対して読み出し要求
があった時だけでなく、プロセッサからキャッシュメモ
リに書き込む時にも生じる。この時、更新を要求された
データがキャッシュメモリにない時、キャッシュメモリ
はメインメモリがアクセス要求のあったデータをもって
くるとともに、次にアクセスされやすそうなブロックを
予測し、そのブロックのデ−タも同時にメインメモリか
ら読み出してキャッシュメモリに保持する。The method of transferring not only the block containing the address for which the access request was made but also the other blocks collectively from the main memory to the cache memory is called prefetching. The prefetching occurs not only when a read request is issued from the processor to the main memory, but also when the processor writes to the cache memory. At this time, when the data requested to be updated does not exist in the cache memory, the cache memory fetches the data requested to be accessed by the main memory, predicts the next block which is likely to be accessed next, and reads the data of the block. Is also read from the main memory and held in the cache memory at the same time.
【0013】先読みの方式のうち、もっとも単純なもの
がアクセス要求のあったアドレスが含まれるブロックの
次の(メモリアドレスで上位に相当する)ブロックをま
とめてキャッシュメモリに格納するという方式である。Among the prefetching methods, the simplest one is a method in which blocks (corresponding to a higher memory address) following a block including an address for which an access request is made are collectively stored in a cache memory.
【0014】図15(b)はこの方式の動作を表してい
る。一般的に、プロセッサからのアクセス要求は、アド
レス上位方向に連続して行なわれることが多い。そのた
め、次の上位アドレスのブロックをあらかじめ先読みし
て保持しておけば、キャッシュヒットの確率が高くな
る。FIG. 15B shows the operation of this system. Generally, an access request from a processor is often made continuously in an upper address direction. Therefore, if the block of the next higher address is pre-read and held, the probability of a cache hit increases.
【0015】また、さらに複雑な方法として、これまで
のアクセス履歴を用いて先読みすべきブロックを予測す
るという方法もある。例えば、ある一定間隔のアドレス
を連続してアクセスしている場合には、次のアクセスも
一定幅先になると予測できる。その場合には、予測され
たアドレスを含むブロックのデータをキャッシュメモリ
に格納すればよい。また、これまでの履歴を元に、適当
な論理回路によって、次のアドレスをアクセスするか予
測し、そのアドレスに対応するブロックを先読みする方
法もある。Further, as a more complicated method, there is a method of predicting a block to be prefetched using the access history so far. For example, if addresses at a certain interval are continuously accessed, it can be predicted that the next access will be a certain width ahead. In that case, the data of the block including the predicted address may be stored in the cache memory. There is also a method of predicting whether a next address is accessed or not by a suitable logic circuit based on the history so far, and prefetching a block corresponding to the address.
【0016】[0016]
【発明が解決しようとする課題】しかし、これらの技術
では次のような問題があった。上位アドレスのブロック
を先読みして格納する方式は、アドレスが単純に上位方
向へ連続アクセスする場合しか効果的に作用しない。現
実のアプリケーションプログラムでは、ランダムなアク
セスが多く、この方法はある程度までしか効果があがら
ない。また、適応的に先読みするブロックを予測する方
式、およびは一定間隔を予測する予測方式は、構造が複
雑になる上に、正確な予測が難しいという問題がある。
特に、一定間隔を予測する方式は、配列アクセスなどの
規則的なアプリケーションプログラムに対してはある程
度の効果があるが、データベースなどのアプリケーショ
ンプログラムに対してはほとんど効果がない。また、論
理回路で予測する方式も、予測のための論理が組み立て
難いという問題がある。However, these techniques have the following problems. The method of prefetching and storing the block of the upper address works effectively only when the address is simply accessed continuously in the upper direction. In a real application program, there are many random accesses, and this method is only effective to a certain extent. In addition, the method of adaptively predicting a block to be prefetched and the method of predicting a fixed interval have problems that the structure is complicated and accurate prediction is difficult.
In particular, the method of predicting a fixed interval has a certain effect on a regular application program such as array access, but has little effect on an application program such as a database. In addition, the method of predicting with a logic circuit also has a problem that the logic for prediction is difficult to assemble.
【0017】さらに、先読み方式全般に言えることであ
るが、先読みしたブロックが結局、プロセッサによって
アクセスされない可能性があるため、常に不必要なブロ
ックをキャッシュメモリに格納していることになる。こ
のことは、キャッシュメモリの実質的な利用率を低下さ
せることであり、さらにメインメモリとキャッシュメモ
リとの間で無駄なデータ転送をしていることを意味す
る。Further, as can be said for the prefetching method in general, there is a possibility that the prefetched block may not be accessed by the processor after all, so that unnecessary blocks are always stored in the cache memory. This means that the actual utilization rate of the cache memory is reduced, and that unnecessary data transfer is performed between the main memory and the cache memory.
【0018】本発明は、これらの問題を考慮した上で、
規則的でないアクセス、例えばデ−タベースなどのアプ
リケーションプログラムのような場合でも、比較的単純
にキャッシュヒット率を向上させ、先読みによるデータ
転送量を少なくするキャッシュメモリ装置を提供するこ
とを目的とする。The present invention, taking these problems into account,
It is an object of the present invention to provide a cache memory device that relatively simply improves the cache hit rate and reduces the amount of data transferred by prefetching even in the case of irregular access, for example, in an application program such as a database.
【0019】[0019]
【課題を解決するための手段】本発明のキャッシュメモ
リ装置は、キャッシュミスが発生した場合に、アクセス
要求のあったアドレスが含まれるブロックだけでなく、
その上位のブロックn個および下位のブロックm個も先
読みの対象とする。According to the present invention, when a cache miss occurs, not only a block including an address requested to be accessed but also a cache memory device is disclosed.
The upper n blocks and the lower m blocks are also prefetched.
【0020】さらに、このブロックはもとの要求された
ブロックから見て上位にある(U)か下位にある(D)
を区別するタグを設ける。このタグは、さらに次の先読
みの場合に用いる。Further, this block is higher (U) or lower (D) with respect to the original requested block.
The tag which distinguishes is provided. This tag is used for the next look-ahead.
【0021】このタグは先読みしてきたブロックに付随
して持たせる方法や、先読みしたブロックのデータとは
対応せずに、独立したタグのみを持たせる方法、あるい
はその両方で持たせることができる。This tag can be provided by a method of attaching it to the block read ahead, a method of providing only an independent tag without corresponding to the data of the block read ahead, or both.
【0022】さらにこのタグには深さというパラメータ
kも設けることができる。この深さは、先読みするかし
ないかを判定する際に用いられる。Further, the tag can be provided with a parameter k called depth. This depth is used when determining whether to prefetch or not.
【0023】図1は本発明の基本構成を示す。図1にお
いて、1はプロセッサである。FIG. 1 shows the basic configuration of the present invention. In FIG. 1, reference numeral 1 denotes a processor.
【0024】2はキャッシュメモリ装置である。3はキ
ャッシュメモリである。4はキャッシュ制御装置であ
る。Reference numeral 2 denotes a cache memory device. 3 is a cache memory. Reference numeral 4 denotes a cache control device.
【0025】5は制御部であって、プロセッサ1から要
求されたアドレスについて、そのアドレスのデータがキ
ャッシュメモリ3にあるかないかを判定し、読み出し要
求のあったアドレスのキャッシュヒット、キャッシュミ
スヒットを判定するものである。キャッシュヒットであ
ればキャッシュメモリ3からの読み出し指示(読み出し
要求の時)もしくは書き込み(書き込み要求)をする。
キャッシュミスヒットであればメインメモリ10に要求
アドレスのデータおよび要求アドレスの上位および下位
のアドレスのデータをキャッシュメモリ3にコピーする
ことを指示するものである。A control unit 5 determines whether or not the data of the address requested by the processor 1 exists in the cache memory 3 and determines a cache hit and a cache miss of the address requested to be read. It is to judge. If it is a cache hit, a read instruction (at the time of a read request) or a write (write request) from the cache memory 3 is issued.
If it is a cache miss, it instructs the main memory 10 to copy the data of the requested address and the data of the upper and lower addresses of the requested address to the cache memory 3.
【0026】6はキャッシュヒット判定部であって、ア
クセス要求のあったアドレスのヒット、ミスヒットを判
定するものである。7はデータ読み出し部であって、メ
インメモリ10からアクセス要求のあったアドレスのデ
ータを読み出すものである。Reference numeral 6 denotes a cache hit judging unit for judging a hit or a mishit of an address for which an access request has been made. Reference numeral 7 denotes a data reading unit which reads data from the main memory 10 at an address for which an access request has been made.
【0027】8は下位ブロック読み出し部であって、メ
インメモリ10から要求アドレスより下位アドレスのデ
ータを読み出すものである。9は上位ブロック読み出し
部であって、メインメモリ10から要求アドレスより上
位アドレスのデータを読み出すものである。Numeral 8 denotes a lower block reading section for reading data from the main memory 10 at a lower address than the requested address. Reference numeral 9 denotes an upper block reading unit which reads data of an upper address from the requested address from the main memory 10.
【0028】10はメインメモリである。図1の構成の
動作を説明する。プロセッサ1からアクセス要求が生じ
る(メインメモリ10からの読み出し、もしくはメイン
メモリ10への書き込み)。キャッシュヒット判定部6
はキャッシュメモリ3に要求アドレスのデータがある
か、ないかを判定する。要求アドレスのデータがキャッ
シュメモリ3にあれば(キャッシュヒット)、データ読
み出し部7は、キャッシュメモリ3からの読み出し指示
をする(プロセッサの読み出し要求の時)、あるいはキ
ャッシュメモリにプロセッサから書き込む(プロセッサ
の書き込み要求の時)。要求アドレスのデータがキャッ
シュメモリ3になければ(キャッシュミスヒット)、デ
ータ読み出し部7は、メインメモリ10から要求アドレ
スのデータを読み出し、キャッシュメモリ3へ格納する
とともにプロセッサ1へ転送する(プロセッサの読み出
し要求の時)、あるいはメインメモリ10から要求アド
レスのデータを読み出し、プロセッサから要求アドレス
に書き込む(プロセッサの書き込み要求の時)。さら
に、キャッシュミスヒットであれば、書き込みのいずれ
の場合にも、メインメモリ10からキャッシュメモリ3
にデータを読み出した時、下位ブロック読み出し部8お
よび上位ブロック読み出し部9は、それぞれ、メインメ
モリ10から要求アドレスの下位ブロックおよび上位ブ
ロックのデータを読み出してキャッシュメモリ3に格納
する。Reference numeral 10 denotes a main memory. The operation of the configuration of FIG. 1 will be described. An access request is generated from the processor 1 (read from the main memory 10 or write to the main memory 10). Cache hit determination unit 6
Determines whether there is data at the requested address in the cache memory 3. If the data at the requested address is in the cache memory 3 (cache hit), the data read unit 7 instructs a read from the cache memory 3 (at the time of a processor read request) or writes the data to the cache memory (from the processor). At the time of a write request). If the data of the requested address is not in the cache memory 3 (cache miss), the data reading unit 7 reads the data of the requested address from the main memory 10, stores the data in the cache memory 3 and transfers the data to the processor 1 (read by the processor). (At the time of a request) or data of the requested address is read from the main memory 10 and written from the processor to the requested address (at the time of a write request from the processor). Furthermore, if there is a cache mishit, in any case of writing, the cache memory 3
When the data is read from the main memory 10, the lower block read unit 8 and the upper block read unit 9 read the data of the lower block and the upper block of the requested address from the main memory 10, respectively, and store them in the cache memory 3.
【0029】本発明によれば、キャッシュミスが発生し
た場合に、アクセス要求のあったアドレスが含まれるブ
ロックだけでなく、その上位ブロックn個、下位ブロッ
クm個も先読みの対象とする。そのため、単純な上位ブ
ロックだけの先読みに比べて、上位方向に連続したアク
セスだけでなく、ある程度ランダムなアクセスの場合で
もキャッシュヒット率を向上させることができる。According to the present invention, when a cache miss occurs, not only the block including the address requested to be accessed but also the upper n blocks and the lower blocks m are to be prefetched. For this reason, the cache hit rate can be improved not only in the case of continuous access in the upper direction but also in the case of random access to some extent, as compared with simple prefetching of only the upper block.
【0030】[0030]
【発明の実施の形態】図2は本発明の実施の形態1と、
実施の形態2で使用するキャッシュメモリ装置の実施の
形態を示す。FIG. 2 shows Embodiment 1 of the present invention.
The embodiment of the cache memory device used in the second embodiment is shown.
【0031】図2において、1はプロセッサであり、メ
モリアクセスを発生するものである。2はキャッシュメ
モリ装置である。In FIG. 2, reference numeral 1 denotes a processor for generating a memory access. 2 is a cache memory device.
【0032】3はキャッシュメモリであり、キャッシュ
データを保持するキャッシュアレイ21と、先読みデー
タを保持する先読みバッファ22により構成されるもの
である。キャッシュメモリは高価で小容量であるが、高
速なメモリである。Reference numeral 3 denotes a cache memory, which comprises a cache array 21 for holding cache data and a prefetch buffer 22 for holding prefetch data. The cache memory is expensive and has a small capacity, but is a high-speed memory.
【0033】4はキャッシュ制御装置である。キャッシ
ュ制御装置4において、5は制御部である。Reference numeral 4 denotes a cache control device. In the cache control device 4, reference numeral 5 denotes a control unit.
【0034】6はアドレス計算部である。10はメイン
メモリであり、プロセッサがアクセスすべきデータを保
持している。メインメモリは低速であるが安価で大容量
である。23はデータ選択部であって、キャッシュアレ
イ21から読み出されてデータと先読みバッファ22か
ら読み出されたデータを選択して、プロセッサ1に渡す
ものである。Reference numeral 6 denotes an address calculation unit. A main memory 10 holds data to be accessed by the processor. The main memory is slow but cheap and of large capacity. Reference numeral 23 denotes a data selection unit which selects data read from the cache array 21 and data read from the pre-read buffer 22 and passes them to the processor 1.
【0035】キャッシュメモリ3において、21はキャ
ッシュアレイであり、キャッシュミスヒットした時にメ
インメモリから読み出されたデータを保持するものであ
る。In the cache memory 3, reference numeral 21 denotes a cache array which holds data read from the main memory when a cache miss occurs.
【0036】22は先読みバッファであって、キャッシ
ュミスヒットの時にメインメモリ10から先読みしたデ
ータを保持するものである。10はメインメモリであ
る。Reference numeral 22 denotes a prefetch buffer which holds data prefetched from the main memory 10 when a cache miss occurs. 10 is a main memory.
【0037】図2の構成の動作を説明する。本発明の先
読みはプロセッサからの読み出し要求、書き込み要求の
いずれの場合にも適用されるものであるが、以下、プロ
セッサからの読み出し要求があった場合を例として動作
を説明する。The operation of the configuration shown in FIG. 2 will be described. The prefetch according to the present invention is applied to both a read request and a write request from the processor. Hereinafter, the operation will be described by taking as an example a case where there is a read request from the processor.
【0038】プロセッサ1からアクセス要求が発生する
と、キャッシュ制御装置4において、制御部5は、その
アドレスをブロックアドレスに変換する。これは、キャ
ッシュアレイでの管理、先読みの管理、メインメモリへ
のデータ要求など、キャッシュメモリ装置2で行なわれ
る処理は全てブロック単位で行なわれるからである。When an access request is issued from the processor 1, in the cache control device 4, the control unit 5 converts the address into a block address. This is because all processes performed in the cache memory device 2, such as management in the cache array, management of prefetching, and data request to the main memory, are performed in block units.
【0039】次に、制御部5は、要求アドレスのあるブ
ロックアドレスがすでにキャッシュアレイ21と先読み
バッファ22に格納されているか、いないかを検査(検
索と同じ意味で用いる)する。キャッシュアレイ21と
先読みバッファ22は独立したメモリなので、この検査
は同時にできる。Next, the control unit 5 checks whether the block address having the requested address is already stored in the cache array 21 and the prefetch buffer 22 (used in the same meaning as the search). Since the cache array 21 and the prefetch buffer 22 are independent memories, this check can be performed simultaneously.
【0040】要求されたデータがキャッシュアレイ21
にあり、キャッシュヒットであれば、キャッシュアレイ
21から要求されたデータが読み出され、データ選択部
23で選択されて、プロセッサに転送される。この時、
先読みは行なわない。The requested data is stored in the cache array 21.
In the case of a cache hit, the requested data is read from the cache array 21, selected by the data selection unit 23, and transferred to the processor. At this time,
No prefetching is performed.
【0041】キャッシュヒットであるが、キャッシュア
レイ21になく、先読みバッファ22にある場合には、
制御部5は次の3の動作を行なう。 1.先読みバッファ22からそのデータを読み出し、キ
ャッシュアレイ21にコピーする。If there is a cache hit but not in the cache array 21 but in the prefetch buffer 22,
The control unit 5 performs the following three operations. 1. The data is read from the prefetch buffer 22 and copied to the cache array 21.
【0042】2.1と同時に先読みバッファ22から読
み出したデータをアクセス要求の結果としてプロセッサ
1に返す(先読みバッファ22のデータが読み出されデ
ータ選択部23で選択されてプロセッサに転送され
る)。At the same time as 2.1, the data read from the prefetch buffer 22 is returned to the processor 1 as a result of the access request (the data in the prefetch buffer 22 is read, selected by the data selection unit 23, and transferred to the processor).
【0043】3.1、2が終了したら、先読みバッファ
22からそのデータを消去する。要求されたブロックア
ドレスに対応するデータがキャッシュアレイにも先読み
バッファ22にもなかった場合は制御部5はメインメモ
リ10に対してデータ読み出し要求を発行する。この
時、図1で説明したように、プロセッサ1からアクセス
要求のあったメモリだけでなく、その上位、下位に相当
するブロックのデータも要求する。なお、本実施の形態
1では、m=1、n=1を例として説明する。When the steps 3 and 2 are completed, the data is deleted from the prefetch buffer 22. If there is no data corresponding to the requested block address in either the cache array or the prefetch buffer 22, the control unit 5 issues a data read request to the main memory 10. At this time, as described with reference to FIG. 1, not only the memory requested to be accessed by the processor 1 but also the data of the blocks corresponding to the upper and lower parts thereof are requested. In Embodiment 1, m = 1 and n = 1 will be described as an example.
【0044】この時、この上位、下位に相当するブロッ
クがすでにキャッシュアレイ21に存在すれば、メイン
メモリ10に対して読み出し要求はしない。これは、先
読みバッファ22に関しても同じであるが、実装上の都
合で先読みバッファ22における検査が難しい時は、先
読みバッファ22にすでに先読み対象のデータと同じも
のがあっても、先読みして差し支えない。但し、先読み
バッファ22に同じデータが二重に存在することになる
のでメモリを無駄に使用することになり、メインメモリ
10とキャッシュメモリ3との間のデータ転送量も増え
る。At this time, if the upper and lower blocks already exist in the cache array 21, no read request is made to the main memory 10. The same applies to the prefetch buffer 22. However, when the inspection in the prefetch buffer 22 is difficult due to mounting reasons, even if the prefetch buffer 22 already has the same data as the prefetch target data, the prefetch may be performed. . However, the same data is duplicated in the prefetch buffer 22, so that the memory is wasted and the data transfer amount between the main memory 10 and the cache memory 3 increases.
【0045】読み出しの結果が返ってくると、プロセッ
サ1からアクセス要求のあったブロックはキャッシュア
レイ21に格納するとともに、プロセッサ1に対してア
クセス要求の結果として返す。上位、下位に相当するブ
ロックは先読みバッファ22に格納する。When the read result is returned, the block requested by the processor 1 for access is stored in the cache array 21 and returned to the processor 1 as a result of the access request. The blocks corresponding to the upper order and the lower order are stored in the prefetch buffer 22.
【0046】図2では、キャッシュメモリをキャッシュ
アレイ21と先読みバッファ22に分け、先読みデータ
を先読みバッファ22に格納するように構成している
が、先読みデータを直接キャッシュアレイ21に格納す
る構成でも良い。本発明は、いづれの構成のキャッシュ
メモリにも適用できるが、以下の説明においては、図2
の構成の場合について例示的に説明する。In FIG. 2, the cache memory is divided into the cache array 21 and the prefetch buffer 22, and the prefetch data is stored in the prefetch buffer 22, but the prefetch data may be stored directly in the cache array 21. . The present invention can be applied to any configuration of the cache memory, but in the following description, FIG.
The case of the configuration described above will be exemplarily described.
【0047】図3は本発明の実施の形態1のキャッシュ
アレイと先読みバッファの構成を示す。図3(a)はキ
ャッシュアレイの構成である。FIG. 3 shows the configuration of the cache array and the prefetch buffer according to the first embodiment of the present invention. FIG. 3A shows the configuration of the cache array.
【0048】図3(b)は先読みバッファでの構成であ
る。本実施の形態1ではキャッシュアレイと先読みバッ
ファは同じ構成であり、ブロックアドレス、データ、お
よびその欄が有効か無効かを表すフラグで構成される。
先読みバッファの方がバッファの欄が少ない。FIG. 3B shows a configuration using a prefetch buffer. In the first embodiment, the cache array and the prefetch buffer have the same configuration, and are composed of a block address, data, and a flag indicating whether the column is valid or invalid.
The look-ahead buffer has fewer buffer columns.
【0049】キャッシュアレイの構成には、図3のよう
なダイレクトマップ方式(一つの欄に一つのブロックが
対応する)の他に、セットアソシエーティブ方式(ひと
つの欄に複数のブロックが対応する)があり、本発明は
いづれにも適用できるが、本実施の形態1では、ダイレ
クトマップ方式について例示的に説明する。In the configuration of the cache array, in addition to the direct map system (one block corresponds to one block) as shown in FIG. 3, a set associative system (a plurality of blocks correspond to one column) Although the present invention can be applied to any of them, the first embodiment exemplarily describes a direct map method.
【0050】本実施の形態1では、プロセッサからアク
セス要求が発生した時、上位、下位に相当するブロック
を先読みして先読みバッファに格納する。このようにす
ることにより、キャッシュヒットしなかった場合にも、
先読みバッファにヒットする可能性が高くなるので、キ
ャッシュヒット率が向上する。さらに、上位だけでな
く、下位のブロックも先読みするので、アクセスがラン
ダムにされる場合にも高いヒット率が得られる。In the first embodiment, when an access request is issued from the processor, blocks corresponding to the upper and lower blocks are prefetched and stored in the prefetch buffer. By doing so, even if there is no cache hit,
Since the possibility of hitting the prefetch buffer is increased, the cache hit rate is improved. Furthermore, since not only the upper block but also the lower block is prefetched, a high hit ratio can be obtained even when the access is made random.
【0051】図4は本発明の実施の形態1のフローチャ
ートである。 S1、S2 要求されたブロックがキャッシュアレイ
の中にすでに存在するか検査する。FIG. 4 is a flowchart of the first embodiment of the present invention. S1, S2 Check if the requested block already exists in the cache array.
【0052】S3、S4 S2の判定結果が存在するも
のであれば、要求されたブロックが先読みバッファの中
にすでに存在するか検査する。 S5、S4の判定結果が存在するものであれば、先読み
バッファのデータをキャシュアレイに転送する。S3, S4 If the judgment result in S2 exists, it is checked whether the requested block already exists in the prefetch buffer. If the determination results in S5 and S4 exist, the data in the prefetch buffer is transferred to the cache array.
【0053】S6 先読みバッファ内のデータを消去す
る。 S7 S4の検査結果が存在しないものであれば、メイ
ンメモリに対して、要求されたブロック、上位ブロッ
ク、下位ブロックのデータ転送を要求する。S6 The data in the prefetch buffer is deleted. S7 If there is no test result in S4, the main memory is requested to transfer data of the requested block, upper block, and lower block.
【0054】S8 S2の判定結果が存在するものであ
れば、アクセス結果をプロセッサに送る。 図5は本発明の実施の形態2の先読みバッファの構成で
ある。S8 If the judgment result in S2 exists, the access result is sent to the processor. FIG. 5 shows the configuration of the prefetch buffer according to the second embodiment of the present invention.
【0055】本発明の実施の形態2は、先読みバッファ
の先読みデータに、次に先読みする時の方向を表すタグ
をつけたものである。なお、本実施の形態2の装置構成
は図2と同様である。According to the second embodiment of the present invention, the pre-read data in the pre-read buffer is provided with a tag indicating the direction of the next pre-read. Note that the device configuration of the second embodiment is the same as that of FIG.
【0056】先読みされたブロックに対して、そのブロ
ックが元の要求されたブロックから見て、上位(U)に
あるか下位(D)にあるかを表す方向を記録する。その
後のアクセスが先読みされたブロックにヒットした場
合、このタグの方向を検査し、タグの内容がUであれば
さらに上位のブロックのみを先読みし、タグの内容がD
であればさらに下位のブロックのみを先読みする。これ
によって、上位方向または下位方向の両方向に対して連
続したアクセスが発生した場合に、常に先読みしたブロ
ックが存在することになり、キャッシュヒット率をさら
に向上させることができる。With respect to the pre-read block, a direction indicating whether the block is higher (U) or lower (D), when viewed from the original requested block, is recorded. When the subsequent access hits the pre-read block, the direction of this tag is checked, and if the tag content is U, only the higher-order block is pre-read, and the tag content is D.
If so, only the lower block is prefetched. Thus, when continuous access occurs in both the upper direction and the lower direction, there is always a block that has been pre-read, and the cache hit rate can be further improved.
【0057】方向の記録は、具体的には、図5に示すよ
うにブロックデータに対して先読み状態を示すタグ(方
向(U/D))を付ける。このタグはこの有効/無効を
表すフラグを拡張した形になっている。方向はUもしく
はDの値をとり、Uであれば要求された元のブロックに
対して上位方向に隣接したブロックであることを表し、
Dであれば要求された元のブロックに対して下位方向に
隣接したブロックであることを示す。In the recording of the direction, specifically, as shown in FIG. 5, a tag (direction (U / D)) indicating a pre-read state is added to the block data. This tag is an extended form of the flag indicating valid / invalid. The direction takes the value of U or D, and if U, it indicates that the requested block is a block adjacent to the original block in the upper direction,
D indicates that the block is a block adjacent to the requested original block in the lower direction.
【0058】本実施の形態は以下のような動作を行な
う。プロセッサでメインメモリに対するアクセス要求が
発生してから、キャッシュアレイと先読みバッファに対
して検査がなされるまでの動作は実施の形態1の場合と
同様である。本実施の形態2では、先読みバッファにお
いて、データがあるもしくはないをあらわす情報と同時
に、データがあった場合にそのタグ(方向)も読み出さ
れる。This embodiment performs the following operation. The operation from the generation of the access request to the main memory by the processor to the checking of the cache array and the prefetch buffer is the same as in the first embodiment. In the second embodiment, when there is data, the tag (direction) of the pre-read buffer is also read when there is data in the pre-read buffer.
【0059】要求されたブロックアドレスに対応するデ
ータが、すでにキャッシュアレイに格納されていた場
合、この制御部はキャッシュアレイからそのデータを読
み出し、プロセッサにアクセス要求の結果として返す。
この場合、先読みは行われない。If the data corresponding to the requested block address has already been stored in the cache array, the control unit reads the data from the cache array and returns it to the processor as a result of the access request.
In this case, prefetching is not performed.
【0060】要求されたブロックアドレスに対応するデ
ータが、キャッシュアレイに格納されていた場合、制御
部は次の4つの動作を行なう。 1.先読みバッファからそのデータを読み出し、キャッ
シュアレイにコピーする。When data corresponding to the requested block address is stored in the cache array, the control unit performs the following four operations. 1. The data is read from the prefetch buffer and copied to the cache array.
【0061】2.1と同時に先読みバッファから読み出
したデータをアクセス要求の結果としてプロセッサに返
す。 3.先読みバッファのタグ(方向)の状態に応じて、さ
らに先読みを行なう。Simultaneously with 2.1, the data read from the prefetch buffer is returned to the processor as a result of the access request. 3. Further prefetching is performed according to the state of the tag (direction) of the prefetch buffer.
【0062】 方向状態がUなら、さらに上位のブロ
ックアドレスに対応するデータを先読みデータとして、
メインメモリに要求する。 方向状態がDなら、さらに下位のブロックアドレス
に対応するデータを先読みデータとして、メインメモリ
に要求する。If the direction state is U, data corresponding to a higher-order block address is set as prefetch data,
Request to main memory. If the direction state is D, the data corresponding to the lower block address is requested to the main memory as prefetch data.
【0063】4. 1、2、3が終了したら、先読みバ
ッファからそのデータを消去する。要求されたブロック
アドレスに対応するデータがキャッシュアレイにも先読
みバッファにもなかった場合は制御部はメインメモリに
対してデータ読み出し要求を発行する。この時、図1で
説明したように、プロセッサからアクセス要求のあった
メモリだけでなく、その上位、下位に相当するブロック
(m=1、n=1)も要求し、先読みされたブロックに
対して適切なタグ(方向(U/D)を設定する等は、本
発明の実施の形態1の場合と同様である。4. When 1, 2, and 3 are completed, the data is deleted from the prefetch buffer. If the data corresponding to the requested block address is neither in the cache array nor in the prefetch buffer, the control unit issues a data read request to the main memory. At this time, as described with reference to FIG. 1, not only the memory to which the processor has made an access request, but also the upper and lower blocks (m = 1, n = 1) corresponding to the upper and lower blocks are requested. Setting an appropriate tag (direction (U / D), etc.) is the same as in the first embodiment of the present invention.
【0064】図6は本発明の実施の形態2のフローチャ
ートである。 S1、S2 要求されたブロックがキャッシュアレイの
中にすでに存在するか検査する。FIG. 6 is a flowchart according to the second embodiment of the present invention. S1, S2 Check if the requested block already exists in the cache array.
【0065】S3、S4 S2の判定結果が存在しない
ものであれば、要求されたブロックが先読みバッファの
中にすでに存在するか検査する。 S5、S4の判定結果が存在するものであれば、先読み
バッファのデータをキャシュアレイに転送する。S3, S4 If the determination result in S2 does not exist, it is checked whether the requested block already exists in the prefetch buffer. If the determination results in S5 and S4 exist, the data in the prefetch buffer is transferred to the cache array.
【0066】S6、S7 タグの方向検査をし、下位
(D)であればS7で下位ブロックのデータを先読みす
る。 S6、S8 タグの方向検査をし、上位(U)であれば
S8で上位ブロックのデータを先読みする。S6, S7 The direction of the tag is checked, and if it is lower (D), the data of the lower block is prefetched in S7. S6, S8 The direction of the tag is checked, and if it is higher (U), the data of the upper block is prefetched in S8.
【0067】S9 先読みされたバッファ内の要求され
たブロックを消去する。 S10 S4で要求されたブロックが先読みバッファの
中にすでに存在していないと判定されれば、メインメモ
リに対して、要求されたブロック、上位ブロック、下位
ブロックのデータ転送を要求する。S9 Erases the requested block in the prefetched buffer. S10 If it is determined in S4 that the requested block does not already exist in the prefetch buffer, the main memory is requested to transfer data of the requested block, upper block, and lower block.
【0068】S11 上位ブロックにU、下位ブロック
にDの方向タグをつけ、先読みバッファに格納する。 S12 アクセス結果をプロセッサに送る。S11 A direction tag of U is attached to the upper block, and a direction tag of D is attached to the lower block, and stored in the prefetch buffer. S12 Send the access result to the processor.
【0069】図7は、本発明の実施の形態3、4、5、
6で使用するキャッシュメモリ装置の構成である。図7
の構成は、先読みバッファと別に、タグ(先読みタグ)
のみを保持するバッファをもつようにしたものである。FIG. 7 shows Embodiments 3, 4, 5, and 5 of the present invention.
6 shows a configuration of a cache memory device used in the second embodiment. FIG.
Consists of a tag (look-ahead tag) separately from the look-ahead buffer.
It has a buffer that holds only
【0070】図7において、図2と共通の参照番号は同
じものを表す。23はバッファであって、先読みタグを
保持するものである。図7の構成の動作の詳細は後述す
る。In FIG. 7, the same reference numerals as those in FIG. 2 denote the same items. A buffer 23 holds a prefetch tag. Details of the operation of the configuration in FIG. 7 will be described later.
【0071】図8は、本発明の実施の形態3である。本
実施の形態3のキャッシュアレイ、先読みバッファは図
3に示す実施の形態1と同様である。FIG. 8 shows a third embodiment of the present invention. The cache array and prefetch buffer of the third embodiment are the same as those of the first embodiment shown in FIG.
【0072】前述した実施の形態1、2では、無駄な先
読みが発生し、先読みするブロック数が多くなり、メイ
ンメモリとキャッシュメモリとの間のデータ転送が多く
なり過ぎることがある。このような時、先読みされたデ
ータ量はたくさんあるが、プロセッサにとって本当に必
要なデータが少ないことになり、性能が低下する。そこ
で、キャッシュヒット率とデータ転送量の増大による不
利益とを比べて、データ転送量の増大の不利益が大きい
場合には、キャッシュヒット率を多少犠牲にしてもデー
タ転送量を減らした方が良い。In Embodiments 1 and 2 described above, useless prefetching occurs, the number of blocks to be prefetched increases, and data transfer between the main memory and the cache memory may increase too much. In such a case, the amount of pre-read data is large, but the data that is really necessary for the processor is small, and the performance is reduced. Therefore, comparing the cache hit rate with the disadvantage of increasing the data transfer amount, if the disadvantage of increasing the data transfer amount is large, it is better to reduce the data transfer amount even if the cache hit ratio is somewhat sacrificed. good.
【0073】データ転送量を減らす方法として、次のよ
うな方法を考える。先読みバッファのブロックデータに
付随して持っていたタグ情報を先読みバッファのブロッ
クデータと独立にもつようにする。そして、先読みバッ
ファのブロックデータが消去された場合にも、それと独
立してもつタグ情報は残すようにする。そして、任意の
ブロックに対する先読みが発生した場合に、上位方向に
先読みを行なえばよいか、下位方向に先読みを行なえば
良いかを先読みタグだけで判断できるようにする。As a method of reducing the data transfer amount, the following method is considered. The tag information accompanying the block data of the prefetch buffer is provided independently of the block data of the prefetch buffer. Then, even when the block data in the prefetch buffer is erased, the tag information held independently of the block data is left. Then, when prefetching for an arbitrary block occurs, it is possible to judge only by using the prefetch tag whether to prefetch in the upper direction or to prefetch in the lower direction.
【0074】前述した実施の形態2のようにタグがブロ
ックに付随していた場合は、キャッシュミスヒットの
時、常に上位、下位の方向のブロックを持ってきてい
た。しかし独立したタグを持たせると、キャッシュミス
ヒットの場合でも、タグの方向の情報が残っている可能
性がある。タグに方向の情報が残っていた場合には、そ
の情報を参照することにより、タグに記載された方向の
みを先読みすることができる。このようにすると、先読
み量を減らすことができ、データ転送量を少なくするこ
とができる。When a tag is attached to a block as in the above-described second embodiment, a block in the upper or lower direction is always brought at the time of a cache miss. However, if an independent tag is provided, information on the direction of the tag may remain even in the case of a cache miss. If direction information remains in the tag, it is possible to prefetch only the direction described in the tag by referring to the information. In this way, the amount of pre-reading can be reduced, and the amount of data transfer can be reduced.
【0075】図8は本発明の実施の形態3の先読みバッ
ファと先読みタグの構成を示す。図8(a)は先読みバ
ッファであり、有効/無効フラグ、ブロックアドレス、
データにより構成される。FIG. 8 shows a configuration of a prefetch buffer and a prefetch tag according to the third embodiment of the present invention. FIG. 8A shows a look-ahead buffer, in which a valid / invalid flag, a block address,
It is composed of data.
【0076】図8(b)は先読みタグであり、有効/無
効フラグ、ブロックアドレス、方向(U/D)により構
成される。先読みタグは先読みバッファのブロックデー
タとは独立して存在し、先読みバッファのブロックデー
タが消去された後も残されるものである。FIG. 8B shows a look-ahead tag, which is composed of a valid / invalid flag, a block address, and a direction (U / D). The prefetch tag exists independently of the block data of the prefetch buffer, and remains after the block data of the prefetch buffer is erased.
【0077】先読みバッファ、先読みタグを本発明の実
施の形態3のように構成した場合の図7の構成の動作
は、次のようになる。プロセッサでメインメモリに対す
るアクセス要求が発生し制御部で要求アドレスをブロッ
クアドレスに変換し、キャッシュアレイ、先読みバッフ
ァを検索するまでの動作は図2の場合と同様である。本
実施の形態3では、要求されたブロックアドレスがキャ
ッシュアレイ、先読みバッファに登録されているかを検
査するだけでなく、先読みタグに登録されているかいな
いかも検査する。このキャッシュアレイ、先読みバッフ
ァ、先読みタグの検索は同時にできる。When the prefetch buffer and the prefetch tag are configured as in the third embodiment of the present invention, the operation of the configuration shown in FIG. 7 is as follows. The operation from the generation of an access request to the main memory by the processor, the conversion of the request address to the block address by the control unit, and the search of the cache array and the prefetch buffer are the same as those in FIG. In the third embodiment, it is checked not only whether the requested block address is registered in the cache array and the prefetch buffer, but also whether the requested block address is registered in the prefetch tag. The cache array, the prefetch buffer, and the prefetch tag can be searched simultaneously.
【0078】要求されたブロックアドレスに対応するデ
ータが、すでにキャッシュアレイに格納されていた場
合、前述の実施の形態の場合と同様に、制御部は先読み
バッファからそのデータを読み出し、キャッシュアレイ
に転送すると共に、プロセッサにアクセス要求の結果と
して返す。If the data corresponding to the requested block address has already been stored in the cache array, the control unit reads the data from the prefetch buffer and transfers the data to the cache array, as in the above-described embodiment. And returns it to the processor as a result of the access request.
【0079】要求されたブロックアドレスに対応するデ
ータが、キャッシュアレイにはなく、先読みバッファに
格納されていた場合、制御部は先読みバッファからその
データをキャッシュアレイに転送すると共にプロセッサ
にアクセス要求の結果として返す。If the data corresponding to the requested block address is not in the cache array but is stored in the prefetch buffer, the control unit transfers the data from the prefetch buffer to the cache array, and transmits the result of the access request to the processor. As
【0080】要求されたブロックアドレスに対応するデ
ータがキャッシュアレイにも先読みバッファにもない場
合、先読み制御部はメインメモリにデータの読み出し要
求を発行し、返ってきた結果をキャッシュアレイに格納
すると共に、プロセッサにアクセス要求の結果を送る。
この場合、さらに先読みを行う。If the data corresponding to the requested block address is neither in the cache array nor in the prefetch buffer, the prefetch control unit issues a data read request to the main memory and stores the returned result in the cache array. Sends the result of the access request to the processor.
In this case, prefetching is further performed.
【0081】先読みは、要求されたブロックアドレスに
対応するデータの検査結果に関係なく、先読みタグの検
査結果に従ってなされる。制御部は、先読みタグの検索
結果に従って次の動作を行なう。The prefetching is performed according to the inspection result of the prefetch tag regardless of the inspection result of the data corresponding to the requested block address. The control unit performs the following operation according to the search result of the look-ahead tag.
【0082】(1) 要求されたブロックアドレスが先
読みタグに登録されている場合、そのタグ方向の内容に
よって次の動作をする。 方向が上位のブロックのみを先読みし、先読みバッ
ファに格納する。同時に、先読みタグに先読みしたブロ
ックアドレスを登録し、方向をUとする。(1) When the requested block address is registered in the look-ahead tag, the following operation is performed depending on the content in the tag direction. Only the block whose direction is higher is prefetched and stored in the prefetch buffer. At the same time, the pre-read block address is registered in the pre-read tag, and the direction is U.
【0083】 方向が下位のブロックのみを先読み
し、先読みバッファに格納する。同時に、先読みタグに
先読みしたブロックアドレスを登録し、方向をDとす
る。 (2) 要求されたブロックアドレスが先読みタグに登
録されていない場合、上位、下位のブロックアドレスの
データを先読みして先読みバッファに格納し、先読みし
たブロックアドレスを先読みタグに登録し、上位ブロッ
クアドレスの方向をU、下位ブロックアドレスの方向を
Dとする。Only the block whose direction is lower is prefetched and stored in the prefetch buffer. At the same time, the pre-read block address is registered in the pre-read tag, and the direction is set to D. (2) If the requested block address is not registered in the prefetch tag, the data of the upper and lower block addresses are prefetched and stored in the prefetch buffer, the prefetched block address is registered in the prefetch tag, and the upper block address is registered. Is U, and the direction of the lower block address is D.
【0084】本実施の形態3では、タグを先読みバッフ
ァと独立させることによって、先読みバッファ欄の数よ
りタグの欄数を増やすことができる。その場合、先読み
バッファからデータが消えた後でもタグ情報だけは残す
ことができ、キャッシュミスヒットの場合でも、適切な
方向のみのブロックデータを先読みすることができる。
そのため、メインメモリとキャッシュメモリ装置との間
のデータ転送量を抑えることができる。In the third embodiment, the number of tag columns can be increased from the number of prefetch buffer columns by making the tags independent of the prefetch buffer. In that case, even after the data has disappeared from the prefetch buffer, only the tag information can be left, and even in the case of a cache miss, block data in only an appropriate direction can be prefetched.
Therefore, the amount of data transfer between the main memory and the cache memory device can be suppressed.
【0085】図9と図10は本発明の実施の形態3の動
作のフローチャートである。図9は全体の動作であり、
図10は先読み部のフローチャートである。図9のフロ
ーチャートを説明する。FIGS. 9 and 10 are flowcharts showing the operation of the third embodiment of the present invention. FIG. 9 shows the overall operation.
FIG. 10 is a flowchart of the prefetch unit. The flowchart of FIG. 9 will be described.
【0086】S1、S2 要求されたブロックがキャッ
シュアレイの中にすでに存在するか検査する。 S3、S4 S2の判定結果が存在しないものであれ
ば、要求されたブロックが先読みバッファの中にすでに
存在するか検査する。S1, S2 Check if the requested block already exists in the cache array. S3, S4 If the determination result in S2 does not exist, it is checked whether the requested block already exists in the prefetch buffer.
【0087】S5、S4の判定結果が存在するものであ
れば、先読みバッファのデータをキャシュアレイに転送
する。 S6 先読みバッファ内の要求されたブロックを消去す
る。If the determination results in S5 and S4 exist, the data in the prefetch buffer is transferred to the cache array. S6 Erase the requested block in the prefetch buffer.
【0088】S7 S4の検索結果が存在しないもので
あれば、メインメモリに対して、要求されたブロック、
上位ブロック、下位ブロックのデータ転送を要求する。 S8 S2の判定結果が存在するものであれば、アクセ
ス結果をプロセッサに送る。S7 If the search result of S4 does not exist, the requested block,
Requests data transfer of upper block and lower block. S8 If the determination result in S2 exists, the access result is sent to the processor.
【0089】S9 先読み部の処理を行なう(図10参
照)。 図10の本実施の形態3の先読み部のフローチャートを
説明する。 S21、S25 要求されたブロックがキャッシュアレ
イの中にすでに存在するか検査する。S9 The process of the prefetch unit is performed (see FIG. 10). A flowchart of the prefetch unit according to the third embodiment in FIG. 10 will be described. S21, S25 Check whether the requested block already exists in the cache array.
【0090】S23 S22の判定結果が存在しないも
のであれば、上位ブロック、下位ブロックのデータを先
読みする。 S24 上位ブロックにU、下位ブロックにDの方向タ
グをつけ、先読みタグに格納する。S23 If the judgment result in S22 does not exist, the data of the upper block and the lower block are pre-read. S24 Attach a direction tag of U to the upper block and a direction tag of D to the lower block, and store them in the prefetch tag.
【0091】S25、S26 S25で方向検査をし、
下位方向(D)であればS26で下位ブロックのデータ
を先読みする。 S27 下位ブロックにDの方向タグをつけ、先読みタ
グに格納する。S25, S26 The direction is checked in S25,
If it is in the lower direction (D), the data of the lower block is prefetched in S26. S27 Attach a direction tag of D to the lower block and store it in the look-ahead tag.
【0092】S28 S25の方向検査で上位方向
(U)なら上位方向のデータを先読みする。 S29 上位ブロックにUの方向タグをつけ、先読みタ
グに格納する。S28 If the direction check in S25 is the upper direction (U), the data in the upper direction is prefetched. S29 Attach a U direction tag to the upper block and store it in the prefetch tag.
【0093】図11は本発明の実施の形態4の先読みバ
ッファと先読みタグである。本発明の実施の形態3のよ
うに先読みタグを持つ場合には先読みバッファと先読み
タグの双方にブロックアドレスをもつ必要がある。この
ことは2つの場所で同じブロックアドレスをもつことに
なり無駄なことであるが、先読みタグを独立してもつと
ともに、先読みバッファにもタグをもたせ、先読みバッ
ファにもタグ情報をもたせることができるよにする。こ
のようにしてブロックアドレスを2つ持つことの無駄を
なくすことができる。FIG. 11 shows a look-ahead buffer and look-ahead tags according to the fourth embodiment of the present invention. In the case of having a prefetch tag as in the third embodiment of the present invention, it is necessary to have a block address in both the prefetch buffer and the prefetch tag. This has the same block address in two places, which is wasteful. However, it is possible to have a look-ahead tag independently, to have a tag in a look-ahead buffer, and to have a tag information in a look-ahead buffer. Do well. In this way, the waste of having two block addresses can be eliminated.
【0094】図11(a)に示すように、本実施の形態
4の先読みバッファは有効/無効フラグ、ブロックアド
レス、データの他に方向タグ(U/D)をもつ。さら
に、図11(b)に示す用に先読みタグをもつ。As shown in FIG. 11A, the prefetch buffer according to the fourth embodiment has a direction tag (U / D) in addition to a valid / invalid flag, a block address, and data. Further, it has a look-ahead tag as shown in FIG.
【0095】本発明の実施の形態4の装置構成は図7と
同様である。本実施の形態4は次のように動作する。プ
ロセッサでメモリアドレスが発生して制御装置でアクセ
ス要求をブロックアドレスに変換し、キャッシュアレ
イ、先読みバッファ、先読みタグを検索するまでの動作
は本発明の実施の形態3と同様である。また、このキャ
ッシュアレイ、先読みバッファ、先読みタグの検索は同
時にできる点も本実施の形態3と同様である。さらに、
要求アドレスのデータが、すでにキャッシュアレイに格
納されていた場合、先読み制御部はキャッシュアレイか
らそのデータを読み出し、プロセッサにアクセス要求の
結果として返す点も本発明の実施の形態3と同様であ
る。The device configuration of the fourth embodiment of the present invention is the same as that of FIG. The fourth embodiment operates as follows. The operations from generating a memory address in the processor, converting the access request into a block address in the control device, and searching for the cache array, prefetch buffer, and prefetch tag are the same as those in the third embodiment of the present invention. In addition, the cache array, the prefetch buffer, and the prefetch tag can be searched at the same time as in the third embodiment. further,
When the data of the request address is already stored in the cache array, the prefetch control unit reads the data from the cache array and returns the data to the processor as a result of the access request, similarly to the third embodiment of the present invention.
【0096】要求されたブロックアドレスに対応するデ
ータがキャッシュアレイにはなく、先読みバッファにあ
る場合、制御装置は次の4つの動作を行なう。 1.先読みバッファからそのデータを読み出し、キャッ
シュアレイにコピーする。If the data corresponding to the requested block address is not in the cache array but is in the prefetch buffer, the control device performs the following four operations. 1. The data is read from the prefetch buffer and copied to the cache array.
【0097】2.1と同時に、先読みバッファから読み
出されたデータをアクセス要求の結果として返す。 3.先読みバッファのタグ(方向)の状態に応じて、さ
らに先読みを行なう。At the same time as 2.1, the data read from the prefetch buffer is returned as a result of the access request. 3. Further prefetching is performed according to the state of the tag (direction) of the prefetch buffer.
【0098】 方向の状態がUなら、さらに上位のブ
ロックアドレスに対応するデータを先読みデータとして
メインメモリに要求する。 方向の状態がDなら、さらに下位のブロックアドレ
スに対応するデータを先読みデータとしてメインメモリ
に要求する。If the state of the direction is U, a request is made to the main memory for data corresponding to a higher block address as prefetch data. If the state of the direction is D, data corresponding to a lower block address is requested to the main memory as prefetch data.
【0099】4.1、2、3が終了した後、先読みバッ
ファから要求されたブロックアドレスに対応するデータ
を消去し、同時に先読みバッファに登録されていたブロ
ックアドレスとタグ情報を先読みタグに保持する。After the steps 1, 2, 3 are completed, the data corresponding to the requested block address is erased from the prefetch buffer, and the block address and tag information registered in the prefetch buffer are simultaneously held in the prefetch tag. .
【0100】要求されたブロックアドレスに対応するデ
ータがキャッシュアレイにも先読みバッファにもなかっ
た場合、メインメモリからデータ読み出しを行なう。さ
らに、先読みバッファおよび先読みタグを検査し、次の
動作を行なう。If there is no data corresponding to the requested block address in the cache array or the prefetch buffer, data is read from the main memory. Further, the prefetch buffer and the prefetch tag are checked, and the following operation is performed.
【0101】(1)要求されたブロックアドレスが先読
みタグに登録されている場合、そのタグの方向の内容に
よって、 方向がUなら、上位のブロックのみを先読みし、先
読みバッファに格納する。さらに,その先読みバッファ
のタグ格納部分に方向情報としてUを登録する。(1) When the requested block address is registered in the look-ahead tag, if the direction is U according to the contents of the direction of the tag, only the upper block is prefetched and stored in the prefetch buffer. Further, U is registered as direction information in the tag storage portion of the prefetch buffer.
【0102】 方向がDなら、下位のブロックのみを
先読みし、先読みバッファに格納する。さらに、先読み
バッファのタグ格納部分に方向情報としてDを登録す
る。 (2) 要求されたブロックアドレスが先読みタグに登
録されていない場合、上位、下位のブロックを先読み
し、先読みバッファに格納する。If the direction is D, only the lower block is prefetched and stored in the prefetch buffer. Further, D is registered as direction information in the tag storage portion of the prefetch buffer. (2) If the requested block address is not registered in the prefetch tag, the upper and lower blocks are prefetched and stored in the prefetch buffer.
【0103】さらに,それらの先読みバッファのタグ格
納部分に方向情報として、上位のブロックにはU、下位
のブロックにはDを登録する。図12は本発明の実施の
形態4の全体の動作であり、本発明の実施の形態4の先
読み部のフローチャートは実施の形態3の先読み部のフ
ローチャート(図10)と同じである。Further, U is registered in the upper block and D is registered in the lower block as direction information in the tag storage portion of the prefetch buffer. FIG. 12 shows the entire operation of the fourth embodiment of the present invention. The flowchart of the prefetch unit according to the fourth embodiment of the present invention is the same as the flowchart of the prefetch unit (FIG. 10) of the third embodiment.
【0104】図12の全体のフローチャートを説明す
る。 S1、S2 要求されたブロックがキャッシュアレイ
の中にすでに存在するか検査する。The overall flowchart of FIG. 12 will be described. S1, S2 Check if the requested block already exists in the cache array.
【0105】S3、S4 S2の判定結果が存在しない
ものであれば、要求されたブロックが先読みバッファの
中にすでに存在するか検査する。 S5 S4の判定結果が存在するものであれば、先読み
バッファのデータをキャシュアレイに転送する。S3, S4 If the judgment result in S2 does not exist, it is checked whether the requested block already exists in the prefetch buffer. S5 If the determination result in S4 exists, the data in the prefetch buffer is transferred to the cache array.
【0106】S6 方向検査をする。DであればS7の
処理を行ない、UであればS9の処理を行なう。 S7 下位ブロックのデータを先読みする。S6 The direction inspection is performed. If D, the process of S7 is performed, and if U, the process of S9 is performed. S7 Pre-read the data of the lower block.
【0107】S8 先読みしたデ−タを先読みバッファ
に格納し、そのタグ格納部分に方向情報としてDを登録
する。 S9 上位ブロックのデータを先読みする。S8 The prefetched data is stored in the prefetch buffer, and D is registered in the tag storage portion as direction information. S9 The data of the upper block is pre-read.
【0108】S10 先読みしたデ−タを先読みバッフ
ァに格納し、そのタグ格納部分に方向情報としてUを登
録する。 S11 先読みバッファ内の要求されたブロックを消去
する。S10 The prefetched data is stored in the prefetch buffer, and U is registered as direction information in the tag storage portion. S11 Erase the requested block in the prefetch buffer.
【0109】S12 アクセス結果をプロセッサに送
る。 S13 S4の検索結果が存在しないものであれば、メ
インメモリに対して、要求されたブロックのデータ転送
を要求する。S12 The access result is sent to the processor. S13 If there is no search result in S4, a request is made to the main memory for data transfer of the requested block.
【0110】S14 S2の判定結果が存在するもので
あれば、アクセス結果をプロセッサに送る。 S15 先読み部の処理を行なう(図10参照)。S14 If the judgment result in S2 exists, the access result is sent to the processor. S15 The process of the prefetch unit is performed (see FIG. 10).
【0111】本実施の形態4の先読みタグを検索し、先
読みするブロックを決定する部分(先読み部)の動作は
図10と同様であるので説明は省略する。上記のよう
に、タグを先読みバッファと先読みタグの双方に持たせ
ることにより、効率的にタグを保持できる。The operation of the part (prefetch unit) for searching for the prefetch tag and determining the block to be prefetched according to the fourth embodiment is the same as that of FIG. 10, and therefore the description is omitted. As described above, the tag can be held efficiently by having the tag in both the prefetch buffer and the prefetch tag.
【0112】図13は本発明の実施の形態5である。本
発明の実施の形態5は、前述の各実施の形態のデータ転
送量をさらに少なくする方法である。前述の実施の形態
3もしくは実施の形態4と同様に先読みタグをもってい
る。先読みバッファは実施の形態3のようにタグ情報は
なくても良く、実施の形態4のように先読みバッファに
もタグ情報をもつようにしても良い。本実施の形態5で
は、キャッシュミスヒットの時にすぐには先読みをしな
い。そのかわり、先読みするはずであったことを表す情
報を記録する。後のメモリアクセスにおいて、この先読
みするはずであったブロックにアクセス要求があった
時、その先読み情報に基づいてブロックを先読みする。FIG. 13 shows a fifth embodiment of the present invention. Embodiment 5 of the present invention is a method for further reducing the data transfer amount of each of the above embodiments. It has a look-ahead tag as in the above-described third or fourth embodiment. The prefetch buffer may not have the tag information as in the third embodiment, and the prefetch buffer may also have the tag information as in the fourth embodiment. In the fifth embodiment, prefetching is not performed immediately at the time of a cache miss. Instead, it records information indicating that it should have been prefetched. In a later memory access, when an access request is made to the block that should have been prefetched, the block is prefetched based on the prefetch information.
【0113】図13(a)は本実施の形態5の先読みタ
グである。要求されたブロックアドレスに対応するデー
タが先読みバッファになかった時、制御装置は先読みタ
グ内に該当ブロックが登録されているか検査する。その
内容によって、次の動作を行なう。なお、以下では要求
されたブロックアドレスをADRと表す。FIG. 13A shows a look-ahead tag according to the fifth embodiment. If the data corresponding to the requested block address is not in the look-ahead buffer, the control unit checks whether the block is registered in the look-ahead tag. The following operation is performed according to the contents. Hereinafter, the requested block address is represented as ADR.
【0114】(1) ADRが先読みタグに登録されて
いなければ、ADR+1を方向Uとして、ADR−1を
方向Dとして登録する(方向フラグUのブロックアドレ
スの欄にADR+1、方向フラグDのブロックアドレス
にADR−1を書き込む)。 (2) ADRが先読みタグに登録されていれば、その
内容を見て、 方向がUなら、ADR+1に相当するデータをメイ
ンメモリから読み出し、先読みバッファに格納する。先
読みバッファの方向タグをUとする。(1) If ADR is not registered in the look-ahead tag, register ADR + 1 as direction U and register ADR-1 as direction D (ADR + 1 in the block address column of direction flag U, block address of direction flag D). ADR-1). (2) If the ADR is registered in the look-ahead tag, look at its contents. If the direction is U, read data corresponding to ADR + 1 from the main memory and store it in the look-ahead buffer. Let U be the direction tag of the prefetch buffer.
【0115】 方向がDなら、ADR−1に相当する
データをメインメモリから読み出し、先読みバッファに
格納する。先読みバッファの方向タグをDとする。 (3) その後、先読みタグから要求されたブロックア
ドレスに対応する欄を消去する。図13(b)は、要求
されたブロックアドレスに対応するデータが先読みバッ
ファになかった場合のフローチャートである。先読み部
のみを示す。全体のフローチャートは図9と共通であ
る。If the direction is D, data corresponding to ADR-1 is read from the main memory and stored in the prefetch buffer. The direction tag of the prefetch buffer is D. (3) Thereafter, the column corresponding to the block address requested from the prefetch tag is deleted. FIG. 13B is a flowchart in a case where data corresponding to the requested block address is not in the prefetch buffer. Only the prefetch part is shown. The entire flowchart is common to FIG.
【0116】以上の動作により、キャッシュミスヒット
しても1回は先読みせず、次に隣接するブロックにアク
セスが発生したときはじめて先読みする。そのため、連
続して動作する傾向があるときに初めて先読みを開始す
るので、メインメモリとキャッシュメモリとの間の転送
を効率的に行なうことができる。With the above operation, even if a cache miss occurs, read-ahead is not performed once, but read-ahead is performed only when an access occurs to a next adjacent block. Therefore, prefetching is started only when there is a tendency to operate continuously, so that transfer between the main memory and the cache memory can be performed efficiently.
【0117】S1、S2 要求されたブロックが、先読
みタグの中にすでに存在するか検査する。 S3 S2の検査で、存在しなければ、S3で先読みタ
グに上位方向であれば、ADR+1を登録し、下位方向
であれば、ADR−1を登録する。S1, S2 It is checked whether the requested block already exists in the look-ahead tag. S3 In the inspection in S2, if there is not, in S3, ADR + 1 is registered in the pre-read tag if it is in the upper direction, and ADR-1 is registered in the lower direction if it is in the lower direction.
【0118】S2 検査で存在すれば方向検査で下位方
向(D)であれば、S5の処理を行ない、方向検査で上
位方向(U)であれば、S356処理を行なう。 S5 下位ブロックのデータを先読みする。If it exists in the S2 inspection, if it is the lower direction (D) in the direction inspection, the process of S5 is performed, and if it is the upper direction (U) in the direction inspection, the S356 process is performed. S5 Pre-read the data of the lower block.
【0119】S6 上位ブロックのデータを先読みす
る。 図14は本発明の実施の形態6である。本発明の実施の
形態6は、同方向のc個以上の隣接ブロックに対して次
々にアクセスがあった場合にのみ先読みを行うものであ
る。S6 The data of the upper block is prefetched. FIG. 14 shows a sixth embodiment of the present invention. The sixth embodiment of the present invention performs prefetching only when c or more adjacent blocks in the same direction are successively accessed.
【0120】図14(a)はそのための先読みタグの実
施の形態を示す。先読みタグに深さkを記録する。kは
同方向の隣接ブロックに対して何回次々とアクセスした
かという回数である。深さkが一定数c以下であれば先
読みは行なわず、次の隣接するブロックのアドレスを先
読みタグに登録して、その深さをk+1として設定す
る。深さkが一定数c以上であれば、タグの内容を検査
し、タグの方向の内容がUであればさらに上位のブロッ
クを先読みする。タグの方向の内容が下位の方向Dであ
れば、さらに下位のブロックを先読みする。FIG. 14A shows an embodiment of a look-ahead tag for that purpose. Record the depth k in the look-ahead tag. k is the number of successive accesses to adjacent blocks in the same direction. If the depth k is equal to or smaller than a certain number c, prefetching is not performed, the address of the next adjacent block is registered in a prefetch tag, and the depth is set as k + 1. If the depth k is equal to or more than the predetermined number c, the contents of the tag are inspected, and if the contents in the direction of the tag are U, a higher-order block is prefetched. If the content of the tag direction is the lower direction D, the lower block is prefetched.
【0121】このようにして、プロセッサが上位方向、
下位方向に対して、ある一定数のブロックにまたがって
連続アクセスを行なった時にのみ、先読みを行なうとい
うものである。このようにすると、全体のキャッシュヒ
ット率は多少低下するが、キャッシュヒットになる可能
性が高いブロックのみを先読みすることになり、メイン
メモリとキャッシュメモリとの間の無駄なデータ転送量
を少なくすることができる。In this way, the processor moves upward,
In the lower direction, prefetching is performed only when continuous access is performed over a certain number of blocks. By doing so, the overall cache hit rate slightly decreases, but only the blocks that are likely to be cache hits are prefetched, and the amount of unnecessary data transfer between the main memory and the cache memory is reduced. be able to.
【0122】実施の形態6の先読みバッファの構成は本
発明の実施の形態5のものと同様である。先読みタグに
は図14(a)に示されるように深さ情報kを付加す
る。本実施の形態6の動作は、先読みバッファにデータ
がない場合以外は、実施の形態5と同様である。The structure of the prefetch buffer according to the sixth embodiment is the same as that of the fifth embodiment of the present invention. As shown in FIG. 14A, depth information k is added to the prefetch tag. The operation of the sixth embodiment is the same as that of the fifth embodiment except that there is no data in the prefetch buffer.
【0123】要求されたブロックアドレスに対応するデ
ータが先読みバッファになかった時、制御部は先読みタ
グ内に該当ブロックが登録されているか検査する。その
内容によって、次の動作を行なう。When the data corresponding to the requested block address is not in the prefetch buffer, the control unit checks whether the corresponding block is registered in the prefetch tag. The following operation is performed according to the contents.
【0124】(1) ADRが先読みタグに登録されて
いなければ、ADR+1を〔方向U、深さ1〕として、
ADR−1を〔方向D、深さ1〕として登録する。 (2) ADRが先読みタグに登録されていれば、その
内容を見て、 (a)ADRの深さkがある一定値c未満なら、 方向がUなら、ADR+1を〔方向U、深さk+
1〕として先読みタグに登録する。(1) If ADR is not registered in the look-ahead tag, ADR + 1 is set as [direction U, depth 1], and
ADR-1 is registered as [direction D, depth 1]. (2) If the ADR is registered in the look-ahead tag, look at its contents. (A) If the depth k of the ADR is less than a certain value c, if the direction is U, set ADR + 1 to [direction U, depth k +
1] is registered in the pre-read tag.
【0125】 方向がDなら、ADR−1を〔方向
U、深さk+1〕として先読みタグに登録する。 (b)ADRの深さkがある一定値c以上なら、 ADRの方向がUなら、ADR+1に相当するデー
タをメインメモリから読み出し、先読みバッファに格納
する。ADR+1の先読みバッファの方向タグをUとす
る。If the direction is D, ADR-1 is registered in the look-ahead tag as [direction U, depth k + 1]. (B) If the depth k of the ADR is equal to or greater than a certain value c, if the direction of the ADR is U, read data corresponding to ADR + 1 from the main memory and store it in the prefetch buffer. Let U be the direction tag of the ADR + 1 look-ahead buffer.
【0126】 方向がDなら、ADR−1に相当する
データをメインメモリから読み出し、先読みバッファに
格納する。先読みバッファの方向タグをDとする。 ADRの方向がDなら、ADR−1に相当するデー
タをメインメモリから読み出し、先読みバッファに格納
する。ADR−1の先読みバッファのタグの方向をDと
する。If the direction is D, data corresponding to ADR-1 is read from the main memory and stored in the prefetch buffer. The direction tag of the prefetch buffer is D. If the direction of ADR is D, data corresponding to ADR-1 is read from the main memory and stored in the prefetch buffer. Let D be the direction of the tag in the ADR-1 look-ahead buffer.
【0127】(3) その後、先読みタグから要求され
たブロックアドレスに対応する欄を消去する。図14
(b)は、要求されたブロックアドレスに対応するデー
タが先読みバッファになかった場合のフローチャートで
ある。先読み部のみを示す。全体のフローチャートは図
9と共通である。(3) Thereafter, the column corresponding to the block address requested from the prefetch tag is deleted. FIG.
FIG. 9B is a flowchart in the case where data corresponding to the requested block address is not in the prefetch buffer. Only the prefetch part is shown. The entire flowchart is common to FIG.
【0128】以上の動作により、キャッシュミスヒット
しても一定回数はキャッシュミスヒットしても、先読み
をしないで、次回から先読みをするので、連続して動作
する傾向が見られたときに初めて先読みを開始するの
で、メインメモリとキャッシュメモリとの間の転送を効
率的に行なうことができる。According to the above operation, even if a cache miss occurs or a certain number of cache misses occur, prefetching is performed from the next time without performing prefetching. Is started, the transfer between the main memory and the cache memory can be performed efficiently.
【0129】図14(b)のフローチャートを説明す
る。 S41、S42 要求されたブロックが、先読みタグの
中にすでに存在するか検査する。The flowchart of FIG. 14B will be described. S41, S42 It is checked whether the requested block already exists in the look-ahead tag.
【0130】S43 S42の検査で、存在しなけれ
ば、S43で先読みタグに上位方向であれば、ADR+
1を〔方向U、深さk+1〕、ADR−1を〔方向D、
深さk+1〕として先読みタグに登録する。S43: In the inspection in S42, if there is not, if it is determined in S43 that the pre-read tag is in the upper direction, ADR +
1 in [direction U, depth k + 1], and ADR-1 in [direction D,
Depth k + 1] is registered in the look-ahead tag.
【0131】S47、48 深さkを調べ、k≧cなら
S44の処理を行ない、k<cなら、S49の処理を行
なう。 S44、S45 方向検査で下位方向(D)であれば、
下位ブロックのデータを先読みする。S47, 48 The depth k is checked. If k ≧ c, the process of S44 is performed, and if k <c, the process of S49 is performed. S44, S45 If the direction check is the lower direction (D),
Read ahead the data in the lower block.
【0132】S44、S46 方向検査で上位方向
(U)であれば、上位ブロックのデータを先読みする。 S49、S50 方向検査で下位方向(D)であれば、
先読みタグにADR−1を〔方向D、深さk+1〕とし
て登録する。S44, S46 If the direction check indicates the upper direction (U), the data of the upper block is pre-read. S49, S50 If the direction check is the lower direction (D),
ADR-1 is registered in the look-ahead tag as [direction D, depth k + 1].
【0133】S49、S51 方向検査で上位方向
(U)であれば、先読みタグにADR+1を〔方向U、
深さk+1〕として登録する。S49, S51 If the direction check indicates the upper direction (U), ADR + 1 is added to the pre-read tag [direction U,
Depth k + 1].
【0134】[0134]
【発明の効果】本発明によれば、キャッシュヒット率が
向上し、メインメモリのアクセス時間を短縮することが
できる。先読みにともなうメインメモリとキャッシュメ
モリとの間のデータ転送量を少なくすることができる。
そのため、本発明によれば、メインメモリに対するアク
セス時間が見かけ上短い、高能率のキャッシュメモリ装
置を実現できる。According to the present invention, the cache hit rate is improved, and the access time of the main memory can be reduced. It is possible to reduce the amount of data transfer between the main memory and the cache memory due to prefetching.
Therefore, according to the present invention, a highly efficient cache memory device in which the access time to the main memory is apparently short can be realized.
【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing a basic configuration of the present invention.
【図2】本発明の実施の形態1、2の装置構成の例を示
す図である。FIG. 2 is a diagram illustrating an example of a device configuration according to the first and second embodiments of the present invention.
【図3】本発明の実施の形態1のキャッシュアレイと先
読みバッファを示す図である。FIG. 3 is a diagram illustrating a cache array and a prefetch buffer according to the first embodiment of the present invention.
【図4】本発明の実施の形態1のフローチャートを示す
図である。FIG. 4 is a diagram showing a flowchart of the first embodiment of the present invention.
【図5】本発明の実施の形態2の先読みバッファを示す
図である。FIG. 5 is a diagram illustrating a prefetch buffer according to a second embodiment of the present invention.
【図6】本発明の実施の形態2のフローチャートを示す
図である。FIG. 6 is a diagram showing a flowchart according to the second embodiment of the present invention.
【図7】本発明の実施の形態3、4、5、6の装置構成
の例を示す図である。FIG. 7 is a diagram illustrating an example of a device configuration according to Embodiments 3, 4, 5, and 6 of the present invention.
【図8】本発明の実施の形態3の先読みバッファと先読
みタグを示す図である。FIG. 8 is a diagram illustrating a prefetch buffer and a prefetch tag according to the third embodiment of the present invention.
【図9】本発明の実施の形態3のフローチャート(全
体)を示す図である。FIG. 9 is a diagram showing a flowchart (entire) of a third embodiment of the present invention.
【図10】本発明の実施の形態3のフローチャート(先
読み部)を示す図である。FIG. 10 is a diagram showing a flowchart (look-ahead unit) according to a third embodiment of the present invention.
【図11】本発明の実施の形態4の先読みバッファと先
読みタグを示す図である。FIG. 11 is a diagram illustrating a prefetch buffer and a prefetch tag according to the fourth embodiment of the present invention.
【図12】本発明の実施の形態4のフローチャート(全
体)を示す図である。FIG. 12 is a view showing a flowchart (entire) of a fourth embodiment of the present invention.
【図13】本発明の実施の形態5を示す図である。FIG. 13 is a diagram showing a fifth embodiment of the present invention.
【図14】本発明の実施の形態6を示す図である。FIG. 14 is a diagram showing a sixth embodiment of the present invention.
【図15】従来のキャッシュメモリを備える計算機シス
テムを示す図である。FIG. 15 is a diagram illustrating a computer system including a conventional cache memory.
1:プロセッサ 2:キャッシュメモリ装置 3:キャッシュメモリ 4:キャッシュ制御装置 5:制御部 6:キャッシュヒット判定部 7:データ読み出し部 8:下位ブロック読み出し部 9:上位ブロック読み出し部 10:メインメモリ 1: Processor 2: Cache memory device 3: Cache memory 4: Cache controller 5: Control unit 6: Cache hit determination unit 7: Data read unit 8: Lower block read unit 9: Upper block read unit 10: Main memory
Claims (3)
インメモリの代わりにプロセッサとの間でデータのやり
とりをするキャッシュメモリにおいて、 プロセッサからアクセス要求のあったアドレスである要
求アドレスをもとにメインメモリからデータを先読みす
る時に、該要求アドレスの上位と下位のアドレスのデー
タを読み出して保持することを特徴とするキャッシュメ
モリ装置。1. A cache memory which retains a part of the contents of a main memory and exchanges data with a processor instead of the main memory, based on a request address which is an address for which an access request is made from the processor. A cache memory device for reading and holding data of an upper address and a lower address of the request address when prefetching data from the main memory.
アドレスの上位アドレスであるか、あるいは下位アドレ
スであるかを表すタグ情報をつけ、該先読みデータにア
クセス要求があった時、そのタグ情報が上位アドレスを
示すものであれば該要求アドレスをもとに該上位アドレ
スのデータを先読みし、タグ情報が下位アドレスを示す
ものであれば該要求アドレスをもとに下位アドレスのデ
ータを先読みして保持することを特徴とする請求項1に
記載のキャッシュメモリ装置。2. A tag information indicating whether prefetched data to be prefetched and held is an upper address or a lower address of a request address is added. When an access request is made to the prefetched data, the tag information is When the tag information indicates the upper address, the data of the upper address is prefetched based on the request address. When the tag information indicates the lower address, the data of the lower address is prefetched based on the request address. 2. The cache memory device according to claim 1, wherein the cache memory device holds the cache memory.
回数を表す値kを記録し、kの値が予めきめた値cを越
えた時にタグ情報に従って先読みすることを特徴とする
請求項2に記載のキャッシュメモリ装置。3. The apparatus according to claim 2, wherein a value k representing the number of times of access requests has been recorded in arbitrary tag information, and prefetching is performed in accordance with the tag information when the value of k exceeds a predetermined value c. 3. A cache memory device according to claim 1.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10201417A JP2000035918A (en) | 1998-07-16 | 1998-07-16 | Cache memory device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10201417A JP2000035918A (en) | 1998-07-16 | 1998-07-16 | Cache memory device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2000035918A true JP2000035918A (en) | 2000-02-02 |
Family
ID=16440745
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10201417A Withdrawn JP2000035918A (en) | 1998-07-16 | 1998-07-16 | Cache memory device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2000035918A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6918009B1 (en) * | 1998-12-18 | 2005-07-12 | Fujitsu Limited | Cache device and control method for controlling cache memories in a multiprocessor system |
| KR20140111499A (en) * | 2013-03-11 | 2014-09-19 | 삼성전자주식회사 | System on chip and operating method thereof |
| CN113778909A (en) * | 2020-09-28 | 2021-12-10 | 北京京东振世信息技术有限公司 | Method and device for caching data |
-
1998
- 1998-07-16 JP JP10201417A patent/JP2000035918A/en not_active Withdrawn
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6918009B1 (en) * | 1998-12-18 | 2005-07-12 | Fujitsu Limited | Cache device and control method for controlling cache memories in a multiprocessor system |
| KR20140111499A (en) * | 2013-03-11 | 2014-09-19 | 삼성전자주식회사 | System on chip and operating method thereof |
| JP2014175017A (en) * | 2013-03-11 | 2014-09-22 | Samsung Electronics Co Ltd | System-on-chip and its operation method |
| KR102069273B1 (en) | 2013-03-11 | 2020-01-22 | 삼성전자주식회사 | System on chip and operating method thereof |
| CN113778909A (en) * | 2020-09-28 | 2021-12-10 | 北京京东振世信息技术有限公司 | Method and device for caching data |
| CN113778909B (en) * | 2020-09-28 | 2023-12-05 | 北京京东振世信息技术有限公司 | Method and device for caching data |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9418011B2 (en) | Region based technique for accurately predicting memory accesses | |
| US6965970B2 (en) | List based method and apparatus for selective and rapid cache flushes | |
| JP4060506B2 (en) | Disk controller | |
| JP2002536717A (en) | Technology for improving memory access in virtual memory systems | |
| JPH06318177A (en) | Method, device and computer system for reducing cache mistake penalty | |
| JP4451717B2 (en) | Information processing apparatus and information processing method | |
| JPH04233641A (en) | Method and apparatus for data pre-fetch | |
| JP3262519B2 (en) | Method and system for enhancing processor memory performance by removing old lines in second level cache | |
| US8621152B1 (en) | Transparent level 2 cache that uses independent tag and valid random access memory arrays for cache access | |
| US7657667B2 (en) | Method to provide cache management commands for a DMA controller | |
| CN100428193C (en) | A method of prefetching data in a data storage system | |
| CN112711383B (en) | Non-volatile storage reading acceleration method for power chip | |
| JPH08263380A (en) | Disk cache control method | |
| US20010032297A1 (en) | Cache memory apparatus and data processing system | |
| JP2000035918A (en) | Cache memory device | |
| CN110688155A (en) | Merging method for storage instruction accessing non-cacheable area | |
| JP4104283B2 (en) | Storage subsystem and information processing system | |
| JPH0950399A (en) | A cache memory system suitable for processing data arranged in a multidimensional space | |
| JP2001117818A (en) | Memory managing device, managing method, and recording medium recorded with managing program | |
| JP2000047942A (en) | Device and method for controlling cache memory | |
| US12367145B2 (en) | Remote acceleration for data dependent address calculation | |
| JPH05342101A (en) | Hierarchical cache memory | |
| JP2000347941A (en) | Cache memory device | |
| JPH06342401A (en) | Secondary storage controller | |
| JP2003016438A (en) | Image generation device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20051004 |