JP2017058951A - Memory system - Google Patents

Memory system Download PDF

Info

Publication number
JP2017058951A
JP2017058951A JP2015183177A JP2015183177A JP2017058951A JP 2017058951 A JP2017058951 A JP 2017058951A JP 2015183177 A JP2015183177 A JP 2015183177A JP 2015183177 A JP2015183177 A JP 2015183177A JP 2017058951 A JP2017058951 A JP 2017058951A
Authority
JP
Japan
Prior art keywords
data
priority
area
cache
information
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.)
Granted
Application number
JP2015183177A
Other languages
Japanese (ja)
Other versions
JP6140233B2 (en
Inventor
武田 進
Susumu Takeda
進 武田
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2015183177A priority Critical patent/JP6140233B2/en
Publication of JP2017058951A publication Critical patent/JP2017058951A/en
Application granted granted Critical
Publication of JP6140233B2 publication Critical patent/JP6140233B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To provide a memory system capable of efficient memory access.SOLUTION: A memory system comprises: a first tag region 4b for storing address information corresponding to data within a first data region 4a; a second tag region 4c for associating and storing the address information with priority information; an access information transmission unit 11 for transmitting access information to a nonvolatile memory; a priority update unit 12 for updating the priority information within the second tag region on the basis of the access information; a first hit determination unit 13 corresponding to the first tag region; a second hit determination unit 14 corresponding to the second tag region; a determination unit 16 for determining storage control information on whether reading object data should be stored in the first data region or not on the basis of a determination result by the second hit determination unit; and an access control unit 17 for performing control to store the reading object data read out from the second data region with lower access priority than the first data region in the first data region.SELECTED DRAWING: Figure 2

Description

本発明の実施形態は、メモリシステムに関する。   Embodiments described herein relate generally to a memory system.

メモリウォール問題と称されるように、メモリアクセスに要する時間と消費電力が演算コアの性能向上を阻害する大きな要因となっている。   As referred to as the memory wall problem, the time required for memory access and the power consumption are major factors that hinder the performance improvement of the arithmetic core.

このため、メインメモリよりも高速なキャッシュメモリを大容量化したり、階層化する方策などが取られている。また、キャッシュメモリとして汎用的に用いられるSRAM(Static Random Access Memory)は、高速ではあるが、価格も高いため、MRAM(Magnetoresistive RAM)等の不揮発メモリをキャッシュメモリとして利用する検討が進められている。   For this reason, measures have been taken to increase the capacity or hierarchization of cache memory that is faster than the main memory. In addition, SRAM (Static Random Access Memory), which is generally used as a cache memory, is high-speed but expensive, and therefore studies are being made to use nonvolatile memory such as MRAM (Magnetoresistive RAM) as cache memory. .

しかしながら、不揮発メモリは一般に、書換可能な回数に制限があり、書き込み時の消費電力も多いという問題がある。   However, the nonvolatile memory generally has a problem that there is a limit to the number of times that data can be rewritten and power consumption during writing is large.

また、演算コアが利用するデータの種類が多くなるほど、各階層のキャッシュメモリ間でのデータの入替の頻度が多くなり、書換回数も増えてしまう。   In addition, as the number of types of data used by the arithmetic core increases, the frequency of data replacement between cache memories in each hierarchy increases, and the number of rewrites increases.

特開2007−249971号公報JP 2007-249971 A

本発明が解決しようとする課題は、効率的にメモリアクセスを行うことが可能なメモリシステムを提供するものである。   The problem to be solved by the present invention is to provide a memory system capable of efficiently performing memory access.

本実施形態によれば、データを格納する第1データ領域と、
前記第1データ領域に格納されたデータに対応するアドレス情報を格納する第1タグ領域と、
アドレス情報と優先度情報とを対応づけて格納する第2タグ領域と、
前記不揮発メモリに対するアクセス情報を送信するアクセス情報送信部と、
前記アクセス情報に基づいて、前記第2タグ領域内の前記優先度情報を更新する優先度更新部と、
読出対象のデータのアドレス情報が前記第1タグ領域に格納されているか否かを判定する第1ヒット判定部と、
前記読出対象のデータのアドレス情報が前記第2タグ領域に格納されているか否かを判定する第2ヒット判定部と、
前記第2ヒット判定部による判定結果に基づいて、前記読出対象のデータを前記第1データ領域に格納するか否かに関する格納制御情報を決定する決定部と、
前記格納制御情報に基づいて前記決定部が前記読出し対象のデータを前記第1データ領域に格納することを決定すると、前記第1データ領域よりアクセス優先度の低い第2データ領域から読み出した前記読出対象のデータを前記第1データ領域に格納する制御を行うアクセス制御部と、を備えるメモリシステムが提供される。
According to the present embodiment, a first data area for storing data;
A first tag area for storing address information corresponding to the data stored in the first data area;
A second tag area for storing address information and priority information in association with each other;
An access information transmitter for transmitting access information to the nonvolatile memory;
A priority update unit that updates the priority information in the second tag area based on the access information;
A first hit determination unit for determining whether address information of data to be read is stored in the first tag area;
A second hit determination unit for determining whether address information of the data to be read is stored in the second tag area;
A determination unit that determines storage control information related to whether to store the data to be read in the first data area based on a determination result by the second hit determination unit;
When the determination unit determines to store the data to be read in the first data area based on the storage control information, the read from the second data area having a lower access priority than the first data area There is provided a memory system including an access control unit that performs control to store target data in the first data area.

第1の実施形態によるメモリシステムの概略構成を示すブロック図。1 is a block diagram showing a schematic configuration of a memory system according to a first embodiment. 第1の実施形態によるL2キャッシュの内部構成を示すブロック図。The block diagram which shows the internal structure of L2 cache by 1st Embodiment. 第1の実施形態によるメモリシステムの処理動作を示すフローチャート。5 is a flowchart showing processing operations of the memory system according to the first embodiment. 第1の実施形態におけるL2キャッシュのヒット/ミス判定結果を示す図。The figure which shows the hit / miss determination result of L2 cache in 1st Embodiment. 第2タグ領域がない場合のL1キャッシュとL2キャッシュのヒット/ミス判定結果を示す図。The figure which shows the hit / miss determination result of L1 cache and L2 cache when there is no 2nd tag area. 第2の実施形態によるプロセッサシステムの概略構成を示すブロック図。The block diagram which shows schematic structure of the processor system by 2nd Embodiment. 第2の実施形態によるメモリシステム内のL2キャッシュとL3キャッシュの内部構成を示すブロック図。The block diagram which shows the internal structure of L2 cache and L3 cache in the memory system by 2nd Embodiment. 第2の実施形態によるメモリシステムの処理動作を示すフローチャート。9 is a flowchart showing processing operations of the memory system according to the second embodiment. 第2の実施形態におけるL2キャッシュのヒット/ミス判定結果を示す図。The figure which shows the hit / miss determination result of L2 cache in 2nd Embodiment. L3キャッシュ内の第2タグ領域が優先度情報を持たない場合の一比較例のヒット/ミス判定結果を示す図。The figure which shows the hit / miss determination result of the comparative example when the 2nd tag area | region in L3 cache does not have priority information. 第3の実施形態によるメモリシステムの処理動作を示すフローチャート。10 is a flowchart showing processing operations of the memory system according to the third embodiment. 物理的に統合された第1タグ領域と第2タグ領域の例を示す図。The figure which shows the example of the 1st tag area | region and 2nd tag area | region integrated physically. 第2タグ領域内に1ビットのアクセスフラグを設ける例を示す図。The figure which shows the example which provides a 1-bit access flag in a 2nd tag area | region.

以下、図面を参照しながら、本発明の実施形態を説明する。以下の実施形態では、メモリシステムおよびプロセッサシステム内の特徴的な構成および動作を中心に説明するが、メモリシステムおよびプロセッサシステムには以下の説明で省略した構成および動作が存在しうる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following embodiments, the characteristic configurations and operations in the memory system and the processor system will be mainly described. However, configurations and operations omitted in the following description may exist in the memory system and the processor system.

(第1の実施形態)
図1は第1の実施形態によるメモリシステム1の概略構成を示すブロック図である。図1のメモリシステム1は、プロセッサコア(CPU:Central Processing Unit)2に接続された1次キャッシュメモリ(L1キャッシュ)3と、L1キャッシュ3に接続された2次キャッシュメモリ(L2キャッシュ)4と、L2キャッシュ4に接続されたメインメモリ5と、を備えている。
(First embodiment)
FIG. 1 is a block diagram showing a schematic configuration of a memory system 1 according to the first embodiment. 1 includes a primary cache memory (L1 cache) 3 connected to a processor core (CPU: Central Processing Unit) 2, and a secondary cache memory (L2 cache) 4 connected to an L1 cache 3. And a main memory 5 connected to the L2 cache 4.

L1およびL2キャッシュ3,4には、メインメモリ5に格納されたデータ、またはメインメモリ5に格納されるべきデータの少なくとも一部が格納される。これらキャッシュ3,4は、その内部に保持するデータを一意に識別可能なアドレス情報を保持するタグ部を有する。タグ部の実装形態には、専用のメモリ領域を保持するものや、データを保持するメモリ領域の一部に保持するものなど様々な実装形態があり、本実施形態ではそれら全てと組み合わせ可能である。   The L1 and L2 caches 3 and 4 store at least a part of data stored in the main memory 5 or data to be stored in the main memory 5. Each of the caches 3 and 4 has a tag unit that holds address information that can uniquely identify data held therein. There are various types of tag unit implementations, such as those that hold a dedicated memory area and those that hold a part of the memory area that holds data. In this embodiment, all of these can be combined. .

図1では、L2キャッシュ4までの2階層のキャッシュメモリを設ける例を示しているが、L2キャッシュ4よりも高次のキャッシュメモリを設けてもよい。以下では、簡略化のため、L2キャッシュ4までの2階層のキャッシュ構造を有する例を説明する。   FIG. 1 shows an example in which a two-level cache memory up to the L2 cache 4 is provided. Hereinafter, for simplification, an example having a two-level cache structure up to the L2 cache 4 will be described.

メインメモリ5以外のプロセッサコア2、L1キャッシュ3およびL2キャッシュ4は、例えば一つのチップに集積される。あるいは、プロセッサコア2とL1キャッシュ3が1つのチップに集積され、L2キャッシュ4は別のチップに集積され、これらがチップ同士の積層構造に基づき、金属配線によって直接接合されているシステムであってもよい。本実施形態では、L1およびL2キャッシュ3,4をメモリシステム1と呼ぶ。なお、メインメモリ5もメモリシステム1に含めても良いし、含めなくてもよい。   The processor core 2, L1 cache 3, and L2 cache 4 other than the main memory 5 are integrated on one chip, for example. Alternatively, the processor core 2 and the L1 cache 3 are integrated on one chip, the L2 cache 4 is integrated on another chip, and these are directly joined by metal wiring based on a stacked structure of chips. Also good. In the present embodiment, the L1 and L2 caches 3 and 4 are referred to as a memory system 1. The main memory 5 may or may not be included in the memory system 1.

L1およびL2キャッシュ3,4は、メインメモリ5よりも高速アクセスが可能な半導体メモリで構成されている。それぞれのキャッシュへのデータ配置ポリシには様々なバリエーションが考えられる。例えば、Inclusion方式がある。この場合、L2キャッシュ4には、L1キャッシュ3に格納されたデータのすべてが格納される。   The L1 and L2 caches 3 and 4 are constituted by semiconductor memories that can be accessed at a higher speed than the main memory 5. There are various variations in the data placement policy for each cache. For example, there is an Inclusion method. In this case, all of the data stored in the L1 cache 3 is stored in the L2 cache 4.

その他、例えば、Exclusion方式がある。この方式では、例えばL1キャッシュ3とL2キャッシュ4に同じデータは配置されない。また、例えば、Inclusion方式とExclusion方式のハイブリッド方式がある。この方式では、例えばL1キャッシュ3とL2キャッシュ4で重複して保持されるデータもあるし、排他的に保持されるデータもある。   In addition, for example, there is an Exclusion method. In this method, for example, the same data is not arranged in the L1 cache 3 and the L2 cache 4. Further, for example, there is a hybrid method of the inclusion method and the exclusion method. In this method, for example, there is data that is held redundantly in the L1 cache 3 and the L2 cache 4, and there is data that is held exclusively.

これらの方式は、2つのキャッシュ3,4間のデータ配置ポリシであり、複数階層のキャッシュ構成では様々な組み合わせが考えられる。例えば、全ての階層でInclusion方式であってもよい。例えば、L1キャッシュ3とL2キャッシュ4はExclusive方式で、L2キャッシュ4とメインメモリ5はInclusion方式であってもよい。本実施形態に示される方式は、これら上記に記した様々なデータ配置ポリシと組み合わせることが可能である。   These methods are data arrangement policies between the two caches 3 and 4, and various combinations are conceivable in a multi-level cache configuration. For example, the Inclusion method may be used in all layers. For example, the L1 cache 3 and the L2 cache 4 may be an exclusive method, and the L2 cache 4 and the main memory 5 may be an inclusion method. The system shown in the present embodiment can be combined with the various data arrangement policies described above.

キャッシュの更新方式にも様々な方式が存在するが、本実施形態はそれら全てと組み合わせ可能である。例えば、キャッシュ書き込みヒット時の書き込み方式がライトスルーであってもよいし、ライトバックであってもよい。また、キャッシュ書き込みミス時の書き込み方式がライトアロケートであってもよいし、ノーライトアロケートであってもよい。   There are various cache update methods, but this embodiment can be combined with all of them. For example, the write method at the time of cache write hit may be write-through or write-back. Further, the write method at the time of cache write miss may be write allocate or no write allocate.

L2キャッシュ4のメモリ容量はL1キャッシュ3のメモリ容量以上である。このように、高次のキャッシュメモリほどメモリ容量が大きくなる。従って、高次のキャッシュメモリには集積度が高く、容量に比例する傾向にあるリーク電力が少ないメモリを用いることが望ましい。このようなメモリとして、例えば、MRAM(Magnetoresistive Random Access Memory)等の不揮発メモリが考えられる。また、例えば、低リーク電力プロセスを用いたSRAMやDRAMであってもよい。   The memory capacity of the L2 cache 4 is greater than or equal to the memory capacity of the L1 cache 3. Thus, the higher the cache memory, the larger the memory capacity. Therefore, it is desirable to use a high-level cache memory having a high degree of integration and a low leakage power that tends to be proportional to the capacity. As such a memory, for example, a nonvolatile memory such as an MRAM (Magnetoresistive Random Access Memory) can be considered. For example, an SRAM or DRAM using a low leakage power process may be used.

メインメモリ5は、L1およびL2キャッシュ3,4よりもメモリ容量が大きいことから、プロセッサコア2等が実装されるチップとは別個の1以上のチップで構成されることが多い。メインメモリ5を構成するメモリセルは、例えばDRAM(Dynamic RAM)セルである。なお、TSV(Through Silicon Via)等の技術を用いて、プロセッサコア2等と一つのチップに混載してもよい。   Since the main memory 5 has a larger memory capacity than the L1 and L2 caches 3 and 4, the main memory 5 is often composed of one or more chips separate from the chip on which the processor core 2 and the like are mounted. A memory cell constituting the main memory 5 is, for example, a DRAM (Dynamic RAM) cell. It should be noted that the processor core 2 and the like may be mixedly mounted on one chip by using a technique such as TSV (Through Silicon Via).

プロセッサコア2が発行した仮想アドレスに対応する物理アドレスは、まず最優先にL1キャッシュ3に送られる。この物理アドレスに対応するデータ(以下、対象データ)がL1キャッシュ3にある場合は、プロセッサコア2はそのデータにアクセスすることになる。L1キャッシュ3のメモリ容量は、例えば数10kバイト程度である。   The physical address corresponding to the virtual address issued by the processor core 2 is first sent to the L1 cache 3 with the highest priority. When data corresponding to the physical address (hereinafter, target data) is in the L1 cache 3, the processor core 2 accesses the data. The memory capacity of the L1 cache 3 is, for example, about several tens of kilobytes.

対象データがL1キャッシュ3にない場合は、対応する物理アドレスはL2キャッシュ4に送られる。L2キャッシュ4に対象データがある場合は、プロセッサコア2はそのデータにアクセスすることになる。L2キャッシュ4のメモリ容量は、例えば数100kバイト〜数Mバイト程度である。   If the target data is not in the L1 cache 3, the corresponding physical address is sent to the L2 cache 4. When there is target data in the L2 cache 4, the processor core 2 accesses the data. The memory capacity of the L2 cache 4 is, for example, about several hundred kilobytes to several megabytes.

対象データがL2キャッシュ4にない場合は、対応する物理アドレスはメインメモリ5に送られる。本実施形態では、メインメモリ5には、L2キャッシュ4に格納されている全データが格納されているものとする。本実施形態は、上述したキャッシュ間データ配置ポリシに限定されるものではない。メインメモリ5には、ページ単位のデータが格納される。一般的に、ページ単位のデータはメインメモリ5と補助記憶装置に配置されるが、本実施形態では簡易化のため全てのデータがメインメモリ5に配置されているものとする。本実施形態では、メインメモリ5に対象データがある場合は、プロセッサコア2はそのデータにアクセスすることになる。メインメモリ5のメモリ容量は、例えば数Gバイト程度である。   If the target data is not in the L2 cache 4, the corresponding physical address is sent to the main memory 5. In the present embodiment, it is assumed that all data stored in the L2 cache 4 is stored in the main memory 5. The present embodiment is not limited to the inter-cache data arrangement policy described above. The main memory 5 stores page unit data. In general, data in units of pages is arranged in the main memory 5 and the auxiliary storage device. In the present embodiment, it is assumed that all data is arranged in the main memory 5 for simplification. In the present embodiment, when there is target data in the main memory 5, the processor core 2 accesses the data. The memory capacity of the main memory 5 is, for example, about several GB.

このように、L1およびL2キャッシュ3,4は階層化されており、次数の大きい(下位階層の)キャッシュメモリほどメモリ容量は大きい。   In this way, the L1 and L2 caches 3 and 4 are hierarchized, and the larger the degree (lower hierarchy) cache memory, the larger the memory capacity.

以下では、簡略化のため、L1およびL2キャッシュ3,4のタグアレイがLRU(Least Recently Used)アルゴリズムで管理されるものとして説明する。ただし、本実施形態は、LRU以外の様々なデータ優先度管理アルゴリズムと組み合わせることが可能である。例えば、NRU(Not Recently Used)やランダムリプレイスアルゴリズムと組み合わせてもよい。また、以下の説明では、簡略化のため、タグアレイをフルアソシアティブキャッシュとして示している。ただし、本実施形態は、種々のキャッシュ方式に適用可能であり、例えば、セットアソシアティブでもよいし、ダイレクトマップでもよい。   In the following, for the sake of simplification, the tag arrays of the L1 and L2 caches 3 and 4 are described as being managed by an LRU (Least Recently Used) algorithm. However, this embodiment can be combined with various data priority management algorithms other than LRU. For example, it may be combined with NRU (Not Recently Used) or a random replacement algorithm. In the following description, the tag array is shown as a fully associative cache for the sake of simplicity. However, the present embodiment can be applied to various cache systems, and may be set associative or a direct map, for example.

本実施形態は、アクセス頻度が高いデータが高再参照データであるとする。また、キャッシュ内の優先度とは、例えば、キャッシュから消去するデータを決定する指標である。例えば、キャッシュにデータをフィルする際、優先度の低いデータをキャッシュから消去する。LRUアルゴリズムでは、MRU(Most Recently Used)のデータの優先度を最も高くし、LRUのデータの優先度を最も低くする。また、当該キャッシュに存在しないデータ(MRUからLRUの間に存在しないデータ)の優先度は、当該キャッシュに存在するデータより優先度が低いものとしてもよい。   In the present embodiment, it is assumed that data with high access frequency is highly re-referenced data. The priority in the cache is an index for determining data to be deleted from the cache, for example. For example, when filling data in the cache, data with low priority is deleted from the cache. In the LRU algorithm, MRU (Most Recently Used) data has the highest priority, and LRU data has the lowest priority. In addition, the priority of data that does not exist in the cache (data that does not exist between MRU and LRU) may be lower than that of data that exists in the cache.

第1の実施形態では、キャッシュにデータを格納する際、そのデータの優先度情報に基づき、キャッシュに格納する際の優先度を決定する。場合によっては、キャッシュに格納すべきデータの優先度が低い場合には、そのデータをキャッシュに格納しなくてもよい。このような制御を行うことで、低再参照データが、優先度の高いデータとしてキャッシュに格納されることを抑制する。また、高再参照データをキャッシュ内に保持することができ、キャッシュミスの削減や、キャッシュ書き込み回数の削減が期待できる。   In the first embodiment, when data is stored in the cache, the priority in storing in the cache is determined based on the priority information of the data. In some cases, if the priority of data to be stored in the cache is low, the data need not be stored in the cache. By performing such control, low re-reference data is prevented from being stored in the cache as high priority data. Further, highly re-referenced data can be held in the cache, and a reduction in cache misses and a reduction in the number of cache writes can be expected.

図2は第1の実施形態によるメモリシステム1内のL2キャッシュ(第1メモリ)4の内部構成を示すブロック図である。図2に示すように、L2キャッシュ4は、第1データ領域4aと、第1タグ領域4bと、第2タグ領域4cと、L2キャッシュコントローラ6とを備えている。L2キャッシュ4の下位階層にはメインメモリ(第2メモリ)5が設けられている。   FIG. 2 is a block diagram showing an internal configuration of the L2 cache (first memory) 4 in the memory system 1 according to the first embodiment. As shown in FIG. 2, the L2 cache 4 includes a first data area 4a, a first tag area 4b, a second tag area 4c, and an L2 cache controller 6. A main memory (second memory) 5 is provided in a lower hierarchy of the L2 cache 4.

第1データ領域4aは、優先度が所定のレベルより高いデータを格納する領域であり、不揮発メモリで構成されている。不揮発メモリの種類は特に問わないが、例えば、MRAM(Magnetoresistive Random Access Memory)である。MRAMは、SRAMよりも高速かつ高集積化が可能であり、低リーク電力であるため省電力化が可能である。第1データ領域4aは、複数のキャッシュラインを有し、キャッシュライン単位でデータの格納および読出が行われる。   The first data area 4a is an area for storing data whose priority is higher than a predetermined level, and is composed of a nonvolatile memory. The type of the nonvolatile memory is not particularly limited, but is, for example, an MRAM (Magnetoresistive Random Access Memory). MRAM can be integrated at higher speed and higher than SRAM, and can reduce power consumption due to low leakage power. The first data area 4a has a plurality of cache lines, and data is stored and read out in units of cache lines.

第1タグ領域4bは、第1データ領域4aに格納されたデータに対応するアドレス情報を格納する。より具体的には、第1タグ領域4bは、第1データ領域4a内の各キャッシュラインごとに、対応するアドレス情報を格納する。   The first tag area 4b stores address information corresponding to the data stored in the first data area 4a. More specifically, the first tag area 4b stores corresponding address information for each cache line in the first data area 4a.

図2の第1タグ領域4bは、各アドレス情報4b1に対応づけて、優先度情報4b2を格納している。例えば、優先度情報の値が小さい程、対応するアドレス情報およびデータの優先度が高いことを示している。図2では、第1タグ領域4bおよび第1データ領域4aの先頭アドレス側ほど、優先度の高いアドレス情報およびデータを格納する例を示している。   The first tag area 4b in FIG. 2 stores priority information 4b2 in association with each address information 4b1. For example, the smaller the priority information value, the higher the priority of the corresponding address information and data. FIG. 2 shows an example in which address information and data with higher priority are stored toward the head address side of the first tag area 4b and the first data area 4a.

なお、第1タグ領域4b内に優先度情報を設けることは必須ではない。第1タグ領域4b内に優先度情報がなくても、アドレス情報の格納順に優先度を割り振ってもよいし、あるいは、第1タグ領域4b内に格納された各アドレス情報をすべて同じ優先度としてもよい。以下では、第1タグ領域4b内に優先度情報が格納されている例を説明する。   Note that providing priority information in the first tag area 4b is not essential. Even if there is no priority information in the first tag area 4b, priorities may be assigned in the order in which the address information is stored, or each address information stored in the first tag area 4b is set to the same priority. Also good. Hereinafter, an example in which priority information is stored in the first tag area 4b will be described.

第2タグ領域4cは、アドレス情報4c1と優先度情報4c2とを対応づけて格納する。第2タグ領域4c内の各アドレス情報に対応するデータは、第1データ領域4aまたはメインメモリ5に格納されている。   The second tag area 4c stores address information 4c1 and priority information 4c2 in association with each other. Data corresponding to each address information in the second tag area 4 c is stored in the first data area 4 a or the main memory 5.

例えば、第2タグ領域4cは、第1タグ領域4bより多くのメモリ量であり、プロセッサコア2がL2キャッシュ4にアクセスした過去のアドレス情報を第1タグよりも長い期間にわたって格納している。後述するように、第1タグ領域4bに格納されるアドレス情報は、第2タグ領域4cにも重複して格納されてもよいし、第1タグ領域4bに格納されていないアドレス情報のみを第2タグ領域4cに格納してもよい。   For example, the second tag area 4c has a larger amount of memory than the first tag area 4b, and stores past address information that the processor core 2 has accessed the L2 cache 4 over a longer period than the first tag. As will be described later, the address information stored in the first tag area 4b may be redundantly stored in the second tag area 4c, or only the address information not stored in the first tag area 4b is stored in the first tag area 4b. You may store in 2 tag area | region 4c.

第2タグ領域4c内の優先度情報4c2と、第1タグ領域4b内の優先度情報4b2とは、予め対応づけられている。例えば、第2タグ領域4c内の優先度情報0〜5は、第1タグ領域4b内の優先度情報0に対応づけられている。この場合、第2タグ領域4c内の優先度情報0〜5のいずれかのアドレス情報に対応するデータを第1データ領域4aに格納する際には、第1タグ領域4bの優先度情報0に対応するキャッシュラインに該当データが格納される。なお、このような優先度情報の対応づけは、事後的や動的に変更できるようにしてもよい。   The priority information 4c2 in the second tag area 4c and the priority information 4b2 in the first tag area 4b are associated in advance. For example, the priority information 0 to 5 in the second tag area 4c is associated with the priority information 0 in the first tag area 4b. In this case, when data corresponding to any one of the priority information 0 to 5 in the second tag area 4c is stored in the first data area 4a, the priority information 0 in the first tag area 4b is stored. The corresponding data is stored in the corresponding cache line. Note that such association of priority information may be changed afterwards or dynamically.

L2キャッシュコントローラ6は、アクセス情報送信部11と、優先度更新部12と、第1ヒット判定部13と、第2ヒット判定部14と、優先度取得部15と、優先度決定部16とを有する。   The L2 cache controller 6 includes an access information transmission unit 11, a priority update unit 12, a first hit determination unit 13, a second hit determination unit 14, a priority acquisition unit 15, and a priority determination unit 16. Have.

アクセス情報送信部11は、L2キャッシュ4に対するアクセス情報を送信する。アクセス情報の送信先は、優先度更新部12である。アクセス情報とは、L2キャッシュ4に対してアクセスのあったデータのアドレス情報を含んでいる。アクセス情報送信部11は、少なくとも一部のL2キャッシュ4へのアクセスのたびに、アクセス情報を優先度更新部12に送信する。   The access information transmission unit 11 transmits access information for the L2 cache 4. The transmission destination of the access information is the priority update unit 12. The access information includes address information of data accessed to the L2 cache 4. The access information transmission unit 11 transmits the access information to the priority update unit 12 every time at least a part of the L2 cache 4 is accessed.

優先度更新部12は、アクセス情報に基づいて、第2タグ領域4c内の優先度情報を更新する。例えば、アクセス頻度が高いアドレス情報ほど優先度を高くするよう、優先度情報を更新する。また、優先度更新部12は、再参照される可能性が低いデータほど、優先度を低くする。優先度更新部12は、再参照される可能性が低いデータ、すなわち優先度の低いデータのアドレス情報を第2タグ領域4cに格納しない場合もありうる。   The priority update unit 12 updates the priority information in the second tag area 4c based on the access information. For example, the priority information is updated so that the address information having a higher access frequency has a higher priority. Moreover, the priority update part 12 makes a priority low, so that there is a low possibility of being re-referenced. The priority update unit 12 may not store in the second tag area 4c data that has a low possibility of being re-referenced, that is, data with low priority.

また、優先度更新部12は、例えば、第2タグ領域4c内のアドレス情報を更新する際に、第2タグ領域4c内の少なくとも一つの優先度情報を更新する。第2タグ領域4c内のアドレス情報の更新は、例えば、第1データ領域4aからデータが追い出されたときか、メインメモリ5からデータを読み出したときか、優先度更新部により更新する対象のアドレス情報が第二タグ領域に存在しないときに行われる。   For example, when updating the address information in the second tag area 4c, the priority update unit 12 updates at least one priority information in the second tag area 4c. The address information in the second tag area 4c is updated, for example, when the data is evicted from the first data area 4a, when the data is read from the main memory 5, or the address to be updated by the priority update unit. This is performed when information is not present in the second tag area.

第1ヒット判定部13は、読出対象のデータのアドレス情報が第1タグ領域4bに格納されているか否かを判定する。ここで、読出対象のデータとは、プロセッサコア2から読出要求のあったデータである。   The first hit determination unit 13 determines whether the address information of the data to be read is stored in the first tag area 4b. Here, the data to be read is data requested to be read from the processor core 2.

第2ヒット判定部14は、第1ヒット判定部13により、第1タグ領域4bに格納されていないと判定されると、または、第1ヒット判定部による第1タグ領域に格納されているかどうかの判定と同時に、読出対象のデータのアドレス情報が第2タグ領域4cに格納されているか否かを判定する。   The second hit determination unit 14 determines whether the first hit determination unit 13 determines that it is not stored in the first tag area 4b or whether it is stored in the first tag area by the first hit determination unit At the same time, it is determined whether the address information of the data to be read is stored in the second tag area 4c.

優先度取得部15は、第2ヒット判定部14により、第2タグ領域4cに格納されていると判定されるか、または、第二ヒット判定部により第二タグ領域に格納されているかどうかの判定と同時に、第2タグ領域4cから、読出対象データのアドレス情報に対応する優先度情報を取得する。   The priority acquisition unit 15 determines whether the second hit determination unit 14 determines that the second hit determination unit 14 stores the second tag area 4c or whether the second hit determination unit stores the second tag area 4c. Simultaneously with the determination, priority information corresponding to the address information of the read target data is acquired from the second tag area 4c.

優先度決定部16は、取得された優先度情報に基づいて、読出対象のデータを第1データ領域4aに格納するか否かを決定する。例えば、優先度決定部16は、読出対象データのアドレス情報に対応する優先度情報が0〜8であれば、読出対象のデータを第1データ領域4aに格納することを決定し、優先度情報が8より大きい値であれば、読出対象のデータを第1データ領域4aに格納しないことを決定する。   The priority determination unit 16 determines whether to store the data to be read in the first data area 4a based on the acquired priority information. For example, if the priority information corresponding to the address information of the read target data is 0 to 8, the priority determination unit 16 determines that the read target data is stored in the first data area 4a, and the priority information If is greater than 8, it is determined that the data to be read is not stored in the first data area 4a.

これにより、第2タグ領域4cに格納されているアドレス情報のうち、優先度の高いアドレス情報に対応するデータのみを、第1データ領域4aに格納することができる。これはすなわち、第1データ領域4aは、優先度が所定のレベルより高いデータ(高再参照データ)を優先して格納することを意味する。   Thereby, only the data corresponding to the address information with high priority among the address information stored in the second tag area 4c can be stored in the first data area 4a. This means that the first data area 4a preferentially stores data whose priority is higher than a predetermined level (high re-reference data).

L2キャッシュコントローラ6は、アクセス制御部17を有していてもよい。アクセス制御部17は、優先度決定部16が読出対象のデータを第1データ領域4aに格納することを決定すると、読出対象のデータをメインメモリ5(第2データ領域)から読み出して第1データ領域4aに格納する制御を行う。   The L2 cache controller 6 may have an access control unit 17. When the priority determination unit 16 determines that the data to be read is stored in the first data area 4a, the access control unit 17 reads the data to be read from the main memory 5 (second data area) and reads the first data Control to store in the area 4a is performed.

図3は第1の実施形態によるメモリシステム1の処理動作を示すフローチャートである。このフローチャートは、プロセッサコア2が読み出し要求を行い、L1キャッシュ3にミスして、L2キャッシュ4に読出要求が届いた場合の処理動作を示している。   FIG. 3 is a flowchart showing the processing operation of the memory system 1 according to the first embodiment. This flowchart shows the processing operation when the processor core 2 makes a read request, misses in the L1 cache 3, and reaches the L2 cache 4.

まず、第1タグ領域4bにヒットするか否かを判定する(ステップS1)。ここでは、第1ヒット判定部13が、読出対象のデータのアドレス情報が第1タグ領域4bに格納されているか否かを判定する。   First, it is determined whether or not the first tag area 4b is hit (step S1). Here, the first hit determination unit 13 determines whether the address information of the data to be read is stored in the first tag area 4b.

例えば、第1タグ領域4bにミスしたと判定されると、第2タグ領域4cにヒットしたか否かを判定する(ステップS2)。ここでは、第2ヒット判定部14が、読出対象のデータのアドレス情報が第2タグ領域4cに格納されているか否かを判定する。   For example, if it is determined that the first tag area 4b is missed, it is determined whether or not the second tag area 4c is hit (step S2). Here, the second hit determination unit 14 determines whether the address information of the data to be read is stored in the second tag area 4c.

例えば、第2タグ領域4cにヒットしたと判定されると、優先度取得部15は、第2タグ領域4cから優先度情報を取得する(ステップS3)。一方、第2タグ領域4cにヒットしなかったと判定されると、例えば、後述するステップS7に移行する。   For example, when it is determined that the second tag area 4c is hit, the priority acquisition unit 15 acquires priority information from the second tag area 4c (step S3). On the other hand, if it is determined that the second tag area 4c is not hit, for example, the process proceeds to step S7 described later.

ステップS2,S3の処理に並行して、L2キャッシュコントローラ6は、読出対象のデータをメインメモリ5に要求する(ステップS4)。L2キャッシュコントローラ6は、この要求に応じて、メインメモリ5から読み出されたデータを取得し(ステップS5)、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS6)。   In parallel with the processing of steps S2 and S3, the L2 cache controller 6 requests the data to be read from the main memory 5 (step S4). In response to this request, the L2 cache controller 6 acquires the data read from the main memory 5 (step S5) and transfers it to the processor core 2 via the L1 cache 3 (step S6).

