JP2014032555A - Cache memory controller and cache memory control method - Google Patents

Cache memory controller and cache memory control method Download PDF

Info

Publication number
JP2014032555A
JP2014032555A JP2012173206A JP2012173206A JP2014032555A JP 2014032555 A JP2014032555 A JP 2014032555A JP 2012173206 A JP2012173206 A JP 2012173206A JP 2012173206 A JP2012173206 A JP 2012173206A JP 2014032555 A JP2014032555 A JP 2014032555A
Authority
JP
Japan
Prior art keywords
memory
data
access
cache
read
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
JP2012173206A
Other languages
Japanese (ja)
Inventor
Junko Kishima
淳子 貴島
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2012173206A priority Critical patent/JP2014032555A/en
Publication of JP2014032555A publication Critical patent/JP2014032555A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To reduce data transfer processing between a main memory and a cache memory in the case where there is processing using data which does not need data holding after a read request from an access master.SOLUTION: A cache memory controller includes transfer attribute management means 50 for defining the necessity of data holding after reading from an access master in each memory area obtained by dividing a memory area of a main memory, hit detection means 10 for detecting whether to be a cache error to an access request, and request control means 30 for securing a cache line in a cache memory in the case of detecting a cache error when receiving a write request from the access master, and writing data subjected the write request from the access master in the secured cache line without performing data transfer from the main memory to the cache memory if data holding after reading a memory area including an address to which the access master performs the write request is defined as unnecessary.

Description

この発明は、アクセスマスタからメインメモリへのアクセス処理についてキャッシュメモリを介して実現するキャッシュメモリ制御装置に関する。   The present invention relates to a cache memory control device that realizes access processing from an access master to a main memory via a cache memory.

電子機器においては、メインメモリを搭載し、コンピュータプログラムの実行や、映像、音声、通信といったデータを扱った処理の実行を行なうときに、処理途中のデータをメインメモリに書き込み・読み出しを行うことが一般的に行われている。近年ではこのメインメモリの記憶容量が増加の一途をたどっており、通信機器や画像処理装置によっては、数ギガバイトから数テラバイトの半導体メモリ、例えばDRAM(Dynamic Random Access Memory)が搭載されるものもある。また、プロセッサコアやDMA(Dynamic Memory Accsess)回路を含む複数のアクセスマスタがメインメモリにアクセスするアーキテクチャが主流である。   An electronic device is equipped with a main memory, and when executing processing such as computer program execution and data processing such as video, audio, and communication, data being processed can be written to and read from the main memory. Generally done. In recent years, the storage capacity of this main memory has been steadily increasing, and some communication devices and image processing apparatuses are equipped with a semiconductor memory of several gigabytes to several terabytes, for example, a DRAM (Dynamic Random Access Memory). . Further, an architecture in which a plurality of access masters including a processor core and a DMA (Dynamic Memory Access) circuit access a main memory is mainstream.

このような場合、1つ以上のアクセスマスタがメインメモリに高速にアクセスするため、DRAMよりもSRAM(Static Random Memory)のような高速にデータアクセスが可能な半導体メモリをキャッシュメモリとして設けて、メモリを階層化することが一般的である。ここでキャッシュメモリは、アクセスマスタとメインメモリとの間におかれるもので、メインメモリに格納されるデータのうちの一部をキャッシュメモリに格納し、アクセスマスタがメインメモリにアクセス要求をしたときに、該当のデータがキャッシュメモリに格納されている場合は、メインメモリにアクセスすることなくキャッシュメモリに格納されたデータについてアクセスマスタの要求に基づいた書き込みまたは読み出しを行なう。これにより、メインメモリよりも高速にデータアクセスが可能なキャッシュメモリへのアクセスで対応できることになり、見かけ上のメインメモリへのアクセス速度を高速化できる。特に使用頻度の高いデータをキャッシュメモリに格納していれば、アクセスマスタが使用頻度の高いデータにアクセス要求すればするほどキャッシュメモリによる高速化の効果が顕著になる。   In such a case, since one or more access masters access the main memory at high speed, a semiconductor memory capable of high-speed data access, such as SRAM (Static Random Memory) rather than DRAM, is provided as a cache memory. Is generally hierarchized. Here, the cache memory is located between the access master and the main memory. When a part of the data stored in the main memory is stored in the cache memory, the access master makes an access request to the main memory. In addition, when the corresponding data is stored in the cache memory, the data stored in the cache memory is written or read based on the request of the access master without accessing the main memory. As a result, it is possible to cope with access to a cache memory capable of accessing data faster than the main memory, and the apparent access speed to the main memory can be increased. In particular, if frequently used data is stored in the cache memory, the effect of speeding up by the cache memory becomes more prominent as the access master requests access to frequently used data.

ここで、アクセスマスタがメインメモリにリード要求をした場合のキャッシュメモリ制御について説明する。キャッシュメモリ制御装置は、アクセスマスタがリード要求したアドレスに対応するデータがキャッシュメモリ側に格納されているときは、キャッシュメモリにアクセスしてキャッシュメモリに格納されたデータを読み出してアクセスマスタに出力する。一方、キャッシュメモリに格納されていないときは、一旦キャッシュメモリにアクセスマスタからリード要求されたデータを転送するためのキャッシュラインを確保する。ここで、キャッシュラインとは、キャッシュメモリの管理単位となるメモリ領域であってキャッシュメモリには複数のキャッシュラインによってメモリ領域が構成される。また、メインメモリとのデータ転送についてはキャッシュライン単位(またはライン単位、とよぶ)で行なわれる。   Here, the cache memory control when the access master issues a read request to the main memory will be described. When data corresponding to the address requested by the access master is stored on the cache memory side, the cache memory control device accesses the cache memory, reads the data stored in the cache memory, and outputs the data to the access master. . On the other hand, when the data is not stored in the cache memory, a cache line for temporarily transferring the data requested to be read from the access master is secured in the cache memory. Here, the cache line is a memory area that is a management unit of the cache memory, and the memory area is constituted by a plurality of cache lines in the cache memory. Data transfer with the main memory is performed in cache line units (or called line units).

上述のように確保したキャッシュラインに、アクセスマスタからリード要求されたアドレスを含むキャッシュライン単位のメモリ領域のデータをメインメモリからデータ転送する。このデータ転送を行なってから、リード要求されたアドレスのデータについてアクセスマスタへ出力する。ここで、アクセスマスタからメインメモリへアクセス要求されたときに、該当のアドレスのデータがキャッシュメモリに格納されているときをキャッシュヒットとよび、キャッシュメモリに格納されていないときをキャッシュミスとよぶ。   Data in the memory area of the cache line unit including the address requested to be read from the access master is transferred from the main memory to the cache line secured as described above. After performing this data transfer, the data at the address requested to be read is output to the access master. Here, when an access master requests access to the main memory, the data at the corresponding address is stored in the cache memory is called a cache hit, and the data not stored in the cache memory is called a cache miss.

次にアクセスマスタがメインメモリにライト要求をした場合のキャッシュメモリ制御について説明する。ライト要求された該当のアドレスに対応するキャッシュラインがキャッシュメモリに格納されているとき、つまりキャッシュヒットのときは、キャッシュメモリの該当のアドレスを含むキャッシュラインに書き込まれる。一方、キャッシュミスの場合は、一旦キャッシュメモリにアクセスマスタからリード要求されたデータを転送するためのキャッシュラインを確保してメインメモリに格納されている該当のキャッシュライン分のデータをキャッシュメモリへデータ転送した上で、キャッシュメモリの該当のアドレスを含むキャッシュラインに書き込まれる。   Next, cache memory control when the access master issues a write request to the main memory will be described. When the cache line corresponding to the corresponding address requested to be written is stored in the cache memory, that is, when a cache hit occurs, the data is written to the cache line including the corresponding address in the cache memory. On the other hand, in the case of a cache miss, a cache line for transferring the data requested to be read from the access master is once reserved in the cache memory, and the corresponding cache line data stored in the main memory is transferred to the cache memory. After the transfer, the data is written to the cache line including the corresponding address in the cache memory.

