JPH08335188A - Cache memory device capable of controlling software - Google Patents

Cache memory device capable of controlling software

Info

Publication number
JPH08335188A
JPH08335188A JP7166987A JP16698795A JPH08335188A JP H08335188 A JPH08335188 A JP H08335188A JP 7166987 A JP7166987 A JP 7166987A JP 16698795 A JP16698795 A JP 16698795A JP H08335188 A JPH08335188 A JP H08335188A
Authority
JP
Japan
Prior art keywords
instruction
block
cache
data
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7166987A
Other languages
Japanese (ja)
Inventor
Satoru Nishimoto
哲 西本
Noriyasu Mori
教安 森
Hiroyasu Nishiyama
博泰 西山
Yoichi Takeuchi
洋一 竹内
Sumio Kikuchi
純男 菊池
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP7166987A priority Critical patent/JPH08335188A/en
Publication of JPH08335188A publication Critical patent/JPH08335188A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE: To avoid a problem on the contamination of a cache memory caused by data having the low frequency of use and to decrease a cache error by positively using information releating to memory access provided for a programmer and a compiler. CONSTITUTION: As the means of access to the cache memory, an instruction designating a real address and a set address is received. When the cache is accessed by designating the real address and the set address, those addresses are respectively stored in a real address storage means 201 and a set address storage means 202. Concerning the respective ways of the cache memory, comparing means 215 to 217 inspect cache hit or error to a cache block uniquely decided by the real address and the block of the set address designated by the instruction. Depending on the result, a cache control circuit 222 controls the cache operation.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、キャッシュミスを減少
させプロセッサの実行効率を向上させることのできるソ
フトウェア制御可能なキャッシュメモリ装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a software controllable cache memory device capable of reducing cache misses and improving processor execution efficiency.

【0002】[0002]

【従来の技術】コンピュータプログラムの主記憶参照に
は局所性がある。この性質を利用して、頻繁に参照され
る主記憶のデータをキャッシュメモリと呼ばれる高速で
小容量なメモリにコピーし、主記憶へのアクセスをこの
キャッシュメモリに対して行なうことによって、メモリ
アクセスを高速化させることが行なわれている。
2. Description of the Related Art Main memory references of computer programs have locality. Utilizing this property, data in the main memory that is often referred to is copied to a high-speed, small-capacity memory called a cache memory, and the main memory is accessed to this cache memory, thereby making memory access. Speeding up is done.

【0003】キャッシュメモリは、次のように動作す
る。プロセッサからのメモリアクセスに対し、まずその
データがキャッシュメモリ上に存在するかどうかを調べ
る。データがキャッシュメモリ上に存在すれば、キャッ
シュメモリ上のデータをプロセッサに転送する。存在し
なければ、そのデータを必要とする命令の実行を中断さ
せ、主記憶からキャッシュメモリにデータを転送する。
転送が終了したら、プロセッサが要求したデータをプロ
セッサに転送し、中断していた命令の実行を再開させ
る。
The cache memory operates as follows. For memory access from the processor, it is first checked whether the data exists in the cache memory. If the data exists in the cache memory, the data in the cache memory is transferred to the processor. If it does not exist, the execution of the instruction that requires the data is suspended, and the data is transferred from the main memory to the cache memory.
When the transfer is completed, the data requested by the processor is transferred to the processor, and the execution of the interrupted instruction is restarted.

【0004】このように、データがキャッシュメモリ上
に存在すれば、プロセッサはキャッシュメモリのアクセ
ス速度でデータを得ることができる。しかし、キャッシ
ュメモリ上にデータがない場合、プロセッサは主記憶か
らキャッシュメモリにデータが転送される間、実行を待
たされる。
Thus, if the data exists in the cache memory, the processor can obtain the data at the access speed of the cache memory. However, if there is no data in the cache memory, the processor is kept waiting for execution while the data is transferred from the main memory to the cache memory.

【0005】キャッシュミスは、データの初期参照、キ
ャッシュメモリの容量不足、およびキャッシュブロック
の競合によって生じる。データの初期参照によるミス
は、キャッシュブロック内のデータに対する最初のアク
セス時に生じる。すなわち、最初のデータ参照時にはキ
ャッシュ中には主記憶のコピーは存在しておらず、主記
憶からデータを転送する必要がある。
A cache miss is caused by initial reference of data, lack of cache memory capacity, and cache block contention. The miss due to the initial reference of the data occurs at the first access to the data in the cache block. That is, there is no copy of the main memory in the cache at the time of first data reference, and it is necessary to transfer the data from the main memory.

【0006】キャッシュメモリの容量不足によるミス
(容量性のミス)とは、キャッシュの容量がプログラム
の実行に必要なブロックを収容するのに十分でない場合
に、いくつかのブロックがキャッシュから追い出される
ことから生じるミスである。
A miss due to lack of capacity of the cache memory (capacitive miss) means that some blocks are evicted from the cache when the capacity of the cache is not sufficient to accommodate the blocks required for program execution. It is a mistake caused by.

【0007】キャッシュブロックの競合によるミス(競
合性のミス)とは、ダイレクトマップやセットアソシア
ティブ方式のキャッシュにおいて生じるミスである。こ
れらの方式では主記憶のアドレスとキャッシュ中のセッ
トとが対応しているため、同一セットに対してアクセス
する場合に競合が生じ、頻繁に使用するデータであって
も強制的にブロックから追い出されることがある。
The miss due to cache block conflict (competitive miss) is a miss that occurs in a direct map or set associative cache. In these methods, since the main memory address and the set in the cache correspond to each other, contention occurs when accessing the same set, and even frequently used data is forcibly removed from the block. Sometimes.

【0008】アーキテクチャ側から上記のキャッシュミ
スを減少させるには、次のようにすればよい。まず、キ
ャッシュ容量を、プログラムの実行に必要なデータが全
て入るほど十分大きくすることで、容量性のミスは回避
できる。次に、主記憶とキャッシュブロックのマッピン
グ方式をフルアソシアティブにすることで競合性のミス
は回避できる。
In order to reduce the above cache miss from the architecture side, the following may be done. First, by making the cache capacity large enough to contain all the data required to execute the program, capacity mistakes can be avoided. Next, by making the mapping method between the main memory and the cache block fully associative, it is possible to avoid the miss of competition.

【0009】しかしながら、上記の解決策の実現は、コ
ストとのトレードオフである。すなわち、キャッシュメ
モリの容量を大きくするとメモリ装置が高価になるし、
主記憶とキャッシュメモリとのマッピング方式をフルア
ソシアティブ方式にするとハードウェアが複雑化しキャ
ッシュの動作クロックが低下してしまう。
However, the realization of the above solution is a trade-off with cost. That is, if the capacity of the cache memory is increased, the memory device becomes expensive,
If the mapping method between the main memory and the cache memory is set to the full associative method, the hardware becomes complicated and the operation clock of the cache decreases.

【0010】キャッシュミスを減少させる方法は、アー
キテクチャ側からだけでなく、コンパイラ、およびプロ
グラマの側からも考えることができる。プログラマは、
プログラム中で使用されるデータの参照についての情報
を持っている。コンパイラもまた、データフロー解析に
代表される最適化処理により、データ参照についての情
報をプログラムから得ることができる。これらのデータ
アクセス情報を、キャッシュメモリをアクセスする際の
ヒントとして利用することで、キャッシュミスを減少さ
せることが可能である。
Methods for reducing cache misses can be considered not only from the architecture side, but also from the compiler and programmer side. The programmer
Holds information about references to data used in the program. The compiler can also obtain information about the data reference from the program by the optimization process represented by the data flow analysis. It is possible to reduce cache misses by using these data access information as hints when accessing the cache memory.

【0011】そこで近年、プログラムの特性を利用した
り、あるいはコンパイラの解析結果をもとにして、ソフ
トウェアによってキャッシュを制御するさまざまな方法
が提案されている。以下に示す従来技術は、キャッシュ
メモリ装置のソフトウェアによる操作を試みた例であ
る。
Therefore, in recent years, various methods have been proposed in which the cache is controlled by software by utilizing the characteristics of the program or based on the analysis result of the compiler. The prior art shown below is an example of an attempt to operate the cache memory device by software.

【0012】まず、プログラムの特性に応じて、実行時
にキャッシュブロックサイズ、セット数、およびブロッ
ク転送サイズを変更可能にするものがあげられる。通常
これらのパラメータは、システム立ち上げ時には決定し
ている。これを各プログラムに応じて変更することで、
より柔軟にメモリアクセスを行なうことができる。
[0012] First, there is a method in which the cache block size, the number of sets, and the block transfer size can be changed at the time of execution according to the characteristics of the program. Normally, these parameters are decided at system startup. By changing this according to each program,
Memory access can be performed more flexibly.

【0013】次に、プリフェッチと呼ばれる方式をあげ
ることができる。プリフェッチとは、将来使用されるこ
とが予想されるデータを、実行に先だってキャッシュへ
転送しておく方式である。プリフェッチを行うことによ
り、初期参照によるキャッシュミスを減少させることが
できる。プリフェッチを実現するための方法としては、
明確にプリフェッチ用の命令を備える方法、特定のレジ
スタへのロード命令によってキャッシュにデータを転送
する方法、キャッシュミスによるブロック転送時に隣接
ブロックも共に転送する方法などが提案されている。
Next, there is a method called prefetch. Prefetch is a method in which data expected to be used in the future is transferred to the cache prior to execution. By performing prefetch, cache misses due to initial reference can be reduced. As a method to realize prefetch,
There are proposed a method of clearly providing a prefetch instruction, a method of transferring data to a cache by a load instruction to a specific register, a method of transferring an adjacent block together when a block is transferred due to a cache miss, and the like.

【0014】さらに、特開平4−2741号では、上記
のプリフェッチ方式の改良がなされている。これによる
と、データをプリフェッチするモード(プリフェッチモ
ード)を設け、ロード命令に対し、プリフェッチモード
ならば、隣接ブロックも同時にキャッシュにプリフェッ
チする。また、ロード命令のオフセットを記録する手段
を設け、単に隣接ブロックをプリフェッチする代わり
に、、現在アクセスしたアドレスにこのオフセットを足
したアドレスを含むブロックをプリフェッチするように
している。これにより、従来問題とされていた不要なブ
ロックのキャッシュへのプリフェッチという問題を解決
しようとしている。さらに、キャッシュのセット中の特
定ブロックだけがプリフェッチデータを格納可能である
ようにし、キャッシュブロックにプリフェッチされたデ
ータかどうかを識別するビットを設けることにより、プ
リフェッチされたブロックが通常のロード命令によって
キャッシュから追い出されることを防いでいる。
Further, in Japanese Patent Laid-Open No. 4-2741, the above prefetch method is improved. According to this, a mode for prefetching data (prefetch mode) is provided, and in the prefetch mode for a load instruction, adjacent blocks are also prefetched into the cache at the same time. Further, a means for recording the offset of the load instruction is provided, and instead of simply prefetching an adjacent block, a block including an address obtained by adding this offset to the currently accessed address is prefetched. This is trying to solve the problem of prefetching unnecessary blocks into the cache, which has been a problem in the past. In addition, by allowing only certain blocks in the set of caches to store prefetched data, and by providing a bit in the cache block to identify if it is prefetched data, the prefetched block is cached by a normal load instruction. It prevents you from being kicked out.

【0015】特開平6−202951号では、階層キャ
ッシュメモリの各レベルに対するメモリアクセス命令を
備えることで、より積極的にキャッシュメモリを操作し
ようとする技術が提案されている。この技術は、使用頻
度の低いデータによるキャッシュメモリの汚染を防ぐこ
とを目的としている。具体的には、メモリの各階層すな
わち主記憶および各レベルのキャッシュに対してアクセ
スする命令を備えることで、上記目的を達成しようとし
ている。例えば、キャッシュメモリ装置が2階層キャッ
シュである場合、メモリアクセス命令として、第1レベ
ルのキャッシュメモリに対しては第1ロード命令と第1
ストア命令とを備え、第2レベルのキャッシュメモリに
対しては第2ロード命令と第2ストア命令とを備え、主
記憶に対しては主記憶アクセスロード命令と主記憶アク
セスストア命令とを備えるようにする。
Japanese Unexamined Patent Publication No. 6-202951 proposes a technique for more aggressively operating a cache memory by providing a memory access instruction for each level of the hierarchical cache memory. This technique is intended to prevent the cache memory from being contaminated by infrequently used data. Specifically, the above object is achieved by providing an instruction to access each hierarchy of the memory, that is, the main memory and the cache of each level. For example, when the cache memory device is a two-level cache, the memory access instructions include the first load instruction and the first load instruction for the first level cache memory.
A store instruction, a second load instruction and a second store instruction for the second level cache memory, and a main memory access load instruction and a main memory access store instruction for the main memory. To

【0016】2階層構造を持つ通常のキャッシュメモリ
では、メモリアクセスが生じると、まず第1レベルのキ
ャッシュが調べられ、ヒットしたら第1レベルのキャッ
シュからデータがプロセッサに返される。ミスした場合
は、第2レベルのキャッシュが調べられ、第2レベルの
キャッシュでヒットしたら、まず第2レベルのキャッシ
ュブロックが第1レベルのキャッシュメモリに転送され
る。ここで第1レベルと第2レベルのキャッシュブロッ
クの入れ替えが生じる。その後、第1レベルのキャッシ
ュからプロセッサにデータが返される。第2レベルのキ
ャッシュでもミスした場合、まず主記憶から第2レベル
のキャッシュにブロックが転送される。その後、このブ
ロックが第2レベルから第1レベルのキャッシュに転送
され、最後に第1レベルのキャッシュからデータがプロ
セッサに転送される。
In a normal cache memory having a two-layer structure, when a memory access occurs, the first level cache is checked first, and if hit, the data is returned from the first level cache to the processor. In the case of a miss, the second level cache is checked, and if the second level cache is hit, the second level cache block is first transferred to the first level cache memory. Here, the replacement of the cache blocks of the first level and the second level occurs. The data is then returned to the processor from the first level cache. When a miss is made in the second level cache, the block is first transferred from the main memory to the second level cache. The block is then transferred from the second level to the first level cache and finally the data is transferred from the first level cache to the processor.

