JP3078303B2 - Cache memory control circuit - Google Patents

Cache memory control circuit

Info

Publication number
JP3078303B2
JP3078303B2 JP02182596A JP18259690A JP3078303B2 JP 3078303 B2 JP3078303 B2 JP 3078303B2 JP 02182596 A JP02182596 A JP 02182596A JP 18259690 A JP18259690 A JP 18259690A JP 3078303 B2 JP3078303 B2 JP 3078303B2
Authority
JP
Japan
Prior art keywords
cache memory
data
way
external
external cache
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.)
Expired - Fee Related
Application number
JP02182596A
Other languages
Japanese (ja)
Other versions
JPH0471049A (en
Inventor
義弘 氷治
裕之 吉田
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP02182596A priority Critical patent/JP3078303B2/en
Publication of JPH0471049A publication Critical patent/JPH0471049A/en
Application granted granted Critical
Publication of JP3078303B2 publication Critical patent/JP3078303B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、キャッシュメモリを内蔵したマイクロプロ
セッサにおいて、内蔵キャッシュメモリと外部キャッシ
ュメモリとの内容の整合性を確保するキャッシュメモリ
制御方式に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory control method for ensuring the consistency of contents between a built-in cache memory and an external cache memory in a microprocessor having a built-in cache memory. is there.

[従来の技術] マイクロプロセッサの分野においても、その動作速度
の向上と共に、プロセッサーと主記憶装置との間の動作
速度の差が問題となってきている。処理装置の動作速度
が上がるにつれて、それが消費する命令コードやデータ
の量も増えるため、主記憶装置の方も処理装置の動作速
度に見合った高速なものを使用しなければシステム全体
の処理能力を上げることが出来ない。しかし、容量が大
きな主記憶装置全体を高速な記憶素子で構成すると非常
に高価な装置になってしまう。
[Prior Art] In the field of microprocessors, the difference in operation speed between a processor and a main storage device has become a problem as its operation speed has been improved. As the operation speed of the processing unit increases, the amount of instruction codes and data consumed by it also increases.Therefore, the processing capacity of the entire system must be used for the main storage unit unless a high-speed one that matches the operation speed of the processing unit is used. Can not be raised. However, if the entire main storage device having a large capacity is constituted by high-speed storage elements, the device becomes very expensive.

そこで第2図(a)に示すように、主記憶装置23と処
理装置21との間にキャッシュメモリ22を設けて、処理装
置21に比べて相対的に遅い主記憶装置23の速度を見掛上
早くすることを行う。キャッシュメモリ22は、小容量で
はあるが高速な記憶装置で、主記憶装置23の内で、処理
装置21によって最近参照された部分の内容のコピーを保
持している。処理装置23を参照する際には、まずキャッ
シュメモリ22を検索して目的のデータや命令コードがそ
こに存在すればそれを利用して、主記憶装置23の参照は
行わない。もしも目的のものがキャッシュメモリ22の内
部に存在しない場合には、それを主記憶装置23から取り
出して利用すると同時に、キャッシュメモリ22にそのコ
ピーを格納する。
Therefore, as shown in FIG. 2A, a cache memory 22 is provided between the main storage device 23 and the processing device 21 so that the speed of the main storage device 23 is relatively slow as compared with the processing device 21. Do things faster. The cache memory 22 is a small-capacity but high-speed storage device, and holds a copy of the content of the part recently referred to by the processing device 21 in the main storage device 23. When referring to the processing device 23, first, the cache memory 22 is searched, and if the target data or instruction code exists there, it is used, and the main storage device 23 is not referenced. If the target object does not exist in the cache memory 22, it is taken out from the main storage device 23 and used, and at the same time, a copy thereof is stored in the cache memory 22.

キャッシュメモリ22の内部ではデータはブロックと呼
ばれる単位で管理される。キャッシュメモリ22の内部に
存在するブロックは前にも述べたように全て主記憶装置
23の内部のブロックのコピーである。そして、キャッシ
ュメモリ22の内部の全てのブロックには、そのブロック
のオリジナルが主記憶装置23のどこに格納されているか
を示すタグと呼ばれるデータと、そのブロックが有効で
あることを示すバリッドビットと呼ばれるフラグとが付
属している。ブロックとタグとバリッドビットとをまと
めてエントリと呼ぶ。
Inside the cache memory 22, data is managed in units called blocks. The blocks existing inside the cache memory 22 are all in the main memory as described above.
Here is a copy of the block inside 23. All blocks in the cache memory 22 are called data indicating where the original of the block is stored in the main storage device 23 and data called a valid bit indicating that the block is valid. Comes with flags. A block, a tag, and a valid bit are collectively called an entry.

キャッシュメモリ22を検索するとは、キャッシュメモ
リ22の内部に存在する全ての有効なブロックの内から参
照の要求があったデータのアドレスと等しいタグをもっ
たブロックを捜すことを意味する。そして、キャッシュ
メモリ12の内部にそのようなブロックが存在した場合を
ヒット、存在しない場合をミスヒットという。
Searching the cache memory 22 means searching for a block having a tag equal to the address of the data requested to be referenced from all valid blocks existing in the cache memory 22. A case where such a block exists in the cache memory 12 is called a hit, and a case where it does not exist is called a mishit.

キャッシュメモリ22の構成方法は、アドレスとタグと
の比較に用いる比較器の数によっていくつかに分類でき
る。ここでは、その中から今回の発明に関係が深いセッ
トアソシアティブ方式について説明を行う。セットアソ
シアティブ方式のキャッシュメモリにおいては、ウェイ
数、セット数という2個のパラメータによってその構成
を表現する。ウェイ数とは検索の際にアドレスとタグと
の比較に用いられる比較器の数を示す数であり、セット
数とは比較器1個当りのブロック数を示す数である。
The configuration method of the cache memory 22 can be classified into several types according to the number of comparators used for comparing an address with a tag. Here, the set associative method which is closely related to the present invention will be described. In a set associative cache memory, the configuration is expressed by two parameters, the number of ways and the number of sets. The number of ways is a number indicating the number of comparators used for comparing an address and a tag at the time of retrieval, and the number of sets is a number indicating the number of blocks per comparator.

セットアソシアティブ方式のキャッシュメモリの構成
の例としてウェイ数が2である場合(2ウェイセットア
ソシアティブ方式)の構成を第3図に示す。第3図の中
で、301はセットインデックス発生回路であり、参照要
求があったデータのアドレス300から適当なアルゴリズ
ムに基づいてセットインデックス302を発生する。
As an example of the configuration of the set associative cache memory, FIG. 3 shows the configuration when the number of ways is two (two-way set associative system). In FIG. 3, reference numeral 301 denotes a set index generation circuit, which generates a set index 302 from an address 300 of data for which a reference request has been made, based on an appropriate algorithm.

303はウェイ♯0アレイである、これは、ウェイ♯0
に属するエントリを格納するための記憶装置であり、セ
ット数に等しい個数のエントリを格納する。ウェイ♯0
アレイ303は、キャッシュメモリの検索動作の際には、
セットインデックス302に従って内部にあるエントリか
ら1個を選択してその内容を出力する。また、ブロック
の置換動作の際には、ウェイ選択信号発生回路305から
出力されるウェイ♯0選択信号306に従って動作し、セ
ットインデックス302に従って選択されたエントリのタ
グをアドレス300で置換し、ブロックをデータ入力308か
らの入力データで置換し、バリッドビットに論理“1"を
セットしてそのエントリに含まれるブロックが有効であ
ることを示す。
303 is the way $ 0 array, which is the way $ 0
Is a storage device for storing the entries belonging to the group, and stores the number of entries equal to the number of sets. Way $ 0
The array 303 is used for a cache memory search operation.
One entry is selected from the internal entries according to the set index 302, and its contents are output. Further, at the time of the block replacement operation, the block operates in accordance with the way # 0 selection signal 306 output from the way selection signal generation circuit 305, replaces the tag of the entry selected according to the set index 302 with the address 300, and replaces the block. Replace with the input data from the data input 308, and set the valid bit to logic "1" to indicate that the block included in the entry is valid.

ウェイ♯1アレイ304もウェイ♯0アレイ303と同様な
動作を行う。即ち、キャッシュメモリの検索動作の際に
は、セットインデックス302に従って内部にあるエント
リから1個を選択してその内容を出力する。また、ブロ
ックの置換動作の際には、ウェイ選択信号発生回路305
から出力されるウェイ♯1選択信号307に従って動作す
る。
The way # 1 array 304 performs the same operation as the way # 0 array 303. That is, at the time of a cache memory search operation, one entry is selected from the internal entries according to the set index 302 and the content is output. In addition, during the block replacement operation, the way selection signal generation circuit 305
Operates in accordance with the way # 1 selection signal 307 output from.

ウェイ選択信号発生回路305はエントリの更新を行う
場合に、更新の対象となるエントリが存在しているウェ
イを指定するための信号を発生する。参照の結果、ミス
ヒットした場合にはブロックの置換が行われる、その際
にはセットインデックス302に従って選択されたセット
(同じセットインデックスを持つエントリの集合、ウェ
イ数に等しい数のエントリを含む)に属する2個のエン
トリ内のどのウェイに属するものを更新の対象とするか
を決定する必要がある。これを行うためのアルゴリズム
としては、最後に参照されてから最も長い時間が経過し
ているものを更新の対象とするLRUアルゴリズムや、キ
ャッシュメモリに読み込まれてから最も長い時間が経過
しているものを更新の対象とするFIFOアルゴリズム等が
ある。第3図では省略してあるがウェイ選択信号発生回
路305には、そこにインプリメントされているアルゴリ
ズムが必要とする情報を入力するための信号線が存在す
る。
When updating an entry, the way selection signal generating circuit 305 generates a signal for designating a way in which an entry to be updated exists. If a miss occurs as a result of reference, block replacement is performed. In this case, a set selected according to the set index 302 (a set of entries having the same set index, including the number of ways equal to the number of ways) is included. It is necessary to determine which way of the two entries belongs to which is to be updated. Algorithms to do this include LRU algorithms that update the longest time since they were last referenced, or algorithms that have the longest time since they were read into cache memory. There is a FIFO algorithm or the like for which is updated. Although not shown in FIG. 3, the way selection signal generating circuit 305 has a signal line for inputting information required by the algorithm implemented therein.

キャッシュメモリの検索動作の際にセットインデック
ス302に従って選択され、ウェイ♯0アレイ303から出力
されたエントリに含まれるタグは、一致検出回路309へ
入力され、そこでアドレス300と比較される。比較の結
果は、ANDゲート311でそのエントリのバリッドビットと
論理積を取られる。その結果が論理1である場合には、
出力ゲート313が開かれ、選択されているエントリのブ
ロックがデータ出力315へ出力される。すなわち、各ウ
ェイにおいてセットインデックス302に従って選択され
たエントリの内で、そのタグがアドレス300と等しく、
かつ、そのバリッドビットが論理1であるもののブロッ
クがデータ出力315に出力されることになる。
The tag selected in accordance with the set index 302 during the search operation of the cache memory and included in the entry output from the way # 0 array 303 is input to the match detection circuit 309, where it is compared with the address 300. The result of the comparison is ANDed with the valid bit of the entry in the AND gate 311. If the result is logic one,
Output gate 313 is opened and the block of the selected entry is output to data output 315. That is, in each entry selected in each way according to the set index 302, its tag is equal to the address 300,
The block whose valid bit is logic 1 is output to the data output 315.

ORゲート316は、ヒットかミスヒットかを示す信号を
発生するためのものである。すなわち、ウェイ♯0アレ
イ303かウェイ♯アレイ304のどちらかにアドレス300と
値が等しいタグを持ち、かつバリッドビットが論理1で
あるエントリが存在する場合にORゲート316の出力は論
理1となり、キャッシュメモリから目的のデータが出力
されているので主記憶装置を参照する必要がないことを
示す。ここで、ウェイ数W、セット数Sのセットアソシ
アティブ方式のキャッシュメモリの動作についてまとめ
ると以下の通りである。
The OR gate 316 is for generating a signal indicating a hit or a mishit. That is, if there is an entry having a tag equal to the address 300 in either the way # 0 array 303 or the way # array 304 and the valid bit is logic 1, the output of the OR gate 316 becomes logic 1, This indicates that it is not necessary to refer to the main storage device because the target data has been output from the cache memory. Here, the operation of the set associative cache memory of the number of ways W and the number of sets S is summarized as follows.

求めるデータのアドレスから適当なアルゴリズムによ
りセットインデックスを算出する。
The set index is calculated from the address of the data to be obtained by an appropriate algorithm.

求められたセットインデックスを用いてS個のセット
の中から1個を選択する。
One of the S sets is selected using the obtained set index.

選択されたセットにはW個のエントリが含まれている
ので、各々のエントリに含まれるタグとアドレスとをW
個の比較器によって1度に比較する。参照要求があった
アドレスと一致するタグを含み、かつバリッドビットが
論理1である(有効なデータを含む)エントリが存在し
たならばヒットしたものとしてブロックの内容を処理装
置へ送る。またそのようなエントリがなかった場合には
ミスヒットしたものとしてのエントリの置換処理を行
う。
Since the selected set contains W entries, the tag and address contained in each entry are
Are compared at once by the number of comparators. If there is an entry that includes a tag that matches the address requested to be referenced and whose valid bit is logical 1 (contains valid data), the contents of the block are sent to the processing device as a hit as a hit. If there is no such entry, the entry replacement processing is performed assuming that there is a miss hit.

もし現在選択されているセットに空きがあるならば、
参照要求があったデータを主記憶装置から取り出してき
てそこへ格納しタグとバリッドビットとを付与する。セ
ットに空きがない場合には、適当なアルゴリズムに従っ
てW個のエントリ各々の置換の優先順位を評価し、最も
置換の優先順位が高いエントリを無効化して、その後に
主記憶装置から取り出されたデータを格納してタグとバ
リットビットとを付与する。また主記憶装置から取り出
されたデータは処理装置に対しても送られる。
If the currently selected set has room,
The data requested to be referenced is fetched from the main storage device and stored there, and a tag and a valid bit are added. If there is no room in the set, the replacement priority of each of the W entries is evaluated in accordance with an appropriate algorithm, the entry with the highest replacement priority is invalidated, and the data retrieved from the main storage device is deleted. And a tag and a valid bit are assigned. The data retrieved from the main storage device is also sent to the processing device.

ところで、キャッシュメモリは相対的に遅い主記憶装
置を見かけ上速く見せるために設けられる。処理装置側
から見た場合には、主記憶装置とキャッシュメモリとは
別々に見えるのではなく1個の高速な主記憶装置が存在
するように見えなければならない。従って、第2図
(b)に示すように複数の処理装置211,212、…の間で
主記憶装置23を共有しながら処理を行うマルチプロセッ
サーシステムのような構成を考えた場合、複数のキャッ
シュメモリ221、222、…と主記憶装置23との間で内容の
整合性を確保する必要がある。例えば、第2図(b)に
おいて、ある処理装置211の指示により、あるブロック
の内容が書き換えられたとする。このとき、全てのキャ
ッシュメモリ221、222、…と主記憶装置23との間で内容
の整合を取る必要がある。整合の取り方としてよく行わ
れる手法として、主記憶装置23と書き換えを指示した処
理装置211に付加されたキャッシュメモリ221について
は、同じ内容になるように書き換えを行い、そのほかの
キャッシュメモリ222、…については書き換えられたブ
ロックに対応するキャッシュメモリ上のブロックを全て
無効化するという手法がある。
By the way, the cache memory is provided to make a relatively slow main storage device seem faster. When viewed from the processing device side, the main storage device and the cache memory must not appear to be separate, but must appear to have one high-speed main storage device. Therefore, as shown in FIG. 2 (b), when considering a configuration such as a multiprocessor system that performs processing while sharing the main storage device 23 among a plurality of processing devices 211, 212,. , 222,... And the main storage device 23, it is necessary to ensure content consistency. For example, in FIG. 2B, it is assumed that the content of a certain block has been rewritten by an instruction from a certain processing device 211. At this time, it is necessary to match the contents between all the cache memories 221, 222,... And the main storage device 23. As a method that is often performed as a method of matching, the cache memory 221 added to the main storage device 23 and the processing device 211 that has instructed the rewrite is rewritten so as to have the same contents, and the other cache memories 222,. As for the method, there is a method of invalidating all the blocks on the cache memory corresponding to the rewritten blocks.

このような手法を用いる場合、主記憶装置に対する書
き込み動作を検出するためのバス監視回路が必要とな
る。バス監視回路とは、第2図(b)におけるバスライ
ン25上のデータの転送状況を監視して主記憶装置23に対
する書き込みが行われたことを検出するための回路であ
る。
When such a method is used, a bus monitoring circuit for detecting a write operation to the main storage device is required. The bus monitoring circuit is a circuit for monitoring the data transfer status on the bus line 25 in FIG. 2 (b) and detecting that writing to the main storage device 23 has been performed.

下記文献では、この手法にしたがってハードウェアに
よって主記憶装置とマイクロプロセッサに内蔵されてい
るキャッシュメモリとの内容の整合を取る方法が紹介さ
れている。
The following document introduces a method of matching contents between a main storage device and a cache memory built in a microprocessor by hardware according to this method.

文献:Integrated MMU,cache raise system−level is
sues“COMPUTER DESIGN"May 15,1987文献中で紹介され
ているマイクロプロセッサは、チップ上に2ウェイセッ
トアソシアティブ方式のデータ専用キャッシュメモリと
ダイレクトマッピング方式(ウェイ数が1であるセット
アソシアティブ方式と等価な方式)の命令専用キャッシ
ュメモリとを備えている。そして各々の内蔵キャッシュ
メモリにおいては、各ウェイに外部から与えられたセッ
トインデックスにより選択されたエントリのバリッドビ
ットを論理0にリセットして、そのエントリに含まれる
ブロックを無効化する機能を付加することによって上記
手法を実現する手段としている。
Reference: Integrated MMU, cache raise system-level is
sues "COMPUTER DESIGN" May 15, 1987 The microprocessor introduced in the literature has a 2-way set associative data-only cache memory and a direct mapping method (equivalent to a set associative method with one way). ) Instruction-specific cache memory. In each of the internal cache memories, a function of resetting the valid bit of the entry selected by the set index given from the outside to logical 0 to each way and invalidating a block included in the entry is added. Means for realizing the above method.

