JPH01199251A - Access control system for cache memory - Google Patents

Access control system for cache memory

Info

Publication number
JPH01199251A
JPH01199251A JP8822898A JP2289888A JPH01199251A JP H01199251 A JPH01199251 A JP H01199251A JP 8822898 A JP8822898 A JP 8822898A JP 2289888 A JP2289888 A JP 2289888A JP H01199251 A JPH01199251 A JP H01199251A
Authority
JP
Japan
Prior art keywords
cache
line
lru
caches
order
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
JP8822898A
Other languages
Japanese (ja)
Inventor
Takao Kato
加藤 高夫
Masanobu Yuhara
雅信 湯原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP8822898A priority Critical patent/JPH01199251A/en
Publication of JPH01199251A publication Critical patent/JPH01199251A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To prevent the address having the highest access frequency from vanishing out of a high-order or low-order cache by giving the access control to the exchange of the low-order caches with consideration taken into a fact that the exchange of the low-order caches exists on the high-order caches, as well. CONSTITUTION:Some of those lines are first exchanged based on the LRUs which are updated with accesses received from a means A which updates the LRUs of both internal and external caches and a line selection means B which drives out the contents of the oldest line. The LRUs are updated so as to decide that the accesses are also given to those lines existing in the low-order caches in the blocks to be exchanged during the progress of a means which updates the LRUs of the low-order caches. Otherwise the exchange line of the low-order caches is decided by selecting the oldest line via a low-order cache out of those lines which are not included in the high-order caches and included in the low- order caches.

Description

