JP2024011696A - Arithmetic processing apparatus and arithmetic processing method - Google Patents

Arithmetic processing apparatus and arithmetic processing method Download PDF

Info

Publication number
JP2024011696A
JP2024011696A JP2022113918A JP2022113918A JP2024011696A JP 2024011696 A JP2024011696 A JP 2024011696A JP 2022113918 A JP2022113918 A JP 2022113918A JP 2022113918 A JP2022113918 A JP 2022113918A JP 2024011696 A JP2024011696 A JP 2024011696A
Authority
JP
Japan
Prior art keywords
data
cache
unit
speculative
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2022113918A
Other languages
Japanese (ja)
Inventor
汐 中原
Shio Nakahara
隆英 吉川
Takahide Yoshikawa
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2022113918A priority Critical patent/JP2024011696A/en
Publication of JP2024011696A publication Critical patent/JP2024011696A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

To provide an arithmetic processing apparatus and an arithmetic processing method for improving efficiency of data transfer.SOLUTION: A storage unit 134 stores data. On receipt of a data access request from an arithmetic unit or a superior cache, a control unit 131 accesses target data when the target data of the data access request exists in the storage unit 134, or acquires the target data when the target data does not exist in the storage unit 134, from a subordinate cache or a main memory and stores the target data in the storage unit 134. A cache miss information update unit 132 calculates the number of occurrences of cache miss indicating that the target data does not exist in the storage unit 134. A speculative prefetch unit 133 acquires speculative data based on the number of occurrences from the main memory or the subordinate cache, and stores the acquired speculative data in the storage unit 134.SELECTED DRAWING: Figure 2

Description

本発明は、演算処理装置及び演算処理方法に関する。 The present invention relates to an arithmetic processing device and an arithmetic processing method.

近年、プロセッサの動作周波数が飛躍的に向上している。これに対し、メインメモリとして一般的に使用されるDRAM(Dynamic Random Access Memory)の動作速度の向上は低調であり、プロセッサの性能を十分に活かすためにデータ転送を効率化するアーキテクチャの技術研究が盛んである。情報処理装置では、一般に、メインメモリよりもデータアクセスが高速なキャッシュメモリをCPU(Central Processing Unit)に配置する。そして、このキャッシュメモリ上に、最近参照したデータを置くことによって、メインメモリ参照によるレイテンシの低減が図られる。 In recent years, the operating frequency of processors has improved dramatically. On the other hand, improvements in the operating speed of DRAM (Dynamic Random Access Memory), which is commonly used as main memory, have been slow, and technical research into architectures that make data transfer more efficient is needed to take full advantage of processor performance. It's thriving. In an information processing device, a cache memory whose data access is faster than a main memory is generally arranged in a CPU (Central Processing Unit). By placing recently referenced data on this cache memory, latency due to main memory reference can be reduced.

ただし、レイテンシの低減のためのキャッシュメモリの配置が効果的に働くためには、キャッシュメモリ上に参照するデータが格納されていることが条件となる。キャッシュメモリ上に参照するデータが無ければ、メインメモリへのアクセスが発生してしまうため、キャッシュメモリを配置した場合であっても、データ転送速度が演算速度のボトルネックとなる。そこで、プリフェッチなどでデータを効率的にキャッシュメモリに格納することで、データ転送速度の向上が図られている。 However, in order for the arrangement of the cache memory to reduce latency to be effective, it is necessary that the data to be referenced is stored in the cache memory. If there is no data to be referenced on the cache memory, an access to the main memory will occur, so even if a cache memory is provided, the data transfer speed becomes a bottleneck in the calculation speed. Therefore, attempts are being made to improve the data transfer speed by efficiently storing data in a cache memory using prefetching or the like.

なお、キャッシュ管理の技術として、キャッシュが連携置換ポリシによって管理されるダイレクトマップ部分とマルチウェイ部分とを含み、マルチウェイ部分をダイレクトマップ部分のためのビクティムキャッシュとして機能させる技術が提案されている。ビクティムキャッシュとは、キャッシュから追い出されたデータを書き込むためのキャッシュである。また、キャッシュから追い出されたエントリをメインメモリに書き戻す前に一時的にライトバッファに保存し、要求されたデータがライトバッファにあれば、そのデータをキャッシュに戻す技術が提案されている。また、条件分岐予測でどの分岐を取るかを予測し、予測に基づいてメモリを検索して予測が正しければ次の命令はすでにフェッチされているが、予測が間違っている場合は、条件分岐が実際に解決されるまで、投機的にフェッチしておく技術が提案されている。また、メモリ内のWork領域に転送されたデータをキャッシュ内の特定キャッシュ領域へ格納してデータ処理を行い、その後に特定のキャッシュからデータを追い出す動作を繰り返して、局所性の高いデータをキャッシュメモリに残す技術が提案されている。 As a cache management technique, a technique has been proposed in which the cache includes a direct map part and a multiway part managed by a cooperative replacement policy, and the multiway part functions as a victim cache for the direct map part. A victim cache is a cache for writing data evicted from the cache. Furthermore, a technique has been proposed in which an entry evicted from the cache is temporarily stored in a write buffer before being written back to the main memory, and if the requested data is in the write buffer, the data is returned to the cache. Also, conditional branch prediction predicts which branch to take, searches memory based on the prediction, and if the prediction is correct, the next instruction has already been fetched, but if the prediction is wrong, the conditional branch is Techniques have been proposed in which the problem is fetched speculatively until it is actually resolved. In addition, the data transferred to the work area in memory is stored in a specific cache area in the cache for data processing, and then the operation of evicting the data from the specific cache is repeated to store highly localized data in the cache memory. A technique has been proposed to leave the

特表2018-512650号公報Special table 2018-512650 publication 特開平08-314802号公報Japanese Patent Application Publication No. 08-314802 米国特許出願公開第2018/0322059号明細書US Patent Application Publication No. 2018/0322059 特開2011-86131号公報JP2011-86131A

しかしながら、疎行列演算などの不規則アクセスが多い演算では、将来のデータアクセス予測が難しい。例えば、疎行列ベクトル積演算(SpMV:Sparse Matrix-Vector multiplication)におけるベクトルデータなどは、どのデータが将来利用されるかを予測することは非常に困難である。将来のデータアクセス予測に失敗すると、プリフェッチによってデータを効率的にキャッシュメモリに格納することが難しく、データ転送を効率化することは困難となる。また、上述したいずれの技術であっても、不規則アクセスが多い演算において効率的なプリフェッチを実現することは難しく、データ転送を効率化することは困難である。 However, in operations that involve many irregular accesses, such as sparse matrix operations, it is difficult to predict future data accesses. For example, it is very difficult to predict which data will be used in the future, such as vector data in sparse matrix-vector multiplication (SpMV). If future data access prediction fails, it becomes difficult to efficiently store data in the cache memory by prefetching, and it becomes difficult to improve the efficiency of data transfer. Furthermore, with any of the techniques described above, it is difficult to implement efficient prefetching in operations that involve many irregular accesses, and it is difficult to improve the efficiency of data transfer.

開示の技術は、上記に鑑みてなされたものであって、データ転送を効率化する演算処理装置及び演算処理方法を提供することを目的とする。 The disclosed technology has been developed in view of the above, and aims to provide an arithmetic processing device and an arithmetic processing method that improve the efficiency of data transfer.

本願の開示する演算処理装置及び演算処理方法の一つの態様において、演算処理装置は、演算部、メインメモリ及び1つ又は階層化された複数のキャッシュを有する。前記キャッシュの少なくとも1つは、以下の各部を備える。記憶部は、データを格納する。制御部は、前記演算部又は上位キャッシュからデータアクセス要求を受けて、前記データアクセス要求の対象データが前記記憶部に存在する場合に前記対象データにアクセスする。また前記制御部は、前記対象データが前記記憶部に存在しない場合に前記対象データを下位キャッシュ又は前記メインメモリから取得して前記記憶部に格納する。情報管理部は、前記対象データが前記記憶部に存在しないことを示すキャッシュミスの発生回数を算出する。投機的プリフェッチ部は、前記発生回数を基に投機的データを前記メインメモリ又は前記下位キャッシュから取得して、取得した前記投機的データを前記記憶部に格納する。 In one aspect of the arithmetic processing device and the arithmetic processing method disclosed in the present application, the arithmetic processing device includes a calculation unit, a main memory, and one or a plurality of hierarchical caches. At least one of the caches includes the following parts. The storage unit stores data. The control unit receives a data access request from the calculation unit or the upper cache, and accesses the target data when the target data of the data access request exists in the storage unit. Further, when the target data does not exist in the storage unit, the control unit acquires the target data from the lower cache or the main memory and stores it in the storage unit. The information management unit calculates the number of occurrences of a cache miss indicating that the target data does not exist in the storage unit. The speculative prefetch unit acquires speculative data from the main memory or the lower cache based on the number of occurrences, and stores the acquired speculative data in the storage unit.

1つの側面では、本発明は、データ転送を効率化することができる。 In one aspect, the present invention can streamline data transfer.

図1は、情報処理装置の全体構成を示す概略図である。FIG. 1 is a schematic diagram showing the overall configuration of an information processing device. 図2は、実施例1に係るL1及びL2キャッシュのブロック図である。FIG. 2 is a block diagram of L1 and L2 caches according to the first embodiment. 図3は、メモリアドレスの一例を示す図である。FIG. 3 is a diagram showing an example of memory addresses. 図4は、キャッシュミス情報の一例の図である。FIG. 4 is a diagram of an example of cache miss information. 図5は、実施例1に係る制御部によるデータキャッシュ処理のフローチャートである。FIG. 5 is a flowchart of data cache processing by the control unit according to the first embodiment. 図6は、キャッシュミス情報更新部によるキャッシュミス情報の更新処理のフローチャートである。FIG. 6 is a flowchart of the cache miss information update process by the cache miss information update unit. 図7は、投機的プリフェッチ部による投機的プリフェッチ処理のフローチャートである。FIG. 7 is a flowchart of speculative prefetch processing by the speculative prefetch unit. 図8は、実施例2に係るL2キャッシュのブロック図である。FIG. 8 is a block diagram of the L2 cache according to the second embodiment. 図9は、実施例2に係るキャッシュ情報の構成を示す図である。FIG. 9 is a diagram showing the configuration of cache information according to the second embodiment. 図10は、実施例2に係る制御部によるデータキャッシュ処理のフローチャートである。FIG. 10 is a flowchart of data cache processing by the control unit according to the second embodiment. 図11は、データモニタ部によるデータ格納処理のフローチャートである。FIG. 11 is a flowchart of data storage processing by the data monitor section. 図12は、MRAMをビクティムキャッシュとして用いる場合のデータキャッシュ処理のフローチャートである。FIG. 12 is a flowchart of data cache processing when MRAM is used as a victim cache.