マイクロプロセッサに内蔵されているキャッシュメモ
リは、一般に容量が小さいため、チップの外部にさらに
外部キャッシュメモリを付加することが行われている。
この場合には、内蔵キャッシュメモリ、外部キャッシュ
メモリのどちらの内容も主記憶装置の内容と整合が取れ
ていなければならない。上記文献において紹介されてい
る例でも、マイクロプロセッサの外部にさらにダイレク
トマップ方式の外部キャッシュメモリを設けている。そ
して、このような場合には内蔵キャッシュメモリ上に存
在するブロックは、必ず外部キャッシュメモリ上にも存
在するという条件が成立する場合には、内蔵キャッシュ
メモリと外部キャッシュメモリとでバス監視回路を共有
することによってハードウェアの量を減少させることが
出来るということが述べられている。そして、その条件
を満たすために、外部キャッシュメモリにおいてエント
リの更新が発生した場合には、外部キャッシュメモリで
更新されたエントリに対応している内蔵キャッシュメモ
リ中のエントリを全て無効化するという方法が紹介され
ている。
Since the cache memory built in the microprocessor generally has a small capacity, an external cache memory is further added outside the chip.
In this case, the contents of both the internal cache memory and the external cache memory must be consistent with the contents of the main storage device. In the example introduced in the above document, a direct map type external cache memory is further provided outside the microprocessor. In such a case, if the condition that the block existing in the internal cache memory always exists in the external cache memory is satisfied, the bus monitoring circuit is shared between the internal cache memory and the external cache memory. It is stated that by doing so, the amount of hardware can be reduced. In order to satisfy the condition, when an entry is updated in the external cache memory, all entries in the internal cache memory corresponding to the entry updated in the external cache memory are invalidated. Has been introduced.

