JP2010217992A - Cache controller, cache control method, and cache control program - Google Patents

Cache controller, cache control method, and cache control program Download PDF

Info

Publication number
JP2010217992A
JP2010217992A JP2009061095A JP2009061095A JP2010217992A JP 2010217992 A JP2010217992 A JP 2010217992A JP 2009061095 A JP2009061095 A JP 2009061095A JP 2009061095 A JP2009061095 A JP 2009061095A JP 2010217992 A JP2010217992 A JP 2010217992A
Authority
JP
Japan
Prior art keywords
cache control
cache
timing
processing
delay time
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
JP2009061095A
Other languages
Japanese (ja)
Inventor
Masakatsu Toyama
正勝 外山
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 JP2009061095A priority Critical patent/JP2010217992A/en
Publication of JP2010217992A publication Critical patent/JP2010217992A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To perform prefetch in a proper timing so that data that are likely to be accessed in each cycle are read from a cache, in a cyclic processing whose scale is large enough to exceed the capacity of a cache memory. <P>SOLUTION: A cache control analyzing part 115 generates access statistical information 116 showing the statistics of timings of cache miss and addresses for cache misses which have occurred in the same addresses in different timings of 10 micro-seconds in N÷5 or more cycles in 1-N cycles of cyclic processing. A timing correction part 117 sets the prefetch timing from the statistics of the timings shown by the access statistical information 116, the time for prefetch processing and the time for accessing a RAM 111 when the cache miss occurs. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、キャッシュ制御装置及びキャッシュ制御方法及びキャッシュ制御プログラムに関するものである。   The present invention relates to a cache control device, a cache control method, and a cache control program.

例えば工業用コントローラ製品のような組み込み機器では、センサ等の入力や制御用出力に対し一定時間内に応答する、リアルタイム性が求められる。そのような組み込み機器のソフトウェアは、一般的に、一定の時間間隔で決められた処理を繰り返し実行する、周期処理で構成される。このような組み込み機器では、一定時間にできるだけ多くの処理や計算を実行することが高性能・高機能につながるが、その処理性能に大きく影響する要因の1つとして、メモリキャッシュがある。   For example, an embedded device such as an industrial controller product is required to have real-time characteristics that respond to a sensor input or a control output within a predetermined time. Software for such an embedded device is generally configured by periodic processing that repeatedly executes processing determined at regular time intervals. In such an embedded device, executing as many processes and calculations as possible in a certain time leads to high performance and high functionality, but one of the factors that greatly affects the processing performance is a memory cache.

キャッシュ容量が十分であれば、毎周期アクセスするようなデータは常にキャッシュ上に存在していることになり、周期処理はメモリアクセスに対して待たされることなく、効率よく実行することができる。しかしながら、組み込み機器の高機能化のためにソフトウェア規模が肥大化した影響で、周期処理で扱うデータがキャッシュに収まり切らなくなったために、毎周期決まった位置でキャッシュミスが発生してしまい、実行速度低下を引き起こしてしまうケースが発生する。   If the cache capacity is sufficient, data that is accessed every cycle is always present in the cache, and the periodic processing can be executed efficiently without waiting for memory access. However, due to the increase in software scale due to the high functionality of embedded devices, the data handled by periodic processing cannot be stored in the cache, so a cache miss occurs at a fixed position every cycle, and the execution speed Cases that cause a drop occur.

特許文献1では、上記のケースに対応するために、プログラムの区間ごとの平均クロック数と、キャッシュミスを起こした位置と経過時間を監視することによって周期を割り出し、さらにキャッシュミスを引き起こした経過時間とシステム固有のメモリアクセス遅延時間を基に、その周期内のプリフェッチ位置を求め、そのタイミングでプリフェッチを行うことで、周期処理で毎回発生するキャッシュミスを抑止する方法が開示されている。   In Patent Document 1, in order to deal with the above case, the period is determined by monitoring the average number of clocks for each section of the program, the position where the cache miss occurred, and the elapsed time, and the elapsed time causing the cache miss. And a system-specific memory access delay time, a prefetch position within the cycle is obtained, and a prefetch is performed at that timing, thereby preventing a cache miss that occurs each time in the cycle processing.

また、特許文献2では、決まったパターンのデータアクセスがある場合に、アクセス履歴を記録しておき、次のアクセス時にその履歴を指定することで先読みを行う方法が開示されている。   Further, Patent Document 2 discloses a method of prefetching by recording an access history when there is a predetermined pattern of data access and designating the history at the next access.

特開2008−226025号公報JP 2008-2226025 A 特開2005−157711号公報JP 2005-157711 A

特許文献1の方法では、プリフェッチ位置を決める際に、キャッシュミスを引き起こした経過時間に対し、メモリアクセス遅延時間分だけ早いタイミングでプリフェッチ指示を与えている。しかし、この方法では、周期内の複数個のキャッシュミスに対処しようとした場合に、プリフェッチにより周期の先頭のキャッシュミスが解消されたことにより、以降に発生するはずのキャッシュミスの位置がメモリアクセス遅延分だけ早まるために、プリフェッチのタイミングが実動作に対して遅れてしまう可能性があり、適切なタイミングでプリフェッチを行うことができないという課題があった。   In the method of Patent Document 1, when determining the prefetch position, a prefetch instruction is given at a timing earlier by the memory access delay time than the elapsed time causing the cache miss. However, with this method, when trying to deal with multiple cache misses within a cycle, the cache miss position that should occur after the cache miss that occurred after pre-fetching has been resolved. Since it is advanced by the delay, there is a possibility that the prefetch timing may be delayed with respect to the actual operation, and there is a problem that prefetch cannot be performed at an appropriate timing.

また、特許文献2の方法は、アクセスする順序を前もって知らせることで先読みを可能にするものであり、そのタイミングについては考慮されないため、周期処理に対して適用することができないという課題があった。メモリキャッシュの場合、データを前もって用意すればいいだけはでなく、その用意するタイミングが重要であり、早すぎれば他の処理の実行を妨げてしまうおそれもある。   In addition, the method of Patent Document 2 enables prefetching by informing the access order in advance, and there is a problem that it cannot be applied to periodic processing because the timing is not considered. In the case of a memory cache, it is not only necessary to prepare data in advance, but the timing for preparing the data is important, and if it is too early, execution of other processing may be hindered.

本発明は、例えば、キャッシュメモリの容量を超えるような規模の大きな周期処理において、毎周期アクセスされる確率が高いデータがキャッシュヒットとなるよう、適切なタイミングでプリフェッチを行うことを目的とする。   An object of the present invention is to perform prefetching at an appropriate timing so that, for example, in a large-scale periodic process exceeding the capacity of a cache memory, data having a high probability of being accessed every cycle is a cache hit.

本発明の一の態様に係るキャッシュ制御装置は、
メインメモリからキャッシュメモリへデータを予め読み出すプリフェッチ処理のための時間であるキャッシュ制御処理遅延時間と、キャッシュミスが発生した場合にメインメモリにアクセスするための時間であるメモリアクセス遅延時間とを示す遅延時間情報と、一定周期ごとに実行される周期処理の複数周期にて発生したキャッシュミスごとに、キャッシュミスが発生したタイミングとアドレスとを示すアクセストレース情報とを予め記憶する記憶装置と、データ処理を行う処理装置とを具備し、
前記記憶装置に記憶されたアクセストレース情報から、前記複数周期のうち、所定数以上の周期にて所定範囲内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として処理装置により抽出し、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量を前記処理装置により計算し、計算したタイミングの統計量と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報を前記処理装置により生成するキャッシュ制御解析部と、
前記キャッシュ制御解析部により抽出されたキャッシュミス集合ごとに、前記キャッシュ制御解析部により生成されたアクセス統計情報で示されるタイミングの統計量と前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間及びメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを前記処理装置により設定し、設定したタイミングと当該アクセス統計情報で示されるアドレスとを示すキャッシュ制御シナリオを前記処理装置により生成するキャッシュ制御シナリオ生成部とを備えることを特徴とする。
A cache control device according to one aspect of the present invention includes:
A delay indicating a cache control processing delay time that is a time for prefetch processing for pre-reading data from the main memory to the cache memory, and a memory access delay time that is a time for accessing the main memory when a cache miss occurs A storage device for preliminarily storing time information and access trace information indicating the timing and address at which a cache miss occurs for each cache miss occurring in a plurality of cycles of periodic processing executed at fixed intervals; and data processing And a processing device for performing
From the access trace information stored in the storage device, a cache miss that occurs at the same address with a timing difference within a predetermined range in a predetermined number of cycles or more among the plurality of cycles is extracted as a cache miss set by the processing device. For each extracted cache miss set, the processing device calculates the statistics of the timing at which a cache miss has occurred, and provides access statistical information indicating the calculated timing statistics and the address at which the cache miss has occurred. Cache control analysis unit generated by
For each cache miss set extracted by the cache control analysis unit, the cache control indicated by the timing statistics indicated by the access statistical information generated by the cache control analysis unit and the delay time information stored in the storage device Based on the processing delay time and the memory access delay time, the processing device sets the timing for executing the prefetch processing, and the processing device generates a cache control scenario indicating the set timing and the address indicated by the access statistical information. And a cache control scenario generation unit.

本発明の一の態様によれば、キャッシュ制御装置において、キャッシュ制御解析部が、周期処理の複数周期のうち、所定数以上の周期にて所定範囲内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として抽出し、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量とアドレスとを示すアクセス統計情報を生成し、キャッシュ制御シナリオ生成部が、キャッシュミス集合ごとに、アクセス統計情報で示されるタイミングの統計量と、プリフェッチ処理のための時間であるキャッシュ制御処理遅延時間と、キャッシュミスが発生した場合にメインメモリにアクセスするための時間であるメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを設定し、設定したタイミングとアクセス統計情報で示されるアドレスとを示すキャッシュ制御シナリオを生成するため、キャッシュメモリの容量を超えるような規模の大きな周期処理において、毎周期アクセスされる確率が高いデータがキャッシュヒットとなるよう、キャッシュ制御シナリオに従って適切なタイミングでプリフェッチを行うことが可能となる。   According to an aspect of the present invention, in the cache control device, the cache control analysis unit generates a cache generated for the same address with a timing difference within a predetermined range in a predetermined number or more of a plurality of cycles of the periodic processing. A miss is extracted as a cache miss set, and for each extracted cache miss set, access statistical information indicating the statistics and address of the timing at which the cache miss occurs is generated, and the cache control scenario generator generates a cache miss set for each cache miss set. , The timing statistics indicated by the access statistical information, the cache control processing delay time that is the time for prefetch processing, and the memory access delay time that is the time to access the main memory when a cache miss occurs To set the timing to execute the prefetch process, In order to generate a cache control scenario that indicates the specified timing and the address indicated by the access statistical information, in a large-scale periodic process exceeding the capacity of the cache memory, data with a high probability of being accessed every cycle is a cache hit. Thus, prefetching can be performed at an appropriate timing according to the cache control scenario.

実施の形態1に係るキャッシュ制御装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of a cache control device according to a first embodiment. 実施の形態1に係るキャッシュ制御装置のハードウェア構成の一例を示す図である。2 is a diagram illustrating an example of a hardware configuration of a cache control device according to Embodiment 1. FIG. 実施の形態1に係るアクセストレース情報の一例を示すテーブルである。10 is a table showing an example of access trace information according to the first embodiment. 実施の形態1に係るキャッシュ制御解析部がプリフェッチの対象とするキャッシュミスを抽出する方法を示す図である。It is a figure which shows the method in which the cache control analysis part which concerns on Embodiment 1 extracts the cache miss made into the object of prefetch. 実施の形態1に係るアクセス統計情報の一例を示すテーブルである。10 is a table showing an example of access statistical information according to the first embodiment. 実施の形態1に係るキャッシュ制御シナリオの一例を示すテーブルである。4 is a table showing an example of a cache control scenario according to the first embodiment. 実施の形態1に係るキャッシュ制御部の動作を示すフローチャートである。4 is a flowchart illustrating an operation of a cache control unit according to the first embodiment. 実施の形態2に係る同期イベントを定義する情報の一例を示すテーブルである。10 is a table showing an example of information defining a synchronization event according to the second embodiment. 実施の形態2に係るアクセス統計情報の一例を示すテーブルである。10 is a table showing an example of access statistical information according to the second embodiment. 実施の形態2に係るキャッシュ制御シナリオの一例を示すテーブルである。10 is a table showing an example of a cache control scenario according to the second embodiment. 実施の形態2に係るキャッシュ制御部の動作を示すフローチャートである。10 is a flowchart illustrating an operation of a cache control unit according to the second embodiment. 実施の形態2に係るキャッシュ制御部の動作を示すフローチャートである。10 is a flowchart illustrating an operation of a cache control unit according to the second embodiment. 実施の形態2に係るキャッシュ制御部の動作を示すフローチャートである。10 is a flowchart illustrating an operation of a cache control unit according to the second embodiment. 実施の形態3に係るキャッシュ制御装置の構成を示すブロック図である。FIG. 10 is a block diagram illustrating a configuration of a cache control device according to a third embodiment. 実施の形態3に係るキャッシュ制御部の動作を示すフローチャートである。14 is a flowchart illustrating an operation of a cache control unit according to the third embodiment.

以下、本発明の実施の形態について、図を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

実施の形態1.
図1は、本実施の形態に係るキャッシュ制御装置100の構成を示すブロック図である。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing the configuration of the cache control apparatus 100 according to the present embodiment.

図1において、キャッシュ制御装置100は、メインコア101とサブコア102とを含むマルチコアプロセッサを具備している。以下では、マルチコアプロセッサを用いて、周期処理(一定周期ごとに実行される処理)を実行するプロセッサコア(メインコア101)とは別のコア(サブコア102)において、本実施の形態に係るキャッシュ制御を行う方法を示す。なお、シングルコアプロセッサを用いて、本実施の形態に係るキャッシュ制御を行ってもよい。   In FIG. 1, the cache control device 100 includes a multi-core processor including a main core 101 and a sub-core 102. In the following, the cache control according to the present embodiment is performed in a core (sub-core 102) different from the processor core (main core 101) that executes periodic processing (processing executed at regular intervals) using a multi-core processor. Shows how to do. Note that cache control according to the present embodiment may be performed using a single core processor.

