JP2009217385A - Processor and multiprocessor - Google Patents
Processor and multiprocessor Download PDFInfo
- Publication number
- JP2009217385A JP2009217385A JP2008058471A JP2008058471A JP2009217385A JP 2009217385 A JP2009217385 A JP 2009217385A JP 2008058471 A JP2008058471 A JP 2008058471A JP 2008058471 A JP2008058471 A JP 2008058471A JP 2009217385 A JP2009217385 A JP 2009217385A
- Authority
- JP
- Japan
- Prior art keywords
- control unit
- cache miss
- memory
- counter value
- cache
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は、プロセッサ及びマルチプロセッサに関し、特に、キャッシュミスのプロファイル機能を有するプロセッサ及びマルチプロセッサに関する。 The present invention relates to a processor and a multiprocessor, and more particularly to a processor and a multiprocessor having a cache miss profile function.
従来より、プロセッサ上で動作するプログラムの処理速度を上げる為に、キャッシュメモリ(以下、単にキャッシュともいう)が使用されている。キャッシュを有効に利用するためには、プログラムの時間的局所性(すなわちデータの再利用率とその時間的特性)、及び空間的局所性(すなわちデータの格納位置に対する偏在性)を調査した上で、キャッシュミスのオーバヘッドを低減させることが必須である。 Conventionally, a cache memory (hereinafter also simply referred to as a cache) has been used to increase the processing speed of a program operating on a processor. In order to effectively use the cache, after investigating the temporal locality of the program (ie, the data reuse rate and its temporal characteristics) and the spatial locality (ie, the ubiquity of the data storage location) It is essential to reduce the cache miss overhead.
従来、キャッシュミスの発生状況を調査するために、キャッシュミスイベント検出器とキャッシュミスパフォーマンス測定用レジスタが利用される。すなわち、キャッシュミスイベント検出器が、プロセッサにおけるキャッシュミスの発生イベントを検出すると、キャッシュミスパフォーマンス測定用レジスタ(以下、キャッシュミスカウンタという)がインクリメントされることによって、キャッシュミスの発生回数を測定することができる。 Conventionally, in order to investigate the occurrence of a cache miss, a cache miss event detector and a cache miss performance measurement register are used. That is, when the cache miss event detector detects a cache miss occurrence event in the processor, a cache miss performance measurement register (hereinafter referred to as a cache miss counter) is incremented to measure the number of occurrences of a cache miss. Can do.
キャッシュミスカウンタに保持されたキャッシュミス回数は、ターゲットプログラム中に記述されたコマンドによって読み出すことができる。キャッシュミスカウンタは一つしかないため、ターゲットプログラム中の任意の位置でキャッシュミスカウンタを読み出し、別の場所へ保存することによって、キャッシュミス回数を測定することができる。例えば、ターゲットプログラム中の各関数におけるキャッシュミス回数を測定する場合、各関数の実行前にカウンタ値を読み込み、各関数の実行後に再びカウンタ値を読み込み、各関数の実行の前後におけるカウンタ値の差を算出することによって、各関数におけるキャッシュミス回数を測定することができる。このようにすることによって、測定対象、例えば各関数、のキャッシュに関するプロファイルの情報を得ることができる。 The number of cache misses held in the cache miss counter can be read by a command described in the target program. Since there is only one cache miss counter, the number of cache misses can be measured by reading the cache miss counter at an arbitrary position in the target program and storing it in another location. For example, when measuring the number of cache misses in each function in the target program, the counter value is read before each function is executed, the counter value is read again after each function is executed, and the difference between the counter values before and after the execution of each function is read. By calculating the number of cache misses in each function. By doing so, it is possible to obtain profile information regarding the cache of the measurement object, for example, each function.
しかし、上述した方法では、キャッシュプロファイル情報を得るために、キャッシュミス回数を測定するためのコードを含ませるようにターゲットプログラムを事前に書き換えて再コンパイルする必要がある。そのため、キャッシュミス回数を測定するためのコードを含むターゲットプログラムと、キャッシュミス回数を測定するためのコードを含まないターゲットプログラムとは、コンパイラの最適化により、コードのメモリ配置が変わってしまうため、実際の動作時のプロファイル情報と違う結果が得られる可能性が高い。 However, in the method described above, in order to obtain cache profile information, it is necessary to recompile and recompile the target program in advance so as to include code for measuring the number of cache misses. Therefore, the target memory that includes code for measuring the number of cache misses and the target program that does not include code for measuring the number of cache misses will change the memory layout of the code due to compiler optimization. There is a high possibility that a result different from the profile information during actual operation is obtained.
また、ソフトウエアのシミュレーションによるメモリアクセスの状態を抽出する方法では、実システムの動作とは異なる情報が得られるという問題に対して、CPUのメモリアクセス状態の情報を、システムの振る舞いに影響を与えることなく、外部に出力するCPUメモリアクセス解析装置の技術が提案されている(例えば、特許文献1参照)。 In addition, in the method of extracting memory access status by software simulation, CPU memory access status information affects the system behavior for the problem that information different from the actual system operation can be obtained. There has been proposed a technique of a CPU memory access analysis device that outputs to the outside (see, for example, Patent Document 1).
その提案に係る技術では、CPUメモリアクセス解析装置は、プロセスの切り替わりを検出し、キャッシュミスヒット時に、イベント識別子とCPUから出力された仮想アドレスを選択してキャッシュミス情報として出力する。 In the technology according to the proposal, the CPU memory access analysis device detects a process change, selects an event identifier and a virtual address output from the CPU, and outputs it as cache miss information when a cache miss hits.
しかし、その技術では、関数毎にキャッシュミスがどの程度かつどのようなタイミングで発生しているのか、という情報を得ることできない。
そこで、本発明は、以上の問題に鑑みてなされたものであり、ターゲットプログラムの実際の動作時のキャッシュミスのプロファイル情報を、関数毎に得ることができるプロセッサ及びマルチプロセッサを提供することを目的とする。 Therefore, the present invention has been made in view of the above problems, and an object of the present invention is to provide a processor and a multiprocessor capable of obtaining, for each function, profile information of cache misses during actual operation of a target program. And
本発明の一態様によれば、メモリと、クロック信号に基づいてクロック信号をカウントするクロックカウンタと、関数の呼び出しを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、飛び先あるいは戻り先のアドレスの情報を、前記メモリに出力する関数呼び出し制御部と、キャッシュミスを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、アクセスアドレスの情報を、前記メモリに出力するキャッシュミス制御部と、を有するプロセッサを提供することができる。 According to one aspect of the present invention, upon detecting a memory, a clock counter that counts a clock signal based on a clock signal, and a function call, the counter value of the clock counter, the program counter value, and a jump destination or return A function call control unit that outputs the information of the previous address to the memory, and a cache miss that outputs the counter value of the clock counter, the program counter value, and the access address information to the memory when a cache miss is detected. And a processor having a controller.
本発明のプロセッサ及びマルチプロセッサによれば、ターゲットプログラムの実際の動作時のキャッシュミスのプロファイル情報を、関数毎に得ることができる。 According to the processor and multiprocessor of the present invention, it is possible to obtain cache miss profile information for each function during actual operation of the target program.
以下、図面を参照して本発明の実施の形態を説明する。
まず図1に基づき、本実施の形態に係わるプロセッサシステムの構成を説明する。図1は、本実施の形態に係わるプロセッサシステムの構成を示す構成図である。
Embodiments of the present invention will be described below with reference to the drawings.
First, the configuration of the processor system according to the present embodiment will be described with reference to FIG. FIG. 1 is a configuration diagram showing a configuration of a processor system according to the present embodiment.
プロセッサシステム1は、プロセッサ11と、主メモリ12とを含む。プロセッサ11は、バスインターフェース(以下、I/Fと略す)13を介して、システムバス14に接続され、主メモリ12も、システムバス14に接続されている。
The
プロセッサ11は、コアプロセッサ21と、イベント制御部22と、一時保存用メモリとしてのローカルメモリ23を含む。ローカルメモリ23は、一時的にデータを格納するRAMのメモリである。
コアプロセッサ21は、デコーダ31と、命令キャッシュ32と、データキャッシュ33と、割り込みコントローラ34を含む。
コアプロセッサ21は、主メモリ12に記憶されている命令とデータを、システムバス14を介して読み込んで実行する。主メモリ12から読み出した命令とデータは、それぞれ、命令キャッシュ32とデータキャッシュ33に一時的に記憶される。デコーダ31は、命令キャッシュ32の命令を読み出してデコードし、コアプロセッサ31は、データキャッシュ33から読み出した必要なデータに対して、そのデコードされた命令を実行する。コアプロセッサ31は、命令の実行結果を、主メモリ12の所定の領域に出力し、記憶させる。
The
The
The
プロセッサ11において実行されるプログラムは、図示しない外部記憶装置等に記憶されており、その外部記憶装置から読み出されたプログラムは、主メモリ12に記憶される。命令キャッシュ32とデータキャッシュ33には、主メモリ12から読み出された命令とデータが一時的に記憶され、デコーダ31が連続して命令を実行することによって、主メモリ12に記憶されたプログラムの処理が実行される。
A program executed by the
また、プログラムの実行中に所定のイベントが発生すると割り込み処理が実行される。割り込みコントローラ34は、その割り込み処理の実行を制御する。
Further, when a predetermined event occurs during the execution of the program, an interrupt process is executed. The
イベント制御部22は、関数コール制御部41と、キャッシュミス制御部42と、データ制御部43とを含むハードウエア回路により形成された回路部である。
The
コアプロセッサ21は、イベント制御部22の機能を有効あるいは無効にするためのフラグ設定部を有し、そのフラグ設定部に設定するフラグによって、イベント制御部33の機能を有効(ENABLE)あるいは無効(DISABLE)に設定することができる。よって、イベント制御部33を有効することにより、後述するようなキャッシュミスのプロファイル情報を得るようにすることができる。
The
関数コール制御部41は、デコーダ31によりデコードされた命令が、分岐命令、ジャンプ命令、あるいはリターン命令のときに、所定のイベントとしてこれらの命令の実行を検出する。デコーダ31は、デコードされた命令コードを、関数コール制御部41に出力する。関数コール制御部41は、これらの命令の実行が、所定の命令であることを検出すると、その検出時のプログラムカウンタ値、飛び先あるいは戻り先のアドレス、及びそのときの時間すなわちクロックカウンタ値を、ログデータとして、一次保存用メモリであるローカルメモリ23に記録する。すなわち、関数コール制御部41は、関数の呼び出しを検出すると、クロックカウンタ51のカウンタ値と、プログラムカウンタ(以下、PCと略す)の値と、飛び先あるいは戻り先のアドレスの情報を、ローカルメモリ23に出力する関数呼び出し制御部を構成する。
When the instruction decoded by the
キャッシュミス制御部42は、命令キャッシュ32とデータキャッシュ33のキャッシュミスを、所定のイベントとして検出する。すなわち、キャッシュミス制御部42は、命令キャッシュ32とデータキャッシュ33へのキャッシュミスのアクセスがあった時に、そのキャッシュミスを、所定のイベントとして検出する。キャッシュミス制御部42は、それらの所定のイベントを検出すると、その検出時のプログラムカウンタ値、アクセスされたアドレスすなわちアクセスアドレス、及びそのときの時間すなわちクロックカウンタ値を、ログデータとして、一次保存用メモリのローカルメモリ23に出力する。
The cache miss
データ制御部43には、ローカルメモリ23に記憶されるデータの量についての閾値が設定されている。データ制御部43は、ローカルメモリであるローカルメモリ23に記録されているデータ量をモニタしている。ローカルメモリ23に格納されたデータ量が、設定された所定の閾値を超えた時点で、データ制御部43は、割り込みコントローラ34に所定の割り込み信号を出力する。割り込みコントローラ34は、対応する所定の割り込みルーチンを実行して、ローカルメモリ23のログデータを、主メモリ12の所定のデータ保存領域12aに格納する割り込み制御部である。以上により、主メモリ12に、キャッシュミスのプロファイルデータが自動的に格納される。主メモリ12は、キャッシュミスのプロファイルデータを格納する、データ保存用メモリである。すなわち、データ制御部43は、ローカルメモリ23に記憶されたデータ量が所定の閾値以上となったことを検出すると、データ保存用メモリである主メモリ12に、ローカルメモリ23に記憶されたデータを転送する制御部である。
In the
次に、上述した各制御部の構成をより詳述する。
図2は、プロセッサ11の構成をより詳細に説明するためのブロック図である。
Next, the configuration of each control unit described above will be described in detail.
FIG. 2 is a block diagram for explaining the configuration of the
プロセッサ21においては、図1で説明した構成に加えて、キャッシュミス検出部35と、PCの値を保持するPCレジスタ36と、命令におけるジャンプすなわち飛び先のアドレスを保持する飛び先レジスタ37と、命令におけるリターンすなわち戻り先のアドレスを保持する戻り先レジスタ38とが示されている。
In the
キャッシュミス検出部35は、命令キャッシュ32及びデータキャッシュ33においてキャッシュミスが発生すると、キャッシュミスのイベント情報と、データキャッシュにおいてキャッシュミスが発生したときのアクセスアドレスの情報を出力する。
When a cache miss occurs in the
イベント制御部22は、関数コール制御部41と、キャッシュミス制御部42と、データ制御部43に加えて、カウンタ49を含む。
The
関数コール制御部41は、命令比較部44と、関数情報出力部45とを含む。命令比較部44には、デコーダ31においてデコードされた命令コードと、分岐命令、ジャンプ命令、あるいはリターン命令の各命令コードとが入力される。命令比較部44は、デコードされた命令コードと、分岐命令、ジャンプ命令、あるいはリターン命令の各命令コードを比較して、デコードされた命令コードが、分岐命令、ジャンプ命令、あるいはリターン命令のいずれかの命令コードと一致すると、一致信号を関数情報出力部45に出力する。
The function
関数情報出力部45には、PCレジスタ36,飛び先レジスタ37及び戻り先レジスタ38のデータが入力されている。さらに、関数情報出力部45には、クロック(以下、CLKと略す)信号に基づいてCLK信号をカウントするクロックカウンタ51からのクロックカウンタ値の信号も入力されている。
Data of the
関数コール制御部41は、所定の命令が検出されると、その所定の命令を検出したときのクロックカウンタ値、PC値、関数コールであること、及び、飛び先あるいは戻り先のアドレスの情報を、カウンタ49を介して、ローカルメモリ23に出力する。
カウンタ49は、関数コール制御部41から出力されたログデータのデータ量に応じた値だけカウントアップする。
When a predetermined instruction is detected, the function
The counter 49 counts up by a value corresponding to the data amount of log data output from the function
キャッシュミス制御部42は、キャッシュミス情報出力部46を含んでいる。キャッシュミス情報出力部46には、キャッシュミス検出部35から、キャッシュミス検出信号としての、イベント情報とアクセスアドレスの情報とが入力されている。さらに、キャッシュミス情報出力部46には、PCカウンタ36のPC値の情報と、クロックカウンタ51からのクロックカウンタ値の信号とが入力されている。
The cache
キャッシュミス制御部42は、キャッシュミスを検出したときのクロックカウンタ値、PC値、キャッシュミスであること、及び、キャッシュミスしたときのアクセスアドレスの情報を、カウンタ49を介して、ローカルメモリ23に出力する。
The cache
カウンタ49は、キャッシュミス制御部42から出力されたログデータのデータ量に応じた値だけカウントアップする。
The counter 49 counts up by a value corresponding to the amount of log data output from the cache
データ制御部43は、閾値比較部47と閾値保持部48とを含む。閾値比較部47は、閾値保持部48に保持された所定の閾値と、ローカルメモリ23に記憶されたログデータのデータ量を示すカウンタ49のカウント値とを比較し、カウント値がその閾値以上になると、割り込みコントローラ34に所定の割り込み信号を出力する。上述したように、割り込みコントローラ34は、その所定の割り込み信号を受信すると、ローカルメモリ23から主メモリ12へデータの転送処理を実行する。カウンタ49は、データの転送がされると、リセットされる。
The data control
なお、閾値比較部47は、ローカルメモリ23のデータ量を監視して、そのデータ量と閾値と比較するようにしてもよい。
The
イベント制御部22には、電源Vddが供給されているが、スイッチ(以下、SWと略す)52を介して電源Vddが供給されている。上述したように、コアプロセッサ21は、フラグ設定部53を有している。フラグ設定部53にイベント制御部22を有効とする設定がされたときには、フラグ設定部53は、SW52をオンとするようにスイッチ信号がSW52に供給される。SW52は、関数コール制御部41とキャッシュミス制御部42への電源の供給を制御する。フラグ設定部53は、関数コール制御部41とキャッシュミス制御部42の機能の有効あるいは無効を設定する機能設定部である。すなわち、SW52とフラグ設定部53は、フラグ設定部53に設定された信号に基づいて、関数コール制御部41とキャッシュミス制御部42の機能を有効あるいは無効にするための機能設定部を構成する。
The
以上のような構成において、ターゲットプログラムを実行させると、プロセッサ11は、次のように動作する。
ターゲットプログラムの実行中に、分岐命令、ジャンプ命令、あるいはリターン命令が検出されると、関数コール制御部41は、それらの命令を検出したときのクロックカウンタ値、PC値、関数コールであること、及び、飛び先あるいは戻り先のアドレスの情報を、カウンタ49を介して、ローカルメモリ23に出力する。
例えば、次のように、関数コール制御部41は、CSV形式で、これらの情報を出力する。
In the above configuration, when the target program is executed, the
When a branch instruction, a jump instruction, or a return instruction is detected during execution of the target program, the function
For example, the function
(クロックカウンタ値),(PC値),(関数コール),(飛び先あるいは戻り先のアドレス)
また、ターゲットプログラムの実行中に、キャッシュミスが検出されると、キャッシュミス制御部42は、キャッシュミスを検出したときのクロックカウンタ値、PC値、キャッシュミスであること、及び、キャッシュミスしたときのアクセスアドレスの情報を、カウンタ49を介して、ローカルメモリ23に出力する。
例えば、次のように、キャッシュミス制御部42は、CSV形式で、これらの情報を出力する。
(Clock counter value), (PC value), (function call), (jump destination or return address)
In addition, when a cache miss is detected during execution of the target program, the cache
For example, the cache
(クロックカウンタ値),(PC値),(キャッシュミス),(アクセスアドレス)
従って、所定の命令が実行されたこと、及びキャッシュミスが発生したことに応じて、上述した情報が、例えば、CSV形式でカウンタ49を介して、ローカルメモリ23に出力され、ログ情報として記録されていく。
(Clock counter value), (PC value), (cache miss), (access address)
Accordingly, in response to the execution of a predetermined instruction and the occurrence of a cache miss, the above-described information is output to the
関数コール制御部41とキャッシュミス制御部42からの情報は、ローカルメモリ23に蓄積されていき、所定のデータ量が蓄積されると、割り込みコントローラ34によって、主メモリ12のデータ保存領域12aに転送される。
Information from the function
主メモリ12のデータ保存領域12aに記憶されたログ情報は、飛び先及び戻り先のアドレスの情報を含むため、そのアドレスに基づいて、関数を特定することができるので、蓄積されたログデータを解析することによって、関数毎のキャッシュミス回数をカウントすることができる。
Since the log information stored in the
次に、以上のようにして得られたキャッシュミスのプロファイルデータを用いた解析例を説明する。
1)関数のキャッシュミスの相関
例えば、図3は、関数名と、各関数のキャッシュミス回数を示す表を示す図である。ターゲットプログラムは、複数の関数を含む。図3には、関数名「func_a」の実行時に「112797」回のキャッシュミスが発生しており、関数名「func_b」の実行時に「42607」回のキャッシュミスが発生しており、関数名「func_c」の実行時に「20364」回のキャッシュミスが発生していることが示されている。
Next, an analysis example using the cache miss profile data obtained as described above will be described.
1) Correlation of function cache misses
For example, FIG. 3 is a table showing function names and the number of cache misses for each function. The target program includes a plurality of functions. In FIG. 3, “1279797” cache misses occur when the function name “func_a” is executed, and “42607” cache misses occur when the function name “func_b” is executed. It is indicated that “20364” cache misses have occurred during the execution of “func_c”.
すなわち、関数毎の、キャッシュミス回数を示すことができる。実行される関数名及び遷移先の関数名は、分岐命令、ジャンプ命令、及びリターン命令時の、PC値、飛び先あるいは戻り先アドレスの情報と、デバッグ情報から得ることができる。これらのアドレス情報から、空間的局所性を知ることができる。キャッシュミス回数が大きい関数は、それによるミスペナルティも大きいので、キャッシュミス回数を減らすことによりプログラム全体の処理速度の向上に効果が大きいと考えられる。 That is, the number of cache misses for each function can be indicated. The name of the function to be executed and the function name of the transition destination can be obtained from the PC value, jump destination or return destination address information, and debug information at the time of the branch instruction, jump instruction, and return instruction. From these address information, the spatial locality can be known. A function with a large number of cache misses has a large miss penalty, and therefore it is considered that reducing the number of cache misses is effective in improving the processing speed of the entire program.
従って、最もキャッシュミスの多かった関数からチューニングをすることによって、キャッシュミスのオーバヘッド低減が大きいので、関数名「func_a」からチューニングを行えばよいことがわかる。 Therefore, it can be understood that tuning is performed from the function name “func_a” because the overhead of cache miss is greatly reduced by tuning from the function having the most cache misses.
2)関数とキャッシュミスの発生の時間的な相関
例えば、図4は、関数、クロックカウンタ値及びアクセスアドレスの表データを示す図である。図5は、アクセスされた実アドレスの時間経過における散布図である。横軸が、関数のコール、リターン時の時間すなわちクロックカウンタ値の軸であり、縦軸が、関数のコール及びリターン時にアクセスされたときのメモリの実アドレスの軸である。
2) Temporal correlation between occurrence of function and cache miss For example, FIG. 4 is a diagram showing table data of a function, a clock counter value, and an access address. FIG. 5 is a scatter diagram of the accessed real addresses over time. The horizontal axis is the time of function call and return, that is, the axis of the clock counter value, and the vertical axis is the axis of the real address of the memory when accessed at the time of function call and return.
図5において、縦の実線CMで示す時点においてキャッシュミスが発生したことを示している。すなわち、図5は、キャッシュミスが発生したタイミングを時系列的に示しているので、キャッシュミスの時間的局所性を知ることができる。 FIG. 5 shows that a cache miss has occurred at the time indicated by the vertical solid line CM. That is, FIG. 5 shows the timing at which a cache miss occurs in time series, so that the temporal locality of the cache miss can be known.
関数コール制御部41とキャッシュミス制御部42から出力されるログデータには、クロックカウンタ値が含まれているので、図5に示すように、いわゆる分岐、ジャンプ、リターン時の時間と、キャッシュミス発生時の時間とが得られるので、関数の遷移と、キャッシュミスの発生とを関連付けることができる。
Since the log data output from the function
図4に示された時間範囲R1のデータに対応する、図5の同じ時間範囲R1におけるキャッシュミスの発生状況を見ると、キャッシュの同一ラインに配置された関数に交互にアクセスが発生しているために、そのアクセスの度にキャッシュミスが発生していることがわかる。特に、時間範囲R1と同じようなキャッシュミスが繰り返し発生しているような場合に、各関数が効率的にメモリに配置されていれば、キャッシュミスを大幅に削減できると考えられる。 When the occurrence situation of the cache miss in the same time range R1 in FIG. 5 corresponding to the data in the time range R1 shown in FIG. 4 is seen, the functions arranged on the same line of the cache are alternately accessed. Therefore, it can be seen that a cache miss occurs at each access. In particular, when a cache miss similar to that in the time range R1 occurs repeatedly, if each function is efficiently arranged in the memory, it is considered that the cache miss can be significantly reduced.
図6と図7は、それぞれ、図5に示すようなキャッシュミスの発生を低減するように、関数のメモリ配置を変更したときの、関数、クロックカウンタ値及びアクセスアドレスの表データを示す図と、アクセスされた実アドレスの時間経過における散布図である。図7を見ると判るように、図4の範囲R1に対応する範囲R2におけるキャッシュミス回数は、大幅に減少している。 FIGS. 6 and 7 are diagrams showing table data of functions, clock counter values, and access addresses when the memory arrangement of functions is changed so as to reduce the occurrence of cache misses as shown in FIG. FIG. 7 is a scatter diagram of the accessed real addresses over time. As can be seen from FIG. 7, the number of cache misses in the range R2 corresponding to the range R1 in FIG. 4 is greatly reduced.
以上のように、上述した本実施の形態に係るプロセッサによれば、従来のようなキャッシュミスカウンタのようなレジスタを設けず、かつプログラム中にキャッシュミス測定用のコードを含ませることもなく、ターゲットプログラムの実際の動作時のキャッシュミスのプロファイル情報を、関数毎に得ることができる。 As described above, according to the processor according to the present embodiment described above, a register such as a conventional cache miss counter is not provided, and a cache miss measurement code is not included in the program. Cache miss profile information during actual operation of the target program can be obtained for each function.
特に、出力されるログ情報は、時間の情報を含むので、キャッシュミスの発生した場所と時間を特定することができる。その結果、ターゲットプログラムをチューニングする際に、プログラムのメモリ配置を最適化することにより、キャッシュミス回数の減少につなげることが可能となる。 In particular, since the output log information includes time information, it is possible to specify the location and time at which the cache miss occurred. As a result, when tuning the target program, it is possible to reduce the number of cache misses by optimizing the memory layout of the program.
また、ログ情報は、プロセッサ上のローカルメモリに一旦保持され、一定の閾値以上になると、データ保存用のメモリに転送するので、出力されるログ情報を常にデータ保存用のメモリに転送するよりも、高速にログ情報の記憶を行うことができる。 Also, log information is temporarily stored in the local memory on the processor, and when it exceeds a certain threshold value, it is transferred to the data storage memory. Therefore, the output log information is always transferred to the data storage memory. Log information can be stored at high speed.
なお、上述した実施の形態に係るプロセッサは、半導体チップ上に複数のプロセッサが設けられたマルチプロセッサにおいても適用可能である。すなわち、マルチプロセッサ上の各プロセッサに、上述した関数コール制御部41,キャッシュミス制御部42,データ制御部43、及びローカルメモリ23が、設けられる。図8は、マルチプロセッサの構成例を示す図である。図8に示すように、マルチプロセッサ61は、複数のプロセッサ11を有し、複数のプロセッサ11は、互いにバス62に接続されている。
Note that the processor according to the above-described embodiment can also be applied to a multiprocessor in which a plurality of processors are provided on a semiconductor chip. That is, the above-described function
本発明は、上述した実施の形態に限定されるものではなく、本発明の要旨を変えない範囲において、種々の変更、改変等が可能である。 The present invention is not limited to the above-described embodiments, and various changes and modifications can be made without departing from the scope of the present invention.
1 プロセッサシステム、11 コアプロセッサ、12 主メモリ、13 バスインターフェース、14 システムバス、21 コアプロセッサ、22 イベント制御部、23 ローカルメモリ、31 デコーダ、32 命令キャッシュ、33 データキャッシュ、34 割り込みコントローラ、41 関数コール制御部、42 キャッシュミス制御部、43 データ制御部、51 クロックカウンタ、52 スイッチ、53 フラグ設定部、61 マルチプロセッサ、62 バス 1 processor system, 11 core processor, 12 main memory, 13 bus interface, 14 system bus, 21 core processor, 22 event control unit, 23 local memory, 31 decoder, 32 instruction cache, 33 data cache, 34 interrupt controller, 41 function Call control unit, 42 cache miss control unit, 43 data control unit, 51 clock counter, 52 switch, 53 flag setting unit, 61 multiprocessor, 62 bus
Claims (5)
クロック信号に基づいてクロック信号をカウントするクロックカウンタと、
関数の呼び出しを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、飛び先あるいは戻り先のアドレスの情報を、前記メモリに出力する関数呼び出し制御部と、
キャッシュミスを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、アクセスアドレスの情報を、前記メモリに出力するキャッシュミス制御部と、
を有することを特徴とするプロセッサ。 Memory,
A clock counter that counts the clock signal based on the clock signal;
When a function call is detected, a counter value of the clock counter, a program counter value, and a function call control unit that outputs information on the jump destination or return destination address to the memory,
When a cache miss is detected, a counter value of the clock counter, a program counter value, and a cache miss control unit that outputs information of an access address to the memory;
A processor characterized by comprising:
前記メモリに記憶されたデータの転送は、前記割り込み制御部により行われることを特徴とする請求項1又は請求項2に記載のプロセッサ。 Having an interrupt controller,
3. The processor according to claim 1, wherein the transfer of the data stored in the memory is performed by the interrupt control unit.
各プロセッサは、
メモリと、
クロック信号に基づいてクロック信号をカウントするクロックカウンタと、
関数の呼び出しを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、飛び先あるいは戻り先のアドレスの情報を、前記メモリに出力する関数呼び出し制御部と、
キャッシュミスを検出すると、前記クロックカウンタのカウンタ値と、プログラムカウンタ値と、アクセスアドレスの情報を、前記メモリに出力するキャッシュミス制御部と、
を有することを特徴とするマルチプロセッサ。 A multiprocessor having a plurality of processors,
Each processor
Memory,
A clock counter that counts the clock signal based on the clock signal;
When a function call is detected, a counter value of the clock counter, a program counter value, and a function call control unit that outputs information on the jump destination or return destination address to the memory,
When a cache miss is detected, a counter value of the clock counter, a program counter value, and a cache miss control unit that outputs information of an access address to the memory;
A multiprocessor characterized by comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008058471A JP2009217385A (en) | 2008-03-07 | 2008-03-07 | Processor and multiprocessor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008058471A JP2009217385A (en) | 2008-03-07 | 2008-03-07 | Processor and multiprocessor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009217385A true JP2009217385A (en) | 2009-09-24 |
Family
ID=41189194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008058471A Pending JP2009217385A (en) | 2008-03-07 | 2008-03-07 | Processor and multiprocessor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009217385A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011048413A (en) * | 2009-08-25 | 2011-03-10 | Fujitsu Ltd | Recording device, recording method, and recording program |
JP2013003934A (en) * | 2011-06-20 | 2013-01-07 | Hitachi Ltd | Memory management method, computer, and memory management program |
JP2014532944A (en) * | 2011-11-07 | 2014-12-08 | クアルコム,インコーポレイテッド | Method, device, and system for detecting return-oriented programming exploits |
-
2008
- 2008-03-07 JP JP2008058471A patent/JP2009217385A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011048413A (en) * | 2009-08-25 | 2011-03-10 | Fujitsu Ltd | Recording device, recording method, and recording program |
JP2013003934A (en) * | 2011-06-20 | 2013-01-07 | Hitachi Ltd | Memory management method, computer, and memory management program |
JP2014532944A (en) * | 2011-11-07 | 2014-12-08 | クアルコム,インコーポレイテッド | Method, device, and system for detecting return-oriented programming exploits |
US9262627B2 (en) | 2011-11-07 | 2016-02-16 | Qualcomm Incorporated | Methods, devices, and systems for detecting return oriented programming exploits |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20120095728A1 (en) | Data processing apparatus, performance evaluation/analysis apparatus, and performance evaluation/analysis system and method | |
CN108475236B (en) | Measuring address translation delay | |
TWI461908B (en) | Optional logging of debug activities in a real time instruction tracing log | |
US20110055838A1 (en) | Optimized thread scheduling via hardware performance monitoring | |
US9575816B2 (en) | Deadlock/livelock resolution using service processor | |
JP5353227B2 (en) | Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function. | |
US20110289357A1 (en) | Information processing device | |
US9740541B2 (en) | Information processing apparatus and method of collecting performance analysis data | |
JP2007242003A (en) | Technique for using memory attributes | |
US20160378636A1 (en) | Software-Initiated Trace Integrated with Hardware Trace | |
TWI437488B (en) | Microprocessor and operation method using the same | |
JP2017167930A (en) | Information processing device, power measurement method and power measurement program | |
US20080141002A1 (en) | Instruction pipeline monitoring device and method thereof | |
US8612952B2 (en) | Performance optimization based on data accesses during critical sections | |
JP2009217385A (en) | Processor and multiprocessor | |
JP2014106972A (en) | Profiling method for dynamic library | |
US9182958B2 (en) | Software code profiling | |
US20140229715A1 (en) | Apparatus and method for providing eventing ip and source data address in a statistical sampling infrastructure | |
US20080140993A1 (en) | Fetch engine monitoring device and method thereof | |
JP4806577B2 (en) | Trace data recording device | |
Li et al. | A data locality and memory contention analysis method in embedded numa multi-core systems | |
US20230088780A1 (en) | Profiling of sampled operations processed by processing circuitry | |
JP2010009175A (en) | Program performance estimation device | |
US20050120348A1 (en) | Method of determining information about the processes which run in a program-controlled unit during the execution of a program by the program-controlled unit | |
CN117453500A (en) | Method for adjusting service performance and related equipment thereof |