[発明が解決しようとする課題] 従来技術に基づいた内蔵キャッシュメモリを持つマイ
クロプロセッサに外部キャッシュメモリを付加し、ハー
ドウェアによって主記憶装置との内容の整合性を確保す
る際に発生する問題を説明するために、以下に述べるよ
うな系を仮定する。
[Problem to be Solved by the Invention] A problem that occurs when an external cache memory is added to a microprocessor having a built-in cache memory based on the prior art and hardware ensures consistency of contents with a main storage device. For the sake of explanation, assume a system as described below.

(1)内蔵キャッシュメモリは次のような特徴を持つも
のとする。
(1) The built-in cache memory has the following features.

ウェイ数Wi、セット数Siのセットアソシアティブ方式
である。
This is a set associative system with the number of ways Wi and the number of sets Si.

チップ外からセットインデックスを指定することによ
ってセット単位で内容を無効化することができる。
By specifying a set index from outside the chip, the contents can be invalidated in a set unit.

(2)上記のような特徴を備えた内蔵キャッシュメモリ
を持ったマイクロプロセッサに、次のような特徴を備え
た外部キャッシュメモリを付加するものとする。
(2) An external cache memory having the following features is added to a microprocessor having a built-in cache memory having the above features.

ウェイ数We、セット数Seのセットアソシアティブ方式
である(但し、We≧Wi,Se≧Siとする)。
It is a set associative system with the number of ways We and the number of sets Se (however, We ≧ Wi, Se ≧ Si).