キャッシュ制御装置100は、メインコア101側には、通常の周期処理を行う周期タスク103と、周期タスク103の実行を管理するOS104(オペレーティングシステム)を備える。キャッシュ制御装置100は、さらにOS104には、タスク、割り込みハンドラ、システムコール等の実行コンテキストを切り替える処理を担うディスパッチャ105を監視(フック)し、周期タスク103の実行状況を、共有メモリを用いてサブコア102側に通知する同期部106を備える。なお、通知の方法としては、共有メモリのほかに、割り込み信号や、通信用レジスタ、その他コア間共有資源を用いる方法が考えられるが、これらに限定されない。   The cache control apparatus 100 includes, on the main core 101 side, a periodic task 103 that performs normal periodic processing, and an OS 104 (operating system) that manages execution of the periodic task 103. The cache control apparatus 100 further monitors (hooks) the dispatcher 105 responsible for switching execution contexts such as tasks, interrupt handlers, and system calls in the OS 104, and uses the shared memory to monitor the execution status of the periodic task 103. A synchronization unit 106 that notifies the 102 side is provided. As a notification method, in addition to the shared memory, a method of using an interrupt signal, a communication register, and other shared resources between cores is conceivable, but is not limited thereto.

キャッシュ制御装置100は、サブコア102側には、プリフェッチ(メインメモリからキャッシュメモリへデータを予め読み出す処理)を行うアドレスとタイミングが記載されたキャッシュ制御シナリオ107と、同期部106から通知された周期処理の開始時点からの経過時間を計測するクロックカウンタ108と、これらを参照して指定されたタイミングでプリフェッチを行うキャッシュ制御部109を備える。   The cache control device 100 includes, on the sub-core 102 side, a cache control scenario 107 in which an address and timing for performing prefetch (a process for reading data from the main memory to the cache memory in advance) are described, and the periodic processing notified from the synchronization unit 106 A clock counter 108 that measures an elapsed time from the start point of the cache, and a cache control unit 109 that performs prefetching at a designated timing with reference to these.

本実施の形態では、キャッシュ制御装置100は、キャッシュ制御シナリオ107を生成するために、共有キャッシュ110(キャッシュメモリの一例)とRAM111(Random・Access・Memory)(メインメモリの一例)の間のデータ転送を管理するメモリコントローラ112の挙動を監視することで、キャッシュミスを引き起こすアドレスと時刻情報の収集を行うメモリアクセス監視部113を備える。なお、収集の方法としては、メモリコントローラ112の挙動を監視するほか、メモリバスのトレースや、シミュレータによるキャッシュ挙動シミュレーション結果の分析等、様々な方法を用いることが可能である。周期タスク103の実行中に収集された情報は、メモリアクセス監視部113によりアクセストレース情報114としてHDD(Hard・Disk・Drive)に保存される。キャッシュ制御装置100は、アクセストレース情報114をキャッシュ制御解析部115によって解析することにより、各周期に共通するキャッシュミス発生タイミングを抽出し、アクセス統計情報116を生成する。アクセス統計情報116は、キャッシュ制御解析部115によりHDDに保存される。その後、タイミング補正部117(キャッシュ制御シナリオ生成部の一例)によってプリフェッチを行う適切なタイミングを算出した結果が、キャッシュ制御シナリオ107としてHDDに保存される。   In the present embodiment, the cache control device 100 generates data between the shared cache 110 (an example of a cache memory) and a RAM 111 (an example of a random access memory) (an example of a main memory) in order to generate a cache control scenario 107. A memory access monitoring unit 113 that collects address and time information that causes a cache miss by monitoring the behavior of the memory controller 112 that manages the transfer is provided. As a collection method, it is possible to use various methods such as monitoring the behavior of the memory controller 112, tracing a memory bus, and analyzing a cache behavior simulation result by a simulator. Information collected during the execution of the periodic task 103 is stored in the HDD (Hard / Disk / Drive) as access trace information 114 by the memory access monitoring unit 113. The cache control apparatus 100 analyzes the access trace information 114 by the cache control analysis unit 115 to extract a cache miss occurrence timing common to each cycle, and generates access statistical information 116. The access statistical information 116 is stored in the HDD by the cache control analysis unit 115. After that, the timing correction unit 117 (an example of a cache control scenario generation unit) calculates an appropriate timing for prefetching, and the result is stored as a cache control scenario 107 in the HDD.

前述したマルチコアプロセッサは、データ処理を行う処理装置の一例である。また、前述したHDDやRAM111は、データ(情報)を記憶する記憶装置の一例である。キャッシュ制御装置100は、処理装置、記憶装置のほか、入力装置、出力装置等を具備していてもよい。これらのハードウェアはキャッシュ制御装置100の各部によって利用される。例えば、処理装置は、キャッシュ制御装置100の各部でデータの演算、加工、読み取り、書き込み等を行うために利用される。記憶装置は、そのデータを記憶するために利用される。また、入力装置は、そのデータを入力するために、出力装置は、そのデータを出力するために利用される。   The multi-core processor described above is an example of a processing device that performs data processing. The HDD and RAM 111 described above are examples of storage devices that store data (information). The cache control device 100 may include an input device, an output device, and the like in addition to the processing device and the storage device. These hardware are used by each unit of the cache control device 100. For example, the processing device is used for performing calculation, processing, reading, writing, and the like of data in each unit of the cache control device 100. The storage device is used to store the data. Further, the input device is used for inputting the data, and the output device is used for outputting the data.

図2は、キャッシュ制御装置100のハードウェア構成の一例を示す図である。   FIG. 2 is a diagram illustrating an example of a hardware configuration of the cache control device 100.

図2において、キャッシュ制御装置100は、マイクロコンピュータやパーソナルコンピュータ等のコンピュータであり、LCD121(Liquid・Crystal・Display)、キーボード122(K/B)、マウス123、FDD124(Flexible・Disk・Drive)、CDD125(Compact・Disc・Drive)、プリンタ126といったハードウェアデバイスを備えている。これらのハードウェアデバイスはケーブルや信号線で接続されている。LCD121の代わりに、CRT(Cathode・Ray・Tube)、あるいは、その他の表示装置が用いられてもよい。マウス123の代わりに、タッチパネル、タッチパッド、トラックボール、ペンタブレット、あるいは、その他のポインティングデバイスが用いられてもよい。   In FIG. 2, a cache control device 100 is a computer such as a microcomputer or a personal computer, and includes an LCD 121 (Liquid / Crystal / Display), a keyboard 122 (K / B), a mouse 123, an FDD 124 (Flexible Disk / Drive), A hardware device such as a CDD 125 (Compact Disc Drive) or a printer 126 is provided. These hardware devices are connected by cables and signal lines. Instead of the LCD 121, a CRT (Cathode / Ray / Tube) or other display device may be used. Instead of the mouse 123, a touch panel, a touch pad, a trackball, a pen tablet, or other pointing devices may be used.

キャッシュ制御装置100は、プログラムを実行するCPU131(Central・Processing・Unit)を備えている。CPU131は、処理装置の一例である。本実施の形態では、CPU131はマルチコアプロセッサである。CPU131は、バス132を介してROM133(Read・Only・Memory)、RAM111、通信ボード135、LCD121、キーボード122、マウス123、FDD124、CDD125、プリンタ126、HDD140(Hard・Disk・Drive)と接続され、これらのハードウェアデバイスを制御する。HDD140の代わりに、フラッシュメモリ、光ディスク装置、メモリカードリーダライタ又はその他の記憶媒体が用いられてもよい。   The cache control device 100 includes a CPU 131 (Central Processing Unit) that executes a program. The CPU 131 is an example of a processing device. In the present embodiment, the CPU 131 is a multi-core processor. The CPU 131 is connected to the ROM 133 (Read / Only / Memory), the RAM 111, the communication board 135, the LCD 121, the keyboard 122, the mouse 123, the FDD 124, the CDD 125, the printer 126, and the HDD 140 (Hard / Disk / Drive) via the bus 132. Control these hardware devices. Instead of the HDD 140, a flash memory, an optical disk device, a memory card reader / writer, or other storage medium may be used.

RAM111は、揮発性メモリの一例である。ROM133、FDD124、CDD125、HDD140は、不揮発性メモリの一例である。これらは、記憶装置の一例である。通信ボード135、キーボード122、マウス123、FDD124、CDD125は、入力装置の一例である。また、通信ボード135、LCD121、プリンタ126は、出力装置の一例である。   The RAM 111 is an example of a volatile memory. The ROM 133, the FDD 124, the CDD 125, and the HDD 140 are examples of nonvolatile memories. These are examples of the storage device. The communication board 135, the keyboard 122, the mouse 123, the FDD 124, and the CDD 125 are examples of input devices. The communication board 135, the LCD 121, and the printer 126 are examples of output devices.

通信ボード135は、LAN(Local・Area・Network)等に接続されている。通信ボード135は、LANに限らず、IP−VPN(Internet・Protocol・Virtual・Private・Network)、広域LAN、ATM(Asynchronous・Transfer・Mode)ネットワークといったWAN(Wide・Area・Network)、あるいは、インターネットに接続されていても構わない。LAN、WAN、インターネットは、ネットワークの一例である。   The communication board 135 is connected to a LAN (Local / Area / Network) or the like. The communication board 135 is not limited to a LAN, but includes an IP-VPN (Internet, Protocol, Private, Network), a wide area LAN, an ATM (Asynchronous / Transfer / Mode) network, a WAN (Wide / Area / Network), or the Internet. It does not matter if it is connected to. LAN, WAN, and the Internet are examples of networks.

HDD140には、OS104、プログラム群143、ファイル群144が記憶されている。プログラム群143のプログラムは、CPU131、OS104により実行される。プログラム群143には、本実施の形態の説明において「〜部」として説明する機能を実行するプログラムが含まれている。プログラムは、CPU131により読み出され実行される。ファイル群144には、本実施の形態の説明において、「〜データ」、「〜情報」、「〜ID(識別子)」、「〜フラグ」、「〜結果」として説明するデータや情報や信号値や変数値やパラメータが、「〜ファイル」や「〜データベース」や「〜テーブル」の各項目として含まれている。「〜ファイル」や「〜データベース」や「〜テーブル」は、RAM111やHDD140等の記憶媒体に記憶される。RAM111やHDD140等の記憶媒体に記憶されたデータや情報や信号値や変数値やパラメータは、読み書き回路を介してCPU131によりメインメモリやキャッシュメモリに読み出され、抽出、検索、参照、比較、演算、計算、制御、出力、印刷、表示といったCPU131の処理(動作)に用いられる。抽出、検索、参照、比較、演算、計算、制御、出力、印刷、表示といったCPU131の処理中、データや情報や信号値や変数値やパラメータは、メインメモリやキャッシュメモリやバッファメモリに一時的に記憶される。   The HDD 140 stores an OS 104, a program group 143, and a file group 144. The programs in the program group 143 are executed by the CPU 131 and the OS 104. The program group 143 includes programs that execute the functions described as “˜units” in the description of the present embodiment. The program is read and executed by the CPU 131. The file group 144 includes data, information, and signal values described as “˜data”, “˜information”, “˜ID (identifier)”, “˜flag”, and “˜result” in the description of the present embodiment. And variable values and parameters are included as items of “˜file”, “˜database”, and “˜table”. The “˜file”, “˜database”, and “˜table” are stored in a storage medium such as the RAM 111 and the HDD 140. Data, information, signal values, variable values, and parameters stored in a storage medium such as the RAM 111 and the HDD 140 are read out to the main memory and the cache memory by the CPU 131 via a read / write circuit, and extracted, searched, referenced, compared, and calculated. It is used for processing (operation) of the CPU 131 such as calculation, control, output, printing, and display. During processing of the CPU 131 such as extraction, search, reference, comparison, calculation, calculation, control, output, printing, and display, data, information, signal values, variable values, and parameters are temporarily stored in the main memory, cache memory, and buffer memory. Remembered.

本実施の形態の説明において用いるブロック図やフローチャートの矢印の部分は主としてデータや信号の入出力を示す。データや信号は、RAM111等のメモリ、FDD124のフレキシブルディスク(FD)、CDD125のコンパクトディスク(CD)、HDD140の磁気ディスク、光ディスク、DVD(Digital・Versatile・Disc)、あるいは、その他の記録媒体に記録される。また、データや信号は、バス132、信号線、ケーブル、あるいは、その他の伝送媒体により伝送される。   The arrows in the block diagrams and flowcharts used in the description of this embodiment mainly indicate input / output of data and signals. Data and signals are recorded in a memory such as the RAM 111, a flexible disk (FD) of the FDD 124, a compact disk (CD) of the CDD 125, a magnetic disk of the HDD 140, an optical disk, a DVD (Digital Versatile Disc), or other recording media. Is done. Data and signals are transmitted by the bus 132, signal lines, cables, or other transmission media.

本実施の形態の説明において「〜部」として説明するものは、「〜回路」、「〜装置」、「〜機器」であってもよく、また、「〜ステップ」、「〜工程」、「〜手順」、「〜処理」であってもよい。即ち、「〜部」として説明するものは、ROM133に記憶されたファームウェアで実現されていても構わない。あるいは、「〜部」として説明するものは、ソフトウェアのみ、あるいは、素子、デバイス、基板、配線といったハードウェアのみで実現されていても構わない。あるいは、「〜部」として説明するものは、ソフトウェアとハードウェアとの組み合わせ、あるいは、ソフトウェアとハードウェアとファームウェアとの組み合わせで実現されていても構わない。ファームウェアとソフトウェアは、プログラムとして、フレキシブルディスク、コンパクトディスク、磁気ディスク、光ディスク、DVD等の記録媒体に記憶される。プログラムはCPU131により読み出され、CPU131により実行される。即ち、プログラムは、本実施の形態の説明で述べる「〜部」としてコンピュータを機能させるものである。あるいは、プログラムは、本実施の形態の説明で述べる「〜部」の手順や方法をコンピュータに実行させるものである。   In the description of the present embodiment, what is described as “to part” may be “to circuit”, “to device”, “to device”, and “to step”, “to process”, “to”. ~ Procedure "," ~ process ". That is, what is described as “˜unit” may be realized by firmware stored in the ROM 133. Alternatively, what is described as “˜unit” may be realized only by software, or only by hardware such as an element, a device, a board, and wiring. Alternatively, what is described as “to part” may be realized by a combination of software and hardware, or a combination of software, hardware and firmware. Firmware and software are stored as programs in a recording medium such as a flexible disk, a compact disk, a magnetic disk, an optical disk, and a DVD. The program is read by the CPU 131 and executed by the CPU 131. That is, the program causes the computer to function as “to part” described in the description of the present embodiment. Or a program makes a computer perform the procedure and method of "-part" described by description of this Embodiment.