以下に、本願の開示する演算処理装置及び演算処理方法の実施例を図面に基づいて詳細に説明する。なお、以下の実施例により本願の開示する演算処理装置及び演算処理方法が限定されるものではない。 Embodiments of the arithmetic processing device and the arithmetic processing method disclosed in the present application will be described in detail below with reference to the drawings. Note that the following embodiments do not limit the arithmetic processing device and the arithmetic processing method disclosed in the present application.

図1は、情報処理装置の全体構成を示す概略図である。図1に示すように、情報処理装置1は、演算部11、L1キャッシュ12、L2キャッシュ13、L3キャッシュ14、メインメモリ15、補助記憶装置16、表示装置17及び入力装置18を有する。演算部11は、L1キャッシュ12、L2キャッシュ13、L3キャッシュ14、メインメモリ15、補助記憶装置16、表示装置17及び入力装置18のそれぞれとバスで接続される。演算部11、L1キャッシュ12、L2キャッシュ13及びL3キャッシュ14は、例えば、演算処理装置であるCPU10に搭載される。 FIG. 1 is a schematic diagram showing the overall configuration of an information processing device. As shown in FIG. 1, the information processing device 1 includes a calculation unit 11, an L1 cache 12, an L2 cache 13, an L3 cache 14, a main memory 15, an auxiliary storage device 16, a display device 17, and an input device 18. The calculation unit 11 is connected to each of the L1 cache 12, L2 cache 13, L3 cache 14, main memory 15, auxiliary storage device 16, display device 17, and input device 18 via a bus. The calculation unit 11, the L1 cache 12, the L2 cache 13, and the L3 cache 14 are installed, for example, in the CPU 10, which is a calculation processing device.

演算部11は、例えば、CPU(Central Processing Unit)コアである。演算部11は、補助記憶装置16に格納された各種プログラムなどを読み出してメインメモリ15に展開して、L1キャッシュ12、L2キャッシュ13、L3キャッシュ14及びメインメモリ15に格納されたデータを用いて演算を実行する。 The calculation unit 11 is, for example, a CPU (Central Processing Unit) core. The calculation unit 11 reads various programs stored in the auxiliary storage device 16, develops them in the main memory 15, and uses the data stored in the L1 cache 12, L2 cache 13, L3 cache 14, and main memory 15. Perform calculations.

L1キャッシュ12は、動作速度が速く且つL2キャッシュ12及びL3キャッシュ14と比べて容量の小さいキャッシュメモリであり、演算部11によるデータアクセス時に最初に読み込まれるキャッシュメモリである。L1キャッシュ12は、例えば、SRAM(Static Random Access Memory)である。 The L1 cache 12 is a cache memory that has a high operating speed and a smaller capacity than the L2 cache 12 and the L3 cache 14, and is the cache memory that is read first when data is accessed by the calculation unit 11. The L1 cache 12 is, for example, SRAM (Static Random Access Memory).

L2キャッシュ13は、動作速度が速く且つ一般的にL1キャッシュ12よりも容量の大きいキャッシュメモリであり、演算部11によるデータアクセス時に、L1キャッシュ12でキャッシュミスが発生した場合に次に読み込まれるキャッシュメモリである。L2キャッシュ13も、例えば、SRAMである。 The L2 cache 13 is a cache memory that operates at a faster speed and generally has a larger capacity than the L1 cache 12. The L2 cache 13 is a cache memory that has a faster operation speed and generally has a larger capacity than the L1 cache 12, and is the cache memory that is read next when a cache miss occurs in the L1 cache 12 during data access by the calculation unit 11. It's memory. The L2 cache 13 is also, for example, SRAM.

L3キャッシュ14は、動作速度が速く且つ一般的にL2キャッシュ13よりも容量の大きいキャッシュメモリであり、演算部11によるデータアクセス時に、L2キャッシュ13でキャッシュミスが発生した場合に次に読み込まれるキャッシュメモリである。L3キャッシュ14も、例えば、SRAMである。 The L3 cache 14 is a cache memory that has a faster operating speed and generally has a larger capacity than the L2 cache 13, and is the cache memory that is read next when a cache miss occurs in the L2 cache 13 during data access by the calculation unit 11. It's memory. The L3 cache 14 is also, for example, SRAM.

ここで、本実施例では、情報処理装置1が、L1キャッシュ12、L2キャッシュ13及びL3キャッシュ14という3つのキャッシュメモリを有する場合で説明するが、キャッシュメモリの階層の数はこれに限らない、例えば、情報処理装置1は、L2キャッシュ13やL3キャッシュ14を有さなくても良いし、4つ以上の階層を有してもよい。 Here, in this embodiment, a case will be described in which the information processing device 1 has three cache memories, L1 cache 12, L2 cache 13, and L3 cache 14, but the number of cache memory hierarchies is not limited to this. For example, the information processing device 1 may not have the L2 cache 13 or the L3 cache 14, or may have four or more layers.

メインメモリ15は、L1キャッシュ12、L2キャッシュ13及びL3キャッシュ14に比べて動作速度が遅く且つ大容量の主記憶装置である。メインメモリ15は、演算部11が演算に用いるデータが格納される。メインメモリ15は、L1キャッシュ12、L2キャッシュ13及びL3キャッシュ14のいずれにもアクセス対象のデータが存在しない場合に演算部11からのアクセスを受ける。メインメモリ15は、例えば、DRAM(Dynamic Random Access Memory)である。 The main memory 15 is a main storage device with a lower operating speed and larger capacity than the L1 cache 12, L2 cache 13, and L3 cache 14. The main memory 15 stores data used in calculations by the calculation unit 11. The main memory 15 receives access from the calculation unit 11 when there is no data to be accessed in any of the L1 cache 12, L2 cache 13, and L3 cache 14. The main memory 15 is, for example, a DRAM (Dynamic Random Access Memory).

補助記憶装置16は、例えば、HDD(Hard Disk Drive)やSSD(Solid State Drive)などである。補助記憶装置16には、OS(Operating System)や演算を行なうための各種プログラムが格納される。 The auxiliary storage device 16 is, for example, an HDD (Hard Disk Drive) or an SSD (Solid State Drive). The auxiliary storage device 16 stores an OS (Operating System) and various programs for performing calculations.

表示装置17は、例えば、モニタやディスプレイなどである。表示装置17は、演算部11による演算結果の利用者への提示などを行なう。入力装置18は、例えば、キーボードやマウスなどである。利用者は、表示装置17に表示された画面を参照しつつ、入力装置18を用いて情報処理装置1へのデータや命令の入力を行なう。表示装置17及び入力装置18は、1つのハードウェアとして構成されてもよい。 The display device 17 is, for example, a monitor or a display. The display device 17 presents the results of calculations by the calculation unit 11 to the user. The input device 18 is, for example, a keyboard or a mouse. The user inputs data and commands to the information processing device 1 using the input device 18 while referring to the screen displayed on the display device 17 . The display device 17 and the input device 18 may be configured as one piece of hardware.

図2は、実施例1に係るL1~L2キャッシュのブロック図である。図2では、L1キャッシュ12、L2キャッシュ13及びL3キャッシュ14の階層構造を分かり易くするため、それぞれが多段で接続されるように示した。実際の接続は、図1に示したように演算部11から延びるバスにそれぞれが接続してもよい。 FIG. 2 is a block diagram of the L1-L2 cache according to the first embodiment. In FIG. 2, in order to make the hierarchical structure of the L1 cache 12, L2 cache 13, and L3 cache 14 easier to understand, they are shown connected in multiple stages. In actual connection, each may be connected to a bus extending from the calculation unit 11 as shown in FIG.

L1キャッシュ12は、制御部121及び記憶部122を有する。記憶部122は、キャッシュされたデータ群であるキャッシュ情報123を有する。 The L1 cache 12 includes a control section 121 and a storage section 122. The storage unit 122 has cache information 123 that is a cached data group.

制御部121は、演算部11からのデータ要求を受信する。そして、制御部121は、データ要求で指定されたデータが記憶部122に存在するか否かを判定する。記憶部122が保持するキャッシュ情報123に指定されたデータが存在する場合、制御部121は、キャッシュ情報123の中から指定されたデータを取り出して演算部11へ送信して応答を行なう。 The control unit 121 receives a data request from the calculation unit 11. Then, the control unit 121 determines whether the data specified in the data request exists in the storage unit 122. If the specified data exists in the cache information 123 held by the storage unit 122, the control unit 121 extracts the specified data from the cache information 123 and sends it to the calculation unit 11 to respond.

これに対して、記憶部122が保持するキャッシュ情報123に指定されたデータが存在しない場合、制御部121は、キャッシュミスと判定して、データ要求をL2キャッシュ13へ出力する。その後、L2キャッシュ13から要求したデータを受信すると、制御部121は、記憶部122が保持するキャッシュ情報123として受信したデータを格納する。また、キャッシュの方式によっては、L1キャッシュ12が、L2キャッシュ13から受信したデータを演算部11へ出力してもよい。 On the other hand, if the data specified in the cache information 123 held by the storage unit 122 does not exist, the control unit 121 determines that there is a cache miss and outputs a data request to the L2 cache 13. Thereafter, upon receiving the requested data from the L2 cache 13, the control unit 121 stores the received data as cache information 123 held by the storage unit 122. Further, depending on the cache method, the L1 cache 12 may output the data received from the L2 cache 13 to the calculation unit 11.

次に、L2キャッシュ13について説明する。本実施例では、L2キャッシュ13は、キャッシュのマッピング方式としてセットアソシアティブ方式を用いて動作する。図3は、メモリアドレスの一例を示す図である。本実施例では、メモリアドレス101は、例えば、図3に示すように、タグ、セット、ブロックオフセット及びバイトオフセットを有する。タグとセットとを合わせてブロックアドレスと呼ぶ。ブロックアドレスは、メインメモリ15におけるどのブロックかを示す情報である。また、セットは、キャッシュにおけるどのセットに格納するかを示すインデックスである。また、ブロックオフセットは、ブロック内のどの部分に要求するデータがあるかを示す情報である。また、バイトオフセットは、1回の読み書きの単位であるワードの中のどの部分に要求するデータがあるかを示す情報である。以下では、あるデータが格納された位置を示すメモリアドレスを、そのデータのメモリアドレスと呼ぶ。 Next, the L2 cache 13 will be explained. In this embodiment, the L2 cache 13 operates using a set associative method as a cache mapping method. FIG. 3 is a diagram showing an example of memory addresses. In this embodiment, the memory address 101 has, for example, a tag, a set, a block offset, and a byte offset, as shown in FIG. The tag and set together are called a block address. The block address is information indicating which block in the main memory 15. Further, the set is an index indicating in which set in the cache the data is stored. Further, the block offset is information indicating in which part of the block the requested data is located. Further, the byte offset is information indicating in which part of a word, which is a unit of one read/write, the requested data is located. Hereinafter, a memory address indicating a location where certain data is stored will be referred to as a memory address of that data.