このとき、全てのキャッシュラインが使用状態になると、空きラインを確保するため、キャッシュメモリからメインメモリへの退避を行ない、キャッシュメモリに該当のアドレスを含むメモリ領域をキャッシュライン単位で確保する必要が生じる。退避するキャッシュラインの選択方法のアルゴリズムとして、参照されていない時間が最も長いキャッシュラインを選択するLRU(Least Recently Used)方式、または参照された頻度が最も低いラインを選択するLFU(Least Frequently Used)方式が知られている。   At this time, when all the cache lines are in use, it is necessary to save from the cache memory to the main memory and secure a memory area including the corresponding address in the cache memory in units of cache lines in order to secure an empty line. Arise. As an algorithm for selecting a cache line to be evacuated, an LRU (Least Recently Used) method that selects a cache line that has not been referred to for the longest time, or an LFU (Least Frequently Used) that selects a line that has been referred to the least frequently. The method is known.

このようにキャッシュメモリを設けて階層的にメモリを配置することにより、メインメモリへのアクセスは、キャッシュミス発生時と、空きライン確保のためのキャッシュ退避に集約されることになる。つまり、アクセスマスタからメインメモリへのデータ転送において、キャッシュヒットの確率が低下してキャッシュミスの発生が多くなればなるほどメインメモリへのアクセスが増えてデータ転送の高速化への妨げとなっていた。   By providing the cache memory in such a manner and arranging the memories in a hierarchical manner, access to the main memory is concentrated at the time of a cache miss and cache evacuation for securing a free line. In other words, in the data transfer from the access master to the main memory, as the probability of a cache hit decreases and the occurrence of a cache miss increases, the access to the main memory increases, which hinders the speed of data transfer. .

特に複数のアクセスマスタから1つのメインメモリにアクセスするときは、それぞれで違うメモリアドレス領域をアクセスする場合が増えるため、キャッシュヒットの確率が低下して全体の処理にかかる時間が延びるという問題があった。さらに、一方のアクセスマスタのタスク処理に関連するメモリアクセスと他方のアクセスマスタのタスク処理に関連するメモリアクセスとが混在した場合に、一方のアクセスマスタのタスク処理時に空きライン確保のためのキャッシュ退避が行う際に他方のアクセスマスタのタスク処理で必要なデータのキャッシュラインが退避されてしまうと、他方のアクセスマスタのタスク処理でメモリアクセスしたときにキャッシュミスとなり、タスク処理の高速化の妨げとなるという問題があった。また、キャッシュメモリに用いる半導体メモリはメインメモリにくらべてアクセスが高速である反面コストが高価であることから、キャッシュメモリの大容量化に頼ると、システム全体のコストアップが生じる。   In particular, when accessing a single main memory from a plurality of access masters, there is an increase in the number of accesses to different memory address areas. Therefore, there is a problem that the probability of a cache hit decreases and the time required for the entire processing increases. It was. In addition, when memory access related to task processing of one access master and memory access related to task processing of the other access master are mixed, cache evacuation is performed to secure an empty line during task processing of one access master. If the cache line of the data necessary for the task processing of the other access master is saved when a memory access is performed, a memory miss occurs when the memory access is performed by the task processing of the other access master, which hinders the speeding up of task processing. There was a problem of becoming. In addition, since the semiconductor memory used for the cache memory is faster in access than the main memory, the cost is high. Therefore, depending on the increase in the capacity of the cache memory, the cost of the entire system increases.

そこで、複数のタスクを並行処理するシステムにおいては、各タスクとキャッシュメモリのメモリ領域を分割した各メモリ領域とを対応付けて管理し、各タスクの処理によるメモリアクセスが混在してもお互いのタスクによって引き起こされるキャッシュミスをなくすという方法があった(例えば、特許文献1参照)。   Therefore, in a system that processes multiple tasks in parallel, each task is managed in association with each memory area obtained by dividing the memory area of the cache memory. There has been a method of eliminating a cache miss caused by (see, for example, Patent Document 1).

特開2004−178571号公報(第8−15頁、第1図)JP-A-2004-178571 (pages 8-15, FIG. 1)

従来の方法では、アクセスマスタからライト要求されたときにキャッシュミスであった場合、一旦キャッシュメモリにライト要求されたデータを書き込むためのキャッシュラインを確保し、ライト要求されているアドレスを含むキャッシュライン分のアドレスに該当するデータをメインメモリからキャッシュメモリの確保したキャッシュラインへデータ転送する処理を行なう。しかしながら、ライト要求されているアドレスのデータが一度しかリード要求されないデータであったとしても、キャッシュミスであれば必ずメインメモリとキャッシュメモリとの間のデータ転送処理が必要となり、処理システム全体の処理速度に悪影響を及ぼすこととなるという問題があった。   In the conventional method, if a cache miss occurs when a write request is issued from the access master, a cache line for once writing the data requested to be written to the cache memory is secured, and the cache line including the address for which the write request is made The data corresponding to the minute address is transferred from the main memory to the cache line secured in the cache memory. However, even if the data at the address requested to be written is data that is requested to be read only once, if there is a cache miss, data transfer processing between the main memory and the cache memory is always required, and the processing of the entire processing system There was a problem that the speed would be adversely affected.

この発明は、上述のような課題を解決する為になされたもので、アクセスマスタからリード要求された後のデータ保持が不要とされているデータを用いる処理がある場合にキャッシュミスしたときのメインメモリとキャッシュメモリとの間のデータ転送処理を削減して全体の処理速度を向上させるキャッシュメモリ制御装置を得ることを目的とする。   The present invention has been made to solve the above-described problems, and is the main in the case of a cache miss when there is a process using data that does not require data retention after a read request is made by the access master. An object of the present invention is to provide a cache memory control device that improves the overall processing speed by reducing data transfer processing between a memory and a cache memory.

この発明に係るキャッシュメモリ制御装置においては、メインメモリのメモリ領域を分割してそれぞれの分割された前記メモリ領域ごとにアクセスマスタからリードされた後のデータ保持の要否を定義して管理する転送属性管理手段と、前記アクセスマスタからアクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリに存在するか否かを検出するヒット検出手段と、前記アクセスマスタからのアクセス要求に基づいて、前記メインメモリと前記キャッシュメモリとの間のデータ転送及び前記キャッシュメモリへデータの書き込みまたはデータの読み出しを行う要求制御手段とを備え、前記要求制御手段は、前記アクセスマスタからのアクセス要求がライト要求であって前記ヒット検出手段がアクセス要求されたアドレスに対応するキャッシュラインが前記キャッシュメモリに存在しないと検出した場合に、前記キャッシュメモリにアクセス要求された前記アドレスに対応するキャッシュラインを確保し、分割された前記メモリ領域のうち前記転送属性管理手段によって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が必要と定義されていれば、ライト要求されているアドレスに対応するキャッシュラインに該当する前記メインメモリのアドレス領域に記憶されたデータを確保した前記キャッシュラインへデータ転送をしてから、さらに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込みを行ない、分割された前記メモリ領域のうち前記転送属性管理手段によって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が不要と定義されていれば、前記データ転送を行わずに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込むことを特徴とするものである。   In the cache memory control device according to the present invention, the memory area of the main memory is divided, and the transfer for defining and managing the necessity of holding data after being read from the access master for each of the divided memory areas Attribute management means, hit detection means for detecting whether or not a cache line corresponding to an address requested to be accessed from the access master exists in the cache memory, and based on the access request from the access master, the main memory Request control means for performing data transfer between the data and the cache memory, and writing data to or reading data from the cache memory, wherein the request control means is that the access request from the access master is a write request. Address for which the hit detection means is requested to access When it is detected that the corresponding cache line does not exist in the cache memory, a cache line corresponding to the address requested to be accessed is secured to the cache memory, and the transfer attribute management means in the divided memory area If the memory area containing the address requested by the access master is defined to hold data after being read from the access master, it corresponds to the cache line corresponding to the address requested to be written. The data transferred to the cache line that secures the data stored in the address area of the main memory is then written to the cache line that secures the data requested to be written by the access master, and the divided Out of memory area If it is defined by the transfer attribute management means that the memory area including the address requested by the access master to be written is not required to hold data after being read from the access master, the data transfer is not performed. The data requested by the access master to be written is written in the secured cache line.