次に動作について説明する。   Next, the operation will be described.

本実施の形態は、キャッシュ制御シナリオ107を生成するフェーズと、キャッシュ制御シナリオ107を実行するフェーズにより実現される。   The present embodiment is realized by a phase for generating the cache control scenario 107 and a phase for executing the cache control scenario 107.

まず、キャッシュ制御シナリオ107を生成するフェーズについて説明する。   First, a phase for generating the cache control scenario 107 will be described.

このフェーズでは、サブコア102は停止させ、メインコア101側のみ通常の周期処理を実行する。このとき、キャッシュミスが発生すれば、必要なデータをRAM111から共有キャッシュ110にロードするよう、メモリコントローラ112に指示されるが、メモリアクセス監視部113は、これをトレースして指示を読み取り、周期処理の周期の開始時点を0とした時刻(タイミング)と、キャッシュミスを引き起こすきっかけとなった対象アドレスの組を、アクセストレース情報114として記憶装置に記憶する。   In this phase, the sub-core 102 is stopped and normal cycle processing is executed only on the main core 101 side. At this time, if a cache miss occurs, the memory controller 112 is instructed to load necessary data from the RAM 111 to the shared cache 110. The memory access monitoring unit 113 traces this and reads the instruction, A set of a time (timing) in which the start point of the processing cycle is set to 0 and a target address that causes a cache miss is stored as access trace information 114 in the storage device.

図3は、アクセストレース情報114の一例を示すテーブルである。   FIG. 3 is a table showing an example of the access trace information 114.

アクセストレース情報114は、周期処理の複数周期にて発生したキャッシュミスごとに、キャッシュミスが発生したタイミング(周期開始時点からの経過時間)とアドレスとを示す情報である。図3の例では、キャッシュミスが発生したタイミングは「時刻(ミリ秒)」カラム(列)に、キャッシュミスが発生したアドレスは「ミス発生箇所」カラムに記録されている。図3のアクセストレース情報114では、例えば、ある周期にて20380ナノ秒のタイミングで、0x00800010のアドレスに対するキャッシュミスが発生したことが記録されている。また、ある周期にて856222ナノ秒、1019983ナノ秒、3019983ナノ秒の少なくとも3つのタイミングで、0x00800100のアドレスに対するキャッシュミスが発生したことが記録されている。   The access trace information 114 is information indicating the timing (elapsed time from the cycle start time) and the address at which a cache miss occurs for each cache miss that occurs in a plurality of cycles of the periodic processing. In the example of FIG. 3, the timing at which a cache miss has occurred is recorded in the “time (millisecond)” column (row), and the address at which the cache miss has occurred is recorded in the “miss occurrence location” column. In the access trace information 114 of FIG. 3, for example, it is recorded that a cache miss for the address 0x00800010 occurs at a timing of 20380 nanoseconds in a certain cycle. In addition, it is recorded that a cache miss with respect to the address 0x00800100 occurred at at least three timings of 856222 nanoseconds, 1019983 nanoseconds, and 3019983 nanoseconds in a certain cycle.

図4は、キャッシュ制御解析部115において、プリフェッチの対象とするキャッシュミスを抽出する方法を示す図である。   FIG. 4 is a diagram illustrating a method of extracting a cache miss to be prefetched by the cache control analysis unit 115.

まず、キャッシュ制御解析部115は、周期処理の周期時間を基に、アクセストレース情報114の内容を周期単位に分割する。図4において、横軸は、周期1〜周期N(NはN>1となる整数)の各周期開始時点からの経過時間(タイミング)を示しており、下方向の矢印はその時間にキャッシュミスが発生したアドレスを示している。キャッシュ制御解析部115は、ある時間範囲(例えば、10マイクロ秒の範囲)を集計区間と定義し、集計区間の開始時点をS(NはS>0となる実数)マイクロ秒ずつ(例えば、1マイクロ秒ずつ)ずらしながら、集計区間に含まれるキャッシュミスアドレスをカウントする。このとき、閾値(例えば、N÷5回)以上の周期にてアドレスが出現する区間が1回以上続いた場合、キャッシュ制御解析部115は、そのアドレスをプリフェッチ対象に決める。また、キャッシュ制御解析部115は、対象アドレスについて、閾値以上の周期にて連続して出現する集計区間内における出現回数、平均経過時間、及び、経過時間の標準偏差を計算し、アクセス統計情報116として記録する。なお、集計区間や閾値の値は、チューニングによって適宜調整される。   First, the cache control analysis unit 115 divides the contents of the access trace information 114 into cycle units based on the cycle time of the cycle process. In FIG. 4, the horizontal axis indicates the elapsed time (timing) from the start of each cycle of cycle 1 to cycle N (N is an integer satisfying N> 1), and a downward arrow indicates a cache miss at that time. Indicates the address where. The cache control analysis unit 115 defines a certain time range (for example, a range of 10 microseconds) as a totaling interval, and sets the start time of the totaling interval by S (N is a real number satisfying S> 0) by microseconds (for example, 1 Counting the cache miss addresses included in the counting interval while shifting (by microseconds). At this time, if a section in which an address appears in a cycle equal to or greater than a threshold (for example, N ÷ 5 times) continues one or more times, the cache control analysis unit 115 determines the address as a prefetch target. In addition, the cache control analysis unit 115 calculates the number of appearances, the average elapsed time, and the standard deviation of the elapsed time in the aggregation section that appears continuously in a cycle equal to or greater than the threshold for the target address, and the access statistical information 116 Record as. Note that the values of the totaling section and the threshold are adjusted as appropriate by tuning.

例えば、N=10とし、あるアドレスA1に関して、周期1の11マイクロ秒、周期2の12マイクロ秒、周期3の13マイクロ秒のタイミングでキャッシュミスが発生しており、それ以外のタイミングでは、いずれの周期においてもキャッシュミスが発生していなかったとする。集計区間の長さが10マイクロ秒、S=1とした場合、アドレスA1の出現回数(キャッシュミスが発生した周期の数)は、0マイクロ秒を始点とする集計区間R0では0回、1マイクロ秒を始点とする集計区間R1では1回、2マイクロ秒を始点とする集計区間R2では2回、3マイクロ秒を始点とする集計区間R3では3回である。アドレスA1の出現回数は、その次の4マイクロ秒を始点とする集計区間R4から11マイクロ秒を始点とする集計区間R11までは3回のままであるが、12マイクロ秒を始点とする集計区間R12では2回、13マイクロ秒を始点とする集計区間R13では1回、14マイクロ秒を始点とする集計区間R14では0回となる。閾値をN÷5回とすると、閾値以上の周期にてアドレスA1が出現している集計区間はR2〜R12である。そこで、キャッシュ制御解析部115は、例えば、集計区間R2〜R12のうち、アドレスA1の出現回数が最大となる集計区間R3について、タイミングの平均等を計算する。この例では、タイミングの平均は、(11マイクロ秒+12マイクロ秒+13マイクロ秒)÷3=12マイクロ秒となる。   For example, when N = 10 and a certain address A1, a cache miss occurs at a timing of 11 microseconds in cycle 1, 12 microseconds in cycle 2, and 13 microseconds in cycle 3, and at other timings, It is assumed that no cache miss has occurred in the period. When the length of the total section is 10 microseconds and S = 1, the number of appearances of the address A1 (the number of cycles in which a cache miss has occurred) is 0 times and 1 microsecond in the total section R0 starting from 0 microseconds. It is once in the total section R1 starting from the second, twice in the total section R2 starting from 2 microseconds, and three times in the total section R3 starting from 3 microseconds. The number of appearances of the address A1 remains three times from the total section R4 starting from the next 4 microseconds to the total section R11 starting from 11 microseconds, but the total section starting from 12 microseconds It is twice in R12, once in the total section R13 starting from 13 microseconds, and zero in the total section R14 starting from 14 microseconds. When the threshold value is N ÷ 5 times, the total sections in which the address A1 appears in a cycle equal to or greater than the threshold value are R2 to R12. Therefore, for example, the cache control analysis unit 115 calculates the average of the timing or the like for the aggregation section R3 in which the number of appearances of the address A1 is the maximum among the aggregation sections R2 to R12. In this example, the average timing is (11 microseconds + 12 microseconds + 13 microseconds) ÷ 3 = 12 microseconds.

図5は、アクセス統計情報116の一例を示すテーブルである。   FIG. 5 is a table showing an example of the access statistical information 116.

アクセス統計情報116は、キャッシュミス集合ごとに、キャッシュミスが発生したタイミングの平均及び標準偏差とアドレスとを示す情報である。図3の例では、キャッシュミスが発生したタイミングの平均は「平均経過時間」カラムに、キャッシュミスが発生したタイミングの標準偏差は「標準偏差」カラムに、キャッシュミスが発生したアドレスは「ミス発生箇所」カラムに記録されている。また、当該アドレスの出現回数が「回数」カラムに記録されている。さらに、アクセス統計情報116は、「平均経過時間」カラムの値の昇順にソートされており、レコード(行)ごとに「番号」がふられている。図5のアクセス統計情報116では、例えば、あるキャッシュミス集合において、キャッシュミスが発生したアドレスが0x00800010であり、そのアドレスが同じ集計区間内で892回出現し、そのアドレスの当該集計区間における出現タイミングの平均及び標準偏差がそれぞれ20032ナノ秒及び270であることが記録されている。   The access statistical information 116 is information indicating the average and standard deviation of the timing at which a cache miss occurs and an address for each cache miss set. In the example of FIG. 3, the average of the timing at which a cache miss occurred is in the “average elapsed time” column, the standard deviation of the timing at which the cache miss occurred is in the “standard deviation” column, and the address at which the cache miss has occurred is “miss occurrence” Recorded in the "Location" column. The number of appearances of the address is recorded in the “number of times” column. Further, the access statistical information 116 is sorted in ascending order of the value in the “average elapsed time” column, and a “number” is assigned to each record (row). In the access statistical information 116 of FIG. 5, for example, in a certain cache miss set, the address where a cache miss has occurred is 0x00800010, the address appears 892 times within the same aggregation section, and the appearance timing of the address in the aggregation section The average and standard deviation are recorded as 20032 nanoseconds and 270, respectively.

上記のように、キャッシュ制御解析部115は、記憶装置に記憶されたアクセストレース情報114から、周期処理の複数周期(周期1〜周期N)のうち、所定数(例えば、N÷5)以上の周期にて所定範囲(例えば、10マイクロ秒の集計区間)内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として処理装置により抽出する。キャッシュ制御解析部115は、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量を処理装置により計算する。キャッシュ制御解析部115は、キャッシュミス集合ごとに、計算したタイミングの平均及び標準偏差(統計量の一例)と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報116を処理装置により生成して記憶装置に記憶する。   As described above, the cache control analysis unit 115 calculates a predetermined number (for example, N ÷ 5) or more from a plurality of cycles (cycle 1 to cycle N) of the cycle processing from the access trace information 114 stored in the storage device. A cache miss that occurs at the same address due to a timing difference within a predetermined range (for example, a 10 microsecond counting section) in a cycle is extracted as a cache miss set by the processing device. The cache control analysis unit 115 calculates, for each extracted cache miss set, a statistical amount of the timing at which a cache miss has occurred by the processing device. For each cache miss set, the cache control analysis unit 115 generates and stores access statistical information 116 indicating the average and standard deviation of the calculated timing (an example of a statistic) and the address where the cache miss occurs, by the processing device. Store in the device.

タイミング補正部117では、アクセス統計情報116を基に、プリフェッチを行う適切なタイミングを決定する。タイミング補正部117は、パラメータとして、メモリアクセス遅延時間と、キャッシュ制御処理遅延時間をもつ。なお、記憶装置には、メモリアクセス遅延時間とキャッシュ制御処理遅延時間とを示す遅延時間情報が予め記憶されているものとする。メモリアクセス遅延時間は、キャッシュミスが発生した際に、メモリコントローラ112によって必要なデータがRAM111から共有キャッシュ110にロードされるまでに要する時間(キャッシュミスが発生した場合にRAM111にアクセスするための時間)であり、RAM111やターゲットの仕様によって決まるものである。また、キャッシュ制御処理遅延時間は、サブコア102側で1回のプリフェッチ処理に関わる一連の処理に要する最大時間(プリフェッチ処理のための時間)である。ここで、アクセス統計情報116を用いると、[i](iはi>1となる整数)回目のキャッシュミスに対するプリフェッチ時間は、『平均経過時間−(標準偏差×範囲補正値)−((i−1)×メモリアクセス遅延時間)−キャッシュ制御処理遅延時間』で求められる。ここで、『(i−1)×メモリアクセス遅延時間』を減算しているのは、キャッシュ制御シナリオ107を実行すると、[1]回目〜[i−1]回目のプリフェッチにより[i−1]回のキャッシュミスが発生しなくなるからである。なお、範囲補正値は、タイミングのずれが正規分布のとき許容するばらつき範囲を指示するもので、チューニングによって適宜調整される。   The timing correction unit 117 determines an appropriate timing for prefetching based on the access statistical information 116. The timing correction unit 117 has memory access delay time and cache control processing delay time as parameters. It is assumed that the storage device stores delay time information indicating the memory access delay time and the cache control processing delay time in advance. The memory access delay time is the time required for data required by the memory controller 112 to be loaded from the RAM 111 to the shared cache 110 when a cache miss occurs (the time for accessing the RAM 111 when a cache miss occurs) ) And is determined by the specifications of the RAM 111 and the target. The cache control processing delay time is the maximum time (time for prefetch processing) required for a series of processing related to one prefetch processing on the sub-core 102 side. Here, when the access statistical information 116 is used, the prefetch time for the first cache miss [i] (i is an integer satisfying i> 1) is “average elapsed time− (standard deviation × range correction value) − ((i −1) × memory access delay time) −cache control processing delay time ”. Here, “(i−1) × memory access delay time” is subtracted when the cache control scenario 107 is executed, [i−1] through [1] to [i−1] prefetches. This is because the number of cache misses does not occur. The range correction value indicates a variation range allowed when the timing deviation is a normal distribution, and is appropriately adjusted by tuning.