バス監視回路を備えており主記憶装置に対する書き込
み動作を検出した場合には、 (a)主記憶装置上の書き換えられたブロックのコピ
ーが自身の内部に存在するかどうかを調べて、存在する
場合には自身の内容と主記憶装置の内容との整合をと
る、 (b)書き込み動作が行われたアドレスに対応する内
部キャッシュメモリのセットインデックスを発生し、そ
れを用いて主記憶装置上で書き換えられたブロックの内
蔵キャッシュメモリ上に存在するコピーを無効化する、 という2つの動作を行う。
When a bus monitoring circuit is provided and a write operation to the main storage device is detected, (a) it is checked whether or not a copy of the rewritten block in the main storage device exists in itself; (B) Generates a set index of the internal cache memory corresponding to the address where the write operation was performed, and rewrites it on the main storage device using the set index. The following operations are performed to invalidate the copy of the specified block existing in the internal cache memory.

このような系において、内蔵キャッシュメモリ上に存
在するブロックについては、必ず同じものが外部キャッ
シュメモリにも存在するという条件が成立するとき、従
来技術の説明の所で述べたように内部キャッシュメモリ
と外部キャッシュメモリとでバス監視機構を共有するこ
とによってハードウェアの量を少なくすることが出来る
ということは前項の参考文献で述べられている通りであ
る。
In such a system, if the condition that the same block always exists in the external cache memory is satisfied, the internal cache memory and the internal cache memory are used as described in the description of the related art. As described in the reference in the preceding section, the amount of hardware can be reduced by sharing the bus monitoring mechanism with the external cache memory.

しかし、一般には外部キャッシュメモリが検索される
のは内蔵キャッシュメモリがミスヒットした場合に限ら
れるため、ある特定のブロックに着目した場合、内蔵キ
ャッシュメモリ側から見た場合と外部キャッシュメモリ
側から見た場合とでは参照の頻度が異なる場合がある。
このとき、内蔵キャッシュメモリ、外部キャッシュメモ
リの両方でミスヒットするような参照要求があった場
合、内蔵キャッシュメモリにおいて置換されるブロック
と外部キャッシュメモリにおいて置換されるブロックが
同一ではないことがある。内蔵キャッシュメモリ、外部
キャッシュメモリ共に2ウェイセットアソシアティブ方
式で置換アルゴリズムとしてLRU方式を用いている場合
に、そのようなことが発生する様子を第4図に示す。
However, in general, the external cache memory is searched only when the internal cache memory has a mishit.Therefore, when focusing on a specific block, the external cache memory is viewed from the internal cache memory side and from the external cache memory side. And the frequency of reference may be different.
At this time, if there is a reference request that causes a miss in both the internal cache memory and the external cache memory, the block replaced in the internal cache memory and the block replaced in the external cache memory may not be the same. FIG. 4 shows how such a case occurs when both the internal cache memory and the external cache memory use the 2-way set associative method and the LRU method as a replacement algorithm.

第4図において、41は内蔵キャッシュメモリの、ある
セットの内容を示している。左側の欄がウェイ♯0に属
するエントリのブロックを表し、右側の欄はウェイ♯1
に属するエントリのブロックを表す。今、このセットの
ウェイ♯0にはブロックAが存在しウェイ♯1にはブロ
ックBが存在するものとする。Bの右形にある*は次に
ミスヒットした場合にはウェイ♯1の内容であるBが置
換されることを示している。42は外部キャッシュメモリ
において41に対応しているセットの内容を示している。
表記法は41の場合と同様である。
In FIG. 4, reference numeral 41 denotes the contents of a certain set in the internal cache memory. The left column shows the block of the entry belonging to way # 0, and the right column shows the way # 1.
Represents a block of entries belonging to. Now, it is assumed that block A exists in way # 0 of this set and block B exists in way # 1. An asterisk (*) on the right side of B indicates that if the next miss occurs, B, which is the content of way # 1, is replaced. 42 indicates the contents of the set corresponding to 41 in the external cache memory.
The notation is the same as in the case of 41.

第4図(a)は、内部キャッシュメモリの内容と外部
キャッシュメモリの内容とが一致している状態を示して
いる。
FIG. 4A shows a state where the contents of the internal cache memory and the contents of the external cache memory match.

ここで、処理装置からBに対する参照が行われた場合
を考える。このとき、内蔵キャッシュメモリはヒットす
るので外部キャッシュメモリは参照されない。またヒッ
トした結果、内蔵キャッシュメモリにおいては次にミス
ヒットした場合に置換されるブロックがBからAに代わ
って43に示すような状態となる。しかし、このとき、外
部キャッシュメモリは参照されていないので、その内容
は44に示すように元のままである(第4図(b))。
Here, it is assumed that the processing device refers to B. At this time, since the built-in cache memory is hit, the external cache memory is not referred. As a result of the hit, in the built-in cache memory, the state of the block to be replaced in the case of the next miss hit is as shown by 43 instead of B to A. However, at this time, since the external cache memory has not been referred to, the contents remain unchanged as shown at 44 (FIG. 4 (b)).

この状態で次にAでもBでもないブロックCが参照さ
れたとする。この時内蔵キャッシュメモリ、外部キャッ
シュメモリともミスヒットする。その結果、両方のキャ
ッシュメモリでブロックの置換が発生するが、内蔵キャ
ッシュメモリにおいてはAが置換され45に示すような状
態となるが、外部キャッシュメモリにおいてはBが置換
され46に示すような状態となる(第4図(c))。
In this state, it is assumed that a block C which is neither A nor B is referred to next. At this time, both the internal cache memory and the external cache memory cause a miss hit. As a result, block replacement occurs in both cache memories. In the internal cache memory, A is replaced and the state as shown at 45 is obtained. However, in the external cache memory, B is replaced and the state as shown at 46 is obtained. (FIG. 4 (c)).

この第4図(c)の状態は、参考文献に記述されてい
る、バス監視回路を内蔵キャッシュメモリと外部キャッ
シュメモリとで共有するための条件が満たされなくな
る。
In the state shown in FIG. 4C, the condition for sharing the bus monitoring circuit between the internal cache memory and the external cache memory described in the reference is not satisfied.

バス監視回路を両方のキャッシュメモリで独立に持て
ば機能上は問題ないがシステム全体としては部品点数が
増加するためあまり望ましい解決法とはならない。
If the bus monitoring circuit is independently provided in both cache memories, there is no problem in function, but the number of components in the whole system increases, so this is not a very desirable solution.

文献中の例では、このような現象を回避するために外
部キャッシュメモリでエントリの更新が発生した場合に
は内蔵キャッシュメモリにおいては、外部キャッシュメ
モリで更新されたエントリと対応しているエントリを全
部無効化してから新しいブロックを読み込んでいる。こ
の様子を第4図と同様な表記で表したのが第5図であ
る。
In an example in the literature, in order to avoid such a phenomenon, when an entry is updated in the external cache memory, all entries corresponding to the entry updated in the external cache memory are stored in the internal cache memory. A new block is being read after invalidation. FIG. 5 shows this state in the same notation as FIG.

第5図において51から54(第5図(a),(b))ま
では第4図の場合と同じである。この状態においてブロ
ックCが参照されたとする。外部キャッシュメモリの動
作は第4図で説明した場合と全く同様でありミスヒット
した結果ブロックBが置換されて56に示すような状態に
なる。一方、内蔵キャッシュメモリにおいてはミスヒッ
トした結果そのセットの内容が一旦全て無効化され55に
示すようになった後にブロックCが読み込まれ、57に示
すような状態となる(第5図(c))。
In FIG. 5, steps 51 to 54 (FIGS. 5A and 5B) are the same as those in FIG. Assume that block C is referred to in this state. The operation of the external cache memory is exactly the same as that described with reference to FIG. On the other hand, in the built-in cache memory, the block C is read after the contents of the set are once invalidated as shown in FIG. 55 as a result of the mishit, and the state shown in 57 is obtained (FIG. 5 (c)). ).