ここで、L2キャッシュ13のセット数の一例について説明する。L2キャッシュ13の記憶部134におけるキャッシュ情報135を格納する領域の容量は、セット数とウェイ数とブロックサイズとの総積により算出される。例えば、L2キャッシュ13には、16ウェイ、2048セット且つブロックサイズが256Byteのものがある。他にも、L2キャッシュ13には、16ウェイ、1024セット且つブロックサイズが64Byteのものがある。 Here, an example of the number of sets in the L2 cache 13 will be explained. The capacity of the area for storing cache information 135 in the storage unit 134 of the L2 cache 13 is calculated by the total product of the number of sets, the number of ways, and the block size. For example, the L2 cache 13 has 16 ways, 2048 sets, and a block size of 256 Bytes. In addition, the L2 cache 13 has 16 ways, 1024 sets, and a block size of 64 Bytes.

図2に戻って説明を続ける。本実施例に係るL2キャッシュ13は、処理能力に余裕がある場合に、不規則アクセスの多いデータに対して投機的なプリフェッチを行なう。すなわち、L2キャッシュ13は、不規則アクセスが多いと判定したデータを、データアクセスを受けない段階で事前にキャッシュ情報135として記憶部134に格納する。ここで、本実施例では、L2キャッシュ13が不規則アクセスに基づく投機的プリフェッチを行う場合で説明したが、これに限らず、L1キャッシュ12やL3キャッシュ14といった他のキャッシュメモリが行ってもよい。ただし、L1キャッシュ12は、容量の小ささや演算部11からのアクセス頻度を考えた場合、実施例に係る不規則アクセスに基づく投機的プリフェッチにはあまり適さない。 Returning to FIG. 2, the explanation will be continued. The L2 cache 13 according to this embodiment performs speculative prefetching on data that is frequently accessed irregularly when there is sufficient processing capacity. That is, the L2 cache 13 stores data determined to be frequently accessed irregularly in the storage unit 134 in advance as cache information 135 before the data is accessed. Here, in this embodiment, a case has been described in which the L2 cache 13 performs speculative prefetching based on irregular access, but the present invention is not limited to this, and other cache memories such as the L1 cache 12 and the L3 cache 14 may also perform the speculative prefetching. . However, considering the small capacity of the L1 cache 12 and the frequency of access from the calculation unit 11, the L1 cache 12 is not very suitable for the speculative prefetch based on irregular access according to the embodiment.

以下に、L2キャッシュ13の詳細について説明する。L2キャッシュ13は、図2に示すように、制御部131、キャッシュミス情報更新部132、投機的プリフェッチ部133及び記憶部134を有する。 Details of the L2 cache 13 will be explained below. As shown in FIG. 2, the L2 cache 13 includes a control section 131, a cache miss information update section 132, a speculative prefetch section 133, and a storage section 134.

制御部131は、L1キャッシュ12からのデータ要求を受信する。そして、制御部121は、データ要求で指定されたデータが記憶部134に存在するか否かを判定する。記憶部134が保持するキャッシュ情報135に指定されたデータが存在する場合、制御部131は、キャッシュ情報135の中から指定されたデータを取り出してL1キャッシュ12及び演算部11へ送信して応答を行なう。 The control unit 131 receives a data request from the L1 cache 12. Then, the control unit 121 determines whether the data specified in the data request exists in the storage unit 134. If the specified data exists in the cache information 135 held by the storage unit 134, the control unit 131 extracts the specified data from the cache information 135, sends it to the L1 cache 12 and the calculation unit 11, and sends a response. Let's do it.

これに対して、記憶部134が保持するキャッシュ情報135に指定されたデータが存在しない場合、制御部131は、キャッシュミスと判定して、データ要求をL3キャッシュ14へ出力する。また、制御部131は、指定されたデータのキャッシュミスをキャッシュミス情報更新部132に通知する。その後、L3キャッシュ14から要求したデータを受信すると、制御部131は、記憶部134が保持するキャッシュ情報135として受信したデータを格納する。また、キャッシュの方式によっては、L1キャッシュ12が、L3キャッシュ14から受信したデータをL1キャッシュ12へ出力してもよい。 On the other hand, if the data specified in the cache information 135 held by the storage unit 134 does not exist, the control unit 131 determines that there is a cache miss and outputs a data request to the L3 cache 14. Further, the control unit 131 notifies the cache miss information updating unit 132 of a cache miss of the specified data. Thereafter, upon receiving the requested data from the L3 cache 14, the control unit 131 stores the received data as cache information 135 held by the storage unit 134. Further, depending on the cache method, the L1 cache 12 may output data received from the L3 cache 14 to the L1 cache 12.

キャッシュミス情報136は、メモリアドレスに含まれるタグ毎に、キャッシュミスの発生頻度を管理するためのテーブルである。図4は、キャッシュミス情報の一例の図である。キャッシュミス情報136は、タグ及び各タグに対応するカウンタの値が登録される。タグは、図3に示すメモリアドレス101の上位部分にあたる。また、カウンタは、タグに対応するアドレス範囲で発生したキャッシュミスの数を表す。 The cache miss information 136 is a table for managing the frequency of occurrence of cache misses for each tag included in a memory address. FIG. 4 is a diagram of an example of cache miss information. In the cache miss information 136, tags and counter values corresponding to each tag are registered. The tag corresponds to the upper part of the memory address 101 shown in FIG. Further, the counter represents the number of cache misses that have occurred in the address range corresponding to the tag.

キャッシュミス情報更新部132は、キャッシュ情報135の変更に応じて、キャッシュミス情報136を更新する。より詳しくは、キャッシュミス情報更新部132は、キャッシュミス発生時に、指定されたデータのキャッシュミスの通知を制御部131から受ける。次に、キャッシュミス情報更新部132は、記憶部134に格納されたキャッシュミス情報136を参照する。そして、キャッシュミス情報更新部132は、キャッシュミス情報136に指定されたデータに対応するエントリが存在するか否かを判定する。すなわち、キャッシュミス情報更新部132は、指定されたデータのメモリアドレスに含まれるタグを有するエントリがキャッシュミス情報136に存在するか否かを判定する。 The cache miss information update unit 132 updates the cache miss information 136 in accordance with the change in the cache information 135. More specifically, the cache miss information update unit 132 receives a notification of a cache miss for specified data from the control unit 131 when a cache miss occurs. Next, the cache miss information update unit 132 refers to the cache miss information 136 stored in the storage unit 134. Then, the cache miss information update unit 132 determines whether an entry corresponding to the data specified in the cache miss information 136 exists. That is, the cache miss information update unit 132 determines whether or not an entry having the tag included in the memory address of the specified data exists in the cache miss information 136.

対応するエントリが存在しない場合、キャッシュミス情報更新部132は、指定されたデータのメモリアドレスに含まれるタグ有するエントリをキャッシュミス情報136に追加する。さらに、キャッシュミス情報更新部132は、カウンタをカウンタの初期値に設定する。これに対して、対応するエントリが存在する場合、キャッシュミス情報更新部132は、キャッシュミス情報136の指定されたデータのメモリアドレスに含まれるタグに対応するカウンタをインクリメントする。すなわち、キャッシュミス情報更新部132は、タグ毎にキャッシュミスの発生数を累積していく。キャッシュミス情報136を更新した場合、キャッシュミス情報更新部132は、キャッシュミス情報136の更新を投機的プリフェッチ部133へ通知する。 If the corresponding entry does not exist, the cache miss information update unit 132 adds an entry having the tag included in the memory address of the specified data to the cache miss information 136. Furthermore, the cache miss information update unit 132 sets the counter to its initial value. On the other hand, if a corresponding entry exists, the cache miss information update unit 132 increments the counter corresponding to the tag included in the memory address of the specified data in the cache miss information 136. That is, the cache miss information updating unit 132 accumulates the number of cache misses for each tag. When the cache miss information 136 is updated, the cache miss information update unit 132 notifies the speculative prefetch unit 133 of the update of the cache miss information 136.

ここで、L2キャッシュ13は、ストライドプリフェッチなどのハードウェアプリフェッチを実行してもよい。ただし、キャッシュミス情報更新部132は、ハードウェアプリフェッチをキャッシュミスと同様には扱わず、ハードウェアプリフェッチが発生した場合でもキャッシュミス情報136のカウントをインクリメントしない。 Here, the L2 cache 13 may perform hardware prefetch such as stride prefetch. However, the cache miss information update unit 132 does not treat a hardware prefetch in the same way as a cache miss, and does not increment the count in the cache miss information 136 even if a hardware prefetch occurs.

また、キャッシュミス情報更新部132は、所定の条件が満たされた場合に、キャッシュミス情報136のエントリをクリアしてもよい。例えば、特定の処理における一群の演算が終了した場合に、キャッシュミス情報更新部132は、キャッシュミス情報136のエントリをクリアしてもよい。このキャッシュミス情報更新部132が、「情報管理部」の一例にあたる。 Further, the cache miss information updating unit 132 may clear the entry of the cache miss information 136 when a predetermined condition is satisfied. For example, when a group of operations in a specific process is completed, the cache miss information update unit 132 may clear the entry of the cache miss information 136. This cache miss information update unit 132 is an example of an “information management unit”.

投機的プリフェッチ部133は、L2キャッシュ13とL3キャッシュ14との間のバスに余裕が存在するときに、不規則アクセスが多いアドレス範囲からキャッシュしていないデータをプリフェッチする。すなわち、投機的プリフェッチ部133は、キャッシュしていないデータを下位メモリであるL3キャッシュ14又はメインメモリ15から取得してキャッシュ情報135として記憶部134に格納する。 The speculative prefetch unit 133 prefetches uncached data from an address range that is frequently accessed irregularly when there is some free space on the bus between the L2 cache 13 and the L3 cache 14. That is, the speculative prefetch unit 133 acquires uncached data from the L3 cache 14 or the main memory 15, which is a lower memory, and stores it in the storage unit 134 as cache information 135.