この発明は、メインメモリのメモリ領域を分割して、それぞれの分割されたメモリ領域とアクセスマスタからリード要求がされた後のデータ保持の要否の定義とを対応付け、キャッシュミスと判定されたときはメインメモリから該当のキャッシュラインのデータを転送せずにキャッシュメモリにのみ書き込むことで、アクセスマスタからリード要求がされた後のデータ保持が不要なデータをライト要求した場合のキャッシュミスした際にメインメモリとキャッシュメモリとの間のデータ転送処理が不要となる。これにより、メインメモリとキャッシュメモリとの間のデータ転送処理を削減してシステム全体の処理速度を向上させることができる。   According to the present invention, the memory area of the main memory is divided, and the divided memory areas are associated with the definition of necessity of holding data after a read request is issued from the access master, and determined as a cache miss. When a cache miss occurs when a write request is made for data that does not need to be retained after a read request is made by the access master by writing only to the cache memory without transferring the data of the corresponding cache line from the main memory. In addition, data transfer processing between the main memory and the cache memory becomes unnecessary. As a result, the data transfer processing between the main memory and the cache memory can be reduced and the processing speed of the entire system can be improved.

この発明に係るキャッシュメモリ制御手段100および処理システムの構成を示すブロック図である。1 is a block diagram showing configurations of a cache memory control unit 100 and a processing system according to the present invention. FIG. 属性管理手段50が管理する属性の内容の一例を示す図である。It is a figure which shows an example of the content of the attribute which the attribute management means 50 manages. ライト要求の場合の要求制御手段30の処理を示すフローチャートである。It is a flowchart which shows the process of the request control means 30 in the case of a write request. リード要求の場合の要求制御手段30の処理を示すフローチャートである。It is a flowchart which shows the process of the request control means 30 in the case of a read request.

実施の形態1.
図1は、この発明の実施の形態1に係るキャッシュメモリ制御装置100および処理システムの構成を示すブロック図である。図1において、キャッシュメモリ制御手段100は、キャッシュメモリ150、それぞれのアクセスマスタ200,210、メインメモリ300と接続されている。図1のように複数のアクセスマスタ200,210は、共通のバスライン線に接続されている。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a configuration of a cache memory control device 100 and a processing system according to Embodiment 1 of the present invention. In FIG. 1, the cache memory control means 100 is connected to a cache memory 150, access masters 200 and 210, and a main memory 300. As shown in FIG. 1, the plurality of access masters 200 and 210 are connected to a common bus line.

アクセスマスタ200,210は、処理システムのなかで処理の実行を行うもので、メインメモリ300に格納されたコンピュータプログラムデータに基づいて実行するマイクロプロセッサであってもよいし、DMA回路などの汎用回路であってもよい。メインメモリ300へのアクセス要求をする作用については同様の作用を行なうものである。   The access masters 200 and 210 execute processing in the processing system, and may be microprocessors that execute based on computer program data stored in the main memory 300, or general-purpose circuits such as DMA circuits. It may be. The operation for requesting access to the main memory 300 performs the same operation.

メインメモリ300は、処理システムで用いられるデータを格納するものであって、例えばDRAMのような半導体メモリで構成される。   The main memory 300 stores data used in the processing system and is composed of a semiconductor memory such as a DRAM.

次に、図1に示す処理システムでのアクセスマスタ200とキャッシュメモリ制御装置100とのインターフェース信号について説明する。アクセス種別情報221は、アクセスマスタ200がメインメモリ300に対するアクセス要求の種別を示すものであって、書き込み(ライト)要求あるいは読み出し(リード)要求しているかを示す。アドレスデータ222は、アクセスマスタ200がアクセス要求しているメインメモリ300のアドレスを示す。ライトデータ223は、アクセスマスタ200がメインメモリ300へ書き込む際に出力するデータである。リードデータ224は、アクセスマスタ200がメインメモリ300に格納されたデータを読み出す際にキャッシュメモリ制御装置100から出力されるデータである。   Next, interface signals between the access master 200 and the cache memory control device 100 in the processing system shown in FIG. 1 will be described. The access type information 221 indicates the type of access request to the main memory 300 by the access master 200 and indicates whether a write (write) request or a read (read) request is made. The address data 222 indicates the address of the main memory 300 requested by the access master 200 for access. The write data 223 is data that is output when the access master 200 writes to the main memory 300. The read data 224 is data output from the cache memory control device 100 when the access master 200 reads data stored in the main memory 300.

同様に、図1に示す処理システムでのアクセスマスタ210とキャッシュメモリ制御装置100とのインターフェース信号について説明する。アクセス種別情報225は、アクセスマスタ210がメインメモリ300に対するアクセス要求の種別を示すものであって、書き込み(ライト)要求あるいは読み出し(リード)要求しているかを示す。アドレスデータ226は、アクセスマスタ210がアクセス要求しているメインメモリ300のアドレスを示す。ライトデータ227は、アクセスマスタ210がメインメモリ300へ書き込む際に出力するデータである。リードデータ228は、アクセスマスタ210がメインメモリ300に格納されたデータを読み出す際にキャッシュメモリ制御装置100から出力されるデータである。   Similarly, interface signals between the access master 210 and the cache memory control device 100 in the processing system shown in FIG. 1 will be described. The access type information 225 indicates the type of access request to the main memory 300 by the access master 210 and indicates whether a write (write) request or a read (read) request is being made. The address data 226 indicates the address of the main memory 300 requested by the access master 210 for access. The write data 227 is data that is output when the access master 210 writes to the main memory 300. The read data 228 is data output from the cache memory control device 100 when the access master 210 reads data stored in the main memory 300.

図1に示すアクセスマスタ200,210とキャッシュメモリ制御手段100との間のインターフェース信号以外に、アクセスマスタ200,210がアクセスするデータの長さを出力したり、キャッシュメモリ制御装置100がアクセス応答情報を出力したりしてやり取りしてもよい。また、図1では、2つのアクセスマスタ200,210がキャッシュメモリ制御手段100に接続される処理システムを表しているが、アクセスマスタの数は、1つ以上の任意の数でキャッシュ制御手段100を共有してよい。   In addition to the interface signal between the access masters 200 and 210 and the cache memory control means 100 shown in FIG. 1, the length of data accessed by the access masters 200 and 210 is output, and the cache memory control device 100 displays access response information. May be exchanged. Further, FIG. 1 shows a processing system in which two access masters 200 and 210 are connected to the cache memory control unit 100, but the number of access masters may be one or more arbitrary numbers. May be shared.