【0017】上記のようにキャッシュメモリを操作する
と、コンパイラおよびプログラマが使用頻度が低いと認
識しているデータであっても、すべて第1レベルのキャ
ッシュまで転送された後でプロセッサに返される。ここ
で、使用頻度の低いデータのアクセスにより、使用頻度
の高い第1レベルのキャッシュ上のデータが追い出され
ることが問題となる。
When the cache memory is operated as described above, even data that the compiler and programmer recognize as infrequently used is transferred to the processor after being transferred to the first level cache. Here, it becomes a problem that the data on the first level cache, which is frequently used, is expelled by accessing the data which is rarely used.

【0018】この問題を回避するために、前述の特開平
6−202951号に開示された技術では、第1ロード
命令、第1ストア命令、第2ロード命令、第2ストア命
令、主記憶アクセスロード命令、および主記憶アクセス
ストア命令を備え、次のように動作するようにしてい
る。
In order to avoid this problem, in the technique disclosed in the above-mentioned Japanese Patent Laid-Open No. 6-202951, the first load instruction, the first store instruction, the second load instruction, the second store instruction, and the main memory access load. It has an instruction and a main memory access store instruction, and operates as follows.

【0019】まず、第1ロード命令または第1ストア命
令がキャッシュメモリに受け入れられると、キャッシュ
メモリは前述した一般的なメモリアクセスと同じように
動作をする。すなわち、キャッシュがミスした場合、下
位のレベルのメモリから第1レベルのキャッシュまでブ
ロックが転送された後、第1レベルのキャッシュからプ
ロセッサにデータが返されるか、またはプロセッサから
のデータが第1キャッシュにストアされる。
First, when the first load instruction or the first store instruction is received in the cache memory, the cache memory operates in the same manner as the general memory access described above. That is, if the cache misses, the block is transferred from the lower level memory to the first level cache, and then the data is returned from the first level cache to the processor, or the data from the processor is transferred to the first cache. Will be stored in.

【0020】第2ロード命令または第2ストア命令がキ
ャッシュメモリに受け入れられると、まず一般的なキャ
ッシュと同様に、第1レベルのキャッシュが調べられ
る。ここでキャッシュがヒットすると、第1レベルのキ
ャッシュからデータがロードされるか、または第1レベ
ルのキャッシュにデータが格納される。第1レベルのキ
ャッシュでミスすると、第2レベルのキャッシュが調べ
られる。ここでキャッシュがヒットすると、第2レベル
のキャッシュからデータがロードされるか、または第2
レベルのキャッシュにプロセッサからのデータが格納さ
れる。第2レベルのキャッシュでミスすると、主記憶が
アクセスされ、主記憶から対応するメモリブロックが第
2レベルのキャッシュに転送される。その後、第2レベ
ルのキャッシュからデータがプロセッサにロードされる
か、または第2レベルのキャッシュにプロセッサからの
データが格納される。このように、第2ロード命令また
は第2ストア命令が実行されて第1レベルのキャッシュ
がミスした場合、下位のメモリ階層からのブロックの転
送は第2レベルまでしか行なわれず、プロセッサとのデ
ータのやりとりは直接第2レベルのキャッシュとの間で
行なわれる。
When the second load instruction or the second store instruction is accepted into the cache memory, the first level cache is first examined like a general cache. If the cache hits here, the data is loaded from the first level cache or the data is stored in the first level cache. If you miss in the first level cache, the second level cache is examined. If the cache hits here, the data is loaded from the second level cache, or the second
Data from the processor is stored in the level cache. When a miss is made in the second level cache, the main memory is accessed and the corresponding memory block is transferred from the main memory to the second level cache. The data is then loaded into the processor from the second level cache or the data from the processor is stored in the second level cache. In this way, when the second load instruction or the second store instruction is executed and the first level cache misses, the block transfer from the lower memory hierarchy is performed only up to the second level, and the data with the processor is transferred. The interaction is directly with the second level cache.

【0021】主記憶アクセスロード命令および主記憶ア
クセスストア命令も、前記第2ロード命令および第2ス
トア命令と同様に、第1、第2レベルのキャッシュでミ
スした場合、主記憶から第1、第2レベルのキャッシュ
へのブロックの転送は行なわれず、プロセッサとのデー
タのやりとりは直接主記憶との間で行なわれる。
Similarly to the second load instruction and the second store instruction, the main memory access load instruction and the main memory access store instruction also cause the first and the second from the main memory when a miss occurs in the first and second level caches. No blocks are transferred to the two-level cache, and data is exchanged with the processor directly to / from the main memory.

【0022】以上より、コンパイラおよびプログラマ
が、最も使用頻度が高いと判断したデータへのアクセス
に第1ロード命令および第1ストア命令を使用し、使用
頻度の低いデータへのアクセスに第2ロード命令および
第2ストア命令並びに主記憶アクセスロード命令および
主記憶アクセスストア命令を使用することで、使用頻度
の低いデータによるキャッシュの汚染、すなわち使用頻
度の高いデータの上位レベルキャッシュからの追い出し
を回避することができる。
From the above, the compiler and the programmer use the first load instruction and the first store instruction to access the data determined to be most frequently used, and the second load instruction to access the less frequently used data. And the second store instruction and the main memory access load instruction and the main memory access store instruction to avoid cache pollution by infrequently used data, that is, eviction of frequently used data from the upper level cache. You can

【0023】[0023]

【発明が解決しようとする課題】上述したように、従来
のキャッシュメモリ装置のソフトウェアによる制御、特
にプリフェッチに関する方法を用いて実際のデータ使用
に先だってキャッシュにデータをプリフェッチすること
により、初期参照ミスを減少させることができる。
As described above, by prefetching data into the cache prior to actual data use by using the software control of the conventional cache memory device, in particular, the method related to prefetching, an initial reference miss can be prevented. Can be reduced.

【0024】しかし、主記憶とキャッシュメモリとのマ
ッピング方式にダイレクトマップ方式またはセットアソ
シアティブ方式を採用する限り、必要なブロックが追い
出されるというキャッシュブロックの競合によるミスは
解消できない。すなわち、大きな配列をシーケンシャル
にアクセスするような場合、より使用頻度の高いデータ
もキャッシュから追い出されてしまうという問題があ
る。
However, as long as the direct map method or the set associative method is adopted as the mapping method between the main memory and the cache memory, the miss due to the contention of the cache block that the necessary block is evicted cannot be eliminated. That is, when a large array is sequentially accessed, there is a problem in that even more frequently used data will be evicted from the cache.

【0025】また、従来技術で紹介した技術(特開平6
−202951号)では、各レベル別のメモリアクセス
命令によって、より上位レベルのキャッシュの汚染は回
避できるが、同一レベルのキャッシュメモリの汚染は回
避できない。
Further, the technique introduced in the prior art (Japanese Patent Laid-Open No. Hei 6)
No. 202951), the contamination of the cache of a higher level can be avoided by the memory access instruction for each level, but the contamination of the cache memory of the same level cannot be avoided.

【0026】さらに従来のキャッシュメモリ装置では、
データが格納されている主記憶の実アドレスのみを指定
したメモリアクセス命令がキャッシュメモリにアクセス
する唯一の手段であることから、プログラマおよびコン
パイラの持つ情報を、キャッシュミスを減少させるため
に積極的に活用することができない。
Further, in the conventional cache memory device,
Since the memory access instruction that specifies only the real address of the main memory where the data is stored is the only means to access the cache memory, the information held by the programmer and the compiler should be aggressively reduced to reduce cache misses. Cannot be utilized.

【0027】本発明の目的は、使用頻度の低いデータに
よるキャッシュメモリの汚染に関する問題を回避でき、
かつプログラマおよびコンパイラが持つメモリアクセス
に関する情報を積極的に用いることにより、キャッシュ
ミスを減少させプロセッサの実行効率を向上させること
のできるキャッシュメモリ装置を提供することである。
An object of the present invention is to avoid the problem of polluting the cache memory with infrequently used data,
Another object of the present invention is to provide a cache memory device capable of reducing cache misses and improving processor execution efficiency by positively using information relating to memory access held by a programmer and a compiler.

【0028】[0028]

【課題を解決するための手段】上記課題を解決するため
に、本発明の請求項1に係るキャッシュメモリ装置は、
プロセッサと主記憶装置との間に位置し、該主記憶装置
に記憶されるデータをキャッシュメモリにキャッシング
することにより、該プロセッサからの主記憶アクセス命
令を受けて高速なメモリアクセスを行なうキャッシュメ
モリ装置であって、実アドレスによる第1のアクセス手
段と、命令によって指定されたキャッシュメモリのセッ
トアドレスによる第2のアクセス手段とを備えたことを
特徴とする。
In order to solve the above-mentioned problems, a cache memory device according to claim 1 of the present invention comprises:
A cache memory device that is located between a processor and a main memory device, and caches data stored in the main memory device to a cache memory to perform a high-speed memory access in response to a main memory access instruction from the processor. It is characterized in that it comprises first access means by a real address and second access means by a set address of the cache memory designated by an instruction.

【0029】また、請求項2に係るキャッシュメモリ装
置は、プロセッサと主記憶装置との間に位置し、該主記
憶装置に記憶されるデータをキャッシュメモリにキャッ
シングすることにより、該プロセッサからの主記憶アク
セス命令を受けて高速なメモリアクセスを行なうキャッ
シュメモリ装置であって、実アドレスのみを指定したメ
モリアクセス命令を受け、該命令に応じたメモリアクセ
ス動作を行なうとともに、該命令で指定された実アドレ
スに基づいて決定されるキャッシュブロックを用いてキ
ャッシングを行なう第1のアクセス手段と、実アドレス
とキャッシュブロックを特定するセットアドレスとを指
定したセットアドレス指定付きメモリアクセス命令を受
け、該命令に応じたメモリアクセス動作を行なうととも
に、該命令で指定されたセットアドレスに基づいて決定
されるキャッシュブロックを用いてキャッシングを行な
う第2のアクセス手段とを備えたことを特徴とする。
A cache memory device according to a second aspect of the present invention is located between the processor and the main storage device, and caches the data stored in the main storage device to the cache memory, thereby allowing the main memory from the processor to operate. A cache memory device that performs a high-speed memory access by receiving a memory access instruction, receives a memory access instruction that specifies only a real address, performs a memory access operation according to the instruction, and executes a memory access instruction that is specified by the instruction. A first access unit that performs caching using a cache block determined based on an address, and a memory access instruction with a set address designating a real address and a set address that identifies the cache block are received, and in response to the instruction Specified memory access operation Characterized in that a second access means for caching with cache block is determined based on the set address.

【0030】本発明のキャッシュメモリ装置は、実アド
レスのみを指定してキャッシュメモリにアクセスする通
常のロード、ストア、プリフェッチ命令に加え、実アド
レスとセットアドレスとを指定してキャッシュメモリに
アクセスするセットアドレス指定付きメモリアクセス命
令を受け付ける。セットアドレス指定付きメモリアクセ
ス命令としては、セットアドレス指定付きのロード、ス
トア、プリフェッチ命令と、セットアドレス指定付きキ
ャッシュブロック無効化命令がある。
The cache memory device of the present invention, in addition to the normal load, store, and prefetch instructions that specify only the real address to access the cache memory, sets that access the cache memory by specifying the real address and the set address. Accepts a memory access instruction with address specification. Memory access instructions with set address designation include load, store, and prefetch instructions with set address designation, and cache block invalidate instructions with set address designation.

【0031】主記憶装置とキャッシュメモリとのマッピ
ング方式としてセットアソシアティブ方式が採用された
ときは、セットアドレス指定による第2のアクセス手段
は、該セットアソシアティブ方式における特定の1つ以
上のウェイをアクセス対象とできる。
When the set associative method is adopted as the mapping method of the main memory device and the cache memory, the second access means by the set address designation accesses one or more specific ways in the set associative method. Can be

【0032】本発明に係るキャッシュメモリ装置では、
セットアドレス指定付きプリフェッチ命令を受けたとき
以下のように動作する。まず命令で指定された実アドレ
スで示されるデータが、該実アドレスに基づいて決定さ
れるキャッシュブロックに存在するかどうかを調べ、
(a)存在すれば、該キャッシュブロックを無効化し、
命令で指定されたセットアドレスのキャッシュブロック
に、命令で指定された実アドレスで示されるデータを含
む前記主記憶装置上のブロックを転送し、(b)存在し
なければ、命令で指定されたセットアドレスのキャッシ
ュブロックに、命令で指定された実アドレスで示される
データが存在するかどうかを調べ、(b1)存在しなけ
れば、命令で指定されたセットアドレスのキャッシュブ
ロックに、命令で指定された実アドレスで示されるデー
タを含む前記主記憶装置上のブロックを転送する。
In the cache memory device according to the present invention,
When a prefetch instruction with set address specification is received, it operates as follows. First, it is checked whether the data indicated by the real address specified by the instruction exists in the cache block determined based on the real address,
(A) If present, invalidate the cache block,
The block on the main storage device containing the data indicated by the real address designated by the instruction is transferred to the cache block of the set address designated by the instruction, and (b) if it does not exist, the set designated by the instruction It is checked whether or not the data indicated by the real address specified by the instruction exists in the cache block of the address. (B1) If it does not exist, the data specified by the instruction is specified in the cache block of the set address specified by the instruction. Transfer the block on the main memory containing the data indicated by the real address.