ここで、ハードウェアプリフェッチなどの通常のプリフェッチでは、データのアクセスの規則性を推測してプリフェッチが行われる。すなわち、あるアドレス範囲において推測できる程度の規則性にしたがってデータアクセスが行われていれば、そのアドレス範囲においてキャッシュミスの発生は通常のプリフェッチにより抑えられると考える。このことから、キャッシュミスが頻発している場合、推測できる程度の規則性から外れたデータアクセスが行われていると想定される。すなわち、キャッシュミスの発生数が多いアドレス範囲は、不規則アクセスが多いアドレス範囲と考えることができる。そこで、投機的プリフェッチ部133は、キャッシュミス情報136においてカウンタの値が大きいアドレス範囲に不規則アクセスの対象となるデータがあると判定し、そのデータをL2キャッシュ13の記憶部134に格納する。 Here, in normal prefetching such as hardware prefetching, prefetching is performed by estimating the regularity of data access. That is, if data accesses are performed according to a regularity that can be estimated within a certain address range, it is considered that the occurrence of cache misses in that address range can be suppressed by normal prefetching. From this, if cache misses occur frequently, it is assumed that data accesses are being performed with a degree of irregularity that can be inferred. In other words, an address range where a large number of cache misses occur can be considered an address range where irregular accesses occur frequently. Therefore, the speculative prefetch unit 133 determines that there is data to be irregularly accessed in the address range where the counter value is large in the cache miss information 136, and stores the data in the storage unit 134 of the L2 cache 13.

ただし、キャッシュミス情報136においてカウンタ値が全体的に小さい場合、いずれのアドレス範囲においても不規則アクセスが発生していないといえる。そこで、投機的プリフェッチ部133は、不規則アクセスの発生を判定するための判定閾値を予め有する。判定閾値は、大きければ不規則アクセスの検出の見逃しが多くなり、小さければ不規則アクセスの誤検出が多くなる。そこで、判定閾値は、情報処理装置1の運用状態に応じて決定されることが好ましい。 However, if the counter values in the cache miss information 136 are small overall, it can be said that irregular accesses have not occurred in any address range. Therefore, the speculative prefetch unit 133 has a determination threshold value in advance for determining the occurrence of irregular access. When the determination threshold is large, irregular accesses are often missed, and when it is small, irregular accesses are often erroneously detected. Therefore, it is preferable that the determination threshold value is determined according to the operating state of the information processing device 1.

このように、特定のアドレス範囲に不規則アクセスの対象となるデータが推測し、そのアドレス範囲の中から今後アクセス対象になるかが不確実なデータを選択してプリフェッチすることから、以下では、投機的プリフェッチ部133が行なうプリフェッチを投機的プリフェッチと呼ぶ。投機的プリフェッチ部133が投機的プリフェッチの対象とするデータが、「投機的データ」の一例にあたる。以下に、投機的プリフェッチ部133の動作の詳細について説明する。 In this way, data to be accessed irregularly is inferred in a specific address range, and data that is uncertain whether it will be accessed in the future is selected from that address range and prefetched. The prefetch performed by the speculative prefetch unit 133 is called speculative prefetch. The data targeted for speculative prefetch by the speculative prefetch unit 133 is an example of "speculative data." The details of the operation of the speculative prefetch unit 133 will be described below.

投機的プリフェッチ部133は、キャッシュミス情報136の更新通知をキャッシュミス情報更新部132から受信する。次に、投機的プリフェッチ部133は、データを格納する空き領域が記憶部134に存在するか否かを判定する。データを格納する空き領域があれば、投機的プリフェッチ部133は空いているウェイが存在するセットを1つ選択する。 The speculative prefetch unit 133 receives an update notification of the cache miss information 136 from the cache miss information update unit 132. Next, the speculative prefetch unit 133 determines whether or not there is free space in the storage unit 134 to store the data. If there is a free area to store data, the speculative prefetch unit 133 selects one set in which a free way exists.

次に、投機的プリフェッチ部133は、キャッシュミス情報136を参照する。そして、投機的プリフェッチ部133は、キャッシュミス情報136に格納されたエントリの中からカウンタ値が大きいものから順にエントリを選択する。 Next, the speculative prefetch unit 133 refers to the cache miss information 136. Then, the speculative prefetch unit 133 selects entries from among the entries stored in the cache miss information 136 in descending order of the counter value.

次に、投機的プリフェッチ部133は、選択したエントリのカウンタ値が判定閾値より大きいか否かを判定する。判定閾値よりもカウンタ値が大きい場合、投機的プリフェッチ部133は、選択したセットと選択したエントリとのタグに対応するデータが、記憶部134に存在するか否かを判定する。選択したセットとタグに対応するデータが記憶部134に既に存在する場合、投機的プリフェッチ部133は、次にカウンタ値の大きいエントリをキャッシュミス情報136から選択して、同様の処理を繰り返す。 Next, the speculative prefetch unit 133 determines whether the counter value of the selected entry is greater than the determination threshold. If the counter value is larger than the determination threshold, the speculative prefetch unit 133 determines whether data corresponding to the tag of the selected set and the selected entry exists in the storage unit 134. If data corresponding to the selected set and tag already exists in the storage unit 134, the speculative prefetch unit 133 selects the entry with the next largest counter value from the cache miss information 136, and repeats the same process.

これに対して、選択したセットとタグに対応するデータが記憶部134に存在しなければ、投機的プリフェッチ部133は、L2キャッシュ13とL3キャッシュ14との間のバスの処理能力に余裕ができるまで待機する。具体的には、投機的プリフェッチ部133は、L2キャッシュ13とL3キャッシュ14との間のバスの処理量が予め設定した処理量閾値よりも小さい場合に、処理能力に余裕があると判定する。投機的プリフェッチ部133は、例えば、バスの処理量としてバスのビジー率(使用率)、ロードストア比率、L2キャッシュ13のキャッシュミス率又はデータ取得に係るレイテンシなどを用いることができる。 On the other hand, if the data corresponding to the selected set and tag does not exist in the storage unit 134, the speculative prefetch unit 133 can free up processing capacity of the bus between the L2 cache 13 and the L3 cache 14. Wait until. Specifically, the speculative prefetch unit 133 determines that there is sufficient processing capacity when the throughput of the bus between the L2 cache 13 and the L3 cache 14 is smaller than a preset throughput threshold. The speculative prefetch unit 133 can use, for example, the busy rate (usage rate) of the bus, the load/store ratio, the cache miss rate of the L2 cache 13, or the latency related to data acquisition as the amount of bus processing.

例えば、ロードストア比率を用いる場合、投機的プリフェッチ部133は、実行命令に対するロード命令数及びストア命令数の比率をL1キャッシュ12から取得する。ロード命令及びストア命令の場合データがバスで運ばれるため、その比率が大きい場合に、投機的プリフェッチ部133は、バスの処理量が大きいと判定できる。また、L2キャッシュ13のキャッシュミスが多い場合、L2キャッシュ13がL3キャッシュ14から取得するデータ量が増加する。そこで、L2キャッシュ13のキャッシュミスが多い場合に、投機的プリフェッチ部133は、バスの処理量が大きいと判定できる。また、データ取得に係るレイテンシは、演算部11によるL1キャッシュ12からのデータ取得にかかる時間である。データ取得に係るレイテンシはL3キャッシュ14やメインメモリ15へのアクセスが増えると増加するため、この値が大きい場合に、投機的プリフェッチ部133は、バスの処理量が大きいと判定できる。 For example, when using the load/store ratio, the speculative prefetch unit 133 obtains the ratio of the number of load instructions and the number of store instructions to the executed instructions from the L1 cache 12. In the case of load instructions and store instructions, data is carried on the bus, so if the ratio is large, the speculative prefetch unit 133 can determine that the amount of processing on the bus is large. Furthermore, when there are many cache misses in the L2 cache 13, the amount of data that the L2 cache 13 acquires from the L3 cache 14 increases. Therefore, when there are many cache misses in the L2 cache 13, the speculative prefetch unit 133 can determine that the amount of bus processing is large. Furthermore, the latency related to data acquisition is the time required for the calculation unit 11 to acquire data from the L1 cache 12. The latency associated with data acquisition increases as the number of accesses to the L3 cache 14 and main memory 15 increases, so if this value is large, the speculative prefetch unit 133 can determine that the amount of bus processing is large.

L2キャッシュ13とL3キャッシュ14との間のバスの処理能力に余裕ができた後、投機的プリフェッチ部133は、選択したセットとタグに対応するデータが待機中に記憶部134に格納されていないかを確認する。待機中にデータの格納が行われていなければ、投機的プリフェッチ部133は、対応するデータをL3キャッシュ14から取得してL2キャッシュ13の記憶部134に格納する。これにより、投機的プリフェッチ部133は、投機的プリフェッチ処理を実行する。 After the processing capacity of the bus between the L2 cache 13 and the L3 cache 14 becomes available, the speculative prefetch unit 133 determines whether the data corresponding to the selected set and tag is not stored in the storage unit 134 while waiting. Check whether If data is not stored during standby, the speculative prefetch unit 133 acquires the corresponding data from the L3 cache 14 and stores it in the storage unit 134 of the L2 cache 13 . Thereby, the speculative prefetch unit 133 executes speculative prefetch processing.

図5は、実施例1に係る制御部によるデータキャッシュ処理のフローチャートである。次に、図5を参照して、制御部131によるデータキャッシュ処理の流れを説明する。ここでは、演算部11によるデータAへのアクセスが発生した場合で説明する。 FIG. 5 is a flowchart of data cache processing by the control unit according to the first embodiment. Next, the flow of data cache processing by the control unit 131 will be described with reference to FIG. Here, a case will be described in which access to data A by the calculation unit 11 occurs.

制御部131は、データAの送信要求をL1キャッシュ12から受ける(ステップS101)。 The control unit 131 receives a request to send data A from the L1 cache 12 (step S101).

次に、制御部131は、データAが記憶部134に格納されたキャッシュ情報135に存在するか否かを判定する(ステップS102)。 Next, the control unit 131 determines whether data A exists in the cache information 135 stored in the storage unit 134 (step S102).

データAが記憶部134に格納されたキャッシュ情報135に存在しない場合(ステップS102:否定)、制御部131は、データAのキャッシュミスをキャッシュミス情報更新部132に通知する(ステップS103)。 If data A does not exist in the cache information 135 stored in the storage unit 134 (step S102: negative), the control unit 131 notifies the cache miss information update unit 132 of the cache miss of data A (step S103).

次に、制御部131は、データAの送信をL3キャッシュ14に要求する(ステップS104)。ステップS104は、ステップS103と同時、もしくは、ステップS103の前に行ってもよい。 Next, the control unit 131 requests the L3 cache 14 to transmit data A (step S104). Step S104 may be performed simultaneously with step S103 or before step S103.

その後、制御部131は、データAをL3キャッシュ14から取得する。そして、制御部131は、データAをSRAMである記憶部134にキャッシュ情報135として格納する(ステップS105)。 Thereafter, the control unit 131 obtains data A from the L3 cache 14. Then, the control unit 131 stores the data A in the storage unit 134, which is an SRAM, as cache information 135 (step S105).