キャッシュメモリ150は、メインメモリ300よりも高速にデータ転送が可能なものであって、例えばSRAMのような半導体メモリで構成される。また、キャッシュメモリ制御装置100とは所定のデータ量単位で書き込みまたは読み出しができる。この所定のデータ量をラインと呼び、例えばライン単位を64バイトとしてメインメモリ300の連続した64バイトのデータが格納される。ライン単位が64バイトであってメインメモリ300の1つのアドレスに対するビット幅が32バイトであれば、メインメモリ300とキャッシュメモリ150とのデータ転送はメインメモリ300の2アドレス分を纏めてデータ転送することになる。メインメモリ300とキャッシュメモリ150とのデータ転送はライン複写とも呼ばれる。キャッシュメモリ150は、ライン単位のメモリ領域を1つのキャッシュラインとして、複数のキャッシュラインで構成される。   The cache memory 150 is capable of transferring data at a higher speed than the main memory 300, and is composed of a semiconductor memory such as an SRAM. Further, data can be written to or read from the cache memory control device 100 in a predetermined data amount unit. This predetermined amount of data is called a line. For example, 64 bytes of data in the main memory 300 are stored with the line unit being 64 bytes. If the line unit is 64 bytes and the bit width for one address of the main memory 300 is 32 bytes, the data transfer between the main memory 300 and the cache memory 150 is performed by transferring two addresses of the main memory 300 together. It will be. Data transfer between the main memory 300 and the cache memory 150 is also called line copying. The cache memory 150 is composed of a plurality of cache lines, with the memory area in units of lines as one cache line.

次にキャッシュメモリ制御装置100について説明する。キャッシュメモリ制御装置100は、ヒット検出手段10、リード監視手段20、要求制御手段30、タグメモリ40および属性管理手段50を備える。   Next, the cache memory control device 100 will be described. The cache memory control device 100 includes hit detection means 10, read monitoring means 20, request control means 30, tag memory 40, and attribute management means 50.

タグメモリ40は、キャッシュメモリ150の各キャッシュラインに格納されたデータのメインメモリ300におけるアドレス情報と、各キャッシュラインのデータが有効か無効かを示すフラグを格納する。ここで、このフラグが有効であるときはそのキャッシュラインにデータが存在する状態をいい、無効であるときはそのキャッシュラインにデータが存在しない状態をいう。   The tag memory 40 stores address information of data stored in each cache line of the cache memory 150 in the main memory 300 and a flag indicating whether the data of each cache line is valid or invalid. Here, when this flag is valid, it means a state where data exists in the cache line, and when it is invalid, it means a state where data does not exist in the cache line.

ヒット検出手段10は、タグメモリ40に格納された情報が読み取り可能にタグメモリ40と接続されている。また、アクセスマスタ200または210からアクセス要求があった場合に、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在するかどうかをタグメモリ40に格納されたアドレス情報とフラグとにより判断する。   The hit detection means 10 is connected to the tag memory 40 so that information stored in the tag memory 40 can be read. Further, when there is an access request from the access master 200 or 210, whether or not a cache line corresponding to the access requested address exists in the cache memory 150 is determined based on the address information and flag stored in the tag memory 40. To do.

アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在するかどうかを示す検出結果232と、キャッシュメモリ150上のアドレス情報233を出力する。検出結果232は、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在する場合はキャッシュヒットを示す情報、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在しない場合はキャッシュミスを示す情報となる。   The detection result 232 indicating whether or not the cache line corresponding to the access requested address exists in the cache memory 150 and the address information 233 on the cache memory 150 are output. The detection result 232 is information indicating a cache hit when the cache line corresponding to the access requested address exists in the cache memory 150, and cache information when the cache line corresponding to the access requested address does not exist in the cache memory 150. Information indicating a mistake.

判断の方法は、例えば、タグメモリ40の各キャッシュラインの情報のうち、フラグが有効であるキャッシュラインのアドレス情報を順次、アクセス要求をしているアクセスマスタより出力されているアドレスデータと比較する。フラグが有効であるキャッシュラインのアドレス情報のうち、アクセス要求されているアドレスデータと一致するアドレス情報がある場合は、キャッシュメモリ150にアクセスマスタ200,210がアクセス要求をしているデータが存在すると判断され、一致するアドレス情報がない場合はキャッシュメモリ150にアクセスマスタ200,210がアクセス要求をしているデータが存在しないと判断される。   For example, among the information on each cache line in the tag memory 40, the address information of the cache line whose flag is valid is sequentially compared with the address data output from the access master requesting the access. . If there is address information that matches the address data requested to be accessed among the address information of the cache line in which the flag is valid, the cache memory 150 includes data requested by the access masters 200 and 210. If there is no matching address information, it is determined that there is no data in the cache memory 150 that the access masters 200 and 210 have requested access to.

リード監視手段20は、キャッシュメモリ150のキャッシュライン毎にアクセスマスタ200,210から入力されるアクセス種別情報221,225とアドレスデータを監視し、アクセスマスタ200,210がそれぞれリードしたキャッシュラインを記憶する。リード監視手段20は、キャッシュメモリ150のキャッシュラインの数とアクセスマスタの数とを掛けた分の記憶素子を備える。   The read monitoring means 20 monitors the access type information 221 and 225 and address data input from the access masters 200 and 210 for each cache line of the cache memory 150, and stores the cache lines read by the access masters 200 and 210, respectively. . The read monitoring unit 20 includes storage elements corresponding to the number of cache lines in the cache memory 150 multiplied by the number of access masters.

リード監視手段20の動作について説明する。リード監視手段20は、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在するかどうかを示す検出結果232と、キャッシュメモリ150上のアドレス情報233を得る。   The operation of the lead monitoring means 20 will be described. The read monitoring unit 20 obtains a detection result 232 indicating whether or not the cache line corresponding to the access requested address exists in the cache memory 150 and address information 233 on the cache memory 150.

さらにリード監視手段20は、アクセスマスタ200,210から入力されたアドレスデータのうち、下位アドレスよりアドレス情報233に該当するキャッシュメモリ150のキャッシュライン中の位置を検出する。下位アドレスから、キャッシュメモリ150のキャッシュラインを構成するデータの末尾にアクセスしたと判断すると、アクセスを発行したアクセスマスタ200,210のアドレス情報233に該当するキャッシュラインの情報をリード済みと記憶する。リードする下位アドレスからリード状態を判定することにより、簡便な構成にてリード状態を監視できる。   Further, the read monitoring means 20 detects the position in the cache line of the cache memory 150 corresponding to the address information 233 from the lower address among the address data input from the access masters 200 and 210. If it is determined from the lower address that the end of the data constituting the cache line of the cache memory 150 has been accessed, the cache line information corresponding to the address information 233 of the access masters 200 and 210 that issued the access is stored as read. By determining the read state from the lower address to be read, the read state can be monitored with a simple configuration.

要求制御手段30は、アクセス要求されたアドレスのデータがキャッシュメモリ150に格納されている場合は、キャッシュメモリ150にアクセスする。アクセス要求されたアドレスのデータがキャッシュメモリ150に格納されていない場合は、アクセス種別情報221,225に応じた処理を行なう。   The request control means 30 accesses the cache memory 150 when the data of the address requested to be accessed is stored in the cache memory 150. When the data of the address requested to be accessed is not stored in the cache memory 150, processing according to the access type information 221 and 225 is performed.

データが一時データであるかどうかを識別するため、属性管理手段50にて、メインメモリ300を1つ以上の領域に分割し、それぞれの分割されたメモリ領域ごとの属性を定義する。属性管理手段50により定義される属性の内容を図2に示す。   In order to identify whether or not the data is temporary data, the attribute management unit 50 divides the main memory 300 into one or more areas and defines attributes for each divided memory area. The contents of the attributes defined by the attribute management means 50 are shown in FIG.