第5図(c)の56、57に着目すると、内蔵キャッシュ
メモリに存在するブロックは必ず外部キャッシュメモリ
にも存在するという条件が満たされるため、内蔵キャッ
シュメモリと外部キャッシュメモリとでバス監視回路を
共有することができる。
Paying attention to 56 and 57 in FIG. 5 (c), the condition that the block existing in the internal cache memory always exists in the external cache memory is satisfied. Can be shared.

しかしながら、この方法を用いた場合、内蔵キャッシ
ュメモリにおいて本来は無効化する必要がないブロック
Aまで無効化されてしまう。セットアソシアティブ方式
のキャッシュメモリの一般的な特性として容量が同じで
あればウェイ数を増やしたほうがヒットする確立が高く
なる傾向があるため、外部キャッシュメモリを設ける場
合にも出来るだけウェイ数が大きい構成のものを設ける
ほうがシステムの性能を大きくすることができる。しか
し、ここで説明したような無駄な無効化が発生しやすい
状況においては、ウェイ数を増やすほど無駄な無効化に
よる被害が増えるため思ったように性能が向上しない。
However, when this method is used, even the block A which should not be invalidated in the built-in cache memory is invalidated. As a general characteristic of the set associative cache memory, if the capacity is the same, increasing the number of ways tends to increase the probability of hitting, so the number of ways is as large as possible even when an external cache memory is provided. The performance of the system can be enhanced by providing the above. However, in a situation in which useless invalidation is likely to occur as described here, the performance is not improved as expected because the damage caused by useless invalidation increases as the number of ways increases.

本発明の目的は、外部キャッシュメモリのエントリが
更新された場合に発生する内蔵キャッシュメモリにおけ
る無駄な無効化操作を減少させることが可能なキャッシ
ュメモリ制御方式を提供することにある。
An object of the present invention is to provide a cache memory control method capable of reducing useless invalidation operations in a built-in cache memory which occur when an entry in an external cache memory is updated.

[課題を解決するための手段] 本発明のキャッシュメモリ制御方式は、キャッシュメ
モリを内蔵したマイクロプロセッサの外部に外部キャッ
シュメモリが設けられ、主記憶装置の各ブロックに対応
するキャッシュメモリ上のブロックが複数個あるように
したセットアソシアティブ方式を取るキャッシュメモリ
制御方式において、外部キャッシュメモリに主記憶装置
に対する書き込みを検出するバス監視手段を備え、ミス
ヒット時に、バス監視手段の検出結果に応じて外部キャ
ッシュメモリから内蔵キャッシュメモリに制御信号を供
給して、内蔵キャッシュメモリの置換されるエントリが
格納されているウェイを外部キャッシュメモリと整合す
るように外部から指定するようにしたものである。
[Means for Solving the Problems] In the cache memory control method of the present invention, an external cache memory is provided outside a microprocessor having a built-in cache memory, and blocks on the cache memory corresponding to each block of the main storage device are provided. In a cache memory control system employing a set associative system in which a plurality of sets are provided, a bus monitoring unit for detecting writing to a main storage device in an external cache memory is provided. A control signal is supplied from the memory to the internal cache memory, and the way in which the entry to be replaced in the internal cache memory is stored is designated from the outside so as to match the external cache memory.

[作用] 内蔵キャッシュメモリにも外部キャッシュメモリにも
ないブロックの参照が行なわれてミスヒットすると、ミ
スヒットに伴うエントリの置換が行なわれるが、その
際、置換の対象となる内蔵キャッシュメモリにおけるウ
ェイの選択が、LRUアルゴリズムやFIFOアルゴリズム等
の置換方式に拘束されることとなる内部からではなく、
そのような方式に拘束されないように外部キャッシュメ
モリから外部指示される。
[Operation] If a block that is neither in the internal cache memory nor in the external cache memory is referred to and a miss occurs, the entry is replaced with the mishit. At this time, the way in the internal cache memory to be replaced is replaced. Selection is not restricted from the inside, which is restricted by the replacement method such as LRU algorithm and FIFO algorithm.
An external instruction is issued from the external cache memory so as not to be restricted by such a method.

外部キャッシュメモリから指示するということは、外
部キャッシュメモリを基準とした指示に基づいて置換の
対象となるウェイの選択を行なうことが可能となる。即
ち、外部キャッシュメモリは内部キャッシュメモリの全
ての状態を把握しているわけではないが、少なくとも、
バス監視手段による主記憶装置書き込み情報を持ってお
り、この情報に基づいて内部キャッシュメモリの置換結
果を外部キャッシュメモリの置換結果に合わすように指
示することが可能となる。
Instructing from the external cache memory makes it possible to select a way to be replaced based on an instruction based on the external cache memory. That is, the external cache memory does not know all states of the internal cache memory, but at least,
It has the main storage device write information by the bus monitoring means, and it is possible to instruct the replacement result of the internal cache memory to match the replacement result of the external cache memory based on this information.

従って、そのような外部指示に基づいてなされた置換
は、無効化する必要のないブロックまで無効化すること
がなく、また、内蔵キャッシュメモリ上に存在するブロ
ックについては、必ず同じものが外部キャッシュメモリ
にも存在するというバス監視機構共有条件が成立するの
で、バス監視手段は外部キャッシュメモリに設けるだけ
で足り、バス監視手段を共有することができる。
Therefore, a replacement made based on such an external instruction does not invalidate blocks that do not need to be invalidated, and the same blocks always exist in the internal cache memory as those in the external cache memory. Since the bus monitoring mechanism sharing condition that the bus monitoring mechanism exists also holds, the bus monitoring means only needs to be provided in the external cache memory, and the bus monitoring means can be shared.

[実施例] 本発明の実施例による2ウェイセットアソシアティブ
キャッシュメモリの構成を第6図に示す。600から616の
各構成要素については、第3図における200から216と同
様である。ただし、ウェイ♯0アレイ603、ウェイアレ
イ604には第3図で説明した基本的な機能に加えて主記
憶装置との内容の整合をハードウェアによって確保する
際に必要なセット単位の無効化を行うための入力が設け
られている。これらは、無効化用セットインデックス入
力620に接続される。本実施例の特徴は構成要素621から
624を付加したことである。621はセレクタであり、外部
選択信号イネーブル信号624によって制御され、内蔵の
ウェイ選択信号発生回路605の出力606,607と、外部から
のウェイ♯0選択信号622,ウェイ♯1選択信号623とを
切り換えて、ウェイ♯0選択信号626,ウェイ♯1選択信
号627を出力するために用いられる。
Embodiment FIG. 6 shows the configuration of a two-way set associative cache memory according to an embodiment of the present invention. The components from 600 to 616 are the same as those from 200 to 216 in FIG. However, the way # 0 array 603 and the way array 604 have, in addition to the basic functions described in FIG. 3, invalidation of a set unit necessary when ensuring consistency of contents with the main storage device by hardware. There is an input to perform. These are connected to the invalidation set index input 620. This embodiment is characterized by the components 621
624 was added. Reference numeral 621 denotes a selector which is controlled by an external selection signal enable signal 624, and switches between outputs 606 and 607 of a built-in way selection signal generation circuit 605 and external way # 0 selection signals 622 and way # 1 selection signals 623, It is used to output a way # 0 selection signal 626 and a way # 1 selection signal 627.