これに対して、データAが記憶部134に格納されたキャッシュ情報135に存在する場合(ステップS102:肯定)、制御部131は、記憶部134が保持するキャッシュ情報135の中からデータAを取得する。そして、制御部131は、データAをL1キャッシュ12及び演算部11へ送信する(ステップS106)。 On the other hand, if the data A exists in the cache information 135 stored in the storage unit 134 (step S102: affirmative), the control unit 131 acquires the data A from the cache information 135 held in the storage unit 134. do. Then, the control unit 131 transmits the data A to the L1 cache 12 and the calculation unit 11 (step S106).

図6は、キャッシュミス情報更新部によるキャッシュミス情報の更新処理のフローチャートである。次に、図6を参照して、キャッシュミス情報更新部132によるキャッシュミス情報の更新処理の流れを説明する。 FIG. 6 is a flowchart of the cache miss information update process by the cache miss information update unit. Next, with reference to FIG. 6, the flow of the cache miss information update process by the cache miss information update unit 132 will be described.

キャッシュミス情報更新部132は、キャッシュミスの通知を制御部131から受信する(ステップS201)。 The cache miss information update unit 132 receives a cache miss notification from the control unit 131 (step S201).

次に、キャッシュミス情報更新部132は、キャッシュミスされたデータに対応するエントリ、すなわち通知で指定されたデータのメモリアドレスに含まれるタグに対応するエントリがキャッシュミス情報136に存在するか否かを判定する(ステップS202)。 Next, the cache miss information update unit 132 determines whether or not there is an entry corresponding to the cache miss data, that is, an entry corresponding to the tag included in the memory address of the data specified in the notification, in the cache miss information 136. is determined (step S202).

キャッシュミスされたデータに対応するエントリが存在する場合(ステップS202:肯定)、キャッシュミス情報更新部132は、キャッシュミスされたデータに対応するエントリのカウンタ値をインクリメントする(ステップS203)。 If there is an entry corresponding to the cache-missed data (step S202: affirmative), the cache-miss information update unit 132 increments the counter value of the entry corresponding to the cache-missed data (step S203).

これに対して、キャッシュミスされたデータに対応するエントリが存在しない場合(ステップS202:否定)、キャッシュミス情報更新部132は、キャッシュミスされたデータに対応するエントリをキャッシュミス情報136に追加する(ステップS204)。この際、キャッシュミス情報更新部132は、追加したエントリのカウンタ値を初期値に設定する。 On the other hand, if there is no entry corresponding to the cache-missed data (step S202: negative), the cache-miss information update unit 132 adds the entry corresponding to the cache-missed data to the cache-miss information 136. (Step S204). At this time, the cache miss information update unit 132 sets the counter value of the added entry to the initial value.

図7は、投機的プリフェッチ部による投機的プリフェッチ処理のフローチャートである。次に、図7を参照して、投機的プリフェッチ部133による投機的プリフェッチ処理の流れを説明する。 FIG. 7 is a flowchart of speculative prefetch processing by the speculative prefetch unit. Next, with reference to FIG. 7, the flow of speculative prefetch processing by the speculative prefetch unit 133 will be described.

投機的プリフェッチ部133は、キャッシュミス情報136の更新通知をキャッシュミス情報更新部132から受信する(ステップS301)。 The speculative prefetch unit 133 receives an update notification of the cache miss information 136 from the cache miss information update unit 132 (step S301).

次に、投機的プリフェッチ部133は、データを格納する空き領域が記憶部134に存在するか否かを判定する(ステップS302)。データを格納する空き領域が存在しない場合(ステップS302:否定)、投機的プリフェッチ部133は、投機的プリフェッチ処理を終了する。 Next, the speculative prefetch unit 133 determines whether there is a free area in the storage unit 134 to store data (step S302). If there is no free space to store the data (step S302: negative), the speculative prefetch unit 133 ends the speculative prefetch process.

これに対して、データを格納する空き領域が存在する場合(ステップS302:肯定)、投機的プリフェッチ部133は空いているウェイが存在するセットを選択する(ステップS303)。 On the other hand, if there is a free area to store data (step S302: affirmative), the speculative prefetch unit 133 selects a set in which a free way exists (step S303).

次に、投機的プリフェッチ部133は、キャッシュミス情報136を参照する。そして、投機的プリフェッチ部133は、キャッシュミス情報136に登録されたエントリの中の未選択のエントリのうちカウンタ値が最大のエントリを選択する(ステップS304)。 Next, the speculative prefetch unit 133 refers to the cache miss information 136. Then, the speculative prefetch unit 133 selects the entry with the largest counter value among the unselected entries among the entries registered in the cache miss information 136 (step S304).

次に、投機的プリフェッチ部133は、選択したエントリのカウンタ値が判定閾値より大きいか否かを判定する(ステップS305)。選択したエントリのカウンタ値が判定閾値以下の場合(ステップS305:否定)、投機的プリフェッチ部133は、投機的プリフェッチ処理を終了する。 Next, the speculative prefetch unit 133 determines whether the counter value of the selected entry is larger than the determination threshold (step S305). If the counter value of the selected entry is less than or equal to the determination threshold (step S305: negative), the speculative prefetch unit 133 ends the speculative prefetch process.

これに対して、選択したエントリのカウンタ値が判定閾値よりも大きい場合(ステップS305:肯定)、投機的プリフェッチ部133は、選択したセットとタグに対応するデータが記憶部134に存在するか否かを判定する(ステップS306)。選択したセットとタグに対応するデータが記憶部134に既に存在する場合(ステップS306:肯定)、投機的プリフェッチ部133は、ステップS304へ戻る。 On the other hand, if the counter value of the selected entry is larger than the determination threshold (step S305: affirmative), the speculative prefetch unit 133 determines whether data corresponding to the selected set and tag exists in the storage unit 134. (Step S306). If data corresponding to the selected set and tag already exists in the storage unit 134 (step S306: affirmative), the speculative prefetch unit 133 returns to step S304.

これに対して、選択したセットとタグに対応するデータが記憶部134に既に存在しない場合(ステップS306:否定)、投機的プリフェッチ部133は、L2キャッシュ13とL3キャッシュ14との間のバスの処理能力に余裕ができるまで待機する(ステップS307)。 On the other hand, if the data corresponding to the selected set and tag does not already exist in the storage unit 134 (step S306: negative), the speculative prefetch unit 133 controls the bus between the L2 cache 13 and the L3 cache 14. The processing waits until processing capacity becomes available (step S307).

その後、投機的プリフェッチ部133は、選択したセットとタグに対応するデータが記憶部134に格納されていないかを再度確認する(ステップS308)。選択したセットとタグに対応するデータが記憶部134に格納されていた場合(ステップS308:肯定)、投機的プリフェッチ部133は、ステップS304へ戻る。 After that, the speculative prefetch unit 133 checks again whether data corresponding to the selected set and tag is stored in the storage unit 134 (step S308). If the data corresponding to the selected set and tag is stored in the storage unit 134 (step S308: affirmative), the speculative prefetch unit 133 returns to step S304.

これに対して、選択したセットとタグに対応するデータが記憶部134に格納されていない場合(ステップS308:否定)、投機的プリフェッチ部133は、対応するデータをL3キャッシュ14から取得する。そして、投機的プリフェッチ部133は、記憶部134にキャッシュ情報135として格納する(ステップS309)。 On the other hand, if the data corresponding to the selected set and tag is not stored in the storage unit 134 (step S308: negative), the speculative prefetch unit 133 acquires the corresponding data from the L3 cache 14. Then, the speculative prefetch unit 133 stores the cache information 135 in the storage unit 134 (step S309).

以上に説明したように、本実施例に係る情報処理装置のキャッシュは、キャッシュミスの頻度が高いアドレス範囲のデータを投機的にプリフェッチしておく。これにより、不規則なデータアクセスが行われる場合に、データがプリフェッチされている可能性を向上させることができる。したがって、限られたメモリバンド幅を無駄なく使用することが可能となり、データ転送を効率化することができる。 As described above, the cache of the information processing apparatus according to this embodiment speculatively prefetches data in an address range where cache misses occur frequently. Thereby, when irregular data access is performed, it is possible to improve the possibility that data is prefetched. Therefore, it is possible to use the limited memory bandwidth without wasting it, and data transfer can be made more efficient.

図8は、実施例2に係るL2キャッシュのブロック図である。図8では、L1キャッシュ12の詳細は省略した。本実施例に係るL2キャッシュ13は、SRAM137とSRAM137よりも記憶密度の高いメモリであるMRAM138の混載メモリである記憶部134を有する。記憶部134において、SRAM137がメイン領域であり、MRAM138が予備領域である。そして、L2キャッシュ13は、投機的プリフェッチにおいてデータをMRAM138に格納する。さらに、L2キャッシュ13は、MRAM138に格納されたデータのうちアクセス頻度の高いデータはSRAM137に移動する。以下に、本実施例に係るL2キャッシュ13の詳細について説明する。以下の説明では、実施例1と同様の各部の動作については説明を省略する。 FIG. 8 is a block diagram of the L2 cache according to the second embodiment. In FIG. 8, details of the L1 cache 12 are omitted. The L2 cache 13 according to this embodiment includes a storage unit 134 that is a mixed memory of an SRAM 137 and an MRAM 138 that is a memory with a higher storage density than the SRAM 137. In the storage unit 134, the SRAM 137 is the main area, and the MRAM 138 is the spare area. The L2 cache 13 then stores the data in the MRAM 138 in speculative prefetch. Furthermore, the L2 cache 13 moves frequently accessed data among the data stored in the MRAM 138 to the SRAM 137. Details of the L2 cache 13 according to this embodiment will be explained below. In the following description, descriptions of the operations of the same parts as in the first embodiment will be omitted.

図8に示すように、本実施例に係るL2キャッシュ13は、実施例1に係る各部に加えてデータモニタ部140を有する。さらに、本実施例に係るL2キャッシュ13は、記憶部134をSRAM137とMRAM(Magnetoresistive Random Access Memory)138との混載メモリである。MRAM138は、SRAM137よりも記憶密度が高いメモリである。 As shown in FIG. 8, the L2 cache 13 according to the present embodiment includes a data monitor section 140 in addition to each section according to the first embodiment. Furthermore, in the L2 cache 13 according to this embodiment, the storage unit 134 is a mixed memory of an SRAM 137 and an MRAM (Magnetoresistive Random Access Memory) 138. MRAM 138 is a memory with higher storage density than SRAM 137.

SRAM137は、キャッシュ情報135を格納する。SRAM137は、一般的なキャッシュメモリと同様のフィールド及び機能を有する。 SRAM 137 stores cache information 135. The SRAM 137 has fields and functions similar to general cache memory.