【発明の詳細な説明】 (概 要〕 この発明は中央処理装置と主記憶装置間に設けられるキ
ャッシュメモリのアクセス制御方式に関し、 キャッシュメモリへのアクセス精度の向上を図ることを
目的とし、 中央処理装置と主記憶装置との間に設けられるキャッシ
ュメモリのアクセス制御方式であって、前記中央処理装
置内部に設けられうる上位キャッシュメモリと外部に設
けられる下位キャッシュメモリのそれぞれのLRUをヒ
ツト情報に基づいて更新するLRU更新手段と、前記L
RUに基づいて、最も古いラインの内容を選択的に入れ
換えるためのライン選択手段とを備え、前記下位キャッ
シュのLRUを更新する手11j〃の進行中に、入れ換
え対象ブロック中の上位キャッシュに存在するラインに
ついてもアクセスが行なわれたとみなすようにLRUを
更新するか、あるいは入れ換えラインを決定するときに
、下位キャッシュには存在するが上位キャッシュには存
在しないものの中から最も古いものを下位キャッシュか
ら選択することにより入れ換えラインを決定するように
構成する。
[Detailed Description of the Invention] (Summary) The present invention relates to an access control method for a cache memory provided between a central processing unit and a main storage device, and aims to improve the accuracy of access to the cache memory. An access control method for a cache memory provided between a device and a main storage device, the LRU of each of an upper cache memory that may be provided inside the central processing unit and a lower cache memory that may be provided externally, based on hit information. an LRU updating means for updating the LRU;
and a line selection means for selectively replacing the contents of the oldest line based on the RU, and the line selection means exists in the upper cache in the block to be replaced during the step 11j of updating the LRU of the lower cache. Either update the LRU so that the line is considered to have been accessed, or select the oldest one from the lower cache among those that exist in the lower cache but not in the upper cache when determining a replacement line. The configuration is such that the replacement line is determined by doing this.

〔産業上の利用分野〕[Industrial application field]

本発明は中央処理装置と主記憶装置間に設けられるキャ
ッシュメモリのアクセス制御方式に関する。
The present invention relates to an access control method for a cache memory provided between a central processing unit and a main storage device.

データ処理装置では中央処理装置(CP U)の高速処
理と低速な主記憶装置(MSU)との処理速度の差を解
消するために、これらの間に高速のキャッシュメモリ 
(以下、キャッシュ)を設けることが行なわれる。マイ
クロプロセッサにおいても同様であり、集積度の向上に
伴い、チップ内部に小容量のキャッシュを設け、さらに
容量を補填するために外部にもキャッシュを設はヒツト
率を向上させ処理性能の向上を図っている。キャッシュ
は通常、複数バイトからなるラインと呼ばれる単位毎に
管理され、新たなラインをキャッシュに登録するとき、
ラインに空きがなければ既にキャッシュに登録されてい
るラインのうちのどれかが追い出される。
In data processing equipment, in order to eliminate the difference in processing speed between the high-speed processing of the central processing unit (CPU) and the slow processing speed of the main storage unit (MSU), a high-speed cache memory is installed between them.
(hereinafter referred to as cache) is provided. The same is true for microprocessors; as the degree of integration increases, small-capacity caches are installed inside the chip, and additional caches are installed externally to supplement the capacity, increasing the hit rate and improving processing performance. ing. Cache is usually managed in units called lines, which consist of multiple bytes, and when registering a new line in the cache,
If there is no free line, one of the lines already registered in the cache will be evicted.

〔従来の技術〕[Conventional technology]

第1O図はセットアソシアティブ方式によるキャッシュ
のアクセス制御方式を説明する図であり、通常、L R
U (Least Recentjy Used)方式
によってデータの入れ換えの制御を行なう。この方式は
同一のセットのラインの中で現時点までのアクセス順を
記憶しておき、最近アクセスされていない古いラインか
ら入れ換えの対象とするものである。
FIG. 1O is a diagram illustrating a cache access control method based on the set associative method.
Data exchange is controlled by the U (Least Recently Used) method. In this method, the order of access up to the present moment among lines in the same set is stored, and the oldest lines that have not been accessed recently are replaced.

例えば、MSUのセット1のラインの斜線部分の“00
101χ”と“FFFOIX ”が、キャッシュのセッ
ト1のWAYOとWAYIにそれぞれ格納されていると
すると、次に同じセット1に対応するが、“0OIOI
X”と” FFFOIX ’以外のアドレスにアクセス
されたときはLRU方式では“0OIOIX”と“FF
FOIX”のいずれかの内最近使われない方を追い出す
ように制御する。
For example, “00” in the shaded part of the line of set 1 of MSU
If ``101χ'' and ``FFFOIX'' are stored in WAYO and WAYI of set 1 of the cache, respectively, then they correspond to the same set 1, but ``0OIOI
When an address other than “X” and “FFFOIX” is accessed, in the LRU method, “0OIOIX” and “FFFOIX” are
FOIX" that has not been used recently.

第11図は階層化されたキャッシュ構成を示す図で、第
12図に詳細に内部構成を示すように、上位キャッシュ
は内部キャッシュに対応し、下位キャッシュは外部キャ
ッシュに対応する。内部キャッシュおよび外部キャッシ
ュは、容量の大小に差はあるが、アドレスを格納するタ
グ部(TAG)と、データを格納するデータ部−(DA
TA)と、これらの書込み/読出しを制御する制御部(
CNT)とを基本構成とする。通常、内部キャッシュは
CPU内部に設けられ、外部キャッシュはアドレスバス
(ADD) 、データバス(D)、制御信号線(S)を
介して内部キャッシュに接続され、さらにMSUに接続
される。第11図に示すような階層化されたキャッシュ
構成では上位キャッシュのアクセス頻度が高く、下位キ
ャッシュのアクセス頻度が低いのが通常である。従って
、読み出しアクセスの場合、上位キャッシュにヒント(
bit)している間は下位キャッシュLこアクセスしな
いので、最もアクセス頻度の高いアドレスに対する下位
キャッシュのラインはアクセス頻度が低いためそのライ
ンから追い出されることがある。この時、偶然にそのア
クセスにおいて上位キャッシュから追い出され、下位キ
ャッシュからも追い出されると、次のアクセスは上位、
下位ともそのアドレスが消滅するミスとなってアクセス
の性能低下を来すことになる。
FIG. 11 is a diagram showing a hierarchical cache configuration. As shown in FIG. 12, which shows the internal configuration in detail, the upper cache corresponds to the internal cache, and the lower cache corresponds to the external cache. The internal cache and external cache differ in capacity, but they have a tag section (TAG) that stores addresses and a data section (DAG) that stores data.
TA) and a control unit (TA) that controls these writes/reads.
The basic structure is CNT). Usually, an internal cache is provided inside the CPU, and an external cache is connected to the internal cache via an address bus (ADD), a data bus (D), and a control signal line (S), and is further connected to the MSU. In a hierarchical cache configuration as shown in FIG. 11, normally the upper cache is accessed more frequently and the lower cache is accessed less frequently. Therefore, for read access, the upper cache has a hint (
Since the lower cache L is not accessed while the bit is being accessed, the lower cache line corresponding to the most frequently accessed address may be evicted from the lower cache line because the access frequency is low. At this time, if by chance the access is evicted from the upper cache and also evicted from the lower cache, the next access will be from the upper cache,
This results in a miss in which the lower address disappears, resulting in a drop in access performance.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

第13図は従来の問題点を説明する図である。 FIG. 13 is a diagram explaining the conventional problems.

図において、左側は上位キャッシュ、右側は下位キャッ
シュの内容である。本図を用いて上述したアクセス頻度
の高いアドレスに対応する下位のラインが追い出された
後で上位のラインも追い出される場合を説明する。左端
はアクセス順序を示し、同一のセットに対応するアドレ
スA、B、C,D。
In the figure, the left side shows the contents of the upper cache, and the right side shows the contents of the lower cache. With reference to this figure, a case will be described in which the above-mentioned lower line corresponding to the frequently accessed address is evicted and then the upper line is also evicted. The left end shows the access order, with addresses A, B, C, and D corresponding to the same set.

Eにこの順序でアクセスがあり、Aが最もアクセス頻度
が高いアクセスとする。上位および下位キャッシュ°の
内容は左端に示したアクセスがあった後の各ラインの内
容を示し、添字数字は各WAY間のアクセス順序を示す
(番号が若いほど古い内容であり入れ替えの対象となる
)。また、図中のダッシュ(−)はラインが存在しない
ことを示している。上位キャッシュにおいて、下端から
3番目ではWAYOにアドレスAがアクセスされた後、
WAYIにアドレスEがアクセスされると−AYIのア
ドレスDはEに更新され、次にWAYOにアドレスDが
アクセスされると、WAYOのアドレスAはDに更新さ
れる。この時点でWAYOはアドレスDに−AYIはア
ドレスEとなりアドレスAは上位キャッシュから消滅す
る。下位キャッシュにおいても同様に、下端から3番目
の−AYOにおいて、アドレスAから已に変ると、この
時点では下位キャッシュのすべてのWAYからアドレス
Aは消滅する。このようにして、最も頻度の高いアドレ
スAが上位キャッシュからも下位キャッシュからも追い
出される事態が生ずる。
It is assumed that E is accessed in this order, and A has the highest access frequency. The contents of the upper and lower cache ° indicate the contents of each line after the access shown on the left, and the subscript number indicates the access order between each WAY (the younger the number, the older the content is and the content to be replaced. ). Further, a dash (-) in the figure indicates that a line does not exist. In the upper cache, after address A is accessed to WAYO in the third from the bottom,
When address E is accessed to WAYI, address D of -AYI is updated to E. Next, when address D is accessed to WAYO, address A of WAYO is updated to D. At this point, WAYO becomes address D and AYI becomes address E, and address A disappears from the upper cache. Similarly, in the lower cache, when the third -AYO from the bottom changes from the address A, the address A disappears from all WAYs in the lower cache at this point. In this way, a situation arises in which the most frequently occurring address A is evicted from both the upper and lower caches.

本発明の目的は階層化されたキャッシュ構成のアクセス
において、下位キャッシュの入れ換えを下位のキャッシ
ュへのアクセスだけでなく上位のキャッシュにも存在す
ることを配慮してアクセス制御することにより、最もア
クセス頻度の高いアドレスが上位および下位のキャッシ
ュから消滅することを防止するアクセス制御方式を提供
することにある。
An object of the present invention is to perform access control in accessing a hierarchical cache configuration by controlling the replacement of lower-level caches by taking into consideration that not only lower-level caches are accessed but also higher-level caches. An object of the present invention is to provide an access control method that prevents high addresses from disappearing from upper and lower caches.

〔課題を解決するための手段および作用〕第1図は本発
明の原理構成図である。Aは内部及び外部キャッシュの
LRUを更新する手段であり、Bは最も古いラインの内
容を追い出すためのライン選択手段である。このような
構成において、アクセスすることにより更新されるLR
Uに基づいて入れ換え対象となるラインの内から入れ換
えを行なう階層化されたキャッシュメモリのアクセス制
御方式では、前記下位キャッシュのLRUを更新する手
段の進行中に、入れ換え対象ブロック中の上位キャッシ
ュに存在するラインについてもアクセスが行なわれたと
みなすようにLRUを更新しておくか、あるいは下位キ
ャッシュの入れ換えラインを決定するときに、下位キャ
ッシュには存在するが上位キャッシュには存在しないも
のの中から最も古いものを下位キャッシュから選ぶこと
により入れ換えラインを決定する。
[Means and operations for solving the problems] FIG. 1 is a diagram showing the basic configuration of the present invention. A is a means for updating the LRU of internal and external caches, and B is a line selection means for evicting the contents of the oldest line. In such a configuration, the LR updated by accessing
In a hierarchical cache memory access control method in which lines to be replaced are replaced based on U, while the means for updating the LRU of the lower cache is in progress, the lines existing in the upper cache in the block to be replaced are in progress. Either update the LRU so that it is assumed that the line that has been accessed has been accessed, or when deciding which line to replace in the lower cache, the oldest line that exists in the lower cache but not in the upper cache. The replacement line is determined by selecting the item from the lower cache.

〔実施例〕〔Example〕

第2図は本発明に係るキャッシュメモリアクセス制御方
式を適用する内部キャッシュのブロック図である。タグ
部(T A G)には第4図(a)に詳細に示すように
−AYOのラインとWAYIのラインを有し、命令制御
部lNClから内部アドレスバスIADHを介して送出
されるアドレスAl0−4によりラインが選択され、さ
らに書込みもしくは読出しの指定アドレスA31−11
が入力される。指定アドレスA31−11は同時に比較
器COMP 1およびCOMP 2にも入力され、これ
ら比較器において−AYOおよびWAYIからの出力と
比較され一致していれば制御部CNTに出力される。比
較器COMP 1およびCOMP 2の出力は制御部C
NTを介してライン選択アドレスAr0−4と共にLR
U方式により更新する内部制御回路(LiLRIJ)に
入力される。制御回路(LiLRtl)の出力は制御部
CNTに入力されると共に取り込みWayAとして後述
する外部キャッシュに出力される。
FIG. 2 is a block diagram of an internal cache to which the cache memory access control method according to the present invention is applied. The tag section (TAG) has an -AYO line and a WAYI line as shown in detail in FIG. -4 selects the line, and further specifies write or read address A31-11
is input. The designated address A31-11 is also input to comparators COMP 1 and COMP 2 at the same time, and is compared with the outputs from -AYO and WAYI in these comparators, and if they match, it is output to the control unit CNT. The outputs of the comparators COMP 1 and COMP 2 are connected to the control section C.
LR with line selection address Ar0-4 via NT
It is input to an internal control circuit (LiLRIJ) that updates using the U method. The output of the control circuit (LiLRtl) is input to the control unit CNT, and is also output to an external cache to be described later as a fetch WayA.

さらに、命令制御部lNClからのライン選択アドレス
A to−2は内部アドレスバスIADBを介してデー
タ部(DATA)の−AYOおよびWAYIに入力され
る。そして、データ部の−AYOおよびWAYIには比
較器COMP 1およびCOMP 2の出力が入力され
、指定アドレスのデータが出力される。出力データDA
TAは内部データバスIDBを介して命令制御部lNC
2へ送出される。■は制御部CNTからTAGに入力さ
れるライン更新のための更新信号である。
Furthermore, the line selection address A to-2 from the instruction control unit INCl is input to -AYO and WAYI of the data unit (DATA) via the internal address bus IADB. The outputs of the comparators COMP 1 and COMP 2 are input to -AYO and WAYI of the data section, and data at the designated address is output. Output data DA
TA is connected to the instruction control unit INC via the internal data bus IDB.
2. 2 is an update signal for updating the line inputted from the control unit CNT to the TAG.

第3図は本発明を適用する外部キャッシュのブロック図
である。外部キャッシュではLRU方式により更新する
外部制御回路(LeLRU)が前述の内部制御回路(L
iLRU)に代って設けられ、さらに更新信号lおよび
Wと取り込みWayAとを比較する比較器COMP 3
とCOMP 4が追加される。各々の比較器からはヒラ
1−(bit)および更新信号Iが制御CNTに入力さ
れ、同時にデータ部(DATA)の各WAYに送出され
る。簡単のためにWAYI 、 WAY2については省
略されており、これらはWAYO、WAY3と同様の構
成である。
FIG. 3 is a block diagram of an external cache to which the present invention is applied. In the external cache, the external control circuit (LeLRU) that updates using the LRU method is connected to the internal control circuit (LeLRU) described above.
Comparator COMP 3 is provided in place of iLRU) and further compares the update signals l and W with the acquisition WayA.
and COMP 4 are added. From each comparator, the signal 1-(bit) and the update signal I are inputted to the control CNT, and simultaneously sent to each WAY of the data section (DATA). For simplicity, WAYI and WAY2 are omitted, and these have the same configuration as WAYO and WAY3.