【0033】本発明に係るキャッシュメモリ装置では、
セットアドレス指定付きロード命令を受けたとき以下の
ように動作する。まず命令で指定された実アドレスで示
されるデータが、該実アドレスに基づいて決定されるキ
ャッシュブロックに存在するかどうかを調べ、(a)存
在すれば、該キャッシュブロックを無効化し、命令で指
定されたセットアドレスのキャッシュブロックに、命令
で指定された実アドレスで示されるデータを含む前記主
記憶装置上のブロックを転送し、該転送されたブロック
内のデータを前記プロセッサに返し、(b)存在しなけ
れば、命令で指定されたセットアドレスのキャッシュブ
ロックに、命令で指定された実アドレスで示されるデー
タが存在するかどうかを調べ、(b1)存在すれば、そ
のデータを前記プロセッサに返し、(b2)存在しなけ
れば、命令で指定されたセットアドレスのキャッシュブ
ロックに、命令で指定された実アドレスで示されるデー
タを含む前記主記憶装置上のブロックを転送し、該転送
されたブロック内のデータを前記プロセッサに返す。
In the cache memory device according to the present invention,
When a load instruction with set address specification is received, it operates as follows. First, it is checked whether or not the data indicated by the real address designated by the instruction exists in the cache block determined based on the real address. (A) If it exists, the cache block is invalidated and designated by the instruction. A block on the main memory containing the data indicated by the real address specified by the instruction is transferred to the cache block of the set address, and the data in the transferred block is returned to the processor, (b) If it does not exist, it is checked whether or not the data indicated by the real address specified by the instruction exists in the cache block of the set address specified by the instruction. (B1) If it exists, the data is returned to the processor. , (B2) If it does not exist, the real address specified by the instruction is added to the cache block at the set address specified by the instruction. Transfer the blocks on the main memory device including a data indicated by the scan returns the data of the transferred block to the processor.

【0034】本発明に係るキャッシュメモリ装置では、
セットアドレス指定付きストア命令を受けたとき以下の
ように動作する。まず命令で指定された実アドレスで示
されるデータが、該実アドレスに基づいて決定されるキ
ャッシュブロックに存在するかどうかを調べ、(a)存
在すれば、該キャッシュブロックを無効化し、命令で指
定されたセットアドレスのキャッシュブロックに、命令
で指定された実アドレスで示されるデータを含む前記主
記憶装置上のブロックを転送し、前記プロセッサから与
えられたデータを該転送されたブロックに格納し、
(b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在すれば、前記プロセッサから与えられたデータ
を該ブロックに格納し、(b2)存在しなければ、命令
で指定されたセットアドレスのキャッシュブロックに、
命令で指定された実アドレスで示されるデータを含む前
記主記憶装置上のブロックを転送し、前記プロセッサか
ら与えられたデータを該転送されたブロックに格納す
る。
In the cache memory device according to the present invention,
When a store instruction with set address specification is received, it operates as follows. First, it is checked whether or not the data indicated by the real address designated by the instruction exists in the cache block determined based on the real address. (A) If it exists, the cache block is invalidated and designated by the instruction. Transfer a block on the main storage device containing data indicated by the real address specified by the instruction to the cache block of the set address, and store the data given from the processor in the transferred block,
(B) If it does not exist, it is checked whether or not the data indicated by the real address specified by the instruction exists in the cache block of the set address specified by the instruction.
1) If it exists, the data given from the processor is stored in the block. (B2) If it does not exist, it is stored in the cache block of the set address specified by the instruction.
A block on the main storage device containing the data indicated by the real address specified by the instruction is transferred, and the data given from the processor is stored in the transferred block.

【0035】主記憶を介さずにキャッシュブロック間で
データを転送する手段を備えるようにしてもよい。この
場合、上記セットアドレス指定付きプリフェッチ、ロー
ド、およびストア命令では、命令で指定された実アドレ
スで示されるデータが該実アドレスに基づいて決定され
るキャッシュブロックに存在する場合、無効化する前に
データをキャッシュブロック間で転送するようにする。
Means may be provided for transferring data between cache blocks without going through the main memory. In this case, in the set-address-specified prefetch, load, and store instructions, if the data indicated by the real address specified by the instruction exists in the cache block determined based on the real address, before invalidation Causes data to be transferred between cache blocks.

【0036】[0036]

【作用】セットアドレス指定付きプリフェッチ命令によ
り、ソフトウェアが指定したセットアドレスのキャッシ
ュブロックに、主記憶のデータを格納することが可能に
なる。データの実際の使用に先だってこのプリフェッチ
命令が実行されるようにコードを生成すると、実際のデ
ータの使用時の初期参照ミスが減少する。また、主記憶
の任意のブロックをキャッシュメモリ装置の任意のブロ
ックに格納できるため、フルアソシアティブなキャッシ
ュメモリと同様にブロックの競合によるミスを減少させ
ることができる。
The prefetch instruction with the set address designation makes it possible to store the data in the main memory in the cache block of the set address designated by the software. Generating the code so that this prefetch instruction is executed prior to the actual use of the data reduces initial reference misses when using the actual data. Further, since any block of the main memory can be stored in any block of the cache memory device, it is possible to reduce misses due to block competition as in the case of the fully associative cache memory.

【0037】競合を減少させる効果は、大きな配列をシ
ーケンシャルにアクセスする場合に顕著に現れる。従来
のキャッシュメモリ装置では、主記憶上のデータはその
実アドレスによって一意にキャッシュメモリにマッピン
グされる。この場合、大きな配列データをシーケンシャ
ルにアクセスすると、もともとキャッシュブロックに存
在していたデータは強制的に追い出されることになる。
一方、本発明よるセットアドレス指定付きキャッシュア
クセスでは、命令によって明示的に指定したキャッシュ
ブロックを繰り返して使用することができるため、他の
ブロックの追い出しを最小限に抑えることができる。
The effect of reducing competition is remarkable when sequentially accessing a large sequence. In the conventional cache memory device, the data on the main memory is uniquely mapped to the cache memory by its real address. In this case, if large array data is accessed sequentially, the data originally existing in the cache block will be forcibly expelled.
On the other hand, in the cache access with set address designation according to the present invention, since the cache block explicitly designated by the instruction can be repeatedly used, the eviction of other blocks can be minimized.

【0038】セットアドレス指定付きロード命令によ
り、ブロック指定可能なプリフェッチ命令によってキャ
ッシュメモリの特定のブロックに格納されたデータをレ
ジスタにロードすることが可能になる。セットアドレス
指定付きプリフェッチ命令とセットアドレス指定付きロ
ード命令により、セットアソシアティブ方式のキャッシ
ュメモリにもかかわらず、フルアソシアティブ方式と同
様に任意の主記憶ブロックを任意のキャッシュブロック
にマッピングでき、かつブロックを指定することによ
り、ハードウェアのコストはセットアソシアティブ程度
に押えることができる。
The load instruction with set address specification enables the data stored in a specific block of the cache memory to be loaded into the register by the block-specifiable prefetch instruction. Prefetch instruction with set address specification and load instruction with set address specification allow you to map any main memory block to any cache block and specify the block in the same way as in the full associative method, despite the cache memory of the set associative method. By doing so, the hardware cost can be suppressed to the level of set associative.

【0039】ブロック間にデータ転送手段を備えること
により、キャッシュブロックの無効化に伴うオーバーヘ
ッドを抑えることが可能になる。
By providing the data transfer means between the blocks, it becomes possible to suppress the overhead caused by invalidating the cache block.

【0040】[0040]

【実施例】以下、図面を用いて本発明の一実施例を説明
する。本実施例のキャッシュメモリ装置は、実アドレス
とキャッシュメモリのセットアドレスとを指定したメモ
リアクセスを行なうことのできるソフトウェア制御可能
なキャッシュメモリ装置である。
An embodiment of the present invention will be described below with reference to the drawings. The cache memory device of this embodiment is a software-controllable cache memory device that can perform memory access by designating a real address and a set address of the cache memory.

【0041】図1は、本発明に係わるキャッシュメモリ
装置を適用した計算機システムのブロック図である。本
実施例のキャッシュメモリ装置103は、プロセッサ
(CPU)101と主記憶装置102との間に置かれ
る。キャッシュメモリ装置103は、高速かつ小容量の
メモリで構成されるメモリ部105と、キャッシュメモ
リへのアクセスを制御するメモリ制御部104とから構
成される。
FIG. 1 is a block diagram of a computer system to which a cache memory device according to the present invention is applied. The cache memory device 103 of the present embodiment is placed between the processor (CPU) 101 and the main storage device 102. The cache memory device 103 includes a memory unit 105 configured by a high-speed and small-capacity memory, and a memory control unit 104 that controls access to the cache memory.

【0042】図2は、キャッシュメモリ装置103の構
成を表すブロック図である。なお、ここで説明する図2
のキャッシュメモリ装置103は、本発明を2ウェイセ
ットアソシアティブ方式のキャッシュに適用したもので
ある。
FIG. 2 is a block diagram showing the configuration of the cache memory device 103. Note that FIG. 2 described here
The cache memory device 103 is a 2-way set associative type cache to which the present invention is applied.

【0043】本実施例のキャッシュメモリ装置103
は、従来より用いられている通常のメモリアクセス命令
(すなわち、データの実アドレスのみを指定したロード
命令、ストア命令、プリフェッチ命令など)を受け付け
ることができる。このようなデータの実アドレスのみを
指定したメモリアクセスが発生すると、キャッシュメモ
リ装置103内のメモリ制御部104は、そのアドレス
に対応するデータがキャッシュ上に存在するかどうか
(具体的にはメモリ部105に存在するかどうか)を調
べる。データがキャッシュ上にあれば、(ロード命令の
場合)メモリ部105からデータをプロセッサ101に
転送したり、(ストア命令の場合)プロセッサ101か
らのデータをメモリ部105に転送したりする。データ
がキャッシュ上になければ、主記憶102に対しデータ
を要求する。
The cache memory device 103 of this embodiment
Can accept a conventional memory access instruction conventionally used (that is, a load instruction, a store instruction, a prefetch instruction, etc., which specify only a real address of data). When such a memory access that specifies only the real address of the data occurs, the memory control unit 104 in the cache memory device 103 determines whether the data corresponding to the address exists in the cache (specifically, the memory unit). 105). If the data is in the cache, the data is transferred from the memory unit 105 to the processor 101 (in the case of a load instruction), or the data from the processor 101 is transferred to the memory unit 105 (in the case of a store instruction). If the data is not in the cache, the main memory 102 is requested for the data.

【0044】さらに、本実施例のキャッシュメモリ装置
103では、本実施例に特有のセットアドレス指定付き
のメモリアクセス命令(データの実アドレスに加えてキ
ャッシュメモリのセットアドレスをも指定したロード命
令、ストア命令、プリフェッチ命令など)を受け付ける
ことができる。セットアドレス指定付き命令は、当該セ
ットアドレスで指定されたキャッシュブロックを用いて
キャッシングすることを明示的に指示するメモリアクセ
ス命令である。
Further, in the cache memory device 103 of the present embodiment, a memory access instruction with a set address designation peculiar to the present embodiment (a load instruction and a store which specify not only the real address of data but also the set address of the cache memory) Instructions, prefetch instructions, etc.) can be accepted. The instruction with set address designation is a memory access instruction that explicitly instructs caching using the cache block designated by the set address.

【0045】例えば、セットアドレス指定付きロード命
令を受けたとき、キャッシュメモリ装置103内のメモ
リ制御部104は、まず指定された実アドレスに対応す
るデータがキャッシュ上に存在するかどうかを調べ、デ
ータがキャッシュ上にあれば、そのブロックを無効化し
た後、指定された実アドレスのデータを主記憶102か
ら指定されたセットアドレスのブロックに転送し、その
後、該指定されたセットアドレスのブロックから当該デ
ータをロードする。また、指定された実アドレスに対応
するデータがキャッシュ上にないときは、指定されたセ
ットアドレスのブロックに当該データがあるかどうかを
調べ、データがそのブロックにあればそこからデータを
ロードする。指定されたセットアドレスのブロックに当
該データがなければ、指定された実アドレスのデータを
主記憶102から指定されたセットアドレスのブロック
に転送し、その後、該指定されたセットアドレスのブロ
ックから当該データをロードする。要するに、セットア
ドレス指定付きロード命令では、明示的に指定されたセ
ットアドレスのブロックを用いてキャッシングが行なわ
れる。他のセットアドレス指定付き命令も同様である。
なお、セットアドレス指定付き命令については、後に詳
述する。
For example, when a load instruction with set address designation is received, the memory control unit 104 in the cache memory device 103 first checks whether or not the data corresponding to the designated real address exists in the cache, and If it is in the cache, the block is invalidated, the data of the designated real address is transferred from the main memory 102 to the block of the designated set address, and then the block of the designated set address is concerned. Load the data. If the data corresponding to the specified real address is not in the cache, it is checked whether the block of the specified set address has the data, and if the data is in that block, the data is loaded from that block. If the block of the designated set address does not have the data, the data of the designated real address is transferred from the main memory 102 to the block of the designated set address, and then the data of the block of the designated set address is transferred. To load. In short, in the load instruction with set address specification, caching is performed using the block of the set address specified explicitly. The same applies to other instructions with set address designation.
The instruction with set address designation will be described later in detail.

【0046】図2を参照して、本実施例のキャッシュメ
モリ装置103の構成を説明する。実アドレス記憶手段
201は、CPU101からのメモリアクセス要求によ
って渡される主記憶102上の実アドレスを記憶する。
実アドレスは、メモリをアクセスするために論理的にブ
ロックアドレス部、セットアドレス部、およびブロック
内アドレス部に分割される。ブロックアドレス部は主記
憶102上のブロックを特定するブロックアドレス、セ
ットアドレス部はキャッシングされるキャッシュブロッ
クを特定するセットアドレス、ブロック内アドレス部は
ブロック内の相対アドレスを示している。
The configuration of the cache memory device 103 of this embodiment will be described with reference to FIG. The real address storage unit 201 stores the real address on the main memory 102, which is passed by the memory access request from the CPU 101.
The real address is logically divided into a block address part, a set address part, and an in-block address part for accessing the memory. The block address part indicates a block address that specifies a block on the main memory 102, the set address part indicates a set address that specifies a cache block to be cached, and the in-block address part indicates a relative address within the block.