MRAM138は、補助キャッシュ情報139及びキャッシュミス情報136を格納する。補助キャッシュ情報139は、投機的プリフェッチ部133が行う投機的プリフェッチにより記憶部134に格納されたデータ群である。 MRAM 138 stores auxiliary cache information 139 and cache miss information 136. The auxiliary cache information 139 is a data group stored in the storage unit 134 by speculative prefetch performed by the speculative prefetch unit 133.

図9は、実施例2に係るキャッシュ情報の構成を示す図である。記憶部134は、SRAM137に格納されたキャッシュ情報135及びMRAM138に格納された補助キャッシュ情報139をまとめて、全体を1つのメモリアレイ200として保持する。例えば、図9に示す例では、記憶部134は、4ウェイアソシアティブのメモリアレイ200として保持する。MRAM138が有する補助キャッシュ情報139には、図9でReference Countとして示した各データの参照回数を表す参照カウンタがブロック毎に登録される。参照カウンタは、2ビット程度のカウンタである。 FIG. 9 is a diagram showing the configuration of cache information according to the second embodiment. The storage unit 134 collectively holds the cache information 135 stored in the SRAM 137 and the auxiliary cache information 139 stored in the MRAM 138 as one memory array 200. For example, in the example shown in FIG. 9, the storage unit 134 stores data as a 4-way associative memory array 200. In the auxiliary cache information 139 of the MRAM 138, a reference counter indicating the number of times each data is referenced, shown as Reference Count in FIG. 9, is registered for each block. The reference counter is an approximately 2-bit counter.

制御部131は、データの送信要求をL1キャッシュ12から受ける。そして、制御部131は、送信要求で指定されたデータが記憶部134に格納されているか否かを判定する。この場合、制御部131は、図9に示すキャッシュ情報135及び補助キャッシュ情報139をまとめたメモリアレイ200を対象としてデータを検索する。すなわち、制御部131は、キャッシュ情報135又は補助キャッシュ情報139に存在するか否かを判定する。指定されたデータが記憶部134に格納されている場合、制御部131は、記憶部134が保持するキャッシュ情報135又は補助キャッシュ情報139の中から指定されたデータを取得する。その後、制御部131は、取得したデータをL1キャッシュ12及び演算部11へ送信する。 The control unit 131 receives a data transmission request from the L1 cache 12. Then, the control unit 131 determines whether the data specified in the transmission request is stored in the storage unit 134. In this case, the control unit 131 searches for data in the memory array 200 that collects the cache information 135 and the auxiliary cache information 139 shown in FIG. That is, the control unit 131 determines whether it exists in the cache information 135 or the auxiliary cache information 139. If the specified data is stored in the storage unit 134, the control unit 131 acquires the specified data from the cache information 135 or the auxiliary cache information 139 held by the storage unit 134. After that, the control unit 131 transmits the acquired data to the L1 cache 12 and the calculation unit 11.

さらに、制御部131は、キャッシュヒットしたデータの格納場所がMRAM138か否かを判定する。取得したデータの格納場所がMRAM138でない場合、制御部131は、キャッシュヒットしたデータをSRAM137に格納したままの状態としてデータキャッシュ処理を終了する。これに対して、キャッシュヒットしたデータの格納場所がMRAM138の場合、制御部131は、キャッシュヒットしたデータへのアクセスをデータモニタ部140に通知する。 Furthermore, the control unit 131 determines whether the storage location of the cache hit data is the MRAM 138 or not. If the acquired data is not stored in the MRAM 138, the control unit 131 ends the data caching process while leaving the cache hit data stored in the SRAM 137. On the other hand, if the storage location of the cache hit data is the MRAM 138, the control unit 131 notifies the data monitor unit 140 of access to the cache hit data.

投機的プリフェッチ部133は、キャッシュミスの通知をキャッシュミス情報更新部132から受ける。そして、投機的プリフェッチ部133は、キャッシュミス情報136におけるカウンタ値を用いて不規則アクセスのデータが格納されたアドレス範囲を特定する。その後、投機的プリフェッチ部133は、特定したアドレス範囲のデータをL3キャッシュ14から取得する。 The speculative prefetch unit 133 receives a cache miss notification from the cache miss information update unit 132. Then, the speculative prefetch unit 133 uses the counter value in the cache miss information 136 to identify the address range in which the irregularly accessed data is stored. Thereafter, the speculative prefetch unit 133 acquires data in the specified address range from the L3 cache 14.

ここで、投機的プリフェッチの対象のデータは、ハードウェアプリフェッチなど他のプリフェッチされたデータを含む記憶部134に格納された他のデータよりもアクセスされる可能性が低い。そこで、投機的プリフェッチの対象のデータは、比較的動作速度が遅いメモリに格納してもデータ転送速度への影響は小さい。また、投機的プリフェッチの対象のデータは、より多く保持することでアクセスされる可能性を向上させることができ、投機的プリフェッチの効果を大きくすることができる。ただし、投機的プリフェッチにより得られたデータに対するアクセス頻度が高い場合には、そのデータは動作速度がなるべく速いメモリに格納されることが好ましい。 Here, the data subject to speculative prefetching is less likely to be accessed than other data stored in the storage unit 134 including other prefetched data such as hardware prefetching. Therefore, even if the data to be subjected to speculative prefetching is stored in a memory whose operating speed is relatively slow, the effect on the data transfer speed is small. Further, by retaining more data to be subjected to speculative prefetching, the possibility of access can be improved, and the effect of speculative prefetching can be increased. However, if the data obtained by speculative prefetching is frequently accessed, it is preferable that the data be stored in a memory whose operating speed is as fast as possible.

そこで、投機的プリフェッチ部133は、取得したデータを記憶部134のMRAM138が保持する補助キャッシュ情報139として格納する。すなわち、投機的プリフェッチ部133は、投機的プリフェッチの対象のデータをMRAM138に格納して投機的プリフェッチを行なう。 Therefore, the speculative prefetch unit 133 stores the acquired data as auxiliary cache information 139 held in the MRAM 138 of the storage unit 134. That is, the speculative prefetch unit 133 stores data to be speculatively prefetched in the MRAM 138 and performs speculative prefetching.

データモニタ部140は、MRAM138に格納されたデータのアクセス頻度に応じてデータをSRAM137に移動する。以下にデータモニタ部140の詳細について説明する。 The data monitor unit 140 moves data to the SRAM 137 according to the access frequency of the data stored in the MRAM 138. Details of the data monitor section 140 will be explained below.

データモニタ部140は、MRAM138からSRAM137への移動の判定のための移動閾値を有する。データモニタ部140は、キャッシュヒットしたデータへのアクセスの通知を制御部131から受ける。そして、データモニタ部140は、補助キャッシュ情報139におけるキャッシュヒットしたデータの参照カウンタをインクリメントする。ここで、データモニタ部140は、書込速度が特に遅い場合は、書き込みによるデータアクセスの場合のインクリメント量が読み出しによるデータアクセスの場合のインクリメント量より大きくするようにインクリメント量を変えてもよい。 The data monitor unit 140 has a movement threshold for determining movement from MRAM 138 to SRAM 137. The data monitor unit 140 receives notification from the control unit 131 of access to cache hit data. Then, the data monitor unit 140 increments the reference counter of the cache hit data in the auxiliary cache information 139. Here, if the write speed is particularly slow, the data monitor unit 140 may change the increment amount so that the increment amount in the case of data access by writing is larger than the increment amount in the case of data access by reading.

次に、データモニタ部140は、キャッシュヒットしたデータの参照カウンタが移動閾値を超えたか否かを判定する。キャッシュヒットしたデータの参照カウンタが移動閾値を超えた場合、データモニタ部140は、キャッシュヒットしたデータを格納するための空き領域がSRAM137に存在するか否かを判定する。 Next, the data monitor unit 140 determines whether the reference counter of the cache hit data exceeds the movement threshold. If the reference counter of the cache hit data exceeds the movement threshold, the data monitor unit 140 determines whether there is a free space in the SRAM 137 to store the cache hit data.

キャッシュヒットしたデータを格納するための空き領域がSRAM137に存在する場合、データモニタ部140は、キャッシュヒットしたデータをMRAM138からSRAM137へ移動する。 If there is free space in the SRAM 137 to store the cache hit data, the data monitor unit 140 moves the cache hit data from the MRAM 138 to the SRAM 137.

これに対して、キャッシュヒットしたデータを格納するための空き領域がSRAM137に存在しなければ、データモニタ部140は、SRAM137に格納されたデータの中からキャッシュヒットしたデータを格納するための空き領域を確保するためのリプレイスデータを選択する。データモニタ部140は、例えば、疑似LRU(Least Recently Used)などの一般的に用いられる手法でリプレイスデータの選択を行なう。そして、データモニタ部140は、キャッシュヒットしたデータをMRAM138からSRAM137に移動する。また、データモニタ部140は、選択したリプレイスデータをSRAM137からMRAM138に移動する。 On the other hand, if there is no free space in the SRAM 137 to store the cache hit data, the data monitor unit 140 selects a free space to store the cache hit data from among the data stored in the SRAM 137. Select replacement data to secure. The data monitor unit 140 selects replacement data using a commonly used method such as pseudo LRU (Least Recently Used). The data monitor unit 140 then moves the cache hit data from the MRAM 138 to the SRAM 137. Furthermore, the data monitor unit 140 moves the selected replacement data from the SRAM 137 to the MRAM 138.

図10は、実施例2に係る制御部によるデータキャッシュ処理のフローチャートである。次に、図10を参照して、本実施例に係る制御部131によるデータキャッシュ処理の流れを説明する。ここでは、演算部11によるデータAへのアクセスが発生した場合で説明する。 FIG. 10 is a flowchart of data cache processing by the control unit according to the second embodiment. Next, with reference to FIG. 10, the flow of data cache processing by the control unit 131 according to this embodiment will be described. Here, a case will be described in which access to data A by the calculation unit 11 occurs.

制御部131は、データAの送信要求をL1キャッシュ12から受ける(ステップS401)。 The control unit 131 receives a request to send data A from the L1 cache 12 (step S401).

次に、制御部131は、データAが記憶部134に格納されたキャッシュ情報135又は補助キャッシュ情報139のいずれかに存在するか否かを判定する(ステップS402)。 Next, the control unit 131 determines whether data A exists in either the cache information 135 or the auxiliary cache information 139 stored in the storage unit 134 (step S402).

データAが記憶部134に格納されたキャッシュ情報135及び補助キャッシュ情報139のいずれにも存在しない場合(ステップS402:否定)、制御部131は、データAのキャッシュミスをキャッシュミス情報更新部132に通知する(ステップS403)。 If the data A does not exist in either the cache information 135 or the auxiliary cache information 139 stored in the storage unit 134 (step S402: negative), the control unit 131 updates the cache miss information update unit 132 with the cache miss of the data A. Notify (step S403).