ステップS3またはステップS6の処理が終了すると、優先度決定部16は、第2タグ領域4cまたはメインメモリ5から読み出したデータを、L2キャッシュ4に格納するか否かを決定する。また、優先度更新部12は、第2タグ領域4cの優先度情報を更新する(ステップS7)。   When the process of step S3 or step S6 ends, the priority determination unit 16 determines whether or not the data read from the second tag area 4c or the main memory 5 is stored in the L2 cache 4. Moreover, the priority update part 12 updates the priority information of the 2nd tag area | region 4c (step S7).

次に、L2キャッシュコントローラ6は、ステップS7の決定に従って、第2タグ領域4cまたはメインメモリ5から読み出したデータを第1データ領域4aに格納または非格納の制御を行う(ステップS8)。   Next, the L2 cache controller 6 performs control of storing or not storing the data read from the second tag area 4c or the main memory 5 in the first data area 4a according to the determination in step S7 (step S8).

ここで、優先度決定部16がステップS7でL2キャッシュ4にデータを格納するか否かを決定するポリシ(すなわち、データを格納するか否かに関する格納制御情報)には、様々なものが考えられる。例えば、第2タグ領域4c内の優先度が0〜5のアドレス情報を、第1タグ領域4b内の優先度0のアドレス情報として第1タグ領域4bに格納し、第2タグ領域4c内の優先度が5より大きいアドレス情報を、第2タグ領域4cに格納されていない低優先度のアドレス情報も含めて、第1タグ領域4b内の優先度3のアドレス情報として第1タグ領域4bに格納するポリシを採用してもよい。なお、ここでは、優先度の数値が小さいほど、優先度が高いものとする。あるいは、第2タグ領域4c内に格納されていない低優先度のアドレス情報は、第1タグ領域4bには格納しないようなポリシを採用してもよい。第2タグ領域4c内の優先度が5より大きいアドレス情報を第1タグ領域4bには格納しないようなポリシ(格納制御情報)を採用してもよい。   Here, various policies can be considered as the policy for determining whether or not the priority determination unit 16 stores data in the L2 cache 4 in step S7 (that is, storage control information regarding whether or not to store data). It is done. For example, address information with a priority of 0 to 5 in the second tag area 4c is stored in the first tag area 4b as address information with a priority of 0 in the first tag area 4b, and the address information in the second tag area 4c is stored. Address information with a priority higher than 5 is included in the first tag area 4b as address information with a priority of 3 in the first tag area 4b, including low priority address information not stored in the second tag area 4c. A policy to be stored may be adopted. Here, it is assumed that the smaller the numerical value of the priority, the higher the priority. Alternatively, a policy may be adopted in which low priority address information not stored in the second tag area 4c is not stored in the first tag area 4b. A policy (storage control information) may be employed in which address information with a priority higher than 5 in the second tag area 4c is not stored in the first tag area 4b.