【0047】セットアドレス記憶手段202は、セット
アドレス指定付き命令を受けた場合に使用される。セッ
トアドレス記憶手段202は、セットアドレス指定付き
命令により指定されたセットアドレスを記憶する。
The set address storage means 202 is used when an instruction with set address designation is received. The set address storage means 202 stores the set address designated by the instruction with set address designation.

【0048】本実施例におけるキャッシュメモリ装置1
03のメモリ部105は、ウェイ203およびウェイ2
04の2つのウェイから構成されている。各ウェイは、
ブロックアドレス記憶手段205,207とブロックデ
ータ記憶手段206,208とから構成される。ブロッ
クアドレス記憶手段205,207は、キャッシュの各
ブロック(具体的にはブロックデータ記憶手段206,
208の各ブロック)が主記憶上のどのブロックのコピ
ーを保持しているかを表すテーブルである。ブロックデ
ータ記憶手段206,208は、ブロックアドレス記憶
手段205,207に対応する主記憶のブロック内のデ
ータのコピーを保持する。
Cache memory device 1 in this embodiment
No. 03 memory unit 105 includes a way 203 and a way 2
It is composed of two ways 04. Each way
It comprises block address storage means 205, 207 and block data storage means 206, 208. The block address storage units 205 and 207 are each block of the cache (specifically, the block data storage unit 206,
Each block of 208) is a table showing which block in the main memory holds a copy. The block data storage means 206, 208 hold a copy of the data in the block of the main memory corresponding to the block address storage means 205, 207.

【0049】すなわち、ブロックアドレス記憶手段20
5はブロックアドレスを記憶するための複数のエントリ
を備えており、その各エントリはブロックデータ記憶手
段206の各ブロックに1対1対応している。ブロック
アドレス記憶手段205のあるエントリにあるブロック
アドレスが保持されているとき、そのエントリに対応す
るブロックデータ記憶手段206のブロックに、主記憶
のそのブロックアドレスのデータがキャッシングされて
いるということである。ブロックアドレス記憶手段20
7とブロックデータ記憶手段208との関係も同様であ
る。ブロックデータ記憶手段206,208の各ブロッ
クには、通常、複数語が格納される。
That is, the block address storage means 20
Reference numeral 5 has a plurality of entries for storing block addresses, and each entry has a one-to-one correspondence with each block of the block data storage means 206. That is, when a block address in an entry of the block address storage unit 205 is held, the block of the block data storage unit 206 corresponding to the entry is cached with the data of the block address in the main storage. . Block address storage means 20
7 and the block data storage means 208 are similar. A plurality of words are usually stored in each block of the block data storage means 206, 208.

【0050】比較器215,216,217は、実アド
レスのブロックアドレス部で示される主記憶のブロック
アドレスと、セットアドレス部で指定されるブロックア
ドレス記憶手段内のブロックアドレスとを比較する。比
較の結果、ブロックアドレスが一致すれば、キャッシュ
上(具体的にはブロックデータ記憶手段上)にブロック
アドレス記憶手段で示される実アドレス(ブロックアド
レス)のデータ(1ブロック分)が存在することにな
る。
The comparators 215, 216, 217 compare the block address of the main memory indicated by the block address part of the real address with the block address in the block address storage means specified by the set address part. If the block addresses match as a result of the comparison, it means that the data (for one block) of the real address (block address) indicated by the block address storage means exists in the cache (specifically, on the block data storage means). Become.

【0051】キャッシュ制御回路222は、比較器21
5,216,217からの出力(各ウェイにおけるキャ
ッシュヒット検査の結果)やCPUからの制御信号など
を入力し、キャッシュメモリ装置103全体の制御を行
なう。
The cache control circuit 222 includes a comparator 21.
Outputs from 5,216,217 (results of cache hit inspection in each way) and control signals from the CPU are input to control the cache memory device 103 as a whole.

【0052】次に、実アドレスのみを指定する通常のメ
モリアクセス命令に対する図2の装置の動作について説
明する。
Next, the operation of the apparatus of FIG. 2 for a normal memory access instruction designating only a real address will be described.

【0053】実アドレスのみを指定する通常のロード命
令によるメモリアクセスでは、まずCPU101からキ
ャッシュ制御回路222にロード命令の発行が伝えら
れ、それと同時にロードするデータの実アドレスも渡さ
れる。キャッシュ制御回路222は、与えられた実アド
レスを実アドレス記憶手段201にセットする(23
0)。セットした実アドレス内のセットアドレスは、ブ
ロックアドレス記憶手段205の先頭からのオフセット
になっている。
In memory access by a normal load instruction designating only a real address, the CPU 101 first notifies the cache control circuit 222 of the issuance of the load instruction, and at the same time, the real address of the data to be loaded is also passed. The cache control circuit 222 sets the given real address in the real address storage means 201 (23
0). The set address in the set real address is an offset from the beginning of the block address storage unit 205.

【0054】もし実アドレス記憶手段201にセットさ
れた実アドレスのデータを含む主記憶102のブロック
がキャッシングされているとすれば、この実アドレス記
憶手段201のセットアドレス部で指定されるブロック
アドレス記憶手段205のエントリ209には実アドレ
ス記憶手段201のブロックアドレス部と同じブロック
アドレスがセットされているはずであり、この場合、当
該エントリ209に対応するブロックデータ記憶手段2
06のブロック210に、当該実アドレスのデータを含
む主記憶102のブロックがコピーされていることにな
る。
If the block of the main memory 102 containing the data of the real address set in the real address storage means 201 is cached, the block address storage designated by the set address part of this real address storage means 201 is stored. The same block address as the block address part of the real address storage means 201 should be set in the entry 209 of the means 205, and in this case, the block data storage means 2 corresponding to the entry 209.
This means that the block 210 of the main memory 102 containing the data of the real address is copied to the block 210 of 06.

【0055】そこで、実アドレス記憶手段201のセッ
トアドレス部に基づいて、ウェイ1(203)のブロッ
クアドレス記憶手段205のエントリ209をアクセス
し、そのエントリ209に記憶されているブロックアド
レスと実アドレス記憶手段201のブロックアドレス部
とを比較器215に入力して比較する。比較器215の
比較結果は、出力223としてキャッシュ制御回路22
2に入力する。比較器215の比較の結果、上記のブロ
ックアドレスが一致すれば、エントリ209に対応する
ブロックデータ記憶手段206のブロック210には求
めるデータがキャッシングされているということである
から、キャッシュ制御回路222は、ブロック210内
の、実アドレス記憶手段201のブロック内アドレス部
(225)で指される位置から、求めるデータを読み出
してCPU101に返す。比較器215の比較の結果、
不一致であったときは、ブロック210には求めるデー
タを含むブロックがキャッシングされていなかったとい
うことであるから、キャッシュ制御回路222は、主記
憶102から当該実アドレスのデータを読み出してブロ
ック210にキャッシングするとともにCPU101に
返す。
Therefore, based on the set address part of the real address storage means 201, the entry 209 of the block address storage means 205 of the way 1 (203) is accessed to store the block address and real address stored in the entry 209. The block address part of the means 201 is input to the comparator 215 for comparison. The comparison result of the comparator 215 is output as the output 223 to the cache control circuit 22.
Enter 2. If the above block addresses match as a result of comparison by the comparator 215, it means that the desired data is cached in the block 210 of the block data storage unit 206 corresponding to the entry 209. , The requested data is read from the position designated by the in-block address portion (225) of the real address storage means 201 in the block 210 and returned to the CPU 101. As a result of comparison by the comparator 215,
If they do not match, it means that the block including the desired data has not been cached in the block 210. Therefore, the cache control circuit 222 reads the data of the real address from the main memory 102 and caches it in the block 210. And returns to the CPU 101.

【0056】上記ではウェイ1(203)の動作を説明
したが、ウェイ2(204)も同様である。特に、ブロ
ックアドレス記憶手段205,207へのアクセスや比
較器215,216によるブロックアドレスの比較など
は、各ウェイで並行して行なわれる。また、上記では通
常のロード命令について説明したが、実アドレスのみを
指定する通常のストア命令やプリフェッチ命令に対する
動作も同様である。
Although the operation of way 1 (203) has been described above, the same applies to way 2 (204). In particular, access to the block address storage means 205 and 207 and comparison of block addresses by the comparators 215 and 216 are performed in parallel in each way. Further, although the normal load instruction has been described above, the operation for a normal store instruction or a prefetch instruction that specifies only a real address is similar.

【0057】次に、実アドレスとセットアドレスとを指
定するセットアドレス指定付きメモリアクセス命令に対
する図2の装置の動作について説明するが、まず動作説
明の前にセットアドレス指定付き命令について具体的に
説明する。
Next, the operation of the apparatus of FIG. 2 for a memory access instruction with set address designation for designating a real address and a set address will be described. First, the instruction with set address designation will be specifically described before the operation description. To do.

【0058】図3から図6に、セットアドレス指定付き
命令のフォーマットを示す。
3 to 6 show formats of instructions with set address designation.

【0059】図3は、セットアドレス指定付きプリフェ
ッチ命令を示す。このプリフェッチ命令は、指定された
実アドレスを含む主記憶のブロックを、指定されたキャ
ッシュのブロックに転送する命令である。プリフェッチ
アドレスフィールドには、プリフェッチ対象のデータの
実アドレスを指定する。セットアドレスフィールドに
は、プリフェッチデータの転送先であるキャッシュのブ
ロックを特定するセットアドレスを明示的に指定する。
FIG. 3 shows a prefetch instruction with set address designation. This prefetch instruction is an instruction to transfer the block of the main memory including the designated real address to the designated block of the cache. In the prefetch address field, the real address of the prefetch target data is specified. In the set address field, a set address that specifies the cache block to which the prefetch data is transferred is explicitly specified.

【0060】図4は、セットアドレス指定付きロード命
令を示す。ロードアドレスフィールドには、ロード対象
のデータの主記憶上の実アドレスを指定する。ターゲッ
トレジスタフィールドには、データをロードするレジス
タを指定する。セットアドレスフィールドには、ロード
対象のデータをキャッシングするのに用いるブロックを
特定するセットアドレスを明示的に指定する。このロー
ド命令は、指定された実アドレスのデータを指定された
レジスタにロードするとともに、当該データを含むブロ
ックを、指定されたセットアドレスのキャッシュブロッ
クに強制的にキャッシングする。もし当該データが別の
ブロックにキャッシングされていたときは、そのブロッ
クを無効化して、指定されたセットアドレスのブロック
にキャッシングする。
FIG. 4 shows a load instruction with set address designation. In the load address field, the real address on the main memory of the data to be loaded is specified. In the target register field, specify the register to load the data. In the set address field, a set address that specifies a block used to cache the data to be loaded is explicitly specified. This load instruction loads the data of the designated real address into the designated register and forcibly caches the block containing the data into the cache block of the designated set address. If the data is cached in another block, that block is invalidated and cached in the block of the specified set address.

【0061】図5は、セットアドレス指定付きストア命
令を示す。ストアアドレスフィールドには、データを格
納する主記憶の実アドレスを指定する。ソースレジスタ
フィールドには、ストアする対象のデータが格納されて
いるレジスタを指定する。セットアドレスフィールドに
は、ストア対象のデータをキャッシングするのに用いる
ブロックを特定するセットアドレスを明示的に指定す
る。このストア命令は、指定されたレジスタのデータを
主記憶の指定された実アドレスに格納するとともに、当
該データを含むブロックを、指定されたセットアドレス
のキャッシュブロックに強制的にキャッシングする。も
し当該データが別のブロックにキャッシングされていた
ときは、そのブロックを無効化して、指定されたセット
アドレスのブロックにキャッシングする。
FIG. 5 shows a store instruction with set address designation. In the store address field, the real address of the main memory that stores the data is specified. In the source register field, the register in which the data to be stored is stored is specified. In the set address field, a set address that specifies a block used to cache the data to be stored is explicitly specified. This store instruction stores the data in the designated register at the designated real address in the main memory, and forcibly caches the block containing the data in the cache block at the designated set address. If the data is cached in another block, that block is invalidated and cached in the block of the specified set address.

【0062】図6は、セットアドレス指定付きキャッシ
ュブロック無効化命令を示す。セットアドレスフィール
ドには、無効化するキャッシュブロックを指定する。こ
のキャッシュブロック無効化命令は、指定されたセット
アドレスのキャッシュブロックを無効化する。
FIG. 6 shows a cache block invalidating instruction with set address designation. A cache block to be invalidated is specified in the set address field. This cache block invalidation instruction invalidates the cache block of the designated set address.