次に、制御部131は、データAの送信をL3キャッシュ14に要求する(ステップS404)。 Next, the control unit 131 requests the L3 cache 14 to transmit data A (step S404).

その後、制御部131は、データAをL3キャッシュ14から取得する。そして、制御部131は、データAをSRAM137にキャッシュ情報135として格納する(ステップS405)。 Thereafter, the control unit 131 obtains data A from the L3 cache 14. Then, the control unit 131 stores data A in the SRAM 137 as cache information 135 (step S405).

これに対して、データAが記憶部134に格納されたキャッシュ情報135又は補助キャッシュ情報139のいずれかに存在する場合(ステップS402:肯定)、制御部131は、記憶部134が保持するキャッシュ情報135又はキャッシュ補助情報139の中からデータAを取得する。そして、制御部131は、データAをL1キャッシュ12及び演算部11へ送信する(ステップS406)。 On the other hand, if data A exists in either the cache information 135 or the auxiliary cache information 139 stored in the storage unit 134 (step S402: affirmative), the control unit 131 controls the cache information held by the storage unit 134. 135 or cache auxiliary information 139. Then, the control unit 131 transmits the data A to the L1 cache 12 and the calculation unit 11 (step S406).

その後、制御部131は、データAの格納場所がMRAM138か否かを判定する(ステップS407)。データAの格納場所がMRAM138でない場合(ステップS407:否定)、制御部131は、データAをそのままの状態としてデータキャッシュ処理を終了する。 After that, the control unit 131 determines whether the storage location of data A is the MRAM 138 (step S407). If the storage location of data A is not the MRAM 138 (step S407: negative), the control unit 131 leaves data A as is and ends the data cache processing.

これに対して、データAの格納場所がMRAM138の場合(ステップS407:肯定)、制御部131は、データAへのアクセスをデータモニタ部140に通知する(ステップS408)。その後、制御部131は、データキャッシュ処理を終了する。 On the other hand, if the storage location of data A is MRAM 138 (step S407: affirmative), control unit 131 notifies data monitor unit 140 of access to data A (step S408). After that, the control unit 131 ends the data cache processing.

ここで、本実施例に係る投機的プリフェッチ部133による投機的プリフェッチの流れは、図7に示したフローと同様の処理である。ただし、本実施例に係る投機的プリフェッチ部133、ステップS309において、データをMRAM138に格納する。 Here, the flow of speculative prefetch by the speculative prefetch unit 133 according to this embodiment is similar to the flow shown in FIG. 7 . However, the speculative prefetch unit 133 according to this embodiment stores data in the MRAM 138 in step S309.

図11は、データモニタ部によるデータ格納処理のフローチャートである。次に、図11を参照して、データモニタ部140によるデータキャッシュ格納処理の流れを説明する。ここでは、制御部131によるデータAへのアクセスが発生した場合で説明する。 FIG. 11 is a flowchart of data storage processing by the data monitor section. Next, with reference to FIG. 11, the flow of data cache storage processing by the data monitor unit 140 will be described. Here, a case will be described in which access to data A by the control unit 131 occurs.

データモニタ部140は、キャッシュヒットしたデータAへのアクセスの通知を制御部131から受ける(ステップS501)。 The data monitor unit 140 receives from the control unit 131 a notification of access to the cache hit data A (step S501).

次に、データモニタ部140は、補助キャッシュ情報139におけるデータAの参照カウンタをインクリメントする(ステップS502)。 Next, the data monitor unit 140 increments the reference counter for data A in the auxiliary cache information 139 (step S502).

次に、データモニタ部140は、データAの参照カウンタが移動閾値より大きいか否かを判定する(ステップS503)。データAの参照カウンタが移動閾値以下の場合(ステップS503:否定)、データモニタ部140は、データの格納処理を終了する。 Next, the data monitor unit 140 determines whether the reference counter of data A is larger than the movement threshold (step S503). If the reference counter of data A is less than or equal to the movement threshold (step S503: negative), the data monitor unit 140 ends the data storage process.

これに対して、データAの参照カウンタが移動閾値より大きい場合(ステップS503:肯定)、データモニタ部140は、データAを格納するための空き領域がSRAM137に存在するか否かを判定する(ステップS504)。 On the other hand, if the reference counter for data A is larger than the movement threshold (step S503: affirmative), the data monitor unit 140 determines whether there is free space in the SRAM 137 to store data A ( Step S504).

データAを格納するための空き領域がSRAM137に存在する場合(ステップS504:肯定)、データモニタ部140は、データAをMRAM138からSRAM137へ移動してSRAM137に格納する(ステップS505)。その後、データモニタ部140は、データの格納処理を終了する。 If there is free space in the SRAM 137 to store the data A (step S504: affirmative), the data monitor unit 140 moves the data A from the MRAM 138 to the SRAM 137 and stores it in the SRAM 137 (step S505). Thereafter, the data monitor unit 140 ends the data storage process.

これに対して、データAを格納するための空き領域がSRAM137に存在しない場合(ステップS504:否定)、データモニタ部140は、SRAM137に格納されたデータの中からリプレイスデータを選択する(ステップS506)。ここでは、データモニタ部140が、リプレイスデータとしてデータBを選択した場合で説明する。 On the other hand, if there is no free space in the SRAM 137 to store data A (step S504: negative), the data monitor unit 140 selects replacement data from among the data stored in the SRAM 137 (step S506). ). Here, a case will be described in which the data monitor unit 140 selects data B as the replacement data.

次に、データモニタ部140は、データAをMRAM138からSRAM137に移動してSRAM137に格納する。また、データモニタ部140は、データBをSRAM137からMRAM138に移動してMRAM138に格納する(ステップS507)。その後、データモニタ部140は、データの格納処理を終了する。 Next, the data monitor unit 140 moves data A from the MRAM 138 to the SRAM 137 and stores it in the SRAM 137. Furthermore, the data monitor unit 140 moves data B from the SRAM 137 to the MRAM 138 and stores it in the MRAM 138 (step S507). Thereafter, the data monitor unit 140 ends the data storage process.

以上に説明したように、本実施例に係るL2キャッシュは、SRAMとSRAMよりも記憶密度の高いメモリとの混載メモリであり、投機的プリフェッチの対象のデータをSRAMよりも記憶密度の高いメモリに格納する。また、本実施例に係るL2キャッシュは、MRAMに格納したデータのアクセス頻度が高い場合には、そのデータをSRAMに移動する。このように、L2キャッシュに格納されたデータのうちアクセスの可能性が低い投機的プリフェッチによるデータを記憶密度の高いMRAMに格納することで、データの転送速度の低下を抑えつつ、投機的プリフェッチによるデータをより多く保持することができる。これにより、投機的プリフェッチによるキャッシュヒット率を向上させることができ、投機的プリフェッチの効果を大きくすることができる。 As explained above, the L2 cache according to this embodiment is a mixed memory of SRAM and memory with higher storage density than SRAM, and the data to be speculatively prefetched is transferred to the memory with higher storage density than SRAM. Store. Furthermore, when the data stored in MRAM is accessed frequently, the L2 cache according to the present embodiment moves the data to SRAM. In this way, by storing speculative prefetch data that is unlikely to be accessed among the data stored in the L2 cache in MRAM with high storage density, data transfer speed can be suppressed while reducing speculative prefetch data. Can hold more data. Thereby, the cache hit rate due to speculative prefetching can be improved, and the effect of speculative prefetching can be increased.

(変形例)
実施例2におけるMRAM138は、L2キャッシュ13内でのビクティムキャッシュとして用いることも可能である。以下で、MRAM138をビクティムキャッシュとして用いる場合の動作について説明する。
(Modified example)
The MRAM 138 in the second embodiment can also be used as a victim cache within the L2 cache 13. The operation when using the MRAM 138 as a victim cache will be described below.

図12は、MRAMをビクティムキャッシュとして用いる場合のデータキャッシュ処理のフローチャートである。図12を参照して、MRAM138をビクティムキャッシュとして用いる場合のデータキャッシュ処理を説明する。ここでは、演算部11がデータAへのアクセスを要求し、且つ、データAがL2キャッシュ13に存在しない場合で説明する。 FIG. 12 is a flowchart of data cache processing when MRAM is used as a victim cache. With reference to FIG. 12, data cache processing when using the MRAM 138 as a victim cache will be described. Here, a case will be described in which the calculation unit 11 requests access to data A and data A does not exist in the L2 cache 13.

制御部131は、データAの取得要求をL1キャッシュ12から受けて、データAが記憶部134のキャッシュ情報135及び補助キャッシュ情報139のいずれかとして格納されているか否かを判定する。この場合、データAは記憶部134に格納されておらず、制御部131はデータAを検出できないため、データAのキャッシュミスが発生する(ステップS601)。 The control unit 131 receives an acquisition request for data A from the L1 cache 12 and determines whether data A is stored as either cache information 135 or auxiliary cache information 139 in the storage unit 134. In this case, since data A is not stored in the storage unit 134 and the control unit 131 cannot detect data A, a cache miss of data A occurs (step S601).

次に、制御部131は、データAの送信をL3キャッシュ14に要求する(ステップS602)。 Next, the control unit 131 requests the L3 cache 14 to transmit data A (step S602).

次に、制御部131は、SRAM137にデータAを格納する空き領域が存在するか否かを判定する(ステップS603)。データAを格納する空き領域が存在する場合(ステップS603:肯定)、制御部131は、ステップS608へ進む。 Next, the control unit 131 determines whether there is any free space in the SRAM 137 to store the data A (step S603). If there is free space to store data A (step S603: affirmative), the control unit 131 proceeds to step S608.

これに対して、データAを格納する空き領域が存在しない場合(ステップS603:否定)、制御部131は、データAを格納する空き領域を確保するために、SRAM137のキャッシュ情報135の中から削除するデータBを選択する(ステップS604)。 On the other hand, if there is no free space to store the data A (step S603: negative), the control unit 131 deletes the data from the cache information 135 of the SRAM 137 in order to secure the free space to store the data A. Data B to be processed is selected (step S604).

次に、制御部131は、MRAM138にデータBを格納する空き領域が存在するか否かを判定する(ステップS605)。データBを格納する空き領域が存在する場合(ステップS605:肯定)、制御部131は、ステップS607へ進む。 Next, the control unit 131 determines whether there is a free area in the MRAM 138 to store the data B (step S605). If there is free space to store data B (step S605: affirmative), the control unit 131 proceeds to step S607.