もし、[i]回目のプリフェッチ時間が、『[i−1]回目のプリフェッチ時間+キャッシュ制御処理遅延時間』よりも早くなってしまう場合、タイミング補正部117は、『キャッシュ制御処理遅延時間−([i]回目のプリフェッチ時間−[i−1]回目のプリフェッチ時間)』だけ[i−1]回目のプリフェッチ時間を早める。メモリアクセス遅延時間を150ナノ秒、キャッシュ制御処理遅延時間を300ナノ秒、範囲補正値を2とした場合、図5の例では、2回目のプリフェッチ時間が、76554ナノ秒−(391×2)−(1×150ナノ秒)−300ナノ秒=75322ナノ秒、3回目のプリフェッチ時間が、76818ナノ秒−(350×2)−(1×150ナノ秒)−300ナノ秒=75518ナノ秒と求められ、その差が196ナノ秒でキャッシュ制御処理遅延時間を下回るため、2回目のプリフェッチ時間は104ナノ秒前倒しにした75218ナノ秒に補正する。   If the [i] -th prefetch time is earlier than “[i−1] -th prefetch time + cache control processing delay time”, the timing correction unit 117 sets “cache control processing delay time− ( [I-1] th prefetch time- [i-1] th prefetch time) ". When the memory access delay time is 150 nanoseconds, the cache control processing delay time is 300 nanoseconds, and the range correction value is 2, in the example of FIG. 5, the second prefetch time is 76554 nanoseconds− (391 × 2) -(1 x 150 nanoseconds)-300 nanoseconds = 75322 nanoseconds The third prefetch time is 76818 nanoseconds-(350 x 2)-(1 x 150 nanoseconds)-300 nanoseconds = 75518 nanoseconds Since the obtained difference is less than the cache control processing delay time at 196 nanoseconds, the second prefetch time is corrected to 75218 nanoseconds that is 104 nanoseconds ahead.

タイミング補正部117は、最終的に求められたプリフェッチ時間を、周期処理開始からの経過時間を測定するために用いるクロックカウンタ108の単位に変換し、キャッシュ制御シナリオ107を生成する。   The timing correction unit 117 converts the finally obtained prefetch time into a unit of the clock counter 108 used for measuring the elapsed time from the start of the periodic processing, and generates the cache control scenario 107.

図6は、クロックカウンタ108の周波数を100MHzとした場合のキャッシュ制御シナリオ107の一例を示すテーブルである。   FIG. 6 is a table showing an example of the cache control scenario 107 when the frequency of the clock counter 108 is 100 MHz.

キャッシュ制御シナリオ107は、キャッシュミス集合ごとに、プリフェッチ処理を実行するタイミングとアドレスとを示す情報である。図6の例では、プリフェッチ処理を実行するタイミングは「プリフェッチタイミング」カラムに、プリフェッチ処理を実行するアドレスは「プリフェッチ箇所」カラムに記録されている。「番号」はプリフェッチ処理が行われる順番を表している。図6のキャッシュ制御シナリオ107では、例えば、クロックカウンタ108が752180(75218ナノ秒に相当)をカウントしたタイミングで、0x00800EC0のアドレスを対象にプリフェッチ処理を実行することが示されている。   The cache control scenario 107 is information indicating the timing and address for executing prefetch processing for each cache miss set. In the example of FIG. 6, the timing for executing the prefetch processing is recorded in the “prefetch timing” column, and the address for executing the prefetch processing is recorded in the “prefetch location” column. “Number” represents the order in which prefetch processing is performed. In the cache control scenario 107 of FIG. 6, for example, it is indicated that the prefetch process is executed for the address 0x00800EC0 at the timing when the clock counter 108 counts 752180 (corresponding to 75218 nanoseconds).

上記のように、タイミング補正部117は、キャッシュ制御解析部115により抽出されたキャッシュミス集合ごとに、キャッシュ制御解析部115により生成されたアクセス統計情報116で示されるタイミングの平均及び標準偏差と記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間及びメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを処理装置により設定する。このとき、タイミング補正部117は、キャッシュ制御解析部115により生成されたアクセス統計情報116で、i番目にプリフェッチ処理を実行するアドレスとともに示されるタイミングの平均及び標準偏差と、記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間と、記憶装置に記憶された遅延時間情報で示されるメモリアクセス遅延時間をi−1倍した時間とから、i番目にプリフェッチ処理を実行するタイミングを設定する。また、タイミング補正部117は、i番目にプリフェッチ処理を実行するタイミングとi−1番目にプリフェッチ処理を実行するタイミングとの差がキャッシュ制御処理遅延時間以上になるようにタイミングを設定する(補正する)。そして、タイミング補正部117は、設定したタイミングとキャッシュ制御解析部115により生成されたアクセス統計情報116で示されるアドレスとを示すキャッシュ制御シナリオ107を処理装置により生成する。   As described above, the timing correction unit 117 stores the average and standard deviation of the timing indicated by the access statistical information 116 generated by the cache control analysis unit 115 for each cache miss set extracted by the cache control analysis unit 115 and the memory. The timing for executing the prefetch processing is set by the processing device from the cache control processing delay time and the memory access delay time indicated by the delay time information stored in the device. At this time, the timing correction unit 117 stores the average and standard deviation of the timing indicated by the access statistical information 116 generated by the cache control analysis unit 115 together with the address for executing the i-th prefetch process, and the storage device. The i-th prefetch processing timing is set from the cache control processing delay time indicated by the delay time information and the memory access delay time indicated by i-1 times the delay time information stored in the storage device. To do. In addition, the timing correction unit 117 sets (corrects) the timing so that the difference between the i-th prefetch processing timing and the (i−1) -th prefetch processing timing is equal to or longer than the cache control processing delay time. ). Then, the timing correction unit 117 generates a cache control scenario 107 indicating the set timing and the address indicated by the access statistical information 116 generated by the cache control analysis unit 115 by the processing device.

具体的には、タイミング補正部117は、キャッシュ制御解析部115により抽出されたキャッシュミス集合ごとに、キャッシュ制御解析部115により生成されたアクセス統計情報116でアドレスA[i]とともに示されるタイミングの平均M[i]及び標準偏差V[i]と、所定の補正値Cと、キャッシュ制御処理遅延時間Dと、メモリアクセス遅延時間Eとから、i番目にプリフェッチ処理を実行するタイミングP[i]を、P[i]=M[i]−(V[i]×C)−((i−1)×E)−Dに設定する。このとき、タイミング補正部117は、タイミングP[i]とi−1番目にプリフェッチ処理を実行するタイミングP[i−1]との差がキャッシュ制御処理遅延時間D以上でない場合、タイミングP[i−1]をキャッシュ制御処理遅延時間D−(タイミングP[i]−タイミングP[i−1])早いタイミングに処理装置により補正する。   Specifically, for each cache miss set extracted by the cache control analysis unit 115, the timing correction unit 117 determines the timing indicated with the address A [i] in the access statistical information 116 generated by the cache control analysis unit 115. The timing P [i] at which the i-th prefetch process is executed from the average M [i] and standard deviation V [i], the predetermined correction value C, the cache control processing delay time D, and the memory access delay time E Is set to P [i] = M [i] − (V [i] × C) − ((i−1) × E) −D. At this time, if the difference between the timing P [i] and the timing P [i−1] at which the i−1th prefetch processing is executed is not equal to or greater than the cache control processing delay time D, the timing correction unit 117 performs the timing P [i]. -1] is corrected by the processing device at a timing earlier than the cache control processing delay time D- (timing P [i] -timing P [i-1]).

なお、タイミング補正部117は、アクセス統計情報116で示されるタイミングの平均のみに基づいて、プリフェッチ処理を実行するタイミングを設定してもよい。この場合、具体的には、タイミング補正部117は、タイミングP[i]を、P[i]=M[i]−((i−1)×E)−Dに設定する。また、タイミング補正部117は、アクセス統計情報116で示されるタイミングの他の統計量(例えば、最小値、中間値、最大値)に基づいて、プリフェッチ処理を実行するタイミングを設定してもよい。   Note that the timing correction unit 117 may set the timing for executing the prefetch process based only on the average of the timings indicated by the access statistical information 116. In this case, specifically, the timing correction unit 117 sets the timing P [i] to P [i] = M [i] − ((i−1) × E) −D. Further, the timing correction unit 117 may set the timing for executing the prefetch process based on other statistics (for example, the minimum value, the intermediate value, and the maximum value) of the timing indicated by the access statistical information 116.

次に、キャッシュ制御シナリオ107を実行するフェーズについて説明する。   Next, a phase for executing the cache control scenario 107 will be described.

図7は、キャッシュ制御部109の動作を示すフローチャートである。   FIG. 7 is a flowchart showing the operation of the cache control unit 109.

キャッシュ制御部109は、サブコア102で実行が開始されると、メインコア101側の同期部106からの周期タスク103の実行開始通知がコア間共有メモリに書き込まれるまでポーリングすることによって待機する(ステップS101)。キャッシュ制御部109は、実行開始通知を検出すると、クロックカウンタ108に対しカウンタ値をリセットし、再度0からカウントアップするようにする(ステップS102)。次に、キャッシュ制御部109は、キャッシュ制御シナリオ107の先頭から1エントリ分を読み出し、プリフェッチタイミングの値を内部レジスタに保持しておく(ステップS103)。その後、キャッシュ制御部109は、クロックカウンタ108からカウンタ値を読み出し(ステップS104)、保持されたプリフェッチタイミングの値と比較を行う(ステップS105)。キャッシュ制御部109は、プリフェッチタイミングの値よりもカウンタ値が小さい間は、同期部106から非同期処理の開始通知がないか共有メモリを調べ(ステップS106)、なければ再度カウンタ値を読み出した後比較する処理(ステップS104及びS105)を繰り返す。もし、非同期処理の開始通知があれば、キャッシュ制御部109は、カウンタを一時停止した後(ステップS107)、非同期処理の終了を待ち(ステップS108)、通知を受けた後に停止していたカウンタを再開し(ステップS109)、カウンタ読み出し処理(ステップS104)まで戻る。   When the execution of the sub-core 102 is started, the cache control unit 109 waits by polling until the execution start notification of the periodic task 103 from the synchronization unit 106 on the main core 101 side is written in the inter-core shared memory (Step S110). S101). When the cache control unit 109 detects the execution start notification, the cache control unit 109 resets the counter value to the clock counter 108 and starts counting up again from 0 (step S102). Next, the cache control unit 109 reads one entry from the beginning of the cache control scenario 107, and holds the prefetch timing value in the internal register (step S103). After that, the cache control unit 109 reads the counter value from the clock counter 108 (step S104), and compares it with the held prefetch timing value (step S105). While the counter value is smaller than the prefetch timing value, the cache control unit 109 checks the shared memory for an asynchronous process start notification from the synchronization unit 106 (step S106), and if not, compares the counter value after reading the counter value again. This process (steps S104 and S105) is repeated. If there is an asynchronous process start notification, the cache control unit 109 suspends the counter (step S107), waits for the asynchronous process to end (step S108), and displays the counter stopped after receiving the notification. The process is resumed (step S109), and the process returns to the counter reading process (step S104).

キャッシュ制御部109は、クロックカウンタ108から読み出したカウンタ値がプリフェッチタイミングを超えた場合、プリフェッチ処理として、プリフェッチ箇所で指定されたアドレスのデータを読み出す(ステップS110)。その結果、共有キャッシュ110上にそのデータが存在していなければ、メモリコントローラ112によってRAM111から共有キャッシュ110にデータがロードされることになる。キャッシュ制御部109は、プリフェッチ処理を行った後は、先ほど処理したエントリがキャッシュ制御シナリオ107の最後のエントリかどうかを判定し(ステップS111)、最後でなければ次のエントリを読み出すところから処理(ステップS103以降)を繰り返す。キャッシュ制御部109は、全てのエントリを処理したのであれば、周期タスク103の実行開始通知待ち(ステップS101)の前まで戻り、次の周期開始に備える。なお、タイミング補正部117がパラメータとして使用するキャッシュ制御処理遅延時間は、プリフェッチタイミングとカウンタ値の比較が成立してからプリフェッチを行った後、次のエントリを読み出して再度カウンタ値を比較するループに戻るまでの一連の処理にかかる時間として求められる。   When the counter value read from the clock counter 108 exceeds the prefetch timing, the cache control unit 109 reads the data at the address specified at the prefetch location as the prefetch process (step S110). As a result, if the data does not exist on the shared cache 110, the data is loaded from the RAM 111 to the shared cache 110 by the memory controller 112. After performing the prefetch process, the cache control unit 109 determines whether or not the previously processed entry is the last entry of the cache control scenario 107 (step S111). Step S103 and subsequent steps are repeated. If all entries have been processed, the cache control unit 109 returns to before the execution start notification waiting for the periodic task 103 (step S101) and prepares for the start of the next period. The cache control processing delay time used as a parameter by the timing correction unit 117 is a loop in which the prefetch is performed after the prefetch timing and the counter value are compared, and then the next entry is read and the counter value is compared again. It is calculated as the time required for a series of processing until returning.

上記のように、キャッシュ制御部109は、タイミング補正部117により生成されたキャッシュ制御シナリオ107で示されるタイミングで、当該キャッシュ制御シナリオ107で示されるアドレスに対してプリフェッチ処理を処理装置により実行する。   As described above, the cache control unit 109 performs prefetch processing on the address indicated by the cache control scenario 107 by the processing device at the timing indicated by the cache control scenario 107 generated by the timing correction unit 117.

以下、本実施の形態が奏する効果について説明する。   Hereinafter, the effect which this embodiment has will be described.

