JP2013210961A - Cache memory device, method of controlling cache memory, and information processing device - Google Patents
Cache memory device, method of controlling cache memory, and information processing device Download PDFInfo
- Publication number
- JP2013210961A JP2013210961A JP2012082322A JP2012082322A JP2013210961A JP 2013210961 A JP2013210961 A JP 2013210961A JP 2012082322 A JP2012082322 A JP 2012082322A JP 2012082322 A JP2012082322 A JP 2012082322A JP 2013210961 A JP2013210961 A JP 2013210961A
- Authority
- JP
- Japan
- Prior art keywords
- access
- access request
- data
- memory
- cache
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は、キャッシュメモリ装置及びキャッシュメモリの制御方法並びに情報処理装置に関し、例えば、複数のアクセス要求を処理するためのキャッシュメモリ装置及びキャッシュメモリの制御方法並びに情報処理装置に関する。 The present invention relates to a cache memory device, a cache memory control method, and an information processing device. For example, the present invention relates to a cache memory device, a cache memory control method, and an information processing device for processing a plurality of access requests.
プロセッサの速度向上に対して、外部メモリの速度向上は限られる。そのため、プロセッサと外部メモリとの間にキャッシュメモリを設けることで、システム全体としてのメモリレイテンシやスループットの改善を図る手法が用いられている。 The speed improvement of the external memory is limited to the speed improvement of the processor. Therefore, a technique for improving memory latency and throughput of the entire system by providing a cache memory between the processor and the external memory is used.
ここで、キャッシュメモリは、応答速度とコスト(容量)との関係から複数に階層化されていることが一般的である。すなわち、最上位階層の一次キャッシュは、高速アクセスが可能な代わりに、その高速性を維持することや消費電力のため容量が制限される。そこで、一次キャッシュは、プロセッサの役割を担うIPコア(Intellectual Property Core)のプライベートキャッシュとして用いられることが多い。 Here, the cache memory is generally hierarchized into a plurality of layers from the relationship between response speed and cost (capacity). In other words, the primary cache of the highest hierarchy is limited in capacity for maintaining high speed and power consumption instead of enabling high speed access. Therefore, the primary cache is often used as a private cache of an IP core (Intellectual Property Core) that plays the role of a processor.
一方、二次キャッシュ以降は、一次キャッシュと比べて容量が確保できる代わりに、アクセス速度が相対的に遅くなる。そこで、二次キャッシュ以降は、複数のIPコアから共有される共有キャッシュメモリとして用いられることが多い。ここで、共有キャッシュメモリは、複数のアクセス要求に対して応答する必要がある。そのためには、例えば、マルチバンクやマルチポートといった技術が挙げられる。 On the other hand, after the secondary cache, the access speed is relatively slow instead of securing the capacity compared to the primary cache. Therefore, after the secondary cache, it is often used as a shared cache memory shared by a plurality of IP cores. Here, the shared cache memory needs to respond to a plurality of access requests. For this purpose, for example, techniques such as multi-bank and multi-port can be cited.
非特許文献1には、マルチバンクに関する技術が開示されている。非特許文献1にかかるL2キャッシュメモリは、命令又はデータのキャッシュであり、物理的に8バンクに分割されている。また、当該L2キャッシュメモリは、全CPUの間で論理的に共有されている。そして、当該L2キャッシュメモリは、キャッシュラインの物理アドレス(64バイト)の下位ビットを用いてインターリーブするものである。
Non-Patent
また、特許文献1には、マルチポートに関する技術が開示されている。特許文献1にかかるマルチポートキャッシュメモリは、各メモリセルについて複数の入出力ポートを有する。そのため、同一のキャッシュメモリに対して複数のアクセス要求が発生しても、複数のメモリセルに対して同時並行に処理が可能である。
しかしながら、非特許文献1には、複数のアクセス要求に対する全ての応答が完了するまでの時間が長くなる場合があるという問題点がある。それは、複数のアクセス要求のアクセス対象のアドレスが同一のバンクを指す場合(いわゆるバンク競合の場合)に、各アクセス要求を並列に処理できないためである。したがって、バンク競合を減らすように並列に実行するプログラムをチューニングする必要などが生じる可能性がある。
However, Non-Patent
尚、特許文献1にかかるマルチポートキャッシュメモリは、一次キャッシュを対象としたものである。一般にマルチポートメモリは、面積コストが大きく、二次キャッシュ以降のキャッシュメモリの様に容量が重要なキャッシュメモリには適さない。よって、特許文献1では、上述した課題を解決することができない。
Note that the multi-port cache memory according to
その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。 Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.
一実施の形態によれば、キャッシュメモリ装置は、第1のアクセス要求に対して複数のタグメモリへのキャッシュヒット判定を行い、第2のアクセス要求に基づき前記複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求におけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、前記第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始する。 According to one embodiment, the cache memory device performs a cache hit determination on a plurality of tag memories in response to the first access request, and accesses any one of the plurality of data memories based on the second access request. During processing, if the data memory corresponding to the tag memory specified at the time of the cache hit in the first access request is not being accessed based on the second access request, the data memory is accessed. Start processing.
また、他の実施の形態によれば、キャッシュメモリ装置は、アソシアティブキャッシュメモリに対する第1のアクセス要求に基づき複数のウェイのいずれかにデータアクセス中に、当該第1のアクセス要求以外の第2のアクセス要求におけるキャッシュヒットにより特定されるウェイが、当該第1のアクセス要求に基づきデータアクセス中ではない場合、当該特定されるウェイに対するデータアクセスを開始する。 Further, according to another embodiment, the cache memory device may perform second data other than the first access request during data access to any of the plurality of ways based on the first access request to the associative cache memory. If the way specified by the cache hit in the access request is not being accessed based on the first access request, data access to the specified way is started.
さらに、他の実施の形態によれば、キャッシュメモリの制御方法は、第1のアクセス要求に基づきキャッシュヒットしたタグメモリを特定し、当該第1のアクセス要求以外の第2のアクセス要求に基づき複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求における前記特定されたタグメモリに対応するデータメモリが当該第1のアクセス要求以外の第2のアクセス要求に基づきアクセス処理中であるか否かを判定し、前記アクセス処理中ではないと判定した場合に、前記第1のアクセス要求に基づきアクセス処理を開始する。 Furthermore, according to another embodiment, the cache memory control method specifies a tag memory that has a cache hit based on the first access request, and a plurality of cache memory control methods based on second access requests other than the first access request. The data memory corresponding to the identified tag memory in the first access request is being accessed based on the second access request other than the first access request. It is determined whether or not there is an access process, and when it is determined that the access process is not in progress, the access process is started based on the first access request.
また、他の実施の形態によれば、情報処理装置は、複数のプロセッサコアのいずれかからの第1のアクセス要求に対して複数のタグメモリへのキャッシュヒット判定を行い、当該第1のアクセス要求とは異なる第2のアクセス要求に基づき前記複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求におけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、前記第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始する。 Further, according to another embodiment, the information processing apparatus performs cache hit determination to a plurality of tag memories in response to a first access request from any of a plurality of processor cores, and performs the first access During access processing to any of the plurality of data memories based on a second access request different from the request, a data memory corresponding to a tag memory specified at the time of a cache hit in the first access request, When access processing is not being performed based on the second access request, access processing to the data memory is started.
前記一実施の形態によれば、複数のアクセス要求に対する全ての応答が完了するまでの時間を短縮することができる。 According to the one embodiment, it is possible to shorten the time until all responses to a plurality of access requests are completed.
以下では、上述した課題を解決するための手段を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。各図面において、同一要素には同一の符号が付されており、説明の明確化のため、必要に応じて重複説明は省略する。 Hereinafter, specific embodiments to which means for solving the above-described problems are applied will be described in detail with reference to the drawings. In the drawings, the same elements are denoted by the same reference numerals, and redundant description will be omitted as necessary for the sake of clarity.
<実施の形態1>
図1は、本実施の形態1にかかるキャッシュメモリ装置100の構成を示すブロック図である。キャッシュメモリ装置100は、複数のアクセス要求ARを受け付けて、それぞれの要求元に対する応答としてのデータ転送DTを部分的に並列処理するものである。尚、アクセス要求に対する応答は、データ転送の他、書き込み処理等のデータメモリへのアクセス処理を含むものとする。キャッシュメモリ装置100は、制御部110と、タグメモリ群120と、データメモリ群130とを備える。
<
FIG. 1 is a block diagram illustrating a configuration of the
タグメモリ群120は、複数のタグメモリ121〜12nを含む。データメモリ群130は、複数のデータメモリ131〜13nを含む。ここで、タグメモリ121〜12nと、データメモリ131〜13nとはそれぞれが対応するものである。例えば、タグメモリ121とデータメモリ131とが対応し、この対応関係をウェイW1と定義する。同様に、タグメモリ122とデータメモリ132との対応関係がウェイW2であり、・・・タグメモリ12nとデータメモリ13nとの対応関係がウェイWnである。尚、タグメモリ121〜12n並びにデータメモリ131〜13nは、それぞれ異なるメモリモジュールとする。メモリモジュールとしては、例えば、SRAM(Static Random Access Memory)が採用できる。そのため、タグメモリ121〜12nには並列にキャッシュヒット判定のアクセスが可能である。また、データメモリ131〜13nには並列にデータアクセス処理が可能である。例えば、データメモリ131とデータメモリ132から並列にデータ転送が可能である。
The
制御部110は、第1のアクセス要求ARに対して複数のタグメモリ121〜12nへのキャッシュヒット判定を行う。そして、制御部110は、第2のアクセス要求に基づき複数のデータメモリのいずれかにアクセス処理中に、第1のアクセス要求ARにおけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始する。つまり、制御部110は、アクセス要求ARがキャッシュヒットしたウェイと、他のアクセス要求がキャッシュヒットしたウェイとが異なるか否かを判定し、異なると判定した場合に当該ウェイへのデータアクセス処理を開始する。また、他のアクセス要求は、アクセス要求ARに先行して受け付けられたものとする。特に、制御部110は、アクセス処理として、データメモリから読み出したデータをアクセス要求ARの要求元へバースト転送する。
The
これにより、複数のアクセス要求のデータ転送を部分的に並列処理できるため、全体としてデータ転送処理時間を短縮することができる。 As a result, data transfer of a plurality of access requests can be partially processed in parallel, so that the data transfer processing time can be shortened as a whole.
図2は、本実施の形態1にかかるキャッシュメモリ装置100の制御処理の流れを示すフローチャートである。まず、制御部110は、受け付けたアクセス要求ARがキャッシュヒットであるか否かを判定する(S101)。ステップS101においてキャッシュヒットであると判定した場合、制御部110は、ヒットしたウェイを特定する(S102)。すなわち、制御部110は、第1のアクセス要求に基づきキャッシュヒットしたタグメモリを特定する。
FIG. 2 is a flowchart showing a flow of control processing of the
ここで、この時点で少なくともアクセス要求ARにより先行又は同時に受け付けられたアクセス要求に基づきデータメモリ群130内のいずれかのデータメモリに対するアクセス処理が実行中であるものとする。このとき、制御部110は、特定されたウェイにかかるデータメモリがアクセス処理中であるか否かを判定する(S103)。
Here, it is assumed that, at this time, an access process for any one of the data memories in the
ステップS103においてアクセス処理中であると判定した場合、制御部110は、アクセス要求ARに基づくアクセス処理を待機する(S104)。そして、一定時間後に、再度、ステップS103を実行する。また、ステップS103においてアクセス処理中でないと判定した場合、制御部110は、アクセス要求ARに基づきアクセス処理を開始する(S105)。例えば、第1のアクセス要求以外の第2のアクセス要求に基づきデータメモリ132に対してアクセス処理中であっても、ステップS102により特定されたタグメモリに対応するデータメモリ131が第2のアクセス要求に基づきアクセス処理中ではないため、第1のアクセス要求に基づきアクセス処理を開始する。また、ステップS104による待機の間に第2のアクセス要求に基づくアクセス処理が完了すれば、ステップS103においてアクセス処理中でないと判定される。
If it is determined in step S103 that the access process is being performed, the
また、ステップS101においてキャッシュミスであると判定した場合、制御部110は、該当データのロード処理する(S106)。
If it is determined in step S101 that there is a cache miss, the
そのため、例えば、先行するアクセス要求に基づいて任意のデータメモリからデータ転送中に、後続するアクセス要求を受け付けた場合、キャッシュメモリ装置100は、後続するアクセス要求のアクセス対象として特定されたデータメモリが、先行するアクセス要求に基づきデータ転送中でなければ、後続するアクセス要求のデータ転送を開始する。そのため、先行するアクセス要求と後続するアクセス要求とに基づくデータ転送が部分的に並列実行される。よって、先行するアクセス要求のデータ転送が完了するまで待ち合わせるようなシーケンシャルに処理する場合に比べて、全体のデータ転送時間を短縮することができる。
Therefore, for example, when a subsequent access request is received during data transfer from an arbitrary data memory based on the preceding access request, the
尚、本実施の形態1にかかるキャッシュメモリ装置100は、次のように言い換えることができる。すなわち、キャッシュメモリ装置は、アソシアティブキャッシュメモリに対する第1のアクセス要求に基づき複数のウェイのいずれかにデータアクセス中に、当該第1のアクセス要求以外の第2のアクセス要求におけるキャッシュヒットにより特定されるウェイが、当該第1のアクセス要求に基づきデータアクセス中ではない場合、当該特定されるウェイに対するデータアクセスを開始する。
The
このように、実施の形態1は例えば、通常の複数ウェイを持ったセットアソシアティブキャッシュを拡張することで実現可能である。すなわち、キャッシュタグはシーケンシャルにサーチし、その結果によって、ウェイがアクセス処理中でなければ、並列にデータアクセスをできるようにするものである。つまり、アクセスするウェイが異なれば、アクセス処理中でないため、異なったイニシエータから並列アクセス可能となり、スループットが向上する。特に、バースト転送によって、タグ引きサイクルに比べて、データアレイへのアクセスサイクルが長くなる場合に有効である。 As described above, the first embodiment can be realized, for example, by expanding a set associative cache having a normal plurality of ways. That is, the cache tag searches sequentially, and the result allows data access in parallel if the way is not being accessed. In other words, if the way to be accessed is different, the access processing is not in progress, so that parallel access is possible from different initiators, and the throughput is improved. This is particularly effective when the access cycle to the data array becomes longer than the tag pulling cycle due to burst transfer.
上述したように共有キャッシュメモリは、複数のIPコアからのアクセス要求に対して応答する必要が生じる。そのため、プライベートキャッシュのヒット率が低いアプリケーション実行時などには、この共有キャッシュメモリがアクセスネックとなり、性能を律速する可能性が生じる。 As described above, the shared cache memory needs to respond to access requests from a plurality of IP cores. For this reason, when an application with a low private cache hit rate is executed, the shared cache memory becomes an access bottleneck, which may limit the performance.
続いて、以下に非特許文献1における課題と、本実施の形態1による課題の解決及び効果について詳述する。共有キャッシュメモリには、上述の通りキャッシュネックが存在するが、これに対して上述したマルチバンク方式のキャッシュメモリが利用されていることが多い。マルチバンク方式は、アドレスの特定ビットを識別ビットとして割り付け、複数のキャッシュメモリの中から識別ビットによって該当するキャッシュメモリを決定してアクセスを行うものである。これにより、識別ビット(バンクアドレス)の異なるキャッシュメモリに対しては、異なったIPコアからのアクセス要求を許容することができる。
Subsequently, the problem in
図10は、非特許文献1にかかるマルチバンクによるプロセッサシステムの構成を示すブロック図である。L2キャッシュメモリL20〜L27は、命令又はデータのキャッシュであり、物理的に8バンクに分割されている。また、L2キャッシュメモリL20〜L27は、全CPUの間で論理的に共有されている。そして、L2キャッシュメモリL20〜L27は、キャッシュラインの物理アドレス(64バイト)の下位ビットを用いてインターリーブするものである。これは、非特許文献1のpp285.左側の15-17行目に、"The L2 banks are interleaved using the lower address bits of a cache line's physical address (64-byte line)."と記載されていることから明らかである。
FIG. 10 is a block diagram illustrating a configuration of a multi-bank processor system according to
そのため、非特許文献1では、例えば、2つのアクセス要求が1つのL2キャッシュメモリ(バンク)に対してアクセスする場合には、一方のアクセス要求によるキャッシュのヒット判定を行い、ヒットした場合にL2キャッシュメモリから該当データを読み出し、要求元へデータ転送を行う。そして、当該データ転送が完了した後に、他方のアクセス要求に対するヒット判定等の処理が開始される。つまり、バンク競合の場合には、アクセス要求をシーケンシャルに処理せざるを得ず、結果として、複数のアクセス要求に対する全ての応答が完了するまでの時間が長くなってしまう。
Therefore, in
また、非特許文献1のようなマルチバンク方式では、アドレスによって一意にアクセスするキャッシュメモリが決定できるため、構成が容易となる。しかし、次のような主な3つの課題が挙げられる。1つ目は、複数のキャッシュヒットミス判定などの制御論理が必要なことである。2つ目は、バンクアドレスを分散させるチューニングが必要になることである。これは、バンクアドレスが分散しない場合には、特定のキャッシュメモリのバンクのみにアクセスが集中するためである。3つ目は、キャッシュメモリに対するアクセス負荷に対して、電源切断によるキャッシュ容量の増減などに対応しづらいことである。
In addition, in the multi-bank system as in
そこで、1バンク内を複数のウェイにより管理するセットアソシアティブ方式を用いることが考えられる。セットアソシアティブ方式では、あるアドレスのデータについて複数のキャッシュエントリ、つまりウェイのいずれかに格納することが可能である。しかし、セットアソシアティブ方式では、あるアクセス要求についてキャッシュヒットした場合に、ヒットしたウェイにおけるデータの転送が完了するまでの間、他のアクセス要求についての処理を進められない。つまり、並列したアクセス要求に対応していない。 Therefore, it is conceivable to use a set associative method in which one bank is managed by a plurality of ways. In the set associative method, data at a certain address can be stored in one of a plurality of cache entries, that is, ways. However, in the set associative method, when a cache hit occurs for a certain access request, the processing for another access request cannot proceed until the data transfer in the hit way is completed. That is, it does not support parallel access requests.
ここで、このような共有キャッシュメモリは、上位のプライベートキャッシュを介したアクセスが中心となるため、複数個のデータを何回かのサイクルに分けて転送するバースト転送がほとんどになる。ここで、シングルデータ転送では、転送ごとにキャッシュタグを比較する必要が生じる。一方、バースト転送では、転送開始時のみキャッシュタグを比較するだけでよい。つまり、バースト転送では、1サイクル目でキャッシュタグの比較を行い、キャッシュヒットした場合には、データメモリに格納されたデータを複数サイクルによりバースト転送する。上述の通り、キャッシュタグへのヒットミス判定は、1サイクルで可能であるにもかかわらず、バースト転送の間のサイクル中の間も、他のアクセス要求についてのヒットミス判定が待機させられていた。 Here, since such a shared cache memory is mainly accessed through a higher-level private cache, burst transfer in which a plurality of data is transferred in several cycles is mostly performed. Here, in single data transfer, it is necessary to compare cache tags for each transfer. On the other hand, in burst transfer, it is only necessary to compare cache tags at the start of transfer. That is, in the burst transfer, the cache tags are compared in the first cycle, and when the cache hits, the data stored in the data memory is burst transferred in a plurality of cycles. As described above, hit miss determination for the cache tag is possible in one cycle, but hit miss determination for other access requests is kept waiting even during the cycle between burst transfers.
そこで、本実施の形態1では、複数のキャッシュエントリの候補すなわちウェイを、キャッシュタグアクセス後に並列にアクセスするものである。すなわち、本実施の形態1は、複数のアクセス要求に対して、タグメモリへのアクセスは直列に行い、データメモリへのアクセスは並列に行うキャッシュメモリ装置である。これにより、スループット向上が可能となり、マルチバンク方式に匹敵するスループット向上が可能になる。しかも、マルチバンク方式キャッシュのチューニングコスト、容量増減、論理量などの課題を解決できる。 Therefore, in the first embodiment, a plurality of cache entry candidates, that is, ways, are accessed in parallel after the cache tag is accessed. That is, the first embodiment is a cache memory device that performs access to a tag memory in series and accesses data memory in parallel in response to a plurality of access requests. Thereby, throughput can be improved, and throughput comparable to the multi-bank method can be achieved. In addition, problems such as the tuning cost, capacity increase / decrease, and logical amount of the multi-bank cache can be solved.
<実施の形態2>
本実施の形態2では、上述した実施の形態1の具体的な実施例であり、複数のアクセス要求を同時に受け付けた場合に、アクセス要求を調停するものである。
<Embodiment 2>
The second embodiment is a specific example of the first embodiment described above, and arbitrates access requests when a plurality of access requests are received simultaneously.
図3は、本実施の形態2にかかるマルチプロセッサシステム200の構成を示すブロック図である。マルチプロセッサシステム200は、IPコア211〜214と、L1キャッシュ221〜224と、キャッシュメモリ装置230と、SDRAM(Synchronous Dynamic Random Access Memory)240とを備える。つまり、マルチプロセッサシステム200は、L1キャッシュ221〜224と、L2キャッシュであるキャッシュメモリ装置230と、さらに下位層のSDRAM240との階層メモリを有する。
FIG. 3 is a block diagram showing a configuration of the
IPコア211〜214は、データの読み出しや書き込みをするためのアクセス要求を階層メモリに対して行う。IPコア211〜214は、それぞれL1キャッシュ221〜224を備える。IPコア211〜214は、L1キャッシュミスの場合、アクセス要求バスB20を介してアービタスケジューラ231へアクセス要求を発行する。尚、IPコアの数はこれに限定されない。
The IP cores 211 to 214 make access requests for reading and writing data to the hierarchical memory. The IP cores 211 to 214 include
アービタスケジューラ231は、複数のアクセス要求を受け付け、調停を行った上で、L2HIT/MISS判定部232に対して一つずつアクセス要求を発行する。尚、調停を実現するためのアルゴリズム等は公知なもののいずれを採用しても構わない。L2HIT/MISS判定部232は、アクセス要求に応じてWAY0タグ2330及びWAY1タグ2331に対してキャッシュのヒット判定を行う。
The
WAY0データアレイ2350及びWAY1データアレイ2351は、それぞれ独立したSRAMで構成され、SDRAM240内の一部のアドレスに対応するデータをラインごとに格納しているデータメモリである。尚、SDRAM240内の同一のアドレスに対応したデータは、WAY0データアレイ2350及びWAY1データアレイ2351のいずれにも格納可能である。
The WAY 0
WAY0アクセス状態フラグ2340は、WAY0データアレイ2350が読出し又は書込みのアクセス処理が処理中であるか否かを示すアクセス状態情報である。同様に、WAY1アクセス状態フラグ2341は、WAY1データアレイ2351が読出し又は書込みのアクセス処理が処理中であるか否かを示すアクセス状態情報である。WAY0アクセス状態フラグ2340及びWAY1アクセス状態フラグ2341は、少なくともL2HIT/MISS判定部232が参照可能なデータである。例えば、WAY0アクセス状態フラグ2340は、例えば、WAY0データアレイ2350内の制御領域に格納されるものである。同様に、WAY1アクセス状態フラグ2341は、WAY1データアレイ2351内の制御領域に格納されるものである。または、キャッシュメモリ装置230内の記憶領域に管理テーブルとしてアクセス状態情報を格納してもよい。ここで、管理テーブルは、データメモリがアクセス処理中か否かを示す情報を格納するものである。
The WAY 0
また、アクセス状態フラグとしては、"Free"と"Busy"とのいずれかを示す値であればよい。例えば、"0"が"Free"であり、"1"が"Busy"であってもよく、これ以外の例であってもよい。ここで、"Free"は「アクセス処理中でない」ことを示し、"Busy"は「アクセス処理中である」ことを示すものである。また、L2HIT/MISS判定部232は、ウェイにロックをかけるときには、アクセス状態フラグを"1"に更新し、ウェイのロックを解除するときには、アクセス状態フラグを"0"に更新する。
The access state flag may be a value indicating either “Free” or “Busy”. For example, “0” may be “Free”, “1” may be “Busy”, or other examples. Here, “Free” indicates “access not being processed”, and “Busy” indicates “access is being processed”. The L2HIT /
WAY0タグ2330は、WAY0データアレイ2350の各ラインに対応するアドレス情報である。同様に、WAY1タグ2331は、WAY1データアレイ2351の各ラインに対応するアドレス情報である。尚、WAY0タグ2330及びWAY1タグ2331は、1枚のSRAMで実現しても構わない。
The WAY 0
WAY0タグ2330、WAY0アクセス状態フラグ2340及びWAY0データアレイ2350は、WAY0として対応付けられている。同様に、WAY1タグ2331、WAY1アクセス状態フラグ2341及びWAY1データアレイ2351は、WAY1として対応付けられている。尚、図3では、2ウェイのキャッシュメモリ装置を例示しているが、ウェイ数は2以上であればよい。
The WAY 0
SDRAMコントローラ236は、L2HIT/MISS判定部232においてキャッシュミスと判定されたアクセス要求に応じて、SDRAM240へのアクセスを制御し、応答データを要求元へ転送し、かつ、応答データをWAY0データアレイ2350又はWAY1データアレイ2351にロードする。
The
SDRAM240は、メインメモリであり、L1キャッシュ221〜224並びにWAY0データアレイ2350及びWAY1データアレイ2351に格納されないデータも含めて格納されている。
The
上述したL2HIT/MISS判定部232は、制御部110の一例である。そのため、本実施の形態2にかかる制御部は、キャッシュヒットである場合にアクセス要求に基づきアクセス処理を開始する際に、当該アクセス処理対象のデータメモリを処理中とし、当該アクセス処理が完了した後に、当該アクセス処理対象のデータメモリを処理中でないとして、それぞれアクセス状態情報を更新する。言い換えると、当該制御部は、アクセス処理の開始時に、当該アクセス処理対象のデータメモリに排他制御のためにロックをかける。また、当該制御部は、アクセス処理の完了後に、当該アクセス処理対象のデータメモリのロックを解除する。また、当該制御部は、アクセス要求がキャッシュヒットである場合に特定されるタグメモリに対応するデータメモリについてアクセス状態情報を参照して、当該アクセス状態情報が処理中でなければ、当該データメモリへのアクセス処理を開始する。このように、アクセス状態情報を用いることにより、アクセス処理中であるか否かについて、データメモリ単位、つまりウェイ単位で容易に確認することが可能となり、排他制御を容易に実現することができる。
The above-described L2HIT /
また、上述したアービタスケジューラ231は、複数のアクセス要求を受け付けて調停を行う調停部である。そして、上記制御部は、調停された後続のアクセス要求がキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、調停された先行のアクセス要求に基づきアクセス処理中である場合には、当該後続のアクセス要求を調停部へ戻す。このように、調停部を用いることにより、複数のアクセス要求が同時に発行された場合であっても、1サイクルに調停された一つの要求のヒットミス判定を行いつつ、アクセス処理については上記同様に、部分的に並列処理することができる。
The
図4は、本実施の形態2にかかるキャッシュメモリ装置230の制御処理の流れを示すフローチャートである。まず、アービタスケジューラ231は、複数のアクセス要求を受け付ける(S201)。次に、アービタスケジューラ231は、複数のアクセス要求を調停する(S202)。そして、アービタスケジューラ231は、処理対象のアクセス要求を選択する(S203)。つまり、アービタスケジューラ231は、複数のアクセス要求のうち、調停により最優先と判定されたアクセス要求をL2HIT/MISS判定部232へ通知する。例えば、2つのアクセス要求を受け付けた場合、調停により先行して処理されるアクセス要求を上述した第2のアクセス要求とし、調停により第2のアクセス要求の後続に処理されるアクセス要求を上述した第1のアクセス要求とする。
FIG. 4 is a flowchart showing a flow of control processing of the
そして、L2HIT/MISS判定部232は、L2キャッシュのヒットミス判定を行う(S204)。つまり、L2HIT/MISS判定部232は、当該アクセス要求がキャッシュヒットであるか否かを判定する。具体的には、L2HIT/MISS判定部232は、アクセス要求に含まれるアドレスとWAY0タグ2330及びWAY1タグ2331とを照合し、一致するか否かを判定し、一致する場合にはキャッシュヒットと判定する。
Then, the L2HIT /
ステップS204においてキャッシュヒットと判定した場合、L2HIT/MISS判定部232は、アクセス対象のウェイのフラグが"Free"であるか否かを判定する(S205)。L2HIT/MISS判定部232は、アクセス状態情報を参照して判定する。例えば、WAY0がキャッシュヒットした場合、L2HIT/MISS判定部232は、WAY0アクセス状態フラグ2340のフラグが"0"であれば、"Free"と判定し、"1"であれば"Busy"と判定する。つまり、L2HIT/MISS判定部232は、第1のアクセス要求に基づき特定されたタグメモリに対応するデータメモリについて、ロックがかけられているか否かにより、当該データメモリが前記アクセス処理中であるか否かを判定する。
If it is determined in step S204 that there is a cache hit, the L2HIT /
ステップS205においてアクセス対象のウェイのフラグが"Free"でない、つまり"Busy"であると判定した場合、当該アクセス要求は、アービタスケジューラ231に戻されて、再度、調停が行われる。つまり、アービタスケジューラ231は、第1のアクセス要求のアクセス処理対象のデータメモリが、第2のアクセス要求に基づきアクセス処理中であると判定した場合に、当該第1のアクセス要求を再度、調停対象とする。例えば、先行するアクセス要求により同一のウェイに対して既にアクセス処理が開始されている場合には、同一のSRAMに対する処理は行えないため、所定時間後にアクセスする必要がある。
If it is determined in step S205 that the flag of the way to be accessed is not “Free”, that is, “Busy”, the access request is returned to the
ステップS205においてアクセス対象のウェイのフラグが"Free"であると判定した場合、L2HIT/MISS判定部232は、アクセス対象のウェイのフラグを"Busy"に更新する(S206)。つまり、L2HIT/MISS判定部232は、アクセス要求に基づきアクセス処理を開始する際に、当該アクセス処理対象のデータメモリにロックをかけて、アクセス処理中とする。言い換えると、L2HIT/MISS判定部232は、ロックがかけられていないと判定した場合に、第1のアクセス要求のアクセス処理対象のデータメモリにロックをかける。これにより、当該ウェイに対して後続のアクセス要求に対してアクセス処理を排除できる。
If it is determined in step S205 that the flag of the access target way is “Free”, the L2HIT /
例えば、並行してアクセス処理が行われているアクセス要求がない場合には、いずれのウェイであっても"Free"である。また、本実施の形態で顕著な場合としては、既に他のアクセス要求によりアクセス処理が開始されている場合である。このとき、他のアクセス要求によりアクセスされているウェイについては、"Busy"となっているが、それ以外のウェイについて"Free"であれば、アクセス可能である。よって、このような場合には、複数のアクセス要求に対してアクセス処理を並列実行することができる。 For example, when there is no access request for which access processing is being performed in parallel, “Free” is used for any way. In addition, a remarkable case in the present embodiment is a case where an access process has already been started by another access request. At this time, the way accessed by another access request is “Busy”, but other ways can be accessed if they are “Free”. Therefore, in such a case, access processing can be executed in parallel for a plurality of access requests.
そして、L2HIT/MISS判定部232は、対象のデータアレイへのアクセス処理を開始する(S207)。例えば、アクセス要求が読出し命令である場合、要求元のIPコアに対してデータ転送が行われる。
Then, the L2HIT /
データ転送の完了後、L2HIT/MISS判定部232は、対象のタグを更新し、かつ、ウェイのフラグを"Free"に更新する(S208)。つまり、L2HIT/MISS判定部232は、当該アクセス処理が完了した後に、当該アクセス処理対象のデータメモリのロックを解除して、アクセス処理中でないものとする。これにより、以後のアクセス要求については当該ウェイに対してアクセス処理が可能となる。
After the data transfer is completed, the L2HIT /
ステップS204においてキャッシュミスと判定した場合、SDRAMコントローラ236は、ロード対象のウェイを決定する(S209)。そして、SDRAMコントローラ236は、ロード対象のウェイのフラグが"Free"であるか否かを判定する(S210)。ステップS209においてアクセス対象のウェイのフラグが"Free"であると判定した場合、L2HIT/MISS判定部232は、ロード対象のウェイのフラグを"Busy"に更新する(S211)。その後、SDRAMコントローラ236は、ロード対象のウェイに対してデータをロードする(S212)。
If it is determined in step S204 that there is a cache miss, the
図5は、本実施の形態2にかかるキャッシュメモリ装置230の動作を説明するタイミングチャートである。ここでは、アクセス要求XがWAY0をアクセス対象とし、アクセス要求YがWAY1をアクセス対象とする例を示す。
FIG. 5 is a timing chart for explaining the operation of the
まず、キャッシュメモリ装置230がIPコアA及びBからそれぞれアクセス要求X及びYを同時に受け付けたものとする(S201)。そのため、アービタスケジューラ231は、アクセス要求X及びYの調停を行う(S202)。このとき、調停によりアクセス要求Xが先行となったものとする。よって、次のサイクルにて、アービタスケジューラ231は、アクセス要求Xを処理対象として選択する(S203)。
First, it is assumed that the
続いて、L2HIT/MISS判定部232は、アクセス要求Xについてヒットミス判定を行う(S204)。つまり、L2HIT/MISS判定部232は、WAY0タグ2330及びWAY1タグ2331に共にヒットミス判定を行う。ここでは、WAY0でキャッシュヒットしたものとする(S204でYES)。
Subsequently, the L2HIT /
そこで、L2HIT/MISS判定部232は、WAY0アクセス状態フラグ2340が"Free"か否かを判定する(S205)。ここでは、WAY0アクセス状態フラグ2340が"Free"であるものとする。そのため、L2HIT/MISS判定部232は、WAY0アクセス状態フラグ2340を"Busy"に更新し(S206)、WAY0データアレイ2350へのアクセス処理を開始する(S207)。ここでは、アクセス要求Xがデータ読出しであるものとする。よって、ヒットミス判定の次のサイクルからWAY0データアレイ2350からD0、D1、・・・D15と読み出され、IPコアAへデータ転送される。尚、この例では、データ転送に16サイクル要するが、1ライン当たりのデータ量に応じて32、64サイクル等、2以上のサイクルを要することが一般的である。
Therefore, the L2HIT /
また、WAY0データアレイ2350からD0を読み出すサイクルと同時に、アービタスケジューラ231は、後続のアクセス要求Yを処理対象として選択し(S203)、L2HIT/MISS判定部232は、アクセス要求Yのヒットミス判定を行う(S204)。ここでは、WAY1でキャッシュヒットしたものとする(S204でYES)。
Simultaneously with the cycle of reading D0 from the
そこで、L2HIT/MISS判定部232は、WAY1アクセス状態フラグ2341が"Free"か否かを判定する(S205)。ここでは、WAY1アクセス状態フラグ2341が"Free"であるものとする。そのため、L2HIT/MISS判定部232は、WAY1アクセス状態フラグ2341を"Busy"に更新し(S206)、WAY1データアレイ2351へのアクセス処理を開始する(S207)。ここでは、アクセス要求Yがデータ読出しであるものとする。よって、ヒットミス判定の次のサイクル、つまり、WAY0データアレイ2350からD1が読み出されるタイミングからWAY1データアレイ2351からD0、D1、・・・D15と読み出され、IPコアBへデータ転送される。このとき、アクセス要求X及びYに基づくデータ転送が部分的に並列処理される。
Therefore, the L2HIT /
その後、L2HIT/MISS判定部232は、WAY0データアレイ2350からD15が読み出されたことにより、WAY0アクセス状態フラグ2340を"Free"に更新する(S208)。また、L2HIT/MISS判定部232は、WAY1データアレイ2351からD15が読み出されたことにより、WAY1アクセス状態フラグ2341を"Free"に更新する(S208)。
Thereafter, the L2HIT /
このように、図5の例では、同時に発行されたアクセス要求XとYに対して、わずか1サイクル差で全てのデータ転送を完了することができる。 In this way, in the example of FIG. 5, all data transfer can be completed with a difference of only one cycle with respect to the access requests X and Y issued simultaneously.
図6は、本実施の形態2にかかるキャッシュメモリ装置230の動作を説明するタイミングチャートである。ここでは、アクセス要求X及びYが共にWAY0をアクセス対象とする例を示す。以下、図5との違いを中心に説明する。
FIG. 6 is a timing chart for explaining the operation of the
まず、先行のアクセス要求Xに基づくアクセス処理としてWAY0データアレイ2350からD0が読み出される。このときのサイクルと同時に、アービタスケジューラ231は、後続のアクセス要求Yを処理対象として選択し(S203)、L2HIT/MISS判定部232は、アクセス要求Yのヒットミス判定を行う(S204)。ここでは、再び、WAY0でキャッシュヒットしたものとする(S204でYES)。
First, D0 is read from the
そこで、L2HIT/MISS判定部232は、WAY0アクセス状態フラグ2340が"Free"か否かを判定する(S205)。ここでは、WAY0アクセス状態フラグ2340が"Busy"であるため(S205でNO)、アクセス要求Yは、再度、アービタスケジューラ231における調停が行われる。その後、L2HIT/MISS判定部232は、WAY0データアレイ2350からD15が読み出されたことにより、WAY0アクセス状態フラグ2340を"Free"に更新する(S208)。そして、アクセス要求YについてWAY0に対するアクセスが可能となり、データ転送が開始される。
Therefore, the L2HIT /
このように、アクセス状態フラグにより同一のウェイに対する同時アクセスを適切に排除し、応答データの整合性を保つことができる。 In this way, simultaneous access to the same way can be appropriately eliminated by the access status flag, and the consistency of response data can be maintained.
図7は、本実施の形態2にかかるキャッシュメモリ装置230の動作を説明するタイミングチャートである。ここでは、アクセス要求X及びYが共にWAY0をアクセス対象とし、アクセス要求ZがWAY1をアクセス対象とする例を示す。以下、図5及び図6との違いを中心に説明する。
FIG. 7 is a timing chart for explaining the operation of the
まず、キャッシュメモリ装置230がIPコアA及びBからそれぞれアクセス要求X及びYを同時に受け付けたものとする(S201)。そして、調停により、アクセス要求Xが先行となったものとする。そして、L2HIT/MISS判定部232は、アクセス要求Xについてヒットミス判定を行い、WAY0でキャッシュヒットしたものとする(S204でYES)。
First, it is assumed that the
同時に、キャッシュメモリ装置230は、IPコアCからアクセス要求Zを受け付けたものとする。このとき、アービタスケジューラ231は、アクセス要求Y及びZ及びYの調停を行う(S202)。このとき、調停によりアクセス要求Yが先行となったものとする。よって、次のサイクルにて、アービタスケジューラ231は、アクセス要求Yを処理対象として選択する(S203)。
At the same time, it is assumed that the
続いて、L2HIT/MISS判定部232は、アクセス要求Yについてヒットミス判定を行う(S204)。このとき、上述した通り、並行して、アクセス要求Xに基づくデータ転送が開始される。そして、図6と同様に、WAY0アクセス状態フラグ2340が"Busy"であるため、アクセス要求Yは、再度、アービタスケジューラ231における調停が行われる。
Subsequently, the L2HIT /
次に、アクセス要求Xに基づきWAY0データアレイ2350からD1を読み出すサイクルと同時に、アービタスケジューラ231は、後続のアクセス要求Zを処理対象として選択し(S203)、L2HIT/MISS判定部232は、アクセス要求Zのヒットミス判定を行う(S204)。ここでは、WAY1でキャッシュヒットしたものとする(S204でYES)。そこで、アクセス要求Zに基づきWAY1データアレイ2351からデータ転送が開始される。このとき、アクセス要求X及びZに基づくデータ転送が部分的に並列処理される。
Next, simultaneously with the cycle of reading D1 from the
その後、アクセス要求Yについては図6と同様に、アクセス要求Xに基づくデータ転送の完了後にデータ転送が開始される。アクセス要求Y及びZに基づくデータ転送が部分的に並列処理される。 Thereafter, for the access request Y, data transfer is started after completion of data transfer based on the access request X, as in FIG. Data transfer based on access requests Y and Z is partially processed in parallel.
このように、本実施の形態2にかかるWAY0データアレイ2350及びWAY1データアレイ2351は、それぞれ別のSRAMマクロにすることで、また、応答バスB21及び応答バスB22を設けることで、並列したアクセス処理を実現することができる。
As described above, the WAY 0
さらに、キャッシュメモリ装置230は、WAY0及びWAY1それぞれにBUSY及びFREEを管理するアクセス状態情報を用いるものである。そして、アービタスケジューラ231は、BUSYと判定されたウェイへのアクセス要求を再度スケジューリングしなおすものである。
Further, the
尚、本実施の形態2は、バースト転送が行われる場合に、特に有効である。そのため、L2以下のキャッシュメモリに適用可能である。また、本実施の形態2は、マルチバンク方式と異なり、アドレス振り分け不要である。 The second embodiment is particularly effective when burst transfer is performed. Therefore, it can be applied to a cache memory of L2 or less. Further, unlike the multi-bank method, the second embodiment does not require address allocation.
ここで、本実施の形態2について、改めて説明する。まず、共有キャッシュへの複数のアクセス要求が生じた場合、キャッシュへのアクセス要求をアービタスケジューラで調停し、その後、複数のウェイのタグを引く。ここで、キャッシュのヒット又はミスを判定し、アクセスを行うウェイを決定する。アクセスを行うウェイがフリーであれば、ビジーに状態を遷移させ、データアクセスを行う。他方、ビジーであれば、当該キャッシュアクセス要求は、ウェイト状態となり、アービタスケジューラで再度スケジュールし、他のアクセス要求と再度調停しつつ、当該アクセス要求は、当該ウェイがフリーとなるまで、キャッシュのヒットミス判定を繰り返す処理を行う。 Here, the second embodiment will be described again. First, when a plurality of access requests to the shared cache are generated, the access request to the cache is arbitrated by the arbiter scheduler, and then tags of a plurality of ways are pulled. Here, the hit or miss of the cache is determined, and the way to be accessed is determined. If the way to be accessed is free, the state is changed to busy and data access is performed. On the other hand, if it is busy, the cache access request is in a wait state, rescheduled by the arbiter scheduler, and reconciled with other access requests, while the access request hits the cache until the way becomes free. A process of repeating the error determination is performed.
また、WAY0がバースト転送中にも、WAY0及びWAY1のタグに対しては、共にアクセス可能であり、後続のアクセス要求がWAY1へのアクセスとなった場合には、WAY0とWAY1がそれぞれ異なったIPコアに対してデータのやり取りが可能になる。
Even when WAY 0 is in burst transfer, the tags of WAY 0 and
そのため、本実施の形態2により、キャッシュメモリに対する部分的な並列アクセスが可能になる。また、ウェイ単位での並列アクセスであるため、上述したマルチバンク方式と違い、プログラムのチューニングが不要となるという効果も奏する。 Therefore, according to the second embodiment, partial parallel access to the cache memory becomes possible. Further, since parallel access is performed in units of ways, there is an effect that program tuning is not required unlike the multi-bank method described above.
尚、本実施の形態2にかかるキャッシュメモリ装置230は、複数のプロセッサコアにより共有され、各プロセッサコアから個別にアクセス要求を受け付けるものである。これにより、複数のアクセス要求の発行元に対して共有キャッシュメモリを実現することができ、かつ、アクセス処理を部分的に並列処理可能とできる。また、本実施の形態2にかかるキャッシュメモリ装置230は、上述したようにセットアソシアティブ又はフルアソシアティブ方式であることが望ましい。これにより、バンク競合の場合であっても、アクセスを分散させることができる。
Note that the
<実施の形態3>
本実施の形態3にかかるキャッシュメモリ装置は、キャッシュミス時にWAY0アクセス状態フラグ2340及びWAY1アクセス状態フラグ2341を確認した上で、ロード先を決定するものである。本実施の形態3にかかるキャッシュメモリ装置は、図3と同等であるため図示及び詳細な説明を省略する。
<Embodiment 3>
The cache memory device according to the third embodiment determines the load destination after confirming the WAY 0
図8は、本実施の形態3にかかるキャッシュメモリ装置の制御処理の流れを示すフローチャートである。図8において、図4と同等の処理については同一の符号を付し、詳細な説明を省略する。 FIG. 8 is a flowchart showing a flow of control processing of the cache memory device according to the third embodiment. In FIG. 8, the same processes as those in FIG. 4 are denoted by the same reference numerals, and detailed description thereof is omitted.
ステップS204においてキャッシュミスと判定した場合、SDRAMコントローラ236は、ウェイのフラグが"Free"であるウェイが存在するか否かを判定する(S309)。例えば、SDRAMコントローラ236は、WAY0アクセス状態フラグ2340及びWAY1アクセス状態フラグ2341を参照し、"Free"が1以上存在するか否かを判定する。
If it is determined in step S204 that there is a cache miss, the
ステップS309において"Free"であるウェイが存在しない、つまり、全てのウェイがアクセス処理中である場合には、ステップS202へ戻る。 If there is no way that is “Free” in step S309, that is, if all the ways are being accessed, the process returns to step S202.
また、ステップS309において"Free"であるウェイが存在すると判定した場合、SDRAMコントローラ236は、"Free"であるウェイの中からロード対象のウェイを決定する(S310)。つまり、第1のアクセス要求がキャッシュミスと判定された場合に、複数のデータメモリのうちロックがかけられていないデータメモリをロード先として決定する。従来は、LRU(Least Recently Used)等に基づいて決定されたウェイにロードをするか否かを判定し、当該ウェイが使用中であればロードを待機せざるをえなかった。しかし、本実施の形態3では、予め各ウェイのアクセス状態フラグを参照することで、ロード対象として決定する際には、確実にロード可能なウェイを決定することができる。
If it is determined in step S309 that there is a “Free” way, the
つまり、SDRAMコントローラ236は、アクセス要求がキャッシュヒット判定によりキャッシュミスと判定された場合に、当該アクセス要求が要求するデータを下位層のメモリから複数のデータメモリのいずれかへロードするロードストアユニットである。そして、SDRAMコントローラ236は、アクセス状態情報を参照して、処理中以外のデータメモリをロード先として決定する。
That is, the
または、図4のステップS209のようにLRUなど既存技術によるウェイ選択を行い、ステップS210においてウェイがBUSYだった場合に、アクセス状態フラグが"Free"であるウェイの中からロード対象を決定するようにしてもよい。これにより、キャッシュミスによって新たにデータをロードしようとした際に、選択を行ったウェイがBUSYだったの場合、他のウェイをロード対象として、なるべく並列アクセスができるようにして、並列アクセスによる性能向上率を高めることができる。 Alternatively, as shown in step S209 in FIG. 4, when a way is selected by an existing technique such as LRU and the way is BUSY in step S210, the load target is determined from the ways whose access state flag is “Free”. It may be. As a result, when a new way to load data due to a cache miss and the selected way is BUSY, it is possible to perform parallel access as much as possible with another way as a load target, and performance by parallel access The improvement rate can be increased.
<実施の形態4>
既存のロード対象のウェイの決定の仕方では、あるウェイにデータ格納し切ってから別のウェイへデータを格納するようにしていた。そして、本実施の形態1〜3では、複数の異なったウェイに対するアクセス要求について部分的に並列処理を行うものである。そのため、1つ目のウェイにデータが格納し終わるまでの間は、同じウェイに対しては本実施の形態1〜3により並列処理が実行できないといえる。
<Embodiment 4>
In the method of determining an existing way to be loaded, data is stored in one way and then stored in another way. In
そこで、本実施の形態4では、直前にロード対象とされたウェイと異なるウェイをロード対象として選択するものである。例えば、2ウェイの場合には、ロード対象のウェイを交互に選択することとなる。まず、本実施の形態4では、アクセス要求がキャッシュヒット判定によりキャッシュミスと判定された場合に、当該アクセス要求が要求するデータを下位層のメモリから前記複数のデータメモリのいずれかへロードするロードストアユニットを備える。そして、本実施の形態4にかかるロードストアユニットは、直前にロードされたデータメモリとは異なるデータメモリをロード先として決定する。つまり、連続してロードするときに、直前のロード先のウェイとは異なるウェイをロード先として決定する。例えば、複数のウェイが空の状態である初期段階などでは、新規に割り付けるウェイをWAY0、WAY1、WAY0・・・と交互に割り付ける。これにより、各ウェイに対して均等にデータを格納することができ、並列処理が行える確率を高めることができる。 Therefore, in the fourth embodiment, a way different from the way that was set as the load target immediately before is selected as the load target. For example, in the case of 2 ways, the way to be loaded is selected alternately. First, in the fourth embodiment, when an access request is determined to be a cache miss by a cache hit determination, a load for loading data requested by the access request from a lower layer memory to any of the plurality of data memories Equipped with a store unit. The load / store unit according to the fourth embodiment determines a data memory different from the data memory loaded immediately before as the load destination. That is, when loading continuously, a way different from the immediately preceding load destination is determined as the load destination. For example, in an initial stage where a plurality of ways are empty, new ways to be assigned are assigned alternately as WAY0, WAY1, WAY0,. As a result, data can be stored equally for each way, and the probability that parallel processing can be performed can be increased.
<実施の形態5>
キャッシュメモリ内の複数のウェイに対するアクセスのヒット率は、アクセス要求元のアプリケーション等や処理過程に応じて変動することがある。そのため、本実施の形態5では、キャッシュミス時にロードするデータを複数のウェイに分散させるものである。すなわち、まず、本実施の形態5では、アクセス要求がキャッシュヒット判定によりキャッシュミスと判定された場合に、当該アクセス要求が要求するデータを下位層のメモリから複数のデータメモリのいずれかへロードするロードストアユニットを備える。そして、本実施の形態5にかかるロードストアユニットは、複数のデータメモリにおけるアクセス頻度に応じてロード先となるデータメモリを決定するものである。アクセス頻度とは、例えば、ウェイの使用比率を含む。これにより、各ウェイに分散してデータを格納することができ、ウェイごとのヒット率が分散し、並列アクセス処理ができる確率を向上させることができる。
<Embodiment 5>
The hit rate of access to a plurality of ways in the cache memory may fluctuate depending on the application requesting the access request and the like and the processing process. Therefore, in the fifth embodiment, data to be loaded at the time of a cache miss is distributed over a plurality of ways. That is, first, in the fifth embodiment, when an access request is determined to be a cache miss by a cache hit determination, data requested by the access request is loaded from a lower layer memory to any of a plurality of data memories. Equipped with a load store unit. The load / store unit according to the fifth embodiment determines a data memory to be a load destination according to the access frequency in a plurality of data memories. The access frequency includes, for example, the usage ratio of the way. As a result, data can be stored in each way in a distributed manner, the hit rate for each way can be distributed, and the probability that parallel access processing can be performed can be improved.
<実施の形態6>
図9は、本実施の形態6にかかる情報処理装置600の構成を示すブロック図である。情報処理装置600は、複数のプロセッサコア611〜61mと、タグメモリ群120と、データメモリ群130と、キャッシュ制御部620とを備える。
<Embodiment 6>
FIG. 9 is a block diagram showing a configuration of the
複数のプロセッサコア611〜61mは、それぞれアクセス要求ARをキャッシュ制御部620に対して発行する。そして、複数のプロセッサコア611〜61mは、アクセス要求ARの応答としてデータ転送DT等を受け付ける。
Each of the plurality of
キャッシュ制御部620は、複数のプロセッサコア611〜61mのいずれかからの第1のアクセス要求に対して複数のタグメモリ121〜12nへのキャッシュヒット判定を行う。そして、キャッシュ制御部620は、第1のアクセス要求とは異なる第2のアクセス要求に基づき複数のデータメモリのいずれかにアクセス処理中に、第1のアクセス要求におけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが当該第1のアクセス要求とは異なる第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始する。
The
尚、タグメモリ群120とデータメモリ群130とは、図1と同等であるため説明を省略する。
The
これにより、本実施の形態1と同様の効果を奏することができる。 Thereby, the same effects as those of the first embodiment can be obtained.
<その他の実施の形態>
また、他の実施の形態として、ヒットミス判定部を複数かつ並列に備えるようにしてもよい。これにより、複数のアクセス要求に対してヒットミス判定を並列化することができる。
<Other embodiments>
As another embodiment, a plurality of hit miss determination units may be provided in parallel. Thereby, hit miss determination can be parallelized for a plurality of access requests.
尚、上述した実施の形態2ではマルチプロセッサシステムを対象としたが、1つのプロセッサから複数のアクセス要求を発行するものであっても適用可能である。 In the second embodiment described above, the multiprocessor system is targeted. However, the present invention can be applied to a case where a plurality of access requests are issued from one processor.
尚、上述した実施の形態1〜6では、ウェイごとにデータアレイのSRAMマクロを分離するため、ウェイ単位でのシャットダウンが容易に実現可能となる。よって、アクセス頻度が低い場合などに、キャッシュ容量を電源遮断によって減らすことにより、省電力化が可能である。 In the first to sixth embodiments described above, since the SRAM macro of the data array is separated for each way, shutdown in units of ways can be easily realized. Therefore, when the access frequency is low, it is possible to save power by reducing the cache capacity by turning off the power.
尚、図4のステップ203の後に、ウェイが"Free"の場合に、キャッシュがヒットするものと仮定して、投機的にデータ読み出しを開始するようにしてもよい。これにより、後続のアクセス要求のヒットミス判定と同時にデータ読出しを開始することができる。また、レイテンシ短縮も実現でき得る。 In addition, after step 203 in FIG. 4, when the way is “Free”, it is possible to speculatively start reading data on the assumption that the cache hits. Thereby, data reading can be started simultaneously with the hit miss determination of the subsequent access request. In addition, latency can be shortened.
さらに、その他の実施の形態としては、以下のキャッシュメモリシステムがある。すなわち、キャッシュメモリシステムは、複数のIPコアにより共有されるキャッシュメモリを有する。当該共有キャッシュメモリは、複数の連想度を持ったセットアソシアティブ方式のキャッシュ構成である。そして、ウェイごとにビジー又はフリーの状態管理を行う。また、キャッシュアクセス要求によって、上記キャッシュメモリのタグメモリをアクセスする。そして、アクセスを行う必要のあるウェイを決定し、当該ウェイがフリーであればアクセスを許可する。同時に、当該ウェイの状態をビジーにする。また、データ転送の完了後に再度フリーの状態に戻す。そして、後続のアクセス要求が、続くサイクルで上記タグメモリをアクセスし、異なったウェイにアクセスすると決定され、当該ウェイがフリーであれば、前記先行するアクセス要求と当該後続のアクセス要求に基づくデータアクセスを並列に行う。 Furthermore, as another embodiment, there is the following cache memory system. In other words, the cache memory system has a cache memory shared by a plurality of IP cores. The shared cache memory has a set associative cache configuration having a plurality of associations. Then, busy or free state management is performed for each way. Further, the tag memory of the cache memory is accessed by a cache access request. Then, a way that needs to be accessed is determined, and if the way is free, access is permitted. At the same time, the state of the way is busy. In addition, after the data transfer is completed, the free state is restored. Then, it is determined that a subsequent access request accesses the tag memory in a subsequent cycle and accesses a different way, and if the way is free, data access based on the preceding access request and the subsequent access request In parallel.
尚、本実施の形態は、複数のプロセッサおよびプロセッサや他のハードウェアIPと、共有のキャッシュメモリを集積したSoC(System on a Chip)に適用可能である。 The present embodiment can be applied to a SoC (System on a Chip) in which a plurality of processors, processors and other hardware IP, and a shared cache memory are integrated.
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.
100 キャッシュメモリ装置
110 制御部
120 タグメモリ群
121 タグメモリ
122 タグメモリ
12n タグメモリ
130 データメモリ群
131 データメモリ
132 データメモリ
13n データメモリ
W1 ウェイ
W2 ウェイ
Wn ウェイ
AR1 アクセス要求
AR2 アクセス要求
DT1 データ転送
DT2 データ転送
200 マルチプロセッサシステム
211 IPコア
212 IPコア
213 IPコア
214 IPコア
221 L1キャッシュ
222 L1キャッシュ
223 L1キャッシュ
224 L1キャッシュ
230 キャッシュメモリ装置
231 アービタスケジューラ
232 L2HIT/MISS判定部
2330 WAY0タグ
2331 WAY1タグ
2340 WAY0アクセス状態フラグ
2341 WAY1アクセス状態フラグ
2350 WAY0データアレイ
2351 WAY1データアレイ
236 SDRAMコントローラ
240 SDRAM
B20 アクセス要求バス
B21 応答バス
B22 応答バス
A IPコア
B IPコア
C IPコア
X アクセス要求
Y アクセス要求
Z アクセス要求
600 情報処理装置
611 プロセッサコア
612 プロセッサコア
61m プロセッサコア
620 キャッシュ制御部
L20〜L27 L2キャッシュメモリ
100
B20 access request bus B21 response bus B22 response bus A IP core B IP core C IP core X access request Y access request
Claims (17)
各タグメモリに対応する複数のデータメモリと、
第1のアクセス要求に対して前記複数のタグメモリへのキャッシュヒット判定を行い、第2のアクセス要求に基づき前記複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求におけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、前記第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始する制御部と、
を備えるキャッシュメモリ装置。 Multiple tag memories,
A plurality of data memories corresponding to each tag memory;
A cache hit in the plurality of tag memories is determined in response to the first access request, and the cache in the first access request is processed during access processing to any of the plurality of data memories based on the second access request. A control unit that starts an access process to the data memory when the data memory corresponding to the tag memory specified at the time of hit is not being accessed based on the second access request;
A cache memory device comprising:
前記制御部は、
前記キャッシュヒットである場合に前記第2のアクセス要求に基づきアクセス処理を開始する際に、当該アクセス処理対象のデータメモリを処理中とし、当該アクセス処理が完了した後に、当該アクセス処理対象のデータメモリを処理中でないとして、それぞれ前記アクセス状態情報を更新し、
前記第1のアクセス要求が前記キャッシュヒットである場合に前記特定されるタグメモリに対応するデータメモリについて前記アクセス状態情報を参照して、当該アクセス状態情報が処理中でなければ、当該データメモリへのアクセス処理を開始する
ことを特徴とする請求項1に記載のキャッシュメモリ装置。 A storage area for storing access status information indicating whether or not the data memory is being accessed;
The controller is
When the access process is started based on the second access request in the case of the cache hit, the access process target data memory is being processed, and after the access process is completed, the access process target data memory And updating the access status information respectively,
When the first access request is the cache hit, the access state information is referred to for the data memory corresponding to the specified tag memory, and if the access state information is not being processed, the data memory is transferred to the data memory. The cache memory device according to claim 1, wherein an access process is started.
前記制御部は、
前記調停された後続のアクセス要求が前記キャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、前記調停された先行のアクセス要求に基づきアクセス処理中である場合には、当該後続のアクセス要求を前記調停部へ戻す
ことを特徴とする請求項1に記載のキャッシュメモリ装置。 It further includes an arbitration unit that accepts a plurality of access requests and arbitrates,
The controller is
If the data memory corresponding to the tag memory identified when the arbitrated subsequent access request is a cache hit is in the process of being accessed based on the arbitrated previous access request, the subsequent access The cache memory device according to claim 1, wherein the request is returned to the arbitration unit.
前記ロードストアユニットは、前記アクセス状態情報を参照して、アクセス処理中以外のデータメモリをロード先として決定する
ことを特徴とする請求項3に記載のキャッシュメモリ装置。 A load store unit that loads data requested by the access request from a lower layer memory to any of the plurality of data memories when the access request is determined to be a cache miss by the cache hit determination;
4. The cache memory device according to claim 3, wherein the load store unit refers to the access state information and determines a data memory other than that during access processing as a load destination. 5.
前記ロードストアユニットは、直前にロードされたデータメモリとは異なるデータメモリをロード先として決定する
ことを特徴とする請求項1に記載のキャッシュメモリ装置。 A load store unit that loads data requested by the access request from a lower layer memory to any of the plurality of data memories when the access request is determined to be a cache miss by the cache hit determination;
The cache memory device according to claim 1, wherein the load store unit determines a data memory different from the data memory loaded immediately before as a load destination.
前記ロードストアユニットは、前記複数のデータメモリにおけるアクセス頻度に応じてロード先となるデータメモリを決定する
ことを特徴とする請求項1に記載のキャッシュメモリ装置。 A load store unit that loads data requested by the access request from a lower layer memory to any of the plurality of data memories when the access request is determined to be a cache miss by the cache hit determination;
The cache memory device according to claim 1, wherein the load store unit determines a data memory to be a load destination according to an access frequency in the plurality of data memories.
当該第1のアクセス要求以外の第2のアクセス要求に基づき複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求における前記特定されたタグメモリに対応するデータメモリが前記第2のアクセス要求に基づきアクセス処理中であるか否かを判定し、
前記アクセス処理中ではないと判定した場合に、前記第1のアクセス要求に基づきアクセス処理を開始する
キャッシュメモリの制御方法。 Identify the tag memory that hits the cache based on the first access request,
During an access process to any of a plurality of data memories based on a second access request other than the first access request, a data memory corresponding to the identified tag memory in the first access request is the second To determine whether access processing is in progress based on the access request
A method for controlling a cache memory, which starts an access process based on the first access request when it is determined that the access process is not in progress.
前記第1のアクセス要求に基づき特定されたタグメモリに対応するデータメモリについて前記ロックがかけられているか否かを判定し、
前記ロックがかけられていないと判定した場合に、前記第1のアクセス要求のアクセス処理対象のデータメモリにロックをかける
ことを特徴とする請求項11に記載のキャッシュメモリの制御方法。 When starting the access process based on the second access request, the access target data memory is locked, and after the access process is completed, the access target data memory is unlocked,
Determining whether the data memory corresponding to the tag memory identified based on the first access request is locked;
The cache memory control method according to claim 11, wherein, when it is determined that the lock is not applied, a lock is applied to a data memory subject to access processing of the first access request.
前記調停により先行して処理されるアクセス要求を前記第2のアクセス要求とし、前記調停により前記第2のアクセス要求の後続に処理されるアクセス要求を前記第1のアクセス要求とし、
前記第1のアクセス要求のアクセス処理対象のデータメモリが、前記第2のアクセス要求に基づきアクセス処理中であると判定した場合に、当該第1のアクセス要求を再度、調停対象とする
ことを特徴とする請求項11に記載のキャッシュメモリの制御方法。 Mediation when multiple access requests are accepted,
An access request processed in advance by the arbitration is defined as the second access request, and an access request processed subsequent to the second access request by the arbitration is defined as the first access request.
When it is determined that the data memory subject to access processing of the first access request is undergoing access processing based on the second access request, the first access request is again subject to arbitration. The method of controlling a cache memory according to claim 11.
前記第1のアクセス要求が要求するデータを下位層のメモリから前記ロード先へロードする
ことを特徴とする請求項12に記載のキャッシュメモリの制御方法。 When the first access request is determined to be a cache miss, a data memory that is not locked among a plurality of data memories is determined as a load destination;
13. The cache memory control method according to claim 12, wherein data requested by the first access request is loaded from a lower layer memory to the load destination.
前記第1のアクセス要求が要求するデータを下位層のメモリから前記ロード先へロードする
ことを特徴とする請求項11に記載のキャッシュメモリの制御方法。 When it is determined that the first access request is a cache miss, a data memory different from the data memory loaded immediately before is determined as a load destination,
12. The cache memory control method according to claim 11, wherein data requested by the first access request is loaded from a lower layer memory to the load destination.
前記第1のアクセス要求が要求するデータを下位層のメモリから前記ロード先へロードする
ことを特徴とする請求項11に記載のキャッシュメモリの制御方法。 When it is determined that the first access request is a cache miss, a data memory to be a load destination is determined according to an access frequency in a plurality of data memories,
12. The cache memory control method according to claim 11, wherein data requested by the first access request is loaded from a lower layer memory to the load destination.
複数のタグメモリと、
各タグメモリに対応する複数のデータメモリと、
前記複数のプロセッサコアのいずれかからの第1のアクセス要求に対して前記複数のタグメモリへのキャッシュヒット判定を行い、当該第1のアクセス要求とは異なる第2のアクセス要求に基づき前記複数のデータメモリのいずれかにアクセス処理中に、前記第1のアクセス要求におけるキャッシュヒットの際に特定されるタグメモリに対応するデータメモリが、前記第2のアクセス要求に基づきアクセス処理中ではない場合に、当該データメモリへのアクセス処理を開始するキャッシュ制御部と、
を備える情報処理装置。 Multiple processor cores,
Multiple tag memories,
A plurality of data memories corresponding to each tag memory;
A cache hit determination to the plurality of tag memories is performed for the first access request from any of the plurality of processor cores, and the plurality of the plurality of tag cores are determined based on a second access request different from the first access request. When the data memory corresponding to the tag memory specified at the time of the cache hit in the first access request is not being accessed based on the second access request during the access processing to any of the data memories A cache control unit for starting access processing to the data memory;
An information processing apparatus comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012082322A JP2013210961A (en) | 2012-03-30 | 2012-03-30 | Cache memory device, method of controlling cache memory, and information processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012082322A JP2013210961A (en) | 2012-03-30 | 2012-03-30 | Cache memory device, method of controlling cache memory, and information processing device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013210961A true JP2013210961A (en) | 2013-10-10 |
Family
ID=49528698
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012082322A Pending JP2013210961A (en) | 2012-03-30 | 2012-03-30 | Cache memory device, method of controlling cache memory, and information processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013210961A (en) |
-
2012
- 2012-03-30 JP JP2012082322A patent/JP2013210961A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101861571B (en) | System, apparatus, and method for modifying the order of memory accesses | |
US8527708B2 (en) | Detecting address conflicts in a cache memory system | |
US20110252204A1 (en) | Shared single access memory with management of multiple parallel requests | |
WO2010035426A1 (en) | Buffer memory device, memory system and data trnsfer method | |
JP2014517387A (en) | Efficient tag storage for large data caches | |
JP2016520233A (en) | Memory system, method for processing memory access requests, and computer system | |
US8190825B2 (en) | Arithmetic processing apparatus and method of controlling the same | |
CN110959154B (en) | Private cache for thread local store data access | |
TW201537454A (en) | Method and processor for processing data | |
US10733101B2 (en) | Processing node, computer system, and transaction conflict detection method | |
US6038642A (en) | Method and system for assigning cache memory utilization within a symmetric multiprocessor data-processing system | |
US20130191587A1 (en) | Memory control device, control method, and information processing apparatus | |
WO2016106738A1 (en) | Transaction conflict detection method and apparatus and computer system | |
US20130332665A1 (en) | Memory with bank-conflict-resolution (bcr) module including cache | |
US10713165B2 (en) | Adaptive computer cache architecture | |
US11119924B2 (en) | Interface device including ports and a cache memory, and control method thereof | |
US6775742B2 (en) | Memory device storing data and directory information thereon, and method for providing the directory information and the data in the memory device | |
JP2013210961A (en) | Cache memory device, method of controlling cache memory, and information processing device | |
US9606917B2 (en) | Arithmetic processing apparatus and method for controlling same | |
JP6059360B2 (en) | Buffer processing method and apparatus | |
KR101967857B1 (en) | Processing in memory device with multiple cache and memory accessing method thereof | |
US9454482B2 (en) | Duplicate tag structure employing single-port tag RAM and dual-port state RAM | |
US11704246B2 (en) | Memory system for maintaining data consistency and operation method thereof | |
US8495303B2 (en) | Processor and computer system with buffer memory | |
US8713291B2 (en) | Cache memory control device, semiconductor integrated circuit, and cache memory control method |