一方、ステップS1で第1タグ領域4bにヒットしたと判定されると、L2キャッシュコントローラ6は、読出対象のデータを第1データ領域4aから読み出して、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS9)。また、ステップS9の処理に並行して、アクセス情報送信部11は、L2キャッシュ4の第2タグ領域4cにアクセス情報を送信する(ステップS10)。送信されるアクセス情報には、読出要求があって、第1タグ領域4bにヒットしたアドレス情報が含まれている。優先度更新部12は、受信したアクセス情報に基づいて、第2タグ領域4cの優先度情報を更新する(ステップS11)。より具体的には、優先度更新部12は、第1タグ領域4bにヒットしたアドレス情報に対応する優先度を高くするよう、優先度情報を更新する。   On the other hand, if it is determined in step S1 that the first tag area 4b is hit, the L2 cache controller 6 reads the data to be read from the first data area 4a and transfers it to the processor core 2 via the L1 cache 3. (Step S9). In parallel with the process of step S9, the access information transmitting unit 11 transmits the access information to the second tag area 4c of the L2 cache 4 (step S10). The access information to be transmitted includes address information that has a read request and hits the first tag area 4b. The priority update unit 12 updates the priority information of the second tag area 4c based on the received access information (step S11). More specifically, the priority update unit 12 updates the priority information so as to increase the priority corresponding to the address information hit in the first tag area 4b.

図4は第1の実施形態におけるL2キャッシュ4のヒット/ミス判定結果を示す図である。図4の例では、8サイクルにわたって、プロセッサコア2がデータa、b、c、a、d、b、a、cの順に読出要求を行う例を示している。すなわち、プロセッサコア2は、データaを3サイクルごとに、データbを4サイクルごとに読出要求を行う例を示している。図4のL2_Hit?は、L2キャッシュ4にヒットした場合に○、ミスした場合に×となる。access Dataは、L2キャッシュ4にアクセスしたデータを表している。L1は、L1キャッシュ3に格納されているデータに対応するアドレス情報を表している。L2_0とL2_1は、L2キャッシュ4内の第1データ領域4aに格納されているデータの優先度情報4b2を表しており、この中には当該データのアドレス情報4b1が格納されている。L2_0がL2_1よりも優先度が高いことを示している。2tag_0〜2tag_3は、L2キャッシュ4内の第2タグ領域4c内の優先度情報4c2を表しており、この中には過去にアクセスされたデータのアドレス情報4c1が格納されている。2tag_0の優先度が最も高く、2tag_3の優先度が最も低いことを示している。   FIG. 4 is a diagram showing the hit / miss determination result of the L2 cache 4 in the first embodiment. In the example of FIG. 4, the processor core 2 makes a read request in the order of data a, b, c, a, d, b, a, c over 8 cycles. That is, the processor core 2 shows an example in which a read request is made for data a every 3 cycles and data b every 4 cycles. L2_Hit? In FIG. 4 is “O” when the L2 cache 4 is hit, and “X” when it misses. access Data represents data accessed to the L2 cache 4. L1 represents address information corresponding to data stored in the L1 cache 3. L2_0 and L2_1 represent priority information 4b2 of data stored in the first data area 4a in the L2 cache 4, in which address information 4b1 of the data is stored. L2_0 has a higher priority than L2_1. 2tag_0 to 2tag_3 represent priority information 4c2 in the second tag area 4c in the L2 cache 4, in which address information 4c1 of data accessed in the past is stored. This indicates that 2tag_0 has the highest priority and 2tag_3 has the lowest priority.

まず、サイクルC1で、データaの読出要求があったとする。この時点では、L1キャッシュ3とL2キャッシュ4には、何もデータが格納されていないとする。また、L1キャッシュ3は1キャッシュライン分のメモリ容量を有し、L2キャッシュ4内の第1データ領域4aと第1タグ領域4bは2キャッシュライン分のメモリ容量を有し、第2タグ領域4cは4キャッシュライン分のメモリ容量を有するものとする。   First, it is assumed that there is a read request for data a in cycle C1. At this time, it is assumed that no data is stored in the L1 cache 3 and the L2 cache 4. The L1 cache 3 has a memory capacity for one cache line, the first data area 4a and the first tag area 4b in the L2 cache 4 have a memory capacity for two cache lines, and the second tag area 4c. Has a memory capacity of 4 cache lines.

次のサイクルC2では、サイクルC1で読出要求のあったデータaとそのアドレス情報はL1キャッシュ3に格納されるとともに、L2キャッシュ4内の第1データ領域4aと第1タグ領域4bにも格納される。第2タグ領域4cには、データaのアドレス情報が格納される。また、このサイクルC2では、データbの読出要求があったとする。   In the next cycle C2, the data a requested to be read in the cycle C1 and its address information are stored in the L1 cache 3 and also stored in the first data area 4a and the first tag area 4b in the L2 cache 4. The Address information of data a is stored in the second tag area 4c. In cycle C2, it is assumed that there is a read request for data b.

次のサイクルC3では、L1キャッシュ3はサイクルC2でキャッシュミスしたため、データbとそのアドレス情報に置換される。また、サイクルC2では、L2キャッシュ4内の第1タグ領域4bと第2タグ領域4cのいずれにもキャッシュミスしたため、第1データ領域4aと第1タグ領域4bはデータbとそのアドレス情報に置換される。第2タグ領域4cには、データaのアドレス情報を置換せずに、データbのアドレス情報が追加で格納される。また、このサイクルC3では、データcの読出要求があったとする。   In the next cycle C3, since the L1 cache 3 has a cache miss in cycle C2, it is replaced with the data b and its address information. In cycle C2, since a cache miss has occurred in both the first tag area 4b and the second tag area 4c in the L2 cache 4, the first data area 4a and the first tag area 4b are replaced with the data b and its address information. Is done. In the second tag area 4c, the address information of the data b is additionally stored without replacing the address information of the data a. In cycle C3, it is assumed that there is a request for reading data c.