これに対して、データBを格納する空き領域が存在しない場合(ステップS605:否定)、制御部131は、データBを格納する空き領域を確保するために、MRAM138の補助キャッシュ情報139から削除するデータを選択する。そして、制御部131は、選択したデータをMRAM138の補助キャッシュ情報139から削除する(ステップS606)。その後、制御部131は、ステップS607へ進む。 On the other hand, if there is no free space to store the data B (step S605: negative), the control unit 131 deletes the data from the auxiliary cache information 139 of the MRAM 138 in order to secure a free space to store the data B. Select data. Then, the control unit 131 deletes the selected data from the auxiliary cache information 139 of the MRAM 138 (step S606). After that, the control unit 131 proceeds to step S607.

次に、制御部131は、データBをMRAM138に格納する(ステップS607)。 Next, the control unit 131 stores data B in the MRAM 138 (step S607).

その後、制御部131は、データAをL3キャッシュ14から取得する。そして、制御部131は、データAをSRAM137に格納する(ステップS608)。 Thereafter, the control unit 131 obtains data A from the L3 cache 14. Then, the control unit 131 stores data A in the SRAM 137 (step S608).

以上に説明したように、L2キャッシュ内のMRAMは、L2キャッシュ内でのビクティムキャッシュとして使用することも可能である。これにより、L2キャッシュ内のMRAMをより効率的に使用することが可能となる。 As explained above, the MRAM in the L2 cache can also be used as a victim cache in the L2 cache. This allows the MRAM in the L2 cache to be used more efficiently.

1 情報処理装置
11 演算部
12 L1キャッシュ
13 L2キャッシュ
14 L3キャッシュ
15 メインメモリ
16 補助記憶装置
17 表示装置
18 入力装置
121 制御部
122 記憶部
123 キャッシュ情報
131 制御部
132 キャッシュミス情報更新部
133 投機的プリフェッチ部
134 記憶部
135 キャッシュ情報
136 キャッシュミス情報
140 データモニタ部
1 Information Processing Device 11 Arithmetic Unit 12 L1 Cache 13 L2 Cache 14 L3 Cache 15 Main Memory 16 Auxiliary Storage Device 17 Display Device 18 Input Device 121 Control Unit 122 Storage Unit 123 Cache Information 131 Control Unit 132 Cache Miss Information Update Unit 133 Speculative Prefetch unit 134 Storage unit 135 Cache information 136 Cache miss information 140 Data monitor unit

Claims (8)

演算部及び1つ又は階層化された複数のキャッシュを有する演算処理装置であって、
前記キャッシュの少なくとも1つは、
データを格納する記憶部と、
前記演算部又は上位キャッシュからデータアクセス要求を受けて、前記データアクセス要求の対象データが前記記憶部に存在する場合に前記対象データにアクセスし、前記対象データが前記記憶部に存在しない場合に前記対象データを下位キャッシュ又はメインメモリから取得して前記記憶部に格納する制御部と、
前記対象データが前記記憶部に存在しないことを示すキャッシュミスの発生回数を算出する情報管理部と、
前記発生回数を基に投機的データを前記メインメモリ又は前記下位キャッシュから取得して、取得した前記投機的データを前記記憶部に格納する投機的プリフェッチ部とを備えた
ことを特徴とする演算処理装置。
An arithmetic processing device having an arithmetic unit and one or a plurality of hierarchical caches,
At least one of the caches includes:
a storage unit that stores data;
Upon receiving a data access request from the arithmetic unit or upper cache, if the target data of the data access request exists in the storage unit, the target data is accessed, and if the target data does not exist in the storage unit, the target data is accessed. a control unit that acquires target data from a lower cache or main memory and stores it in the storage unit;
an information management unit that calculates the number of cache misses that indicate that the target data does not exist in the storage unit;
and a speculative prefetch unit that acquires speculative data from the main memory or the lower cache based on the number of occurrences and stores the acquired speculative data in the storage unit. Device.
前記情報管理部は、前記発生回数をアドレス範囲毎に算出し、
前記投機的プリフェッチ部は、前記発生回数を基に、前記アドレス範囲のいずれかを選択して、選択した前記アドレス範囲に含まれる前記投機的データを取得する
ことを特徴とする請求項1に記載の演算処理装置。
The information management unit calculates the number of occurrences for each address range,
The speculative prefetch unit selects one of the address ranges based on the number of occurrences and acquires the speculative data included in the selected address range. arithmetic processing unit.
前記記憶部は、メイン領域と予備領域とを有し、
前記投機的プリフェッチ部は、前記投機的データを前記予備領域に格納する
ことを特徴とする請求項1に記載の演算処理装置。
The storage unit has a main area and a spare area,
The arithmetic processing device according to claim 1, wherein the speculative prefetch unit stores the speculative data in the spare area.
前記予備領域に格納された複数のデータのデータ毎のアクセス頻度を算出し、前記アクセス頻度を基にデータを選択して前記メイン領域に格納するデータモニタ部をさらに備えたことを特徴とする請求項3に記載の演算処理装置。 A claim further comprising a data monitor unit that calculates an access frequency for each of the plurality of data stored in the spare area, selects data based on the access frequency, and stores the selected data in the main area. The arithmetic processing device according to item 3. 前記制御部は、前記対象データが前記記憶部に存在しない場合に前記対象データを前記下位キャッシュ又は前記メインメモリから取得し、前記対象データを格納する空き領域が前記メイン領域に存在しない場合、前記メイン領域から前記予備領域に特定のデータを移動して、前記対象データを前記メイン領域に格納することを特徴とする請求項3に記載の演算処理装置。 The control unit acquires the target data from the lower cache or the main memory when the target data does not exist in the storage unit, and acquires the target data from the lower cache or the main memory when the target data is not stored in the main area. 4. The arithmetic processing device according to claim 3, wherein specific data is moved from the main area to the spare area and the target data is stored in the main area. 前記投機的プリフェッチ部は、自己が搭載されたキャッシュと前記メインメモリ又は前記下位キャッシュとの間のバスの処理能力に余裕があるか否かを判定し、処理能力に余裕がある場合に、前記投機的データを前記メインメモリ又は前記下位キャッシュから取得して、取得した前記投機的データを前記記憶部に格納することを特徴とする請求項1に記載の演算処理装置。 The speculative prefetch unit determines whether or not there is sufficient processing capacity on the bus between the cache in which it is mounted and the main memory or the lower cache, and if there is sufficient processing capacity, the speculative prefetch unit 2. The arithmetic processing device according to claim 1, wherein speculative data is acquired from the main memory or the lower cache, and the acquired speculative data is stored in the storage unit. 前記投機的プリフェッチ部は、前記バスの処理量を表す指標の値を算出して、算出した値と閾値との比較を基に、前記処理能力に余裕があるか否かを判定することを特徴とする請求項6に記載の演算処理装置。 The speculative prefetch unit calculates a value of an index representing the processing amount of the bus, and determines whether or not there is enough processing capacity based on a comparison between the calculated value and a threshold value. 7. The arithmetic processing device according to claim 6. 演算部、メインメモリ及び1つ又は階層化された複数のキャッシュを用いる演算処理方法であって、
前記キャッシュの少なくとも1つに、
前記演算部又は上位キャッシュからデータアクセス要求を受けさせ、
前記データアクセス要求の対象データが当該キャッシュの記憶領域に存在する場合に前記対象データにアクセスさせ、
前記対象データが前記記憶領域に存在しない場合に前記対象データを下位キャッシュ又は前記メインメモリから取得させて前記記憶領域に格納させ、
前記対象データが前記記憶領域に存在しないことを示すキャッシュミスの発生回数を算出させ、
前記発生回数を基に投機的データを前記メインメモリ又は前記下位キャッシュから取得させ、取得した前記投機的データを前記記憶領域に格納させる
ことを特徴とする演算処理方法。
An arithmetic processing method using an arithmetic unit, a main memory, and one or a plurality of hierarchical caches, the method comprising:
at least one of the caches,
receive a data access request from the arithmetic unit or upper cache;
accessing the target data when the target data of the data access request exists in the storage area of the cache;
If the target data does not exist in the storage area, acquiring the target data from a lower cache or the main memory and storing it in the storage area;
calculating the number of occurrences of cache misses indicating that the target data does not exist in the storage area;
An arithmetic processing method comprising: acquiring speculative data from the main memory or the lower cache based on the number of occurrences, and storing the acquired speculative data in the storage area.
JP2022113918A 2022-07-15 2022-07-15 Arithmetic processing apparatus and arithmetic processing method Pending JP2024011696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022113918A JP2024011696A (en) 2022-07-15 2022-07-15 Arithmetic processing apparatus and arithmetic processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022113918A JP2024011696A (en) 2022-07-15 2022-07-15 Arithmetic processing apparatus and arithmetic processing method

Publications (1)

Publication Number Publication Date
JP2024011696A true JP2024011696A (en) 2024-01-25

Family

ID=89621758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022113918A Pending JP2024011696A (en) 2022-07-15 2022-07-15 Arithmetic processing apparatus and arithmetic processing method

Country Status (1)

Country Link
JP (1) JP2024011696A (en)

Similar Documents

Publication Publication Date Title
US20240004800A1 (en) Write merging on stores with different tags
JP4486750B2 (en) Shared cache structure for temporary and non-temporary instructions
US8041897B2 (en) Cache management within a data processing apparatus
US6957304B2 (en) Runahead allocation protection (RAP)
US6138213A (en) Cache including a prefetch way for storing prefetch cache lines and configured to move a prefetched cache line to a non-prefetch way upon access to the prefetched cache line
US4774654A (en) Apparatus and method for prefetching subblocks from a low speed memory to a high speed memory of a memory hierarchy depending upon state of replacing bit in the low speed memory
US9672161B2 (en) Configuring a cache management mechanism based on future accesses in a cache
US20130111136A1 (en) Variable cache line size management
US20080320228A1 (en) Method and apparatus for efficient replacement algorithm for pre-fetcher oriented data cache
US20070239940A1 (en) Adaptive prefetching
US20100217937A1 (en) Data processing apparatus and method
EP1869557B1 (en) Global modified indicator to reduce power consumption on cache miss
US11526449B2 (en) Limited propagation of unnecessary memory updates
JP3732397B2 (en) Cash system
US7353341B2 (en) System and method for canceling write back operation during simultaneous snoop push or snoop kill operation in write back caches
JP2001249846A (en) Cache memory device and data processing system
JP2024011696A (en) Arithmetic processing apparatus and arithmetic processing method
JP2024511768A (en) Method and apparatus for DRAM cache tag prefetcher
US9552293B1 (en) Emulating eviction data paths for invalidated instruction cache
JP7311959B2 (en) Data storage for multiple data types
US11397680B2 (en) Apparatus and method for controlling eviction from a storage structure
Khan Brief overview of cache memory
JPH07101412B2 (en) Data pre-fetching method and multiprocessor system