外部キャッシュメモリを付加しない場合には、内蔵の
ウェイ選択信号発生回路605の指示にしたがってエント
リの更新を行うが、外部キャッシュメモリを付加した場
合には外部キャッシュメモリのウェイ選択信号発生回路
の指示にしたがってエントリを更新する。その制御を行
うために外部選択信号イネーブル信号624を設けてあ
る。
When the external cache memory is not added, the entry is updated in accordance with the instruction of the built-in way selection signal generation circuit 605, but when the external cache memory is added, the entry is updated according to the instruction of the way selection signal generation circuit of the external cache memory. Therefore, the entry is updated. An external selection signal enable signal 624 is provided to perform the control.

第6図に示したような構成の内蔵キャッシュメモリを
持つマイクロプロセッサに2ウェイセットアソシアティ
ブ方式の外部キャッシュメモリを付加した例を第1図に
示す。図中で破線で囲まれた部分11がマイクロプロセッ
サである。マイクロプロセッサ11は処理装置12の他に内
蔵キャッシュメモリ13を同一チップ上に含む。内蔵キャ
ッシュメモリ13は第6図に示したような構成を取る。
FIG. 1 shows an example in which a two-way set associative external cache memory is added to a microprocessor having a built-in cache memory having the configuration shown in FIG. A portion 11 surrounded by a broken line in the drawing is a microprocessor. The microprocessor 11 includes a built-in cache memory 13 on the same chip in addition to the processing device 12. The built-in cache memory 13 has a configuration as shown in FIG.

外部キャッシュメモリ15は、従来技術の問題点の説明
の(2)に述べたような機能に加えて、本発明の実施に
必要な内蔵キャッシュメモリ13に対するウェイ選択信号
を発生する機能を備える。(2)に述べたような外部キ
ャッシュメモリ機能を簡略化して繰返すと、それはセッ
トアソシアティブ方式であり、かつ、共有することにな
るバス監視回路19を備え、このバス監視回路19はブロッ
クのコピーが存在する場合には整合を取り、存在しない
場合には内蔵キャッシュメモリ上に存在するコピーを無
効化するというものである。
The external cache memory 15 has a function of generating a way select signal for the built-in cache memory 13 necessary for implementing the present invention, in addition to the function described in (2) of the description of the problems of the prior art. When the external cache memory function as described in (2) is simplified and repeated, the external cache memory function is set associative and has a bus monitoring circuit 19 to be shared, and this bus monitoring circuit 19 If it exists, it is matched, and if it does not exist, the copy existing in the internal cache memory is invalidated.

外部キャッシュメモリ15から内蔵キャッシュメモリ13
に供給される信号線18は内蔵キャッシュメモリ制御信号
をまとめて表現したものであり、無効化を行う際にセッ
トインデックスを指定するための信号線620及び置換を
行う際にウェイを指定するための信号線622〜624からな
る。この置換を行なう際にウェイを指定するための信号
線622〜624に乗る信号は、バス監視回路19の監視結果に
基づいて送出される。
External cache memory 15 to internal cache memory 13
The signal line 18 supplied to the bus is a collective expression of the internal cache memory control signal, and a signal line 620 for specifying a set index when performing invalidation and for specifying a way when performing replacement. It consists of signal lines 622-624. Signals on the signal lines 622 to 624 for specifying a way when performing this replacement are sent out based on the monitoring result of the bus monitoring circuit 19.

主記憶装置67は第2図(a)、第2図(b)に示した
ものと同様である。
The main storage device 67 is the same as that shown in FIGS. 2 (a) and 2 (b).

第7図は、本実施例における内蔵キャッシュメモリと
外部キャッシュメモリとの対応するエントリの状態を第
4図、第5図と同様な表記法に従って表したものであ
る。第7図において71、72(第7図(a))は初期状態
を表している。
FIG. 7 shows the states of the corresponding entries in the built-in cache memory and the external cache memory in this embodiment according to the same notation as in FIGS. 4 and 5. In FIG. 7, reference numerals 71 and 72 (FIG. 7A) show the initial state.

次にBが参照されると内蔵キャッシュメモリでヒット
して73、74に示す状態になる(第7図(b))。
Next, when B is referred to, a hit occurs in the internal cache memory, and the state shown in 73 and 74 is reached (FIG. 7 (b)).

ここまでは、第4図、第5図の場合と同じである。 Up to this point, the operation is the same as in FIGS. 4 and 5.

さらにCが参照されると内蔵キャッシュメモリ、外部
キャッシュメモリ共にミスヒットするのでエントリの更
新が行われる。このとき、第4図の場合には両方のキャ
ッシュメモリは独自の判断に基づいてエントリを更新し
たため、バス監視回路を共有するための条件が満たされ
なくなってしまった。さらに、第5図の場合には条件は
満たされたが本来無効化する必要がないAまで無効化さ
れてしまった。第5図では一旦全てのウェイの内容を無
効化したが、本実施例においては無効化は行わずに外部
からのウェイ選択信号にしたがってBを置換する(第7
図(c))。
Further, when C is referenced, both the built-in cache memory and the external cache memory cause a miss hit, so the entry is updated. At this time, in the case of FIG. 4, both cache memories have updated their entries based on their own judgment, so that the condition for sharing the bus monitoring circuit has not been satisfied. Further, in the case of FIG. 5, the condition A is invalidated up to A which is not necessary to be invalidated. In FIG. 5, the contents of all the ways are once invalidated. However, in this embodiment, B is replaced according to an external way selection signal without invalidation (No. 7).
Figure (c).

すなわち、ブロックの置換動作の際に、外部キャッシ
ュメモリ15に設けたバス監視回路19の監視結果に基づ
き、外部キャッシュメモリ15から内蔵キャッシュメモリ
13に内蔵キャッシュメモリ制御信号18が出力される。外
部選択信号イネーブル624によってセレクタ621から出力
されるウェイ選択信号626,627が、内部から外部のウェ
イ選択信号622,623に切り換えられる。このとき外部の
ウェイ♯0選択信号622は非選択値を取り、ウェイ♯1
選択信号623が選択値を取っている。このため、内蔵キ
ャッシュメモリにおいては、ウェイ♯1アレイ604はセ
レクタ621から出力される外部ウェイ♯1選択信号627に
従って動作し、次にミスヒットした場合に置換されるべ
きブロックがウェイ♯0に属するAであるにも関わら
ず、ウェイ♯1に属するエントリのブロックBの更新が
行なわれて、ブロックCに置換される。外部キャッシュ
メモリにおいては、次にミスヒットした場合に置換され
るべきブロックBがブロックCに置換される。この結
果、内部キャッシュメモリの内容が外部キャッシュメモ
リの内容に合せられ、第7図(c)の75,76に示した状
態となり無駄な無効化は行われない。このようにして、
本実施例によれば内部キャッシュメモリを外部キャッシ
ュメモリに整合させるので、バス監視回路19は外部キャ
ッシュメモリにあれば足りる。
That is, at the time of a block replacement operation, the external cache memory 15 is stored in the internal cache memory based on the monitoring result of the bus monitoring circuit 19 provided in the external cache memory 15.
The internal cache memory control signal 18 is output to 13. The way selection signals 626 and 627 output from the selector 621 by the external selection signal enable 624 are switched from the inside to the outside way selection signals 622 and 623. At this time, the external way # 0 selection signal 622 takes a non-selected value, and the way # 1
The selection signal 623 has a selection value. For this reason, in the built-in cache memory, the way # 1 array 604 operates according to the external way # 1 selection signal 627 output from the selector 621, and the block to be replaced when the next miss occurs belongs to the way # 0. Despite being A, block B of the entry belonging to way # 1 is updated and replaced with block C. In the external cache memory, the block B to be replaced in the case of the next miss hit is replaced with the block C. As a result, the contents of the internal cache memory are adjusted to the contents of the external cache memory, and the state shown at 75 and 76 in FIG. 7 (c) is obtained. In this way,
According to this embodiment, since the internal cache memory is matched with the external cache memory, the bus monitoring circuit 19 only needs to be in the external cache memory.