【0063】次に、上述した図3〜図6のセットアドレ
ス指定付き命令に対する図2のキャッシュメモリ装置1
03の動作について説明する。これらの命令を受けたと
き、キャッシュ制御回路222は、命令で指定された実
アドレスを実アドレス記憶手段201にセットする(2
30)とともに、命令で指定されたセットアドレスをセ
ットアドレス記憶手段202にセットする(231)。
なお、図6のキャッシュブロック無効化命令ではセット
アドレスのみがセットされる。
Next, the cache memory device 1 of FIG. 2 for the above-mentioned instruction with set address designation of FIGS.
The operation of 03 will be described. Upon receiving these instructions, the cache control circuit 222 sets the real address specified by the instructions in the real address storage means 201 (2
At the same time, the set address designated by the instruction is set in the set address storage means 202 (231).
In the cache block invalidation instruction of FIG. 6, only the set address is set.

【0064】実アドレス記憶手段201の実アドレスに
よるキャッシュアクセスは、前記の、実アドレスのみを
指定する通常のメモリアクセス命令と同様である。すな
わち、まず実アドレス内のセットアドレス部により、ウ
ェイ1,2のそれぞれのブロックアドレス記憶手段20
5,207を並列にアクセスし、その後、ブロックアド
レス記憶手段205,207中に格納されたブロックア
ドレス209,211と実アドレス記憶手段201のブ
ロックアドレス部との比較を比較器215,216によ
り行なう。結果として、比較器215の出力223によ
り、ウェイ1の当該実アドレスから決定されるブロック
210に当該実アドレスのデータがキャッシングされて
いるかどうかが分かり、比較器216の出力226によ
り、ウェイ2の当該実アドレスから決定されるブロック
213に当該実アドレスのデータがキャッシングされて
いるかどうかが分かる。
The cache access by the real address of the real address storage means 201 is the same as the above-mentioned normal memory access instruction designating only the real address. That is, first, the block address storage means 20 of each of the ways 1 and 2 is set by the set address portion in the real address.
5, 207 are accessed in parallel, and then the block addresses 209, 211 stored in the block address storage means 205, 207 and the block address part of the real address storage means 201 are compared by the comparators 215, 216. As a result, the output 223 of the comparator 215 determines whether the data of the real address is cached in the block 210 determined from the real address of the way 1, and the output 226 of the comparator 216 determines that the data of the way 2 is concerned. It can be seen whether or not the data of the real address is cached in the block 213 determined from the real address.

【0065】セットアドレス記憶手段202のセットア
ドレスを用いた比較も同様である。すなわち、セットア
ドレス記憶手段202にセットされたセットアドレスを
もとにブロックアドレス記憶手段207のエントリ21
2がアクセスされ、そのエントリ212に保持されてい
るブロックアドレスと実アドレス記憶手段201中のブ
ロックアドレス部とを比較器217によって比較する。
比較したブロックアドレスが等しければ、当該実アドレ
スでアクセスされるデータは、命令で明示的に指定され
たセットアドレスのブロック214中にキャッシングさ
れていることになる。比較器217の比較結果出力22
7は、比較器215,216の結果と同様に、キャッシ
ュ制御回路222に入力される。
The same is true for comparison using the set address of the set address storage means 202. That is, the entry 21 of the block address storage unit 207 is based on the set address set in the set address storage unit 202.
2 is accessed, and the block address held in the entry 212 is compared with the block address part in the real address storage means 201 by the comparator 217.
If the compared block addresses are equal, it means that the data accessed at the real address is cached in the block 214 at the set address explicitly specified by the instruction. Comparison result output 22 of the comparator 217
7 is input to the cache control circuit 222 similarly to the results of the comparators 215 and 216.

【0066】なお、上記のセットアドレス記憶手段20
2によるブロックアドレス記憶手段207のアクセスや
比較器207における比較の実行などは、実アドレス記
憶手段201によるブロックアドレス記憶手段205,
207のアクセスや比較器215,216における比較
の実行などと並行して行なわれる。
The above set address storage means 20
2 accesses the block address storage means 207 and executes comparison in the comparator 207, the block address storage means 205 by the real address storage means 201,
This is performed in parallel with the access of 207 and the execution of comparison in the comparators 215 and 216.

【0067】上述の図3〜図5のセットアドレス指定付
き命令(プリフェッチ、ロード、ストア)では、実アド
レスとセットアドレスの両方を指定するから、上述した
動作により、比較器215,216,217の比較結果
223,226,227がキャッシュ制御回路222に
入力することになる。すなわち、キャッシュ制御回路2
22は、命令で指定された実アドレスのデータが、命
令で指定された実アドレス内のセットアドレス部で指定
されるウェイ1内のキャッシュブロックにキャッシング
されているかどうか、命令で指定された実アドレス内
のセットアドレス部で指定されるウェイ2内のキャッシ
ュブロックにキャッシングされているかどうか、命令
で明示的に指定されたセットアドレスで指定されるウェ
イ2内のキャッシュブロックにキャッシングされている
かどうか、を知ることができる。キャッシュ制御回路2
22は、このようなキャッシングの状況を知って、実際
のデータのプリフェッチ、ロード、およびストアを行な
う。キャッシュ制御回路222の動作については、図7
〜図9を参照して後述する。
In the instruction with set address designation (prefetch, load, store) in FIGS. 3 to 5 described above, both the real address and the set address are designated, so that the comparators 215, 216 and 217 perform the above-mentioned operation. The comparison results 223, 226, 227 are input to the cache control circuit 222. That is, the cache control circuit 2
22 indicates whether the data of the real address specified by the instruction is cached in the cache block in the way 1 specified by the set address part of the real address specified by the instruction, and the real address specified by the instruction. Whether the cache block is cached in the way 2 designated by the set address part of the cache memory, and whether the cache block is cached in the way 2 designated by the set address explicitly designated by the instruction. I can know. Cache control circuit 2
Knowing such a caching situation, the 22 performs actual data prefetching, loading, and storing. The operation of the cache control circuit 222 is shown in FIG.
~ It mentions later with reference to FIG.

【0068】上述の図6のセットアドレス指定付きキャ
ッシュブロック無効化命令では、セットアドレスのみを
指定するから、上述した動作により、比較器217の比
較結果227がキャッシュ制御回路222に入力するこ
とになる。すなわち、キャッシュ制御回路222は、命
令で指定された実アドレスのデータが、命令で明示的に
指定されたセットアドレスで指定されるウェイ2内のキ
ャッシュブロックにキャッシングされているかどうか、
を知ることができる。
In the cache block invalidating instruction with set address designation in FIG. 6 described above, only the set address is designated, so the comparison result 227 of the comparator 217 is input to the cache control circuit 222 by the above-described operation. . That is, the cache control circuit 222 determines whether or not the data of the real address designated by the instruction is cached in the cache block in the way 2 designated by the set address explicitly designated by the instruction.
You can know.

【0069】図3のセットアドレス指定付きプリフェッ
チ命令を受けたときのキャッシュ制御回路222の動作
を説明する。このとき、キャッシュ制御回路222は、
上述の動作により比較器215,216,217の比較
結果223,226,227を入力し、指定されたプリ
フェッチアドレスのデータのキャッシングの状況を知
る。その後、図7に示すように動作する。
The operation of the cache control circuit 222 when receiving the prefetch instruction with set address designation shown in FIG. 3 will be described. At this time, the cache control circuit 222
By the above-mentioned operation, the comparison results 223, 226, 227 of the comparators 215, 216, 217 are input, and the status of caching the data of the designated prefetch address is known. Then, it operates as shown in FIG.

【0070】図7において、キャッシュ制御回路222
は、まず実アドレス(プリフェッチアドレス)によるア
クセスでキャッシュがヒットするかどうかを調べる(ス
テップ700)。実アドレスによるキャッシュヒットと
は、比較器215と216のいずれかでブロックアドレ
スが一致する場合である。実アドレスによるアクセスで
キャッシュがヒットした場合は、ブロックアドレス記憶
手段205,207内の現在ヒットしたエントリ209
(および対応するブロック210)またはエントリ21
1(および対応するブロック213)を無効化する(ス
テップ703)。
In FIG. 7, the cache control circuit 222
First, it is checked whether the cache is hit by the access by the real address (prefetch address) (step 700). The cache hit by the real address is a case where the block addresses match in either of the comparators 215 and 216. If the cache is hit by the access by the real address, the currently hit entry 209 in the block address storage means 205, 207.
(And corresponding block 210) or entry 21
Invalidate 1 (and corresponding block 213) (step 703).

【0071】この無効化は、ストアスルー方式のキャッ
シュならば、当該エントリに対応する有効ビットに無効
フラグを立てることであり、ストアバック方式のキャッ
シュならば、ヒットしたエントリのブロック210また
は213を主記憶102に書き戻す処理である。有効ビ
ットは、ブロックアドレス記憶手段205,207の各
エントリに対応して設けられているビット情報であり、
有効ビットに無効フラグが立っているとき、その有効ビ
ットに対応するキャッシュブロックは空き状態であるこ
とを示す。有効ビットに無効フラグが立っていないと
き、その有効ビットに対応するキャッシュブロックは使
用中であることを示す。
This invalidation is to set an invalid flag in the valid bit corresponding to the entry in the case of the store-through type cache, and to store the block 210 or 213 of the hit entry in the store-back type cache. This is a process of writing back to the memory 102. The valid bit is bit information provided corresponding to each entry of the block address storage means 205 and 207,
When the invalid flag is set in the valid bit, it indicates that the cache block corresponding to the valid bit is empty. When the invalid flag is not set in the valid bit, it indicates that the cache block corresponding to the valid bit is in use.

【0072】ステップ703の無効化が終了したら、実
アドレス記憶手段201の実アドレスで示される主記憶
102のブロックを、セットアドレス記憶手段202で
指定されたキャッシュブロック214に転送(プリフェ
ッチ)する(ステップ705)。また、ブロック214
に対応するブロックアドレス記憶手段207のエントリ
212には、いまプリフェッチしたブロックのブロック
アドレス(すなわち、実アドレス記憶手段201のブロ
ックアドレス部)を設定し、対応する有効ビットは無効
フラグオフに設定する(ステップ705)。
After the invalidation of step 703 is completed, the block of the main memory 102 indicated by the real address of the real address storage means 201 is transferred (prefetched) to the cache block 214 designated by the set address storage means 202 (step). 705). Also, block 214
Is set to the entry 212 of the block address storage means 207 corresponding to the block address of the block that has been prefetched (that is, the block address portion of the real address storage means 201) and the corresponding valid bit is set to the invalid flag OFF (step 705).

【0073】ステップ700の実アドレスによるキャッ
シュアクセスでキャッシュがミス(比較器215と21
6でのブロックアドレスの比較が共に不一致)した場合
は、セットアドレス記憶手段202で指定されたセット
アドレスによるアクセスでキャッシュヒットするかどう
かを調べる(ステップ706)。この判定は、比較器2
17による比較でブロックアドレスが一致したかどうか
をチェックすることにより行なう。比較器217による
比較でブロックアドレスが一致したなら、セットアドレ
ス指定によるアクセスでキャッシュヒットしたことにな
る。キャッシュヒットしたということは、セットアドレ
ス記憶手段202で指定されたブロック214には、既
に実アドレス記憶手段201の実アドレスを含む主記憶
上のブロックがキャッシングされていたということであ
るから、キャッシュ制御回路222はセットアドレス指
定付きプリフェッチ命令に対する動作を終了する。
The cache is missed due to the cache access by the real address in step 700 (comparators 215 and 21).
If the comparison of the block addresses in 6 does not coincide with each other), it is checked whether or not a cache hit is caused by the access by the set address designated by the set address storage means 202 (step 706). This judgment is made by the comparator 2.
This is done by checking whether the block addresses match in the comparison by 17. If the block addresses match in the comparison by the comparator 217, it means that a cache hit has occurred in the access by specifying the set address. A cache hit means that the block 214 designated by the set address storage means 202 has already cached the block on the main memory including the real address of the real address storage means 201. The circuit 222 ends the operation for the prefetch instruction with set address designation.

【0074】ステップ706でキャッシュミスした場合
は、ステップ705に進んで、実アドレス記憶手段20
1の実アドレスで示される主記憶102のブロックを、
セットアドレス記憶手段202で指定されたキャッシュ
ブロック214に転送する。対応するブロックアドレス
記憶手段207のエントリ212の設定や、有効ビット
の設定も行なう。
If a cache miss occurs in step 706, the process proceeds to step 705, in which the real address storage means 20.
A block of the main memory 102 indicated by a real address of 1,
The data is transferred to the cache block 214 designated by the set address storage means 202. The entry 212 of the corresponding block address storage means 207 is set, and the valid bit is also set.

【0075】図4のセットアドレス指定付きロード命令
を受けたときのキャッシュ制御回路222の動作を説明
する。このとき、キャッシュ制御回路222は、上述の
動作により比較器215,216,217の比較結果2
23,226,227を入力し、指定されたロードアド
レスのデータのキャッシングの状況を知る。その後、図
8に示すように動作する。
The operation of the cache control circuit 222 when receiving the load instruction with set address designation shown in FIG. 4 will be described. At this time, the cache control circuit 222 causes the comparison result 2 of the comparators 215, 216 and 217 by the above-described operation.
23, 226, 227 is input to know the caching status of the data at the specified load address. After that, it operates as shown in FIG.

【0076】図8において、キャッシュ制御回路222
は、まず実アドレス(ロードアドレス)によるアクセス
でキャッシュがヒットするかどうかを調べる(ステップ
801)。これは、上記図7のステップ700と同様の
判別である。実アドレスによるアクセスでキャッシュが
ヒットした場合は、ブロックアドレス記憶手段205,
207内の現在ヒットしたエントリ209(および対応
するブロック210)またはエントリ211(および対
応するブロック213)を無効化する(ステップ80
4)。無効化は、図7のステップ703と同様の処理で
ある。
In FIG. 8, the cache control circuit 222
First, it is checked whether the cache is hit by the access by the real address (load address) (step 801). This is the same determination as in step 700 of FIG. When the cache is hit by the access by the real address, the block address storage means 205,
Invalidate the currently hit entry 209 (and corresponding block 210) or entry 211 (and corresponding block 213) in 207 (step 80).
4). The invalidation is the same process as step 703 in FIG. 7.

【0077】ステップ804の無効化が終了したら、実
アドレス記憶手段201の実アドレスで示される主記憶
102のブロックを、セットアドレス記憶手段202で
指定されたキャッシュブロック214に転送する(ステ
ップ808)。また、ブロック214に対応するブロッ
クアドレス記憶手段207のエントリ212には、いま
転送したブロックのブロックアドレス(すなわち、実ア
ドレス記憶手段201のブロックアドレス部)を設定
し、対応する有効ビットは無効フラグオフに設定する
(ステップ808)。ステップ808の処理は、図7の
ステップ705と同様である。
After the invalidation of step 804 is completed, the block of the main memory 102 indicated by the real address of the real address storage means 201 is transferred to the cache block 214 designated by the set address storage means 202 (step 808). Further, the block address of the block just transferred (that is, the block address part of the real address storage unit 201) is set in the entry 212 of the block address storage unit 207 corresponding to the block 214, and the corresponding valid bit turns off the invalid flag. Set (step 808). The process of step 808 is the same as that of step 705 of FIG.

【0078】ステップ808の後、ブロック214中か
ら、実アドレス記憶手段201のブロック内アドレス部
の位置のデータを取り出し、CPU101に転送して指
定されたターゲットレジスタにセットする(ステップ8
10)。
After step 808, the data at the position of the in-block address portion of the real address storage means 201 is fetched from the block 214, transferred to the CPU 101, and set in the designated target register (step 8).
10).