属性管理手段50は、メインメモリ300を1つ以上のメモリ領域に分割してそれぞれの分割されたメモリ領域ごとの属性を定義する。例えば、メインメモリ300のそれぞれの分割されたメモリ領域の開始アドレスの情報を格納することで、それぞれの分割されたメモリ領域を定義する。ここで、定義されたメモリ領域は必ずキャッシュメモリ150の1ライン以上の大きさをもち、キャッシュメモリ150に格納される際に同一キャッシュラインが複数領域にまたがることがないように定義される。   The attribute management means 50 divides the main memory 300 into one or more memory areas and defines attributes for each divided memory area. For example, by storing information on the start address of each divided memory area of the main memory 300, each divided memory area is defined. Here, the defined memory area always has a size of one line or more of the cache memory 150, and is defined so that the same cache line does not extend over a plurality of areas when stored in the cache memory 150.

さらに、定義されたメモリ領域ごとに、一時データを格納するメモリ領域(一時データ領域)であるかないかを定義して格納する。ここで、一時データとは、1つのアクセスマスタがライトしたデータをライトしたアクセスマスタと同じ、または異なるアクセスマスタが1回リードした後、次にアクセスマスタが新たなデータをライトすることにより更新されるまでの期間、どのアクセスマスタからもリードアクセスされることがないデータとする。   Further, for each defined memory area, whether or not it is a memory area (temporary data area) for storing temporary data is defined and stored. Here, the temporary data is updated when the access master writes the new data after the same or different access master reads the data written by one access master once. Data that is not read-accessed by any access master during the period up to

定義は、例えば処理システムで実行するプログラムに基づいて、いずれかのアクセスマスタが1回リードした後から新たにデータをライト要求されるまでの期間、どのアクセスマスタからもリードアクセスされることがないデータについて割り当てたアドレス領域か否かによって定義する。   The definition is based on, for example, a program executed in the processing system, and any access master is not read-accessed during a period from when any access master reads once until a new data write request is made. It is defined by whether or not the address area is assigned for data.

一時データ領域であるということは、キャッシュメモリ150上のあるキャッシュラインが更新された後、アクセスマスタ200,210がそのキャッシュラインを読み出し完了すると、次に当該メモリ領域へのデータ更新が起こるまでの間、当該メモリ領域への読み出し要求が発生しないことを表す。さらに、一時データ領域である場合は、そのメモリ領域をリードするアクセスマスタを定義して格納することで、定義されたアクセスマスタ以外がそのメモリ領域をリード要求しているかが容易に判別できる。   The temporary data area means that when a certain cache line on the cache memory 150 is updated and the access masters 200 and 210 complete reading the cache line, the next data update to the memory area occurs. In the meantime, this indicates that a read request to the memory area does not occur. Furthermore, in the case of a temporary data area, by defining and storing an access master that reads the memory area, it is possible to easily determine whether a memory area other than the defined access master is requesting to read the memory area.

図2は、属性管理手段50により定義される属性の内容を示す図である。図2のように、開始アドレスの情報を定義することで、メインメモリ300のメモリ領域が定義された数分のメモリ領域に分割されて定義されていることが判別でき、アクセス要求されたアドレスデータがどのメモリ領域内に属するかが判別できる。また、各メモリ領域に対応付けて一時データを格納する一時データ領域であるかないかを示す情報とそのメモリ領域をリードするアクセスマスタの情報を格納することで、アクセス要求されたアドレスデータが一時データを格納するデータであるかないか、どのアクセスマスタがリード要求すると定義されているかが判別できる。ここでリード要求すると定義されているアクセスマスタをリードマスタとよぶ。   FIG. 2 is a diagram showing the contents of the attributes defined by the attribute management means 50. As shown in FIG. 2, by defining the start address information, it can be determined that the memory area of the main memory 300 is divided into a defined number of memory areas, and the address data requested to be accessed. Can be determined in which memory area. In addition, by storing information indicating whether or not the temporary data area stores temporary data in association with each memory area and the information of the access master that reads the memory area, the address data requested to be accessed becomes temporary data. It is possible to determine whether the access master is defined as a read request or not. Here, the access master defined as a read request is called a read master.

次に、アクセスマスタ200,210がメインメモリ300に対してアクセス要求をしたときのキャッシュメモリ制御手段の動作について説明する。   Next, the operation of the cache memory control unit when the access masters 200 and 210 make an access request to the main memory 300 will be described.

図3は、アクセスマスタ200,210がメインメモリ300に対して書き込み(ライト)要求をしていることを示す場合の要求制御手段30が行う処理を示すフローチャートである。   FIG. 3 is a flowchart showing the processing performed by the request control means 30 when it indicates that the access masters 200 and 210 are making a write request to the main memory 300.

まず、ヒット検出手段10が、アクセス要求されたアドレスデータとタグメモリ40に格納された情報とから、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在するかどうかを判断する。要求制御手段30は、ヒット検出手段10からその判断結果とキャッシュメモリ150上のアドレス情報233を得る(ステップS400)。   First, the hit detection means 10 determines whether or not a cache line corresponding to the access requested address exists in the cache memory 150 from the address data requested to be accessed and the information stored in the tag memory 40. The request control unit 30 obtains the determination result and the address information 233 on the cache memory 150 from the hit detection unit 10 (step S400).

ステップS400にて、アクセス要求されたアドレスのデータがキャッシュメモリ150に存在する場合(Yes)は、要求制御手段30は、ヒット検出手段10より得たアドレス情報233で示されるキャッシュメモリ150上のキャッシュラインにライトデータを格納して(ステップS440)、ライト処理を完了する。   In step S400, when the data of the address requested to be accessed exists in the cache memory 150 (Yes), the request control means 30 determines that the cache on the cache memory 150 indicated by the address information 233 obtained from the hit detection means 10 is used. Write data is stored in the line (step S440), and the write process is completed.

ステップS400にて、アクセス要求されたアドレスのデータがキャッシュメモリ150に存在しない場合(No)は、ライト要求されているアドレスのライトデータを格納するためのキャッシュラインをキャッシュメモリ150上に確保する(ステップS410)。ここで、既にキャッシュメモリ150の全キャッシュラインにデータが格納されている場合は、過去に格納されたキャッシュラインをメインメモリ300へ退避することによりライト要求されているライトデータを格納するキャッシュラインを確保する。   In step S400, when the data of the address requested to be accessed does not exist in the cache memory 150 (No), a cache line for storing the write data of the address requested to be written is secured on the cache memory 150 ( Step S410). Here, when data is already stored in all the cache lines of the cache memory 150, the cache line for storing the write data requested to be written is saved by saving the cache line stored in the past to the main memory 300. Secure.

次に、要求制御手段30は、アクセス要求されたアドレスデータと属性管理手段50に格納された情報とから、ライト要求されているアドレスのライトデータが一時データであるかどうかの判別を行う(ステップS420)。   Next, the request control means 30 determines whether or not the write data at the address requested to be written is temporary data from the address data requested to be accessed and the information stored in the attribute management means 50 (step). S420).

ステップS420において、アクセスマスタ200,210がライト要求しているメモリ領域が一時データ領域でない場合には、要求制御手段30は、メインメモリ300にて記憶されたデータをステップS410にて確保したキャッシュメモリ150のキャッシュラインへライン複写する(ステップS430)。その後、要求制御手段30は、複写したキャッシュラインにアクセスマスタ200,210がライト要求したライトデータを上書きする(ステップS440)。以後、続けてアクセスマスタ200,210がこのキャッシュラインへのライト要求をしたときは、ステップS400にてライト領域がキャッシュメモリ150に存在する場合(Yes)になるため、ステップS440にてキャッシュメモリ150にライトデータを上書きする。   In step S420, if the memory area requested by the access masters 200, 210 is not a temporary data area, the request control means 30 uses the cache memory that secured the data stored in the main memory 300 in step S410. Line copying is performed to 150 cache lines (step S430). Thereafter, the request control means 30 overwrites the copied cache line with the write data requested to be written by the access masters 200 and 210 (step S440). Thereafter, when the access master 200, 210 makes a write request to this cache line, it becomes a case where the write area exists in the cache memory 150 in step S400 (Yes), so the cache memory 150 in step S440. Overwrites the write data.