メモリキャッシュのプリフェッチは、タイミングが遅れれば意味がなく、また早すぎれば正常なキャッシュの挙動を乱すおそれがあるため、これらの特性を考慮することが重要である。本実施の形態によれば、タイミング補正部117において、統計的に求められたタイミングに対し、性能向上を考慮したタイミング補正が行われることにより、メインコア101側の周期処理に遅れることなく適切なタイミングでプリフェッチが行われるため、メインコア101側では共有キャッシュ110に対するキャッシュミスの発生が抑えられることになり、周期処理の実行性能を向上させることができる。   Prefetching a memory cache is meaningless if the timing is delayed, and if it is too early, there is a risk of disturbing normal cache behavior, so it is important to consider these characteristics. According to the present embodiment, the timing correction unit 117 performs the timing correction considering the performance improvement with respect to the statistically obtained timing, so that the timing correction unit 117 is appropriate without delaying the periodic processing on the main core 101 side. Since prefetching is performed at the timing, occurrence of a cache miss with respect to the shared cache 110 is suppressed on the main core 101 side, and the execution performance of the periodic processing can be improved.

以上説明したように、本実施の形態では、キャッシュ制御装置100は、周期処理において、周期開始時点からの経過時間とともに、キャッシュミスを引き起こしたアドレスを記録したアクセストレース情報114を収集する。そして、キャッシュ制御装置100は、アクセストレース情報114から、毎周期に共通な又は頻度が高いキャッシュミスアドレスを抽出したアクセス統計情報116を生成し、これを解消するために適切なプリフェッチタイミングを決定し、キャッシュ制御シナリオ107を生成する。このとき、キャッシュ制御装置100は、プリフェッチによりキャッシュミスからキャッシュヒットに変わることによる性能向上に対する補正を、以降のプリフェッチタイミングに対し順次適用することにより、プリフェッチタイミングの精度を高める。   As described above, in the present embodiment, the cache control device 100 collects the access trace information 114 in which the address causing the cache miss is recorded along with the elapsed time from the cycle start time in the periodic processing. Then, the cache control device 100 generates access statistical information 116 obtained by extracting a cache miss address that is common or frequently used in each cycle from the access trace information 114, and determines an appropriate prefetch timing to solve this. A cache control scenario 107 is generated. At this time, the cache control apparatus 100 increases the accuracy of the prefetch timing by sequentially applying the correction for the performance improvement due to the change from the cache miss to the cache hit due to the prefetch to the subsequent prefetch timing.

また、本実施の形態では、キャッシュ制御装置100は、周期処理の実行と並行して、周期処理に対応するキャッシュ制御シナリオ107を用いて、周期開始時点を起点とした所定のタイミングで指定されたアドレスをプリフェッチすることにより、周期処理からアクセスされるデータを前もってキャッシュ上にロードする、キャッシュ制御部109を備える。キャッシュ制御部109は、周期処理を実行するタスク又はOS104に組み込まれた同期部106から、周期処理の開始を通知されることによりキャッシュ制御シナリオ107の実行を開始することで、毎周期適切なタイミングでプリフェッチを行う。   In the present embodiment, the cache control device 100 is specified at a predetermined timing starting from the cycle start time using the cache control scenario 107 corresponding to the cycle processing in parallel with the execution of the cycle processing. A cache control unit 109 is provided, which preloads addresses to load data to be accessed from periodic processing onto the cache in advance. The cache control unit 109 starts execution of the cache control scenario 107 when notified of the start of the periodic processing from the task that executes the periodic processing or the synchronization unit 106 incorporated in the OS 104, so that an appropriate timing can be set for each cycle. Prefetch with.

また、本実施の形態では、キャッシュ制御装置100は、マルチコアプロセッサを使い、メインコア101で周期処理を実行し、サブコア102にてキャッシュ制御部109を実行して所定のタイミングで指定されたアドレスにアクセスすることにより、メインコア101の周期処理からアクセスされるデータを前もってコア間の共有キャッシュ110上にロードする。   Further, in the present embodiment, the cache control device 100 uses a multi-core processor, performs periodic processing in the main core 101, executes the cache control unit 109 in the sub-core 102, and sets the address specified at a predetermined timing. By accessing, data accessed from the periodic processing of the main core 101 is loaded on the shared cache 110 between the cores in advance.

さらに、本実施の形態では、周期処理の実行権を奪う優先度の高い非同期処理が実行された場合、同期部106によって非同期処理の開始と終了を通知する。通知を受けたキャッシュ制御部109は、非同期処理が実行されている間、キャッシュ制御シナリオ107の実行を一時停止することを特徴とする。   Furthermore, in the present embodiment, when a high-priority asynchronous process that takes away the right to execute a periodic process is executed, the synchronization unit 106 notifies the start and end of the asynchronous process. The cache control unit 109 that has received the notification is characterized by temporarily suspending the execution of the cache control scenario 107 while the asynchronous process is being executed.

以上のように、本実施の形態によれば、キャッシュのカバーする範囲を超えるような規模の大きな周期処理において、毎周期アクセスされるデータが常にキャッシュヒットとなるよう、適切なタイミングでプリフェッチを行うことが可能となる。本実施の形態では、メモリアクセスの挙動を監視して蓄積したアクセストレース情報114から、周期処理の各周期に共通するキャッシュミス発生箇所を解析したアクセス統計情報116を作り、これを基にプリフェッチタイミングを決定する際に、プリフェッチの結果キャッシュミスがキャッシュヒットに変わることによる性能向上に対するタイミングの補正を、以降のプリフェッチタイミングに対して順次適用することにより、周期中における適切なタイミングを記したキャッシュ制御シナリオ107を生成し、それを基にプリフェッチを行うことで、キャッシュミスを抑止し実行性能を向上させることができる。   As described above, according to the present embodiment, prefetching is performed at an appropriate timing so that the data accessed every cycle always becomes a cache hit in a large-scale periodic process exceeding the range covered by the cache. It becomes possible. In the present embodiment, access statistical information 116 that analyzes the cache miss occurrence location common to each cycle of the periodic processing is created from the access trace information 114 that is monitored and accumulated by monitoring the memory access behavior, and the prefetch timing is based on this. The cache control describes the appropriate timing in the cycle by sequentially applying the correction of the timing for the performance improvement due to the cache fetch to the cache hit as a result of the prefetch when determining the cache. By generating a scenario 107 and performing prefetching based on the scenario 107, it is possible to suppress cache misses and improve execution performance.

実施の形態2.
本実施の形態について、主に実施の形態1との差異を説明する。
Embodiment 2. FIG.
In the present embodiment, differences from the first embodiment will be mainly described.

本実施の形態に係るキャッシュ制御装置100の構成は、図1に示した実施の形態1のものと同様である。   The configuration of the cache control apparatus 100 according to the present embodiment is the same as that of the first embodiment shown in FIG.

図8は、同期イベントを定義する情報の一例を示すテーブルである。   FIG. 8 is a table showing an example of information defining a synchronization event.

この情報は、周期動作の進行状況に関連して毎回一定のタイミングで必ず発生するイベント(周期処理の周期1〜周期Nの各々にて一定タイミングで発生する少なくとも1つの同期イベント)を任意で定義したものであり、同期部106に登録されている。同期イベントしては、例えば、特定のタスク間の遷移、セマフォ操作やioctl等の特定のシステムコール、あるいは、タスクのある通過点に任意で挿入したチェックポイントトレースAPI(Application・Program・Interface)を用いることができる。図8の例では、これらの同期イベントを識別するイベントIDとともに同期イベントを発生順に並べて定義している。   This information arbitrarily defines an event (at least one synchronous event that occurs at a fixed timing in each of the periodic processing cycles 1 to N) that always occurs at a fixed timing each time in relation to the progress of the periodic operation. Registered in the synchronization unit 106. As a synchronous event, for example, a transition between specific tasks, a specific system call such as a semaphore operation or ioctl, or a checkpoint trace API (Application / Program / Interface) arbitrarily inserted at a passing point of a task is used. Can be used. In the example of FIG. 8, the synchronization events are defined in the order of occurrence together with the event IDs for identifying these synchronization events.

同期部106において、ディスパッチャ105の情報から同期イベントを検出した際の動作は、キャッシュ制御シナリオ107を生成するフェーズか、キャッシュ制御シナリオ107を実行するフェーズかに応じて異なる。   The operation when the synchronization unit 106 detects a synchronization event from the information of the dispatcher 105 differs depending on whether the cache control scenario 107 is generated or the cache control scenario 107 is executed.

まず、キャッシュ制御シナリオ107を生成するフェーズでは、同期部106は、同期イベントを検出した場合、キャッシュを無効にした特定のメモリ領域(RAM111のアドレスのうち、キャッシュの対象外とするように予め定められた同期アドレス)に、その同期イベントのイベントIDを書き込む。メモリアクセス監視部113では、周期処理の開始時点を0とした時刻と、キャッシュミスを引き起こすきっかけとなった対象アドレス、及び、同期イベントのイベントIDが書き込まれた同期アドレスのいずれかのアドレスと、さらに、同期アドレスであれば、そのアドレスに書き込まれたデータ(イベントID)との組を、アクセストレース情報114として記録しておく。   First, in the phase of generating the cache control scenario 107, when detecting the synchronization event, the synchronization unit 106 determines in advance a specific memory area in which the cache is invalidated (the address of the RAM 111 is excluded from the cache target). The event ID of the synchronization event is written to the synchronization address). In the memory access monitoring unit 113, the time when the start time of the periodic processing is set to 0, the target address that caused the cache miss, and any one of the synchronization addresses in which the event ID of the synchronization event is written, Furthermore, if it is a synchronous address, a set with the data (event ID) written in the address is recorded as the access trace information 114.

図9は、アクセストレース情報114の一例を示すテーブルである。   FIG. 9 is a table showing an example of the access trace information 114.

図9の例では、イベントIDを書き込むアドレス(同期アドレス)を0xFF000000としている。図9の例では、図3の例と同様に、キャッシュミス及び同期イベントが発生したタイミングは「時刻(ミリ秒)」カラムに、キャッシュミスが発生したアドレス及び同期アドレスは「ミス発生箇所」カラムに記録されている。さらに、同期イベントが発生した際に同期アドレスに書き込まれたイベントIDが「書き込みデータ」カラムに記録されている。図9のアクセストレース情報114では、図3に示した実施の形態1のものと同様に、例えば、ある周期にて20380ナノ秒のタイミングで、0x00800010のアドレスに対するキャッシュミスが発生したことが記録されている。また、ある周期にて80247ナノ秒のタイミングで、0xFF000000のアドレスに0x00000001のイベントIDが書き込まれたことが記録されている。即ち、ある周期にて80247ナノ秒のタイミングで、図8に示した、セマフォ1の獲得を行う同期イベントが発生したことが記録されている。また、ある周期にて129526ナノ秒のタイミングで、0xFF000000のアドレスに0x00000002のイベントIDが書き込まれたことが記録されている。即ち、ある周期にて129526ナノ秒のタイミングで、図8に示した、デバイス3を制御するioctlを呼び出す同期イベントが発生したことが記録されている。   In the example of FIG. 9, the address (synchronization address) for writing the event ID is set to 0xFF000000. In the example of FIG. 9, as in the example of FIG. 3, the timing when a cache miss and a synchronization event occur is in the “time (millisecond)” column, and the address and synchronization address where the cache miss occurs are in the “miss occurrence location” column. Is recorded. Furthermore, the event ID written in the synchronous address when the synchronous event occurs is recorded in the “write data” column. In the access trace information 114 shown in FIG. 9, as in the first embodiment shown in FIG. 3, for example, it is recorded that a cache miss for the address 0x00800010 occurs at a timing of 20380 nanoseconds in a certain cycle. ing. In addition, it is recorded that an event ID of 0x00000001 is written to an address of 0xFF000000 at a timing of 80247 nanoseconds in a certain cycle. That is, it is recorded that the synchronization event for acquiring the semaphore 1 shown in FIG. 8 occurs at a timing of 80247 nanoseconds in a certain cycle. In addition, it is recorded that an event ID of 0x00000002 is written to an address of 0xFF000000 at a timing of 129526 nanoseconds in a certain cycle. That is, it is recorded that a synchronous event for calling ioctl that controls the device 3 shown in FIG. 8 occurs at a timing of 129526 nanoseconds in a certain cycle.

タイミング補正部117は、実施の形態1と同様に、設定したタイミングとキャッシュ制御解析部115により生成されたアクセス統計情報116で示されるアドレスとを示すキャッシュ制御シナリオ107を処理装置により生成するとともに、同期イベントが発生する前に実行すべきプリフェッチ処理を示す同期情報を処理装置により生成する。このとき、タイミング補正部117は、プリフェッチ処理を実行するタイミングとアドレスとをキャッシュ制御シナリオ107に記録する形式と同じ形式で、同期イベントが発生するタイミングと当該タイミングで同期部106により同期アドレスに書き込まれるデータとをキャッシュ制御シナリオ107に記録する。これにより、タイミング補正部117は、同期情報をキャッシュ制御シナリオ107の一部として生成する。   Similarly to the first embodiment, the timing correction unit 117 generates a cache control scenario 107 indicating the set timing and the address indicated by the access statistical information 116 generated by the cache control analysis unit 115 by the processing device. Synchronization information indicating prefetch processing to be executed before a synchronization event occurs is generated by the processing device. At this time, the timing correction unit 117 writes the timing and address for executing the prefetch processing in the same format as that recorded in the cache control scenario 107, and the synchronization unit 106 writes the synchronization event at the synchronization address at the timing when the synchronization event occurs. Are recorded in the cache control scenario 107. Thereby, the timing correction unit 117 generates synchronization information as a part of the cache control scenario 107.

図10は、キャッシュ制御シナリオ107の一例を示すテーブルである。   FIG. 10 is a table showing an example of the cache control scenario 107.