次のサイクルC4では、L1キャッシュ3はサイクルC3でキャッシュミスしたため、データcとそのアドレス情報に置換される。また、サイクルC3では、L2キャッシュ4内の第1タグ領域4bと第2タグ領域4cのいずれにもキャッシュミスしたため、第1データ領域4aと第1タグ領域4bはデータcとそのアドレス情報に置換される。第2タグ領域4cには、データa、bのアドレス情報を置換せずに、データcのアドレス情報が追加で格納される。また、このサイクルC4では、データaの読出要求があったとする。   In the next cycle C4, since the L1 cache 3 has a cache miss in cycle C3, it is replaced with data c and its address information. In cycle C3, since a cache miss has occurred in both the first tag area 4b and the second tag area 4c in the L2 cache 4, the first data area 4a and the first tag area 4b are replaced with the data c and its address information. Is done. In the second tag area 4c, the address information of the data c is additionally stored without replacing the address information of the data a and b. In cycle C4, it is assumed that there is a read request for data a.

次のサイクルC5では、L1キャッシュ3はサイクルC4でキャッシュミスしたため、データaとそのアドレス情報に置換される。また、サイクルC4では、L2キャッシュ4内の第2タグ領域4cにキャッシュヒットしたため、第1データ領域4aと第1タグ領域4bに追加でデータaとそのアドレス情報が格納される。また、第2タグ領域4c内のデータaに対応するアドレス情報の優先度が最高の値に引き上げられる。また、このサイクルC5では、データdの読出要求があったとする。   In the next cycle C5, the L1 cache 3 is replaced with data a and its address information because a cache miss occurred in cycle C4. In cycle C4, since a cache hit occurs in the second tag area 4c in the L2 cache 4, data a and its address information are additionally stored in the first data area 4a and the first tag area 4b. Further, the priority of the address information corresponding to the data a in the second tag area 4c is raised to the highest value. In cycle C5, it is assumed that there is a read request for data d.

次のサイクルC6では、L1キャッシュ3はサイクルC5でキャッシュミスしたため、データdとそのアドレス情報に置換される。また、サイクルC5では、L2キャッシュ4内の第1タグ領域4bと第2タグ領域4cのいずれにもキャッシュミスしたため、第1データ領域4aと第1タグ領域4b内のデータcはデータdとそのアドレス情報に置換される。第2タグ領域4cには、データa、b、cのアドレス情報を置換せずに、データdのアドレス情報が追加で格納される。また、このサイクルC3では、データbの読出要求があったとする。   In the next cycle C6, the L1 cache 3 is replaced with the data d and its address information because of a cache miss in the cycle C5. In cycle C5, since the cache miss has occurred in both the first tag area 4b and the second tag area 4c in the L2 cache 4, the data c in the first data area 4a and the first tag area 4b is the data d and its data c. Replaced with address information. In the second tag area 4c, the address information of the data d is additionally stored without replacing the address information of the data a, b, c. In cycle C3, it is assumed that there is a request for reading data b.

次のサイクルC7では、L1キャッシュ3はサイクルC6でキャッシュミスしたため、データbとそのアドレス情報に置換される。また、サイクルC6では、L2キャッシュ4内の第1タグ領域4bと第2タグ領域4cのいずれにもキャッシュミスしたため、第1データ領域4aと第1タグ領域4b内のデータcはデータdとそのアドレス情報に置換される。第2タグ領域4cには、データa、b、cのアドレス情報を置換せずに、データdのアドレス情報が追加で格納される。また、このサイクルC7では、データaの読出要求があったとする。これにより、L2キャッシュ4内の第1タグ領域4bにヒットすることになり、第1データ領域4aからデータaが読み出されて、プロセッサコア2に転送される。   In the next cycle C7, the L1 cache 3 is replaced with the data b and its address information because of a cache miss in the cycle C6. In cycle C6, since a cache miss has occurred in both the first tag area 4b and the second tag area 4c in the L2 cache 4, the data c in the first data area 4a and the first tag area 4b is the data d and its data c. Replaced with address information. In the second tag area 4c, the address information of the data d is additionally stored without replacing the address information of the data a, b, c. In cycle C7, it is assumed that there is a read request for data a. As a result, the first tag area 4b in the L2 cache 4 is hit, and the data a is read from the first data area 4a and transferred to the processor core 2.

次のサイクルC8では、L1キャッシュ3はサイクルC7でキャッシュミスしたため、データaとそのアドレス情報に置換される。また、サイクルC7では、L2キャッシュ4内の第1タグ領域4bと第2タグ領域4cのいずれにもキャッシュヒットしたため、第1データ領域4aと第1タグ領域4b内のデータa、bは変化しない。第2タグ領域4cでは、データaの優先度が最も高くなり、次いで、データb、d、cの順にデータが格納される。   In the next cycle C8, the L1 cache 3 has a cache miss in cycle C7, and is therefore replaced with data a and its address information. Further, in cycle C7, the data a and b in the first data area 4a and the first tag area 4b do not change because a cache hit occurs in both the first tag area 4b and the second tag area 4c in the L2 cache 4. . In the second tag area 4c, the priority of the data a is the highest, and then the data is stored in the order of the data b, d, and c.

図4からわかるように、3サイクルごとに読出要求のあるデータaは、4サイクルごとに読出要求のあるデータbよりも優先してL2キャッシュ4に格納される。これにより、再参照される可能性がより高いデータほど、優先的にL2キャッシュ4に格納することができる。   As can be seen from FIG. 4, data a having a read request every three cycles is stored in the L2 cache 4 in preference to data b having a read request every four cycles. As a result, data that is more likely to be re-referenced can be preferentially stored in the L2 cache 4.

図5は第2タグ領域4cがない場合のL1キャッシュ3とL2キャッシュ4のヒット/ミス判定結果を示す図である。図5では、読出要求のあったデータの並び順は図4と同じであり、L1キャッシュ3とL2キャッシュ4のメモリ容量も図4と同じである。図5では、直近に読出要求のあった2つのデータしかL2キャッシュ4に格納できないため、3サイクル以上隔てて同じデータの読出要求があっても、L2キャッシュ4にはヒットしない。これに対して、本実施形態は、図4に示すように、直近に読出要求のあった4つのデータのアドレス情報を格納する第2タグ領域4cを有し、第2タグ領域4cとのヒット判定結果に基づいて第1データ領域4aにデータを格納するため、アクセス頻度の高いデータを確実に第1データ領域4aに格納できる。   FIG. 5 is a diagram showing hit / miss determination results of the L1 cache 3 and the L2 cache 4 when there is no second tag area 4c. In FIG. 5, the arrangement order of the data requested to be read is the same as in FIG. 4, and the memory capacities of the L1 cache 3 and the L2 cache 4 are also the same as in FIG. In FIG. 5, since only the two data that have been requested to be read most recently can be stored in the L2 cache 4, even if there is a read request for the same data at least three cycles apart, the L2 cache 4 is not hit. On the other hand, as shown in FIG. 4, this embodiment has a second tag area 4c for storing address information of the four data requested to be read most recently, and hits the second tag area 4c. Since data is stored in the first data area 4a based on the determination result, data with high access frequency can be reliably stored in the first data area 4a.

このように、本実施形態では、L2キャッシュ4に、本来の第1タグ領域4bとは別に、第2タグ領域4cを設けて、第2タグ領域4cにはアドレス情報と優先度情報とを対応づけて格納し、L2キャッシュ4の第1データ領域4aに格納されていないデータの読出要求があった場合でも、第2タグ領域4c内の優先度情報に基づいて、第1データ領域4aにデータを格納するか否かを決定できる。これにより、高再参照データで無いデータのL2キャッシュ4への書き込みを抑制でき、L2キャッシュ4への書込み回数を削減できる。これにより、第1データ領域4aの優先度の高いデータを追い出すことを抑制しつつ、第1データ領域4aに優先度の高いデータを格納でき、L2キャッシュ4へのヒット率を向上できる。より具体的には、第2タグ領域4cを設けることで、再参照される可能性の高いデータに対するヒット率を向上できる。これにより、L2キャッシュのデータ入れ替え頻度を抑制でき、L2キャッシュ4への書込み回数を削減できる。よって、書込み回数に制限のあるMRAM等の不揮発メモリを用いてL2キャッシュ4を構成できる。   Thus, in the present embodiment, the L2 cache 4 is provided with the second tag area 4c separately from the original first tag area 4b, and the address information and priority information are associated with the second tag area 4c. Even if there is a read request for data stored and not stored in the first data area 4a of the L2 cache 4, data is stored in the first data area 4a based on the priority information in the second tag area 4c. Can be determined. As a result, writing of data that is not highly re-referenced data to the L2 cache 4 can be suppressed, and the number of writes to the L2 cache 4 can be reduced. As a result, high-priority data can be stored in the first data area 4a while suppressing high-priority data in the first data area 4a from being pushed out, and the hit rate to the L2 cache 4 can be improved. More specifically, by providing the second tag region 4c, it is possible to improve the hit rate for data that is highly likely to be re-referenced. As a result, the frequency of data replacement in the L2 cache can be suppressed, and the number of writes to the L2 cache 4 can be reduced. Therefore, the L2 cache 4 can be configured using a non-volatile memory such as an MRAM with a limited number of writes.

(第2の実施形態)
図6は第2の実施形態によるプロセッサシステムの概略構成を示すブロック図である。図6のプロセッサシステムは、図1のL2キャッシュ4とメインメモリ5の間に、L3キャッシュ7を設けたものである。L3キャッシュ7は、読出要求のあったデータがL2キャッシュ4にミスしたときにアクセスされてヒット/ミス判定を行う。ヒットすると、読出要求のあったデータをL3キャッシュ7から読み出して、L2キャッシュ4に転送する。ミスすると、L3キャッシュ7はメインメモリ5に読出要求を転送する。
(Second Embodiment)
FIG. 6 is a block diagram showing a schematic configuration of a processor system according to the second embodiment. The processor system shown in FIG. 6 includes an L3 cache 7 between the L2 cache 4 and the main memory 5 shown in FIG. The L3 cache 7 is accessed when the data requested to be read misses the L2 cache 4 and performs hit / miss determination. When there is a hit, the requested data is read from the L3 cache 7 and transferred to the L2 cache 4. If a miss occurs, the L3 cache 7 transfers a read request to the main memory 5.

図6のL3キャッシュ7は、L2キャッシュ4よりもメモリ容量が大きい。本実施形態では、第1の実施形態と同様に、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7のタグアレイがLRUアルゴリズムで管理されているものとするが、LRU以外の様々なデータ優先度管理アルゴリズムと組み合わせることも可能である。また、以下では、簡略化のため、タグアレイをフルアソシアティブキャッシュの例を説明するが、本実施形態は、種々のキャッシュ方式に適用可能であり、例えば、セットアソシアティブでもよいし、ダイレクトマップでもよい。   The L3 cache 7 in FIG. 6 has a larger memory capacity than the L2 cache 4. In this embodiment, as in the first embodiment, the tag arrays of the L1 cache 3, the L2 cache 4, and the L3 cache 7 are managed by the LRU algorithm, but various data priority management algorithms other than the LRU are used. It is also possible to combine with. In the following, for the sake of simplification, an example of a fully associative cache using a tag array will be described. However, the present embodiment can be applied to various cache methods, and may be set associative or a direct map, for example.

図7は第2の実施形態によるメモリシステム1内のL2キャッシュ4とL3キャッシュ7の内部構成を示すブロック図である。図7に示すように、L2キャッシュ4は、第1タグ領域4bと、第1データ領域4aと、L2キャッシュコントローラ6とを有する。また、L3キャッシュ7は、第2タグ領域7aと、第2データ領域7bと、L3キャッシュコントローラ8とを有する。L3キャッシュ7は、L2キャッシュ4よりもメモリ容量が多い。よって、第2タグ領域7aは第1タグ領域4bよりも大きく、第2データ領域7bは第1データ領域4aよりも大きい。   FIG. 7 is a block diagram showing an internal configuration of the L2 cache 4 and the L3 cache 7 in the memory system 1 according to the second embodiment. As illustrated in FIG. 7, the L2 cache 4 includes a first tag area 4 b, a first data area 4 a, and an L2 cache controller 6. The L3 cache 7 includes a second tag area 7a, a second data area 7b, and an L3 cache controller 8. The L3 cache 7 has a larger memory capacity than the L2 cache 4. Therefore, the second tag area 7a is larger than the first tag area 4b, and the second data area 7b is larger than the first data area 4a.

第1データ領域4aと第2データ領域7bは、MRAM等の不揮発メモリで構成されており、第1タグ領域4bと第2タグ領域7aは、SRAM等の高速の揮発メモリで構成されている。なお、第1タグ領域4bと第2タグ領域7aを、不揮発メモリで構成してもよい。   The first data area 4a and the second data area 7b are configured by a non-volatile memory such as an MRAM, and the first tag area 4b and the second tag area 7a are configured by a high-speed volatile memory such as an SRAM. Note that the first tag area 4b and the second tag area 7a may be formed of a nonvolatile memory.

第1タグ領域4bと第2タグ領域7aはいずれも、アドレス情報4b1,7a1と、優先度情報4b2,7a2とを対応づけて格納する。   Each of the first tag area 4b and the second tag area 7a stores address information 4b1 and 7a1 in association with priority information 4b2 and 7a2.

L2キャッシュコントローラ6は、アクセス情報送信部11と、第1ヒット判定部13と、優先度決定部16とを有する。L3キャッシュコントローラ8は、優先度更新部12と、第2ヒット判定部14と、優先度取得部15と、アクセス制御部17とを有する。   The L2 cache controller 6 includes an access information transmission unit 11, a first hit determination unit 13, and a priority determination unit 16. The L3 cache controller 8 includes a priority update unit 12, a second hit determination unit 14, a priority acquisition unit 15, and an access control unit 17.