一方、ステップS420において、ライトする領域が一時データ領域であると判別した場合(Yes)には、アクセスマスタ200,210はライトされたメモリ領域のみリードする一時データ領域の特性を鑑み、新たに確保したキャッシュラインに対して、メインメモリ300からキャッシュメモリ150へのライン複写を行わず、アクセスマスタ200、210より入力されたデータ223、227を確保したキャッシュラインに書き込みをして(ステップS440)、ライト処理を完了する。   On the other hand, if it is determined in step S420 that the area to be written is a temporary data area (Yes), the access masters 200 and 210 are newly secured in view of the characteristics of the temporary data area in which only the written memory area is read. For the cache line, the line copy from the main memory 300 to the cache memory 150 is not performed, and the data 223 and 227 input from the access masters 200 and 210 are written to the secured cache line (step S440). Complete the write process.

これにより、ステップS420において、ライト要求されたアドレスのデータが一時データかどうかを判定して、一時データでないときのみメインメモリ300からデータをデータ転送するので、アクセスするデータがキャッシュメモリに存在しない場合にも、キャッシュメモリ制御手段100がメインメモリ300へのアクセスをする回数を減らすことができる。   As a result, in step S420, it is determined whether the data at the write-requested address is temporary data, and the data is transferred from the main memory 300 only when the data is not temporary data. Therefore, the data to be accessed does not exist in the cache memory. In addition, the number of times the cache memory control unit 100 accesses the main memory 300 can be reduced.

図4は、アクセスマスタ200,210がメインメモリ300に対して読み出し(リード)要求をしていることを示す場合の要求制御手段30が行う処理を示すフローチャートである。   FIG. 4 is a flowchart showing the processing performed by the request control means 30 when the access masters 200 and 210 indicate that they are making a read (read) request to the main memory 300.

まず、ヒット検出手段10が、アクセス要求されたアドレスデータとタグメモリ40に格納された情報とから、アクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリ150に存在するかどうかを判断する。要求制御手段30は、ヒット検出手段10からその判断結果とキャッシュメモリ150上のアドレス情報233を得る(ステップS500)。   First, the hit detection means 10 determines whether or not a cache line corresponding to the access requested address exists in the cache memory 150 from the address data requested to be accessed and the information stored in the tag memory 40. The request control unit 30 obtains the determination result and the address information 233 on the cache memory 150 from the hit detection unit 10 (step S500).

ステップS500にて、アクセス要求されたアドレスのデータがキャッシュメモリ150に存在する場合(Yes)は、要求制御手段30は、ヒット検出手段10より得たアドレス情報233で示されるキャッシュメモリ150上のキャッシュラインから該当するデータを読み出してリードデータとして出力し(ステップS540)、リード処理を完了する。   In step S500, when the data of the address requested to be accessed exists in the cache memory 150 (Yes), the request control unit 30 caches the cache memory 150 indicated by the address information 233 obtained from the hit detection unit 10. The corresponding data is read from the line and output as read data (step S540), and the read process is completed.

ステップS500にて、アクセス要求されたアドレスのデータがキャッシュメモリ150に存在しない場合(No)は、リード要求されているアドレスのライトデータを読み出すためのキャッシュラインをキャッシュメモリ150上に確保する(ステップS510)。ここで、既にキャッシュメモリの全キャッシュラインにデータが格納されている場合は、過去に格納されたキャッシュラインをメインメモリへ退避することによりリード要求されているデータを格納するキャッシュラインを確保する。   In step S500, if the data at the address requested to access does not exist in the cache memory 150 (No), a cache line for reading the write data at the address requested to be read is secured on the cache memory 150 (step S500). S510). Here, when data is already stored in all the cache lines of the cache memory, a cache line for storing the data requested to be read is secured by saving the cache line stored in the past to the main memory.

要求制御手段30は、メインメモリ300にて記憶されたデータをステップS510にて確保したキャッシュメモリ150のキャッシュラインへライン複写する(ステップS530)。その後、要求制御手段30は、複写したキャッシュメモリ150上のキャッシュラインから該当するデータを読み出してリードデータとして出力する(ステップS540)。   The request control means 30 performs line copying of the data stored in the main memory 300 to the cache line of the cache memory 150 secured in step S510 (step S530). Thereafter, the request control means 30 reads the corresponding data from the cache line on the copied cache memory 150 and outputs it as read data (step S540).

次に要求制御手段30は、ステップS550にて、属性管理手段50よりリードした領域の属性を得て、アクセスマスタ200,210がリードしたメモリ領域が一時データ領域である場合には、さらにステップS560にて、リード監視手段20より、リードしたキャッシュメモリ150のキャッシュラインへのリード状態を得る。   Next, in step S550, the request control unit 30 obtains the attribute of the area read from the attribute management unit 50, and if the memory area read by the access masters 200 and 210 is a temporary data area, the request control unit 30 further performs step S560. Then, the read state of the read cache memory 150 to the cache line is obtained from the read monitoring means 20.

リード監視手段20は、キャッシュメモリ150のキャッシュラインの数×アクセスマスタの数分のリード状態記憶フラグを備え、アクセスマスタ200,210からのアクセス種別信号、アドレスデータにより、リード状態記憶フラグを更新する。例えば、アクセスマスタ200がライト要求をしたとき、ヒット検出手段10の検出結果がキャッシュヒットを示す場合、リード監視手段20は、アドレスデータ222がキャッシュラインの末尾アドレスであることを検知すると、当該キャッシュラインのリード状態記憶フラグのうち、アクセスマスタ200のリード状態を「未リード」を示す情報を記憶する。   The read monitoring unit 20 includes read state storage flags corresponding to the number of cache lines in the cache memory 150 × the number of access masters, and updates the read state storage flags with access type signals and address data from the access masters 200 and 210. . For example, when the access master 200 makes a write request and the detection result of the hit detection means 10 indicates a cache hit, the read monitoring means 20 detects that the address data 222 is the end address of the cache line, and Of the read status storage flag of the line, information indicating “unread” as the read status of the access master 200 is stored.

その後、アクセスマスタ200が当該キャッシュラインに転送されたアドレスのデータに対してリード要求をすると、リード監視手段20は、検出結果232、アドレスデータ222よりキャッシュメモリの当該キャッシュラインの末尾アドレスへのリードであることを検知すると、当該キャッシュラインのリード状態記憶フラグのうち、アクセスマスタ200のリード状態を「リード」を示す情報に更新する。   Thereafter, when the access master 200 makes a read request for the data at the address transferred to the cache line, the read monitoring means 20 reads from the detection result 232 and the address data 222 to the end address of the cache line in the cache memory. If it is detected, the read status of the access master 200 in the read status storage flag of the cache line is updated to information indicating “read”.

属性管理手段50にて定義されたリードマスタのリード状態が「リード」を示す情報となっていれば、そのキャッシュラインをキャッシュメモリ150より解放する。具体的には、タグメモリ40上の該当キャッシュラインのフラグを有効から無効に変更する(ステップS570)。属性管理手段50にて、複数のリードマスタが定義されている場合、定義されたリードマスタのリード状態が全て「リード」となっていれば、そのキャッシュラインをキャッシュメモリ150より解放する。   If the read status of the read master defined by the attribute management means 50 is information indicating “read”, the cache line is released from the cache memory 150. Specifically, the flag of the corresponding cache line on the tag memory 40 is changed from valid to invalid (step S570). When a plurality of read masters are defined in the attribute management means 50, if all the read statuses of the defined read masters are “read”, the cache line is released from the cache memory 150.