図10の例では、プリフェッチ処理を実行するタイミング及び同期イベントが発生するタイミングは「プリフェッチタイミング/同期タイミング」カラムに、プリフェッチ処理を実行するアドレス及び同期イベントのイベントIDは「プリフェッチ箇所/チェックポイント」カラムに記録されている。「番号」はプリフェッチ処理が行われる順番及び同期イベントが発生する順番を表している。図10のキャッシュ制御シナリオ107では、実施の形態1と同様に、例えば、クロックカウンタ108が755180(75518ナノ秒に相当)をカウントしたタイミングで、0x00800EE0のアドレスを対象にプリフェッチ処理を実行することが示されている。また、例えば、クロックカウンタ108が800970(800970ナノ秒に相当)をカウントしたタイミングで、0xFF000000のアドレスに0x00000001のイベントIDが書き込まれることが示されている。即ち、クロックカウンタ108が800970(800970ナノ秒に相当)をカウントしたタイミングで、0x00000001のイベントIDに該当する同期イベントが発生することが示されている。本実施の形態では、このように同期イベントが発生するタイミングをチェックポイントとして用いる。図10の例では、4番目や10番目のエントリがチェックポイントである。なお、本実施の形態では、キャッシュ制御シナリオ107にプリフェッチとチェックポイントの2種類のエントリが含まれることになるため、これを識別する「種別」カラムも設けている。   In the example of FIG. 10, the timing for executing the prefetch process and the timing for generating the synchronization event are in the “prefetch timing / synchronization timing” column, and the address for executing the prefetch process and the event ID of the synchronization event are “prefetch location / checkpoint”. Recorded in the column. “Number” represents the order in which prefetch processing is performed and the order in which synchronization events occur. In the cache control scenario 107 in FIG. 10, as in the first embodiment, for example, when the clock counter 108 counts 755180 (corresponding to 75518 nanoseconds), the prefetch process is executed for the address 0x00800EE0. It is shown. Further, for example, it is indicated that an event ID of 0x00000001 is written to an address of 0xFF000000 at the timing when the clock counter 108 counts 800080 (corresponding to 8000000 nanoseconds). That is, it is shown that a synchronization event corresponding to an event ID of 0x00000001 occurs at the timing when the clock counter 108 counts 800080 (corresponding to 8000000 nanoseconds). In the present embodiment, the timing at which the synchronization event occurs is used as a checkpoint. In the example of FIG. 10, the fourth and tenth entries are checkpoints. In the present embodiment, since the cache control scenario 107 includes two types of entries, prefetch and checkpoint, a “type” column is also provided for identifying these.

チェックポイントの同期タイミングは、キャッシュ制御解析部115と同様の統計処理によって算出される、平均経過時間を用いる。ただし、チェックポイントを示す同期イベントは、毎周期に決まった順番で発生する必要があるため、回数の閾値は統計対象とする周期数と同じNとならなければならない。また、アクセストレース情報114には、同期イベントを取得したことによるメモリアクセスのオーバヘッドが含まれるため、[i]回目のキャッシュミスに対するプリフェッチ時間は、『平均経過時間−(標準偏差×範囲補正値)−((i−1+同期イベント出現回数)×メモリアクセス遅延時間)−キャッシュ制御処理遅延時間』となる。『同期イベント出現回数』×『メモリアクセス遅延時間』を減算しているのは、キャッシュ制御シナリオ107を実行する際には同期部106が同期アドレスにイベントIDを書き込まなくなるため、[i−1]回目のプリフェッチまでのチェックポイント数分のメモリアクセスが発生しなくなるからである。   The checkpoint synchronization timing uses an average elapsed time calculated by statistical processing similar to that of the cache control analysis unit 115. However, since synchronization events indicating checkpoints need to occur in an order determined in each cycle, the threshold of the number of times must be N, which is the same as the number of cycles targeted for statistics. Since the access trace information 114 includes the memory access overhead due to the acquisition of the synchronization event, the prefetch time for the [i] th cache miss is “average elapsed time− (standard deviation × range correction value)”. − ((I−1 + number of occurrences of synchronization event) × memory access delay time) −cache control processing delay time ”. The reason for subtracting “synchronous event occurrence count” × “memory access delay time” is that when the cache control scenario 107 is executed, the synchronization unit 106 does not write the event ID to the synchronous address, [i−1] This is because memory accesses corresponding to the number of checkpoints until the prefetch are not generated.

一方、キャッシュ制御シナリオ107を実行するフェーズでは、同期部106は、同期イベントを検出した場合、同期部106の内部で管理され同期イベントの発生に対応してカウントアップされる実行フェーズ番号を、コア間共有メモリ等を通じてサブコア102に通知する。   On the other hand, in the phase in which the cache control scenario 107 is executed, when the synchronization unit 106 detects a synchronization event, the synchronization unit 106 manages the execution phase number managed inside the synchronization unit 106 and counted up in response to the occurrence of the synchronization event. The sub-core 102 is notified through the shared memory or the like.

図11は、キャッシュ制御部109の動作を示すフローチャートである。   FIG. 11 is a flowchart showing the operation of the cache control unit 109.

図11のフローチャートを図6のフローチャートと比較すると、本実施の形態では、チェックポイントによる同期処理が追加されたことにより、フェーズ同期1(ステップS201)とフェーズ同期2(ステップS202)の処理が追加されている。   Comparing the flowchart of FIG. 11 with the flowchart of FIG. 6, in this embodiment, the process of phase synchronization 1 (step S201) and phase synchronization 2 (step S202) is added due to the addition of the checkpoint synchronization process. Has been.

図12は、フェーズ同期1の詳細を示すフローチャートである。   FIG. 12 is a flowchart showing details of the phase synchronization 1.

キャッシュ制御部109は、最初に、キャッシュ制御シナリオ107から読み出したエントリの種別を調べ、チェックポイントか、それともプリフェッチタイミングかを識別し(ステップS211)、チェックポイントであれば、キャッシュ制御部109の内部で管理しているシナリオフェーズ番号を1つ増加させる(ステップS212)。次に、キャッシュ制御部109は、コア間共有メモリを参照してメインコア101の同期部106から通知された実行フェーズ番号を取得し(ステップS213)、シナリオフェーズ番号と比較する(ステップS214)。このとき、シナリオフェーズ番号が実行フェーズ番号よりも大きければ、シナリオの実行が先行しているので、キャッシュ制御部109は、番号が一致するまでコア間共有メモリをポーリングする(ステップS213及びS214)。実行フェーズ番号がシナリオフェーズ番号以上であれば、キャッシュ制御部109は、チェックポイントのエントリに設定された同期タイミングの値をクロックカウンタ108にセットする(ステップS215)。これより、キャッシュ制御シナリオ107のチェックポイントの同期タイミングと、1つ手前のプリフェッチタイミングの間に、メインコア101の周期処理がチェックポイントに到達すれば、メインコア101の実動作とサブコア102のシナリオのタイミングが一致することになる。このように、キャッシュ制御部109は、もし、実動作が先行しているのであれば、その遅延時間をできる限り埋めるように働く。   The cache control unit 109 first checks the type of the entry read from the cache control scenario 107 to identify whether it is a checkpoint or prefetch timing (step S211). The scenario phase number managed in step 1 is incremented by one (step S212). Next, the cache control unit 109 refers to the inter-core shared memory, acquires the execution phase number notified from the synchronization unit 106 of the main core 101 (step S213), and compares it with the scenario phase number (step S214). At this time, if the scenario phase number is larger than the execution phase number, execution of the scenario has preceded, so the cache control unit 109 polls the inter-core shared memory until the numbers match (steps S213 and S214). If the execution phase number is greater than or equal to the scenario phase number, the cache control unit 109 sets the value of the synchronization timing set in the checkpoint entry in the clock counter 108 (step S215). From this, if the periodic processing of the main core 101 reaches the check point between the checkpoint synchronization timing of the cache control scenario 107 and the prefetch timing immediately before, the actual operation of the main core 101 and the scenario of the subcore 102 are detected. Will coincide with each other. As described above, the cache control unit 109 works to fill the delay time as much as possible if the actual operation is preceded.

図13は、フェーズ同期2の詳細を示すフローチャートである。   FIG. 13 is a flowchart showing details of the phase synchronization 2.

キャッシュ制御部109は、最初にコア間共有メモリを参照してメインコア101の同期部106から通知された実行フェーズ番号を取得し(ステップS221)、内部で管理しているシナリオフェーズ番号との比較を行う(ステップS222)。シナリオフェーズ番号が実行フェーズ番号よりも小さい場合は、実動作がシナリオの実行よりも先行しているので、キャッシュ制御シナリオ107のエントリをチェックポイントの次のエントリまで強制的に進める(ステップS223)。また、キャッシュ制御部109は、チェックポイントのエントリに設定された同期タイミングの値をクロックカウンタ108にセットする(ステップS224)。シナリオフェーズ番号が実行フェーズ番号以上であれば、ここでは何もせずに抜ける。なお、もしシナリオ実行が先行しているのであれば、次のフェーズ同期1(ステップS201)の処理においてタイミングが補正されるため、ここでは考慮しなくてよい。   The cache control unit 109 first refers to the inter-core shared memory, acquires the execution phase number notified from the synchronization unit 106 of the main core 101 (step S221), and compares it with the scenario phase number managed internally Is performed (step S222). If the scenario phase number is smaller than the execution phase number, the actual operation precedes the scenario execution, so the entry of the cache control scenario 107 is forcibly advanced to the next entry of the checkpoint (step S223). Further, the cache control unit 109 sets the value of the synchronization timing set in the checkpoint entry in the clock counter 108 (step S224). If the scenario phase number is greater than or equal to the execution phase number, the process exits without doing anything here. If the scenario execution is preceded, the timing is corrected in the next processing of phase synchronization 1 (step S201), and therefore, this need not be considered here.

上記のように、キャッシュ制御部109は、同期イベントが発生した場合、当該同期イベントが発生したタイミングとタイミング補正部117により生成された同期情報とに基づいて、次以降にプリフェッチ処理を実行するタイミングを処理装置により調整する。   As described above, when a synchronization event occurs, the cache control unit 109 executes the prefetch process after the next based on the timing at which the synchronization event has occurred and the synchronization information generated by the timing correction unit 117. Is adjusted by the processing device.

以下、本実施の形態が奏する効果について説明する。   Hereinafter, the effect which this embodiment has will be described.

本実施の形態によれば、キャッシュヒット率の微妙な変動によるタイミングのずれが蓄積されることにより、周期処理が進行するほど実動作とシナリオ実行との間にずれが生じてしまう課題に対し、同期部106から通知されるチェックポイントのタイミングに合わせてシナリオの実行位置及びタイミングをきめ細かく補正することにより、ずれの発生を抑止し、周期処理の周期後半までプリフェッチタイミングの精度を高く維持することが可能となる。   According to the present embodiment, by accumulating timing shifts due to subtle fluctuations in the cache hit rate, the problem that a shift occurs between actual operation and scenario execution as periodic processing progresses, By finely correcting the scenario execution position and timing in accordance with the checkpoint timing notified from the synchronization unit 106, it is possible to suppress the occurrence of deviation and maintain high accuracy of the prefetch timing until the latter half of the cycle processing cycle. It becomes possible.

以上説明したように、本実施の形態では、キャッシュ制御装置100は、同期部106をOS104内に設け、タスク、割り込みハンドラ、システムコール等の実行コンテキストを管理しているディスパッチャ105の情報を参照し、特定の実行コンテキストが切り替わる時点をチェックポイントとしてキャッシュ制御部109に通知する。キャッシュ制御シナリオ107は、さらにチェックポイントに関する情報を含み、これと照らし合わせることにより、周期処理の実際の進行状況に合わせて、キャッシュ制御シナリオ107の実行位置又はタイミングを補正することにより、実動作とシナリオとのずれを抑止し、プリフェッチタイミングの精度を高く維持する。   As described above, in the present embodiment, the cache control apparatus 100 provides the synchronization unit 106 in the OS 104 and refers to information on the dispatcher 105 that manages execution contexts such as tasks, interrupt handlers, and system calls. Then, the cache control unit 109 is notified of the point in time when the specific execution context is switched as a checkpoint. The cache control scenario 107 further includes information on checkpoints, and by comparing the information with the checkpoints, the execution position or timing of the cache control scenario 107 is corrected according to the actual progress of the periodic process, and The deviation from the scenario is suppressed and the prefetch timing accuracy is kept high.

以上のように、本実施の形態によれば、周期開始時点、実行コンテキスト切り替え時点等のチェックポイント、非同期処理の入口や出口等で同期をとることにより、実際の挙動とキャッシュ制御シナリオ107のタイミングがずれたまま処理が進行してしまうことを防止することができる。   As described above, according to the present embodiment, the actual behavior and the timing of the cache control scenario 107 are obtained by synchronizing at the check point at the cycle start time, the execution context switching time, etc., the entrance and exit of asynchronous processing, and the like. It is possible to prevent the processing from proceeding with the deviation.

実施の形態3.
本実施の形態について、主に実施の形態1との差異を説明する。
Embodiment 3 FIG.
In the present embodiment, differences from the first embodiment will be mainly described.

図14は、本実施の形態に係るキャッシュ制御装置100の構成を示すブロック図である。   FIG. 14 is a block diagram showing a configuration of the cache control apparatus 100 according to the present embodiment.

図14において、キャッシュ制御装置100は、実施の形態1と同様の構成要素のほか、シナリオ選択部118、実行モード参照部119をサブコア102に備える。   In FIG. 14, the cache control apparatus 100 includes a scenario selection unit 118 and an execution mode reference unit 119 in the sub-core 102 in addition to the same components as those in the first embodiment.

本実施の形態では、周期処理は、複数種類存在するものとする。周期処理の種類は、実行モード120として表される。なお、実行モード120は、周期タスク103から実行時に参照される変数であり、具体的な処理、制御、演算の内容の決定に関わる変数である。また、実行モード120は、メモリ共有等の方法によってサブコア102側から参照可能な位置に配置されるものとする。   In the present embodiment, it is assumed that there are a plurality of types of periodic processing. The type of the periodic process is represented as an execution mode 120. The execution mode 120 is a variable that is referred to by the periodic task 103 at the time of execution, and is a variable related to determination of specific processing, control, and calculation contents. In addition, the execution mode 120 is arranged at a position that can be referred to from the sub-core 102 side by a method such as memory sharing.

タイミング補正部117は、実行モード120に応じて、個別のキャッシュ制御シナリオ107を生成する。   The timing correction unit 117 generates an individual cache control scenario 107 according to the execution mode 120.

シナリオ選択部118は、実行モード120に応じて、タイミング補正部117により生成されたキャッシュ制御シナリオ107を選択する(複数のキャッシュ制御シナリオ107を切り替える)。具体的には、シナリオ選択部118は、キャッシュ制御部109からの要求に従い、実行モード参照部119を介して、メインコア101側で管理されたデータである実行モード120を取得し、その実行モード120に対応するキャッシュ制御シナリオ107を選び出す。   The scenario selection unit 118 selects the cache control scenario 107 generated by the timing correction unit 117 according to the execution mode 120 (switches a plurality of cache control scenarios 107). Specifically, the scenario selection unit 118 acquires the execution mode 120 that is data managed on the main core 101 side via the execution mode reference unit 119 in accordance with a request from the cache control unit 109, and the execution mode. A cache control scenario 107 corresponding to 120 is selected.

キャッシュ制御部109は、シナリオ選択部118により選択されたキャッシュ制御シナリオ107で示されるタイミングで、当該キャッシュ制御シナリオ107で示されるアドレスを対象にプリフェッチ処理を実行する。つまり、キャッシュ制御部109は、シナリオ選択部118が選び出したキャッシュ制御シナリオ107に従い、実施の形態1と同様のキャッシュ制御処理を実行する。   The cache control unit 109 executes prefetch processing for the address indicated by the cache control scenario 107 at the timing indicated by the cache control scenario 107 selected by the scenario selection unit 118. That is, the cache control unit 109 executes the same cache control process as in the first embodiment in accordance with the cache control scenario 107 selected by the scenario selection unit 118.

本実施の形態では、キャッシュ制御シナリオ107を生成するフェーズにおいて、キャッシュ制御装置100は、実行モード120ごとに複数回、アクセストレース情報114の取得からキャッシュ制御シナリオ107の生成までを行い、実行モード120ごとのキャッシュ制御シナリオ107を生成する。また、キャッシュ制御装置100は、実行モード120とキャッシュ制御シナリオ107の対応表を、シナリオ選択部118の内部データ構造として記憶装置に保持する。   In the present embodiment, in the phase of generating the cache control scenario 107, the cache control apparatus 100 performs the acquisition from the access trace information 114 to the generation of the cache control scenario 107 a plurality of times for each execution mode 120. Each cache control scenario 107 is generated. In addition, the cache control device 100 holds a correspondence table between the execution mode 120 and the cache control scenario 107 in the storage device as an internal data structure of the scenario selection unit 118.

図15は、キャッシュ制御部109の動作を示すフローチャートである。   FIG. 15 is a flowchart showing the operation of the cache control unit 109.

キャッシュ制御部109からシナリオ選択部118に対する処理要求(ステップS301)は、図15の通りカウンタリセット(ステップS102)の後で行われる。そのため、シナリオ選択部118や、その先で呼ばれる実行モード参照部119の実行に多少時間がかかってしまったとしても、キャッシュ制御シナリオ107に記載されたプリフェッチタイミングには影響しない。   A processing request (step S301) from the cache control unit 109 to the scenario selection unit 118 is made after a counter reset (step S102) as shown in FIG. Therefore, even if the execution of the scenario selection unit 118 or the execution mode reference unit 119 called ahead takes some time, the prefetch timing described in the cache control scenario 107 is not affected.

キャッシュ制御シナリオ107を実行するフェーズにおいて、キャッシュ制御部109からシナリオ選択部118が呼ばれると、シナリオ選択部118は、実行モード参照部119に対し、現在メインコア101側で実行されている周期処理の実行モード120を問い合わせる。実行モード参照部119は、共有メモリを介してメインコア101側の変数として保持される実行モード120を取得してシナリオ選択部118に渡す。このとき、周期処理の処理内容が、複数の変数の組み合わせによって決まる場合は、実際に取り得る各々の組み合わせによって、それぞれ別の実行モード120として認識し、また、それに応じたキャッシュ制御シナリオ107を予め用意しておく。実行モード120を取得したシナリオ選択部118では、実行モード120に対応するシナリオの先頭のエントリを示すポインタを、キャッシュ制御部109に渡す。   In the phase of executing the cache control scenario 107, when the scenario selection unit 118 is called from the cache control unit 109, the scenario selection unit 118 performs the periodic processing currently being executed on the main core 101 side with respect to the execution mode reference unit 119. Queries the execution mode 120. The execution mode reference unit 119 acquires the execution mode 120 held as a variable on the main core 101 side via the shared memory, and passes it to the scenario selection unit 118. At this time, if the processing content of the periodic processing is determined by a combination of a plurality of variables, each of the possible combinations can be recognized as a different execution mode 120, and a cache control scenario 107 corresponding to the execution mode 120 can be determined in advance. Have it ready. The scenario selection unit 118 that has acquired the execution mode 120 passes a pointer indicating the first entry of the scenario corresponding to the execution mode 120 to the cache control unit 109.

以下、本実施の形態が奏する効果について説明する。   Hereinafter, the effect which this embodiment has will be described.

本実施の形態によれば、キャッシュ制御シナリオ107を用いたキャッシュ制御方法の適用範囲を広げることができるため、より多くの周期処理において処理性能の向上が期待できる。   According to the present embodiment, the application range of the cache control method using the cache control scenario 107 can be expanded, so that it is possible to expect an improvement in processing performance in more periodic processes.

以上説明したように、本実施の形態では、キャッシュ制御装置100は、実行モード120に応じて周期処理の内容が変わる場合、キャッシュ制御シナリオ107を実行モード120に対応して複数用意しておき、実行モード参照部119により実行モード120を適宜参照し、その結果に応じてシナリオ選択部118によりキャッシュ制御シナリオ107を切り替える。   As described above, in the present embodiment, the cache control device 100 prepares a plurality of cache control scenarios 107 corresponding to the execution mode 120 when the content of the periodic processing changes according to the execution mode 120. The execution mode reference unit 119 refers to the execution mode 120 as appropriate, and the scenario selection unit 118 switches the cache control scenario 107 according to the result.

以上のように、本実施の形態によれば、複数の実行モード120に対応して周期処理の内容が異なる場合には、実行モード120ごとにキャッシュ制御シナリオ107を各々用意しておき、実行モード120が変化した時にキャッシュ制御シナリオ107も併せて切り替えることで、キャッシュ制御シナリオ107を用いたキャッシュ制御方法を多様な周期処理に適用可能にしている。   As described above, according to the present embodiment, when the contents of the periodic processing are different corresponding to the plurality of execution modes 120, the cache control scenario 107 is prepared for each execution mode 120, and the execution mode By switching the cache control scenario 107 when 120 changes, the cache control method using the cache control scenario 107 can be applied to various periodic processes.

以上、本発明の実施の形態について説明したが、これらのうち、2つ以上の実施の形態を組み合わせて実施しても構わない。あるいは、これらのうち、1つの実施の形態を部分的に実施しても構わない。あるいは、これらのうち、2つ以上の実施の形態を部分的に組み合わせて実施しても構わない。   As mentioned above, although embodiment of this invention was described, you may implement combining 2 or more embodiment among these. Alternatively, one of these embodiments may be partially implemented. Or you may implement combining two or more embodiment among these partially.

100 キャッシュ制御装置、101 メインコア、102 サブコア、103 周期タスク、104 OS、105 ディスパッチャ、106 同期部、107 キャッシュ制御シナリオ、108 クロックカウンタ、109 キャッシュ制御部、110 共有キャッシュ、111 RAM、112 メモリコントローラ、113 メモリアクセス監視部、114 アクセストレース情報、115 キャッシュ制御解析部、116 アクセス統計情報、117 タイミング補正部、118 シナリオ選択部、119 実行モード参照部、120 実行モード、121 LCD、122 キーボード、123 マウス、124 FDD、125 CDD、126 プリンタ、131 CPU、132 バス、133 ROM、135 通信ボード、140 HDD、143 プログラム群、144 ファイル群。   100 cache controller, 101 main core, 102 sub core, 103 periodic task, 104 OS, 105 dispatcher, 106 synchronization unit, 107 cache control scenario, 108 clock counter, 109 cache control unit, 110 shared cache, 111 RAM, 112 memory controller , 113 Memory access monitoring unit, 114 Access trace information, 115 Cache control analysis unit, 116 Access statistical information, 117 Timing correction unit, 118 Scenario selection unit, 119 Execution mode reference unit, 120 Execution mode, 121 LCD, 122 Keyboard, 123 Mouse, 124 FDD, 125 CDD, 126 printer, 131 CPU, 132 bus, 133 ROM, 135 communication board, 140 HDD, 143 programs, 144 files.

Claims (9)