L2キャッシュコントローラ6内のアクセス情報送信部11は、L2キャッシュ4へのアクセス情報をL3キャッシュコントローラ8に送信する。第1ヒット判定部13は、読出要求のあったアドレス情報がL2キャッシュ4内の第1タグ領域4bに格納されているか否かを判定する。優先度決定部16は、読出要求のあったアドレス情報について優先度取得部15で取得された優先度情報に基づいて、読出対象のデータを第1データ領域4aに格納するか否かを決定する。   The access information transmission unit 11 in the L2 cache controller 6 transmits access information to the L2 cache 4 to the L3 cache controller 8. The first hit determination unit 13 determines whether or not the address information requested to be read is stored in the first tag area 4b in the L2 cache 4. The priority determination unit 16 determines whether to store the data to be read in the first data area 4a based on the priority information acquired by the priority acquisition unit 15 for the address information requested to be read. .

L3キャッシュコントローラ8内の優先度更新部12は、アクセス情報送信部11から送信されたアクセス情報に基づいて、第2タグ領域7a内の優先度情報を更新する。第2ヒット判定部14は、読出対象のデータがL2キャッシュ4でミスした場合に、このデータのアドレス情報がL3キャッシュ7内の第2タグ領域7aに格納されているか否かを判定する。優先度取得部15は、読出対象のデータのアドレス情報が第2タグ領域7aにヒットした場合に、第2タグ領域7aから対応する優先度情報を取得する。この優先度情報は、L2キャッシュコントローラ6内の優先度決定部16に送られる。   The priority update unit 12 in the L3 cache controller 8 updates the priority information in the second tag area 7a based on the access information transmitted from the access information transmission unit 11. When the data to be read misses in the L2 cache 4, the second hit determination unit 14 determines whether the address information of this data is stored in the second tag area 7 a in the L3 cache 7. The priority acquisition unit 15 acquires corresponding priority information from the second tag area 7a when the address information of the data to be read hits the second tag area 7a. This priority information is sent to the priority determination unit 16 in the L2 cache controller 6.

図8は第2の実施形態によるメモリシステム1の処理動作を示すフローチャートである。まず、読出対象のデータがL2キャッシュ4にヒットするか否かを判定する(ステップS21)。ここでは、読出対象のデータのアドレス情報がL2キャッシュ4内の第1タグ領域4bに格納されているか否かを、第1ヒット判定部13にて判定する。   FIG. 8 is a flowchart showing the processing operation of the memory system 1 according to the second embodiment. First, it is determined whether or not the data to be read hits the L2 cache 4 (step S21). Here, the first hit determination unit 13 determines whether the address information of the data to be read is stored in the first tag area 4 b in the L2 cache 4.

ステップS21でヒットしたと判定されると、L2キャッシュコントローラ6は、L2キャッシュ4から読出対象のデータを読み出して、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS22)。   If it is determined in step S21 that the data is hit, the L2 cache controller 6 reads the data to be read from the L2 cache 4 and transfers it to the processor core 2 via the L1 cache 3 (step S22).

ステップS21でミスしたと判定されると、読出対象のデータがL3キャッシュ7にヒットするか否かを判定する(ステップS23)。ここでは、読出対象のデータのアドレス情報がL3キャッシュ7内の第2タグ領域7a1に格納されているか否かを、第2ヒット判定部14にて判定する。ステップS23でヒットしたと判定されると、L3キャッシュコントローラ8は、L3キャッシュ7から読出対象のデータを読み出して、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS24)。   If it is determined in step S21 that a miss has occurred, it is determined whether or not the data to be read hits the L3 cache 7 (step S23). Here, the second hit determination unit 14 determines whether or not the address information of the data to be read is stored in the second tag area 7a1 in the L3 cache 7. If it is determined in step S23 that the data has been hit, the L3 cache controller 8 reads the data to be read from the L3 cache 7 and transfers it to the processor core 2 via the L1 cache 3 (step S24).

ステップS23でL3キャッシュ7にミスしたと判定されると、L3キャッシュコントローラ8は、メインメモリ5から読出対象のデータを読み出してL3キャッシュ7に格納するとともに、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS25)。   If it is determined in step S23 that the L3 cache 7 has been missed, the L3 cache controller 8 reads the data to be read from the main memory 5 and stores it in the L3 cache 7, and also stores it in the processor core 2 via the L1 cache 3. Transfer (step S25).

ステップS22、S24またはS25の処理が終了すると、優先度取得部15は、L3キャッシュ7内の第2タグ領域7aから優先度情報を取得して、L2キャッシュコントローラ6に送信する(ステップS26)。   When the process of step S22, S24, or S25 ends, the priority acquisition unit 15 acquires priority information from the second tag area 7a in the L3 cache 7 and transmits it to the L2 cache controller 6 (step S26).

次に、L2キャッシュコントローラ6内の優先度決定部16は、ステップS26で送信されてきた優先度情報に基づいて、L3キャッシュ7またはメインメモリ5から読み出したデータをL2キャッシュ4に格納するか否かを決定する。また、優先度更新部12は、第2タグ領域7aの優先度情報を更新する(ステップS27)。   Next, the priority determination unit 16 in the L2 cache controller 6 stores the data read from the L3 cache 7 or the main memory 5 in the L2 cache 4 based on the priority information transmitted in step S26. To decide. Moreover, the priority update part 12 updates the priority information of the 2nd tag area | region 7a (step S27).

次に、L2キャッシュコントローラ6は、ステップS27の決定に従って、第2タグ領域7aまたはメインメモリ5から読み出したデータを第1データ領域4aに格納または非格納の制御を行う(ステップS28)。   Next, the L2 cache controller 6 performs control of storing or not storing the data read from the second tag area 7a or the main memory 5 in the first data area 4a according to the determination in step S27 (step S28).

優先度決定部16がステップS27でL2キャッシュ4にデータを格納するか否かを決定するポリシは、図3のステップS7と同様に様々なものが考えられ、どのポリシを選択してもよい。   Various policies for determining whether or not the priority determination unit 16 stores data in the L2 cache 4 in step S27 can be considered as in step S7 of FIG. 3, and any policy may be selected.

図9は第2の実施形態におけるL2キャッシュ4のヒット/ミス判定結果を示す図である。図9の例では、8サイクルにわたって、プロセッサコア2がデータa、x1、x2、a、x3、x4およびaの順に読出要求を行う例を示している。このように、図9は、プロセッサコア2がデータaを3サイクルごとに読出要求を行う例を示している。図9のL2_Hit?、access Data、L1、L2_0, L2_1は図4と同じである。L3_0〜L3_5はL3キャッシュ7内の第2データ領域7bに格納されているデータの優先度情報7a2を表しており、この中には当該データのアドレス情報7a1が格納されている。L3_0の優先度が最も高く、L3_5の優先度が最も低いことを示している。   FIG. 9 is a diagram showing the hit / miss determination result of the L2 cache 4 in the second embodiment. The example of FIG. 9 shows an example in which the processor core 2 issues a read request in the order of data a, x1, x2, a, x3, x4, and a over 8 cycles. Thus, FIG. 9 shows an example in which the processor core 2 issues a read request for data a every three cycles. 9, L2_Hit ?, access Data, L1, L2_0, and L2_1 are the same as those in FIG. L3_0 to L3_5 represent priority information 7a2 of data stored in the second data area 7b in the L3 cache 7, in which address information 7a1 of the data is stored. This indicates that L3_0 has the highest priority and L3_5 has the lowest priority.

まず、サイクルC1で、データaの読出要求があったとする。この時点では、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7には、何もデータが格納されていないとする。また、L1キャッシュ3は1キャッシュライン分のメモリ容量を有し、L2キャッシュ4は2キャッシュライン分のメモリ容量を有し、L3キャッシュ7は6キャッシュライン分のメモリ容量を有するものとする。   First, it is assumed that there is a read request for data a in cycle C1. At this time, it is assumed that no data is stored in the L1 cache 3, the L2 cache 4, and the L3 cache 7. The L1 cache 3 has a memory capacity for one cache line, the L2 cache 4 has a memory capacity for two cache lines, and the L3 cache 7 has a memory capacity for six cache lines.

次のサイクルC2では、サイクルC1で読出要求のあったデータaは、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7のいずれにも格納されていないことから、これらキャッシュでミスする。そして、データaがメインメモリ5から読み出されて、データaとそのアドレス情報はL1キャッシュ3とL3キャッシュ7に格納されるが、データaの優先度情報はL3キャッシュ7内の第2タグ領域7a1には格納されていないため、データaはL2キャッシュ4には格納されない。また、このサイクルC2では、データx1の読出要求があったものとする。   In the next cycle C2, the data a requested to be read in the cycle C1 is not stored in any of the L1 cache 3, the L2 cache 4 and the L3 cache 7, and therefore misses in these caches. Then, the data a is read from the main memory 5 and the data a and its address information are stored in the L1 cache 3 and the L3 cache 7, but the priority information of the data a is the second tag area in the L3 cache 7. Since the data is not stored in 7a1, the data a is not stored in the L2 cache 4. In cycle C2, it is assumed that there is a read request for data x1.

次のサイクルC3では、サイクルC2で読出要求のあったデータx1は、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7でミスし、このデータx1はメインメモリ5から読み出されて、データx1とそのアドレス情報はL1キャッシュ3とL3キャッシュ7に格納される。L1キャッシュ3は1キャッシュライン分のメモリ容量しかないため、データaはデータx1に上書きされる。L3キャッシュ7は6キャッシュライン分のメモリ容量を有するため、データaとデータx1はともにL3キャッシュ7に格納され、直近にアクセスのあったデータx1の優先度がデータaの優先度よりも高く設定される。なお、サイクルC3までは、データx1の優先度情報はL3キャッシュ7内の第2タグ領域7a1には格納されていなかったため、データx1はL2キャッシュ4には格納されない。また、このサイクルC3では、データx2の読出要求があったものとする。   In the next cycle C3, the data x1 requested to be read in the cycle C2 misses in the L1 cache 3, the L2 cache 4 and the L3 cache 7, and this data x1 is read from the main memory 5, and the data x1 and its data x1 are read. Address information is stored in the L1 cache 3 and the L3 cache 7. Since the L1 cache 3 has only a memory capacity for one cache line, the data a is overwritten on the data x1. Since the L3 cache 7 has a memory capacity of 6 cache lines, both the data a and the data x1 are stored in the L3 cache 7, and the priority of the data x1 accessed most recently is set higher than the priority of the data a. Is done. Until the cycle C3, since the priority information of the data x1 is not stored in the second tag area 7a1 in the L3 cache 7, the data x1 is not stored in the L2 cache 4. In cycle C3, it is assumed that there is a read request for data x2.

次のサイクルC4では、サイクルC3で読出要求のあったデータx2は、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7でミスし、このデータx2はメインメモリ5から読み出されて、データx2とそのアドレス情報はL1キャッシュ3とL3キャッシュ7に格納される。L1キャッシュ3は1キャッシュライン分のメモリ容量しかないため、データx1はデータx2に上書きされる。L3キャッシュ7は6キャッシュライン分のメモリ容量を有するため、データa、x1、x2はともにL3キャッシュ7に格納され、データx2、x1、aの順に優先度が下がる優先度情報が生成される。すなわち、より直近にアクセスしたデータほど、優先度が高くなる。なお、サイクルC4までは、データx2の優先度情報はL3キャッシュ7内の第2タグ領域7a1には格納されていなかったため、データx2はL2キャッシュ4には格納されない。また、このサイクルC4では、データaの読出要求があったものとする。   In the next cycle C4, the data x2 requested to be read in the cycle C3 misses in the L1 cache 3, the L2 cache 4 and the L3 cache 7, and this data x2 is read from the main memory 5, and the data x2 and its data x2 are read. Address information is stored in the L1 cache 3 and the L3 cache 7. Since the L1 cache 3 has only a memory capacity for one cache line, the data x1 is overwritten with the data x2. Since the L3 cache 7 has a memory capacity for six cache lines, the data a, x1, and x2 are all stored in the L3 cache 7, and priority information that lowers the priority in the order of the data x2, x1, and a is generated. That is, the data accessed more recently has a higher priority. Until the cycle C4, since the priority information of the data x2 is not stored in the second tag area 7a1 in the L3 cache 7, the data x2 is not stored in the L2 cache 4. In cycle C4, it is assumed that there is a request for reading data a.

次のサイクルC5では、サイクルC4で読出要求のあったデータaは、L1キャッシュ3とL2キャッシュ4でミスし、L3キャッシュ7でヒットする。よって、L3キャッシュ7からデータaが読み出されて、L1キャッシュ3とL2キャッシュ4に格納される。L1キャッシュ3は1キャッシュライン分のメモリ容量しかないため、データx2はデータaに上書きされる。L3キャッシュ7内の優先度が変更になり、データa、x2、x1の順に優先度が下がる優先度情報が生成される。また、このサイクルC5では、データx3の読出要求があったものとする。   In the next cycle C5, the data a requested to be read in the cycle C4 misses in the L1 cache 3 and the L2 cache 4 and hits in the L3 cache 7. Therefore, data a is read from the L3 cache 7 and stored in the L1 cache 3 and the L2 cache 4. Since the L1 cache 3 has only a memory capacity for one cache line, the data x2 is overwritten with the data a. The priority in the L3 cache 7 is changed, and priority information in which the priority decreases in the order of data a, x2, and x1 is generated. In cycle C5, it is assumed that there is a read request for data x3.

次のサイクルC6では、サイクルC5で読出要求のあったデータx3は、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7でミスし、このデータx3はメインメモリ5から読み出されて、データx3とそのアドレス情報はL1キャッシュ3とL3キャッシュ7に格納される。L1キャッシュ3は1キャッシュライン分のメモリ容量しかないため、データaはデータx3に上書きされる。L3キャッシュ7は6キャッシュライン分のメモリ容量を有するため、データx3、a、x2、x1の順に優先度が下がる優先度情報が生成される。すなわち、より直近にアクセスしたデータほど、優先度が高くなる。なお、サイクルC6までは、データx3の優先度情報はL3キャッシュ7内の第2タグ領域7a1には格納されていなかったため、データx3はL2キャッシュ4には格納されない。また、このサイクルC6では、データx4の読出要求があったものとする。   In the next cycle C6, the data x3 requested to be read in the cycle C5 misses in the L1 cache 3, the L2 cache 4 and the L3 cache 7, and this data x3 is read from the main memory 5, and the data x3 and its data x3 are read. Address information is stored in the L1 cache 3 and the L3 cache 7. Since the L1 cache 3 has only a memory capacity for one cache line, the data a is overwritten on the data x3. Since the L3 cache 7 has a memory capacity for six cache lines, priority information whose priority decreases in the order of the data x3, a, x2, and x1 is generated. That is, the data accessed more recently has a higher priority. Until the cycle C6, since the priority information of the data x3 is not stored in the second tag area 7a1 in the L3 cache 7, the data x3 is not stored in the L2 cache 4. In cycle C6, it is assumed that there is a read request for data x4.