同様に内部キャッシュメモリは2ウェイで、外部キャ
ッシュメモリが4ウェイセットアソシアティブ方式であ
る場合の動作を示したのが第8図である。
Similarly, FIG. 8 shows the operation when the internal cache memory has two ways and the external cache memory uses the four-way set associative method.

81、82(第8図(a))はそれぞれ内蔵キャッシュメ
モリ、外部キャッシュメモリの初期状態を示している。
81については71と同様である。今度は外部キャッシュメ
モリのウェイ数は4なので81に示した内蔵キャッシュメ
モリのセットに対応する外部キャッシュメモリのセット
には4個のエントリが存在しウェイ♯0から順にA、
B、C、Dというようにブロックが格納されている。82
において、次に外部キャッシュメモリでミスヒットした
場合にはDが置換されることになっているものとする。
81 and 82 (FIG. 8 (a)) show the initial states of the internal cache memory and the external cache memory, respectively.
81 is the same as 71. Since the number of ways of the external cache memory is four this time, there are four entries in the external cache memory set corresponding to the set of the internal cache memory shown at 81.
Blocks such as B, C, and D are stored. 82
In the following, it is assumed that D is to be replaced when the next miss occurs in the external cache memory.

ここで、処理装置がBを参照したとする。このとき、
内蔵キャッシュメモリはヒットし外部キャッシュメモリ
は参照されないので83、84に示すような状態になる(第
8図(b))。
Here, it is assumed that the processing device refers to B. At this time,
Since the built-in cache memory is hit and the external cache memory is not referred to, the state shown in 83 and 84 is obtained (FIG. 8 (b)).

次に、処理装置が内蔵キャッシュメモリにも含まれな
いブロックEを参照したとする。このとき、外部キャッ
シュにおいてはウェイ♯3に存在するブロックDが置換
される。ところが内蔵キャッシュメモリは2ウェイセッ
トアソシアティブ方式でありウェイ♯1までしかない。
そこで外部キャッシュメモリの偶数ウェイを内蔵キャッ
シュメモリのウェイ♯0に対応させ、外部キャッシュメ
モリの奇数ウェイを内蔵キャッシュメモリのウェイ♯1
に対応させることにする。このようにすると、外部キャ
ッシュメモリ上でウェイ♯3に存在するブロックDが置
換されると同時に、外部キャッシュメモリからの指示に
よって内蔵キャッシュメモリにおいてはウェイ♯1に存
在するBが置換され、85、86に示すような状態となる
(第8図(c))。
Next, it is assumed that the processing device refers to the block E which is not included in the internal cache memory. At this time, the block D existing in the way # 3 is replaced in the external cache. However, the built-in cache memory is of the two-way set associative type and has only the way # 1.
Therefore, the even way of the external cache memory is made to correspond to the way # 0 of the internal cache memory, and the odd way of the external cache memory is changed to the way # 1 of the internal cache memory.
Let's make it correspond. In this way, block D existing in way # 3 on the external cache memory is replaced, and B present in way # 1 in the internal cache memory is replaced by an instruction from the external cache memory. The state is as shown in FIG. 86 (FIG. 8 (c)).

この状態はバス監視回路を共有するための条件を満た
している。一般の内蔵キャッシュメモリのセット数が
n、外部キャッシュメモリのウェイ数がm(m≧n)の
場合には、mからnへの多数対1の対応関係を適当に決
定することによって本発明の実施が可能である。
This state satisfies the condition for sharing the bus monitoring circuit. When the number of sets of a general built-in cache memory is n and the number of ways of an external cache memory is m (m ≧ n), the many-to-one correspondence from m to n is appropriately determined to achieve the present invention. Implementation is possible.

以上述べたように本実施例によれば、外部キャッシュ
メモリに共有のバス監視回路を設け、このバス監視回路
の検出結果に応じてウェイ選択信号を内部から外部のウ
ェイ選択信号に切り換えることにより、マイクロプロセ
ッサに内蔵されているセットアソシアティブ方式の内蔵
キャッシュメモリに、ミスヒットに伴うエントリの置換
に際して、置換の対象となるウェイの選択を、外部キャ
ッシュメモリを基準としたチップ外からの指示に従って
行うようにしたので、内部キャッシュメモリをチップ外
の外部キャッシュメモリに容易に整合させることがで
き、従ってバス監視回路を両方のキャッシュメモリに独
立に設ける必要も、また、本来は無効化する必要のない
ブロックまで無効化するということもない。
As described above, according to the present embodiment, a shared bus monitoring circuit is provided in the external cache memory, and the way selection signal is switched from the inside to the external way selection signal in accordance with the detection result of the bus monitoring circuit. When replacing an entry due to a mishit in the set-associative built-in cache memory built in the microprocessor, the way to be replaced is selected according to an instruction from outside the chip based on the external cache memory. Therefore, the internal cache memory can be easily matched with the external cache memory outside the chip. Therefore, it is not necessary to provide the bus monitoring circuit independently in both cache memories, and it is not necessary to invalidate the block in the first place. There is no need to invalidate it.

なお、上記実施例において主記憶とキャッシュメモリ
のマッピング方式をセットアソシアティブ方式とした場
合について述べているが、このセットアソシアティブ方
式には、その特殊例であるダイレクトマッピング方式も
含まれる。
In the above embodiment, the case where the mapping method between the main memory and the cache memory is the set associative method is described. However, the set associative method includes a direct mapping method which is a special example thereof.

[発明の効果] 本発明によれば、キャッシュメモリを内蔵しているマ
イクロプロセッサと外部キャッシュメモリとを組み合わ
せて用いた場合に発生する、内蔵キャッシュメモリの無
駄な無効化動作を減少させることができると共に、バス
監視手段を共有化することができる。
[Effects of the Invention] According to the present invention, it is possible to reduce a useless invalidation operation of a built-in cache memory which occurs when a microprocessor having a built-in cache memory and an external cache memory are used in combination. At the same time, the bus monitoring means can be shared.

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