メインメモリからキャッシュメモリへデータを予め読み出すプリフェッチ処理のための時間であるキャッシュ制御処理遅延時間と、キャッシュミスが発生した場合にメインメモリにアクセスするための時間であるメモリアクセス遅延時間とを示す遅延時間情報と、一定周期ごとに実行される周期処理の複数周期にて発生したキャッシュミスごとに、キャッシュミスが発生したタイミングとアドレスとを示すアクセストレース情報とを予め記憶する記憶装置と、データ処理を行う処理装置とを具備し、
前記記憶装置に記憶されたアクセストレース情報から、前記複数周期のうち、所定数以上の周期にて所定範囲内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として処理装置により抽出し、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量を前記処理装置により計算し、計算したタイミングの統計量と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報を前記処理装置により生成するキャッシュ制御解析部と、
前記キャッシュ制御解析部により抽出されたキャッシュミス集合ごとに、前記キャッシュ制御解析部により生成されたアクセス統計情報で示されるタイミングの統計量と前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間及びメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを前記処理装置により設定し、設定したタイミングと当該アクセス統計情報で示されるアドレスとを示すキャッシュ制御シナリオを前記処理装置により生成するキャッシュ制御シナリオ生成部とを備えることを特徴とするキャッシュ制御装置。
A delay indicating a cache control processing delay time that is a time for prefetch processing for pre-reading data from the main memory to the cache memory, and a memory access delay time that is a time for accessing the main memory when a cache miss occurs A storage device for preliminarily storing time information and access trace information indicating the timing and address at which a cache miss occurs for each cache miss occurring in a plurality of cycles of periodic processing executed at fixed intervals; and data processing And a processing device for performing
From the access trace information stored in the storage device, a cache miss that occurs at the same address with a timing difference within a predetermined range in a predetermined number of cycles or more among the plurality of cycles is extracted as a cache miss set by the processing device. For each extracted cache miss set, the processing device calculates the statistics of the timing at which a cache miss has occurred, and provides access statistics information indicating the calculated timing statistics and the address at which the cache miss has occurred. Cache control analysis unit generated by
For each cache miss set extracted by the cache control analysis unit, the cache control indicated by the timing statistics indicated by the access statistical information generated by the cache control analysis unit and the delay time information stored in the storage device Based on the processing delay time and the memory access delay time, the processing device sets the timing for executing the prefetch processing, and the processing device generates a cache control scenario indicating the set timing and the address indicated by the access statistical information. A cache control apparatus comprising: a cache control scenario generation unit.
前記キャッシュ制御シナリオ生成部は、前記キャッシュ制御解析部により生成されたアクセス統計情報で、i(iはi>1となる整数)番目にプリフェッチ処理を実行するアドレスとともに示されるタイミングの統計量と、前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間と、前記記憶装置に記憶された遅延時間情報で示されるメモリアクセス遅延時間をi−1倍した時間とから、i番目にプリフェッチ処理を実行するタイミングを設定することを特徴とする請求項1に記載のキャッシュ制御装置。   The cache control scenario generation unit is the access statistical information generated by the cache control analysis unit, and is a timing statistic indicated together with an address at which i (i is an integer satisfying i> 1) the prefetch process is performed, The cache control processing delay time indicated by the delay time information stored in the storage device and the memory access delay time indicated by the delay time information stored in the storage device are multiplied by i−1. The cache control device according to claim 1, wherein timing for executing the prefetch process is set. 前記キャッシュ制御シナリオ生成部は、i番目にプリフェッチ処理を実行するタイミングとi−1番目にプリフェッチ処理を実行するタイミングとの差が前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間以上になるようにタイミングを設定することを特徴とする請求項2に記載のキャッシュ制御装置。   The cache control scenario generator generates a cache control process delay in which a difference between a timing at which the i th prefetch process is executed and a timing at which the i−1 th prefetch process is executed is indicated by delay time information stored in the storage device 3. The cache control device according to claim 2, wherein the timing is set so as to be equal to or longer than the time. 前記キャッシュ制御解析部は、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量として、当該キャッシュミスが発生したタイミングの平均及び標準偏差を計算し、前記アクセス統計情報として、計算したタイミングの平均及び標準偏差と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報を生成し、
前記キャッシュ制御シナリオ生成部は、前記キャッシュ制御解析部により抽出されたキャッシュミス集合ごとに、前記キャッシュ制御解析部により生成されたアクセス統計情報でアドレスA[i]とともに示されるタイミングの平均M[i]及び標準偏差V[i]と、所定の補正値Cと、前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間D及びメモリアクセス遅延時間Eとから、i番目にプリフェッチ処理を実行するタイミングP[i]を、P[i]=M[i]−(V[i]×C)−((i−1)×E)−Dに設定することを特徴とする請求項2又は3に記載のキャッシュ制御装置。
The cache control analysis unit calculates the average and standard deviation of the timing at which the cache miss occurs as the statistics of the timing at which the cache miss occurs for each extracted cache miss set, and calculates the access statistics information. Generate access statistics that show the average and standard deviation of the timing and the address where the cache miss occurred,
For each cache miss set extracted by the cache control analysis unit, the cache control scenario generation unit generates an average M [i of timings indicated together with the address A [i] in the access statistical information generated by the cache control analysis unit. ], The standard deviation V [i], the predetermined correction value C, the cache control processing delay time D and the memory access delay time E indicated by the delay time information stored in the storage device, and the i th prefetch processing The timing P [i] for executing the operation is set to P [i] = M [i] − (V [i] × C) − ((i−1) × E) −D. 4. The cache control device according to 2 or 3.
前記周期処理は、前記複数周期の各々にて一定タイミングで発生する同期イベントを少なくとも1つ含み、
前記キャッシュ制御シナリオ生成部は、さらに、同期イベントが発生するタイミングとプリフェッチ処理を実行するタイミングとの前後関係を示す同期情報を前記処理装置により生成し、
前記キャッシュ制御装置は、さらに、
前記キャッシュ制御シナリオ生成部により生成されたキャッシュ制御シナリオで示されるタイミングで、当該キャッシュ制御シナリオで示されるアドレスに対してプリフェッチ処理を前記処理装置により実行するとともに、同期イベントが発生した場合、当該同期イベントが発生したタイミングと前記キャッシュ制御シナリオ生成部により生成された同期情報とに基づいて、次以降にプリフェッチ処理を実行するタイミングを前記処理装置により調整するキャッシュ制御部を備えることを特徴とする請求項1から4までのいずれかに記載のキャッシュ制御装置。
The periodic process includes at least one synchronization event that occurs at a constant timing in each of the plurality of periods,
The cache control scenario generation unit further generates synchronization information indicating a context between a timing at which a synchronization event occurs and a timing at which a prefetch process is executed, by the processing device,
The cache control device further includes:
When the prefetch processing is executed by the processing device for the address indicated by the cache control scenario at the timing indicated by the cache control scenario generated by the cache control scenario generation unit, and the synchronization event occurs, And a cache control unit configured to adjust a timing for executing a prefetch process from the next time onward based on timing at which an event occurs and synchronization information generated by the cache control scenario generation unit. Item 5. The cache control device according to any one of Items 1 to 4.
前記キャッシュ制御装置は、さらに、
同期イベントが発生した場合、一定アドレスへデータを書き込む同期部を備え、
前記キャッシュ制御シナリオ生成部は、設定したタイミングと前記キャッシュ制御解析部により生成されたアクセス統計情報で示されるアドレスとを前記キャッシュ制御シナリオに記録する形式と同じ形式で、同期イベントが発生するタイミングと当該タイミングで前記同期部により書き込まれるデータとを前記キャッシュ制御シナリオに記録することにより、前記同期情報を前記キャッシュ制御シナリオの一部として生成することを特徴とする請求項5に記載のキャッシュ制御装置。
The cache control device further includes:
When a synchronization event occurs, it has a synchronization unit that writes data to a fixed address,
The cache control scenario generation unit is configured to record a synchronization event in the same format as that for recording the set timing and the address indicated by the access statistical information generated by the cache control analysis unit in the cache control scenario. 6. The cache control device according to claim 5, wherein the synchronization information is generated as a part of the cache control scenario by recording data written by the synchronization unit at the timing in the cache control scenario. .
前記周期処理は、複数種類存在し、
前記キャッシュ制御シナリオ生成部は、周期処理の種類に応じて、個別のキャッシュ制御シナリオを生成し、
前記キャッシュ制御装置は、さらに、
周期処理の種類に応じて、前記キャッシュ制御シナリオ生成部により生成されたキャッシュ制御シナリオを選択するシナリオ選択部を備え、
前記キャッシュ制御部は、前記シナリオ選択部により選択されたキャッシュ制御シナリオで示されるタイミングで、当該キャッシュ制御シナリオで示されるアドレスを対象にプリフェッチ処理を実行することを特徴とする請求項1から6までのいずれかに記載のキャッシュ制御装置。
There are multiple types of periodic processing,
The cache control scenario generation unit generates an individual cache control scenario according to the type of periodic processing,
The cache control device further includes:
A scenario selection unit that selects a cache control scenario generated by the cache control scenario generation unit according to the type of periodic processing,
7. The cache control unit according to claim 1, wherein the cache control unit executes prefetch processing for an address indicated by the cache control scenario at a timing indicated by the cache control scenario selected by the scenario selection unit. The cache control device according to any one of the above.
記憶装置が、メインメモリからキャッシュメモリへデータを予め読み出すプリフェッチ処理のための時間であるキャッシュ制御処理遅延時間と、キャッシュミスが発生した場合にメインメモリにアクセスするための時間であるメモリアクセス遅延時間とを示す遅延時間情報と、一定周期ごとに実行される周期処理の複数周期にて発生したキャッシュミスごとに、キャッシュミスが発生したタイミングとアドレスとを示すアクセストレース情報とを予め記憶し、
処理装置が、前記記憶装置に記憶されたアクセストレース情報から、前記複数周期のうち、所定数以上の周期にて所定範囲内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として抽出し、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量を計算し、計算したタイミングの統計量と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報を生成し、
前記処理装置が、前記抽出されたキャッシュミス集合ごとに、前記生成されたアクセス統計情報で示されるタイミングの統計量と前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間及びメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを設定し、設定したタイミングと当該アクセス統計情報で示されるアドレスとを示すキャッシュ制御シナリオを生成することを特徴とするキャッシュ制御方法。
Cache control processing delay time, which is a time for prefetch processing in which data is read from the main memory to the cache memory in advance, and memory access delay time, which is the time for accessing the main memory when a cache miss occurs Delay time information indicating, and access trace information indicating the timing and address at which a cache miss occurs for each cache miss occurring in a plurality of cycles of periodic processing executed at regular intervals,
The processor extracts from the access trace information stored in the storage device, as a cache miss set, cache misses that occur at the same address due to a timing difference within a predetermined range within a predetermined number of cycles among the plurality of cycles. Then, for each extracted cache miss set, calculate the statistics of the timing when the cache miss occurred, and generate access statistics information indicating the calculated timing statistics and the address where the cache miss occurred,
A cache control processing delay time and a memory indicated by the timing statistics indicated by the generated access statistical information and delay time information stored in the storage device for each of the extracted cache miss sets. A cache control method characterized by setting a timing for executing prefetch processing from an access delay time, and generating a cache control scenario indicating the set timing and an address indicated by the access statistical information.
メインメモリからキャッシュメモリへデータを予め読み出すプリフェッチ処理のための時間であるキャッシュ制御処理遅延時間と、キャッシュミスが発生した場合にメインメモリにアクセスするための時間であるメモリアクセス遅延時間とを示す遅延時間情報と、一定周期ごとに実行される周期処理の複数周期にて発生したキャッシュミスごとに、キャッシュミスが発生したタイミングとアドレスとを示すアクセストレース情報とを予め記憶する記憶装置と、データ処理を行う処理装置とを具備するコンピュータにより実行されるキャッシュ制御プログラムであって、
前記記憶装置に記憶されたアクセストレース情報から、前記複数周期のうち、所定数以上の周期にて所定範囲内のタイミングの差で同じアドレスについて発生したキャッシュミスをキャッシュミス集合として処理装置により抽出し、抽出したキャッシュミス集合ごとに、キャッシュミスが発生したタイミングの統計量を前記処理装置により計算し、計算したタイミングの統計量と当該キャッシュミスが発生したアドレスとを示すアクセス統計情報を前記処理装置により生成するキャッシュ制御解析処理と、
前記キャッシュ制御解析処理により抽出されたキャッシュミス集合ごとに、前記キャッシュ制御解析処理により生成されたアクセス統計情報で示されるタイミングの統計量と前記記憶装置に記憶された遅延時間情報で示されるキャッシュ制御処理遅延時間及びメモリアクセス遅延時間とから、プリフェッチ処理を実行するタイミングを前記処理装置により設定し、設定したタイミングと当該アクセス統計情報で示されるアドレスとを示すキャッシュ制御シナリオを前記処理装置により生成するキャッシュ制御シナリオ生成処理とをコンピュータに実行させることを特徴とするキャッシュ制御プログラム。
A delay indicating a cache control processing delay time that is a time for prefetch processing for pre-reading data from the main memory to the cache memory, and a memory access delay time that is a time for accessing the main memory when a cache miss occurs A storage device for preliminarily storing time information and access trace information indicating the timing and address at which a cache miss occurs for each cache miss occurring in a plurality of cycles of periodic processing executed at fixed intervals; and data processing A cache control program executed by a computer comprising a processing device for performing
From the access trace information stored in the storage device, a cache miss that occurs at the same address with a timing difference within a predetermined range in a predetermined number of cycles or more among the plurality of cycles is extracted as a cache miss set by the processing device. For each extracted cache miss set, the processing device calculates the statistics of the timing at which a cache miss has occurred, and provides access statistics information indicating the calculated timing statistics and the address at which the cache miss has occurred. Cache control analysis processing generated by
For each cache miss set extracted by the cache control analysis process, the cache control indicated by the timing statistic indicated by the access statistical information generated by the cache control analysis process and the delay time information stored in the storage device Based on the processing delay time and the memory access delay time, the processing device sets the timing for executing the prefetch processing, and the processing device generates a cache control scenario indicating the set timing and the address indicated by the access statistical information. A cache control program that causes a computer to execute cache control scenario generation processing.
JP2009061095A 2009-03-13 2009-03-13 Cache controller, cache control method, and cache control program Pending JP2010217992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009061095A JP2010217992A (en) 2009-03-13 2009-03-13 Cache controller, cache control method, and cache control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009061095A JP2010217992A (en) 2009-03-13 2009-03-13 Cache controller, cache control method, and cache control program

Publications (1)

Publication Number Publication Date
JP2010217992A true JP2010217992A (en) 2010-09-30

Family

ID=42976821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009061095A Pending JP2010217992A (en) 2009-03-13 2009-03-13 Cache controller, cache control method, and cache control program

Country Status (1)

Country Link
JP (1) JP2010217992A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013175625A1 (en) * 2012-05-25 2013-11-28 株式会社日立製作所 Database management method, database management device, and storage medium
WO2014136002A1 (en) * 2013-03-05 2014-09-12 International Business Machines Corporation Data prefetch for a chip having a parent core and a scout core
US8996840B2 (en) 2011-12-23 2015-03-31 International Business Machines Corporation I/O controller and method for operating an I/O controller
US9116816B2 (en) 2013-03-05 2015-08-25 International Business Machines Corporation Prefetching for a parent core in a multi-core chip
US9128851B2 (en) 2013-03-05 2015-09-08 International Business Machines Corporation Prefetching for multiple parent cores in a multi-core chip
US9563563B2 (en) 2012-11-30 2017-02-07 International Business Machines Corporation Multi-stage translation of prefetch requests
US9792120B2 (en) 2013-03-05 2017-10-17 International Business Machines Corporation Anticipated prefetching for a parent core in a multi-core chip
US11212235B2 (en) 2013-12-24 2021-12-28 Intel Corporation Cloud compute scheduling using a heuristic contention model

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8996840B2 (en) 2011-12-23 2015-03-31 International Business Machines Corporation I/O controller and method for operating an I/O controller
US9286236B2 (en) 2011-12-23 2016-03-15 International Business Machines Corporation I/O controller and method for operating an I/O controller
WO2013175625A1 (en) * 2012-05-25 2013-11-28 株式会社日立製作所 Database management method, database management device, and storage medium
US9563563B2 (en) 2012-11-30 2017-02-07 International Business Machines Corporation Multi-stage translation of prefetch requests
US9128851B2 (en) 2013-03-05 2015-09-08 International Business Machines Corporation Prefetching for multiple parent cores in a multi-core chip
US9128852B2 (en) 2013-03-05 2015-09-08 International Business Machines Corporation Prefetching for a parent core in a multi-core chip
US9135180B2 (en) 2013-03-05 2015-09-15 International Business Machines Corporation Prefetching for multiple parent cores in a multi-core chip
US9141550B2 (en) 2013-03-05 2015-09-22 International Business Machines Corporation Specific prefetch algorithm for a chip having a parent core and a scout core
US9141551B2 (en) 2013-03-05 2015-09-22 International Business Machines Corporation Specific prefetch algorithm for a chip having a parent core and a scout core
US9116816B2 (en) 2013-03-05 2015-08-25 International Business Machines Corporation Prefetching for a parent core in a multi-core chip
JP2016509320A (en) * 2013-03-05 2016-03-24 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Computer system, computer program, and computer-implemented method for prefetching data
JP2016513829A (en) * 2013-03-05 2016-05-16 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Computer system, computer program, and computer-implemented method for prefetching data on a chip
WO2014136002A1 (en) * 2013-03-05 2014-09-12 International Business Machines Corporation Data prefetch for a chip having a parent core and a scout core
US9792120B2 (en) 2013-03-05 2017-10-17 International Business Machines Corporation Anticipated prefetching for a parent core in a multi-core chip
US9798545B2 (en) 2013-03-05 2017-10-24 International Business Machines Corporation Anticipated prefetching for a parent core in a multi-core chip
US11212235B2 (en) 2013-12-24 2021-12-28 Intel Corporation Cloud compute scheduling using a heuristic contention model
US11689471B2 (en) 2013-12-24 2023-06-27 Intel Corporation Cloud compute scheduling using a heuristic contention model

Similar Documents

Publication Publication Date Title
JP2010217992A (en) Cache controller, cache control method, and cache control program
US5297274A (en) Performance analysis of program in multithread OS by creating concurrently running thread generating breakpoint interrupts to active tracing monitor
US5727167A (en) Thresholding support in performance monitoring
US8949579B2 (en) Ineffective prefetch determination and latency optimization
JP6447217B2 (en) Execution information notification program, information processing apparatus, and information processing system
FI3382551T3 (en) Distributed hardware tracing
CN109117274B (en) Memory management method and device applied to browser, terminal and storage medium
JP6269048B2 (en) Data arrangement control program, data arrangement control method, and data arrangement control apparatus
Weisberg et al. Efficient memory control for avionics and embedded systems
Zhou et al. I/O characteristics of smartphone applications and their implications for eMMC design
CN104731974A (en) Dynamic page loading method based on big data stream type calculation
US8006041B2 (en) Prefetch processing apparatus, prefetch processing method, storage medium storing prefetch processing program
CN103339606B (en) Activity recording system for a concurrent software environment
Zhou et al. Bigroots: An effective approach for root-cause analysis of stragglers in big data system
JP2014106973A (en) Performance measurement unit
Yang et al. Mithril: mining sporadic associations for cache prefetching
US9690633B2 (en) Synchronization method
JP6102575B2 (en) Performance measurement method, performance measurement program, and performance measurement apparatus
US20090089555A1 (en) Methods and apparatus for executing or converting real-time instructions
US8612952B2 (en) Performance optimization based on data accesses during critical sections
JP4151975B2 (en) Information processing apparatus, program, and management method
CN115576872B (en) Access detection method and device for multi-level cache
US8332568B2 (en) Memory access determination circuit, memory access determination method and electronic device
CN112767978B (en) DDR command scheduling method, device, equipment and medium
US8160845B2 (en) Method for emulating operating system jitter