次のサイクルC7では、サイクルC6で読出要求のあったデータx4は、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7でミスし、このデータx4はメインメモリ5から読み出されて、データx4とそのアドレス情報はL1キャッシュ3とL3キャッシュ7に格納される。L1キャッシュ3は1キャッシュライン分のメモリ容量しかないため、データx3はデータx4に上書きされる。L3キャッシュ7は6キャッシュライン分のメモリ容量を有するため、データx4、x3、a、x2、x1の順に優先度が下がる優先度情報が生成される。すなわち、より直近にアクセスしたデータほど、優先度が高くなる。なお、サイクルC7までは、データx4の優先度情報はL3キャッシュ7内の第2タグ領域7a1には格納されていなかったため、データx4はL2キャッシュ4には格納されない。また、このサイクルC7では、データaの読出要求があったものとする。これにより、L2キャッシュ4にヒットすることになる。   In the next cycle C7, the data x4 requested to be read in cycle C6 misses in the L1 cache 3, the L2 cache 4 and the L3 cache 7, and this data x4 is read from the main memory 5, and the data x4 and its data x4 are read. Address information is stored in the L1 cache 3 and the L3 cache 7. Since the L1 cache 3 has only a memory capacity for one cache line, the data x3 is overwritten with the data x4. Since the L3 cache 7 has a memory capacity for six cache lines, priority information whose priority decreases in the order of the data x4, x3, a, x2, and x1 is generated. That is, the data accessed more recently has a higher priority. Until the cycle C7, since the priority information of the data x4 is not stored in the second tag area 7a1 in the L3 cache 7, the data x4 is not stored in the L2 cache 4. In cycle C7, it is assumed that there is a request for reading data a. As a result, the L2 cache 4 is hit.

図10はL3キャッシュ7内の第2タグ領域7aが優先度情報を持たない場合の一比較例のヒット/ミス判定結果を示す図である。図10では、読出要求のあったデータの並び順は図9と同じであり、L1キャッシュ3とL2キャッシュ4のメモリ容量も図9と同じである。図10では、直近に読出要求のあった2つのデータしかL2キャッシュ4に格納できないため、3サイクル以上隔てて同じデータの読出要求があっても、L2キャッシュ4にはヒットしない。これに対して、本実施形態は、図9に示すように、L3キャッシュ7内の第2タグ領域7aに格納された優先度情報に基づいて、優先度が高いデータのみをL2キャッシュ4に格納するため、3サイクル以上隔てて同じデータの読出要求があっても、L2キャッシュ4にヒットさせることができる。   FIG. 10 is a diagram showing a hit / miss determination result of a comparative example when the second tag area 7a in the L3 cache 7 does not have priority information. 10, the arrangement order of the data requested to be read is the same as that in FIG. 9, and the memory capacities of the L1 cache 3 and the L2 cache 4 are also the same as those in FIG. In FIG. 10, since only the two data requested to be read most recently can be stored in the L2 cache 4, even if there is a read request for the same data at least three cycles apart, the L2 cache 4 is not hit. On the other hand, in the present embodiment, as shown in FIG. 9, only high priority data is stored in the L2 cache 4 based on the priority information stored in the second tag area 7a in the L3 cache 7. Therefore, even if there is a read request for the same data at least three cycles apart, the L2 cache 4 can be hit.

このように、第2の実施形態では、L3キャッシュ7内の第2タグ領域7aに、各アドレス情報に対応づけて優先度情報を設けるため、L3キャッシュ7にアクセスされたデータの優先度を把握することができる。よって、この優先度情報に基づいて、L2キャッシュ4にデータを格納するか否かを決定でき、再参照される可能性の高いデータをL2キャッシュ4に優先して格納することができる。これにより、L2キャッシュ4へのヒット率を向上できる。   As described above, in the second embodiment, since priority information is provided in association with each address information in the second tag area 7a in the L3 cache 7, the priority of the data accessed to the L3 cache 7 is grasped. can do. Therefore, it is possible to determine whether or not to store data in the L2 cache 4 based on this priority information, and data that is highly likely to be re-referenced can be stored in priority in the L2 cache 4. Thereby, the hit rate to the L2 cache 4 can be improved.

(第3の実施形態)
第3の実施形態は、ビクティムキャッシュ(Victim Cache方式)を採用するものである。ここで、ビクティムキャッシュとは、下位階層のデータをプロセッサコア2に転送する際に、上位階層のキャッシュにはデータを格納せず、上位階層のキャッシュからデータを追い出す際に、下位階層のキャッシュにデータを格納する方式である。
(Third embodiment)
The third embodiment employs a victim cache (Victim Cache method). Here, the victim cache is not stored in the upper-level cache when transferring lower-level data to the processor core 2, but is transferred to the lower-level cache when evicting data from the upper-level cache. A method for storing data.

第3の実施形態によるメモリシステム1は、図6と同様に、L1キャッシュ3、L2キャッシュ4およびL3キャッシュ7の3階層のキャッシュを備えている。なお、4階層以上のキャッシュを備えていてもよい。   The memory system 1 according to the third embodiment includes a three-level cache of an L1 cache 3, an L2 cache 4, and an L3 cache 7, as in FIG. Note that a cache having four or more layers may be provided.

図11は第3の実施形態によるメモリシステム1の処理動作を示すフローチャートである。まず、L2キャッシュ4にヒットしたか否かを判定する(ステップS31)。ステップS31でヒットしたと判定されると、読出対象のデータをL2キャッシュ4から読み出して、L1キャッシュ3を介してプロセッサコア2に転送する(ステップS32)。その後、図11の処理を終了する。   FIG. 11 is a flowchart showing the processing operation of the memory system 1 according to the third embodiment. First, it is determined whether or not the L2 cache 4 has been hit (step S31). If it is determined in step S31 that the data has been hit, the data to be read is read from the L2 cache 4 and transferred to the processor core 2 via the L1 cache 3 (step S32). Then, the process of FIG. 11 is complete | finished.

ステップS31でL2キャッシュ4にミスしたと判定されると、L3キャッシュ7にヒットしたか否かを判定する(ステップS33)。L3キャッシュ7にヒットしたと判定されると、L3キャッシュ7からL1キャッシュ3を介してプロセッサコア2にデータを転送する(ステップS34)。L3キャッシュ7にミスしたと判定されると、メインメモリ5からL1キャッシュ3を介してプロセッサコア2にデータを転送する(ステップS35)。このとき、メインメモリ5からのデータはL3キャッシュ7には転送されない。   If it is determined in step S31 that the L2 cache 4 has been missed, it is determined whether or not the L3 cache 7 has been hit (step S33). If it is determined that the L3 cache 7 has been hit, data is transferred from the L3 cache 7 to the processor core 2 via the L1 cache 3 (step S34). If it is determined that the L3 cache 7 has missed, data is transferred from the main memory 5 to the processor core 2 via the L1 cache 3 (step S35). At this time, data from the main memory 5 is not transferred to the L3 cache 7.

ステップS34またはS35の処理が終了すると、次に、優先度取得部15は、L3キャッシュ7内の第2タグ領域7aから優先度情報を取得して、L2キャッシュコントローラ6に送信する(ステップS36)。   When the process of step S34 or S35 is completed, the priority acquisition unit 15 then acquires priority information from the second tag area 7a in the L3 cache 7 and transmits it to the L2 cache controller 6 (step S36). .

次に、L2キャッシュコントローラ6内の優先度決定部16は、ステップS36で送信されてきた優先度情報に基づいて、L3キャッシュ7またはメインメモリ5から読み出したデータをL2キャッシュ4に格納するか否かを決定する。(ステップS37)。   Next, the priority determination unit 16 in the L2 cache controller 6 stores the data read from the L3 cache 7 or the main memory 5 in the L2 cache 4 based on the priority information transmitted in step S36. To decide. (Step S37).

次に、L2キャッシュコントローラ6は、ステップS37の決定に従って、第2タグ領域7aまたはメインメモリ5から読み出したデータを第1データ領域4aに格納または非格納の制御を行う(ステップS38)。   Next, the L2 cache controller 6 performs control of storing or not storing the data read from the second tag area 7a or the main memory 5 in the first data area 4a according to the determination in step S37 (step S38).

優先度決定部16がステップS37でL2キャッシュ4にデータを格納するか否かを決定するポリシは、図3のステップS7と同様に様々なものが考えられ、どのポリシを選択してもよい。   Various policies for determining whether or not the priority determination unit 16 stores data in the L2 cache 4 in step S37 can be considered as in step S7 of FIG. 3, and any policy may be selected.

L2キャッシュ4にデータを格納する際に、L2キャッシュ4から別のデータを追い出したか否かを判定する(ステップS39)。別のデータを追い出した場合には、追い出したデータをL3キャッシュ7内の第2データ領域7bに格納するとともに、第2タグ領域7a内の優先度情報を更新する(ステップS40)。また、L1キャッシュ3からデータを追い出した際に、L3キャッシュ7内の第2データ領域7bに格納するとともに、第2タグ領域7a内の優先度情報を更新してもよい。L1キャッシュ3からデータを追い出した際に、当該データがL2キャッシュ4に格納されていなければ、L3キャッシュ7内の第2データ領域7bに格納するとともに、第2タグ領域7a内の優先度情報を更新してもよい。   When storing data in the L2 cache 4, it is determined whether or not another data has been expelled from the L2 cache 4 (step S39). When another data is evicted, the evicted data is stored in the second data area 7b in the L3 cache 7, and the priority information in the second tag area 7a is updated (step S40). Further, when data is evicted from the L1 cache 3, it may be stored in the second data area 7b in the L3 cache 7 and the priority information in the second tag area 7a may be updated. When data is evicted from the L1 cache 3, if the data is not stored in the L2 cache 4, it is stored in the second data area 7b in the L3 cache 7, and priority information in the second tag area 7a is stored. It may be updated.

このように、第3の実施形態では、ビクティムキャッシュ方式を採用する場合であっても、L2キャッシュ4に再参照されるデータを優先的に格納することができる。   As described above, in the third embodiment, even when the victim cache method is employed, data that is re-referenced to the L2 cache 4 can be preferentially stored.

上述した第1〜第3の実施形態では、階層化された複数のキャッシュメモリを備えたメモリシステム1について説明したが、本発明は、キャッシュメモリ以外のメモリに幅広く適用可能である。ここで、メモリとは、物理空間のメモリと仮想空間のメモリのいずれも含む趣旨であり、本発明は、例えば、TLB(Translation Lookaside Buffer)やページバッファなどにも適用可能である。   In the first to third embodiments described above, the memory system 1 including a plurality of hierarchical cache memories has been described. However, the present invention can be widely applied to memories other than the cache memory. Here, the term “memory” is intended to include both a physical space memory and a virtual space memory, and the present invention can be applied to, for example, a TLB (Translation Lookaside Buffer), a page buffer, and the like.

(第1タグと第2タグの実装形態)
第1〜第3の実施形態では、簡単化のため、第1タグ領域4bの前提となるセット数と、第2タグ領域4cの前提となるセット数は同じであるものとした。しかしながら、本実施形態は、第1タグ領域4bと第2タグ領域4cのセット数が同じである構成に限定されない。例えば、第1タグ領域4bのセット数が第2タグ領域4cのセット数よりも大きくてもよいし、第1タグ領域4bのセット数が第2タグ領域4cのセット数より小さくてもよい。キャッシュメモリのメモリ容量が同じ場合、セット数が多いキャッシュメモリのタグメモリの1エントリ当たりのデータ量は、セット数が少ないキャッシュメモリのタグメモリの1エントリ当たりのデータ量よりも小さい。従って、例えば、第1タグ領域4bが格納するデータ量よりも第2タグ領域4cが格納するデータ量を大きくしても、第2タグ領域4cのセット数を多くすることで、タグメモリの増加を抑制することが出来る。
(Mounting form of the first tag and the second tag)
In the first to third embodiments, for the sake of simplification, the number of sets that is the premise of the first tag area 4b is the same as the number of sets that is the premise of the second tag area 4c. However, the present embodiment is not limited to a configuration in which the number of sets of the first tag area 4b and the second tag area 4c is the same. For example, the number of sets of the first tag area 4b may be larger than the number of sets of the second tag area 4c, and the number of sets of the first tag area 4b may be smaller than the number of sets of the second tag area 4c. When the memory capacity of the cache memory is the same, the data amount per entry of the tag memory of the cache memory having a large number of sets is smaller than the data amount per entry of the tag memory of the cache memory having a small number of sets. Therefore, for example, even if the data amount stored in the second tag region 4c is larger than the data amount stored in the first tag region 4b, the number of sets of the second tag region 4c is increased, thereby increasing the tag memory. Can be suppressed.

第1〜第3の実施形態では、第2タグ領域4cは第1タグ領域4bより多くの情報を保持する例を示した。しかし、第2タグ領域4cは、第1タグ領域4bよりメモリ容量が小さくてもよい。   In 1st-3rd embodiment, the 2nd tag area | region 4c showed the example holding more information than the 1st tag area | region 4b. However, the second tag area 4c may have a smaller memory capacity than the first tag area 4b.

第1〜第3の実施形態の第1タグ領域4bと第2タグ領域4cは、物理的には統合された1つのタグ領域となっていてもよい。図12に統合された第1タグ領域4bと第2タグ領域4cの例を示す。図12の例では、第1タグ領域4bは、タグアレイ21内の優先度1〜3のアドレス情報と、対応するデータアレイアドレスと、対応する優先度情報を含む。第1データ領域4aは、データアレイ22内のデータ領域のデータを含む。第2タグ領域4cは、タグアレイ21内の優先度1〜5のアドレス情報と、対応する優先度情報とを含む。   The first tag area 4b and the second tag area 4c in the first to third embodiments may be physically integrated into one tag area. FIG. 12 shows an example of the first tag area 4b and the second tag area 4c integrated. In the example of FIG. 12, the first tag area 4b includes address information of priorities 1 to 3 in the tag array 21, corresponding data array addresses, and corresponding priority information. The first data area 4 a includes data in the data area in the data array 22. The second tag area 4c includes address information of priorities 1 to 5 in the tag array 21 and corresponding priority information.

図12の例では、アクセス時に、タグアレイ21内のタグアドレスと対応するデータアドレスとを読み出して、読み出したタグアドレスとアクセスのあったアドレスとを比較し、ヒットすれば、読み出したデータアドレスに対応するデータをデータアレイ22内から読み出す。   In the example of FIG. 12, at the time of access, the tag address in the tag array 21 and the corresponding data address are read, the read tag address is compared with the accessed address, and if it hits, the read data address corresponds. Data to be read is read from the data array 22.