第1図は本実施例によるキャッシュメモリ制御方式を示
すブロック図、第2図は従来例によるキャッシュメモリ
制御方式を示すブロック図、第3図は従来例によるセッ
トアソシアティブ方式のキャッシュメモリを示すブロッ
ク図、第4図は一般的な内蔵キャッシュメモリと外部キ
ャッシュメモリのエントリ状態図、第5図は従来例によ
る内蔵キャッシュメモリと外部キャッシュメモリのエン
トリ状態図、第6図は本実施例によるセットアソシアテ
ィブ方式のキャッシュメモリを示すブロック図、第7図
は本実施例による2ウェイセットアソシアティブ方式の
内蔵キャッシュメモリと外部キャッシュメモリのエント
リ状態図、第8図は本実施例による4ウェイセットアソ
シアティブ方式の内蔵キャッシュメモリと外部キャッシ
ュメモリのエントリ状態図である。 11はマイクロプロセッサ、12は処理装置、13は内蔵キャ
ッシュメモリ、15は外部キャッシュメモリ、17は主記憶
装置、18は内部キャッシュメモリ制御信号、19はバス監
視回路である。
FIG. 1 is a block diagram showing a cache memory control system according to this embodiment, FIG. 2 is a block diagram showing a conventional cache memory control system, and FIG. 3 is a block diagram showing a set associative cache memory according to a conventional example. 4 is an entry state diagram of a general internal cache memory and an external cache memory, FIG. 5 is an entry state diagram of a conventional internal cache memory and an external cache memory according to a conventional example, and FIG. 6 is a set associative method according to the present embodiment. 7 is a block diagram showing the cache memory of FIG. 7, FIG. 7 is an entry state diagram of a 2-way set associative built-in cache memory and an external cache memory according to the present embodiment, and FIG. 8 is a 4-way set associative built-in cache according to the present embodiment. Entries between memory and external cache memory It is a state diagram. 11 is a microprocessor, 12 is a processing device, 13 is a built-in cache memory, 15 is an external cache memory, 17 is a main storage device, 18 is an internal cache memory control signal, and 19 is a bus monitoring circuit.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平1−199251(JP,A) 特開 昭64−13650(JP,A) 特開 昭61−156346(JP,A) 特開 平1−279342(JP,A) 特開 昭62−84350(JP,A) 特開 平2−188847(JP,A) 特開 平3−230238(JP,A) 特開 昭60−237554(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 12/08,12/12 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-1-199251 (JP, A) JP-A-64-13650 (JP, A) JP-A-61-156346 (JP, A) JP-A-1 279342 (JP, A) JP-A-62-84350 (JP, A) JP-A-2-188847 (JP, A) JP-A-3-230238 (JP, A) JP-A-60-237554 (JP, A) (58) Field surveyed (Int.Cl. 7 , DB name) G06F 12 / 08,12 / 12

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】複数のデータを記憶する主記憶装置と、前
記複数のデータのうちの一部のデータに対応する第1及
び第2データを記憶する内部キャッシュメモリ及び参照
データを出力する処理装置を備えたマイクロプロセッサ
と、前記マイクロプロセッサの外部に設けられ、かつ少
なくとも前記第1及び第2データにそれぞれ対応する第
3及び第4データを記憶する外部キャッシュメモリとを
備えたキャッシュメモリ制御回路において、 前記外部キャッシュメモリの中に前記外部キャッシュメ
モリと共有するように設けられ、かつ前記処理装置の前
記主記憶装置に対する書き込み動作を検出するバス監視
手段と、 前記参照データが前記第1乃至第4データと不一致の場
合に、前記バス監視手段の検出結果に基づいて、前記内
部キャッシュメモリに関する制御を前記外部キャッシュ
メモリからの制御に切り替える制御信号選択手段と、 前記外部キャッシュメモリからの制御によって、前記第
3データを前記参照データに置換する場合には前記第1
データも前記参照データに置換し、前記第4データを前
記参照データに置換する場合には前記第2データも前記
参照データに置換するデータ置換手段とを備えることを
特徴とする前記キャッシュメモリ制御回路。
1. A main storage device for storing a plurality of data, an internal cache memory for storing first and second data corresponding to a part of the plurality of data, and a processing device for outputting reference data A cache memory control circuit comprising: a microprocessor provided with a microprocessor; and an external cache memory provided outside the microprocessor and storing at least third and fourth data respectively corresponding to the first and second data. A bus monitoring means provided in the external cache memory so as to be shared with the external cache memory and detecting a write operation of the processing device to the main storage device; and wherein the reference data is the first to fourth data. If the data does not match, the internal cache memory is determined based on the detection result of the bus monitoring means. A control signal selecting means for switching the control to the control from the external cache memory about the outside by the control from the cache memory, when replacing said third data to the reference data of the first
The cache memory control circuit, further comprising: data replacement means for replacing data with the reference data and replacing the second data with the reference data when replacing the fourth data with the reference data. .
JP02182596A 1990-07-12 1990-07-12 Cache memory control circuit Expired - Fee Related JP3078303B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02182596A JP3078303B2 (en) 1990-07-12 1990-07-12 Cache memory control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02182596A JP3078303B2 (en) 1990-07-12 1990-07-12 Cache memory control circuit

Publications (2)

Publication Number Publication Date
JPH0471049A JPH0471049A (en) 1992-03-05
JP3078303B2 true JP3078303B2 (en) 2000-08-21

Family

ID=16121054

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02182596A Expired - Fee Related JP3078303B2 (en) 1990-07-12 1990-07-12 Cache memory control circuit

Country Status (1)

Country Link
JP (1) JP3078303B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5011885B2 (en) 2006-08-18 2012-08-29 富士通株式会社 Snoop tag control device
JP4912789B2 (en) * 2006-08-18 2012-04-11 富士通株式会社 Multiprocessor system, system board, and cache replacement request processing method
JP4912790B2 (en) * 2006-08-18 2012-04-11 富士通株式会社 System controller, snoop tag update method, and information processing apparatus

Also Published As

Publication number Publication date
JPH0471049A (en) 1992-03-05

Similar Documents

Publication Publication Date Title
EP1654660B1 (en) A method of data caching
US5584013A (en) Hierarchical cache arrangement wherein the replacement of an LRU entry in a second level cache is prevented when the cache entry is the only inclusive entry in the first level cache
EP0185867B1 (en) A memory hierarchy and its method of operation
US5689679A (en) Memory system and method for selective multi-level caching using a cache level code
US5091851A (en) Fast multiple-word accesses from a multi-way set-associative cache memory
US6912623B2 (en) Method and apparatus for multithreaded cache with simplified implementation of cache replacement policy
US4811209A (en) Cache memory with multiple valid bits for each data indication the validity within different contents
US7321954B2 (en) Method for software controllable dynamically lockable cache line replacement system
US20070094450A1 (en) Multi-level cache architecture having a selective victim cache
JPH08272682A (en) Tag separated at inside of load/store unit provided with load buffer and method for access to data array as well as apparatus provided with said array
JP3899376B2 (en) Cache memory system and operation method thereof
EP0706131A2 (en) Method and system for efficient miss sequence cache line allocation
EP0604015A2 (en) Cache control system
US7219197B2 (en) Cache memory, processor and cache control method
EP0675443A1 (en) Apparatus and method for accessing direct mapped cache
JP2007156821A (en) Cache system and shared secondary cache
JPH05216766A (en) Method for maintaining coherence of cache between data cache and segment descriptor and memory device of computer
JPH08255079A (en) Register cache for computer processor
JP3078303B2 (en) Cache memory control circuit
EP0173893B1 (en) Computing system and method providing working set prefetch for level two caches
US6397298B1 (en) Cache memory having a programmable cache replacement scheme
US5636365A (en) Hierarchical buffer memories for selectively controlling data coherence including coherence control request means
JPH0659977A (en) Cache memory capable of executing indicative line substituting operation and its control method
US20240054073A1 (en) Circuitry and Method
JPH06250926A (en) Data processing system provided with cache memory of plural hierarchies

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees