JP2011034239A - Information processor, delay determination method for load instruction, and delay determination program for load instruction - Google Patents

Information processor, delay determination method for load instruction, and delay determination program for load instruction Download PDF

Info

Publication number
JP2011034239A
JP2011034239A JP2009178378A JP2009178378A JP2011034239A JP 2011034239 A JP2011034239 A JP 2011034239A JP 2009178378 A JP2009178378 A JP 2009178378A JP 2009178378 A JP2009178378 A JP 2009178378A JP 2011034239 A JP2011034239 A JP 2011034239A
Authority
JP
Japan
Prior art keywords
cache
instruction
load instruction
delay
prefetch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009178378A
Other languages
Japanese (ja)
Other versions
JP5593647B2 (en
Inventor
Yusuke Kobayashi
雄介 小林
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2009178378A priority Critical patent/JP5593647B2/en
Publication of JP2011034239A publication Critical patent/JP2011034239A/en
Application granted granted Critical
Publication of JP5593647B2 publication Critical patent/JP5593647B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To give an index for correcting the inserting position of a prefetch instruction to a user who creates a program. <P>SOLUTION: This information processor 10 including an arithmetic unit 11 and a main storage device 13 and a cache device 12 is configured to detect a load instruction 107 to a cache device whose delay is generated during cache fill execution due to a prefetch instruction 105 from the arithmetic unit 11, and to acquire the generation frequency or duration of the detected load instruction 107. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、情報処理装置に関し、特にプログラムを作成するユーザにプリフェッチ命令の挿入位置を修正するための指標を与える情報処理装置、ロード命令の遅延判定方法、ロード命令の遅延判定プログラムに関する。   The present invention relates to an information processing apparatus, and more particularly to an information processing apparatus that gives an index for correcting a prefetch instruction insertion position to a user who creates a program, a load instruction delay determination method, and a load instruction delay determination program.

近年の技術において、メモリ帯域の向上率は、中央演算処理部の性能向上率に比較して小さい。従って、コンピュータシステムの性能向上のために、メモリ帯域の有効利用は非常に重要である。   In recent technologies, the improvement rate of the memory bandwidth is smaller than the performance improvement rate of the central processing unit. Therefore, effective use of the memory bandwidth is very important for improving the performance of the computer system.

一方、プリフェッチ命令は、ロード命令に先行して実行されることにより、ロード命令のキャッシュヒット率を向上させ、それにより、プログラム(ジョブ)の性能向上を図る命令である。   On the other hand, the prefetch instruction is an instruction that is executed prior to the load instruction to improve the cache hit rate of the load instruction, thereby improving the performance of the program (job).

従い、適切なタイミングでプリフェッチ命令を実行することは、ロード命令がメモリ帯域を使用しない時間区間のメモリ帯域の有効利用を可能にするため、近年のコンピュータシステムにおいては、適切なタイミングでプリフェッチ命令を実行することが性能向上のために重要な課題となっている。
来の研究、開発、論文は、このタイミングが自動で適切になるように制御するハードウェア機構、言語翻訳装置(コンパイラ)を提案している。
Therefore, executing a prefetch instruction at an appropriate timing enables effective use of the memory bandwidth in a time interval in which the load instruction does not use the memory bandwidth. Therefore, in recent computer systems, the prefetch instruction is executed at an appropriate timing. Execution is an important issue for improving performance.
Future research, development, and papers have proposed a hardware mechanism and a language translation device (compiler) that control this timing automatically.

これまでの関連技術においては、プリフェッチ命令の実行位置決定が自働で適切になるように制御するコンパイラ、及びハードウェア機構についての技術が複数提案されている。   In related technologies so far, there have been proposed a plurality of technologies relating to a compiler and a hardware mechanism for controlling execution position determination of a prefetch instruction to be appropriate automatically.

例えば、特許文献1に開示の技術は、ハードウェアが、過去のメモリアクセスの履歴から、プリフェッチ命令の最適な実行位置を予測し、プログラム実行時に動的にプリフェッチ命令を命令列中に埋め込むことを可能としている。   For example, in the technique disclosed in Patent Document 1, the hardware predicts the optimum execution position of a prefetch instruction from the past memory access history, and dynamically embeds the prefetch instruction in the instruction sequence during program execution. It is possible.

しかし、特許文献1に記載の技術においては、プリフェッチ命令の実行位置が適切か否かの情報は、ユーザに提供されないため、ユーザが、ジョブの実行結果からプリフェッチ命令の実行位置が適切かを判断し、プリフェッチ命令の挿入位置を適切に修正することはできない。   However, in the technique disclosed in Patent Document 1, information on whether or not the execution position of the prefetch instruction is appropriate is not provided to the user, so the user determines whether or not the execution position of the prefetch instruction is appropriate from the job execution result. However, the insertion position of the prefetch instruction cannot be corrected appropriately.

なお、プリフェッチ命令が有効に働かない状態は、下記2つの状態である。   Note that the state where the prefetch instruction does not work effectively is the following two states.

まず、第1の状態は、プリフェッチ命令がロード命令に対して早すぎる位置で実行されたために、ロード命令実行前に、プリフェッチされたデータが、キャッシュ外に追い出された場合である。この状態は、従来のキャッシュミスカウンタで計測が可能である。   First, the first state is a case where prefetched data is evicted out of the cache before execution of the load instruction because the prefetch instruction is executed at a position too early with respect to the load instruction. This state can be measured with a conventional cache miss counter.

第2の状態は、プリフェッチ命令がロード命令に対して遅すぎる位置で実行されたために、ロード命令実行前に、プリフェッチ命令によるキャッシュフィルが終了していない場合である。この状態は、これまでの関連技術においては、第1の状態におけるキャッシュミスカウンタに含まれてカウントされるか、全く観測されないかのいずれかである。図10、図11に、この状態を示す。   The second state is a case where the cache fill by the prefetch instruction is not completed before the load instruction is executed because the prefetch instruction is executed at a position too late with respect to the load instruction. This state is either included in the cache miss counter in the first state, counted in the related art so far, or not observed at all. 10 and 11 show this state.

図10は、データがプリフェッチされるまでロード命令を留めている場合を示しており、図11は、データがプリフェッチされるのを待たず、メインメモリからデータを取得している場合を示している。   FIG. 10 shows a case where the load instruction is held until the data is prefetched, and FIG. 11 shows a case where the data is acquired from the main memory without waiting for the data to be prefetched. .

また、図9に、プリフェッチ命令実行位置の好例を示す。図9においては、プリフェッチ命令よりデータがキャッシュにプリフェッチされた後にロード命令がキャッシュに届いているため、ロード命令はキャッシュからデータを取得することができている。   FIG. 9 shows a good example of the prefetch instruction execution position. In FIG. 9, since the load instruction reaches the cache after the data is prefetched into the cache by the prefetch instruction, the load instruction can acquire the data from the cache.

なお、キャッシュミスをカウントするカウンタについての技術は複数開示されており、さらに、キャッシュミスがどのような場合かまで計測するカウンタが、特許文献2に開示されている。   A plurality of techniques for counters that count cache misses are disclosed, and further, a counter that measures the cache misses is disclosed in Patent Document 2.

特許文献2に開示の技術は、カウンタが、プリフェッチ後のロード命令時において、要求するデータがプリフェッチ領域の上側の非領域にすべて存在する場合、あるいはプリフェッチ領域の上側の非領域とキャッシュ領域にまたがって存在する場合、あるいはプリフェッチ領域の下側の非プリフェッチ領域にすべて存在する場合、あるいはプリフェッチ領域の下側の非領域とキャッシュ領域にまたがって存在する場合、そしてプリフェッチ領域に存在する場合とを別々に計測することを可能としている。   In the technique disclosed in Patent Document 2, when the counter requests all the requested data in the non-region above the prefetch area at the time of the load instruction after prefetch, or the counter extends over the non-area and cache area above the prefetch area. If they exist in the non-prefetch area below the prefetch area, or if they exist across the non-area and cache area below the prefetch area, and if they exist in the prefetch area It is possible to measure.

特開2004−038345JP 2004-0383345 A 特開2008−061151JP2008-061151

上述した関連技術の問題点は、上述した第2の状態、つまり、先行するプリフェッチ命令に基づくキャッシュフィルの実行中によりロード命令に遅延が発生する場合を、キャッシュミスとしてカウントしてしまうか、あるいは無視してしまうため、プリフェッチ命令によるロード命令の遅延を通常のキャッシュミスの場合と分けて正確に計測することが困難であるということである。   The problem of the related art described above is that the second state described above, that is, the case where a delay occurs in the load instruction during execution of the cache fill based on the preceding prefetch instruction, is counted as a cache miss, or Because it is ignored, it is difficult to accurately measure the delay of the load instruction due to the prefetch instruction separately from the case of a normal cache miss.

(発明の目的)
本発明の目的は、上述した課題である、プリフェッチ命令に基づくキャッシュフィルの実行中によりロード命令に遅延が発生する場合を個別に計測できないという問題を解決し、プログラムを作成するユーザにプリフェッチ命令の挿入位置を修正するための指標を与える情報処理装置、ロード命令の遅延判定方法、ロード命令の遅延判定プログラムに関する。
(Object of invention)
The object of the present invention is to solve the problem that the load instruction is delayed due to the execution of the cache fill based on the prefetch instruction, which is the above-mentioned problem. The present invention relates to an information processing apparatus that provides an index for correcting an insertion position, a load instruction delay determination method, and a load instruction delay determination program.

本発明の第1の情報処理装置は、演算装置と主記憶装置とキャッシュ装置を含む情報処理装置であって、演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生したキャッシュ装置に対するロード命令を検出し、検出したロード命令の発生回数又は継続時間を取得する機能を有する。   A first information processing apparatus according to the present invention is an information processing apparatus including an arithmetic device, a main storage device, and a cache device, and a load instruction for a cache device in which a delay occurs due to execution of a cache fill by a prefetch instruction from the arithmetic device And detecting the number of occurrences or duration of the detected load instruction.

本発明の第1のロード命令の遅延判定方法は、演算装置と主記憶装置とキャッシュ装置を含む情報処理装置におけるロード命令の遅延判定方法であって、演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生したキャッシュ装置に対するロード命令を検出するステップと、検出したロード命令の発生回数又は継続時間を取得するステップとを有する。   A first load instruction delay determination method according to the present invention is a load instruction delay determination method in an information processing apparatus including an arithmetic unit, a main storage unit, and a cache unit, and a cache fill is being executed by a prefetch instruction from the arithmetic unit. And a step of detecting a load instruction for the cache device in which the delay has occurred, and a step of acquiring the number of occurrences or the duration of the detected load instruction.

本発明の第1のロード命令の遅延判定プログラムは、演算装置と主記憶装置とキャッシュ装置を含む情報処理装置で実行されるロード命令の遅延判定プログラムであって、演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生したキャッシュ装置に対するロード命令を検出する機能と、検出したロード命令の発生回数又は継続時間を取得する機能とを、情報処理装置に実行させる。   A first load instruction delay determination program according to the present invention is a load instruction delay determination program executed by an information processing apparatus including an arithmetic device, a main storage device, and a cache device, and includes a cache based on a prefetch instruction from the arithmetic device. The information processing apparatus is caused to execute a function of detecting a load instruction for a cache device in which a delay occurs during execution of fill and a function of acquiring the number of occurrences or duration of the detected load instruction.

本発明によれば、プログラムを作成するユーザにプリフェッチ命令の挿入位置を修正するための指標を与える情報処理装置、ロード命令の遅延判定方法、ロード命令の遅延判定プログラムを提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the information processing apparatus which gives the parameter | index for correcting the insertion position of a prefetch instruction to the user who creates a program, the delay determination method of a load instruction, and the delay determination program of a load instruction can be provided.

その理由は、先行するプリフェッチ命令に基づくキャッシュフィルの実行中によりロード命令に遅延が発生する回数及び遅延時間を計測するからである。   This is because the number of delays and the delay time of the load instruction due to the execution of the cache fill based on the preceding prefetch instruction are measured.

本発明の第1の実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるキャッシュ装置の構成を示す図である。It is a figure which shows the structure of the cache apparatus in the 1st Embodiment of this invention. 本発明の第1の実施の形態における演算装置の構成を示す図である。It is a figure which shows the structure of the arithmetic unit in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるキャッシュ検索の動作を示したフローチャートである。It is the flowchart which showed the operation | movement of the cache search in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるプリフェッチ命令発行時の動作を示したフローチャートである。It is the flowchart which showed the operation | movement at the time of the prefetch instruction | command issue in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるキャッシュフィル中におけるロード命令発行時の動作を示したフローチャートである。It is the flowchart which showed the operation | movement at the time of the load instruction issuance in the cache fill in the 1st Embodiment of this invention. 本発明の第1の実施の形態における検出信号受信時の演算装置の動作を示したフローチャートである。It is the flowchart which showed operation | movement of the arithmetic unit at the time of the detection signal reception in the 1st Embodiment of this invention. 本発明のコンピュータシステムのハードウェア構成例を示すブロック図である。It is a block diagram which shows the hardware structural example of the computer system of this invention. 関連技術によるプリフェッチ実行位置の好例を示す図である。It is a figure which shows the example of the prefetch execution position by related technology. 関連技術によるプリフェッチ命令とロード命令の実行位置の例を示す図である。It is a figure which shows the example of the execution position of the prefetch instruction | indication and load instruction | indication by related technology. 関連技術によるプリフェッチ命令とロード命令の実行位置の例を示す図である。It is a figure which shows the example of the execution position of the prefetch instruction | indication and load instruction | indication by related technology.

次に、本発明の実施の形態について、図1〜図3を参照して詳細に説明する。   Next, an embodiment of the present invention will be described in detail with reference to FIGS.

(第1の実施の形態)
図1は、本発明の第1の実施の形態の構成を示す図であり、図2は、キャッシュ装置12の構成を示す図である。また、図3は、演算装置11の構成を示す図である。
(First embodiment)
FIG. 1 is a diagram showing the configuration of the first exemplary embodiment of the present invention, and FIG. 2 is a diagram showing the configuration of the cache device 12. FIG. 3 is a diagram illustrating the configuration of the arithmetic device 11.

図1を参照すると、本実施の形態は、プログラムコード20、コンパイラ30、及び情報処理装置10を備える。   Referring to FIG. 1, the present embodiment includes a program code 20, a compiler 30, and an information processing apparatus 10.

プログラムコード20は、情報処理装置10の利用者が記述したプログラムのコードある。プログラムコード20は、プリフェッチ命令挿入の指示行(プリフェッチ命令指示行)を含むものとする。   The program code 20 is a program code written by the user of the information processing apparatus 10. It is assumed that the program code 20 includes a prefetch instruction insertion instruction line (prefetch instruction instruction line).

コンパイラ30は、プログラムコード20を情報処理装置10が実行する形式である命令コード301に翻訳して出力する機能を有する。   The compiler 30 has a function of translating and outputting the program code 20 into an instruction code 301 in a format executed by the information processing apparatus 10.

またコンパイラ30は、プリフェッチ命令の指示行を解釈する機能を有する。コンパイラ30は、例えば、C/C++/Fortranのcompiler等を想定している。また、該指示行は、プリフェッチ命令の実行位置を指定するパラメータを備える。   The compiler 30 also has a function of interpreting the instruction line of the prefetch instruction. The compiler 30 is assumed to be, for example, a C / C ++ / Fortran compiler. The instruction line includes a parameter for designating the execution position of the prefetch instruction.

言語翻訳機は、プログラムコード20内のプリフェッチ命令指示行に従い、命令コード301の命令列中に、プリフェッチ命令を挿入する.   The language translator inserts a prefetch instruction into the instruction string of the instruction code 301 in accordance with the prefetch instruction instruction line in the program code 20.

コンパイラ30が翻訳して出力した命令コード301は、主記憶装置13へ格納される。   The instruction code 301 translated and output by the compiler 30 is stored in the main storage device 13.

情報処理装置10は、情報処理や制御を行う演算装置11と、データを一時的に保持するキャッシュ装置12と、データを格納する主記憶装置13とを備える。 The information processing apparatus 10 includes an arithmetic device 11 that performs information processing and control, a cache device 12 that temporarily holds data, and a main storage device 13 that stores data.

演算装置11は、キャッシュ装置12に対し、命令フィッチ100、プリフェッチ命令105、ロード命令107を送出し、また、キャッシュ装置12から、命令コード103、検出信号110、ロードデータ112を受信する。   The arithmetic unit 11 sends an instruction fit 100, a prefetch instruction 105, and a load instruction 107 to the cache unit 12, and receives an instruction code 103, a detection signal 110, and load data 112 from the cache unit 12.

キャッシュ装置12は、上述したように演算装置11と命令及びデータのやりとりをおこない、かつ、主記憶装置に対し、命令フェッチ101、プリフェッチ命令106、ロード命令108を送出し、また、命令コード104、プリフェッチデータ109、ロードデータ111を受信する。   The cache device 12 exchanges instructions and data with the arithmetic unit 11 as described above, sends an instruction fetch 101, a prefetch instruction 106, and a load instruction 108 to the main storage device. Prefetch data 109 and load data 111 are received.

なお、命令フェッチ100と101、命令コード103と104、プリフェッチ命令105と106、ロード命令107と108、ロードデータ111と112は同一のものであり、便宜上符号を分けているものである。   Note that the instruction fetches 100 and 101, the instruction codes 103 and 104, the prefetch instructions 105 and 106, the load instructions 107 and 108, and the load data 111 and 112 are the same, and are separated from each other for convenience.

命令フィッチ100は、命令コード103を要求する命令である。   The instruction fitch 100 is an instruction that requests the instruction code 103.

命令コード103及び104は、コンパイラ30によって出力され、主記憶装置13に格納されたものと同一である。   The instruction codes 103 and 104 are the same as those output by the compiler 30 and stored in the main storage device 13.

プリフェッチ命令105及び106は、データのプリフェッチを要求する命令で、プリフェッチを行うデータのアドレスを含む。   The prefetch instructions 105 and 106 are instructions for requesting prefetching of data and include an address of data to be prefetched.

ロード命令107及び108は、データのロードを要求する命令で、ロードを行うデータのアドレスを含む。   The load instructions 107 and 108 are instructions for requesting data loading, and include addresses of data to be loaded.

プリフェッチデータ109は、プリフェッチ命令106に応じて主記憶装置13から送出されるデータである。   The prefetch data 109 is data sent from the main storage device 13 in response to the prefetch instruction 106.

ロードデータ111は、ロード命令108に応じて主記憶装置13から送出されるデータである。   The load data 111 is data transmitted from the main storage device 13 in response to the load instruction 108.

検出信号110は、後述するカウンタ1010の計数、及びタイマ1014の計測開始及び終了のトリガとなる信号である。   The detection signal 110 is a signal that triggers counting of a counter 1010, which will be described later, and measurement start and end of a timer 1014.

次に、図2を参照すると、まず、プリフェッチ命令105及びロード命令107は、命令アドレス部1003を有し、該命令アドレス部1003のタグ1000、インデックス1001、オフセット1002にまたがって、プリフェッチまたはロードを行うデータのアドレスを格納している。   Next, referring to FIG. 2, first, the prefetch instruction 105 and the load instruction 107 have an instruction address part 1003, and prefetch or load is performed across the tag 1000, the index 1001, and the offset 1002 of the instruction address part 1003. Stores the address of the data to be performed.

キャッシュ装置12は、一時保存するデータをある程度まとまった単位で管理し、これをキャッシュエントリ113と呼ぶ。   The cache device 12 manages temporarily stored data in a certain unit, and this is called a cache entry 113.

キャッシュエントリ113はバリッドフラグ1004、キャッシュフィルフラグ1005、キャッシュタグ部1007、キャッシュデータ部1008から構成される。   The cache entry 113 includes a valid flag 1004, a cache fill flag 1005, a cache tag part 1007, and a cache data part 1008.

バリッドフラグ1004は、プリフェッチが実行中か否かを示すフラグであり、プリフェッチ実行中は値が0となり、プリフェッチが実行中でない場合は値が1となる。   The valid flag 1004 is a flag indicating whether or not prefetch is being executed. The value is 0 during prefetch execution, and the value is 1 when prefetch is not being executed.

キャッシュフィルフラグ1005は、キャッシュフィルが実行中であるか否かを示すフラグであり、キャッシュフィル実行中は値が1となり、キャッシュフィル実行中でない場合は値が0となる。なお、キャッシュフィルとは、主記憶装置13のデータをキャッシュ装置12へ読み込むことをいう。 The cache fill flag 1005 is a flag indicating whether or not the cache fill is being executed. The value is 1 while the cache fill is being executed, and the value is 0 when the cache fill is not being executed. Note that “cache fill” means reading data in the main storage device 13 into the cache device 12.

キャッシュタグ部は、キャッシュエントリ113のアドレスを格納する。   The cache tag part stores the address of the cache entry 113.

キャッシュデータ部1008は、キャッシュエントリ113にキャッシュフィルされたデータを格納する。   The cache data unit 1008 stores the cache-filled data in the cache entry 113.

また、キャッシュ装置12は、プリフェッチ命令105によりキャッシュフィルの実行中であるキャッシュエントリ113を、後続のロード命令107が参照する条件を検出する検出信号生成部1006を含む。 In addition, the cache device 12 includes a detection signal generation unit 1006 that detects a condition in which the subsequent load instruction 107 refers to the cache entry 113 that is being cache-filled by the prefetch instruction 105.

検出信号生成部1006は、AND回路の機能を有し、後述するバリッドフラグ1004のフラグ値の論理否定と、キャッシュフィルフラグ1005のフラグ値と、キャッシュヒット又はキャッシュミスの論理値を入力する。なお、キャッシュヒットは論理値1、キャッシュミスは論理値0とする。   The detection signal generation unit 1006 has an AND circuit function, and inputs a logical negation of a flag value of a valid flag 1004 (to be described later), a flag value of a cache fill flag 1005, and a logical value of a cache hit or a cache miss. Note that a cache hit has a logical value 1 and a cache miss has a logical value 0.

検出信号生成部1006は、バリッドフラグ1004のフラグ値の論理否定と、キャッシュフィルフラグ1005のフラグ値と、キャッシュヒットの場合の論理値、入力する値がすべて1の時、値1の検出信号110を出力し、それ以外の場合は、値0の検出信号110を出力する。   The detection signal generation unit 1006 detects the logical value of the flag value of the valid flag 1004, the flag value of the cache fill flag 1005, the logical value in the case of a cache hit, and the detection signal 110 of value 1 when all the input values are 1. Otherwise, a detection signal 110 with a value of 0 is output.

次に、図3を参照すると、演算装置11は、微分回路1011と、セレクタ1012と、微分回路有効モード1013と、カウンタ1010と、タイマ1014を備える。   Next, referring to FIG. 3, the arithmetic unit 11 includes a differentiating circuit 1011, a selector 1012, a differentiating circuit valid mode 1013, a counter 1010, and a timer 1014.

微分回路1011は、出力信号が入力信号の導関数になるように設計した回路である。   The differentiation circuit 1011 is a circuit designed so that the output signal is a derivative of the input signal.

微分回路1011は、キャッシュ装置12から検出信号110を入力し、入力した検出信号110の微分形の信号である微分回路出力信号114を出力する。   The differentiation circuit 1011 receives the detection signal 110 from the cache device 12 and outputs a differentiation circuit output signal 114 that is a differential signal of the input detection signal 110.

なお、微分回路1011は、キャッシュ装置12内の検出信号生成部1006と、演算装置11の間に備えられればよい。   Note that the differentiating circuit 1011 may be provided between the detection signal generation unit 1006 in the cache device 12 and the arithmetic device 11.

すなわち、本実施の形態では、微分回路1011は、演算装置11内に備えられていが、これに制限されるものではなく、キャッシュ装置12内に備えたり、また、キャッシュ装置11と演算装置の間に別途装置を設け、該装置に備えたりする構成とすることも可能である。 That is, in the present embodiment, the differentiating circuit 1011 is provided in the arithmetic device 11, but is not limited to this, and is provided in the cache device 12 or between the cache device 11 and the arithmetic device. It is also possible to provide a separate device for the device.

また、微分回路1011を用いずに検出信号生成部1006において微分回路出力信号114と同等のパルス信号を生成する実装や、微分回路1011及びカウンタ1010を用いずに、タイマ1014で時間のみを計測する実装も可能である。すなわち、本実施の形態は、本発明の実装形態を限定するものでもない。   In addition, the detection signal generation unit 1006 does not use the differentiation circuit 1011 to generate a pulse signal equivalent to the differentiation circuit output signal 114, and the timer 1014 measures only the time without using the differentiation circuit 1011 and the counter 1010. Implementation is also possible. That is, this embodiment does not limit the mounting form of the present invention.

微分回路有効モード1013は、セレクタ1012が出力する信号を決めるモードである。   The differentiation circuit effective mode 1013 is a mode for determining a signal output from the selector 1012.

セレクタ1012は、複数の入力信号の一つだけを出力する回路である。   The selector 1012 is a circuit that outputs only one of a plurality of input signals.

セレクタ1012は、キャッシュ装置12から検出信号110を入力し、また、微分回路1011から微分回路出力信号114を入力する。   The selector 1012 receives the detection signal 110 from the cache device 12 and the differentiation circuit output signal 114 from the differentiation circuit 1011.

また、セレクタ1012は、検出信号110と微分回路出力信号114のいずれかを、微分回路有効モード1013に従ってカウンタ1010又はタイマ1014へ出力する。   The selector 1012 outputs either the detection signal 110 or the differentiation circuit output signal 114 to the counter 1010 or the timer 1014 according to the differentiation circuit valid mode 1013.

微分回路有効モード1013は、何を計測したいかによって任意に設定可能である。本実施の形態においては、検出信号が0から1に変化した回数を計数したい場合、微分回路有効モード1013のモードをモード1に設定する。検出信号110が0から1に変化した回数とは、すなわち、プリフェッチ命令105によるキャッシュフィル中のキャッシュエントリ113を後続のロード命令107が参照した回数をいう。   The differentiation circuit effective mode 1013 can be arbitrarily set depending on what is desired to be measured. In the present embodiment, when it is desired to count the number of times the detection signal has changed from 0 to 1, the mode of the differentiation circuit effective mode 1013 is set to mode 1. The number of times the detection signal 110 has changed from 0 to 1 refers to the number of times the subsequent load instruction 107 refers to the cache entry 113 in the cache fill by the prefetch instruction 105.

また、検出信号110が1である時間を計測したい場合、微分回路有効モード1013のモードをモード0に設定する。検出信号110が1である時間とは、すなわち、プリフェッチ命令105によるキャッシュフィルによって後続のロード命令107が待機した時間をいう。   Further, when it is desired to measure the time during which the detection signal 110 is 1, the mode of the differentiation circuit effective mode 1013 is set to mode 0. The time when the detection signal 110 is 1 means the time when the subsequent load instruction 107 waits due to the cache fill by the prefetch instruction 105.

具体的には、セレクタ1012は、微分回路有効モード1013のモードがモード1の場合、微分回路出力信号114をカウンタ1010へ出力し、微分回路有効モード1013のモードがモード0の場合、検出信号110をタイマ1014へ出力する。   Specifically, the selector 1012 outputs the differentiation circuit output signal 114 to the counter 1010 when the mode of the differentiation circuit valid mode 1013 is mode 1, and the detection signal 110 when the mode of the differentiation circuit valid mode 1013 is mode 0. Is output to the timer 1014.

カウンタ1010は、計数を行う機能を有し、値1の微分回路出力信号114を入力したとき、+1カウントアップする。   The counter 1010 has a function of counting, and when the value 1 differentiating circuit output signal 114 is input, the counter 1010 increments by one.

タイマ1014は、時間を計測する機能を有し、値1の検出信号110を入力したときに時間計測を開始し、値0の検出信号110を入力したときに時間計測を終了する。   The timer 1014 has a function of measuring time, starts time measurement when a detection signal 110 having a value 1 is input, and ends time measurement when a detection signal 110 having a value 0 is input.

なお、演算装置11は、ロード命令107と、別のロード命令107bとの間のアウトオブオーダー実行条件と、プリフェッチ命令105と、ロード命令107との間のアウトオブオーダー実行条件を等しくする機能を有する。   The arithmetic unit 11 has a function of making the out-of-order execution condition between the load instruction 107 and another load instruction 107b equal to the out-of-order execution condition between the prefetch instruction 105 and the load instruction 107. Have.

また、演算装置11は、プリフェッチ命令105が、主記憶装置13のリソース不足により実行されない先行のロード命令107cを、パイプライン中で追い越さない構成を備える。   The arithmetic unit 11 has a configuration in which the prefetch instruction 105 does not overtake the preceding load instruction 107c that is not executed due to a shortage of resources in the main storage device 13 in the pipeline.

上述したアウトオブオーダー実行条件及びパイプライン中で追い越さない構成については、本発明の技術分野における当業者にとってよく知られており、方式そのものは本発明とは直接的には関係しないため、その詳細については省略する。   The above-described out-of-order execution conditions and the configuration that does not overtake in the pipeline are well known to those skilled in the art of the present invention, and the details of the method are not directly related to the present invention. Is omitted.

また、本実施の形態は、上述のパイプライン中で追い越さない構成については、好適には備えることが望ましいが、仮に備えていない場合でも、本発明の性質を損なうことはない。   In addition, the present embodiment preferably includes a configuration that does not pass in the above-described pipeline, but even if it is not provided, the characteristics of the present invention are not impaired.

また、演算装置11において図示していない命令発行制御部分、レジスタ部等は、本発明の主張するところではなく、かつ当業者であれば設計可能であるため、本発明においては説明を省略する。   In addition, the instruction issue control part, the register part, and the like which are not illustrated in the arithmetic unit 11 are not claimed by the present invention, and can be designed by those skilled in the art, and thus description thereof is omitted in the present invention.

また、カウンタ1010、タイマ1014は、命令発行制御部分、レジスタ部と入出力を持つが、本発明の主張するところではなく、かつ当業者であれば容易に設計可能であるため、本発明においては説明を省略する。   The counter 1010 and the timer 1014 have an instruction issue control part, a register part and an input / output, but are not claimed by the present invention and can be easily designed by those skilled in the art. Description is omitted.

(第1の実施の形態の動作の説明)
次に、本実施の形態の動作について、図面を参照して詳細に説明する。
(Description of the operation of the first embodiment)
Next, the operation of the present embodiment will be described in detail with reference to the drawings.

(キャッシュ検索の動作の説明)
まず、本実施の形態によるキャッシュ検索の動作を、図2、及び図4に示すフローチャートを参照して説明する。
(Description of cache search operation)
First, the cache search operation according to the present embodiment will be described with reference to the flowcharts shown in FIGS.

キャッシュ装置12は、プリフェッチ命令105又はロード命令107を受信すると(ステップS401)、命令アドレス部60のインデックス1001と、オフセット1002を合わせた検索アドレスを作成する(ステップS402)。   When the cache device 12 receives the prefetch instruction 105 or the load instruction 107 (step S401), it creates a search address that combines the index 1001 of the instruction address section 60 and the offset 1002 (step S402).

次いで、キャッシュ装置12は、検索アドレスをキーに、キャッシュ検索を行う(ステップS403)。   Next, the cache device 12 performs a cache search using the search address as a key (step S403).

キャッシュ検索の結果、該当するキャッシュエントリ113が存在した場合(ステップS404”YES”)、命令アドレス部60のタグ1000と、キャッシュエントリ113のキャッシュタグ部1007に含まれる、タグ1000に対応した位置のアドレスを比較する(ステップS405)。以後、この動作をタグ比較と呼ぶ。   As a result of the cache search, if the corresponding cache entry 113 exists (step S404 “YES”), the tag 1000 in the instruction address portion 60 and the cache tag portion 1007 in the cache entry 113 are located at positions corresponding to the tag 1000. The addresses are compared (step S405). Hereinafter, this operation is referred to as tag comparison.

タグ比較の結果、タグが一致した場合(ステップS406”YES”)は、キャッシュヒットとなる(ステップS407)。 As a result of the tag comparison, if the tags match (step S406 “YES”), a cache hit occurs (step S407).

キャッシュ検索の結果、該当するキャッシュエントリ113が存在しなかった場合(ステップS404”NO”)、または、検索アドレス検索の結果、該当するキャッシュエントリ113が存在したが、タグ比較で一致しなかった場合(ステップS404”YES”、ステップS406”NO”)は、キャッシュミスとなる(ステップS408)。   If the corresponding cache entry 113 does not exist as a result of the cache search (step S404 “NO”), or if the corresponding cache entry 113 exists as a result of the search address search, but does not match in the tag comparison (Step S404 “YES”, Step S406 “NO”) results in a cache miss (Step S408).

(プリフェッチ命令発行時の動作の説明)
次に、命令フィッチ100の送出からプリフェッチ命令106送出までの動作を、図5に示すフローチャートを参照して説明する。なお、命令コード301は、既に主記憶装置13へ格納されているものとする。
(Description of operation when prefetch instruction is issued)
Next, operations from sending the instruction fit 100 to sending the prefetch instruction 106 will be described with reference to the flowchart shown in FIG. It is assumed that the instruction code 301 is already stored in the main storage device 13.

まず、演算装置11は、命令フェッチ100をキャッシュ装置12へ送出する(ステップS501)。   First, the arithmetic unit 11 sends the instruction fetch 100 to the cache unit 12 (step S501).

キャッシュ装置12は、命令フェッチ100を受信すると、命令フェッチ101を主記憶装置13へ送出する(ステップS502)。   When the cache device 12 receives the instruction fetch 100, the cache device 12 sends the instruction fetch 101 to the main storage device 13 (step S502).

主記憶装置13は、命令フェッチ101を受信すると、命令コード103を、キャッシュ装置12へ送出する(ステップS503)。   When the main storage device 13 receives the instruction fetch 101, it sends the instruction code 103 to the cache device 12 (step S503).

キャッシュ装置12は、命令コード103を受信すると、命令コード104を、演算装置11へ送出する(ステップS504)。   When the cache device 12 receives the instruction code 103, the cache device 12 sends the instruction code 104 to the arithmetic device 11 (step S504).

演算装置11は、命令コード104を受信すると、該命令コード104の実行を開始する。演算装置11は、命令コード104の命令列を順番に実行していく。   When the arithmetic unit 11 receives the instruction code 104, the arithmetic unit 11 starts executing the instruction code 104. The arithmetic unit 11 executes the instruction sequence of the instruction code 104 in order.

演算装置11は、命令コード104の実行ラインがプリフェッチ命令であった場合、キャッシュ装置12に対し、プリフェッチ命令105を送出する(ステップS505)。   If the execution line of the instruction code 104 is a prefetch instruction, the arithmetic unit 11 sends the prefetch instruction 105 to the cache device 12 (step S505).

キャッシュ装置12は、プリフェッチ命令105を受信すると、キャッシュ検索を行う。キャッシュ検索の結果、キャッシュヒットした場合(ステップS506”YES”)、キャッシュ装置12は、バリッドフラグ1004を確認する(ステップS509)。   When the cache device 12 receives the prefetch instruction 105, it performs a cache search. If the cache search results in a cache hit (step S506 “YES”), the cache device 12 checks the valid flag 1004 (step S509).

バリッドフラグ1004の値が0であった場合(ステップS509”0”)、すなわち、キャッシュヒットしたキャッシュエントリ113がプリフェッチ実行中の場合は、キャッシュフィルが完了していない旨を示すため、キャッシュフィルフラグ1005に1を設定し(ステップS510)、次いで、プリフェッチ命令105を無効化する(ステップS511)。   If the value of the valid flag 1004 is 0 (step S509 “0”), that is, if the cache entry 113 having a cache hit is being prefetched, the cache fill flag indicates that the cache fill has not been completed. 1 is set to 1005 (step S510), and then the prefetch instruction 105 is invalidated (step S511).

バリッドフラグ1004の値が1であった場合(ステップS509”1”)、すなわち、キャッシュヒットしたキャッシュエントリ113がプリフェッチ実行中ではない場合は、プリフェッチ命令105で要求したデータはすでにキャッシュエントリ113にあるため、キャッシュ装置12は、プリフェッチ命令105を無効化する(ステップS511)。   If the value of the valid flag 1004 is 1 (step S509 “1”), that is, if the cache entry 113 having a cache hit is not being prefetched, the data requested by the prefetch instruction 105 is already in the cache entry 113. Therefore, the cache device 12 invalidates the prefetch instruction 105 (step S511).

また、キャッシュ検索の結果、キャッシュミスした場合(ステップS506”NO”)、キャッシュ装置12は、プリフェッチ命令106を、主記憶装置13へ送出する(ステップS508)。   If the cache search results in a cache miss ("NO" in step S506), the cache device 12 sends the prefetch instruction 106 to the main storage device 13 (step S508).

本発明は、プリフェッチ命令105によってキャッシュフィル中のキャッシュエントリを、後続のロード命令107が参照する回数、及び該キャッシュフィルが完了するまでロード命令107が待機する時間を計測するものであるため、以後、上述のプリフェッチ命令の動作において、キャッシュミスによりプリフェッチ命令106を主記憶装置13へ送出し(ステップS508)、その後、プリフェッチ命令106によるキャッシュフィルが完了する前に、ロード命令107が発行された場合について、説明する。   Since the present invention measures the number of times the subsequent load instruction 107 refers to the cache entry in the cache fill by the prefetch instruction 105 and the time that the load instruction 107 waits until the cache fill is completed. In the operation of the prefetch instruction described above, the prefetch instruction 106 is sent to the main storage device 13 due to a cache miss (step S508), and then the load instruction 107 is issued before the cache fill by the prefetch instruction 106 is completed. Will be described.

(キャッシュフィル中におけるロード命令発行時の動作の説明)
次いで、上述したプリフェッチ命令の動作の説明において、キャッシュミスによりプリフェッチ命令106を主記憶装置13へ送出した(ステップS508)後、プリフェッチ命令106によるキャッシュフィルが完了する前に、ロード命令107が送出された場合の動作を、図6に示すフローチャートを用いて説明する。
(Explanation of operation when load instruction is issued during cache fill)
Next, in the description of the operation of the prefetch instruction described above, after the prefetch instruction 106 is sent to the main storage device 13 due to a cache miss (step S508), the load instruction 107 is sent before the cache fill by the prefetch instruction 106 is completed. The operation in this case will be described with reference to the flowchart shown in FIG.

なお、前提として、上述した図5のステップS507に示すように、バリッドフラグ1004は0であり、キャッシュフィルフラグ1005は1である。また、プリフェッチ命令105とロード命令107が示すアドレスは同じものである。 As a premise, the valid flag 1004 is 0 and the cache fill flag 1005 is 1 as shown in step S507 of FIG. The addresses indicated by the prefetch instruction 105 and the load instruction 107 are the same.

演算装置11は、命令コード103の実行ラインがロード命令であった場合、キャッシュ装置12に対し、ロード命令107を送出する(ステップS601)。   If the execution line of the instruction code 103 is a load instruction, the arithmetic unit 11 sends the load instruction 107 to the cache device 12 (step S601).

キャッシュ装置12は、ロード命令107を受信すると、キャッシュ検索を行う。   When the cache device 12 receives the load instruction 107, it performs a cache search.

キャッシュ検索の結果、キャッシュミスした場合(ステップS602”NO”)、キャッシュ装置12は、ロード命令108を主記憶装置13へ送出する(ステップS603)。この場合は本発明の主張するところではなく、また、本発明の技術分野における当業者には該動作を容易に類推できるものであるため、説明を省略する。   If the cache search results in a cache miss (step S602 “NO”), the cache device 12 sends the load instruction 108 to the main storage device 13 (step S603). In this case, the present invention is not claimed, and those skilled in the technical field of the present invention can easily analogize the operation.

キャッシュ検索の結果、キャッシュヒットした場合(ステップS602”YES”)、キャッシュ装置12は、バリッドフラグ1004を確認する(ステップS604)。   As a result of the cache search, if a cache hit occurs (step S602 “YES”), the cache device 12 checks the valid flag 1004 (step S604).

バリッドフラグ1004の値が1であった場合(ステップS604”1”)、すなわち、ロード命令107で指定された該当キャッシュエントリ113がキャッシュヒットし、かつ、プリフェッチが行われていない場合は、ロード命令107で要求したデータはすでにキャッシュエントリ113にあるため、キャッシュ装置12は、該キャッシュエントリ113を、ロードデータ112として演算装置11へ送出する(ステップS605)。   If the value of the valid flag 1004 is 1 (step S604 “1”), that is, if the corresponding cache entry 113 specified by the load instruction 107 has a cache hit and no prefetch is performed, the load instruction Since the data requested in 107 is already in the cache entry 113, the cache device 12 sends the cache entry 113 to the arithmetic device 11 as the load data 112 (step S605).

バリッドフラグ1004の値が0であった場合(ステップS604”0”)、すなわち、ロード命令107で指定された該当キャッシュエントリ113はキャッシュヒットしたが、プリフェッチ実行中の場合は、キャッシュ装置12は、キャッシュフィルフラグ1005を参照し、該キャッシュエントリ113がキャッシュフィルの最中であるか否かを確認する。   If the value of the valid flag 1004 is 0 (step S604 “0”), that is, the corresponding cache entry 113 specified by the load instruction 107 has a cache hit, but the prefetch is being executed, the cache device 12 With reference to the cache fill flag 1005, it is confirmed whether or not the cache entry 113 is in the middle of the cache fill.

そして、キャッシュフィルフラグ1005が1の場合(ステップS606”1”)、すなわち、該キャッシュエントリ113がキャッシュフィルの最中である場合、検出信号生成部1006は、検出信号110に1を設定し(ステップS607)、該検出信号110を演算装置11へ送出する(ステップS608)。そして、キャッシュ装置12は、ロード命令107を待機させ、プリフェッチデータ109の到着を待つ(ステップS610)。   When the cache fill flag 1005 is 1 (step S606 “1”), that is, when the cache entry 113 is in the middle of the cache fill, the detection signal generation unit 1006 sets 1 to the detection signal 110 ( In step S607), the detection signal 110 is sent to the arithmetic unit 11 (step S608). Then, the cache device 12 waits for the load instruction 107 and waits for the arrival of the prefetch data 109 (step S610).

次いで、キャッシュ装置12は、主記憶装置13からプリフェッチデータ109を受信すると(ステップS609、ステップS610”YES”)、該プリフェッチデータ109をキャッシュエントリ113へキャッシュフィルし、バリッドフラグ1004に1を設定する(ステップS611)。   Next, when the cache device 12 receives the prefetch data 109 from the main storage device 13 (step S609, step S610 “YES”), the cache device 12 cache-fills the prefetch data 109 to the cache entry 113 and sets 1 to the valid flag 1004. (Step S611).

また、キャッシュ装置12は、キャッシュフィルフラグ1005に0を設定する(ステップS612)。   Further, the cache device 12 sets 0 to the cache fill flag 1005 (step S612).

また、検出信号生成部1006は、検出信号110に0を設定し(ステップS613)、該検出信号110を、演算装置11へ送出する(ステップS614)。   The detection signal generation unit 1006 sets 0 to the detection signal 110 (step S613), and sends the detection signal 110 to the arithmetic device 11 (step S614).

そして、キャッシュ装置12は、キャッシュエントリ113のデータを、ロードデータ112として、演算装置51へ送出する(ステップS615)。   Then, the cache device 12 sends the data in the cache entry 113 to the arithmetic device 51 as the load data 112 (step S615).

なお、ステップS609でロードデータ111を受信する場合も考えられるが、その場合の動作は本発明の主張するところではなく、また、本発明の技術分野における当業者には該動作を容易に類推できるものであるため、説明を省略する。   Note that although it is conceivable that the load data 111 is received in step S609, the operation in that case is not claimed by the present invention, and those skilled in the art of the present invention can easily analogize the operation. Since it is a thing, description is abbreviate | omitted.

(検出信号受信時の演算装置の動作の説明)
次に、検出信号110受信時の演算装置11の動作について、図7に示すフローチャートを参照して説明する。
(Explanation of operation of arithmetic unit at detection signal reception)
Next, the operation of the arithmetic unit 11 when receiving the detection signal 110 will be described with reference to the flowchart shown in FIG.

まず、演算装置11は、上述した図6のステップS608及びステップS614でキャッシュ装置12から送出された検出信号110を受信すると(ステップS701)、該検出信号110を、微分回路1011と、セレクタ1012へ入力する(ステップS702)。   First, when the arithmetic device 11 receives the detection signal 110 sent from the cache device 12 in step S608 and step S614 of FIG. 6 (step S701), the arithmetic device 11 sends the detection signal 110 to the differentiation circuit 1011 and the selector 1012. Input (step S702).

微分回路1011は、検出信号110を入力すると、入力した検出信号110の微分形の信号である微分回路出力信号114をセレクタ1012へ出力する(ステップS703)。   When the detection signal 110 is input, the differentiation circuit 1011 outputs a differentiation circuit output signal 114 that is a differential signal of the input detection signal 110 to the selector 1012 (step S703).

次いで、セレクタ1012は、演算装置11から入力した検出信号110と、微分回路1011から入力した微分回路出力信号114のどちらか一方を、微分回路有効モード1013に従い出力する(ステップS704)。   Next, the selector 1012 outputs either the detection signal 110 input from the arithmetic unit 11 or the differentiation circuit output signal 114 input from the differentiation circuit 1011 according to the differentiation circuit valid mode 1013 (step S704).

微分回路有効モード1013がモード1の場合(ステップS704”モード1”)、セレクタ1012は、微分回路出力信号114を、カウンタ1010へ出力する(ステップS705)。   When the differentiation circuit valid mode 1013 is mode 1 (step S704 “mode 1”), the selector 1012 outputs the differentiation circuit output signal 114 to the counter 1010 (step S705).

次いで、カウンタ1010は、入力した微分回路出力信号114の値を確認する(ステップS706)。   Next, the counter 1010 confirms the value of the input differentiation circuit output signal 114 (step S706).

該微分回路出力信号114の値が1の場合(ステップS706”1”)、カウンタ1010は自己のカウンタを+1カウントアップする。(ステップS709)。   When the value of the differentiation circuit output signal 114 is 1 (step S706 "1"), the counter 1010 increments its counter by +1. (Step S709).

微分回路有効モード1013がモード0の場合(ステップS704”モード0”)、セレクタ1012は、検出信号110を、タイマ1014へ出力する(ステップS708)。   When the differentiation circuit valid mode 1013 is mode 0 (step S704 "mode 0"), the selector 1012 outputs the detection signal 110 to the timer 1014 (step S708).

次いで、タイマ1014は、入力した検出信号110の値を確認する(ステップS709)。   Next, the timer 1014 confirms the value of the input detection signal 110 (step S709).

タイマ1014は、検出信号110の値が1の場合(ステップS709”1”)、時間計測を開始する(ステップS710)。   When the value of the detection signal 110 is 1 (step S709 “1”), the timer 1014 starts time measurement (step S710).

また、タイマ1014は、検出信号110の値が0の場合(ステップS709”0”)、時間計測を終了する(ステップS711)。   When the value of the detection signal 110 is 0 (step S709 “0”), the timer 1014 ends the time measurement (step S711).

なお、カウンタ1010及びタイマ1014の値は、演算装置11により、外部へ提供される。提供するタイミングは、自由に設定可能であるが、好適には、命令コード103の実行が終了した時点で提供され、また、提供時にカウンタ1010及びタイマ1014の値はリセットされることが望ましい。   Note that the values of the counter 1010 and the timer 1014 are provided to the outside by the arithmetic unit 11. The timing to provide can be freely set, but is preferably provided when the execution of the instruction code 103 is completed, and the values of the counter 1010 and the timer 1014 are preferably reset at the time of provision.

(第1の実施の形態による効果)
次に本実施の形態の効果について説明する。
(Effects of the first embodiment)
Next, the effect of this embodiment will be described.

本実施の形態によれば、先行するプリフェッチ命令に基づくキャッシュフィルの実行中によりロード命令に遅延が発生する回数及び遅延時間を、プログラムを作成するユーザに提供することができる。   According to the present embodiment, it is possible to provide a user who creates a program with the number of times that the load instruction is delayed during execution of the cache fill based on the preceding prefetch instruction and the delay time.

その理由は、先行するプリフェッチ命令に基づくキャッシュフィル実行中のキャッシュエントリをロード命令が参照した回数をカウンタ1010で計数し、該参照した時から、該キャッシュフィルが終了するまでの時間、すなわち、ロード命令がプリフェッチ命令に基づくキャッシュフィルの実行により待機した時間を、タイマ1014で計測するからである。   The reason is that the counter 1010 counts the number of times that the load instruction refers to the cache entry during cache fill execution based on the preceding prefetch instruction, and the time from the reference to the end of the cache fill, that is, load This is because the timer 1014 measures the time that the instruction waits for execution of the cache fill based on the prefetch instruction.

プログラムを作成するユーザは、カウンタ1010及びタイマ1014の参照回数及び待機時間を参照し、プリフェッチ命令の挿入位置が適切かを判断し、プリフェッチ命令が実行されるタイミングを修正することができる。   The user who creates the program can refer to the reference count and the waiting time of the counter 1010 and the timer 1014, determine whether the insertion position of the prefetch instruction is appropriate, and correct the timing at which the prefetch instruction is executed.

具体的には、カウンタ1010及びタイマ1014の値が大きい場合、プログラムを作成するユーザは、コンパイラ30がプリフェッチ命令を命令コード104中のより早い位置に挿入するように、プリフェッチ命令を実行する位置を修正し、情報処理装置10の実行性能を向上させることができる。   Specifically, when the values of the counter 1010 and the timer 1014 are large, the user who creates the program sets the position at which the prefetch instruction is executed so that the compiler 30 inserts the prefetch instruction at an earlier position in the instruction code 104. The execution performance of the information processing apparatus 10 can be improved by correcting the information.

次に、本発明のコンピュータシステム10のハードウェア構成例について、図8を参照して説明する。図8は、コンピュータシステム10のハードウェア構成例を示すブロック図である。   Next, a hardware configuration example of the computer system 10 of the present invention will be described with reference to FIG. FIG. 8 is a block diagram illustrating a hardware configuration example of the computer system 10.

図8を参照すると、コンピュータシステム10は、一般的なコンピュータ装置と同様のハードウェア構成であり、CPU(Central Processing Unit)801、RAM(Random Access Memory)等のメモリからなる、データの作業領域やデータの一時退避領域に用いられる主記憶部802、ネットワークを介してデータの送受信を行う通信部803、入力装置805や出力装置806及び記憶装置807と接続してデータの送受信を行う入出力インタフェース部804、上記各構成要素を相互に接続するシステムバス808を備えている。記憶装置807は、例えば、ROM(Read Only Memory)、磁気ディスク、半導体メモリ等の不揮発性メモリから構成されるハードディスク装置等で実現される。   Referring to FIG. 8, a computer system 10 has a hardware configuration similar to that of a general computer device, and includes a data work area including memories such as a CPU (Central Processing Unit) 801 and a RAM (Random Access Memory). A main storage unit 802 used for a temporary data saving area, a communication unit 803 that transmits / receives data via a network, and an input / output interface unit that transmits / receives data by connecting to the input device 805, the output device 806, and the storage device 807 804, a system bus 808 for connecting the above-described components to each other is provided. The storage device 807 is realized by, for example, a hard disk device including a non-volatile memory such as a ROM (Read Only Memory), a magnetic disk, and a semiconductor memory.

本発明のコンピュータシステム10の情報処理装置100、コンパイル処理装置20は、プログラムを組み込んだ、LSI(Large Scale Integration)等のハードウェア部品である回路部品を実装することにより、その動作をハードウェア的に実現することは勿論として、その機能を提供するプログラムを、記憶装置807に格納し、そのプログラムを主記憶部802にロードしてCPU801で実行することにより、ソフトウェア的に実現することも可能である。   The information processing apparatus 100 and the compile processing apparatus 20 of the computer system 10 of the present invention are mounted on a circuit component, which is a hardware component such as an LSI (Large Scale Integration), in which a program is incorporated. As a matter of course, it is also possible to realize a software program by storing a program providing the function in the storage device 807, loading the program into the main storage unit 802, and executing it by the CPU 801. is there.

以上好ましい実施の形態をあげて本発明を説明したが、本発明は必ずしも、上記実施の形態に限定されるものでなく、その技術的思想の範囲内において様々に変形して実施することができる。   Although the present invention has been described with reference to the preferred embodiments, the present invention is not necessarily limited to the above embodiments, and various modifications can be made within the scope of the technical idea. .

1:コンピュータシステム
10:情報処理装置
11:演算装置
12:キャッシュ装置
13:主記憶装置
100、101:命令フィッチ
103、104、301:命令コード
105、106:プリフェッチ命令
107、107b、107c、108:ロード命令
109:プリフェッチデータ
110:検出信号
111、112:ロードデータ
113:キャッシュエントリ
114:微分回路出力信号
1000:タグ
1001:インデックス
1002:オフセット
1003:命令アドレス
1004:バリッドフラグ
1005:キャッシュフィルフラグ
1006:検出信号生成部
1007:キャッシュタグ部
1008:キャッシュデータ部
1010:カウンタ
1011:微分回路
1012:セレクタ
1013:微分回路有効モード
1014:タイマ
20:プログラムコード
30:コンパイラ
1: Computer system 10: Information processing device 11: Arithmetic device 12: Cache device 13: Main storage device 100, 101: Instruction fits 103, 104, 301: Instruction code 105, 106: Prefetch instructions 107, 107b, 107c, 108: Load instruction 109: Prefetch data 110: Detection signal 111, 112: Load data 113: Cache entry 114: Differentiation circuit output signal 1000: Tag 1001: Index 1002: Offset 1003: Instruction address 1004: Valid flag 1005: Cache fill flag 1006: Detection signal generation unit 1007: Cache tag unit 1008: Cache data unit 1010: Counter 1011: Differentiation circuit 1012: Selector 1013: Differentiation circuit valid mode 1 14: timer 20: program code 30: compiler

Claims (15)

演算装置と主記憶装置とキャッシュ装置を含む情報処理装置であって、
前記演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記キャッシュ装置に対するロード命令を検出し、検出した前記ロード命令の発生回数又は継続時間を取得する機能を有することを特徴する情報処理装置。
An information processing apparatus including an arithmetic device, a main storage device, and a cache device,
Information processing having a function of detecting a load instruction for the cache apparatus that has been delayed due to execution of a cache fill by a prefetch instruction from the arithmetic unit and acquiring the number of occurrences or duration of the detected load instruction apparatus.
前記キャッシュ装置が、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令を検出する遅延検出手段を備え、
前記演算装置が、前記遅延検出手段で検出したプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令の発生回数をカウントするカウンタを備えることを特徴とする請求項1に記載の情報処理装置。
The cache device includes a delay detection unit that detects the load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction,
2. The information processing apparatus according to claim 1, wherein the arithmetic unit includes a counter that counts the number of occurrences of the load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction detected by the delay detection unit. .
前記キャッシュ装置の前記遅延検出手段が、
キャッシュヒットした前記ロード命令が、プリフェッチ命令によるキャッシュフィル実行中のエントリを参照した場合に、当該ロード命令を、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生したロード命令として検出し、前記演算装置のカウント手段に検出信号を出力することを特徴とする請求項2に記載の情報処理装置。
The delay detection means of the cache device,
When the load instruction having a cache hit refers to an entry that is being cache-filled by a prefetch instruction, the load instruction is detected as a load instruction that is delayed due to a cache-fill execution by a prefetch instruction. The information processing apparatus according to claim 2, wherein a detection signal is output to the counting means.
前記キャッシュ装置の各エントリに、前記各エントリがキャッシュフィル実行中であるかどうかを示すフラグと、前記各エントリがプリフェッチ実行中であるかどうかを示すフラグを設け、
前記遅延検出手段は、キャッシュフィル実行中であるかどうかを示す前記フラグと、前記プリフェッチ実行中であるかどうかを示す前記フラグに基づいて前記ロード命令がプリフェッチ命令によるキャッシュフィル実行中のエントリを参照したかどうかを検出することを特徴とする請求項3に記載の情報処理装置。
Each entry of the cache device is provided with a flag indicating whether each entry is executing cache fill and a flag indicating whether each entry is executing prefetch,
The delay detecting means refers to the entry indicating that the load instruction is executing the cache fill by the prefetch instruction based on the flag indicating whether the cache fill is being executed and the flag indicating whether the prefetch is being executed. The information processing apparatus according to claim 3, wherein the information processing apparatus detects whether it has been performed.
前記演算装置が、前記キャッシュ装置の遅延検出手段からの検出信号の継続時間を計時するタイマと、
前記遅延検出手段からの検出信号を、設定モードに基づいて、前記カウンタ又は前記タイマに選択的に出力するセレクタを備えることを特徴とする請求項1から請求項4の何れかに記載の情報処理装置。
A timer for measuring a duration of a detection signal from a delay detection unit of the cache device;
5. The information processing according to claim 1, further comprising a selector that selectively outputs a detection signal from the delay detection unit to the counter or the timer based on a setting mode. apparatus.
演算装置と主記憶装置とキャッシュ装置を含む情報処理装置におけるロード命令の遅延判定方法であって、
前記演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記キャッシュ装置に対するロード命令を検出するステップと、
検出したロード命令の発生回数又は継続時間を取得するステップと
を有することを特徴するロード命令の遅延判定方法。
A load instruction delay determination method in an information processing device including an arithmetic device, a main storage device, and a cache device,
Detecting a load instruction for the cache device in which a delay has occurred during execution of a cache fill by a prefetch instruction from the arithmetic device;
A method for determining a delay of a load instruction, comprising: obtaining the number of occurrences or duration of the detected load instruction.
前記キャッシュ装置によって、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令を検出する遅延検出ステップと、
前記演算装置によって、前記遅延検出ステップで検出したプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令の発生回数をカウントするステップとを有することを特徴とする請求項6に記載のロード命令の遅延判定方法。
A delay detecting step of detecting the load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction by the cache device;
7. The load instruction according to claim 6, further comprising a step of counting the number of occurrences of the load instruction in which a delay has occurred during execution of a cache fill by the prefetch instruction detected in the delay detection step by the arithmetic unit. Delay judgment method.
前記遅延検出ステップで、
キャッシュヒットした前記ロード命令が、プリフェッチ命令によるキャッシュフィル実行中のエントリを参照した場合に、当該ロード命令を、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生したロード命令として検出し、前記演算装置に検出信号を出力することを特徴とする請求項7に記載のロード命令の遅延判定方法。
In the delay detection step,
When the load instruction having a cache hit refers to an entry in which a cache fill is being executed by a prefetch instruction, the load instruction is detected as a load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction, and 8. The load instruction delay determination method according to claim 7, wherein a detection signal is output.
前記キャッシュ装置の各エントリに、前記各エントリがキャッシュフィル実行中であるかどうかを示すフラグと、前記各エントリがプリフェッチ実行中であるかどうかを示すフラグを設け、
前記遅延検出ステップで、キャッシュフィル実行中であるかどうかを示す前記フラグと、前記プリフェッチ実行中であるかどうかを示す前記フラグに基づいて前記ロード命令がプリフェッチ命令によるキャッシュフィル実行中のエントリを参照したかどうかを検出することを特徴とする請求項8に記載のロード命令の遅延判定方法。
Each entry of the cache device is provided with a flag indicating whether each entry is executing cache fill and a flag indicating whether each entry is executing prefetch,
In the delay detection step, the load instruction refers to an entry in which the cache fill is being executed by the prefetch instruction based on the flag indicating whether the cache fill is being executed and the flag indicating whether the prefetch is being executed. 9. The load instruction delay determining method according to claim 8, wherein whether or not the load instruction has been detected is detected.
前記演算装置が、
前記キャッシュ装置の遅延検出手段からの検出信号の継続時間を計時するステップと、
前記遅延検出手段からの検出信号を、設定モードに基づいて、前記カウンタ又は前記タイマに選択的に出力するステップを有することを特徴とする請求項6から請求項9の何れかに記載のロード命令の遅延判定方法。
The arithmetic unit is
Measuring the duration of the detection signal from the delay detection means of the cache device;
10. The load instruction according to claim 6, further comprising a step of selectively outputting a detection signal from the delay detection means to the counter or the timer based on a setting mode. Delay judgment method.
演算装置と主記憶装置とキャッシュ装置を含む情報処理装置で実行されるロード命令の遅延判定プログラムであって、
前記演算装置からのプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記キャッシュ装置に対するロード命令を検出する機能と、
検出した前記ロード命令の発生回数又は継続時間を取得する機能とを、前記情報処理装置に実行させることを特徴するロード命令の遅延判定プログラム。
A load instruction delay determination program executed by an information processing device including an arithmetic device, a main storage device, and a cache device,
A function for detecting a load instruction for the cache device that has been delayed due to a cache fill being executed by a prefetch instruction from the arithmetic unit;
A load instruction delay determination program which causes the information processing apparatus to execute a function of acquiring the number of occurrences or duration of the detected load instruction.
前記キャッシュ装置に、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令の発生を検出する遅延検出機能を実行させ、
前記演算装置に、前記遅延検出機能で検出したプリフェッチ命令によるキャッシュフィル実行中により遅延が発生した前記ロード命令の発生回数をカウントする機能を実行させることを特徴とする請求項11に記載のロード命令の遅延判定プログラム。
Causing the cache device to execute a delay detection function for detecting the occurrence of the load instruction that has been delayed due to a cache fill being executed by a prefetch instruction;
12. The load instruction according to claim 11, wherein the arithmetic unit is caused to execute a function of counting the number of occurrences of the load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction detected by the delay detection function. Delay judgment program.
前記遅延検出機能で、
キャッシュヒットした前記ロード命令が、プリフェッチ命令によるキャッシュフィル実行中のエントリを参照した場合に、当該ロード命令を、プリフェッチ命令によるキャッシュフィル実行中により遅延が発生したロード命令として検出し、前記演算装置に検出信号を出力することを特徴とする請求項12に記載のロード命令の遅延判定プログラム。
With the delay detection function,
When the load instruction having a cache hit refers to an entry in which a cache fill is being executed by a prefetch instruction, the load instruction is detected as a load instruction in which a delay has occurred during execution of a cache fill by a prefetch instruction, and 13. The load instruction delay determination program according to claim 12, wherein a detection signal is output.
前記キャッシュ装置の各エントリに、前記各エントリがキャッシュフィル実行中であるかどうかを示すフラグと、前記各エントリがプリフェッチ実行中であるかどうかを示すフラグを設け、
前記遅延検出機能で、キャッシュフィル実行中であるかどうかを示す前記フラグと、プリフェッチ実行中であるかどうかを示す前記フラグに基づいて前記ロード命令がプリフェッチ命令によるキャッシュフィル実行中のエントリを参照したかどうかを検出することを特徴とする請求項13に記載のロード命令の遅延判定プログラム。
Each entry of the cache device is provided with a flag indicating whether each entry is executing cache fill and a flag indicating whether each entry is executing prefetch,
In the delay detection function, the load instruction referred to an entry in the cache fill execution by the prefetch instruction based on the flag indicating whether the cache fill is being executed and the flag indicating whether the prefetch is being executed. 14. The load instruction delay determination program according to claim 13, wherein the load instruction delay determination program according to claim 13 is detected.
前記演算装置に、
前記キャッシュ装置の遅延検出機能からの検出信号の継続時間を計時する機能と、
前記遅延検出手段からの検出信号を、設定モードに基づいて、前記カウンタ又は前記タイマに選択的に出力する機能を実行させることを特徴とする請求項11から請求項14の何れかに記載のロード命令の遅延判定プログラム。
In the arithmetic unit,
A function of measuring the duration of the detection signal from the delay detection function of the cache device;
The load according to any one of claims 11 to 14, wherein a function of selectively outputting a detection signal from the delay detection means to the counter or the timer based on a setting mode is executed. Instruction delay judgment program.
JP2009178378A 2009-07-30 2009-07-30 Information processing apparatus, load instruction delay determination method, load instruction delay determination program Expired - Fee Related JP5593647B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009178378A JP5593647B2 (en) 2009-07-30 2009-07-30 Information processing apparatus, load instruction delay determination method, load instruction delay determination program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009178378A JP5593647B2 (en) 2009-07-30 2009-07-30 Information processing apparatus, load instruction delay determination method, load instruction delay determination program

Publications (2)

Publication Number Publication Date
JP2011034239A true JP2011034239A (en) 2011-02-17
JP5593647B2 JP5593647B2 (en) 2014-09-24

Family

ID=43763269

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009178378A Expired - Fee Related JP5593647B2 (en) 2009-07-30 2009-07-30 Information processing apparatus, load instruction delay determination method, load instruction delay determination program

Country Status (1)

Country Link
JP (1) JP5593647B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5475964A (en) * 1977-11-30 1979-06-18 Toshiba Corp Data pre-fetch system
JPS63318652A (en) * 1987-06-23 1988-12-27 Fujitsu Ltd Buffer control system
JPH03119446A (en) * 1989-10-03 1991-05-21 Fujitsu Ltd Information processor
JPH05143451A (en) * 1991-11-20 1993-06-11 Kisaburo Nakazawa Data processor
JP2007226641A (en) * 2006-02-24 2007-09-06 Nec Corp Information processing system, cache control method, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5475964A (en) * 1977-11-30 1979-06-18 Toshiba Corp Data pre-fetch system
JPS63318652A (en) * 1987-06-23 1988-12-27 Fujitsu Ltd Buffer control system
JPH03119446A (en) * 1989-10-03 1991-05-21 Fujitsu Ltd Information processor
JPH05143451A (en) * 1991-11-20 1993-06-11 Kisaburo Nakazawa Data processor
JP2007226641A (en) * 2006-02-24 2007-09-06 Nec Corp Information processing system, cache control method, and program

Also Published As

Publication number Publication date
JP5593647B2 (en) 2014-09-24

Similar Documents

Publication Publication Date Title
US6523109B1 (en) Store queue multimatch detection
US10133675B2 (en) Data processing apparatus, and a method of handling address translation within a data processing apparatus
US5983325A (en) Dataless touch to open a memory page
EP1388065B1 (en) Method and system for speculatively invalidating lines in a cache
KR101369441B1 (en) Method for proactive synchronization within a computer system
US6088789A (en) Prefetch instruction specifying destination functional unit and read/write access mode
US6775749B1 (en) System and method for performing a speculative cache fill
US6481251B1 (en) Store queue number assignment and tracking
US9684606B2 (en) Translation lookaside buffer invalidation suppression
JP4813485B2 (en) Processing device with burst read / write operation
US9465744B2 (en) Data prefetch ramp implemenation based on memory utilization
US6941433B1 (en) Systems and methods for memory read response latency detection
EP2159706B1 (en) Operation processing apparatus and operation processing method
TW201617895A (en) Translation lookaside buffer management
US11023410B2 (en) Instructions for performing multi-line memory accesses
JP2004220581A (en) Data processing system realizing hardware acceleration of input/output (i/o) communication
US8352646B2 (en) Direct access to cache memory
CN112416437B (en) Information processing method, information processing device and electronic equipment
CN110291507B (en) Method and apparatus for providing accelerated access to a memory system
US20180095893A1 (en) Queuing memory access requests
CN114238167B (en) Information prefetching method, processor and electronic equipment
US8122278B2 (en) Clock skew measurement for multiprocessor systems
JP5593647B2 (en) Information processing apparatus, load instruction delay determination method, load instruction delay determination program
US10318424B2 (en) Information processing device
JP6474196B2 (en) Non-blocking execution apparatus and method for static schedule processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120606

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130930

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131008

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20131010

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131203

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140325

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140515

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140708

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140721

R150 Certificate of patent or registration of utility model

Ref document number: 5593647

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees