JPH0228738A - Method for substituting block of multi-hierarchy cache memory - Google Patents
Method for substituting block of multi-hierarchy cache memoryInfo
- Publication number
- JPH0228738A JPH0228738A JP63178870A JP17887088A JPH0228738A JP H0228738 A JPH0228738 A JP H0228738A JP 63178870 A JP63178870 A JP 63178870A JP 17887088 A JP17887088 A JP 17887088A JP H0228738 A JPH0228738 A JP H0228738A
- Authority
- JP
- Japan
- Prior art keywords
- cache memory
- level
- block
- blocks
- processor
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、多階層キャッシュメモリで構成される情報処
理装置におけるキャッシュメモリのブロック置換え方法
に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a cache memory block replacement method in an information processing device configured with a multi-layered cache memory.
第4図に従来のブロック置換え方法を説明するための多
階層キャッシュメモリの構成例を示す。FIG. 4 shows a configuration example of a multi-tiered cache memory for explaining a conventional block replacement method.
これはプロセッサ1とメインメモリ4の間に、レベル0
(上位レベル)のキャッシュメモリ2とレベル1 (下
位レベル)のキャッシュメモリ3の二階層キャッシュメ
モリを配置した例である。第4図では、レベル1のキャ
ッシュメモリ3の容量はレベル0のキャッシュメモリ2
の容量の2倍、メモリ4の容量はレベル1のキャッシュ
メモリ3の容量の2倍であるとしている。5は一つのブ
ロックを示し、各メモリともに等しい大きさの容量であ
る。This is located between processor 1 and main memory 4 at level 0.
This is an example in which a two-level cache memory is arranged, consisting of a cache memory 2 (upper level) and a cache memory 3 (level 1 (lower level)). In FIG. 4, the capacity of level 1 cache memory 3 is equal to the capacity of level 0 cache memory 2.
The capacity of the memory 4 is twice the capacity of the level 1 cache memory 3. 5 indicates one block, and each memory has the same capacity.
レベルOのキャッシュメモリ2、レベル1のキャッシュ
メモリ3およびメインメモリ4は複数の列(第4図では
4列)に分割されており、メインメモリ4の同一列に含
まれるブロック5は、レベルOのキャッシュメモリ2お
よびレベル1のキャッシュメモリ3の同一列に格納され
る。また、レベル○のキャッシュメモリ2およびレベル
1のキャッシュメモリ3の各列において、各ブロックは
、過去にブロックの要求が行われた順序に格納される。The level O cache memory 2, the level 1 cache memory 3, and the main memory 4 are divided into a plurality of columns (four columns in FIG. 4), and blocks 5 included in the same column of the main memory 4 are divided into level O The level 1 cache memory 2 and the level 1 cache memory 3 are stored in the same column. Furthermore, in each column of the cache memory 2 at level ○ and the cache memory 3 at level 1, each block is stored in the order in which the blocks were requested in the past.
第4図において、これを新←旧で示している。In Figure 4, this is shown as new←old.
以下、第4図の構成例について、第5図および第6図を
参照して従来のブロック置換え処理を説明する。Hereinafter, conventional block replacement processing for the configuration example shown in FIG. 4 will be explained with reference to FIGS. 5 and 6.
いま、初期状態として、第4図に示すメインメモリ4の
ブロック群に対し、レベルOのキャッシュメモリ2およ
びレベル1のキャッシュメモリ3に第6図(a)に示す
ようにブロックが格納されており、プロセッサ1はブロ
ック01,02,01.03,04の順に各ブロック内
のデータを要求したとする。Now, in the initial state, blocks are stored in the level O cache memory 2 and the level 1 cache memory 3 as shown in FIG. 6(a) for the block group of the main memory 4 shown in FIG. , processor 1 requests data in each block in the order of blocks 01, 02, 01.03, and 04.
まず、プロセッサ1からブロック01内のデータが要求
された時、レベルOのキャッシュメモリ2にブロック0
1が存在するので、レベルOのキャッシュメモリ2はプ
ロセッサ1にブロック01内のデータを転送すると\も
に、第0列に格納されているブロックをプロセッサ1か
ら要求のあった順序に並べ換える(第5図のステップ5
01゜502、 5]、2. 513) 。First, when data in block 01 is requested from processor 1, block 0 is stored in cache memory 2 at level O.
1 exists, so when the level O cache memory 2 transfers the data in block 01 to the processor 1, it immediately rearranges the blocks stored in the 0th column in the order requested by the processor 1 ( Step 5 in Figure 5
01°502, 5], 2. 513).
このプロセッサ1からブロック01が要求された場合の
処理後、レベルOのキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第6図(b)のようにな
る。After processing when block 01 is requested from processor 1, cache memory 2 at level O and cache memory at level 1
The state of the cache memory 3 is as shown in FIG. 6(b).
次に、プロセッサ1からブロック02内のデータが要求
された時、レベル0のキャッシュメモリ2は、内部にブ
ロック02を格納していないので、レベル1のキャッシ
ュメモリ3にブロック02を要求すると共に、第0列の
ブロック中でプロセッサ]からの要求が最も古く行われ
たブロックO0をブロック02て置換えるべきブロック
として選択する(第5図のステップ501,502,5
03.504.)。Next, when the processor 1 requests the data in block 02, the cache memory 2 at level 0 does not store block 02 internally, so it requests block 02 from the cache memory 3 at level 1, and Among the blocks in the 0th column, the block O0 for which the oldest request from the processor was made is selected as the block to be replaced by block 02 (steps 501, 502, 5 in FIG. 5).
03.504. ).
レベル1のキャッシュメモリ3は、ブロック02が存在
するので、レベル0のキャッシュメモリ2ヘブロツク0
2を転送(ブロック転送)すると。Level 1 cache memory 3 has block 02, so level 0 cache memory 2 has block 0.
2 is transferred (block transfer).
\もに、第0列中に格納されているブロックをレベルO
のキャッシュメモリ2から要求のあった順序に並べ変え
る(第5図のステップ505.509.510)。レベ
ル0のキャッシュメモリ2は、第0列中のブロックOO
を、レベル1のキャッシュメモリ3から転送されたブロ
ック02で置き換える(第5図のステップ511)。そ
の後、レベルOのキャッシュメモリ2は、プロセッサ1
にブロック02内のデータを転送すると\もに、第0列
に格納されているブロックをプロセッサ1から要求のあ
った順序に並べ変える(第5図の512゜513)。\Moreover, the blocks stored in the 0th column are set to level O.
from the cache memory 2 in the requested order (steps 505, 509, and 510 in FIG. 5). The cache memory 2 at level 0 is block OO in the 0th column.
is replaced with block 02 transferred from the level 1 cache memory 3 (step 511 in FIG. 5). Thereafter, the level O cache memory 2 is stored in the processor 1.
When the data in block 02 is transferred, the blocks stored in the 0th column are rearranged in the order requested by processor 1 (512 and 513 in FIG. 5).
このプロセッサ1からブロック02が要求された場合の
処理後、レベルOのキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第6図(c)のようにな
る。After processing when block 02 is requested from processor 1, cache memory 2 at level O and cache memory 2 at level 1
The state of the cache memory 3 is as shown in FIG. 6(c).
次に、プロセッサ1から再びブロック01内のデータが
要求された時、レベル0のキャッシュメモリ2にブロッ
ク01が存在するので、レベル0のキャッシュメモリ2
はプロセッサ1にブロック01内のデータを転送すると
2もに、第0列に格納されているブロックをプロセッサ
1がら要求のあった順序で並べ変える(第5図のステッ
プ5゜1、 502. 512. 503) 。Next, when processor 1 requests the data in block 01 again, since block 01 exists in level 0 cache memory 2, level 0 cache memory 2
transfers the data in block 01 to processor 1, and 2 also rearranges the blocks stored in the 0th column in the order requested by processor 1 (steps 5.1, 502.512 in Figure 5). .503).
このプロセッサ1から再びブロック01が要求された場
合の処理後、レベル0のキャッシュメモリ2およびレベ
ル1のキャッシュメモリ3の状態は第6図(d)のよう
になる。After processing when block 01 is requested again from processor 1, the states of level 0 cache memory 2 and level 1 cache memory 3 become as shown in FIG. 6(d).
次に、プロセッサ1からブロック03内のデータが要求
された時、レベル0のキャッシュメモリ2はブロック0
3を内部に格納しておらず、レベル1のキャッシュメモ
リ3はブロック03を格納している。この時の処理は、
先のブロック02内のデータが要求された場合と同様で
ある。即ち、レベル1のキャッシュメモリ3からレベル
Oのキャッシュメモリ2にブロック03が転送され、レ
ベル0のキャッシュメモリ2は、第0列のブロックでプ
ロセッサ1からの要求が最も以前に行われたブロック0
2をブロック03で置き換え、プロセッサ1にブロック
03内のデータを転送すると\もに、第0列に格納され
ているブロックをプロセッサ1から要求のあった順序に
並べ変える。Next, when data in block 03 is requested from processor 1, cache memory 2 at level 0
3 is not stored internally, and the level 1 cache memory 3 stores block 03. The process at this time is
This is similar to the case where the data in block 02 was requested. That is, block 03 is transferred from level 1 cache memory 3 to level O cache memory 2, and level 0 cache memory 2 transfers block 0 to the block in the 0th column for which the request from processor 1 was made the earliest.
2 is replaced with block 03 and the data in block 03 is transferred to processor 1. At the same time, the blocks stored in the 0th column are rearranged in the order requested by processor 1.
方、レベル1のキャッシュメモリ3は、第0列に格納さ
れているブロックをレベル0のキャッシュメモリ2から
要求のあった順序に並べ変える。On the other hand, the level 1 cache memory 3 rearranges the blocks stored in the 0th column in the requested order from the level 0 cache memory 2.
このプロセッサ1からブロック03が要求された場合の
処理後、レベルOのキャッシュメモリ2およびレベル1
のキャッシュメモリの状態は第6図(e)のようになる
。After processing when block 03 is requested from this processor 1, cache memory 2 at level O and cache memory 2 at level 1
The state of the cache memory is as shown in FIG. 6(e).
次に、プロセッサ1からブロック04内のデータが要求
された時、レベル0のキャッシュメモリ2は、内部にブ
ロック4を格納していないので、レベル1のキャッシュ
メモリ3にブロックo4を要求すると2もに、第0列の
ブロック中でプロセッサ1からの要求が最も古くに行わ
れたブロック01を置き換えブロックとして選択する(
第5図のステップ501,502,503,504)。Next, when processor 1 requests data in block 04, cache memory 2 at level 0 does not store block 4 internally, so when requesting block o4 from cache memory 3 at level 1, data in block 04 is also requested. Then, among the blocks in the 0th column, block 01, for which the request from processor 1 was made the oldest, is selected as the replacement block (
Steps 501, 502, 503, 504 in FIG.
一方、レベル1のキャッシュメモリ3にもブロック04
が存在しないので、レベル1のキャッシュメモリ3は、
メインメモリ4に対してブロック04を要求すると\も
に、第0列のブロック中でレベルOのキャッシュメモリ
2からの要求が最も古くに行われたブロック01をブロ
ック04で置き換えるべきブロックとして選択する(第
5図のステップ505,506,507)。メインメモ
リ4からブロック04の転送(ブロック転送)が行われ
ると、レベル1のキャッシュメモリ3は、第0列中のブ
ロック01を、メインメモリ4から転送されたブロック
04で置き換える(第5図のステップ508)。その後
、レベル1のキャッシュメモリ3は、レベル0のキャッ
シュメモリ2にブロック04を転送すると\もに、第0
列に格納されているブロックをレベルOのキャッシュメ
モリ2から要求のあった順序に並べ変える(第5図のス
テップ509,510)。On the other hand, block 04 also exists in level 1 cache memory 3.
Since there is no cache memory 3 at level 1,
When block 04 is requested from main memory 4, block 01, which has been requested from level O cache memory 2 the oldest among the blocks in the 0th column, is selected as the block to be replaced with block 04. (Steps 505, 506, 507 in FIG. 5). When block 04 is transferred from main memory 4 (block transfer), level 1 cache memory 3 replaces block 01 in the 0th column with block 04 transferred from main memory 4 (as shown in FIG. 5). Step 508). After that, when the level 1 cache memory 3 transfers the block 04 to the level 0 cache memory 2,
The blocks stored in the column are rearranged from the level O cache memory 2 in the requested order (steps 509 and 510 in FIG. 5).
レベルOのキャッシュメモリ2は、第0列中のブロック
01を、レベル1のキャッシュメモリ3から転送された
ブロック4で置き換える(第5図のステップ511)。The level O cache memory 2 replaces the block 01 in the 0th column with the block 4 transferred from the level 1 cache memory 3 (step 511 in FIG. 5).
その後、レベル0のキャッシュメモリ2は、プロセッサ
1にブロック04内のデータを転送すると\もに、第0
列に格納されているブロックをプロセッサ1からの要求
のあった順序に並べ換える(第5図のステップ512゜
513)。Thereafter, when the cache memory 2 at level 0 transfers the data in block 04 to the processor 1,
The blocks stored in the columns are rearranged in the order requested by processor 1 (steps 512 and 513 in FIG. 5).
このプロセッサ1からブロック04が要求された場合の
処理後、レベルOのキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第6図(f)のようにな
る。After processing when block 04 is requested from processor 1, cache memory 2 at level O and cache memory 2 at level 1
The state of the cache memory 3 is as shown in FIG. 6(f).
一般に、プロセッサから要求された順序が新しいブロッ
ク程、再びプロセッサから要求される確率が高いので、
キャッシュメモリに格納しておく必要がある。しかし、
従来のブロック置換え方法では、上記のように、下位の
レベルのキャッシュメモリは、上位レベルのキャッシュ
メモリから要求されたブロックの情報のみを用い、プロ
セッサから上位レベルのキャッシュメモリに対して行わ
れたアクセスと独立にブロックの置き換えを行っていた
ので、下位レベルのキャッシュメモリには、プロセッサ
から要求された順序の新しいブロックが、必ずしも格納
されるようになっていない欠点があった。第6図の例で
は、プロセッサ1からブロック内のデータの要求がブロ
ック01,02゜01.03,04の順に行われたにも
か\わらず、プロセッサ5から要求された順序が3番目
に新しいブロック01がレベル1のキャッシュメモリ3
に格納されていない。Generally, the more recent a block is requested by the processor, the higher the probability that it will be requested again by the processor.
It must be stored in cache memory. but,
In the conventional block replacement method, as described above, the lower level cache memory uses only the information of the block requested from the upper level cache memory, and the accesses made to the upper level cache memory from the processor Because blocks were replaced independently from the processor, the lower level cache memory had the drawback that new blocks were not necessarily stored in the order requested by the processor. In the example of FIG. 6, although processor 1 requests data in blocks in the order of blocks 01, 02, 01, 03, and 04, processor 5 requests data in the third order. New block 01 is level 1 cache memory 3
Not stored in .
本発明の目的は、多階層キャッシュメモリにおいて、下
位レベルのキャッシュメモリに、プロセッサから要求さ
れた順序の新しいブロックを格納することを可能とする
ブロック置換え方法を提供することにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a block replacement method that allows a lower level cache memory to store a new block in the order requested by a processor in a multi-level cache memory.
上記目的を達成するため、本発明の多階層キャッシュメ
モリのブロック置換え方法においては、下位レベルのキ
ャッシュメモリのブロックを、上位レベルのキャッシュ
メモリに格納されているブロックと格納されていないブ
ロックに区分し、下位レベルのキャッシュメモリでのブ
ロック置き換え時、上位レベルのキャッシュメモリに格
納されていないブロックを置き換えの対象とすることを
特徴とするものである。In order to achieve the above object, in the multi-level cache memory block replacement method of the present invention, blocks in the lower level cache memory are divided into blocks stored in the upper level cache memory and blocks not stored in the upper level cache memory. , when a block is replaced in a lower level cache memory, a block that is not stored in an upper level cache memory is targeted for replacement.
上位レベルのキャッシュメモリは、下位レベルのキャッ
シュメモリにブロック要求を出す時、該ブロックで置き
換えられるブロックも同時にを通知する。これにより、
下位レベルのキャッシュメモリでは、ブロックを上位レ
ベルのキャッシュメモリに格納されているブロックと格
納されていないブロックに区分することができる。When the upper level cache memory issues a block request to the lower level cache memory, it also notifies the block to be replaced by the block at the same time. This results in
In the lower level cache memory, blocks can be divided into blocks stored in the higher level cache memory and blocks not stored in the higher level cache memory.
下位レベルのキャッシュメモリは、ブロック置き換え時
、上位レベルのキャッシュメモリに含まれていないブロ
ックのみを置き換えの対象とし、プロセッサから要求さ
れた順序に新しいブロックを格納する。これにより、下
位レベルのキャッシュメモリにおけるブロックの置き換
えが、上位レベルのキャッシュメモリが無い場合と同様
に行われ、プロセッサから要求された新しいブロックを
優先して内部に格納しておくことが可能となる。When replacing blocks, the lower level cache memory replaces only blocks that are not included in the upper level cache memory, and stores new blocks in the order requested by the processor. As a result, blocks in the lower-level cache memory are replaced in the same way as if there was no upper-level cache memory, and new blocks requested by the processor can be given priority and stored internally. .
以下、本発明の一実施例について図面により説明する。 An embodiment of the present invention will be described below with reference to the drawings.
第1図は本発明のブロック置換え方法の一実施例を説明
するための構成図で、1はプロセッサ、2はレベル0の
キャッシュメモリ、3はレベル1のキャッシュメモリ、
4はメインメモリである。FIG. 1 is a block diagram for explaining an embodiment of the block replacement method of the present invention, in which 1 is a processor, 2 is a level 0 cache memory, 3 is a level 1 cache memory,
4 is the main memory.
第1図の構成は、基本的に第4図の構成と同様であり、
レベルOのキャッシュメモリ2、レベル1のキャッシュ
メモリ3およびメインメモリ4は4列に分かれ、レベル
]のキャッシュメモリ3の容量はレベルOのキャッシュ
メモリ2の容量の2倍、メインメモリ4の容量はレベル
1のキャッシュメモリ3の容量の2倍であるとしている
。5は一つのブロックを示し、各メモリともに等しい大
きさの容量である。The configuration in Figure 1 is basically the same as the configuration in Figure 4,
Level O cache memory 2, level 1 cache memory 3, and main memory 4 are divided into four columns, and the capacity of level cache memory 3 is twice the capacity of level O cache memory 2, and the capacity of main memory 4 is It is assumed that the capacity is twice that of the level 1 cache memory 3. 5 indicates one block, and each memory has the same capacity.
メインメモリ4の同一列に含まれるブロックは、レベル
0のキャッシュメモリ2およびレベル1のキャッシュメ
モリ3の同一列に格納される。この場合、レベルOのキ
ャッシュメモリ2の各列については、従来と同様にプロ
セッサ1から要求が行われた順序にブロックが格納され
るが、レベル1のキャッシュメモリ3の各列については
、レベルOのキャッシュメモリ2に格納されているプロ
ン]1
りa、レベルOのキャッシュメモリ2に格納されていな
いブロックbに分けて格納し、レベルOのキャッシュメ
モリ2に格納されていないブロックbは、過去にレベル
Oのキャッシュメモリ2に格納されていた順序に格納す
る。第1図において、置換えられた順序を新←旧で示す
。Blocks included in the same column of main memory 4 are stored in the same column of level 0 cache memory 2 and level 1 cache memory 3. In this case, for each column of the cache memory 2 at level O, blocks are stored in the order in which requests are made from the processor 1 as in the past, but for each column of the cache memory 3 at level 1, blocks are stored at level O. Blocks stored in the cache memory 2 of level O]1 are divided into blocks b that are not stored in the cache memory 2 of level O, and blocks b that are not stored in the cache memory 2 of level O are are stored in the order in which they were stored in the level O cache memory 2. In FIG. 1, the replaced order is shown as new←old.
以下、第1図の構成例について、第2図および第3図を
参照して本発明によるブロック置換え処理の一例を説明
する。An example of block replacement processing according to the present invention will be described below with reference to FIGS. 2 and 3 for the configuration example shown in FIG. 1.
いま、初期状態として、第1図に示すメインメモリ4の
ブロック群に対し、レベルOのキャッシュメモリ2およ
びレベル1のキャッシュメモリ3に第3図(a)に示す
ようにブロックが格納されているとする。この状態にお
いて、プロセッサ1がブロック01,02,01,03
,04の順にデータを要求した場合について以下に説明
する。Now, as an initial state, blocks are stored in the level O cache memory 2 and the level 1 cache memory 3 as shown in FIG. 3(a) for the block group of the main memory 4 shown in FIG. shall be. In this state, processor 1 blocks blocks 01, 02, 01, 03.
, 04 will be described below.
まず、プロセッサlからブロック01内のデータが要求
された時、レベルOのキャッシュメモリ2にブロック0
1が存在するので、レベルOのキャッシュメモリ2はプ
ロセッサ1にブロック01内のデータを転送すると\も
に、第0列に格納されているブロックをプロセッサ1か
ら要求のあった順序に並べ換える(第2図のステップ2
01゜202.212,213)。First, when data in block 01 is requested from processor l, block 0 is stored in cache memory 2 at level O.
1 exists, so when the level O cache memory 2 transfers the data in block 01 to the processor 1, it immediately rearranges the blocks stored in the 0th column in the order requested by the processor 1 ( Step 2 in Figure 2
01°202.212,213).
このプロセッサ1からブロック01が要求された場合の
処理後、レベル0のキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第2図(b)のようにな
る。これは第6図(b)と同じである。After processing when block 01 is requested from processor 1, cache memory 2 of level 0 and cache memory 2 of level 1
The state of the cache memory 3 is as shown in FIG. 2(b). This is the same as FIG. 6(b).
次に、プロセッサ1からブロック02内のデータが要求
された時、レベルOのキャッシュメモリ2は、内部にブ
ロックo2を格納していないので、第0列のブロック中
でプロセッサ1からの要求が最も古く行われたブロック
OOをブロック02で置換えるべきブロックとして選択
し、レベル1のキャッシュメモリ3に対し、ブロック0
2のブロック転送を要求すると\もに、ブロックOOを
ブロック02で置き換えることを通知する(第2図のス
テップ201,202,203,204)。Next, when processor 1 requests data in block 02, cache memory 2 at level O does not store block o2 internally, so the request from processor 1 is the most requested among the blocks in the 0th column. The old block OO is selected as the block to be replaced with block 02, and block 0 is selected for level 1 cache memory 3.
When a request is made to transfer block 02, it is notified that block OO will be replaced with block 02 (steps 201, 202, 203, and 204 in FIG. 2).
レベル1のキャッシュメモリ3は、ブロックO2が存在
するので、レベルOのキャッシュメモリ2ヘブロツク0
2を転送する(第2図のステップ205.209)。そ
の後、レベル1のキャッシュメモリ3は、ブロック00
とブロック02の格納位置を入れ換えると\もに、レベ
ル0のキャッシュメモリ2の第0列に格納されていない
ブロックbをレベルOのキャッシュメモリ2に格納され
ていた順序に並べ変える(第2図のステップ210)。Since block O2 exists in level 1 cache memory 3, level O cache memory 2 has block 0.
2 (steps 205 and 209 in FIG. 2). After that, the cache memory 3 at level 1 will have block 00
When the storage position of block 02 is swapped, the blocks b that are not stored in the 0th column of the level 0 cache memory 2 are rearranged in the order in which they were stored in the level 0 cache memory 2 (Fig. 2). step 210).
レベルOのキャッシュメモリ2は、第0列中のブロック
OOを、レベル1のキャッシュメモリ3から転送された
ブロック02で置き換える(第2図のステップ211)
。その後、レベルOのキャッシュメモリ2は、プロセッ
サ1にブロック02内のデータを転送すると\もに、第
0列に格納されているブロックをプロセッサ1から要求
のあった順序に並べ変える(第2図の212,213)
。The level O cache memory 2 replaces the block OO in the 0th column with the block 02 transferred from the level 1 cache memory 3 (step 211 in FIG. 2).
. After that, the level O cache memory 2 transfers the data in block 02 to the processor 1, and at the same time rearranges the blocks stored in the 0th column in the order requested by the processor 1 (see Figure 2). 212, 213)
.
このプロセッサ1からブロック02が要求された場合の
処理後、レベル0のキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第2図(c)のようにな
る。第6図(c)に対し、第2図(C)では、レベル1
のキャッシュメモリ3において、ブロックOOとブロッ
ク01の配置が入れ換わっている。After processing when block 02 is requested from processor 1, cache memory 2 at level 0 and cache memory 2 at level 1
The state of the cache memory 3 is as shown in FIG. 2(c). In contrast to Fig. 6(c), in Fig. 2(C), level 1
In the cache memory 3, the locations of block OO and block 01 are swapped.
次に、プロセッサ1から再びブロック01内のデータが
要求された時、レベル0のキャッシュメモリ2にブロッ
ク01が存在するので、レベルOのキャッシュメモリ2
はプロセッサ1にブロック01内のデータを転送すると
\もに、第0列に格納されているブロックをプロセッサ
1から要求のあった順序で並べ変える(第2図のステッ
プ20.202,212,213)。Next, when processor 1 requests the data in block 01 again, since block 01 exists in level 0 cache memory 2, level O cache memory 2
transfers the data in block 01 to processor 1, and at the same time rearranges the blocks stored in the 0th column in the order requested by processor 1 (steps 20, 202, 212, 213 in Figure 2). ).
このプロセッサ1から再びブロック01が要求された場
合の処理後、レベル0のキャッシュメモリ2およびレベ
ル1のキャッシュメモリ3の状態は第2図(d)のよう
になる。After processing when block 01 is requested again from processor 1, the states of level 0 cache memory 2 and level 1 cache memory 3 are as shown in FIG. 2(d).
次に、プロセッサ1からブロック03内のデータが要求
された時、レベルOのキャッシュメモリ2はブロック0
3を内部に格納しておらず、レベル1のキャッシュメモ
リ3はブロック03を格納している。この時の処理は、
先のブロック02内のデータが要求された場合と同様で
ある。即ち、レベルOのキャッシュメモリ2は、内部に
ブロック03を格納していないので、レベル1のキャッ
シュメモリ3にブロック03を要求するが、同時に第0
列のブロックでプロセッサ1からの要求が最も古くに行
われたブロック02をブロック03で置き換えることを
通知する。レベル1のキャッシュメモリ3は、レベルO
のキャッシュメモリ2にブロック03を転送し、レベル
Oのキャッシュメモリ2は、ブロック02をブロック0
3で置き換え、プロセッサ1にブロック03内のデータ
を転送すると\もに、第0列に格納されているブロック
をプロセッサ1から要求のあった順序に並べ換える。一
方、レベル1のキャッシュメモリ3は、ブロック02と
ブロック03の格納位置を入れ換えると\もに、レベル
Oのキャッシュメモリ2の第0列に格納されていないブ
ロックbをレベルOのキャッシュメモリ2に格納されて
いた順序に並べ変える。Next, when data in block 03 is requested from processor 1, cache memory 2 at level O
3 is not stored internally, and the level 1 cache memory 3 stores block 03. The process at this time is
This is similar to the case where the data in block 02 was requested. In other words, since the cache memory 2 at level O does not store block 03 internally, it requests block 03 from the cache memory 3 at level 1, but at the same time it requests block 03 from the cache memory 3 at level 1.
Notification is made that block 02, which was the oldest block in the column for which a request was made from processor 1, will be replaced with block 03. Level 1 cache memory 3 is level O
The block 03 is transferred to the level O cache memory 2, and the level O cache memory 2 transfers the block 02 to the block 0.
3 and transfers the data in block 03 to processor 1, the blocks stored in the 0th column are rearranged in the order requested by processor 1. On the other hand, in the level 1 cache memory 3, when the storage locations of blocks 02 and 03 are swapped, block b, which is not stored in the 0th column of the level O cache memory 2, is transferred to the level O cache memory 2. Rearrange them in the order in which they were stored.
1に
のプロセッサ1からブロック03が要求された場合の処
理後、レベルOのキャッシュメモリ2およびレベル1の
キャッシュメモリの状態は第3図(e)のようになる。After processing when the block 03 is requested from the processor 1 at 1, the state of the level O cache memory 2 and the level 1 cache memory becomes as shown in FIG. 3(e).
次に、プロセッサ1からブロック04内のデータが要求
された時、レベル0のキャッシュメモリ2は、内部にブ
ロック04を格納していないので、第0列のブロック中
でプロセッサ1からの要求が最も古くに行われたブロッ
ク01を置き換えブロックとして選択し、レベル1のキ
ャッシュメモリ3に対し、ブロック04を要求すると\
もに、ブロック01をブロック04で置き換えることを
通知する(第2図のステップ201,202,203.
204)。Next, when processor 1 requests data in block 04, cache memory 2 at level 0 does not store block 04 internally, so the request from processor 1 is the most requested among the blocks in the 0th column. If you select block 01, which was executed in the past, as a replacement block and request block 04 from level 1 cache memory 3,\
also informs that block 01 is to be replaced with block 04 (steps 201, 202, 203 . in FIG. 2).
204).
一方、レベル1のキャッシュメモリ3にもブロック04
が存在しないので、レベル1のキャッシュメモリ3は、
メインメモリ4に対してブロック04を要求すると\も
に、第0列のブロック中でレベル0のキャッシュメモリ
2に最も古くに格納されなくなったブロック00をブロ
ック04で置き換えるべきブロックとして選択する(第
2図のステップ205,206,207)。メインメモ
I74からブロック04の転送(ブロック転送)が行わ
れると、レベル1のキャッシュメモリ3は、第0列中の
ブロックOOを、メインメモリ4から転送されたブロッ
ク04で置き換え、レベルOのキャッシュメモリ2にブ
ロック04を転送する(第2図のステップ208,20
9)。その後、レベル1のキャッシュメモリ3は、第0
列中のブロック01とブロック04の格納位置を入れ換
えると\もに、レベルOのキャッシュメモリ2に格納さ
れていない第0列中のブロックbをレベル0のキャッシ
ュメモリ2に格納されていた順序に並べ換える(第2図
のステップ210)。On the other hand, block 04 also exists in level 1 cache memory 3.
Since there is no cache memory 3 at level 1,
When block 04 is requested from the main memory 4, block 00, which is the oldest to no longer be stored in the level 0 cache memory 2 among the blocks in the 0th column, is selected as the block to be replaced with block 04. Steps 205, 206, 207 in Figure 2). When the block 04 is transferred from the main memory I74 (block transfer), the level 1 cache memory 3 replaces the block 04 in the 0th column with the block 04 transferred from the main memory 4, and the level 0 cache Transfer block 04 to memory 2 (steps 208 and 20 in FIG.
9). Thereafter, the level 1 cache memory 3
When the storage positions of block 01 and block 04 in the column are swapped, block b in the 0th column, which is not stored in the level O cache memory 2, is changed to the order in which it was stored in the level 0 cache memory 2. Reorder (step 210 in FIG. 2).
レベルOのキャッシュメモリ2は、第0列中のブロック
01を、レベル1のキャッシュメモリ3から転送された
ブロック4で置き換える(第2図のステップ211)。The level O cache memory 2 replaces the block 01 in the 0th column with the block 4 transferred from the level 1 cache memory 3 (step 211 in FIG. 2).
その後、レベルOのキャッシュメモリ2は、プロセッサ
1にブロックo4内のデータを転送すると\もに、第0
列に格納されているブロックをプロセッサ1からの要求
のあった順序に並べ換える(第2図のステップ212゜
213)。Thereafter, when the cache memory 2 at level O transfers the data in block o4 to processor 1,
The blocks stored in the columns are rearranged in the order requested by processor 1 (steps 212 and 213 in FIG. 2).
このプロセッサ1からブロック04が要求された場合の
処理後、レベル○のキャッシュメモリ2およびレベル1
のキャッシュメモリ3の状態は第3図(f)のようにな
る。After processing when block 04 is requested from this processor 1, cache memory 2 of level ○ and cache memory 1 of level 1
The state of the cache memory 3 is as shown in FIG. 3(f).
第3図の例では、プロセッサ1からブロック内のデータ
の要求が、ブロック01,02,01゜03.04の順
に行われ後、このプロセッサ1から要求された順序の新
しいブロック01,02゜03.04がレベル1のキャ
ッシュメモリ3に格納される。これにより、下位レベル
のキャッシュメモリ3におけるブロックの置き換えが、
上位レベルのキャッシュメモリ2が無い場合と同様に行
われ、プロセッサ1から要求された新しいブロックを優
先して内部に格納しておくことが可能となる。In the example shown in FIG. 3, processor 1 requests data in blocks in the order of blocks 01, 02, 01゜03.04, and then requests new blocks 01, 02゜03 in the order requested by processor 1. .04 is stored in the level 1 cache memory 3. As a result, block replacement in the lower level cache memory 3 is
This is done in the same way as when there is no upper-level cache memory 2, and it becomes possible to preferentially store new blocks requested by the processor 1 internally.
以上説明したように、本発明によれば、多階層キャッシ
ュメモリにおいて、下位レベルのキャッシュメモリに上
位レベルのキャッシュメモリに格納されるブロックの情
報を伝え、上位レベルのキャッシュメモリでのブロック
の置き換え時、上位レベルのキャッシュメモリに含まれ
てないブロックを置き換えることにより、プロセッサか
ら要求された順序の新しいブロックを優先して内部に格
納しておくことが可能となる。一般に、上位レベルのキ
ャッシュメモリ程、プロセッサからのアクセス時間が短
かく、プロセッサから要求された順序が新しいブロック
程、再びプロセッサから要求される確率が高いので、プ
ロセッサから要求された順序に新しいブロックを正しく
キャッシュメモリに格納することにより、プロセッサか
らメモリへのアクセス時間を短縮することが可能となる
。As described above, according to the present invention, in a multi-tiered cache memory, information on blocks stored in the upper level cache memory is transmitted to the lower level cache memory, and when a block is replaced in the upper level cache memory. By replacing blocks that are not included in the upper level cache memory, it is possible to preferentially store new blocks in the order requested by the processor. In general, the higher the level of cache memory, the shorter the access time from the processor, and the more recently the block is requested by the processor, the higher the probability that it will be requested again by the processor. By correctly storing data in the cache memory, it is possible to shorten the access time from the processor to the memory.
また、マルチプロセッサシステムのキャッシュメモリに
おいては、他のプロセッサにより書き変えられたメイン
メモリのデータをキャッシュメモリ内に持つことにより
、プロセッサが誤った処理を実行しないように、キャッ
シュメモリとメインメモリとのデータの一致制御を行う
必要がある。In addition, in the cache memory of a multiprocessor system, the cache memory and main memory are connected to prevent the processor from executing incorrect processing by storing main memory data that has been rewritten by another processor in the cache memory. It is necessary to control data consistency.
本発明を用いることにより、任意のブロック(他のプロ
セッサにより書き変えられたデータを含むブロック)が
上位レベルのキャッシュメモリに格納されているか否か
を下位レベルのキャッシュメモリ内の情報から判定でき
るので、下位レベルから順しこ一致制御を行い、上位レ
ベルに他のプロセッサにより書き換えられたデータを含
むブロックが格納されていないと判定され\ば、上位レ
ベルのキャッシュメモリに対する一致制御が不要となり
、キャッシュメモリにおけるプロセッサと一致制御のア
クセス競合を減少させることが可能となる利点がある。By using the present invention, it is possible to determine whether an arbitrary block (a block containing data rewritten by another processor) is stored in the upper level cache memory from the information in the lower level cache memory. , performs matching control sequentially from the lower level, and if it is determined that the upper level does not store a block containing data that has been rewritten by another processor, matching control for the upper level cache memory is no longer necessary, and the cache There is an advantage in that it is possible to reduce access conflicts between processors and co-controllers in memory.
第1図は本発明のブロック置換え方法の一実施例を説明
するための構成図、第2図は本発明によるブロック置換
え処理の一例のフローチャート、第3図は第1図の構成
の具体的処理例を示す図、第4図は従来のブロック置換
え方法を説明するための構成図、第5図は従来のブロッ
ク置換え処理のフローチャート、第6図は第4図の構成
の具体的処理例を示す図である。
1・・・プロセッサ、 2・・・レベルOのキャッシュ
メモリ、 3・・レベル1のキャッシュメモリ、4・
・メインメモリ、 5・・・ブロック、a・・・レベ
ルOのキャッシュメモリに格納されているブロック、
b・・レベルOのキャッシュメモリに格納されていない
ブロック。
第3
畝)ネpヤ我態、
(ト)7′ロ゛ンフ01會是七す”L (!LLI41
ン((、(す7°”ロツ702澱♂2゛(線1法君、(
d)7’o7701tノ’e、;ok’R*or4に’
lj−しへ”ル0I71
七−一、二+1%7キ11
しへ゛ル1ク
シw、、、= −−/F II
(e)7”C1y703%’i#k、−ttae4:’
Kl、ζ子)7・口、り。4饅H灯f11仄悠、六ヤン
鋺クーyt7
へf7シLX′tン
図
(α坊?l勘状鉢
(ト27パ07〕O
減好1゛(代1+jlr’fi−
(c、+〕゛’[777’2 j北が”’f9q”lj
”’B(d)フ゛077 Q
−#茫子に’tフ夫lIユ仄’J3−
MV7シ1メセク
へ?1シ2ヲ
ムΔ゛ルOラ
ヘヤツ婢す
lA−ル1の
へヤシ〉メリ
Ce)7”Oツyo3j:eHk−Lf’i、、*”l
K’g(す)7°’Dソ)o4 tQafF−−Lf’
1qLF’j3、仁へILOQ
へヤソシニに×七υ
Lへ゛ル19
AヤV=−ユ〆9
ムヘ゛ル0つ
六でフジメリ
Lへ“ルック
Aヤフシエ〆−JFIG. 1 is a block diagram for explaining an embodiment of the block replacement method of the present invention, FIG. 2 is a flowchart of an example of block replacement processing according to the present invention, and FIG. 3 is a concrete process of the configuration of FIG. 1. A diagram showing an example, FIG. 4 is a block diagram for explaining the conventional block replacement method, FIG. 5 is a flowchart of the conventional block replacement process, and FIG. 6 shows a specific processing example of the configuration of FIG. 4. It is a diagram. DESCRIPTION OF SYMBOLS 1... Processor, 2... Level O cache memory, 3... Level 1 cache memory, 4...
・Main memory, 5...Block, a...Block stored in level O cache memory,
b: Blocks not stored in level O cache memory. 3rd row) Nepya my state, (g) 7' Lomph 01 meeting is 7"L (!LLI41
((,(su7°”lots702ケ♂2゛(line 1 method, (
d) 7'o7701tノ'e, ;ok'R*or4'
lj-shihe"le0I71 7-1, 2+1%7ki11 Shihele1combw,,, = --/F II (e)7"C1y703%'i#k,-ttae4:'
Kl, ζ子) 7. 口, ri. 4 饅H light f11 组悠, 6yan 麺く yt7 to f7shiLX't diagram (αbo?l Kanjobachi (to27pa07〕O decrease 1゛(dai 1+jlr'fi- (c, + ]゛'[777'2 j North is "'f9q" lj
``'B(d) Film 077 Q - #Akako to 'tfu husband lI 仄' J3- MV7 to 1 mesek? 1st 2nd year ∆゛ru O raheyatsu 1A-ru 1's home〉 Meri Ce)7"Otsuyo3j:eHk-Lf'i,,*"l
K'g(su)7°'Dso)o4 tQafF--Lf'
1qLF'j3, ILOQ to Jin Heyasoshini x 7υ L to ゛le 19 Aya V=-Yu〆9 Mhair 0 x 6 to Fujimeri L "Look A Yafushie〆-J
Claims (1)
ど容量の大きい複数のキャッシュメモリを配置してなる
情報処理装置において、 下位レベルのキャッシュメモリのブロックを、上位レベ
ルのキャッシュメモリに格納されているブロックと格納
されていないブロックに区分し、下位レベルのキャッシ
ュメモリでのブロック置き換え時、上位レベルのキャッ
シュメモリに格納されていないブロックを置き換えの対
象とすることを特徴とする多階層キャッシュメモリのブ
ロック置換え方法。(1) In an information processing device that has multiple cache memories arranged between a processor and main memory, the lower the level, the larger the capacity, the lower level cache memory blocks are stored in the upper level cache memory. A block of a multi-layered cache memory characterized in that the blocks are divided into blocks and blocks that are not stored, and when blocks are replaced in a lower level cache memory, blocks that are not stored in an upper level cache memory are targeted for replacement. Replacement method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63178870A JPH0228738A (en) | 1988-07-18 | 1988-07-18 | Method for substituting block of multi-hierarchy cache memory |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63178870A JPH0228738A (en) | 1988-07-18 | 1988-07-18 | Method for substituting block of multi-hierarchy cache memory |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0228738A true JPH0228738A (en) | 1990-01-30 |
Family
ID=16056131
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63178870A Pending JPH0228738A (en) | 1988-07-18 | 1988-07-18 | Method for substituting block of multi-hierarchy cache memory |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0228738A (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS589277A (en) * | 1981-07-06 | 1983-01-19 | インタ−ナシヨナル・ビジネス・マシ−ンズ・コ−ポレ−シヨン | Data processor |
-
1988
- 1988-07-18 JP JP63178870A patent/JPH0228738A/en active Pending
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS589277A (en) * | 1981-07-06 | 1983-01-19 | インタ−ナシヨナル・ビジネス・マシ−ンズ・コ−ポレ−シヨン | Data processor |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110795206B (en) | System and method for facilitating cluster-level caching and memory space | |
| US11269772B2 (en) | Persistent memory storage engine device based on log structure and control method thereof | |
| TWI262397B (en) | Method and multiprocessor computer apparatus for controlling access to a shared resource using a task synchronization mechanism | |
| US4881163A (en) | Computer system architecture employing cache data line move-out queue buffer | |
| US7114042B2 (en) | Method to provide atomic update primitives in an asymmetric heterogeneous multiprocessor environment | |
| TWI614669B (en) | Migrating pages of different sizes between heterogeneous processors | |
| TW201537454A (en) | Method and processor for processing data | |
| JP2016510930A (en) | System and method for memory system management based on temperature information of memory system | |
| JP2002510079A (en) | Method and apparatus for forcing ordered execution of reads and writes between memory interfaces | |
| US20190332529A1 (en) | Atomic operations for fabric shared memories | |
| US6473845B1 (en) | System and method for dynamically updating memory address mappings | |
| JPH03505793A (en) | Multiprocessor system including cache memory system with hierarchical structure | |
| US20040215900A1 (en) | System and method for reducing contention in a multi-sectored cache | |
| CN105354153A (en) | Implement method for data exchange and cache of tightly-coupled heterogeneous multi-processor | |
| JP2001222466A (en) | Multiprocessor system, shared memory control system, its method, and recording medium | |
| JPH0228738A (en) | Method for substituting block of multi-hierarchy cache memory | |
| CN110244933B (en) | Matrix transposition method based on CUDA | |
| JPH0387948A (en) | Multiprocessor system | |
| JPH1032580A (en) | Method of controlling storage means and device therefor | |
| JPH08115238A (en) | File system | |
| US8423723B2 (en) | Multi-processor system device and method declaring and using variables | |
| JPH011049A (en) | parallel computer | |
| CN121501704A (en) | A data transmission method, apparatus, and medium | |
| CN121364958A (en) | Optimization method for distributed operator, artificial intelligent chip, computer device, readable storage medium and program product | |
| CN114756699A (en) | Graphic data access processing method and device, computer equipment and storage medium |