第4図(a)、(b)はキャッシュ構成図を示し、(a
)は内部キャッシュ、(b)は外部キャッシュである。
FIGS. 4(a) and 4(b) show cache configuration diagrams, and (a)
) is an internal cache, and (b) is an external cache.

Eは外部キャッシュのラインが存在し、lは内部キャッ
シュのラインが存在することを示す。Liは内部キャッ
シュのWAYのLRU制御、Leは外部キャッシュのW
AYのLRUIJIを示す。上位と下位のキャッシュは
斜線で示すように固定的に対応しており、本発明では下
位にアクセスするとき上位にもアクセスしたかのように
みせかけるか、あるいは上位に存在せず、下位に存在す
るものの中から最も古いものを追い出すように制御する
E indicates that an external cache line exists, and l indicates that an internal cache line exists. Li is WAY LRU control of internal cache, Le is W of external cache
Shows AY's LRUIJI. The upper and lower caches have a fixed correspondence as shown by the diagonal lines, and in the present invention, when accessing the lower level, it is made to appear as if the upper level is also accessed, or the cache does not exist in the upper level but exists in the lower level. control to drive out the oldest among those that

第5図(a)、(b)は第2図および第3図に示すLR
U制御回路のブロック図であって、(a)は後述する方
式1に適用し、(b)は方式2に適用する。前述したよ
うに本発明のアクセス制御方式では2つの方式が含まれ
、1つの方式では、LRUは上位キャッシュに存在せず
、下位キャッシュをアクセスしたときに同一セット中の
上位キャッシュに存在するラインについてもアクセスが
あったように更新しておく機能を有し、他の方式では、
LRUの更新は下位のキャッシュのヒントに基いてのみ
行ない、どれかを追い出すときに下位キャッシュに存在
し上位キャッシュにないものの中から古いものを選択す
る機能を有する。即ち、どちらの方式でも上位および下
位キャッシュの両方に存在するものは追い出さず残して
おき、頻度の高いものがたまたま上位キャッシュから追
い出されたときに下位キャッシュには存在するようにし
ておくことにより、頻度の高いアドレスの消滅を防止す
るものである。
Figures 5(a) and (b) are the LRs shown in Figures 2 and 3.
2 is a block diagram of a U control circuit, in which (a) is applied to method 1, which will be described later, and (b) is applied to method 2, which will be described later. FIG. As mentioned above, the access control method of the present invention includes two methods. In one method, the LRU does not exist in the upper cache, but when the lower cache is accessed, the LRU does not exist in the upper cache. It also has a function to update it as if it had been accessed.
The LRU is updated only based on hints from the lower cache, and has a function of selecting an older one from among those existing in the lower cache but not in the upper cache when expelling one. In other words, in either method, items that exist in both the upper and lower caches are left without being evicted, and when a frequently occurring item happens to be evicted from the upper cache, it remains in the lower cache. This prevents addresses from disappearing frequently.