上述のように、ステップS550〜S570において、リード要求しているアクセスマスタ200,210のアドレスデータから、リードするデータが格納されているキャッシュラインが一時データ領域として定義されているかどうかを識別して、当該キャッシュラインが一時データ領域であり、定義されたアクセスマスタ200,210が当該キャッシュラインのデータをリード完了していれば、当該キャッシュラインを保持不要として、キャッシュメモリ150より解放できるので、メインメモリ300上の別のキャッシュラインのデータをキャッシュメモリ150に格納することができる。解放したキャッシュラインは、あるアクセスマスタが次にライトするまでの期間、同じアクセスマスタまたは別のアクセスマスタよりリードアクセスされることがないため、解放後のキャッシュミスによるメインメモリ300へのアクセス回数を減らすことができる。   As described above, in steps S550 to S570, it is identified from the address data of the access masters 200 and 210 that have requested reading whether or not the cache line storing the data to be read is defined as a temporary data area. If the cache line is a temporary data area and the defined access masters 200 and 210 have finished reading the data of the cache line, the cache line can be released from the cache memory 150 without being held. Data of another cache line on the memory 300 can be stored in the cache memory 150. Since the released cache line is not read-accessed by the same access master or another access master until a certain access master writes to the next, the number of accesses to the main memory 300 due to a cache miss after release is reduced. Can be reduced.

例えば、図1に示す処理システムがネットワークサービス加入者端末などのような通信処理装置である場合、通信処理装置は、PCなどの加入者端末より通信データを受け取ると、一旦通信データをメインメモリ300に格納し、ネットワークのプロトコルにしたがって同期をとり、格納された通信データを読み出してネットワークに出力する。通信データはネットワークに出力された後、メインメモリ300に格納されたまま再び読み出されることなく、新たな通信データに更新されてはじめて、再び読み出される一時データである。   For example, when the processing system shown in FIG. 1 is a communication processing device such as a network service subscriber terminal, when the communication processing device receives communication data from a subscriber terminal such as a PC, the communication data is temporarily stored in the main memory 300. The communication data is stored according to the network protocol, and the stored communication data is read out and output to the network. After the communication data is output to the network, it is temporary data that is read again only after being updated to new communication data without being read again while being stored in the main memory 300.

また、キャッシュライン解放の際にキャッシュメモリ150よりメインメモリ300への退避を省略することもできるので、メインメモリ300へのアクセス回数を減らすことができる。なお、図1に示すように、アクセスマスタ200,210より入力される2系統のアクセス信号221〜223、225〜227が個別にヒット検出手段10、リード監視手段20、要求制御手段30に入力され、2系統のアクセスを同時に受け付ける構成としてもよいし、キャッシュメモリ制御手段100が221〜223、225〜227の2系統のうち1系統を選択して、順次アクセスを受け付け、ヒット検出手段10、リード監視手段20、要求制御手段30には、アクセスマスタ200,210のいずれか1系統の信号が順次入力されるように構成してもよい。   Further, since the saving from the cache memory 150 to the main memory 300 can be omitted when the cache line is released, the number of accesses to the main memory 300 can be reduced. As shown in FIG. 1, two systems of access signals 221 to 223 and 225 to 227 input from the access masters 200 and 210 are individually input to the hit detection unit 10, the read monitoring unit 20, and the request control unit 30. The cache memory control unit 100 may select one of the two systems 221 to 223 and 225 to 227 to sequentially receive the access, hit detection unit 10, read The monitoring unit 20 and the request control unit 30 may be configured such that any one of the signals of the access masters 200 and 210 is sequentially input.

10 ヒット検出手段
20 リード監視手段
30 要求制御手段
40 タグメモリ
50 属性管理手段
100 キャッシュメモリ制御手段
150 キャッシュメモリ
200、210 アクセスマスタ
300 メインメモリ
DESCRIPTION OF SYMBOLS 10 Hit detection means 20 Read monitoring means 30 Request control means 40 Tag memory 50 Attribute management means 100 Cache memory control means 150 Cache memory 200, 210 Access master 300 Main memory

Claims (6)