【0079】ステップ801の実アドレスによるキャッ
シュアクセスでキャッシュがミス(比較器215と21
6でのブロックアドレスの比較が共に不一致)した場合
は、セットアドレス記憶手段202で指定されたセット
アドレスによるアクセスでキャッシュヒットするかどう
かを調べる(ステップ805)。この判定は、図7のス
テップ706と同様である。セットアドレス指定による
アクセスでキャッシュヒットしたなら、当該ブロック2
14には既に要求データがキャッシングされているとい
うことだから、ステップ810に進んで、要求データを
ターゲットレジスタにロードする。ステップ805でキ
ャッシュミスした場合は、ステップ808に進んで、要
求データを含むブロックを指定セットアドレスのブロッ
クにキャッシングし、さらにステップ810に進んで、
要求データをターゲットレジスタにロードする。
In the cache access by the real address in step 801, the cache miss (comparators 215 and 21
If the block address comparisons in 6 are both unmatched, it is checked whether or not a cache hit is caused by the access by the set address designated by the set address storage means 202 (step 805). This determination is similar to step 706 in FIG. If there is a cache hit in the access by specifying the set address, the relevant block 2
Since the request data is already cached in 14, the process proceeds to step 810 to load the request data into the target register. If a cache miss occurs in step 805, the process proceeds to step 808, the block including the requested data is cached in the block of the designated set address, and the process proceeds to step 810.
Load the requested data into the target register.

【0080】図5のセットアドレス指定付きストア命令
を受けたときのキャッシュ制御回路222の動作を説明
する。このとき、キャッシュ制御回路222は、上述の
動作により比較器215,216,217の比較結果2
23,226,227を入力し、指定されたストアアド
レスのデータのキャッシングの状況を知る。その後、図
9に示すように動作する。
The operation of the cache control circuit 222 when receiving the store instruction with set address designation shown in FIG. 5 will be described. At this time, the cache control circuit 222 causes the comparison result 2 of the comparators 215, 216 and 217 by the above-described operation.
23, 226, 227 are input to know the caching status of the data of the specified store address. Then, it operates as shown in FIG.

【0081】図9において、図8と同じ番号を付したス
テップ801〜808は同じ処理であるので説明を省略
する。ただし、図8ではセットアドレス指定付きロード
命令で指定されたロードアドレスを実アドレスとして用
いたが、図9ではその代わりにセットアドレス指定付き
ストア命令で指定されたストアアドレスを実アドレスと
して用いる。また、図9のステップ812は、命令で指
定されたソースレジスタの内容を、命令で指定されたセ
ットアドレスのキャッシュブロック214中の実アドレ
ス記憶手段201のブロック内アドレス部の位置に書き
込む処理である。
In FIG. 9, steps 801 to 808 assigned the same numbers as in FIG. 8 are the same processing, and therefore the description thereof will be omitted. However, while the load address designated by the load instruction with set address designation is used as the real address in FIG. 8, the store address designated by the store instruction with the set address designation is used as the real address in place of it in FIG. Further, step 812 of FIG. 9 is a process of writing the contents of the source register designated by the instruction to the position of the in-block address part of the real address storage means 201 in the cache block 214 of the set address designated by the instruction. .

【0082】図6のセットアドレス指定付きキャッシュ
ブロック無効化命令を受けたときのキャッシュ制御回路
222の動作を説明する。このとき、キャッシュ制御回
路222は、上述の動作により比較器217の比較結果
227を入力し、指定されたセットアドレスのブロック
214のキャッシングの状況を知る。もし、指定された
セットアドレスのブロックアドレス記憶手段207のエ
ントリ212に対応する有効ビットに無効化フラグが立
っていたなら、当該ブロック214は既に無効化されて
いたということであるから、そのまま処理を終了する。
もし、当該エントリ212の有効ビットに無効化フラグ
が立っていなかったら、そこに無効化フラグをセットし
て無効化する。このキャッシュメモリ装置がストアスル
ー方式のキャッシュメモリならば、主記憶には最新のデ
ータが格納されているので、無効化はこれで終了する。
ストアバック方式のキャッシュメモリならば、無効化フ
ラグをセットすると同時に、ブロックデータ記憶手段2
08の対応するエントリ214に格納されたデータを主
記憶102に書き戻す。
The operation of the cache control circuit 222 when receiving the cache block invalidating instruction with set address designation shown in FIG. 6 will be described. At this time, the cache control circuit 222 inputs the comparison result 227 of the comparator 217 by the above-described operation, and knows the caching status of the block 214 having the designated set address. If the invalidation flag is set in the valid bit corresponding to the entry 212 of the block address storage unit 207 of the designated set address, it means that the block 214 has already been invalidated, and the processing is directly performed. finish.
If the invalidation flag is not set in the valid bit of the entry 212, the invalidation flag is set there to invalidate. If this cache memory device is a store-through type cache memory, the latest data is stored in the main memory, so the invalidation is completed.
If it is a store-back type cache memory, at the same time as setting the invalidation flag, the block data storage means 2
The data stored in the corresponding entry 214 of 08 is written back to the main memory 102.

【0083】なお、上記図7〜図9の処理では、ヒット
したブロック210または213を主記憶102に書き
戻し(ストアバック方式のとき)、その後、実アドレス
で示される主記憶102のブロックをセットアドレス記
憶手段202で指定されたキャッシュブロック214に
転送するようにしているが、キャッシュブロック間のデ
ータ転送手段219,220を用いてブロック210ま
たは213からブロック214へと直接データを転送す
る方法をとることもできる。
In the processing of FIGS. 7 to 9, the hit block 210 or 213 is written back to the main memory 102 (in the case of the storeback method), and then the block of the main memory 102 indicated by the real address is set. Although the data is transferred to the cache block 214 designated by the address storage means 202, a method of directly transferring the data from the block 210 or 213 to the block 214 by using the data transfer means 219 and 220 between the cache blocks is adopted. You can also

【0084】次に、キャッシュブロック間のエイリアス
の問題について説明する。セットアドレス指定付き命令
の実行に関しては、キャッシュブロック間のエイリアス
が問題になる。このエイリアスの問題を回避するため
に、本実施例では、セットアドレス指定付き命令の使用
に以下に示す制約をつける必要がある。
Next, the problem of alias between cache blocks will be described. Aliases between cache blocks are a concern for executing set-addressed instructions. In order to avoid this aliasing problem, in the present embodiment, it is necessary to place the following restrictions on the use of the instruction with set address designation.

【0085】制約(1):ある実アドレスaに対するセ
ットアドレス指定付きプリフェッチ命令とプリフェッチ
データを使用するセットアドレス指定付きロードまたは
ストア命令との間には、実アドレスaに対する通常のス
トア命令を実行しない。逆に実アドレスaにストアする
可能性がある場合、上記セットアドレス指定付きプリフ
ェッチ、ロード、ストア命令を使用しない。
Constraint (1): A normal store instruction for a real address a is not executed between a prefetch instruction with a set address for a certain real address a and a load or store instruction with a set address for using prefetch data. . On the contrary, when there is a possibility of storing at the real address a, the prefetch with set address designation, load and store instructions are not used.

【0086】制約(2):主記憶上の同一ブロックが、
キャッシュメモリ上の複数のブロックで有効であっては
ならない。すなわち、主記憶上で同一ブロックとなるデ
ータに対するセットアドレス指定付き命令によるアクセ
スには、同一のセットアドレスを指定する。
Constraint (2): the same block in main memory
It must not be valid in multiple blocks on cache memory. That is, the same set address is designated for the access by the instruction with the set address designation to the data in the same block on the main memory.

【0087】制約(3):セットアドレス指定付き命令
を使用して所望の処理を行なった後は、指定したキャッ
シュブロックをセットアドレス指定付き無効化命令によ
って無効化しなければならない。特に、セットアドレス
指定付き命令を実行した後、それを無効化する前に関数
呼び出し等がある場合は、その関数呼び出しの前に、そ
のブロックを無効化する。
Restriction (3): After the desired processing is performed using the instruction with the set address designation, the designated cache block must be invalidated by the invalidation instruction with the set address designation. In particular, if there is a function call or the like after the instruction with set address designation is executed and before it is invalidated, the block is invalidated before the function call.

【0088】制約(1)に関し具体例をあげて説明す
る。以下の処理(A)〜(E)の手順で処理を行なう状
況が生じた場合を例に考える。
The constraint (1) will be described with a specific example. Consider a case where a situation occurs in which processing is performed by the following processing (A) to (E).

【0089】(A)実アドレスXに対する通常のロード
命令の実行 (B)処理(A)によって実アドレスXに対応するブロ
ックがキャッシュに転送された後、その実アドレスXに
対するキャッシュブロックIへのセットアドレス指定付
きプリフェッチ命令の実行
(A) Execution of a normal load instruction for the real address X (B) After the block corresponding to the real address X is transferred to the cache by the process (A), the set address for the cache block I for the real address X Execution of specified prefetch instruction

【0090】(C)実アドレスXに対する通常のストア
命令の実行 (D)実アドレスXと同一のキャッシュブロックにマッ
ピングされる主記憶のブロックへのアクセス命令の実行
による、処理(C)でキャッシュ上に転送されたブロッ
クの追い出しの発生 (E)処理(B)によってセットアドレスIにプリフェ
ッチされたデータを使用するセットアドレス指定付きロ
ード命令の実行
(C) Execution of a normal store instruction to the real address X (D) Execution of an access instruction to a block of the main memory that is mapped to the same cache block as the real address X. Occurrence of eviction of block transferred to (E) Execution of load instruction with set address designation using data prefetched to set address I by processing (B)

【0091】まず処理(A)の実行により、実アドレス
Xを含む主記憶102のブロックがキャッシュブロック
上に転送される。転送先のキャッシュブロックは、実ア
ドレスX(具体的には実アドレスX内のセットアドレス
部)によって一意に決定される。次に処理(B)の状況
が生起したとき、処理(A)でキャッシュ上に転送され
た主記憶ブロックを再び指定されたキャッシュのセット
アドレスIのブロックにプリフェッチするとすれば、キ
ャッシュ中の2つのブロックに同一の主記憶ブロックが
コピーされることになる。
First, by executing the process (A), the block of the main memory 102 containing the real address X is transferred onto the cache block. The transfer destination cache block is uniquely determined by the real address X (specifically, the set address portion in the real address X). Next, when the situation of the processing (B) occurs, if the main memory block transferred to the cache in the processing (A) is prefetched to the block of the set address I of the designated cache again, if two blocks in the cache are The same main memory block will be copied to the block.

【0092】これを回避するために、本実施例のキャッ
シュメモリ装置103では、前述したようにセットアド
レス指定付きプリフェッチ命令の実行に際しては、まず
命令によって与えられる実アドレスによりキャッシュが
ヒットするかどうかを検査し、ヒットするならばヒット
したブロックを無効化し、その後、命令によって指定さ
れたセットアドレスにデータをプリフェッチする。これ
により、上記処理(B)の実行においては、まず実アド
レスXによるキャッシュアクセスで、処理(A)によっ
て転送されたキャッシュブロックは無効化され、その
後、処理(B)のプリフェッチ命令によって指定された
セットアドレスIのキャッシュブロックに主記憶ブロッ
クが転送される。この時点で、実アドレスXに対応する
主記憶ブロックは、キャッシュ内のブロックIにのみ存
在している。
In order to avoid this, in the cache memory device 103 of this embodiment, when executing the prefetch instruction with set address designation, as described above, it is first determined whether the cache is hit by the real address given by the instruction. It checks and invalidates the hit block if it hits, then prefetches the data to the set address specified by the instruction. As a result, in the execution of the process (B), the cache block transferred by the process (A) is invalidated by the cache access by the real address X, and then the prefetch instruction of the process (B) is designated. The main memory block is transferred to the cache block of the set address I. At this point, the main memory block corresponding to the real address X exists only in the block I in the cache.

【0093】次に処理(C)の状況が生起した場合を考
える。処理(C)は通常のストア命令なので、キャッシ
ュに対して実アドレスのみでアクセスされ、実アドレス
Xに対する主記憶ブロックがキャッシュメモリ上に転送
され、新たにデータが格納される。この時点で、最新の
データは、セットアドレスIで示されるキャッシュブロ
ック上にはなくなることになる。次に処理(D)の状況
が生起すると、アドレスXに対する最新のデータはもは
やキャッシュ上にはなくなる。最後に処理(E)の状
況、すなわち処理(B)によってセットアドレスIにプ
リフェッチされたデータをセットアドレス指定付きでロ
ードする命令が実行される状況が生起すると、CPUに
は古いデータが返されることになる。
Next, consider the case where the situation of the processing (C) occurs. Since the process (C) is a normal store instruction, the cache is accessed only by the real address, the main memory block for the real address X is transferred to the cache memory, and new data is stored. At this point, the latest data will not be on the cache block indicated by the set address I. When the processing (D) situation occurs next time, the latest data for the address X is no longer in the cache. Finally, when the situation of the processing (E), that is, the situation of executing the instruction to load the data prefetched to the set address I by the processing (B) with the set address designation, old data is returned to the CPU. become.

【0094】この問題を回避するために、セットアドレ
ス指定付き命令の使用には、まず前述の制約(1)が課
せられる。この制約(1)から、前記条理(B)と
(E)との間には、ブロックへのストア命令(C)は現
れないことが保証され、上記の問題は回避できる。
To avoid this problem, the use of instructions with set addressing first imposes the aforementioned constraint (1). From this restriction (1), it is guaranteed that the store instruction (C) to the block does not appear between the above-mentioned principles (B) and (E), and the above problem can be avoided.

【0095】次に、制約(2)に関し具体例をあげて説
明する。以下の処理(A)〜(D)の手順で処理を行な
う状況が生じた場合を例に考える。
Next, the constraint (2) will be described with a specific example. Consider a case where a situation occurs in which processing is performed by the following processing (A) to (D).

【0096】(A)実アドレスXに対応するブロックが
キャッシュに転送された後、実アドレスXに対するキャ
ッシュブロックIへのセットアドレス指定付きプリフェ
ッチ命令の実行 (B)実アドレスXに対応するブロックがキャッシュに
転送された後、実アドレスXに対するキャッシュブロッ
クK(IとKとは異なる)へのセットアドレス指定付き
プリフェッチ命令の実行
(A) After the block corresponding to the real address X is transferred to the cache, the prefetch instruction with set address designation to the cache block I for the real address X is executed (B) The block corresponding to the real address X is cached To the cache block K (different from I and K) for the real address X after being transferred to

【0097】(C)セットアドレスIの指定によるデー
タの実アドレスXへのストア命令の実行 (D)セットアドレスKの指定による実アドレスXのデ
ータのロード命令の実行
(C) Execution of store instruction of data to real address X by designation of set address I (D) Execution of load instruction of data of real address X by designation of set address K

【0098】上記処理(A)および(B)の終了後、実
アドレスXに対応する主記憶ブロックはキャッシュブロ
ックIおよびKの両方に存在する。その後、処理(C)
により、セットアドレスIが保持する実アドレスXのデ
ータを書き変える。この時点で、セットアドレスKが保
持するデータは最新ではなくなる。この状況で処理
(D)が生起すると、CPUに対して実アドレスXの古
いデータが返されることになる。
After completion of the above processes (A) and (B), the main memory block corresponding to the real address X exists in both cache blocks I and K. After that, processing (C)
Thus, the data of the real address X held by the set address I is rewritten. At this point, the data held by the set address K is not the latest. When the process (D) occurs in this situation, the old data of the real address X is returned to the CPU.

【0099】上記の問題は、コード生成に際し制約
(2)を課すことで回避する。すなわち、同一主記憶ブ
ロックをアクセスするセットアドレス指定付き命令
(A)(B)(C)(D)を実行する場合、指定するセ
ットアドレスを同一にすることで、上記の問題は回避で
きる。
The above problem can be avoided by imposing the constraint (2) on the code generation. That is, when the instructions (A), (B), (C), and (D) with set address designation for accessing the same main memory block are executed, the designated set addresses are made the same to avoid the above problem.

【0100】上記の問題は、関数呼び出しのを行なう場
合にも発生する可能性がある。すなわち、関数呼び出し
の際、関数を呼び出す側と呼ばれる関数の側とでセット
アドレス指定付き命令が実行される場合、主記憶の同一
ブロックに対して同一キャッシュブロックを指定するこ
とが保証されない場合は、前述の問題が発生することに
なる。したがって、前記条件が保証されない場合は、呼
び出し前に、指定されたセットアドレスは無効化しなけ
ればならない。制約(3)は、それを明らかにしたもの
である。
The above problem may occur even when a function is called. That is, at the time of calling a function, if a set addressing instruction is executed between the function calling side and the function side, if it is not guaranteed that the same cache block is specified for the same block in main memory, The problems mentioned above will occur. Therefore, if the above conditions are not guaranteed, the specified set address must be invalidated before the call. Constraint (3) makes it clear.

【0101】本実施例によれば、キャッシュブロック競
合によるキャッシュミスの軽減、すなわちキャッシュの
汚染を防止することができる。以下では、本実施例の好
適な使用例について説明する。
According to this embodiment, cache misses due to cache block competition can be reduced, that is, cache pollution can be prevented. Below, a suitable example of use of this example is explained.

【0102】図10に、本実施例のキャッシュメモリ装
置を用いたデータアクセス例を示す。1001は、キャ
ッシュメモリの容量よりも大きな主記憶上の配列をシー
ケンシャルにアクセスする様子を表している。1002
は、このような配列をアクセスする前のキャッシュの状
態を表している。縦に並ぶ4つの矩形の列がキャッシュ
の1ブロックに相当するものとする。キャッシュの各ブ
ロックには、それまでにアクセスされた主記憶のデータ
のコピーが格納されている。これらのデータの中には、
今後、複数回使用されるデータも含まれている。
FIG. 10 shows an example of data access using the cache memory device of this embodiment. Reference numeral 1001 represents a sequence of sequentially accessing an array on the main memory that is larger than the capacity of the cache memory. 1002
Represents the state of the cache before accessing such an array. It is assumed that four vertically arranged rectangular columns correspond to one block of the cache. Each block of the cache stores a copy of the main memory data that has been accessed so far. Some of these data include
It includes data that will be used multiple times in the future.

【0103】1003は、前記の大きな配列をアクセス
したときの通常のキャッシュメモリの状態を表してい
る。一般に主記憶のブロックは、キャッシュメモリのブ
ロックに一意にマッピングされる。そのため、このよう
な大きな配列に対してシーケンシャルにアクセスする場
合、たとえこの配列データが1度しか使用されない場合
でも、もともとキャッシュ上にある今後も使用される可
能性のあるデータもキャッシュから追い出される。そし
て追い出されたブロックが、再びアクセスされたとき、
キャッシュミスが発生する。
Reference numeral 1003 represents a normal cache memory state when the large array is accessed. Generally, a main memory block is uniquely mapped to a cache memory block. Therefore, when sequentially accessing such a large array, even if the array data is used only once, data that is originally in the cache and may be used in the future is also evicted from the cache. And when the evicted block is accessed again,
A cache miss occurs.

【0104】1004は、本実施例のキャッシュメモリ
装置において、前述のセットアドレス指定付きプリフェ
ッチ、ロード、ストア、無効化命令を使用した場合のキ
ャッシュメモリの状態を示している。大きな配列に対し
て、コンパイラまたはプログラマは、使用するキャッシ
ュブロック1005、1006、1007を決め、セッ
トアドレス指定付き命令を用いてこれらのブロックを繰
り返し使用する。これにより、キャッシュ全体に渡って
生じていた既存のブロック追い出しを回避している。
Reference numeral 1004 denotes the state of the cache memory when the above-mentioned prefetch with set address designation, load, store, and invalidation instruction are used in the cache memory device of this embodiment. For large arrays, the compiler or programmer decides which cache blocks 1005, 1006, 1007 to use and uses these blocks repeatedly with set-addressed instructions. This avoids existing block evictions that have occurred throughout the cache.

【0105】なお、上記実施例では主記憶装置とキャッ
シュメモリとのマッピング方式としてセットアソシアテ
ィブ方式を採用し、ウェイの数を2として、そのうちの
一方のウェイをセットアドレス指定付きメモリアクセス
命令のアクセス対象(明示的に指定されたセットアドレ
スでのアクセス)としている。しかし、セットアソシア
ティブ方式を採用する場合、ウェイの数はこれに限らず
任意の数でよい。また、セットアドレス指定付きメモリ
アクセス命令によるアクセス対象のウェイも1つ以上の
任意の数のウェイとしてよい。セットアドレス指定付き
メモリアクセス命令により2つ以上のウェイをアクセス
対象とする場合、それらのウェイの指定されたセットア
ドレスのキャッシュブロックがアクセス対象となり、そ
のうちの何れか1つのキャッシュブロックを用いればよ
い。さらに、ダイレクトマップ方式に適用することも可
能である。
In the above embodiment, the set associative method is adopted as the mapping method between the main memory device and the cache memory, the number of ways is 2, and one of the ways is the access target of the memory access instruction with the set address designation. (Access with an explicitly specified set address). However, when adopting the set associative method, the number of ways is not limited to this and may be any number. The way to be accessed by the memory access instruction with set address designation may be an arbitrary number of one or more ways. When two or more ways are to be accessed by a memory access instruction with set address designation, the cache block of the set address designated in those ways is the access target, and any one of them may be used. Furthermore, it is also possible to apply to the direct map method.

【0106】[0106]

【発明の効果】本発明によれば、セットアドレス指定付
きプリフェッチ命令により、実際に私用する前にデータ
をキャッシュに存在させることができる。これにより、
キャッシュミスの原因の一つである初期参照によるミス
を減少させ、プロセッサの実行効率を高めることができ
る。さらに、セットアドレス指定付きプリフェッチ、ロ
ード、ストア、無効化命令により、使用するキャッシュ
ブロックをソフトウェアから任意に指定することができ
る。これにより、例えば大きな配列のシーケンシャルな
アクセスの際に生じるキャッシュメモリの汚染を防止す
ることができる。以上より、使用頻度の低いデータによ
るキャッシュメモリの汚染に関する問題を回避でき、か
つプログラマおよびコンパイラが持つメモリアクセスに
関する情報を積極的に用いることにより、キャッシュミ
スを減少させプロセッサの実行効率を向上させることの
できるキャッシュメモリ装置が提供される。
According to the present invention, the prefetch instruction with set address designation allows the data to exist in the cache before it is actually used privately. This allows
It is possible to reduce misses due to initial reference, which is one of the causes of cache misses, and improve the execution efficiency of the processor. Furthermore, the cache block to be used can be arbitrarily designated by software by the prefetch with set address designation, load, store, and invalidation instruction. As a result, it is possible to prevent the cache memory from being contaminated when, for example, a large array is sequentially accessed. From the above, it is possible to avoid the problem of cache memory pollution due to infrequently used data, and to reduce the cache misses and improve the execution efficiency of the processor by positively using the information about the memory access that the programmer and compiler have. A cache memory device capable of performing the above is provided.

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

【図1】実施例のキャッシュメモリ装置を適用した計算
機システムのブロック図
FIG. 1 is a block diagram of a computer system to which a cache memory device according to an embodiment is applied.

【図2】実施例のキャッシュメモリ装置の構成を表すブ
ロック図
FIG. 2 is a block diagram showing a configuration of a cache memory device according to an embodiment.

【図3】セットアドレス指定付きプリフェッチ命令を示
す図
FIG. 3 is a diagram showing a prefetch instruction with set address designation.

【図4】セットアドレス指定付きロード命令を示す図FIG. 4 is a diagram showing a load instruction with set address designation.

【図5】セットアドレス指定付きストア命令を示す図FIG. 5 is a diagram showing a store instruction with set address designation.

【図6】セットアドレス指定付きキャッシュブロック無
効化命令を示す図
FIG. 6 is a diagram showing a cache block invalidating instruction with set address designation.

【図7】セットアドレス指定付きプリフェッチ命令実行
時のキャッシュ制御回路の動作を表すフローチャート図
FIG. 7 is a flowchart showing the operation of the cache control circuit when a prefetch instruction with set address designation is executed.

【図8】セットアドレス指定付きロード命令実行時のキ
ャッシュ制御回路の動作を表すフローチャート図
FIG. 8 is a flowchart showing the operation of the cache control circuit when executing a load instruction with set address designation.

【図9】セットアドレス指定付きストア命令実行時のキ
ャッシュ制御回路の動作を表すフローチャート図
FIG. 9 is a flowchart showing the operation of the cache control circuit when executing a store instruction with set address designation.

【図10】本発明に係わるキャッシュメモリ装置の好適
な使用例を示す図
FIG. 10 is a diagram showing a preferred usage example of the cache memory device according to the present invention.

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

101…プロセッサ(CPU)、102…主記憶装置、
103…キャッシュメモリ装置、104…メモリ制御
部、105…メモリ部、201…実アドレス記憶手段、
202…セットアドレス記憶手段、203,204…ウ
ェイ、205,207…ブロックアドレス記憶手段、2
06,208…ブロックデータ記憶手段、215,21
6,217…比較器、222…キャッシュ制御回路。
101 ... Processor (CPU), 102 ... Main storage device,
103 ... Cache memory device, 104 ... Memory control unit, 105 ... Memory unit, 201 ... Real address storage means,
Reference numeral 202 ... Set address storage means, 203, 204 ... Way, 205, 207 ... Block address storage means, 2
06, 208 ... Block data storage means, 215, 21
6, 217 ... Comparator, 222 ... Cache control circuit.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 竹内 洋一 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 (72)発明者 菊池 純男 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Yoichi Takeuchi, 1099, Ozenji, Aso-ku, Kawasaki-shi, Kanagawa, Ltd. Inside the Hitachi, Ltd. System Development Laboratory (72) Inventor, Sumio Kikuchi, 1099, Ozen-ji, Aso-ku, Kawasaki, Kanagawa Hitachi Systems Development Laboratory

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】プロセッサと主記憶装置との間に位置し、
該主記憶装置に記憶されるデータをキャッシュメモリに
キャッシングすることにより、該プロセッサからの主記
憶アクセス命令を受けて高速なメモリアクセスを行なう
キャッシュメモリ装置であって、 実アドレスによる第1のアクセス手段と、 命令によって指定されたキャッシュメモリのセットアド
レスによる第2のアクセス手段とを備えたことを特徴と
するソフトウェア制御可能なキャッシュメモリ装置。
1. A processor is located between a processor and a main memory,
A cache memory device for performing high-speed memory access in response to a main memory access instruction from the processor by caching data stored in the main memory device in a cache memory, the first access means using a real address. And a software-controllable cache memory device comprising: a second access means by a set address of the cache memory designated by an instruction.
【請求項2】プロセッサと主記憶装置との間に位置し、
該主記憶装置に記憶されるデータをキャッシュメモリに
キャッシングすることにより、該プロセッサからの主記
憶アクセス命令を受けて高速なメモリアクセスを行なう
キャッシュメモリ装置であって、 実アドレスのみを指定したメモリアクセス命令を受け、
該命令に応じたメモリアクセス動作を行なうとともに、
該命令で指定された実アドレスに基づいて決定されるキ
ャッシュブロックを用いてキャッシングを行なう第1の
アクセス手段と、 実アドレスとキャッシュブロックを特定するセットアド
レスとを指定したセットアドレス指定付きメモリアクセ
ス命令を受け、該命令に応じたメモリアクセス動作を行
なうとともに、該命令で指定されたセットアドレスに基
づいて決定されるキャッシュブロックを用いてキャッシ
ングを行なう第2のアクセス手段とを備えたことを特徴
とするソフトウェア制御可能なキャッシュメモリ装置。
2. Located between the processor and the main memory,
A cache memory device that performs high-speed memory access in response to a main memory access instruction from the processor by caching data stored in the main memory device in a cache memory. Received an order,
While performing a memory access operation according to the instruction,
First access means for performing caching using a cache block determined based on a real address designated by the instruction, and a memory access instruction with a set address designating a real address and a set address for identifying the cache block In response to the instruction, the memory access operation is performed, and second access means for performing caching using a cache block determined based on a set address specified by the instruction is provided. Software controllable cache memory device.
【請求項3】前記第2のアクセス手段は、 (a)指定されたセットアドレスのキャッシュブロック
に、指定された実アドレスのデータを含む前記主記憶装
置のブロックを、プリフェッチするセットアドレス指定
付きプリフェッチ命令と、 (b)指定されたセットアドレスのキャッシュブロック
から、前記プロセッサに、データをロードするセットア
ドレス指定付きロード命令と、 (c)指定されたセットアドレスのキャッシュブロック
に、前記プロセッサからのデータを、ストアするセット
アドレス指定付きストア命令と、 (d)指定されたセットアドレスのキャッシュブロック
に格納されている主記憶装置のブロックのコピーを無効
化するセットアドレス指定付きキャッシュブロック無効
化命令とを受け付ける請求項1または2に記載のキャッ
シュメモリ装置。
3. The second access means includes: (a) prefetch with set address designation for prefetching a block of the main storage device containing data of a designated real address in a cache block of a designated set address. An instruction, and (b) a load instruction with set address designation for loading data from the cache block of a designated set address to the processor, and (c) data from the processor to a cache block of a designated set address. And a set addressing cache block invalidating instruction for invalidating a copy of the block of the main storage device stored in the cache block of the designated set address. Accepted according to claim 1 or 2. Cache memory device.
【請求項4】前記主記憶装置とキャッシュメモリとのマ
ッピング方式としてセットアソシアティブ方式が採用さ
れ、前記第2のアクセス手段が、該セットアソシアティ
ブ方式における特定の1つ以上のウェイをアクセス対象
とする請求項1または2に記載のキャッシュメモリ装
置。
4. A set associative method is adopted as a mapping method between the main memory device and the cache memory, and the second access means makes access to one or more specific ways in the set associative method. Item 3. The cache memory device according to item 1 or 2.
【請求項5】前記第2のアクセス手段は、前記セットア
ドレス指定付きプリフェッチ命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックを無効化し、
命令で指定されたセットアドレスのキャッシュブロック
に、命令で指定された実アドレスで示されるデータを含
む前記主記憶装置上のブロックを転送し、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在しなければ、命令で指定されたセットアドレス
のキャッシュブロックに、命令で指定された実アドレス
で示されるデータを含む前記主記憶装置上のブロックを
転送する請求項3に記載のキャッシュメモリ装置。
5. When the second access means receives the prefetch instruction with set address designation, first, the data indicated by the real address designated by the instruction is
Check whether or not the cache block exists based on the real address, and (a) if so, invalidate the cache block,
Transfer the block on the main storage device containing the data indicated by the real address designated by the instruction to the cache block of the set address designated by the instruction, and (b) if it does not exist, the set designated by the instruction Check whether the data indicated by the real address specified by the instruction exists in the cache block of the address, and (b
1) If it does not exist, the cache memory according to claim 3 which transfers a block on the main storage device containing data indicated by a real address designated by an instruction to a cache block of a set address designated by an instruction apparatus.
【請求項6】前記第2のアクセス手段は、前記セットア
ドレス指定付きロード命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックを無効化し、
命令で指定されたセットアドレスのキャッシュブロック
に、命令で指定された実アドレスで示されるデータを含
む前記主記憶装置上のブロックを転送し、該転送された
ブロック内のデータを前記プロセッサに返し、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在すれば、そのデータを前記プロセッサに返し、
(b2)存在しなければ、命令で指定されたセットアド
レスのキャッシュブロックに、命令で指定された実アド
レスで示されるデータを含む前記主記憶装置上のブロッ
クを転送し、該転送されたブロック内のデータを前記プ
ロセッサに返す請求項3に記載のキャッシュメモリ装
置。
6. The second access means, when receiving the load instruction with set address designation, first, the data indicated by the real address designated by the instruction is:
Check whether or not the cache block exists based on the real address, and (a) if so, invalidate the cache block,
Transferring a block on the main storage device containing the data indicated by the real address specified by the instruction to the cache block of the set address specified by the instruction, and returning the data in the transferred block to the processor, (B) If it does not exist, it is checked whether or not the data indicated by the real address specified by the instruction exists in the cache block of the set address specified by the instruction.
1) If present, return the data to the processor,
(B2) If it does not exist, the block on the main storage device including the data indicated by the real address designated by the instruction is transferred to the cache block of the set address designated by the instruction, and within the transferred block 4. The cache memory device according to claim 3, wherein the data of the above is returned to the processor.
【請求項7】前記第2のアクセス手段は、前記セットア
ドレス指定付きストア命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックを無効化し、
命令で指定されたセットアドレスのキャッシュブロック
に、命令で指定された実アドレスで示されるデータを含
む前記主記憶装置上のブロックを転送し、前記プロセッ
サから与えられたデータを該転送されたブロックに格納
し、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在すれば、前記プロセッサから与えられたデータ
を該ブロックに格納し、(b2)存在しなければ、命令
で指定されたセットアドレスのキャッシュブロックに、
命令で指定された実アドレスで示されるデータを含む前
記主記憶装置上のブロックを転送し、前記プロセッサか
ら与えられたデータを該転送されたブロックに格納する
請求項3に記載のキャッシュメモリ装置。
7. When the second access means receives the store instruction with set address designation, first, the data indicated by the real address designated by the instruction is:
Check whether or not the cache block exists based on the real address, and (a) if so, invalidate the cache block,
Transfer the block on the main memory containing the data indicated by the real address specified by the instruction to the cache block of the set address specified by the instruction, and transfer the data given by the processor to the transferred block. (B) If it does not exist, it is checked whether the data indicated by the real address specified by the instruction exists in the cache block of the set address specified by the instruction, and (b)
1) If it exists, the data given from the processor is stored in the block. (B2) If it does not exist, it is stored in the cache block of the set address specified by the instruction.
4. The cache memory device according to claim 3, wherein a block on the main storage device including data indicated by a real address designated by an instruction is transferred, and the data given by the processor is stored in the transferred block.
【請求項8】主記憶を介さずにキャッシュブロック間で
データを転送する手段を備えた請求項1または2に記載
のキャッシュメモリ装置。
8. The cache memory device according to claim 1, further comprising means for transferring data between cache blocks without going through a main memory.
【請求項9】前記第2のアクセス手段は、前記セットア
ドレス指定付きプリフェッチ命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックのデータを、
命令で指定されたセットアドレスのキャッシュブロック
に転送した後に、無効化し、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在しなければ、命令で指定されたセットアドレス
のキャッシュブロックに、命令で指定された実アドレス
で示されるデータを含む前記主記憶装置上のブロックを
転送する請求項8に記載のキャッシュメモリ装置。
9. When the second access means receives the prefetch instruction with set address designation, first, the data indicated by the real address designated by the instruction is
It is checked whether or not the cache block determined based on the real address exists, and (a) if so, the data of the cache block is
After the transfer to the cache block of the set address specified by the instruction, invalidation is performed. (B) If it does not exist, the data indicated by the real address specified by the instruction is stored in the cache block of the set address specified by the instruction. Check if it exists, (b
1) If not present, the cache memory according to claim 8 which transfers a block on the main storage device including data indicated by a real address designated by an instruction to a cache block of a set address designated by an instruction apparatus.
【請求項10】前記第2のアクセス手段は、前記セット
アドレス指定付きロード命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックのデータを、
命令で指定されたセットアドレスのキャッシュブロック
に転送した後に、無効化し、さらに転送されたブロック
内のデータを前記プロセッサに返して指定されたレジス
タにロードし、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在すれば、そのデータを前記プロセッサに返して
指定されたレジスタにロードし、(b2)存在しなけれ
ば、命令で指定されたセットアドレスのキャッシュブロ
ックに、命令で指定された実アドレスで示されるデータ
を含む前記主記憶装置上のブロックを転送し、該転送さ
れたブロック内のデータを前記プロセッサに返して指定
されたレジスタにロードする請求項8に記載のキャッシ
ュメモリ装置。
10. The second access means, when receiving the load instruction with set address designation, first, the data indicated by the real address designated by the instruction is:
It is checked whether or not the cache block determined based on the real address exists, and (a) if so, the data of the cache block is
After transferring to the cache block of the set address specified by the instruction, invalidating it, and further returning the data in the transferred block to the processor and loading it into the specified register. (B) If it does not exist, It is checked whether the data indicated by the real address specified by the instruction exists in the cache block of the specified set address, and (b
1) If it exists, the data is returned to the processor and loaded into the specified register. (B2) If it does not exist, it is stored in the cache block of the set address specified by the instruction with the real address specified by the instruction. 9. The cache memory device according to claim 8, wherein a block on the main memory device containing the indicated data is transferred, and the data in the transferred block is returned to the processor and loaded into a designated register.
【請求項11】前記第2のアクセス手段は、前記セット
アドレス指定付きストア命令を受けたとき、 まず命令で指定された実アドレスで示されるデータが、
該実アドレスに基づいて決定されるキャッシュブロック
に存在するかどうかを調べ、 (a)存在すれば、該キャッシュブロックのデータを、
命令で指定されたセットアドレスのキャッシュブロック
に転送した後に、無効化し、さらに前記プロセッサから
与えられたデータを該転送されたブロックに格納し、 (b)存在しなければ、命令で指定されたセットアドレ
スのキャッシュブロックに、命令で指定された実アドレ
スで示されるデータが存在するかどうかを調べ、(b
1)存在すれば、前記プロセッサから与えられたデータ
を該ブロックに格納し、(b2)存在しなければ、命令
で指定されたセットアドレスのキャッシュブロックに、
命令で指定された実アドレスで示されるデータを含む前
記主記憶装置上のブロックを転送し、前記プロセッサか
ら与えられたデータを該転送されたブロックに格納する
請求項8に記載のキャッシュメモリ装置。
11. When the second access means receives the store instruction with set address designation, first, the data indicated by the real address designated by the instruction is:
It is checked whether or not the cache block determined based on the real address exists, and (a) if so, the data of the cache block is
After transferring to the cache block of the set address specified by the instruction, invalidating it, and further storing the data given from the processor in the transferred block, (b) If it does not exist, the set specified by the instruction Check whether the data indicated by the real address specified by the instruction exists in the cache block of the address, and (b
1) If it exists, the data given from the processor is stored in the block. (B2) If it does not exist, it is stored in the cache block of the set address specified by the instruction.
9. The cache memory device according to claim 8, wherein a block on the main storage device including data indicated by a real address designated by an instruction is transferred, and the data given by the processor is stored in the transferred block.
JP7166987A 1995-06-08 1995-06-08 Cache memory device capable of controlling software Pending JPH08335188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7166987A JPH08335188A (en) 1995-06-08 1995-06-08 Cache memory device capable of controlling software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7166987A JPH08335188A (en) 1995-06-08 1995-06-08 Cache memory device capable of controlling software