(第1領域と第2領域のデータ粒度が異なる場合)
第1〜第3の実施形態では、簡単化のため、第1タグ領域4bのラインサイズと、第2タグ領域4cのラインサイズは同じであるものとした。しかしながら、本実施形態は、第1タグ領域4bと第2タグ領域4cのラインサイズが同じである構成に限定されない。例えば、第1タグ領域4bのラインサイズが第2タグ領域4cのラインサイズよりも大きくてもよいし、第1タグ領域4bのラインサイズが第2タグ領域4cのラインサイズより小さくてもよい。
(When the data granularity of the first and second areas is different)
In the first to third embodiments, for simplification, the line size of the first tag area 4b and the line size of the second tag area 4c are the same. However, the present embodiment is not limited to the configuration in which the line sizes of the first tag region 4b and the second tag region 4c are the same. For example, the line size of the first tag region 4b may be larger than the line size of the second tag region 4c, or the line size of the first tag region 4b may be smaller than the line size of the second tag region 4c.

例えば、第1タグ領域4bのラインサイズが第2タグ領域4cのラインサイズより小さい実施形態を考える。第2タグ領域4bの1つのエントリが示すデータには、第1タグ領域4bの複数のデータが含まれる。例えば、図13のように、第2タグ領域4bの1つのエントリが示すデータに、第1タグ領域4bの1つのエントリが示すデータが4つ含まれる場合を考える。図13の第1データと第2データの両端に示す数値は、データの先頭アドレスと終端アドレスを示す。この例において、第1〜第3の実施形態で示したように、第2タグ領域4cの1エントリが示すデータのうち、0x0から8バイトのデータにアクセスがあり、次に0x8から8バイトのデータにアクセスがあったとする。この場合、第2タグ領域4cの同一のエントリに連続してアクセスを行っているため、このエントリの優先度が高いと判定し、0x8から8バイトのデータを高優先度データとして第1データ領域4aに書き込むことが想定される。これは、例えば、第2データ領域7bへのアクセスをより詳細にプロファイルする機構(詳細アクセスプロファイラ)を設けることで抑制することが出来る。   For example, consider an embodiment in which the line size of the first tag region 4b is smaller than the line size of the second tag region 4c. The data indicated by one entry in the second tag area 4b includes a plurality of data in the first tag area 4b. For example, as shown in FIG. 13, a case is considered where the data indicated by one entry in the second tag area 4b includes four data indicated by one entry in the first tag area 4b. The numerical values shown at both ends of the first data and the second data in FIG. 13 indicate the head address and the end address of the data. In this example, as shown in the first to third embodiments, among the data indicated by one entry in the second tag area 4c, data of 0 to 8 bytes is accessed, and then 0 to 8 bytes of data is accessed. Assume that data has been accessed. In this case, since the same entry in the second tag area 4c is continuously accessed, it is determined that the priority of this entry is high, and data of 0 to 8 bytes is used as the high priority data in the first data area. 4a is assumed to be written. This can be suppressed, for example, by providing a mechanism (detailed access profiler) that profiles the access to the second data area 7b in more detail.

例えば、図13に示すように、第2タグ領域4c内に、第2データ領域7bの8バイトごとに、1ビットのアクセスフラグ4dを設ける方法が考えられる。この場合、第2タグ領域4cの1エントリ毎に、4ビットのアクセスフラグ4dが設けられることになる。アクセスフラグ4dは、1エントリ内の4つの8バイト領域のうち、どの8バイト領域にアクセスしたかを示す情報である。このアクセスフラグと第2タグ領域4cの優先度情報を用いて、例えば、第2タグ領域4cの優先度が高くてアクセスフラグがセットされている場合に高優先度データとして第1データ領域4aに書き込み、第2タグ領域4cの優先度が高くアクセスフラグがセットされていない場合に低優先度データとして第1データ領域4aに書き込むといったことが考えられる。前述の例を用いて、4ビットのアクセスフラグの動作を示す。初期状態では、例えば、4ビットのアクセスフラグは0にセットされる。0x0から8バイトのアクセスがあると、これに対応するフラグを1にセットする。また、0x0から8バイトのデータが含まれる第2タグ領域4cのエントリの優先度をMRUにセットする。次の0x8から8バイトのデータへのアクセスがあると、第2タグ領域4cのエントリはMRUであるが、アクセス時点では0x8から8バイトに対応するアクセスフラグは0であるため、低優先度データとして第1データ領域4aに書き込む。また、0x8から8バイトのデータに対応するアクセスフラグを1にセットする。   For example, as shown in FIG. 13, a method of providing a 1-bit access flag 4d for every 8 bytes of the second data area 7b in the second tag area 4c is conceivable. In this case, a 4-bit access flag 4d is provided for each entry in the second tag area 4c. The access flag 4d is information indicating which of the four 8-byte areas in one entry is accessed. Using the access flag and the priority information of the second tag area 4c, for example, when the priority of the second tag area 4c is high and the access flag is set, the first data area 4a is set as high priority data. It is conceivable that data is written to the first data area 4a as low priority data when the priority of the second tag area 4c is high and the access flag is not set. The operation of the 4-bit access flag will be described using the above example. In the initial state, for example, the 4-bit access flag is set to 0. If there is an 8-byte access from 0x0, the corresponding flag is set to 1. Also, the priority of the entry in the second tag area 4c including 8 bytes of data from 0x0 is set in the MRU. If there is access to 8 bytes of data from the next 0x8, the entry in the second tag area 4c is MRU, but the access flag corresponding to 8 bytes from 0x8 is 0 at the time of access, so low priority data Is written in the first data area 4a. In addition, an access flag corresponding to data of 0 to 8 bytes is set to 1.

例えば、第2タグ領域4cの1エントリ毎に、近い時間帯に第2タグ領域4cのどの位置にアクセスがあったかを示すアクセスアドレス情報をいくつか保持する方法が考えられる。第2タグ領域4cの同一エントリに連続してアクセスがあった場合に、アクセスアドレス情報を用いて、例えば、第2タグ領域4cでの優先度が高くアクセスアドレス情報が存在する場合に高優先度データとして第1データ領域4aに書き込み、第2タグ領域4cの優先度が高くアクセスアドレス情報が存在しない場合に低優先度データとして第1データ領域4aに書き込む。同一エントリへの連続しないアクセスの場合に、第2タグ領域4cの優先度が高いときはアクセスアドレス情報に関わらず第1データ領域4aに高優先度データとして書き込み、第2タグ領域4cの優先度が低いときにはアクセスアドレス情報に関わらず第1データ領域4aに低優先度データとして書き込む。連続するアクセスかどうかは、例えば、第2タグ領域4cの優先度から判断してもよい。例えば、アクセスのあったデータがMRUであれば、連続するアクセスであると判断し、そうでなければ、連続していないアクセスであると判断してもよい。前述の例を用いて、アクセスアドレス情報の動作を示す。簡単化のため、1つのアクセスアドレス情報を保持する例を示す。まず0x0から8バイトのデータへのアクセスがあると、優先度更新部12は、対応するエントリの優先度をMRUにセットし、第2タグ領域4cのエントリ内に存在するアクセスアドレス情報に0x0をセットする。次に0x8から8バイトのデータへのアクセスがあると、優先度取得部15は、第2タグ領域4cの優先度とアクセスアドレス情報を取得する。第2タグ領域4cの優先度がMRUであるが、アクセスアドレス情報は0x0で、0x8と異なるため、低優先度データとして第1データ領域4cに書き込む。最後に、アクセスアドレス情報を0x8で上書きする。   For example, for each entry in the second tag area 4c, a method of holding some access address information indicating which position in the second tag area 4c was accessed in a near time zone is conceivable. When there is continuous access to the same entry in the second tag area 4c, the access address information is used. For example, when the priority in the second tag area 4c is high and the access address information exists, the high priority Data is written to the first data area 4a, and when the priority of the second tag area 4c is high and there is no access address information, it is written to the first data area 4a as low priority data. In the case of non-consecutive access to the same entry, if the priority of the second tag area 4c is high, it is written as high priority data in the first data area 4a regardless of the access address information, and the priority of the second tag area 4c Is low, data is written as low priority data in the first data area 4a regardless of the access address information. Whether the access is continuous may be determined from the priority of the second tag area 4c, for example. For example, if the accessed data is MRU, it may be determined that the access is continuous, and if not, it may be determined that the access is not continuous. The operation of the access address information will be described using the above example. For simplification, an example in which one piece of access address information is held is shown. First, when there is access to data of 8 bytes from 0x0, the priority update unit 12 sets the priority of the corresponding entry to MRU, and sets 0x0 to access address information existing in the entry of the second tag area 4c. set. Next, when there is an access to data of 8 bytes from 0x8, the priority acquisition unit 15 acquires the priority and access address information of the second tag area 4c. Although the priority of the second tag area 4c is MRU, the access address information is 0x0, which is different from 0x8, so it is written in the first data area 4c as low priority data. Finally, the access address information is overwritten with 0x8.

(ショートリテンション技術との組み合わせ)
上述した第1〜第3の実施形態は、ショートリテンション技術と組み合わせることが可能である。ショートリテンション技術とは、例えばMRAMにおいて、少なくとも、2つの書き込み手段を備えることを言う。例えば、高エネルギーでの書き込みを行い長時間のリテンションを実現する第1の書き込み手段と、短時間のリテンションであるものの低エネルギーでの書き込みを行い省エネルギーを実現する第2の書き込み手段を備えることをいう。例えば、第1〜第3の実施形態で、第2タグ領域4cから得られた優先度が高ければ、第1データ領域4aに第1の書き込み手段で書き込みを行い、第2タグ領域4cから得られた優先度が低ければ、第1データ領域4aに第2の書き込み手段で書き込みを行う、といった形態が考えられる。
(Combination with short retention technology)
The first to third embodiments described above can be combined with a short retention technique. The short retention technique means that, for example, in an MRAM, at least two writing units are provided. For example, a first writing unit that performs writing with high energy and realizes long-term retention, and a second writing unit that realizes energy saving by performing writing with low energy although it is a short-time retention. Say. For example, in the first to third embodiments, if the priority obtained from the second tag area 4c is high, the first data area 4a is written by the first writing means and obtained from the second tag area 4c. If the given priority is low, a mode in which the second data is written to the first data area 4a can be considered.

(コヒーレンシ)
第1〜第3の実施形態で説明したキャッシュメモリに、MESIプロトコルのようなコヒーレンシに関する状態を保持する場合は、コヒーレンシの状態を第2タグ領域4cにも格納してもよい。コヒーレンシの状態を第2タグ領域4cのみに格納してもよい。例えば、第2タグ領域4cの優先度情報に基づき、第1データ領域4aへ書き込まない場合等に、上位階層に転送したデータに対応する第2タグ領域4cのエントリにコヒーレンシに関する状態を保持する。例えば、第1タグ領域4bが第2タグ領域4cより小さい場合に、第2タグ領域4cで多くのデータのコヒーレンシに関する状態を保持することが出来る。具体的な動作としては、例えば、当該キャッシュの上位階層でのデータ書き換え情報を当該キャッシュに送付し、第2タグ領域4c内の当該エントリのコヒーレンシに関する状態をModifyに変更する。または、第1タグ領域4bに、第1データ領域4cに格納するデータのアドレス以外を格納する領域を設け、当該領域にコヒーレンシに関する状態を格納してもよい。
(Coherency)
When the cache memory described in the first to third embodiments holds a state related to coherency such as the MESI protocol, the state of coherency may be stored in the second tag area 4c. The coherency state may be stored only in the second tag area 4c. For example, based on the priority information of the second tag area 4c, the state relating to coherency is held in the entry of the second tag area 4c corresponding to the data transferred to the upper layer when not written to the first data area 4a. For example, when the first tag area 4b is smaller than the second tag area 4c, the second tag area 4c can hold a state relating to a lot of data coherency. As a specific operation, for example, data rewrite information in the upper hierarchy of the cache is sent to the cache, and the state regarding the coherency of the entry in the second tag area 4c is changed to Modify. Alternatively, an area for storing data other than the address of data stored in the first data area 4c may be provided in the first tag area 4b, and a state related to coherency may be stored in the area.

(動的手法)
第2タグ領域4cの優先度情報に基づいた第1データ領域4aへの格納ポリシを動的に制御してもよい。例えば、第2タグ領域4cで、アドレス毎にアクセス頻度情報を取得し、優先度情報とアクセス頻度情報により第1データ領域4aへの格納ポリシを決定してもよい。例えば、第2タグ領域4cでの優先度が高くアクセス頻度が高いデータを第1データ領域4aに格納し、第2タグ領域4cでの優先度が高くアクセス頻度が低いデータの第1データ領域4aへの格納を禁止する。アクセス頻度情報としては、例えば、単位時間あたりのヒット回数がある。単位時間とは、例えば、単位実行サイクル数や単位実行命令数や単位キャッシュアクセス回数といったものである。例えば、一般的なLRUでは、優先度決定にアクセス頻度が考慮されていないため、このような制御が有効である場合がある。第2データ領域7bでの優先度決定にアクセス頻度が考慮されていれば、このような制御を必ずしも行わなくてもよい。
(Dynamic method)
The storage policy in the first data area 4a based on the priority information of the second tag area 4c may be dynamically controlled. For example, the access frequency information may be acquired for each address in the second tag area 4c, and the storage policy in the first data area 4a may be determined based on the priority information and the access frequency information. For example, data having a high priority and high access frequency in the second tag area 4c is stored in the first data area 4a, and data having a high priority and low access frequency in the second tag area 4c is stored. Prohibit storage in The access frequency information includes, for example, the number of hits per unit time. The unit time is, for example, the number of unit execution cycles, the number of unit execution instructions, or the number of unit cache accesses. For example, in general LRU, since the access frequency is not considered in the priority determination, such control may be effective. If the access frequency is considered in the priority determination in the second data area 7b, such control is not necessarily performed.

図3のステップS1,S2、図8のステップS21,S23、および図11のステップS31,S33では、第1ヒット判定部13でミスしたときに第2ヒット判定部14の判定処理を行っているが、第1ヒット判定部13と第2ヒット判定部14の処理を並行して行ってもよい。   In steps S1 and S2 of FIG. 3, steps S21 and S23 of FIG. 8, and steps S31 and S33 of FIG. 11, when the first hit determination unit 13 makes a mistake, the determination process of the second hit determination unit 14 is performed. However, the processes of the first hit determination unit 13 and the second hit determination unit 14 may be performed in parallel.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