メインメモリのメモリ領域を分割してそれぞれの分割された前記メモリ領域ごとにアクセスマスタからリードされた後のデータ保持の要否を定義して管理する転送属性管理手段と、
前記アクセスマスタからアクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリに存在するか否かを検出するヒット検出手段と、
前記アクセスマスタからのアクセス要求に基づいて、前記メインメモリと前記キャッシュメモリとの間のデータ転送及び前記キャッシュメモリへデータの書き込みまたはデータの読み出しを行う要求制御手段とを備え、
前記要求制御手段は、前記アクセスマスタからのアクセス要求がライト要求であって前記ヒット検出手段がアクセス要求されたアドレスに対応するキャッシュラインが前記キャッシュメモリに存在しないと検出した場合に、前記キャッシュメモリにアクセス要求された前記アドレスに対応するキャッシュラインを確保し、
分割された前記メモリ領域のうち前記転送属性管理手段によって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が必要と定義されていれば、ライト要求されているアドレスに対応するキャッシュラインに該当する前記メインメモリのアドレス領域に記憶されたデータを確保した前記キャッシュラインへデータ転送をしてから、さらに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込みを行ない、
分割された前記メモリ領域のうち前記転送属性管理手段によって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が不要と定義されていれば、前記データ転送を行わずに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込む
ことを特徴とするキャッシュメモリ制御装置。
Transfer attribute management means for defining and managing the necessity of data retention after the memory area of the main memory is divided and read from the access master for each of the divided memory areas;
Hit detection means for detecting whether or not a cache line corresponding to an address requested to be accessed from the access master exists in the cache memory;
A request control means for performing data transfer between the main memory and the cache memory and writing or reading data to or from the cache memory based on an access request from the access master;
The request control means, when the access request from the access master is a write request and the hit detection means detects that the cache line corresponding to the access requested address does not exist in the cache memory, the cache memory Secure a cache line corresponding to the address requested to be accessed,
If the memory area including the address requested by the access master to be written by the transfer attribute management means among the divided memory areas is defined to hold data after being read from the access master The data transferred to the cache line that secures the data stored in the address area of the main memory corresponding to the cache line corresponding to the address for which the write request is made, and then the data requested by the access master to be written Write to the reserved cache line,
If the memory area including the address requested by the access master to be written by the transfer attribute management means among the divided memory areas is defined as needing no data retention after being read from the access master A cache memory control device, wherein the data requested by the access master to be written is written to the secured cache line without performing the data transfer.
アクセスマスタごとにそのアクセスマスタからのリード要求に対応したキャッシュラインの情報を記憶するリード監視手段をさらに備え、
前記転送属性管理手段は、前記メインメモリのそれぞれ分割された前記メモリ領域ごとにリードアクセスをするアクセスマスタをさらに定義して管理するものであり、
前記要求制御手段は、リード監視手段からの情報と前記転送属性管理手段で定義された情報とに基づいて、アクセスマスタからのリード要求に対応したキャッシュラインについて、定義されたアクセスマスタがリードを完了したと判断したときは、前記アクセスマスタからのリード要求に対応した前記キャッシュラインを開放する
ことを特徴とする請求項1に記載のキャッシュメモリ制御装置。
For each access master, it further comprises a read monitoring means for storing cache line information corresponding to a read request from the access master,
The transfer attribute management means further defines and manages an access master that performs read access for each of the divided memory areas of the main memory,
The request control means, based on the information from the read monitoring means and the information defined by the transfer attribute management means, the defined access master completes the read for the cache line corresponding to the read request from the access master. 2. The cache memory control device according to claim 1, wherein when it is determined that the cache line has been read, the cache line corresponding to the read request from the access master is released.
前記リード監視手段は、前記アクセスマスタからのリード要求が、そのアクセスマスタからのリード要求に対応したキャッシュラインの末尾のデータまでリード要求するものであったときに、そのキャッシュラインの全データをリードしたと判定して記憶する
ことを特徴とする請求項2に記載のキャッシュメモリ制御装置。
The read monitoring means reads all data of the cache line when the read request from the access master is a read request to the last data of the cache line corresponding to the read request from the access master. The cache memory control device according to claim 2, wherein the cache memory control device stores and determines that it has been performed.
メインメモリのメモリ領域を分割してそれぞれの分割された前記メモリ領域ごとにアクセスマスタからリードされた後のデータ保持の要否を定義して管理する転送属性管理ステップと、
前記アクセスマスタからアクセス要求されたアドレスに対応するキャッシュラインがキャッシュメモリに存在するか否かを検出するヒット検出ステップと、
前記アクセスマスタからのアクセス要求に基づいて、前記メインメモリと前記キャッシュメモリとの間のデータ転送及び前記キャッシュメモリへデータの書き込みまたはデータの読み出しを行う要求制御ステップとを備え、
前記要求制御ステップは、前記アクセスマスタからのアクセス要求がライト要求であって前記ヒット検出手段がアクセス要求されたアドレスに対応するキャッシュラインが前記キャッシュメモリに存在しないと検出した場合に、前記キャッシュメモリにアクセス要求された前記アドレスに対応するキャッシュラインを確保し、
分割された前記メモリ領域のうち前記転送属性管理ステップによって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が必要と定義されていれば、ライト要求されているアドレスに対応するキャッシュラインに該当する前記メインメモリのアドレス領域に記憶されたデータを確保した前記キャッシュラインへデータ転送をしてから、さらに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込みを行ない、
分割された前記メモリ領域のうち前記転送属性管理ステップによって前記アクセスマスタがライト要求しているアドレスを含む前記メモリ領域について、前記アクセスマスタからリードされた後のデータ保持が不要と定義されていれば、前記データ転送を行わずに前記アクセスマスタがライト要求したデータを確保した前記キャッシュラインに書き込む
ことを特徴とするキャッシュメモリ制御方法。
A transfer attribute management step that divides the memory area of the main memory and defines and manages whether to hold data after being read from the access master for each of the divided memory areas;
A hit detection step of detecting whether a cache line corresponding to an address requested to be accessed from the access master exists in a cache memory;
A request control step for performing data transfer between the main memory and the cache memory and writing or reading data to or from the cache memory based on an access request from the access master;
In the request control step, when the access request from the access master is a write request and the hit detection means detects that the cache line corresponding to the access requested address does not exist in the cache memory, the cache memory Secure a cache line corresponding to the address requested to be accessed,
If the memory area including the address requested by the access master in the transfer attribute management step among the divided memory areas is defined as needing to hold data after being read from the access master The data transferred to the cache line that secures the data stored in the address area of the main memory corresponding to the cache line corresponding to the address for which the write request is made, and then the data requested by the access master to be written Write to the reserved cache line,
If the memory area including the address requested by the access master in the transfer attribute management step among the divided memory areas is defined as holding data after being read from the access master is unnecessary A cache memory control method, wherein the data requested to be written by the access master is written to the cache line secured without performing the data transfer.
アクセスマスタごとにそのアクセスマスタからのリード要求に対応したキャッシュラインの情報を記憶するリード監視ステップをさらに備え、
前記転送属性管理ステップは、前記メインメモリのそれぞれ分割された前記メモリ領域ごとにリードアクセスをするアクセスマスタをさらに定義して管理するものであり、
前記要求制御ステップは、リード監視ステップからの情報と前記転送属性管理ステップで定義された情報とに基づいて、アクセスマスタからのリード要求に対応したキャッシュラインについて、定義されたアクセスマスタがリードを完了したと判断したときは、前記アクセスマスタからのリード要求に対応した前記キャッシュラインを開放する
ことを特徴とする請求項4に記載のキャッシュメモリ制御方法。
A read monitoring step for storing information of a cache line corresponding to a read request from the access master for each access master is further provided,
The transfer attribute management step further defines and manages an access master that performs read access for each of the divided memory areas of the main memory,
In the request control step, the defined access master completes the read for the cache line corresponding to the read request from the access master based on the information from the read monitoring step and the information defined in the transfer attribute management step. 5. The cache memory control method according to claim 4, wherein when it is determined that the cache line is satisfied, the cache line corresponding to the read request from the access master is released.
前記リード監視ステップは、前記アクセスマスタからのリード要求が、そのアクセスマスタからのリード要求に対応したキャッシュラインの末尾のデータまでリード要求するものであったときに、そのキャッシュラインの全データをリードしたと判定して記憶する
ことを特徴とする請求項5に記載のキャッシュメモリ制御方法。
The read monitoring step reads all data of the cache line when the read request from the access master is a read request to the last data of the cache line corresponding to the read request from the access master. 6. The cache memory control method according to claim 5, wherein the determination is made and stored.
JP2012173206A 2012-08-03 2012-08-03 Cache memory controller and cache memory control method Pending JP2014032555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012173206A JP2014032555A (en) 2012-08-03 2012-08-03 Cache memory controller and cache memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012173206A JP2014032555A (en) 2012-08-03 2012-08-03 Cache memory controller and cache memory control method

Publications (1)

Publication Number Publication Date
JP2014032555A true JP2014032555A (en) 2014-02-20

Family

ID=50282330

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012173206A Pending JP2014032555A (en) 2012-08-03 2012-08-03 Cache memory controller and cache memory control method

Country Status (1)

Country Link
JP (1) JP2014032555A (en)

Similar Documents

Publication Publication Date Title
US8949544B2 (en) Bypassing a cache when handling memory requests
US9280290B2 (en) Method for steering DMA write requests to cache memory
US8762651B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
US8423736B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
US10331568B2 (en) Locking a cache line for write operations on a bus
US20110173400A1 (en) Buffer memory device, memory system, and data transfer method
US9645931B2 (en) Filtering snoop traffic in a multiprocessor computing system
US20060179185A1 (en) Method to preserve ordering of read and write operations in a DMA system by delaying read access
CN110555001B (en) Data processing method, device, terminal and medium
CN113641596B (en) Cache management method, cache management device and processor
US10324760B2 (en) Leases for blocks of memory in a multi-level memory
CN111338561B (en) Memory controller and memory page management method
US10642740B2 (en) Methods for performing a memory resource retry
CN114579480A (en) Page missing processing method, device and system, electronic equipment and storage medium
US9342472B2 (en) PRD (physical region descriptor) pre-fetch methods for DMA (direct memory access) units
US20170199819A1 (en) Cache Directory Processing Method for Multi-Core Processor System, and Directory Controller
US8938588B2 (en) Ensuring forward progress of token-required cache operations in a shared cache
US20070150653A1 (en) Processing of cacheable streaming data
CN106406745A (en) Method and device for maintaining Cache data uniformity according to directory information
JP2014032555A (en) Cache memory controller and cache memory control method
US11914865B2 (en) Methods and systems for limiting data traffic while processing computer system operations
JPWO2007110898A1 (en) Multiprocessor system and method of operating multiprocessor system
CN117453608A (en) NVMe command processing method, computer equipment, storage medium and product
CN117311638A (en) Cache management method, cache management device and processor
US7840757B2 (en) Method and apparatus for providing high speed memory for a processing unit

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20140326