Publications (1)

Publication Number Publication Date
JPH08335188A true JPH08335188A (en) 1996-12-17

Family

ID=15841305

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7166987A Pending JPH08335188A (en) 1995-06-08 1995-06-08 Cache memory device capable of controlling software

Country Status (1)

Country Link
JP (1) JPH08335188A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6128684A (en) * 1997-06-30 2000-10-03 Nec Corporation Bus bridge
JP2008525919A (en) * 2004-12-29 2008-07-17 インテル・コーポレーション Method for programmer-controlled cache line eviction policy

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6128684A (en) * 1997-06-30 2000-10-03 Nec Corporation Bus bridge
JP2008525919A (en) * 2004-12-29 2008-07-17 インテル・コーポレーション Method for programmer-controlled cache line eviction policy

Similar Documents

Publication Publication Date Title
US6038647A (en) Cache memory device and method for providing concurrent independent multiple accesses to different subsets within the device
KR100318789B1 (en) System and method for managing cache in a multiprocessor data processing system
US5539895A (en) Hierarchical computer cache system
US5450563A (en) Storage protection keys in two level cache system
US5155824A (en) System for transferring selected data words between main memory and cache with multiple data words and multiple dirty bits for each address
JP4486750B2 (en) Shared cache structure for temporary and non-temporary instructions
US5974508A (en) Cache memory system and method for automatically locking cache entries to prevent selected memory items from being replaced
US6212602B1 (en) Cache tag caching
US6226695B1 (en) Information handling system including non-disruptive command and data movement between storage and one or more auxiliary processors
US6578111B1 (en) Cache memory system and method for managing streaming-data
US20100217937A1 (en) Data processing apparatus and method
EP1089185A2 (en) Method of controlling a cache memory to increase an access speed to a main memory, and a computer using the method
KR20030097871A (en) Method and system for speculatively invalidating lines in a cache
JPH06243039A (en) Method for operating order in cache memory system and microprocessor unit
US6668307B1 (en) System and method for a software controlled cache
JPH0997214A (en) Information-processing system inclusive of address conversion for auxiliary processor
US6065099A (en) System and method for updating the data stored in a cache memory attached to an input/output system
US7356650B1 (en) Cache apparatus and method for accesses lacking locality
KR20060102565A (en) System and method for canceling write back operation during simultaneous snoop push or snoop kill operation in write back caches
JPH06318174A (en) Cache memory system and method for performing cache for subset of data stored in main memory
US11036639B2 (en) Cache apparatus and method that facilitates a reduction in energy consumption through use of first and second data arrays
US6598124B1 (en) System and method for identifying streaming-data
WO2002027498A2 (en) System and method for identifying and managing streaming-data
US6934810B1 (en) Delayed leaky write system and method for a cache memory
JP3626609B2 (en) Multiprocessor system