1 メモリシステム、2 プロセッサコア、3 L1キャッシュ、4 L2キャッシュ、4a 第1データ領域、4b 第1タグ領域、4c 第2タグ領域、
5 メインメモリ、6 L2キャッシュコントローラ、11 アクセス情報送信部、12 優先度更新部、13 第1ヒット判定部、14 第2ヒット判定部、15 優先度取得部、16 優先度決定部、17 アクセス制御部、
1 memory system, 2 processor core, 3 L1 cache, 4 L2 cache, 4a first data area, 4b first tag area, 4c second tag area,
5 main memory, 6 L2 cache controller, 11 access information transmission unit, 12 priority update unit, 13 first hit determination unit, 14 second hit determination unit, 15 priority acquisition unit, 16 priority determination unit, 17 access control Part,

Claims (19)

データを格納する第1データ領域と、
前記第1データ領域に格納されたデータに対応するアドレス情報を格納する第1タグ領域と、
アドレス情報と優先度情報とを対応づけて格納する第2タグ領域と、
前記不揮発メモリに対するアクセス情報を送信するアクセス情報送信部と、
前記アクセス情報に基づいて、前記第2タグ領域内の前記優先度情報を更新する優先度更新部と、
読出対象のデータのアドレス情報が前記第1タグ領域に格納されているか否かを判定する第1ヒット判定部と、
前記読出対象のデータのアドレス情報が前記第2タグ領域に格納されているか否かを判定する第2ヒット判定部と、
前記第2ヒット判定部による判定結果に基づいて、前記読出対象のデータを前記第1データ領域に格納するか否かに関する格納制御情報を決定する決定部と、
前記格納制御情報に基づいて前記決定部が前記読出し対象のデータを前記第1データ領域に格納することを決定すると、前記第1データ領域よりアクセス優先度の低い第2データ領域から読み出した前記読出対象のデータを前記第1データ領域に格納する制御を行うアクセス制御部と、を備えるメモリシステム。
A first data area for storing data;
A first tag area for storing address information corresponding to the data stored in the first data area;
A second tag area for storing address information and priority information in association with each other;
An access information transmitter for transmitting access information to the nonvolatile memory;
A priority update unit that updates the priority information in the second tag area based on the access information;
A first hit determination unit for determining whether address information of data to be read is stored in the first tag area;
A second hit determination unit for determining whether address information of the data to be read is stored in the second tag area;
A determination unit that determines storage control information related to whether to store the data to be read in the first data area based on a determination result by the second hit determination unit;
When the determination unit determines to store the data to be read in the first data area based on the storage control information, the read from the second data area having a lower access priority than the first data area An access control unit that performs control to store target data in the first data area.
前記第2タグ領域は、第1優先度と、当該第1優先度よりも低い第2優先度との少なくとも2種類の優先度の優先度情報を含んでおり、
前記第2ヒット判定部により、前記第2タグ領域に格納されていると判定された場合には、前記読出し対象データのアドレス情報に対応する優先度情報を前記第2タグ領域から取得する優先度取得部を備え、
前記決定部は、前記優先度情報に基づいて、前記読出対象のデータを前記第1データ領域に格納するか否かに関する格納制御情報を決定する請求項1に記載のメモリシステム。
The second tag area includes priority information of at least two types of priority, a first priority and a second priority lower than the first priority.
Priority for acquiring priority information corresponding to the address information of the read target data from the second tag area when the second hit determination unit determines that the second hit area is stored in the second tag area With an acquisition unit,
The memory system according to claim 1, wherein the determination unit determines storage control information related to whether to store the data to be read in the first data area based on the priority information.
前記第1タグ領域は、前記第1データ領域に格納されたデータに対応するアドレス情報と、優先度情報とを対応づけて格納し、
前記第1タグ領域の前記優先度情報は、第3優先度と、当該第3優先度よりも低い第4優先度との少なくとも2種類の優先度の優先度情報を含んでおり、
前記決定部は、前記読出対象のデータを前記第2データ領域から読み出して前記第1データ領域に格納する際には、対応する前記第2タグ領域内の優先度情報に基づいて、前記第1タグ領域に格納されるアドレス情報の優先度情報を決定する請求項1または2に記載のメモリシステム。
The first tag area stores address information corresponding to data stored in the first data area and priority information in association with each other,
The priority information of the first tag area includes priority information of at least two types of priority, that is, a third priority and a fourth priority lower than the third priority.
The determination unit reads the data to be read from the second data area and stores the data in the first data area based on the priority information in the corresponding second tag area. 3. The memory system according to claim 1, wherein priority information of address information stored in the tag area is determined.
前記決定部は、前記第2ヒット判定部により、前記第2タグ領域に格納されていないと判定された場合には、前記読出し対象のデータを前記第1データ領域に格納することを禁止する格納制御情報を選択する請求項1乃至3のいずれか1項に記載のメモリシステム。   The determination unit prohibits storing the data to be read out in the first data area when the second hit determination unit determines that the data is not stored in the second tag area. The memory system according to claim 1, wherein control information is selected. 前記決定部は、前記優先度取得部により取得された優先度情報が前記第2タグ領域内の前記第1優先度の優先度情報の場合には、前記読み出し対象のデータを前記第1データ領域に格納し、前記優先度取得部により取得された優先度情報が前記第2タグ領域内の前記第2優先度の優先度情報の場合には、前記読出し対象のデータを前記第1データ領域に格納することを禁止する格納制御情報を選択する請求項2または3に記載のメモリシステム。   When the priority information acquired by the priority acquisition unit is the priority information of the first priority in the second tag area, the determination unit determines the data to be read out as the first data area. And when the priority information acquired by the priority acquisition unit is the priority information of the second priority in the second tag area, the data to be read is stored in the first data area. 4. The memory system according to claim 2, wherein storage control information that prohibits storage is selected. 前記決定部は、前記第2ヒット判定部により、前記第2タグ領域に格納されていないと判定された場合には、前記読出し対象のデータを前記第1データ領域に格納するとともに、前記第1タグ領域に前記第2優先度の優先度情報を格納する格納制御情報を選択する請求項2または3に記載のメモリシステム。   The determination unit stores the data to be read in the first data area and the first data area when the second hit determination unit determines that the second hit area is not stored in the second tag area. 4. The memory system according to claim 2, wherein storage control information for storing the priority information of the second priority is selected in a tag area. 前記決定部は、前記優先度取得部により取得された優先度情報が前記第2タグ領域内の前記第1優先度の優先度情報の場合には、前記読み出し対象のデータを前記第1データ領域に格納するとともに、前記第1タグ領域に前記第1優先度の優先度情報を格納する格納制御情報を選択し、前記優先度取得部により取得された優先度情報が前記第2タグ領域内の前記第2優先度の優先度情報の場合には、前記読出し対象のデータを前記第1データ領域に格納するとともに、前記第1タグ領域に前記第2優先度の優先度情報を格納する格納制御情報を選択する、請求項2または3に記載のメモリシステム。   When the priority information acquired by the priority acquisition unit is the priority information of the first priority in the second tag area, the determination unit determines the data to be read out as the first data area. And storing control information for storing the priority information of the first priority in the first tag area, and the priority information acquired by the priority acquisition unit is stored in the second tag area. In the case of the priority information of the second priority, storage control for storing the data to be read in the first data area and storing the priority information of the second priority in the first tag area 4. The memory system according to claim 2, wherein information is selected. 前記アクセス制御部は、前記第1タグ領域に前記第3優先度の優先度情報を格納するべきデータを、第1書き込み手段により前記第1データ領域に格納し、前記第1タグ領域に前記第4優先度の優先度情報を格納するべきデータを、第2書き込み手段により前記第1データ領域に格納する、請求項2または3に記載のメモリシステム。   The access control unit stores data for storing priority information of the third priority in the first tag area in the first data area by a first writing unit, and stores the data in the first tag area in the first tag area. 4. The memory system according to claim 2, wherein data for storing priority information of four priorities is stored in the first data area by a second writing means. 前記第1データ領域、前記第1タグ領域および前記第2タグ領域を有する第1メモリと、
前記第2データ領域を有し、前記第1メモリよりアクセス優先度の低い第2メモリと、を備える請求項1乃至8のいずれか1項に記載のメモリシステム。
A first memory having the first data area, the first tag area and the second tag area;
The memory system according to claim 1, further comprising: a second memory having the second data area and having a lower access priority than the first memory.
前記第1データ領域および前記第1タグ領域を有する第1メモリと、
前記第2データ領域および前記第2タグ領域を有し、前記第1メモリよりアクセス優先度の低い第2メモリと、を備える請求項1乃至8のいずれか1項に記載のメモリシステム。
A first memory having the first data area and the first tag area;
9. The memory system according to claim 1, further comprising: a second memory having the second data area and the second tag area and having a lower access priority than the first memory.
前記第1メモリおよび前記第2メモリは、それぞれ階層が異なるキャッシュメモリである請求項9または10に記載のメモリシステム。   The memory system according to claim 9 or 10, wherein the first memory and the second memory are cache memories having different hierarchies. 前記優先度更新部は、前記第1メモリへのアクセス毎に、前記第2タグ領域内の少なくとも一部の優先度情報を更新する請求項9に記載のメモリシステム。   The memory system according to claim 9, wherein the priority update unit updates at least a part of the priority information in the second tag area every time the first memory is accessed. 前記優先度更新部は、前記第2メモリに対して当該第2メモリと階層が異なるメモリのデータを追い出す場合に、前記第2タグ領域内の少なくとも一部の優先度情報を更新する請求項10または11に記載のメモリシステム。   11. The priority update unit updates at least a part of priority information in the second tag area when data of a memory having a different hierarchy from the second memory is expelled from the second memory. Or the memory system according to 11; 前記第1タグ領域を格納する第1メモリと、
前記第2タグ領域を格納する第2メモリと、を備える、
請求項1に記載のメモリシステム。
A first memory for storing the first tag area;
A second memory for storing the second tag area,
The memory system according to claim 1.
前記第1タグ領域と前記第2タグ領域は、共通のメモリに格納される、
請求項1に記載のメモリシステム。
The first tag area and the second tag area are stored in a common memory;
The memory system according to claim 1.
前記第1タグ領域の1エントリ分のアドレス情報のサイズは、前記第2タグ領域の1エントリ分のアドレス情報のサイズと異なる請求項1に記載のメモリシステム。   The memory system according to claim 1, wherein the size of the address information for one entry in the first tag area is different from the size of the address information for one entry in the second tag area. 前記第1データ領域の1エントリ分のデータ量と、前記第2データ領域の1エントリ分のデータ量とが異なっており、
前記第2タグ領域は、前記第2データ領域内のアクセス位置を示すフラグ情報を格納し、
前記決定部は、前記フラグ情報に基づいて、格納制御情報を決定する、請求項1に記載のメモリシステム。
The data amount for one entry in the first data area is different from the data amount for one entry in the second data area;
The second tag area stores flag information indicating an access position in the second data area,
The memory system according to claim 1, wherein the determination unit determines storage control information based on the flag information.
前記第1データ領域は、不揮発メモリを含む請求項1乃至17のいずれか1項に記載のメモリシステム。   The memory system according to claim 1, wherein the first data area includes a nonvolatile memory. 前記不揮発メモリは、MRAM(Magnetoresistive Random Access Memory)である請求項18に記載のメモリシステム。   The memory system according to claim 18, wherein the nonvolatile memory is an MRAM (Magnetoresistive Random Access Memory).
JP2015183177A 2015-09-16 2015-09-16 Memory system Active JP6140233B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015183177A JP6140233B2 (en) 2015-09-16 2015-09-16 Memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015183177A JP6140233B2 (en) 2015-09-16 2015-09-16 Memory system

Publications (2)

Publication Number Publication Date
JP2017058951A true JP2017058951A (en) 2017-03-23
JP6140233B2 JP6140233B2 (en) 2017-05-31

Family

ID=58391603

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015183177A Active JP6140233B2 (en) 2015-09-16 2015-09-16 Memory system

Country Status (1)

Country Link
JP (1) JP6140233B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019200473A (en) * 2018-05-14 2019-11-21 富士通株式会社 Memory control apparatus, memory control program, and memory control method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355365A (en) * 2003-05-29 2004-12-16 Fujitsu Ltd Cache management device and cache memory management method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355365A (en) * 2003-05-29 2004-12-16 Fujitsu Ltd Cache management device and cache memory management method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019200473A (en) * 2018-05-14 2019-11-21 富士通株式会社 Memory control apparatus, memory control program, and memory control method
JP7132491B2 (en) 2018-05-14 2022-09-07 富士通株式会社 MEMORY CONTROL DEVICE, MEMORY CONTROL PROGRAM AND MEMORY CONTROL METHOD

Also Published As

Publication number Publication date
JP6140233B2 (en) 2017-05-31

Similar Documents

Publication Publication Date Title
JP6118285B2 (en) Cache memory system and processor system
JP2017138852A (en) Information processing device, storage device and program
US10120750B2 (en) Cache memory, error correction circuitry, and processor system
US10031854B2 (en) Memory system
JP6027562B2 (en) Cache memory system and processor system
US20110161597A1 (en) Combined Memory Including a Logical Partition in a Storage Memory Accessed Through an IO Controller
JP6088951B2 (en) Cache memory system and processor system
US20130262767A1 (en) Concurrently Accessed Set Associative Overflow Cache
US20120297140A1 (en) Expandable data cache
US10564871B2 (en) Memory system having multiple different type memories with various data granularities
US20140047175A1 (en) Implementing efficient cache tag lookup in very large cache systems
US10970208B2 (en) Memory system and operating method thereof
JP2016170729A (en) Memory system
JP6140233B2 (en) Memory system
US20160378671A1 (en) Cache memory system and processor system
CN115617709A (en) Cache management method and device, cache device, electronic device and medium
US11822481B2 (en) Semiconductor device and method for controlling semiconductor device
US11321243B2 (en) Data storage device including a semiconductor device managing address mapping of a semiconductor memory device
JP2019164411A (en) Management device, information processing device, management method, and program
US11669450B2 (en) Computer including cache used in plural different data sizes and control method of computer
JP7024127B2 (en) Management equipment, information processing equipment, management methods, and programs

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161216

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170404

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170428

R151 Written notification of patent or utility model registration

Ref document number: 6140233

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350