(a)に示すLRU*[11回路は、LRUのRAM5
1と、LRUの更新回路52と、入れ換えを決定するリ
プレース決定回路53により構成され、(b)に示すL
RU制御回路は、RAM51と、更新回路52と、リプ
レースWAY決定回路54により構成される。これらの
回路の詳細は第7図(a)。
The LRU*[11 circuit shown in (a) is the RAM5 of the LRU.
1, an LRU update circuit 52, and a replacement determination circuit 53 that determines replacement, and the LRU shown in (b)
The RU control circuit includes a RAM 51, an update circuit 52, and a replacement WAY determining circuit 54. Details of these circuits are shown in FIG. 7(a).

(b)および第8図(a)〜(c)に詳細に示すので、
説明は後述する。
As shown in detail in (b) and Figures 8(a) to (c),
The explanation will be given later.

第6図はWAYの参照順序を説明する図である。FIG. 6 is a diagram illustrating the reference order of WAYs.

図で示すように4wayのLRUを示し、各wayの参
照の順序関係を6本の矢a w fで示す。この場合、
例えばaが“0”のとき番号の若い方のWAYOが一^
Y1より古いことを示し、“l”のときは番号の若い方
のWAYOが−AYIより新しいことを示している。同
様に、例えばfについてはfが“0”のときは−AY2
の方がWAY3より古く、“1″のときはWAY2の方
が−AY3より新しいことを示している。
As shown in the figure, a 4-way LRU is shown, and the reference order relationship of each way is shown by six arrows aw f. in this case,
For example, when a is “0”, the WAYO with the smaller number is 1^
This indicates that the WAYO is older than Y1, and when it is "l", it indicates that the WAYO with the smaller number is newer than -AYI. Similarly, for example, when f is "0", -AY2
is older than WAY3, and when it is "1", it indicates that WAY2 is newer than -AY3.

第7図(a)、(b)は第5図(a)を詳細に示すブロ
ック図であり、(a)はLRU更新回路52の詳細、(
b)はリプレース決定回路53の詳細ブロック図である
。(a)において、例えば“hito”は−AYOをヒ
ントしてアクセスしたことを示し、“hit3”はWA
Y3をヒツトしてアクセスしたことを示している。信号
!はそのラインが上位キャッシュに存在することを示し
ており、例えば“IO”はWAYOの内容が上位キャッ
シュに存在することを示している。MPXはマルチプレ
クサを示し、通常のLRUの更新はbit信号に行なう
が、方式1の如く上位キャッシュにアクセスがあったか
の如くみなす場合には更新信号■により更新情報を制御
する。即ち、まず、■信号による更新を行なった後、“
hit”による更新を行なう。また、a out〜f 
outはLRUのRAM51の出力であり、この出力は
(b)に示す如くリプレース決定回路53にも入力され
る。ざらにai、1〜fifiはRAM51に入力され
RAMを書き直す内容となる。ブロック71a〜71f
はすべて同一の構成をとり、例えばブロック71aは(
c)に真理値表を示すように、マルチプレクサMPXで
選択された信号H1のうち例えばHl6とHl、につい
て、Hl。とHl。
FIGS. 7(a) and 7(b) are block diagrams showing details of FIG. 5(a), where (a) is a detailed block diagram of the LRU update circuit 52;
b) is a detailed block diagram of the replacement determination circuit 53. In (a), for example, "hito" indicates that the access was made using -AYO as a hint, and "hit3" indicates that the WA
This shows that the access was made by hitting Y3. signal! indicates that the line exists in the upper cache; for example, "IO" indicates that the contents of WAYO exist in the upper cache. MPX indicates a multiplexer, and normal LRU updates are performed using bit signals, but when it is regarded as if the upper cache has been accessed as in method 1, update information is controlled by an update signal (2). That is, first, after performing an update using the ■ signal, “
update by "hit".Also, a out to f
out is the output of the RAM 51 of the LRU, and this output is also input to the replacement determination circuit 53 as shown in (b). Roughly, ai, 1 to fifi are input to the RAM 51 and become the contents to rewrite the RAM. Blocks 71a-71f
all have the same configuration, for example, block 71a (
As shown in the truth table in c), for example, Hl6 and Hl among the signals H1 selected by the multiplexer MPX, Hl. and Hl.

が共に“0.0”もしくは“1,1”のときはaimは
そのままa outを出力し、Hl、とHI Iが異な
るときはa!Rから“0”もしくは“l”が出力される
。(b)の72a〜72dはリプレース決定回路を示し
、実際に追い出すときにどのWAYが最も古いかをさが
すロジックである。H!の真理値表に従ってLRUのR
AMに書き込み、LRUの更新が行なわれる。
When both are "0.0" or "1,1", aim outputs aout as is, and when Hl and HII are different, a! “0” or “l” is output from R. Reference numerals 72a to 72d in (b) indicate replacement determination circuits, which are logics that search for which WAY is the oldest when actually expelling. H! R of LRU according to the truth table of
The data is written to AM and the LRU is updated.

第8図(a)〜(c)は方式2に適用される回路構成で
あり、(a)は第7図(a)と同様である。(b)およ
び(c)はリプレースWay決定回路54の詳細構成図
である。動作等については第7図と同様なため省略する
8(a) to 8(c) are circuit configurations applied to method 2, and (a) is the same as FIG. 7(a). (b) and (c) are detailed configuration diagrams of the replacement way determining circuit 54. Since the operation and the like are similar to those in FIG. 7, their explanation will be omitted.

第9図は本発明に係るアクセス制御方式のLRU更新タ
イミングチャートであって、第2図および第3図に示す
回路においてCPUから取込みWayを出力するタイミ
ングチャートである。第4図(a)、(b)に示すよう
に、内部キャッシュの1つのライン(斜線部分)に対応
する外部キャッシュのラインは16個所(斜線部分)存
在する。
FIG. 9 is an LRU update timing chart of the access control system according to the present invention, and is a timing chart for outputting the take-in Way from the CPU in the circuits shown in FIGS. 2 and 3. As shown in FIGS. 4(a) and 4(b), there are 16 external cache lines (shaded area) corresponding to one line (shaded area) of the internal cache.

この中に内部キャッシュの−AYOおよび−AYIに存
在するものが最大1つずつ存在する。内部キャッシュの
WAYOに取り込む場合、1−1、W−Oとし他のライ
ンについてWAYOに取り込まれているものがないかを
検索する。もし見つかればそのラインはWAYOから追
い出されたはずなので1−0とする。
Among these, there is at most one each that exists in -AYO and -AYI of the internal cache. When importing into WAYO in the internal cache, 1-1 and WO are used to search for other lines that have been imported into WAYO. If found, that line would have been kicked out of WAYO, making it 1-0.

CPUはアドレスADDをクロックCLKに対応して出
力し、内部キャッシュはアドレスを取込み、データDA
TAによりデータを取り込む。内部キヤ・2シユの制御
回路LiLRUは取込みWay信号Aを外部キャッシュ
に出力する。外部キャッシュの制御は、取り込まれたW
ayがない場合と取り込まれたWa yがあった場合に
分けられ、■によるLRUの更新の後、bitによる更
新が行なわれて、前述の如く■→LW−0として他のラ
インについてWAYOに取り込まれているものがないか
を検索する。即ち、取り込まれたWayがない(mis
s)の場合は、m1ss 、 +l1iss・・・とな
る。一方、取り込まれたWayがあった(b i t)
場合にはI−0となる。
The CPU outputs the address ADD in response to the clock CLK, and the internal cache takes in the address and stores the data DA.
Data is taken in by TA. The control circuit LiLRU of the internal cache 2 outputs the take-in way signal A to the external cache. Control of the external cache is controlled by the imported W
It is divided into cases where there is no ay and cases where there is an imported way, and after the LRU is updated by ■, the bit is updated, and as mentioned above, other lines are imported into WAYO as Search to see if there are any. In other words, there is no imported Way (mis
s), m1ss, +l1iss... On the other hand, there was a way that was captured (b it)
In this case, it becomes I-0.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば、階層化されたキ
ャッシュにおいて、下位キャッシュの入れ換えを、下位
のキャッシュへのアクセスだけでなく上位キャッシュに
存在する事も考慮に入れて制御することにより、アクセ
スの精度向上を図ることができる。
As explained above, according to the present invention, in a hierarchical cache, replacement of lower caches is controlled by taking into consideration not only accesses to lower caches but also existence in upper caches. Access accuracy can be improved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明の原理構成図、 第2図は、本発明に係る一実施例内部キャッシュブロッ
ク構成図、 第3図は、本発明に係る一実施例外部キャッシュブロッ
ク構成図、 第4図(a)、(b)は、内部および外部キャッシュ詳
細構成例。 第5図(a)、(b)は、LRU制御回路ブロック図、 第6図は、WAY参照順序説明図、 第7図(a)、(b)は、LRU制御回路詳細図(方式
1)、(c)は真理値表、 第8図(a) 〜(c)は、LRtJ制御回路詳細図(
方式2)、 第9図は、本発明のアクセスタイムチャート、第1O図
は、セットアソシアティブ方式説明図、第11図は、階
層化されたキャッシュ構成図、第12図は、−船釣なキ
ャッシュ制御構成図、および 第13図は、従来の問題点を説明する図である。 (符号の説明) A・・・LRU更新手段、 B・・・ライン選択手段、
lNCl 、 lNC2・・・命令制御部、CNT・・
・制御部、   TAG・・・タグ部、DATA・・・
データ部、   51・・・LRU RAM、52・・
・LRU更新回路、 53・・・リプレース決定回路、 54・・・リプレースWay決定回路。
FIG. 1 is a diagram showing the principle configuration of the present invention. FIG. 2 is a diagram showing the internal cache block configuration of an embodiment of the present invention. FIG. 3 is a diagram of the external cache block configuration of an embodiment of the present invention. Figures (a) and (b) show detailed configuration examples of internal and external caches. Figures 5 (a) and (b) are LRU control circuit block diagrams, Figure 6 is a WAY reference order explanatory diagram, and Figure 7 (a) and (b) are LRU control circuit detailed diagrams (method 1). , (c) is the truth table, and Figures 8 (a) to (c) are detailed diagrams of the LRtJ control circuit (
Method 2), FIG. 9 is an access time chart of the present invention, FIG. 1O is an explanatory diagram of the set associative method, FIG. 11 is a hierarchical cache configuration diagram, and FIG. The control configuration diagram and FIG. 13 are diagrams for explaining conventional problems. (Explanation of symbols) A: LRU update means, B: line selection means,
lNCl, lNC2...instruction control unit, CNT...
・Control section, TAG...Tag section, DATA...
Data section, 51...LRU RAM, 52...
- LRU update circuit, 53... Replace decision circuit, 54... Replace Way decision circuit.

Claims (1)

【特許請求の範囲】 1、中央処理装置と主記憶装置との間に設けられるキャ
ッシュメモリのアクセス制御方式であって、 前記中央処理装置内部に設けられる上位キャッシュメモ
リと外部に設けられる下位キャッシュメモリのそれぞれ
のLRU、ヒット情報に基づいて更新するLRU更新手
段(A)と、 前記LRUに基づいて、最も古いラインの内容を選択的
に入れ換えるためのライン選択手段(Bとを備え、 前記下位キャッシュのLRUを更新する手順の進行中に
、入れ換え対象ブロック中の上位キャッシュに存在する
ラインについてもアクセスが行なわれたとみなすように
LRUを更新するか、あるいは下位キャッシュの入れ換
えラインを決定するときに、下位キャッシュには存在す
るが上位キャッシュには存在しないものの中から最も古
いものを下位キャッシュから選択することにより入れ換
えラインを決定するキャッシュメモリのアクセス制御方
式。
[Claims] 1. An access control method for a cache memory provided between a central processing unit and a main storage device, comprising an upper cache memory provided inside the central processing unit and a lower cache memory provided externally. LRU update means (A) for updating each LRU based on hit information; and line selection means (B) for selectively replacing the contents of the oldest line based on the LRU; During the procedure for updating the LRU of the block to be replaced, the LRU is updated so that it is assumed that a line existing in the upper cache in the block to be replaced has also been accessed, or when determining the replacement line in the lower cache, A cache memory access control method that determines replacement lines by selecting the oldest line from the lower cache that exists in the lower cache but not in the upper cache.
JP8822898A 1988-02-04 1988-02-04 Access control system for cache memory Pending JPH01199251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8822898A JPH01199251A (en) 1988-02-04 1988-02-04 Access control system for cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8822898A JPH01199251A (en) 1988-02-04 1988-02-04 Access control system for cache memory

Publications (1)

Publication Number Publication Date
JPH01199251A true JPH01199251A (en) 1989-08-10

Family

ID=12095466

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8822898A Pending JPH01199251A (en) 1988-02-04 1988-02-04 Access control system for cache memory

Country Status (1)

Country Link
JP (1) JPH01199251A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7461207B2 (en) 2002-05-06 2008-12-02 Sony Computer Entertainment Inc. Methods and apparatus for controlling hierarchical cache memory
JP2009524137A (en) * 2006-01-19 2009-06-25 インターナショナル・ビジネス・マシーンズ・コーポレーション Cyclic snoop to identify eviction candidates for higher level cache

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7461207B2 (en) 2002-05-06 2008-12-02 Sony Computer Entertainment Inc. Methods and apparatus for controlling hierarchical cache memory
US7870340B2 (en) 2002-05-06 2011-01-11 Sony Computer Entertainment Inc. Methods and apparatus for controlling hierarchical cache memory
JP2009524137A (en) * 2006-01-19 2009-06-25 インターナショナル・ビジネス・マシーンズ・コーポレーション Cyclic snoop to identify eviction candidates for higher level cache

Similar Documents

Publication Publication Date Title
US5325511A (en) True least recently used replacement method and apparatus
JP2822588B2 (en) Cache memory device
CN101446923B (en) System and method for flushing a cache line in response to instruction
US7321954B2 (en) Method for software controllable dynamically lockable cache line replacement system
US7493445B2 (en) Cache memory system and control method of the cache memory system
JPH08272693A (en) Conversion table entry provided with cache possibility attribute bit regarding virtual address as well as method and apparatus for reference of said virtual address using said bit
JPS624745B2 (en)
GB2411986A (en) Method, system and apparatus for hierarchical cache line replacement
US8621152B1 (en) Transparent level 2 cache that uses independent tag and valid random access memory arrays for cache access
US7308557B2 (en) Method and apparatus for invalidating entries within a translation control entry (TCE) cache
US5732409A (en) Caching disk controller implemented by hardwired logic
JPS63240650A (en) Cache memory device
US6314490B1 (en) Method and apparatus for memory addressing
CA1315011C (en) System for fast selection of non-cacheable address ranges using programmed array logic
US7464227B2 (en) Method and apparatus for supporting opportunistic sharing in coherent multiprocessors
JPH06318174A (en) Cache memory system and method for performing cache for subset of data stored in main memory
US5517633A (en) System for controlling an internally-installed cache memory
US7949833B1 (en) Transparent level 2 cache controller
JPH01199251A (en) Access control system for cache memory
US7865691B2 (en) Virtual address cache and method for sharing data using a unique task identifier
US20030188105A1 (en) Management of caches in a data processing apparatus
JP2002041358A (en) Processor system
US6904500B2 (en) Cache controller
JPH04174042A (en) Control system for cache memory
JP2850340B2 (en) Cache memory control circuit