[go: up one dir, main page]

JP2008158662A - Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium - Google Patents

Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium Download PDF

Info

Publication number
JP2008158662A
JP2008158662A JP2006344541A JP2006344541A JP2008158662A JP 2008158662 A JP2008158662 A JP 2008158662A JP 2006344541 A JP2006344541 A JP 2006344541A JP 2006344541 A JP2006344541 A JP 2006344541A JP 2008158662 A JP2008158662 A JP 2008158662A
Authority
JP
Japan
Prior art keywords
offset value
pattern
trace information
memory access
address
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.)
Withdrawn
Application number
JP2006344541A
Other languages
Japanese (ja)
Inventor
Koichi Kato
浩一 加藤
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2006344541A priority Critical patent/JP2008158662A/en
Publication of JP2008158662A publication Critical patent/JP2008158662A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

【課題】デバッグ作業に必要なトレース情報を効率良く取得する。
【解決手段】デバッグ対象プログラムの実行によって、CPU101がアクセスしたアクセスアドレスを取得するメモリアクセスアドレス取得部103と、取得したアドレスを格納するアドレス格納部104と、格納した最新のアドレスと一つ前のアドレスからオフセット値を計算するオフセット値計算部105と、オフセット値を格納するオフセット値格納部106と、最新のオフセット値と一つ前のオフセット値を比較して両者が一致するか否かを判定するオフセット値比較部107と、2つのオフセット値が一致した場合にその回数をカウントするカウンタ106aと、2つのオフセット値が一致しない場合に、オフセットの基準となるベースアドレスとオフセット値、及びオフセット値の一致した回数を出力するメモリアクセスアドレス情報出力部108から構成される。
【選択図】図1
Trace information necessary for debugging work is efficiently obtained.
By executing a program to be debugged, a memory access address acquisition unit 103 that acquires an access address accessed by a CPU 101, an address storage unit 104 that stores the acquired address, and the latest stored address and the previous address are stored. An offset value calculation unit 105 that calculates an offset value from an address, an offset value storage unit 106 that stores an offset value, and compares the latest offset value with the previous offset value to determine whether or not they match. Offset value comparison unit 107, counter 106a that counts the number of times when two offset values match, base address, offset value, and offset value that serve as an offset reference when the two offset values do not match Memory access address that outputs the number of times Composed of scan information output unit 108.
[Selection] Figure 1

Description

本発明は、CPUとメモリを有するプロセッサ上で動作するプログラムにより、前記CPUが前記メモリに対してアクセスしたアクセス状況を示すデータをトレース情報として取得するメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体に関する。   The present invention relates to a memory access trace information acquisition method and a memory access trace information acquisition method for acquiring, as trace information, data indicating an access status accessed by the CPU by a program operating on a processor having a CPU and a memory. The present invention relates to a device, a memory access trace information acquisition program, and a recording medium.

コンピュータシステムにおけるプログラムの動作確認や、プログラム開発におけるデバッグ作業に役立たせるために、コンピュータがどのように命令やメモリアクセスを実行したかを示すデータをトレース情報として取得することが一般に行われている。しかし、トレース情報の全てを取得するには、データ量が膨大となるため効率良く取得する必要がある。   In order to be useful for checking the operation of a program in a computer system and debugging work in program development, data indicating how the computer has executed an instruction or memory access is generally acquired as trace information. However, in order to acquire all of the trace information, it is necessary to acquire it efficiently because the amount of data becomes enormous.

従来、トレース情報を効率良く取得する方法として、プログラムの分岐命令のみを取得し、プログラムの実行後に命令を復帰させる分岐トレース方法が知られている。また、命令のトレース情報を一時的に蓄えておき、トレース情報のパターンを検出して、一致した箇所を他の情報に置き換えることでデータ量を削減するようにした技術が開示されている(例えば、特許文献1、2参照)。更に、分岐命令の繰り返し回数をカウントし、分岐命令と繰り返し回数を出力することでデータ量を削減する技術が開示されている(例えば、特許文献3参照)。
特許第3498702号公報 特許第2702462号公報 特開平05−012061号公報
Conventionally, as a method for efficiently obtaining trace information, a branch trace method is known in which only a branch instruction of a program is obtained and the instruction is restored after the program is executed. Further, a technique is disclosed in which trace information of instructions is temporarily stored, a pattern of the trace information is detected, and the matched portion is replaced with other information to reduce the data amount (for example, Patent Documents 1 and 2). Furthermore, a technique for reducing the amount of data by counting the number of repetitions of a branch instruction and outputting the branch instruction and the number of repetitions is disclosed (for example, see Patent Document 3).
Japanese Patent No. 3498702 Japanese Patent No. 2702462 JP 05-012061 A

このような従来の技術によれば、命令のトレース情報は効率良く取得できるものの、データのトレース情報を効率良く取得することが困難であるため、デバッグ作業を行うことが困難である。   According to such a conventional technique, although the trace information of the instruction can be efficiently acquired, it is difficult to efficiently acquire the trace information of the data, so that it is difficult to perform the debugging work.

また、取得したデータのパターンを比較する際に、メモリ容量が十分であれば問題ないが、メモリ容量に制限がある場合は、パターンを効率良く蓄えなければパターンを検出することが困難である。   Further, when comparing the patterns of acquired data, there is no problem if the memory capacity is sufficient. However, if the memory capacity is limited, it is difficult to detect the pattern unless the patterns are stored efficiently.

本発明は、上記事情に鑑みてなされたものであって、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することを可能にするメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体を提供することを目的とする。   The present invention has been made in view of the above circumstances, and can efficiently acquire data indicating the access status to the memory as trace information necessary for debugging work, and effectively use a memory having a limited storage capacity. It is an object of the present invention to provide a memory access trace information acquisition method, a memory access trace information acquisition device, a memory access trace information acquisition program, and a recording medium that enable efficient detection of trace information patterns.

上記目的を達成するために、本発明の第1のメモリアクセストレース情報取得方法は、CPUとメモリを有するプロセッサ上で動作するプログラムにより、前記CPUが前記メモリに対してアクセスしたアクセス状況を示すデータを、トレース情報として取得するメモリアクセストレース情報取得方法であって、前記メモリに対するアクセスアドレスを格納するステップと、前記アクセスアドレスと前記アクセスアドレスの一つ前のアクセスアドレスとのオフセット値を1つ以上計算するステップと、前記オフセット値を1つ以上計算した結果を示すオフセット値群が1つ前の前記オフセット値群と比較して、一致するか否かを判定する判定ステップと、前記オフセット値群が一つ前の前記オフセット値群と一致すると判定した場合に、一致した回数をカウントするカウントステップと、前記オフセット値群が一つ前の前記オフセット値群と一致しないと判定した場合、前記一致した回数を出力する出力ステップとを有する方法としている。   In order to achieve the above object, a first memory access trace information acquisition method according to the present invention provides data indicating an access situation in which the CPU accesses the memory by a program operating on a processor having the CPU and the memory. For acquiring memory access trace information as a trace information, the step of storing an access address for the memory, and one or more offset values between the access address and the access address immediately before the access address A step of calculating, a determination step of determining whether or not an offset value group indicating a result of calculating one or more offset values is compared with the previous offset value group, and the offset value group Match with the previous offset value group. A counting step of counting a number of times, when said offset value group is determined not to match with the offset value group before one has a method and an output step of outputting the number of times the matching.

この方法により、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出する   By this method, data indicating the access status to the memory can be efficiently acquired as trace information necessary for debugging work, and the trace information pattern can be efficiently detected by effectively using the memory with limited storage capacity.

また、本発明の第2のメモリアクセストレース情報取得方法は、前記判定ステップにおいて、前記オフセット値を一つ前の前記オフセット値と比較して、一致するか否かを判定し、前記カウントステップにおいて、前記オフセット値が一つ前の前記オフセット値と一致すると判定した場合に、一致した回数をカウントし、前記出力ステップにおいて、前記オフセット値が一つ前の前記オフセット値と一致しないと判定した場合に、前記アクセスアドレス、前記オフセット値、及び前記一致した回数を出力する方法としている。   In the second memory access trace information acquisition method of the present invention, in the determination step, the offset value is compared with the previous offset value to determine whether or not they match, and in the counting step When it is determined that the offset value matches the previous offset value, the number of times of matching is counted, and in the output step, the offset value is determined not to match the previous offset value In addition, the access address, the offset value, and the number of times of coincidence are output.

この方法により、オフセット値の一致する回数をカウントすることで出力するトレース情報の量を減少させることができ、従来に比べてより多くのメモリアクセス状況を取得することが可能となる。   By this method, it is possible to reduce the amount of trace information to be output by counting the number of times the offset values match, and it is possible to acquire more memory access situations than in the past.

また、本発明の第3のメモリアクセストレース情報取得方法は、前記CPUの前記プログラムを実行するイベントを検出するステップと、前記イベントが検出されなかった場合に、前記オフセット値を第1のバッファに格納するステップとを有し、前記判定ステップにおいて、前記イベントが検出された場合に、前記第1のバッファの内容を第2のバッファに格納された前記オフセット値群を示すパターンと比較して、一致するか否かを判定し、前記カウントステップにおいて、前記第1のバッファの内容が前記パターンと一致すると判定した場合に、一致した回数をカウントするステップを有し、前記出力ステップにおいて、前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、前記パターン及び前記一致した回数を出力し、前記第1のバッファの内容を前記第2のバッファの内容に反映する方法としている。   The third memory access trace information acquisition method according to the present invention includes a step of detecting an event of executing the program of the CPU, and if the event is not detected, the offset value is stored in the first buffer. And when the event is detected in the determination step, the contents of the first buffer are compared with a pattern indicating the offset value group stored in the second buffer, A step of counting the number of times of matching when it is determined in the counting step that the contents of the first buffer match the pattern, and in the output step, When it is determined that the content of one buffer does not match the pattern, the pattern and the number of times of matching are determined. To force the contents of the first buffer is set to a way that reflects the contents of the second buffer.

この方法により、オフセット値が一定でない範囲を省略することができるので、出力する情報量を減少させることが可能となり、従来に比べてより多くのメモリアクセス状況を取得することができる。   By this method, it is possible to omit a range where the offset value is not constant, so that it is possible to reduce the amount of information to be output, and it is possible to acquire more memory access situations than in the past.

更に、本発明の第4のメモリアクセストレース情報取得方法は、前記イベントを検出する毎に、オフセット値の基準となるベースアドレスを格納するステップと、前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致すると判定した場合に、前記ベースアドレスを前記第2のバッファに格納するステップとを有し、前記出力ステップにおいて、前記第1のバッファの内容が前記パターンと一致しないと判定した場合には、前記パターン、前記一致した回数、及び1つ以上の前記ベースアドレスを示す前記ベースアドレス群を出力する方法としている。   Further, according to the fourth memory access trace information acquisition method of the present invention, each time the event is detected, a step of storing a base address serving as a reference of an offset value and a content of the first buffer in the determination step are as follows. A step of storing the base address in the second buffer when it is determined that the pattern matches the pattern, and the output step determining that the contents of the first buffer do not match the pattern Is a method of outputting the base address group indicating the pattern, the number of times of matching, and one or more base addresses.

この方法により、イベントを取得した際のアドレスのオフセット値が一定でないものに対しても、デバッグ作業に必要なデータトレース情報を効率良く取得することができる。   By this method, it is possible to efficiently acquire the data trace information necessary for the debugging work even when the address offset value when the event is acquired is not constant.

また、本発明の第5のメモリアクセストレース情報取得方法は、前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、前記パターンに対応するラベルを出力するステップと、前記パターンを前記出力ステップにおいて既に出力したことのあるパターンと比較して、一致するか否かを判定するステップと、前記パターンが前記出力ステップにおいて既に出力したことのあるパターンと一致しないと判定した場合に、前記パターンに新規のラベルを付与するステップと、前記パターンが前記出力ステップにおいて既に出力したことのあるパターンと一致すると判定した場合に、前記既に出力したことのあるパターンと同じラベルを付与するステップとを有する方法としている。   The fifth memory access trace information acquisition method of the present invention includes a step of outputting a label corresponding to the pattern when it is determined in the determination step that the contents of the first buffer do not match the pattern. Comparing the pattern with a pattern that has already been output in the output step and determining whether or not they match, and determining that the pattern does not match a pattern that has already been output in the output step If it is determined that the pattern is a pattern that has already been output in the output step, the label that is the same as the pattern that has already been output. And a step of providing.

この方法により、同じパターンは一度しか検出されないようにすることができるので、出力する情報量をさらに減少させることが可能となり、デバッグ作業に必要なデータトレース情報を効率良く取得することができる。   By this method, since the same pattern can be detected only once, the amount of information to be output can be further reduced, and the data trace information necessary for debugging can be acquired efficiently.

また、本発明の第6のメモリアクセストレース情報取得方法は、前記第1のバッファの内容を前記一致した回数が最大となるパターンと比較して、一致するか否かを判定するステップと、前記第1のバッファの内容が前記一致した回数が最大となるパターンと一致しないと判定した場合に、前記パターンに対応するラベルを出力するステップと、前記第1のバッファの内容が前記一致した回数が最大となるパターンと一致すると判定した場合に、前記一致したパターンの優先度を上げるステップとを有し、前記出力ステップにおいて、前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、前記パターンに対応するラベル及び前記一致した回数を出力し、前記第1のバッファの内容を最も優先度の低い前記第2のバッファの内容に反映する方法としている。   Further, the sixth memory access trace information acquisition method of the present invention compares the contents of the first buffer with the pattern having the maximum number of times of matching, and determines whether or not they match, When it is determined that the content of the first buffer does not match the pattern with the maximum number of matches, the step of outputting a label corresponding to the pattern; and the number of times the content of the first buffer matches A step of increasing the priority of the matched pattern when it is determined that the pattern matches the maximum pattern, and in the output step, if the content of the first buffer does not match the pattern in the determination step If determined, the label corresponding to the pattern and the number of matches are output, and the content of the first buffer is the highest priority. It is a way to reflect the lower contents of the second buffer.

この方法により、使用頻度が高いパターンを残しておくことができるので、パターンを格納するためのメモリ量が少ない場合でも、メモリアクセス状況を効率良く取得することが可能となる。   By this method, it is possible to leave a frequently used pattern, so that it is possible to efficiently acquire the memory access status even when the amount of memory for storing the pattern is small.

また、本発明の第1のメモリアクセストレース情報取得装置は、CPUとメモリを有するプロセッサ上で動作するプログラムにより、前記CPUが前記メモリに対してアクセスしたアクセス状況を示すデータを、トレース情報として取得するメモリアクセストレース情報取得装置であって、前記CPUの前記メモリに対するアクセスアドレスを取得するアクセスアドレス取得部と、取得した前記アクセスアドレスを格納するアクセスアドレス格納部と、前記アクセスアドレス格納部に格納したアクセスアドレスと一つ前の前記アクセスアドレスとのオフセット値を1つ以上計算するオフセット値計算部と、前記オフセット値を1つ以上計算した結果を示すオフセット値群を格納するオフセット値格納部と、前記オフセット値格納部に格納したオフセット値群と一つ前の前記オフセット値群と比較して、一致するか否かを判定するオフセット値比較部と、前記オフセット値群が一つ前の前記オフセット値群と一致すると判定した場合に、一致した回数をカウントするカウンタと、前記オフセット値群が一つ前の前記オフセット値群と一致しないと判定した場合に、前記カウンタの値を出力するトレース情報出力部と、を有する構成としている。   The first memory access trace information acquisition apparatus according to the present invention acquires, as trace information, data indicating an access status accessed by the CPU to the memory by a program operating on a processor having the CPU and the memory. A memory access trace information acquisition device that stores an access address acquisition unit that acquires an access address for the memory of the CPU, an access address storage unit that stores the acquired access address, and the access address storage unit An offset value calculation unit that calculates one or more offset values between an access address and the previous access address; an offset value storage unit that stores an offset value group indicating a result of calculating one or more offset values; Stored in the offset value storage unit When comparing the offset value group with the previous offset value group and determining whether or not they match, and determining that the offset value group matches the previous offset value group And a counter that counts the number of times of matching, and a trace information output unit that outputs the value of the counter when it is determined that the offset value group does not match the previous offset value group. Yes.

この構成により、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することができる。   With this configuration, data indicating the access status to the memory can be efficiently acquired as trace information necessary for debugging work, and a trace information pattern can be efficiently detected by effectively using a memory with limited storage capacity. it can.

また、本発明の第2のメモリアクセストレース情報取得装置は、前記オフセット値比較部は、前記オフセット値格納部に格納したオフセット値と一つ前の前記オフセット値と比較して、一致するか否かを判定し、前記カウンタは、前記オフセット値が一つ前の前記オフセット値と一致すると判定した場合に、一致した回数をカウントし、前記トレース情報出力部は、前記オフセット値が一つ前の前記オフセット値と一致しないと判定した場合に、前記アクセスアドレス、前記オフセット値、及び前記カウンタの値を出力する構成としている。   In the second memory access trace information acquisition device of the present invention, the offset value comparison unit compares the offset value stored in the offset value storage unit with the previous offset value to determine whether they match. When the counter determines that the offset value matches the previous offset value, the counter counts the number of matches, and the trace information output unit determines that the offset value is the previous offset value. When it is determined that the value does not match the offset value, the access address, the offset value, and the counter value are output.

この構成により、オフセット値の一致する回数をカウントすることで出力するトレース情報の量を減少させることができ、従来に比べてより多くのメモリアクセス状況を取得することが可能となる。   With this configuration, it is possible to reduce the amount of trace information to be output by counting the number of times the offset values match, and it is possible to acquire more memory access situations than in the past.

また、本発明の第3のメモリアクセストレース情報取得装置は、前記CPUの前記プログラムを実行するイベントを検出するイベント検出部を有し、前記オフセット値格納部は、検出した前記イベント間における前記オフセット値を格納するオフセット値バッファおよび前記オフセット値群を示すパターンを格納するパターンバッファを有し、前記オフセット値比較部は、前記オフセット値バッファに格納した前記オフセット値と前記パターンバッファ格納したパターンを比較して、一致するか否かを判定し、前記カウンタは、前記オフセット値バッファの内容が前記パターンと一致すると判定した場合に、一致した回数をカウントし、前記トレース情報出力部は、前記オフセット値バッファの内容が前記パターンと一致しないと判定した場合に、前記パターン及び前記前記カウンタの値を出力する構成としている。   The third memory access trace information acquisition apparatus of the present invention has an event detection unit that detects an event of executing the program of the CPU, and the offset value storage unit is configured to detect the offset between the detected events. An offset value buffer for storing a value and a pattern buffer for storing a pattern indicating the offset value group, wherein the offset value comparison unit compares the offset value stored in the offset value buffer with the pattern stored in the pattern buffer. And the counter counts the number of times of matching when it is determined that the content of the offset value buffer matches the pattern, and the trace information output unit outputs the offset value. If it is determined that the buffer contents do not match the pattern To, and configured to output the pattern and the value of said counter.

この構成により、オフセット値が一定でない範囲を省略することができるので、出力する情報量を減少させることが可能となり、従来に比べてより多くのメモリアクセス状況を取得することができる。   With this configuration, it is possible to omit a range in which the offset value is not constant, so that it is possible to reduce the amount of information to be output, and it is possible to acquire more memory access situations than in the past.

また、本発明の第1のプログラムは、上記のメモリアクセストレース情報取得方法の各ステップをコンピュータに実行させるためのプログラム。   A first program of the present invention is a program for causing a computer to execute each step of the memory access trace information acquisition method.

これにより、本発明をコンピュータの処理によって実現することができ、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することが可能となる。   As a result, the present invention can be realized by computer processing, and data indicating the access status to the memory can be efficiently acquired as trace information necessary for debugging work, and a memory having a limited storage capacity can be used effectively. Thus, the trace information pattern can be efficiently detected.

また、本発明の第1の記録媒体は、上記のプログラムを記録したコンピュータ読み取り可能な記録媒体である。   The first recording medium of the present invention is a computer-readable recording medium on which the above program is recorded.

これにより、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することが可能となる。   As a result, data indicating the access status to the memory can be efficiently acquired as trace information necessary for debugging, and the trace information pattern can be efficiently detected by effectively using the memory with limited storage capacity. It becomes.

本発明によれば、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することを可能にするメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体を提供できる。   According to the present invention, data indicating an access status to a memory can be efficiently acquired as trace information necessary for debugging work, and a trace information pattern can be efficiently detected by effectively using a memory having a limited storage capacity. A memory access trace information acquisition method, a memory access trace information acquisition device, a memory access trace information acquisition program, and a recording medium can be provided.

以下、本発明に係るメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体の複数の実施形態について説明する。尚、記録媒体にはメモリアクセストレース情報取得プログラムが記録されている。   Hereinafter, a plurality of embodiments of a memory access trace information acquisition method, a memory access trace information acquisition device, a memory access trace information acquisition program, and a recording medium according to the present invention will be described. Note that a memory access trace information acquisition program is recorded on the recording medium.

(第1の実施形態)
まず、本発明に係る第1の実施形態のプロセッサを例示する。図1は、本実施形態に係るプロセッサの概略構成を示すブロック図である。
(First embodiment)
First, the processor according to the first embodiment of the present invention is illustrated. FIG. 1 is a block diagram showing a schematic configuration of a processor according to the present embodiment.

図1において、プロセッサ100は、各部の制御を行う中央処理装置(CPU)101と、プログラム及びデータを格納するメモリ102と、プログラムの実行によってCPU101がアクセスしたアクセスアドレスを取得するメモリアクセスアドレス取得部103と、取得したアドレスを格納するアドレス格納部104と、アドレス格納部104に格納されている最新のアドレスと一つ前のアドレスからオフセット値を計算するオフセット値計算部105と、計算したオフセット値を格納するオフセット値格納部106と、オフセット格納部106に格納されている最新のオフセット値と一つ前のオフセット値を比較して両者が一致するか否かを判定するオフセット値比較部107と、判定の結果で最新のオフセット値と一つ前のオフセット値が一致した場合に、一致した回数をカウントするカウンタ106aと、最新のオフセット値と一つ前の一致しない場合に、アドレス格納部104に格納されているオフセットの基準となるベースアドレスとオフセット値格納部106に格納されているオフセット値、及びカウンタ106aのカウント値を出力するメモリアクセスアドレス情報出力部108を有する構成である。   1, a processor 100 includes a central processing unit (CPU) 101 that controls each unit, a memory 102 that stores a program and data, and a memory access address acquisition unit that acquires an access address accessed by the CPU 101 by executing the program. 103, an address storage unit 104 that stores the acquired address, an offset value calculation unit 105 that calculates an offset value from the latest address and the previous address stored in the address storage unit 104, and the calculated offset value An offset value storage unit 106 that stores the offset value, and an offset value comparison unit 107 that compares the latest offset value stored in the offset storage unit 106 with the previous offset value to determine whether or not they match. The latest offset value and the previous offset in the judgment result When the values match, the counter 106a that counts the number of times of matching, and the base address and offset value that serve as a reference for the offset stored in the address storage unit 104 when the latest offset value does not match the previous one The memory access address information output unit 108 outputs the offset value stored in the storage unit 106 and the count value of the counter 106a.

プロセッサ100は、CPU101がメモリ102に格納されたメモリアクセストレース情報取得プログラムを実行することによりメモリアクセストレース情報取得装置として機能し、トレース情報の生成対象である対象プログラムを実行する際のメモリアクセストレース情報を取得して出力する。   The processor 100 functions as a memory access trace information acquisition device by the CPU 101 executing a memory access trace information acquisition program stored in the memory 102, and a memory access trace when executing a target program for which trace information is generated Obtain and output information.

対象プログラムは、C言語を用いて記述されることがある。C言語で記述されたプログラムは、C言語コンパイラによってプロセッサ100が理解することが可能な機械語とほぼ1対1に対応するアセンブリ言語に変換される。さらに、このアセンブリ言語は、アセンブラとリンカによってプロセッサ100上で実行可能な機械語に変換される。   The target program may be described using C language. A program written in the C language is converted into an assembly language that substantially corresponds to a machine language that can be understood by the processor 100 by a C language compiler. Further, the assembly language is converted into a machine language that can be executed on the processor 100 by an assembler and a linker.

図2は、C言語ソースコード10の一部がC言語コンパイラによってどのようにアセンブリ言語コード11に変換されるかの例を示したものである。   FIG. 2 shows an example of how a part of the C language source code 10 is converted into the assembly language code 11 by the C language compiler.

図2(a)に示すC言語ソースコード10の破線で囲まれた実行文は、図2(b)に示すアセンブリ言語コード11の破線で囲まれた部分に対応する。ここで、アセンブリ言語コード11の破線内の“PC”は、命令アドレスを示すプログラムカウンタ値を示し、“MNEMONIC”は、“PC”に対応するニーモニックを示している。   The executable statement surrounded by the broken line of the C language source code 10 shown in FIG. 2A corresponds to the portion surrounded by the broken line of the assembly language code 11 shown in FIG. Here, “PC” in the broken line of the assembly language code 11 indicates a program counter value indicating an instruction address, and “MNEMONIC” indicates a mnemonic corresponding to “PC”.

図3は、図2の対象プログラムを実行した際のメモリアクセストレース情報の例を示すものである。図3(a)に示す従来のメモリアクセストレース情報20は、基本となるアドレス、オフセット値、オフセット値の繰り返し回数を計算することで、情報を圧縮した図3(b)に示すようなメモリアクセストレース情報21に変換することができる。ここで、“ADRS”はメモリアクセスが発生したアドレス、“#”はメモリアクセスアドレスの前回とのオフセット値、“REPEAT”はオフセット値の繰り返し回数を表している。   FIG. 3 shows an example of memory access trace information when the target program of FIG. 2 is executed. The conventional memory access trace information 20 shown in FIG. 3A is a memory access as shown in FIG. 3B in which information is compressed by calculating a basic address, an offset value, and the number of repetitions of the offset value. Trace information 21 can be converted. Here, “ADRS” represents an address at which a memory access has occurred, “#” represents an offset value with respect to the previous memory access address, and “REPEAT” represents the number of repetitions of the offset value.

次に、以上のように構成された本実施形態のプロセッサについて、メモリアクセストレース情報の取得処理方法を説明する。図4は、本実施形態におけるメモリアクセストレース情報の取得処理手順を説明するためのフローチャートである。   Next, a memory access trace information acquisition processing method for the processor of the present embodiment configured as described above will be described. FIG. 4 is a flowchart for explaining a memory access trace information acquisition processing procedure according to this embodiment.

ステップS100の初期化手順において、CPU101がカウンタ106aに初期値“1”を、終了フラグに“OFF”をそれぞれセットするとともに、アドレス格納部104がベースアドレス及び比較アドレス1、2、オフセット格納部106が比較オフセット値1、2をそれぞれクリアする。   In the initialization procedure of step S100, the CPU 101 sets the initial value “1” in the counter 106a and “OFF” in the end flag, and the address storage unit 104 sets the base address and comparison addresses 1 and 2, and the offset storage unit 106. Clears the comparison offset values 1 and 2, respectively.

まず、メモリアクセスアドレス取得部103がメモリアクセスアドレスを取得できたか否かを判定し(ステップS101)、メモリアクセスアドレスを取得できたと判定した場合は、アドレス格納部104がベースアドレスが空であるか否かを判定する(ステップS102)。   First, it is determined whether or not the memory access address acquisition unit 103 has acquired a memory access address (step S101). If it is determined that the memory access address has been acquired, the address storage unit 104 has an empty base address. It is determined whether or not (step S102).

ステップS102における判定の結果、ベースアドレスが空であると判定した場合は、アドレス格納部104が取得したアドレスをベースアドレス及び比較アドレス1にそれぞれセットして(ステップS103、ステップS104)、ステップS101の手順に戻り、次のメモリアクセスアドレスを取得したか否かを判定する。   As a result of the determination in step S102, if it is determined that the base address is empty, the address acquired by the address storage unit 104 is set as the base address and the comparison address 1 (step S103, step S104), Returning to the procedure, it is determined whether or not the next memory access address has been acquired.

一方、ステップS101の手順でメモリアクセスアドレスを取得できなかったと判定した場合は、CPU101が終了フラグを“ON”にセットして(ステップS120)、後述するステップS113にスキップする。   On the other hand, if it is determined in step S101 that the memory access address could not be acquired, the CPU 101 sets the end flag to “ON” (step S120), and skips to step S113 described later.

また、ステップS102の手順でベースアドレスが空でないと判定した場合は、アドレス格納部104が取得したアドレスを比較アドレス2にセットして(ステップS105)、オフセット値計算部105が比較アドレス1と比較アドレス2のオフセット値を計算する(ステップS106)。   If it is determined in step S102 that the base address is not empty, the address acquired by the address storage unit 104 is set to the comparison address 2 (step S105), and the offset value calculation unit 105 compares it with the comparison address 1. An offset value of address 2 is calculated (step S106).

次に、アドレス格納部104が比較アドレス2のアドレスを比較アドレス1にセットして(ステップS107)、オフセット値格納部106が比較オフセット値1が空であるか否かを判定する(ステップS108)。その結果、比較オフセット値1が空であると判定した場合は、オフセット値格納部106がステップS106の手順で計算したオフセット値を比較オフセット値1にセットして(ステップS109)、ステップS101の手順に戻る。   Next, the address storage unit 104 sets the address of the comparison address 2 to the comparison address 1 (step S107), and the offset value storage unit 106 determines whether or not the comparison offset value 1 is empty (step S108). . As a result, if it is determined that the comparison offset value 1 is empty, the offset value storage unit 106 sets the offset value calculated in the procedure of step S106 to the comparison offset value 1 (step S109), and the procedure of step S101. Return to.

一方、ステップS108の手順において、比較オフセット値1が空でないと判定した場合は、オフセット値格納部106がステップS106の手順で計算したオフセット値を比較オフセット値2にセットし(ステップS110)、オフセット値比較部107が比較オフセット値1と比較オフセット値2が同じであるか否かを判定する(ステップS111)。   On the other hand, if it is determined in step S108 that the comparison offset value 1 is not empty, the offset value storage unit 106 sets the offset value calculated in step S106 to the comparison offset value 2 (step S110). The value comparison unit 107 determines whether or not the comparison offset value 1 and the comparison offset value 2 are the same (step S111).

ステップS111における判定の結果、比較オフセット値1と比較オフセット値2が同じであると判定した場合は、オフセット値計算部105がカウンタ106aの値を“1”増加して(ステップS112)、ステップS101の手順に戻る。   As a result of the determination in step S111, when it is determined that the comparison offset value 1 and the comparison offset value 2 are the same, the offset value calculation unit 105 increases the value of the counter 106a by “1” (step S112), and step S101. Return to the procedure.

一方、ステップS111の手順で比較オフセット値1と比較オフセット値2が同じでないと判定した場合は、メモリアクセスアドレス情報出力部108がベースアドレスを出力するとともに(ステップS113)、オフセット値比較部107がカウンタ106aの値が“1”より大きいか否かを判定する(ステップS114)。その結果、カウンタ値は“1”より大きいと判定した場合は、メモリアクセスアドレス情報出力部108が比較オフセット値1及びカウンタ106aのカウンタ値をそれぞれ出力する(ステップS115、S116)。   On the other hand, when it is determined in the procedure of step S111 that the comparison offset value 1 and the comparison offset value 2 are not the same, the memory access address information output unit 108 outputs the base address (step S113), and the offset value comparison unit 107 It is determined whether or not the value of the counter 106a is greater than “1” (step S114). As a result, when it is determined that the counter value is greater than “1”, the memory access address information output unit 108 outputs the comparison offset value 1 and the counter value of the counter 106a, respectively (steps S115 and S116).

また、ステップS114の手順でカウンタ106aのカウンタ値が“1”以下であると判定した場合は、ステップS117の手順にスキップする。   If it is determined in step S114 that the counter value of the counter 106a is “1” or less, the process skips to step S117.

ステップS117では、CPU101が終了フラグが“ON”であるか否かを判定し、終了フラグが“OFF”であると判定した場合は、CPU101がカウンタ106aの値と比較オフセット値1を初期値に戻すとともに(ステップS118)、アドレス格納部104が取得したメモリアクセスアドレスをベースアドレスにセットして(ステップS119)、ステップS101の手順に戻り、次のメモリアクセスアドレスを取得する。   In step S117, the CPU 101 determines whether or not the end flag is “ON”. If the end flag is determined to be “OFF”, the CPU 101 sets the value of the counter 106a and the comparison offset value 1 to the initial values. At the same time, the memory access address acquired by the address storage unit 104 is set as the base address (step S119), and the procedure returns to step S101 to acquire the next memory access address.

一方、ステップS117において、終了フラグが“ON”であると判定した場合は、メモリアクセストレース情報の取得処理を終了する。   On the other hand, if it is determined in step S117 that the end flag is “ON”, the memory access trace information acquisition process ends.

次に、本実施形態におけるメモリアクセストレース情報取得処理の具体例について、図3を参照しながら説明する。   Next, a specific example of the memory access trace information acquisition process in the present embodiment will be described with reference to FIG.

図3(a)において、初めにアドレス“0x10”のデータを取得すると、図4に示したフローチャートのステップS102の手順でベースアドレスは空であるので、アドレス“0x10”はステップS103の手順でベースアドレスにセットされ、ステップ104の手順で比較アドレス1にセットされる。   In FIG. 3A, when the data of the address “0x10” is acquired first, the base address is empty in the procedure of step S102 in the flowchart shown in FIG. 4, so the address “0x10” is the base in the procedure of step S103. The address is set, and the comparison address 1 is set in the procedure of step 104.

次に、アドレス“0x14”のデータを取得すると、ステップS102の手順では、ベースアドレスに“0x10”が既にセットされているので空ではないと判定され、取得したアドレス“0x14”は、ステップS105の手順で比較アドレス2にセットされる。   Next, when the data of the address “0x14” is acquired, in the procedure of step S102, it is determined that it is not empty because “0x10” is already set in the base address, and the acquired address “0x14” is determined in step S105. Set to comparison address 2 in the procedure.

ステップS106では、比較アドレス1に格納されているアドレス“0x10”と、比較アドレス2に格納されているアドレス“0x14”のオフセット値をオフセット値計算部105によって計算し、“#0x4”を得る。そして、次のデータに対する比較に備えるために、続くステップS107の手順で比較アドレス2に格納されているアドレス“0x14”を比較アドレス1にセットする。   In step S106, the offset value of the address “0x10” stored in the comparison address 1 and the address “0x14” stored in the comparison address 2 is calculated by the offset value calculation unit 105 to obtain “# 0x4”. Then, in order to prepare for the comparison with respect to the next data, the address “0x14” stored in the comparison address 2 is set to the comparison address 1 in the subsequent step S107.

次に、ステップS108における判定の結果、比較オフセット値1は空となっているので、ステップS106の手順で計算したオフセット値“#0x4”を、続くステップS109の手順で比較オフセット値1にセットする。   Next, since the comparison offset value 1 is empty as a result of the determination in step S108, the offset value “# 0x4” calculated in the procedure of step S106 is set to the comparison offset value 1 in the procedure of subsequent step S109. .

次いで、アドレス“0x18”のデータを取得すると、上記したと同様にステップS108までの処理を実行する。   Next, when the data of the address “0x18” is acquired, the processing up to step S108 is executed as described above.

ステップS108では、比較オフセット値1に“#0x4”が格納されているため、ステップS110の手順に進んで比較オフセット値2に“0x14”と“0x18”のオフセット値“#0x4”をセットし、更に、ステップS111においてこれら二つのオフセット値が同じであるか否かの判定を行う。   In step S108, since “# 0x4” is stored in the comparison offset value 1, the procedure proceeds to step S110, and the offset value “# 0x4” of “0x14” and “0x18” is set in the comparison offset value 2. Further, in step S111, it is determined whether or not these two offset values are the same.

ここで、比較オフセット値1と比較オフセット値2にそれぞれ格納されているオフセット値は、同じ“#0x4”であるので、ステップS112の手順でカウンタ106aにおけるカウンタ値を“1”増やして“2”に変更する。   Here, since the offset values stored in the comparison offset value 1 and the comparison offset value 2 are the same “# 0x4”, the counter value in the counter 106a is incremented by “1” and “2” in the procedure of step S112. Change to

次のアドレス“0x1C”のデータからアドレス“0x2C”のデータまで同様の処理を行うと、ベースアドレスが“0x10”、比較アドレス1が“0x2C”、比較オフセット値1が“#0x4”、カウンタ値が“7”という状態になる。   If the same processing is performed from the data of the next address “0x1C” to the data of address “0x2C”, the base address is “0x10”, the comparison address 1 is “0x2C”, the comparison offset value 1 is “# 0x4”, and the counter value Becomes “7”.

続いて、例えばアドレス“0x100”のデータを取得したとすると、上記したと同様に、ステップS108までの処理を行う。   Subsequently, for example, if the data of the address “0x100” is acquired, the processing up to step S108 is performed as described above.

ステップS108では、比較オフセット値1に“#0x4”が格納されているため、ステップS110の処理手順で、比較オフセット値2に“0x2C”と“0x100”のオフセット値“#0xD4”をセットし、ステップS111の手順オフセット値が同じかどうかの判定処理を行う。   In step S108, since “# 0x4” is stored in the comparison offset value 1, “0x2C” and “0x100” offset values “# 0xD4” are set in the comparison offset value 2 in the processing procedure of step S110. It is determined whether or not the procedure offset values in step S111 are the same.

ここで、比較オフセット値1と比較オフセット値2に格納されているオフセット値は、それぞれ“#0x4”と“#0xD4”になっていて異なっているので、ステップS113の手順でベースアドレス“0x10”を出力するとともに、次のステップS114の手順でカウンタ値が“1”より大きいか否かを判定する。   Here, since the offset values stored in the comparison offset value 1 and the comparison offset value 2 are “# 0x4” and “# 0xD4”, respectively, the base address “0x10” is different in the procedure of step S113. And at the next step S114, it is determined whether or not the counter value is larger than “1”.

このとき、カウンタ106aのカウンタ値は“7”となっていて“1”より大きいので、比較オフセット値1に格納されているオフセット値“#0x4”と、カウンタ値“7”を出力して、終了フラグの状態を判定するステップS117の処理を行う。   At this time, since the counter value of the counter 106a is “7” and is larger than “1”, the offset value “# 0x4” stored in the comparison offset value 1 and the counter value “7” are output, The process of step S117 for determining the state of the end flag is performed.

ステップS117の手順では、終了フラグが初期値の“OFF”であるため、続くステップS118の手順において、カウンタ106aのカウンタ値“7”と、比較オフセット値1に格納されているオフセット値“#0x4”をクリアし、更にステップS119の手順で取得したアドレス“0x100”をベースアドレスにセットしてステップS101の手順に戻り、メモリアクセスアドレスを取得したか否かの判定を繰り返す。   In the procedure of step S117, the end flag is the initial value “OFF”. Therefore, in the subsequent procedure of step S118, the counter value “7” of the counter 106a and the offset value “# 0x4” stored in the comparison offset value 1 are used. "Is cleared, the address" 0x100 "acquired in the procedure of step S119 is set as the base address, and the process returns to the procedure of step S101 to repeat the determination of whether or not the memory access address has been acquired.

そして、ステップS101の手順で、例えば次のアドレスが取得できなかった場合は、ステップS120の手順で終了フラグを“ON”にセットしてからステップS113の手順に進み、ベースアドレス“0x100”を出力する。   If, for example, the next address cannot be acquired in the procedure of step S101, the end flag is set to “ON” in the procedure of step S120, and then the process proceeds to the procedure of step S113 to output the base address “0x100”. To do.

次のステップS114では、カウンタ値が初期値“1”になっているので、ステップS117にジャンプして終了フラグを判定する処理を実行する。その結果、終了フラグはステップS120で“ON”にセットしてあったので、メモリアクセストレース情報取得処理を終了し、図3(b)に示すようなメモリアクセストレース情報21を取得することができる。   In the next step S114, since the counter value is the initial value “1”, the process jumps to step S117 to determine the end flag. As a result, since the end flag was set to “ON” in step S120, the memory access trace information acquisition process can be ended and the memory access trace information 21 as shown in FIG. 3B can be acquired. .

以上説明したように、このような本発明に係る第1の実施形態のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、記録媒体によれば、オフセット値の一致する回数をカウントすることで出力するトレース情報の量を減少させることができ、デバッグ作業に必要なメモリアクセス状況を効率良く取得することが可能となる。   As described above, according to the memory access trace information acquisition method, the memory access trace information acquisition device, the memory access trace information acquisition program, and the recording medium according to the first embodiment of the present invention, the offset values match. By counting the number of times of execution, the amount of trace information to be output can be reduced, and the memory access status required for debugging can be acquired efficiently.

(第2の実施形態)
まず、本発明の第2の実施形態に係るプロセッサを例示する。図5は、第2の実施形態に係るプロセッサの概略構成を示すブロック図である。
(Second Embodiment)
First, a processor according to the second embodiment of the present invention will be exemplified. FIG. 5 is a block diagram illustrating a schematic configuration of a processor according to the second embodiment.

図5において、プロセッサ200は、各部の制御を行うCPU201と、プログラム及びデータを格納するメモリ202と、CPU202がアクセスしたメモリアクセスアドレスを取得するメモリアクセスアドレス取得部203と、取得したアドレスを格納するアドレス格納部204と、イベントを検出するイベント検出部205と、アドレス格納部204に格納されている最新のアドレスと一つ前のアドレスからオフセット値を計算するオフセット値計算部206と、計算したオフセット値を格納するオフセット値格納部207と、検出したイベントからイベントまでのオフセット値を格納する一時格納バッファ208と、オフセット値のパターンを格納するパターンバッファ209と、一時格納バッファ208によって格納されたオフセット値とパターンバッファ209によって格納されたオフセット値のパターンを比較して両者が一致するか否かを判定するパターン比較部210と、パターン比較部210における判定で、一時格納バッファ208によって格納されたオフセット値とパターンバッファ209によって格納されたオフセット値のパターンが一致した場合に、一致した回数をカウントするカウンタ209aと、パターン比較部210における判定で、一時格納バッファ208によって格納されたオフセット値とパターンバッファ209によって格納されたオフセット値のパターンが一致しない場合に、パターンバッファ209によって格納されているオフセット値を出力するメモリアクセスアドレス情報出力部211を有する構成である。   In FIG. 5, a processor 200 stores a CPU 201 that controls each unit, a memory 202 that stores programs and data, a memory access address acquisition unit 203 that acquires a memory access address accessed by the CPU 202, and an acquired address. An address storage unit 204, an event detection unit 205 that detects an event, an offset value calculation unit 206 that calculates an offset value from the latest address stored in the address storage unit 204 and the previous address, and a calculated offset An offset value storage unit 207 for storing values, a temporary storage buffer 208 for storing offset values from detected events to events, a pattern buffer 209 for storing patterns of offset values, and an offset stored by the temporary storage buffer 208 A pattern comparison unit 210 that determines whether or not the two match with each other by comparing the offset value stored in the pattern buffer 209 with the pattern value stored in the pattern buffer 209, When the offset value and the pattern of the offset value stored in the pattern buffer 209 match, the counter 209a that counts the number of times of matching and the offset value and pattern stored in the temporary storage buffer 208 by the determination in the pattern comparison unit 210 The memory access address information output unit 211 outputs the offset value stored in the pattern buffer 209 when the pattern of the offset value stored in the buffer 209 does not match.

プロセッサ200は、CPU201がメモリ202に格納されたトレース情報取得プログラムを実行することによりメモリアクセストレース情報取得装置として機能し、トレース情報の生成対象である対象プログラムを実行する際のメモリアクセストレース情報を取得して出力する。なお、本実施形態の対象プログラムは、前述した第1の実施の形態における対象プログラムと同じであるので、説明を省略する。   The processor 200 functions as a memory access trace information acquisition device by the CPU 201 executing the trace information acquisition program stored in the memory 202, and obtains memory access trace information when executing the target program for which the trace information is generated. Obtain and output. Note that the target program of the present embodiment is the same as the target program of the first embodiment described above, and a description thereof will be omitted.

図6は、C言語ソースコード12の一部がC言語コンパイラによってどのようにアセンブリ言語コード13に変換されるかの例を示したものである。   FIG. 6 shows an example of how a part of C language source code 12 is converted into assembly language code 13 by a C language compiler.

図6(a)に示すC言語ソースコード12の破線で囲まれた実行文は、図6(b)に示すアセンブリ言語コード13の破線で囲まれた部分に対応する。ここで、アセンブリ言語コード13の破線内の“PC”は、命令アドレスを示すプログラムカウンタ値を示し、“MNEMONIC”は“PC”に対応するニーモニックを示している。   The executable statement surrounded by the broken line of the C language source code 12 shown in FIG. 6A corresponds to the portion surrounded by the broken line of the assembly language code 13 shown in FIG. Here, “PC” in the broken line of the assembly language code 13 indicates a program counter value indicating an instruction address, and “MNEMONIC” indicates a mnemonic corresponding to “PC”.

図7は、図6に示す対象プログラムを実行した際のメモリアクセストレース情報の例を示したものである。図7(a)に示す従来のメモリアクセストレース情報22は、基本となるアドレス、オフセット値、オフセット値の繰り返し回数を計算することで、情報を圧縮した図7(b)に示すようなメモリアクセストレース情報23に変換することができる。ここで、“LOOP”は分岐によりループの先頭に戻るイベント、“LOOP_BEGIN”及び“LOOP_END”は、それぞれパターンの開始と終了を表している。   FIG. 7 shows an example of memory access trace information when the target program shown in FIG. 6 is executed. The conventional memory access trace information 22 shown in FIG. 7A is a memory access as shown in FIG. 7B in which information is compressed by calculating the basic address, offset value, and number of repetitions of the offset value. Trace information 23 can be converted. Here, “LOOP” represents an event that returns to the top of the loop by branching, and “LOOP_BEGIN” and “LOOP_END” represent the start and end of the pattern, respectively.

次に、以上のように構成された本実施形態のプロセッサについて、メモリアクセストレース情報の取得処理方法を説明する。図8は、本実施形態におけるメモリアクセストレース情報の取得処理手順を説明するためのフローチャートである。   Next, a memory access trace information acquisition processing method for the processor of the present embodiment configured as described above will be described. FIG. 8 is a flowchart for explaining the memory access trace information acquisition processing procedure in this embodiment.

ステップS200の初期化手順において、CPU201がカウンタ209aに初期値“1”を、終了フラグに“OFF”をそれぞれ設定するとともに、一時格納バッファ208、パターンバッファ209をそれぞれクリアする。   In the initialization procedure of step S200, the CPU 201 sets the initial value “1” in the counter 209a and “OFF” in the end flag, and clears the temporary storage buffer 208 and the pattern buffer 209, respectively.

まず、ステップS201においてイベント検出部205がイベントを取得し、パターン比較部210が取得したイベントが指定のイベントと一致するか否かを判定する(ステップS202)。   First, in step S201, the event detection unit 205 acquires an event, and determines whether the event acquired by the pattern comparison unit 210 matches a specified event (step S202).

判定の結果、イベントが一致しない場合は、ステップS203においてメモリアクセスアドレス取得部203がメモリアクセスアドレスを取得したか否かを判定する。その結果、取得したと判定した場合は、メモリアクセスアドレス取得部203がそのメモリアクセスアドレスが初めて取得したものであるか否かを判定する(ステップS204)。   If the event does not match as a result of the determination, it is determined in step S203 whether or not the memory access address acquisition unit 203 has acquired the memory access address. As a result, if it is determined that the memory access address has been acquired, the memory access address acquisition unit 203 determines whether or not the memory access address has been acquired for the first time (step S204).

取得したメモリアクセスアドレスが初めてのものであると判定した場合は、アドレス格納部204がそのメモリアクセスアドレスを比較アドレス1にセットする(ステップS205)とともに、メモリアクセスアドレス情報出力部211がその情報を出力して(ステップS206)、ステップS201の手順に戻り、イベント検出部205によって次のイベントを取得する。   If it is determined that the acquired memory access address is the first one, the address storage unit 204 sets the memory access address to the comparison address 1 (step S205), and the memory access address information output unit 211 stores the information. In step S206, the process returns to step S201, and the event detection unit 205 acquires the next event.

一方、ステップS202の手順で取得したイベントが指定のイベントと一致したと判定した場合は、後述するステップS211にスキップする。   On the other hand, if it is determined that the event acquired in step S202 matches the specified event, the process skips to step S211 described later.

また、ステップS203の手順でメモリアクセスアドレスを取得できなかったと判定した場合は、CPU201が終了フラグを“ON”にセットして(ステップS220)、後述するステップS211にスキップする。   If it is determined that the memory access address could not be acquired in the procedure of step S203, the CPU 201 sets the end flag to “ON” (step S220) and skips to step S211 described later.

更に、ステップS204の手順で、取得したメモリアクセスアドレスが2回目以降のものであると判定した場合は、アドレス格納部204がそのメモリアクセスアドレスを比較アドレス2にセットする(ステップS207)。   Furthermore, when it is determined in the procedure of step S204 that the acquired memory access address is the second or later, the address storage unit 204 sets the memory access address to the comparison address 2 (step S207).

続いて、比較アドレス1及び比較アドレス2にそれぞれセットしてあるメモリアクセスアドレスからそのオフセット値をオフセット計算部206が計算して(ステップS208)、一時格納バッファ208が計算結果を格納する(ステップS209)。   Subsequently, the offset calculation unit 206 calculates the offset value from the memory access addresses set in the comparison address 1 and the comparison address 2, respectively (step S208), and the temporary storage buffer 208 stores the calculation result (step S209). ).

そして、アドレス格納部204が比較アドレス2にセットしてあるメモリアクセスアドレスを比較アドレス1にセットした後(ステップS210)、ステップS201の手順に戻る。   Then, after the memory storage address set in the comparison address 2 by the address storage unit 204 is set in the comparison address 1 (step S210), the process returns to the procedure of step S201.

ステップS211では、パターン比較部210が一時格納バッファ208によって格納されているオフセット値のパターンがパターンバッファ209に格納されているパターンと一致するか否かを判定する。   In step S <b> 211, the pattern comparison unit 210 determines whether or not the offset value pattern stored in the temporary storage buffer 208 matches the pattern stored in the pattern buffer 209.

判定の結果、パターンが一致した場合は、CPU201がカウンタ209aの値を“1”増加させ(ステップS212)、一時格納バッファ208をクリアして(ステップS219)、ステップS201の手順に戻り、イベント検出部205によって次のイベントを取得する。   If the pattern matches, the CPU 201 increments the value of the counter 209a by “1” (step S212), clears the temporary storage buffer 208 (step S219), returns to the procedure of step S201, and detects an event. The next event is acquired by the unit 205.

一方、ステップS211における判定の結果、パターンが一致しない場合は、メモリアクセスアドレス情報出力部211がステップS213でパターンバッファ209によって格納されているパターンを出力し、続くステップS214において、パターン比較部210がカウンタ209aの値が“1”より大きいか否かを判定する。   On the other hand, if the result of determination in step S211 is that the patterns do not match, the memory access address information output unit 211 outputs the pattern stored in the pattern buffer 209 in step S213, and in step S214, the pattern comparison unit 210 It is determined whether or not the value of the counter 209a is greater than “1”.

ステップS214における判定の結果、カウンタ値が“1”より大きい場合は、メモリアクセスアドレス情報出力部211がそのカウンタ値を出力して(ステップS215)、続くステップS216の手順に進む。一方、ステップS214でカウンタ値が“1”以下であると判定した場合は、ステップS216の手順にスキップする。   As a result of the determination in step S214, if the counter value is greater than “1”, the memory access address information output unit 211 outputs the counter value (step S215), and the process proceeds to the subsequent step S216. On the other hand, if it is determined in step S214 that the counter value is “1” or less, the procedure skips to step S216.

ステップS216では、CPU201が終了フラグが“ON”であるか否かを判定する。判定の結果、“ON”ではないと判定した場合は、続くステップS217で、CPU201がカウンタ209aに“1”をセットして初期値に戻すとともに、一時格納バッファ208の内容をパターンバッファ209に反映して(ステップS218)、ステップS219の手順に進み、一時格納バッファ208をクリアする。   In step S216, the CPU 201 determines whether or not the end flag is “ON”. As a result of the determination, if it is determined that it is not “ON”, the CPU 201 sets “1” to the counter 209a to return to the initial value and reflects the contents of the temporary storage buffer 208 in the pattern buffer 209 in the following step S217. Then (step S218), the process proceeds to step S219, and the temporary storage buffer 208 is cleared.

一方、ステップS216で終了フラグが“ON”であると判定した場合は、メモリアクセスアドレス情報出力部211が一時格納バッファ208の内容を出力して(ステップS221)、メモリアクセストレース情報の取得処理を終了する。   On the other hand, if it is determined in step S216 that the end flag is “ON”, the memory access address information output unit 211 outputs the contents of the temporary storage buffer 208 (step S221), and the memory access trace information acquisition process is performed. finish.

なお、以上のメモリアクセストレース情報取得処理手順では、初期化手順ステップS200でパターンバッファ209の内容を空にしているが、検出頻度が高いか、叉は、始めに出やすいパターン等を格納しておいてもよい。   In the above memory access trace information acquisition processing procedure, the contents of the pattern buffer 209 are emptied in the initialization procedure step S200. However, the detection frequency is high, or a pattern that is likely to appear first is stored. It may be left.

また、ステップS201ではイベントを取得しているが、分岐などの特定の命令や、ユーザが挿入したイベント、ループの先頭などに置き換えてもよい。   In step S201, an event is acquired, but it may be replaced with a specific instruction such as a branch, an event inserted by a user, the head of a loop, or the like.

次に、本実施形態におけるメモリアクセストレース情報取得処理の具体例について、図7を参照しながら説明する。   Next, a specific example of the memory access trace information acquisition process in the present embodiment will be described with reference to FIG.

図7(a)において、初めにアドレス“0x10”のデータを取得すると、ステップS204の手順で初めてのメモリアクセスアドレスと判定され、取得したアドレス“0x10”がステップS205の手順で比較アドレス1にセットされるとともに、次のステップS206の手順で出力される。   In FIG. 7A, when the data of the address “0x10” is acquired first, it is determined as the first memory access address in the procedure of step S204, and the acquired address “0x10” is set to the comparison address 1 in the procedure of step S205. At the same time, it is output in the procedure of the next step S206.

次に、アドレス“0x30”のデータを取得すると、ステップS204の手順で2回目以降のアドレスと判定されるので、ステップS207において、この取得したアドレス“0x30”が比較アドレス2にセットされる。   Next, when the data of the address “0x30” is acquired, it is determined as the second and subsequent addresses in the procedure of step S204. Therefore, the acquired address “0x30” is set as the comparison address 2 in step S207.

ステップS208では、比較アドレス1に格納されているアドレス“0x10”と、比較アドレス2に格納されているアドレス“0x30”のオフセット値“#0x20”をオフセット値計算部206によって計算し、ステップS209の手順でこのオフセット値“#0x20”を一時格納バッファ208によって格納する。そして、次のデータに対する比較に備えるため、ステップS210で比較アドレス2に格納されているアドレス“0x30”を比較アドレス1にセットする。   In step S208, the offset value “# 0x20” of the address “0x10” stored in the comparison address 1 and the address “0x30” stored in the comparison address 2 is calculated by the offset value calculation unit 206. The offset value “# 0x20” is stored in the temporary storage buffer 208 in the procedure. Then, to prepare for comparison with the next data, the address “0x30” stored in the comparison address 2 is set to the comparison address 1 in step S210.

次に、アドレス“0x50”を取得すると、上記したと同様にステップS209までの処理を行い、一時格納バッファ208に“#0x20”、“#0x20”が格納される。   Next, when the address “0x50” is acquired, the processing up to step S209 is performed as described above, and “# 0x20” and “# 0x20” are stored in the temporary storage buffer 208.

次いで、イベント“LOOP”を取得すると、ステップS202における判定の結果、指定イベントと一致するので、ステップS211にスキップし、一時格納バッファ208によって格納されている内容“0x20”をパターンと比較して一致するか否かの判定処理を行う。   Next, when the event “LOOP” is acquired, the result of determination in step S202 matches the specified event. Therefore, the process skips to step S211 and matches the content “0x20” stored in the temporary storage buffer 208 with the pattern. Judgment processing of whether to do is performed.

ステップS211における判定の結果、パターンバッファ209は空であるので一時格納バッファ208によって格納されている内容“0x20”とは一致せず、ステップS213の処理に進んでパターンバッファ209によって格納されているパターンを出力するが、この場合パターンバッファ209は空であるので何も出力しない。   As a result of the determination in step S211, since the pattern buffer 209 is empty, it does not match the content “0x20” stored in the temporary storage buffer 208, and the process proceeds to the process in step S213 to store the pattern stored in the pattern buffer 209. In this case, since the pattern buffer 209 is empty, nothing is output.

次に、カウンタ209aの値が“1”を超えているかどうかを判定するステップS214では、カウンタ値が“1”であるのでステップS216にスキップし、終了フラグが“ON”であるか否かを判定する。すると、終了フラグは初期化設定した“OFF”のままであるので、ステップS217の手順でカウンタ209aの値をクリアするとともに、ステップS218の手順で一時格納バッファ208によって格納されている“#0x20”、“#0x20”をパターンバッファ209に反映させ、ステップS219の手順で一時格納バッファ208をクリアする。   Next, in step S214 for determining whether or not the value of the counter 209a exceeds “1”, since the counter value is “1”, the process skips to step S216 and determines whether or not the end flag is “ON”. judge. Then, since the end flag remains “OFF” that has been initialized, the value of the counter 209a is cleared in the procedure of step S217, and “# 0x20” stored in the temporary storage buffer 208 in the procedure of step S218. , “# 0x20” is reflected in the pattern buffer 209, and the temporary storage buffer 208 is cleared in the procedure of step S219.

次いで、図7(a)に示すアドレス“0x14”、“0x34”、“0x54”の各データに対して同様の処理を行うと、一時格納バッファ208にオフセット値“#−0x3C”、“#0x20”、“#0x20”が格納され、パターンバッファ209に“#0x20”、“#0x20”が格納された状態になる。   Next, when the same processing is performed on the data of the addresses “0x14”, “0x34”, “0x54” shown in FIG. 7A, the offset values “# -0x3C”, “# 0x20” are stored in the temporary storage buffer 208. "," # 0x20 "are stored, and" # 0x20 "," # 0x20 "are stored in the pattern buffer 209.

次のイベント“LOOP”に対して同様に処理を行うと、ステップS213でパターン“#0x20”、“#0x20”を出力し、ステップS218で一時格納バッファ208の内容“#−0x3C”、“#0x20”、“#0x20”をパターンバッファ209に反映する。   When the same processing is performed for the next event “LOOP”, the patterns “# 0x20” and “# 0x20” are output in step S213, and the contents “# -0x3C” and “#” of the temporary storage buffer 208 are output in step S218. 0x20 "and" # 0x20 "are reflected in the pattern buffer 209.

続いて、アドレス“0x18”、“0x38”、“0x58”の各データに対して同様の処理を行うと、一時格納バッファ208にオフセット値“#−0x3C”、“#0x20”、“#0x20”が格納され、パターンバッファ209に“#−0x3C”、“#0x20”、“#0x20”が格納された状態になる。   Subsequently, when the same processing is performed on the data of the addresses “0x18”, “0x38”, and “0x58”, the offset values “# -0x3C”, “# 0x20”, “# 0x20” are stored in the temporary storage buffer 208. Is stored, and “# -0x3C”, “# 0x20”, and “# 0x20” are stored in the pattern buffer 209.

次に、イベント“LOOP”に対してステップS211の処理を行うと、パターンが一致するため、ステップS212でカウンタの値を“1”増加して“2”に変更し、ステップS219で一時格納バッファ208をクリアする。   Next, when the process of step S211 is performed for the event “LOOP”, the patterns match, so the counter value is incremented by “1” and changed to “2” in step S212, and the temporary storage buffer in step S219. Clear 208.

次のアドレス“0x1C”のデータからアドレス“0x6C”の後に来るイベントの“LOOP”まで同様に処理を行うと、パターンバッファ209に格納されたパターンが“#−0x3C”、“#0x20”となり、カウンタ209aの値が“7”という状態になる。   If the same processing is performed from the data of the next address “0x1C” to the event “LOOP” following the address “0x6C”, the patterns stored in the pattern buffer 209 become “# -0x3C” and “# 0x20”. The value of the counter 209a becomes “7”.

そして、例えば次のアドレスが取得できなかった場合は、ステップS220の手順で終了フラグを“ON”にセットして、ステップS211の処理を実行する。   For example, if the next address cannot be acquired, the end flag is set to “ON” in the procedure of step S220, and the process of step S211 is executed.

このとき、一時格納バッファ208は空になっているのでパターンバッファ209の内容とは一致せず、ステップS213でパターンバッファ209に格納されているパターン“#−0x3C”、“#0x20”、“#0x20”を出力して、ステップS214でカウンタ209aの値が“1”より大きいかどうかを判定する。すると、カウンタ値は“7”になっているので、ステップS215の手順でこれを出力して、次のステップS216の処理を行う。   At this time, since the temporary storage buffer 208 is empty, it does not match the contents of the pattern buffer 209, and the patterns “# -0x3C”, “# 0x20”, “#” stored in the pattern buffer 209 in step S213. 0x20 "is output, and it is determined in step S214 whether the value of the counter 209a is greater than" 1 ". Then, since the counter value is “7”, this is output in the procedure of step S215, and the process of the next step S216 is performed.

ステップS216において、終了フラグは“ON”になっているのでステップS221の手順に進み、一時格納バッファ208の内容を出力する。しかし、一時格納バッファ208は空であるので、何も出力することなくメモリアクセストレース情報取得処理を終了し、図7(b)に示すようなメモリアクセストレース情報23を取得することができる。   In step S216, since the end flag is “ON”, the process proceeds to step S221, and the contents of the temporary storage buffer 208 are output. However, since the temporary storage buffer 208 is empty, the memory access trace information acquisition process can be completed without outputting anything, and the memory access trace information 23 as shown in FIG. 7B can be acquired.

以上説明したように、このような本発明に係る第2の実施形態のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、及びメモリアクセストレース情報取得プログラムによれば、オフセット値が一定でない範囲を省略することで、出力する情報量を減少させることができ、デバッグ作業に必要なメモリアクセス状況を効率良く取得することが可能となる。   As described above, according to the memory access trace information acquisition method, the memory access trace information acquisition device, and the memory access trace information acquisition program according to the second embodiment of the present invention, the offset value is not constant. By omitting, it is possible to reduce the amount of information to be output and to efficiently acquire the memory access status necessary for debugging work.

(第3の実施形態)
本発明の第3の実施形態に係るプロセッサは、図5で示した第2の実施形態と同一の構成であり、説明を省略する。
(Third embodiment)
The processor according to the third embodiment of the present invention has the same configuration as that of the second embodiment shown in FIG.

図5において、本実施形態のプロセッサ200は、CPU201がメモリ202に格納されたトレース情報取得プログラムを実行することによりメモリアクセストレース情報取得装置として機能し、トレース情報の生成対象である対象プログラムを実行する際のメモリアクセストレース情報を取得して出力する。なお、本実施形態の対象プログラムは、前述した第2の実施の形態における対象プログラムと同じであるので、説明を省略する。   In FIG. 5, the processor 200 according to the present embodiment functions as a memory access trace information acquisition device when the CPU 201 executes a trace information acquisition program stored in the memory 202, and executes a target program that is a target for generating trace information. Acquire and output memory access trace information when Note that the target program of the present embodiment is the same as the target program of the second embodiment described above, and a description thereof will be omitted.

図9は、図6に示す対象プログラムを実行した際のメモリアクセストレース情報の例である。図7(a)に示す従来のメモリアクセストレース情報24は、基本となるアドレス、オフセット値、オフセット値の繰り返し回数を計算することで、情報を圧縮した図9(a)および(b)に示すようなメモリアクセストレース情報25に変換することができる。ここで、“LOOP+ADRS”は、ループの先頭アドレスを表している。   FIG. 9 is an example of memory access trace information when the target program shown in FIG. 6 is executed. The conventional memory access trace information 24 shown in FIG. 7 (a) is shown in FIGS. 9 (a) and 9 (b) in which the information is compressed by calculating the basic address, offset value, and number of repetitions of the offset value. Such memory access trace information 25 can be converted. Here, “LOOP + ADRS” represents the head address of the loop.

次に、本実施形態のプロセッサについて、メモリアクセストレース情報の取得処理方法を説明する。本実施形態におけるメモリアクセストレース情報の取得処理方法は、前述した本発明の第2の実施の形態におけるメモリアクセストレース情報取得処理方法の変形例である。図10は、本実施形態のメモリアクセストレース情報取得処理手順を説明するためのフローチャートである。   Next, a memory access trace information acquisition processing method for the processor of this embodiment will be described. The memory access trace information acquisition processing method in the present embodiment is a modification of the memory access trace information acquisition processing method in the second embodiment of the present invention described above. FIG. 10 is a flowchart for explaining the memory access trace information acquisition processing procedure of this embodiment.

図10において、本実施形態のメモリアクセストレース情報取得処理方法S2aは、図8に示した第2の実施形態のメモリアクセストレース情報取得方法S2の、初めてオフセットの基準となるアドレスを取得したか否かを判定するステップS204に代えて、アドレス格納部204がベースアドレスが空であるか否かを判定するステップS246の手順を設けるとともに、初めて取得したアドレスを出力するステップS206の手順に代えて、アドレス格納部204が取得したアドレスをベースアドレスにセットするステップS241の手順を設けるものである。   In FIG. 10, the memory access trace information acquisition processing method S2a of this embodiment acquires the address that is the reference for offset for the first time in the memory access trace information acquisition method S2 of the second embodiment shown in FIG. Instead of step S204 for determining whether or not the address storage unit 204 provides the procedure of step S246 for determining whether or not the base address is empty, and instead of the procedure of step S206 for outputting the first acquired address, The procedure of step S241 for setting the address acquired by the address storage unit 204 as the base address is provided.

また、一時格納バッファ208をクリアするステップS219の手順に代えて、ベースアドレスをパターンバッファ209によって格納するステップS242の手順、及びアドレス格納部によってベースアドレスを、CPU201によって一時格納バッファ208をクリアするステップS243の手順を設けている。更に、終了フラグが“ON”であるか否かを判定するステップS216の手順の直前に、パターンバッファ209によって格納されたベースアドレス群をメモリアクセスアドレス情報出力部211が出力するステップS244を追加し、また、一時格納バッファ208の内容を出力するステップS221に代えて、メモリアクセスアドレス情報出力部211が一時格納バッファ208によって格納されているオフセット値に加えてベースアドレスの内容も併せて出力するステップS245を設けるものである。なお、ステップS244の手順は、前述した第1の実施形態に記載した方法に置き換えてもよい。   Further, instead of the procedure of step S219 for clearing the temporary storage buffer 208, the procedure of step S242 for storing the base address by the pattern buffer 209, the step of clearing the base address by the address storage unit, and the step of clearing the temporary storage buffer 208 by the CPU 201 The procedure of S243 is provided. Further, immediately before the procedure of Step S216 for determining whether or not the end flag is “ON”, Step S244 in which the memory access address information output unit 211 outputs the base address group stored by the pattern buffer 209 is added. Further, in place of step S221 of outputting the contents of the temporary storage buffer 208, the memory access address information output unit 211 outputs the contents of the base address in addition to the offset value stored in the temporary storage buffer 208. S245 is provided. Note that the procedure in step S244 may be replaced with the method described in the first embodiment.

次に、本実施形態におけるメモリアクセストレース情報取得処理の具体例について、図7を参照しながら説明する。   Next, a specific example of the memory access trace information acquisition process in the present embodiment will be described with reference to FIG.

図7(a)において、初めにアドレス“0x10”のデータを取得すると、ベースアドレスが空であるか否かを判定するステップS246では、ベースアドレスが空であるので、取得したアドレス“0x10”を比較アドレス1及びベースアドレスにセットする(ステップS205、S241)。   In FIG. 7A, when the data of the address “0x10” is first acquired, in step S246 for determining whether or not the base address is empty, since the base address is empty, the acquired address “0x10” is set. The comparison address 1 and the base address are set (steps S205 and S241).

次に、アドレス“0x30”のデータを取得すると、ベースアドレスには“0x10”がセットされているので、ステップS246の次の手順はステップS207となり、取得したアドレス“0x30”が比較アドレス2にセットされる。   Next, when the data at the address “0x30” is acquired, “0x10” is set as the base address, so the next procedure after step S246 is step S207, and the acquired address “0x30” is set as the comparison address 2. Is done.

続くステップS208では、アドレス格納部204の比較アドレス1に格納されているアドレス“0x10”と、比較アドレス2に格納されているアドレス“0x30”のオフセット値“#0x20”をオフセット値計算部206によって計算し、ステップS209の手順で比較アドレス1に格納されている“0x20”を一時格納バッファ208によって格納する。その後、次のデータに対する比較に備えて、比較アドレス2に格納されているアドレス“0x30”を比較アドレス1にセットする(ステップS210)。   In the subsequent step S208, the offset value “0x10” stored in the comparison address 1 of the address storage unit 204 and the offset value “# 0x20” of the address “0x30” stored in the comparison address 2 are obtained by the offset value calculation unit 206. Then, “0x20” stored in the comparison address 1 in the procedure of step S209 is stored in the temporary storage buffer 208. Thereafter, in preparation for comparison with the next data, the address “0x30” stored in the comparison address 2 is set to the comparison address 1 (step S210).

次に、アドレス“0x50” のデータを取得し、上記したと同様にステップS209までの処理を行うと、一時格納バッファ208には“#0x20”、“#0x20”が格納される。   Next, when the data of the address “0x50” is acquired and the processing up to step S209 is performed as described above, “# 0x20” and “# 0x20” are stored in the temporary storage buffer 208.

次いで、ステップS201でイベント“LOOP”を取得すると、ステップS202における判定の結果、指定イベントと一致するので、ステップS211の処理を実行する。   Next, when the event “LOOP” is acquired in step S201, the result of determination in step S202 is the same as the specified event, so the process of step S211 is executed.

ステップS211では、一時格納バッファ208によって格納されている内容をパターンと比較するが、パターンバッファ209が空であるのでステップS213の処理に進み、パターンバッファ209によって格納されているパターンを出力する。この場合パターンバッファ209は空であるので何も出力することなく、続くステップS214の手順を実行する。   In step S211, the contents stored in the temporary storage buffer 208 are compared with the pattern. Since the pattern buffer 209 is empty, the process proceeds to step S213, and the pattern stored in the pattern buffer 209 is output. In this case, since the pattern buffer 209 is empty, nothing is output and the following step S214 is executed.

ステップS214では、カウンタの値が“1”以下であるので、ステップS244の手順にスキップして、パターンバッファ209に格納されているベースアドレス群を出力する手順を実行する。この場合パターンバッファ209は空であるので何も出力することなく、終了フラグを判定するステップS216の手順に進む。   In step S214, since the value of the counter is “1” or less, the procedure skipping the procedure of step S244 and outputting the base address group stored in the pattern buffer 209 is executed. In this case, since the pattern buffer 209 is empty, nothing is output and the process proceeds to step S216 for determining the end flag.

すると、終了フラグは“OFF”であるので、ステップS217でカウンタ209aに“1”をセットして初期値に戻し、ステップS218で一時格納バッファ208によって格納されている“#0x20”、“#0x20”をパターンバッファ209に反映させた後、ベースアドレスをパターンバッファ209によって格納するステップS242の手順と、ベースアドレス及び一時格納バッファ208をクリアするステップS243の手順を実行する。   Then, since the end flag is “OFF”, “1” is set to the counter 209a to return to the initial value in step S217, and “# 0x20” and “# 0x20” stored in the temporary storage buffer 208 in step S218. "Is reflected in the pattern buffer 209, the procedure of step S242 for storing the base address by the pattern buffer 209 and the procedure of step S243 for clearing the base address and temporary storage buffer 208 are executed.

次に、アドレス“0x14”、“0x34”、“0x54”の各データに対して同様の処理を行うと、一時格納バッファ208にオフセット値“#0x20”、“#0x20”が、ベースアドレスに“0x14”、パターンバッファ209に“#0x20”、“#0x20”が、パターンバッファ209にベースアドレス群(“0x10”)がそれぞれ格納されている状態になる。   Next, when the same processing is performed on the data of the addresses “0x14”, “0x34”, and “0x54”, the offset values “# 0x20” and “# 0x20” are stored in the temporary storage buffer 208 as “base address”. 0x14 "," # 0x20 "," # 0x20 "are stored in the pattern buffer 209, and the base address group (" 0x10 ") is stored in the pattern buffer 209.

続いて、イベント“LOOP” を取得してステップS211の判定処理を行うと、一時格納バッファ208の内容がパターンと一致するので、ステップS212でカウンタ209aの値を“1”増やして“2”とし、ステップS242でベースアドレス“0x14”をパターンバッファ208に格納するとともに、ステップS243でベースアドレス及び一時格納バッファ209をクリアする。   Subsequently, when the event “LOOP” is acquired and the determination process in step S211 is performed, the content of the temporary storage buffer 208 matches the pattern, so that the value of the counter 209a is increased by “1” to “2” in step S212. In step S242, the base address “0x14” is stored in the pattern buffer 208, and in step S243, the base address and temporary storage buffer 209 are cleared.

次のアドレス“0x1C”のデータからアドレス“0x6C”の後に来るイベント “LOOP”まで同様に処理を行うと、パターンバッファ209の内容が“#0x20”、“#0x20”、カウンタ209aの値が“8”という状態になる。   If the same processing is performed from the data of the next address “0x1C” to the event “LOOP” that comes after the address “0x6C”, the contents of the pattern buffer 209 are “# 0x20”, “# 0x20”, and the value of the counter 209a is “ It becomes a state of 8 ”.

そして、例えば次のアドレスが取得できなかった場合は、ステップS220の手順で終了フラグを“ON”にセットし、ステップS211の処理を実行する。すると、一時格納バッファ208は空になっているので、ステップS213でパターン“#0x20”、“#0x20”を出力して、カウンタ209aの値を判定するステップS214の手順に進む。   For example, when the next address cannot be acquired, the end flag is set to “ON” in the procedure of step S220, and the process of step S211 is executed. Then, since the temporary storage buffer 208 is empty, the patterns “# 0x20” and “# 0x20” are output in step S213, and the process proceeds to step S214 in which the value of the counter 209a is determined.

ステップS214において、カウンタ209aの値は“1”より大きいので、次のステップS215でその値を出力するとともに、ステップS244でパターンバッファ209によって格納されたベースアドレス群(“0x10、“0x14”、・・・、“0x2C”)を出力して、終了フラグを判定するステップS216の手順を実行する。   In step S214, since the value of the counter 209a is larger than “1”, the value is output in the next step S215, and the base address group (“0x10,“ 0x14 ”,...) Stored in the pattern buffer 209 in step S244. .., “0x2C”) is output, and the procedure of step S216 for determining the end flag is executed.

ステップS216では、終了フラグが“ON”になっているので、ステップS245の手順に進み、ベースアドレスと一時格納バッファ208の内容を出力する。この場合、ベースアドレスと一時格納バッファ208はいずれも空となっているので何も出力することなく、メモリアクセストレース情報取得処理を終了する。これにより、図9(a)に示すメモリアクセストレース情報24を取得することができる。   In step S216, since the end flag is “ON”, the process proceeds to step S245, and the base address and the contents of the temporary storage buffer 208 are output. In this case, since the base address and the temporary storage buffer 208 are both empty, the memory access trace information acquisition process is terminated without outputting anything. Thereby, the memory access trace information 24 shown in FIG. 9A can be acquired.

また、パターンバッファ209によって格納されたベースアドレス群を出力するステップS244の手順を、図4において示した第1の実施形態の方法に置き換えることでも、図9(b)に示すメモリアクセストレース情報25を取得することができる。   The memory access trace information 25 shown in FIG. 9B can also be obtained by replacing the procedure of step S244 for outputting the base address group stored by the pattern buffer 209 with the method of the first embodiment shown in FIG. Can be obtained.

以上説明したように、このような本発明に係る第3の実施形態のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体によれば、イベントを取得した際のアドレスのオフセット値が一定でないものに対しても、デバッグ作業に必要なデータトレース情報を効率良く取得することができる。   As described above, according to the memory access trace information acquisition method, the memory access trace information acquisition device, the memory access trace information acquisition program, and the recording medium of the third embodiment according to the present invention, an event is acquired. Even when the offset value of the address at this time is not constant, it is possible to efficiently obtain the data trace information necessary for the debugging work.

(第4の実施形態)
本発明の第4の実施形態に係るプロセッサは、図5で示した第2の実施形態と同一の構成であり、説明を省略する。
(Fourth embodiment)
The processor according to the fourth embodiment of the present invention has the same configuration as that of the second embodiment shown in FIG.

図5において、本実施形態のプロセッサ200は、CPU201がメモリ202に格納されたトレース情報取得プログラムを実行することによりメモリアクセストレース情報取得装置として機能し、トレース情報の生成対象である対象プログラムを実行する際のメモリアクセストレース情報を取得して出力する。   In FIG. 5, the processor 200 according to the present embodiment functions as a memory access trace information acquisition device when the CPU 201 executes a trace information acquisition program stored in the memory 202, and executes a target program that is a target for generating trace information. Acquire and output memory access trace information when

図12は、図11に示すようなC言語ソースコード14で記述された対象プログラムを実行した際のメモリアクセストレース情報の例を示すものである。図12(a)に示す従来のメモリアクセストレース情報26は、基本となるアドレス、パターン、パターンの繰り返し回数を計算することで、図12(b)に示すように、情報を圧縮したメモリアクセストレース情報27に変換することができる。ここで、“LOOP REPEAT”は、“LOOP_BEGIN”から“LOOP_END”までに同じパターンが繰り返された回数を表している。   FIG. 12 shows an example of memory access trace information when the target program described in the C language source code 14 as shown in FIG. 11 is executed. The conventional memory access trace information 26 shown in FIG. 12A is a memory access trace obtained by compressing information as shown in FIG. 12B by calculating the basic address, pattern, and number of pattern repetitions. Information 27 can be converted. Here, “LOOP REPEAT” represents the number of times the same pattern is repeated from “LOOP_BEGIN” to “LOOP_END”.

次に、本実施形態のプロセッサについて、メモリアクセストレース情報の取得処理方法を説明する。本実施形態におけるメモリアクセストレース情報の取得処理方法は、前述した本発明の第2の実施の形態におけるメモリアクセストレース情報取得処理方法の変形例であり、図13は、本実施形態のメモリアクセストレース情報取得処理手順を説明するためのフローチャートである。   Next, a memory access trace information acquisition processing method for the processor of this embodiment will be described. The memory access trace information acquisition processing method in the present embodiment is a modification of the memory access trace information acquisition processing method in the second embodiment of the present invention described above, and FIG. 13 shows the memory access trace of the present embodiment. It is a flowchart for demonstrating an information acquisition process procedure.

図13に示す本実施形態のメモリアクセストレース情報取得処理手順は、図8で示した第2の実施形態のメモリアクセストレース情報取得処理におけるフローチャートのステップS211とステップ213の間にステップS250を追加し、ステップS218とステップS219の間にステップS251〜S254をそれぞれ追加したものである。   The memory access trace information acquisition processing procedure of this embodiment shown in FIG. 13 adds step S250 between step S211 and step 213 of the flowchart in the memory access trace information acquisition processing of the second embodiment shown in FIG. , Steps S251 to S254 are added between Step S218 and Step S219, respectively.

ステップS250は、ステップS211において一時格納バッファ208の内容がパターンと一致しないと判定した際に、メモリアクセスアドレス情報出力部211がラベルを出力する処理手順であり、ステップS251は、ステップS218で一時格納バッファ208の内容をパターンバッファ209に反映した際に、パターン比較部210が既に同じパターンを出力しているか否かを判定する手順である。なお、このステップS250の手順を追加することにより、パターンを出力する処理のステップS213は、初めてラベルを出力するときにのみパターンを出力し、以降はパターンを出力しない構成になっている。   Step S250 is a processing procedure in which the memory access address information output unit 211 outputs a label when it is determined in step S211 that the contents of the temporary storage buffer 208 do not match the pattern. Step S251 is temporarily stored in step S218. This is a procedure for determining whether or not the pattern comparison unit 210 has already output the same pattern when the contents of the buffer 208 are reflected in the pattern buffer 209. By adding the procedure of step S250, step S213 of the process of outputting a pattern is configured to output a pattern only when outputting a label for the first time, and does not output a pattern thereafter.

また、ステップS252は、ステップS251における判定の結果、既に同じパターンが出力されている場合に、CPU201がそのパターンのラベルを取得する手順であり、ステップS253は、ステップS251で同じパターンが出力されていないと判定された場合に、CPU201が新規ラベルを取得する手順である。さらに、ステップS254は、ステップS252叉はステップS253の手順で取得したラベルをパターンバッファ209によって格納する手順である。   Step S252 is a procedure in which the CPU 201 obtains the label of the pattern when the same pattern has already been output as a result of the determination in step S251, and step S253 outputs the same pattern in step S251. This is a procedure in which the CPU 201 acquires a new label when it is determined that there is no such label. Further, step S254 is a procedure in which the pattern buffer 209 stores the label acquired by the procedure of step S252 or step S253.

次に、本実施形態におけるメモリアクセストレース情報取得処理の具体例について、図12(a)に示したメモリアクセストレース情報26を参照しながら説明する。   Next, a specific example of the memory access trace information acquisition process in the present embodiment will be described with reference to the memory access trace information 26 shown in FIG.

図12(a)におけるアドレス“0x10”のデータからアドレス“0x50”のデータまでは、第2の実施形態と同様の処理を行い、一時格納バッファ208には“#0x20”、“#0x20”が格納される。   From the data at address “0x10” to the data at address “0x50” in FIG. 12A, the same processing as in the second embodiment is performed, and “# 0x20” and “# 0x20” are stored in the temporary storage buffer 208. Stored.

次に、イベント“LOOP” を取得して、パタンーン比較部210が一時格納バッファ208によって格納されている内容をパターンと比較するステップS211を実行すると、パターンバッファ209は空になっているので、ステップS250の処理に進んでメモリアクセスアドレス情報出力部211がラベルを出力し(空の場合は何も出力しない)、更にステップS213でメモリアクセスアドレス情報出力部211がパターンを出力して(空の場合は何も出力しない)、ステップS214でパターン比較部210がカウンタ209aの値が“1”より大きいか否かの判定を行う。   Next, when the event “LOOP” is acquired and the pattern comparison unit 210 executes step S211 in which the content stored in the temporary storage buffer 208 is compared with the pattern, the pattern buffer 209 is empty. In step S250, the memory access address information output unit 211 outputs a label (if it is empty, nothing is output), and in step S213, the memory access address information output unit 211 outputs a pattern (if empty). In step S214, the pattern comparison unit 210 determines whether the value of the counter 209a is greater than “1”.

すると、カウンタ209aの値は“1”以下であるので、終了フラグを判定するステップS216にスキップする。このとき、終了フラグは“OFF”であるので、ステップS217でCPU201がカウンタ209aをクリアし、ステップS218で一時格納バッファ208の内容“#0x20”、“#0x20”をパターンバッファ209に反映させた後、ステップS251の処理を行う。   Then, since the value of the counter 209a is “1” or less, the process skips to step S216 for determining the end flag. At this time, since the end flag is “OFF”, the CPU 201 clears the counter 209a in step S217, and the contents “# 0x20” and “# 0x20” of the temporary storage buffer 208 are reflected in the pattern buffer 209 in step S218. Thereafter, the process of step S251 is performed.

既に同じパターンを出力しているか否かを判定するステップS251では、既に出力したパターンに一致するものがないので、続くステップS253の処理で新規ラベル“LOOP1”を取得し、ステップS254でパターンバッファ209によって取得したラベルを格納して、ステップS219の手順でCPU201が一時格納バッファ208をクリアする。   In step S251 for determining whether or not the same pattern has already been output, since there is no match with the already output pattern, a new label “LOOP1” is acquired in the subsequent step S253, and in step S254, the pattern buffer 209 is acquired. The CPU 201 clears the temporary storage buffer 208 in the procedure of step S219.

次のアドレス“0x14”のデータからアドレス“0x6C”の後に来るイベント“LOOP”まで同様に処理を行うと、パターンバッファ209の内容が“#−0x3C”、“#0x20”、“#0x20”となり、カウンタ209aの値が“7”、ラベルが“LOOP2”という状態になる。   If the same processing is performed from the data of the next address “0x14” to the event “LOOP” that comes after the address “0x6C”, the contents of the pattern buffer 209 become “# -0x3C”, “# 0x20”, “# 0x20”. The value of the counter 209a is “7” and the label is “LOOP2”.

次に、例えばアドレス“0x100”のデータを取得すると、上記したと同様に、ステップS209までの処理を実行する。   Next, for example, when the data of the address “0x100” is acquired, the processing up to step S209 is executed as described above.

再び、アドレス“0x10”のデータからのループが発生したとき、アドレス“0x50”のデータまでは上記したと同様の処理を行い、一時格納バッファ208によって“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”が格納される。   When a loop from the data of the address “0x10” occurs again, the same processing as described above is performed up to the data of the address “0x50”, and “# 0xA4”, “# -0xF0”, “ # 0x20 "and" # 0x20 "are stored.

次に、イベント“LOOP” を取得して、ステップS211の判定処理を行うと、パターンバッファ208の内容は“LOOP2”になっていて一致しないので、ステップS250の処理に進んでメモリアクセスアドレス情報出力部211がラベルを出力し(空の場合は何も出力しない)、更にステップS213でパターン“#−0x3C”、“#0x20”、“#0x20”を出力して、ステップS214の手順でパターン比較部210がカウンタ209aの値が“1”より大きいか否かの判定を行う。   Next, when the event “LOOP” is acquired and the determination process of step S211 is performed, the contents of the pattern buffer 208 are “LOOP2” and do not match, so the process proceeds to the process of step S250 and the memory access address information is output. The unit 211 outputs a label (nothing is output when it is empty), and further outputs patterns “# -0x3C”, “# 0x20”, “# 0x20” in step S213, and compares the patterns in the procedure of step S214. The unit 210 determines whether or not the value of the counter 209a is greater than “1”.

すると、カウンタ209aの値は“7”になっていて“1”より大きいので、ステップS215の手順でメモリアクセスアドレス情報出力部211がこの値を出力して、CPU201が終了フラグを判定するステップS216の処理を行う。   Then, since the value of the counter 209a is “7” and larger than “1”, the memory access address information output unit 211 outputs this value in the procedure of step S215, and the CPU 201 determines the end flag in step S216. Perform the process.

このとき、終了フラグは“OFF”になっているので、ステップS217の手順でCPU201がカウンタ209aをクリアし、ステップS218で一時格納バッファ208の内容“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”をパターンバッファ209に反映させた後、ステップS251の処理を実行する。   At this time, since the end flag is "OFF", the CPU 201 clears the counter 209a in the procedure of step S217, and the contents "# 0xA4", "# -0xF0", "# -0xF0" of the temporary storage buffer 208 in step S218. After reflecting 0x20 "and" # 0x20 "in the pattern buffer 209, the process of step S251 is executed.

ステップS251における判定処理の結果、既に出力したパターンに一致するものがないので、続くステップS253の手順でCPU201が新規ラベルの“LOOP3”を取得し、ステップS254でパターンバッファ209によってラベルを格納するとともに、ステップS219でCPU201が一時格納バッファ208をクリアする。   As a result of the determination process in step S251, there is no pattern that already matches the output pattern, so in the subsequent step S253, the CPU 201 obtains a new label “LOOP3”, and in step S254, the label is stored in the pattern buffer 209. In step S219, the CPU 201 clears the temporary storage buffer 208.

次のアドレス“0x14”のデータからアドレス“0x54”のデータまで上記したと同様の処理を行うと、一時格納バッファ208の内容が“#−0x3C”、“#0x20”、“#0x20”、パターンバッファ209の内容が“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”という状態になる。   When the same processing as described above is performed from the data of the next address “0x14” to the data of the address “0x54”, the contents of the temporary storage buffer 208 are “# -0x3C”, “# 0x20”, “# 0x20”, pattern The contents of the buffer 209 become “# 0xA4”, “# -0xF0”, “# 0x20”, “# 0x20”.

次に、イベント“LOOP” を取得してステップS211の判定処理を実行すると、パターンバッファ208の内容は“LOOP3”となっていて一致しないため、ステップS250の手順でメモリアクセスアドレス情報出力部211がラベル“LOOP3”を出力し、続くステップS213でパターン“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”をメモリアクセスアドレス情報出力部211が出力した後、ステップS214の判定処理を行う。   Next, when the event “LOOP” is acquired and the determination process in step S211 is executed, the contents of the pattern buffer 208 are “LOOP3” and do not match. Therefore, the memory access address information output unit 211 performs the procedure in step S250. After the label “LOOP3” is output and the pattern “# 0xA4”, “# -0xF0”, “# 0x20”, “# 0x20” is output by the memory access address information output unit 211 in the subsequent step S213, the determination in step S214 Process.

ステップS214において、カウンタ209aの値は“1”以下であるので、終了フラグを判定するステップS216にスキップする。すると、終了フラグは“OFF”であるので、ステップS217でCPU201がカウンタ209aをクリアし、ステップS218で一時格納バッファ208の内容“#−0x3C”、“#0x20”、“#0x20”をパターンバッファ209に反映させた後、ステップS251の処理を行う。   In step S214, since the value of the counter 209a is “1” or less, the process skips to step S216 for determining the end flag. Then, since the end flag is “OFF”, the CPU 201 clears the counter 209a in step S217, and the contents “# -0x3C”, “# 0x20”, “# 0x20” of the temporary storage buffer 208 are stored in the pattern buffer in step S218. After reflecting in 209, the process of step S251 is performed.

ステップS251では、既に出力したパターンに一致するものがあるので、続くステップS252でCPU201がラベル“LOOP2”を取得し、ステップS254でパターンバッファ209によって取得したラベルを格納して、ステップS219でCPU201が一時格納バッファ208をクリアする。   In step S251, since there is a pattern that already matches the output pattern, the CPU 201 obtains the label “LOOP2” in the subsequent step S252, stores the label obtained by the pattern buffer 209 in step S254, and the CPU 201 obtains the label in step S219. The temporary storage buffer 208 is cleared.

次のアドレス“0x1C”のデータからアドレス“0x6C”の後に来るイベント“LOOP”まで同様に処理を行うことにより、図12(b)に示すメモリアクセストレース情報27を取得することができる。   The memory access trace information 27 shown in FIG. 12B can be acquired by performing the same processing from the data of the next address “0x1C” to the event “LOOP” that comes after the address “0x6C”.

以上説明したように、このような本発明に係る第4の実施形態のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体によれば、既に出力したことのあるパターンは一度しか検出されないようにすることができるので、パターンを格納するメモリを縮減して、なおかつ、多くのパターンを一致させることが可能となり、デバッグ作業に必要なデータトレース情報を効率良く取得することができる。   As described above, according to the memory access trace information acquisition method, the memory access trace information acquisition device, the memory access trace information acquisition program, and the recording medium of the fourth embodiment according to the present invention, the output has already been performed. Since the pattern can be detected only once, the memory for storing the pattern can be reduced, and many patterns can be matched, making the data trace information necessary for debugging work more efficient. Can get well.

(第5の実施形態)
本発明の第5の実施形態に係るコンピュータシステムのプロセッサは、図5で示した第2の実施形態と同一の構成であり、説明を省略する。
(Fifth embodiment)
The processor of the computer system according to the fifth embodiment of the present invention has the same configuration as that of the second embodiment shown in FIG.

図5において、本実施形態のプロセッサ200は、CPU201がメモリ202に格納されたトレース情報取得プログラムを実行することによってメモリアクセストレース情報取得装置として機能し、トレース情報の生成対象である対象プログラムを実行する際のメモリアクセストレース情報を取得して出力する。   In FIG. 5, the processor 200 according to the present embodiment functions as a memory access trace information acquisition device when the CPU 201 executes a trace information acquisition program stored in the memory 202, and executes a target program that is a target for generating trace information. Acquire and output memory access trace information when

また、本実施形態における対象プログラム及びメモリアクセストレース情報は、それぞれ図6及び図7に示した第2の実施の形態と同じであり、説明を省略する。   In addition, the target program and the memory access trace information in this embodiment are the same as those in the second embodiment shown in FIGS.

次に、本実施形態のプロセッサについて、メモリアクセストレース情報の取得処理方法を説明する。本実施形態におけるメモリアクセストレース情報の取得処理方法は、前述した本発明の第2の実施の形態におけるメモリアクセストレース情報取得処理方法の変形例である。図14は、本実施形態のメモリアクセストレース情報取得処理手順を説明するためのフローチャートである。   Next, a memory access trace information acquisition processing method for the processor of this embodiment will be described. The memory access trace information acquisition processing method in the present embodiment is a modification of the memory access trace information acquisition processing method in the second embodiment of the present invention described above. FIG. 14 is a flowchart for explaining the memory access trace information acquisition processing procedure of this embodiment.

図14に示す本実施形態のメモリアクセストレース情報取得処理手順は、図8で示した第2の実施形態のメモリアクセストレース情報取得処理におけるフローチャートのステップS211に代えてステップS265を設け、ステップS212とステップS219の間にステップS260を追加する。また、変更したステップS265とステップS213の間にステップS262を追加し、更に、ステップS218に代えて、ステップS266、S261、S263、S264を設けるものである。   The memory access trace information acquisition processing procedure of this embodiment shown in FIG. 14 is provided with step S265 instead of step S211 of the flowchart in the memory access trace information acquisition processing of the second embodiment shown in FIG. Step S260 is added during step S219. Further, step S262 is added between the changed steps S265 and S213, and steps S266, S261, S263, and S264 are provided in place of step S218.

ステップS265は、パターン比較部210が一時格納バッファ208の内容がカウンタ209aの値が最大となるパターンと一致するか判定する手順であり、ステップS260は、ステップS260において一時格納バッファ208の内容がカウンタ値が最大となるパターンと一致すると判定した際に、一致したパターンの優先度をCPU201が上げる手順である。   Step S265 is a procedure in which the pattern comparison unit 210 determines whether the contents of the temporary storage buffer 208 match the pattern with the maximum value of the counter 209a. Step S260 is a step in which the contents of the temporary storage buffer 208 are counted in step S260. This is a procedure in which the CPU 201 increases the priority of the matched pattern when it is determined that the pattern matches the maximum value.

また、ステップS262は、ステップS265において一時格納バッファ208の内容がカウンタ値が最大となるパターンと一致しないと判定した際に、メモリアクセスアドレス情報出力部211がラベルを出力する手順である。なお、このステップS262の手順を追加することにより、パターンを出力するステップS213は、初めてラベルを出力するときにのみパターンを出力し、以降はパターンを出力しない構成になっている。   Step S262 is a procedure in which the memory access address information output unit 211 outputs a label when it is determined in step S265 that the contents of the temporary storage buffer 208 do not match the pattern having the maximum counter value. By adding the procedure of step S262, step S213 for outputting a pattern is configured to output a pattern only when a label is output for the first time, and no pattern is output thereafter.

さらに、ステップS266は、パターン比較部210が一時格納バッファ208の内容がパターンと一致するか否かを判定する手順であり、ステップS261は、ステップS263において一時格納バッファ208の内容がパターンと一致しないと判定した際に、一時格納バッファ208の内容を最も優先度の低いパターンバッファ209に反映する手順である。   Further, step S266 is a procedure in which the pattern comparison unit 210 determines whether or not the content of the temporary storage buffer 208 matches the pattern. In step S261, the content of the temporary storage buffer 208 does not match the pattern in step S263. This is a procedure for reflecting the contents of the temporary storage buffer 208 to the pattern buffer 209 having the lowest priority when it is determined.

また、ステップS263はCPU201がラベルを取得する手順であり、ステップS264は取得したラベルをパターンバッファ209によって格納する手順である。   Further, step S263 is a procedure for the CPU 201 to acquire a label, and step S264 is a procedure for storing the acquired label by the pattern buffer 209.

次に、本実施形態におけるメモリアクセストレース情報取得処理の具体例について、図12(a)に示したメモリアクセストレース情報26を参照しながら説明する。ここで、パターンバッファ209は2つのパターンを格納でき、パターン毎にカウンタ値を保持するものとする。   Next, a specific example of the memory access trace information acquisition process in the present embodiment will be described with reference to the memory access trace information 26 shown in FIG. Here, the pattern buffer 209 can store two patterns, and holds a counter value for each pattern.

図12(a)におけるアドレス“0x10”のデータからアドレス“0x50”のデータまでは、第2の実施形態と同様の処理を行い、一時格納バッファ208によって“#0x20”、“#0x20”が格納される。   From the data at address “0x10” to the data at address “0x50” in FIG. 12A, the same processing as in the second embodiment is performed, and “# 0x20” and “# 0x20” are stored by the temporary storage buffer 208. Is done.

次に、イベント“LOOP” を取得してステップS265の処理を実行すると、パターンバッファ209は空であるので、ステップS262の処理に進んでメモリアクセスアドレス情報出力部211がラベルを出力し(空の場合は何も出力しない)、更に、ステップS213でメモリアクセスアドレス情報出力部211がパターンを出力し(を出力するとともに空の場合は何も出力しない)、パターン比較部210がステップS214でカウンタ209aの値が“1”より大きいか否かの判定を行う。   Next, when the event “LOOP” is acquired and the process of step S265 is executed, the pattern buffer 209 is empty, so the process proceeds to step S262, and the memory access address information output unit 211 outputs a label (empty). In step S213, the memory access address information output unit 211 outputs a pattern (and outputs nothing when empty), and the pattern comparison unit 210 outputs a counter 209a in step S214. It is determined whether or not the value of is greater than “1”.

すると、カウンタ209aの値は “0”であるので、終了フラグを判定するステップS216にスキップする。このとき、終了フラグは“OFF”であるので、ステップS217の手順でCPU201がカウンタ209aをクリアし、ステップS266の処理を実行する。   Then, since the value of the counter 209a is “0”, the process skips to step S216 for determining the end flag. At this time, since the end flag is “OFF”, the CPU 201 clears the counter 209a in the procedure of step S217, and executes the process of step S266.

ステップS266では、一時格納バッファ208の内容“#0x20”、“#0x20”がパターンと一致しないので、これをパターンバッファ1によって反映し(ステップS261)、CPU201がラベルの“LOOP1”を取得して(ステップS263)、パターンバッファ209によって格納する(ステップS264)。   In step S266, the contents “# 0x20” and “# 0x20” in the temporary storage buffer 208 do not match the pattern, which is reflected by the pattern buffer 1 (step S261), and the CPU 201 acquires the label “LOOP1”. (Step S263), the pattern buffer 209 stores the data (Step S264).

次のアドレス“0x14”のデータからアドレス“0x54”のデータまで同様に処理を行うと、パターンバッファ209によって“#−0x3C”、“#0x20”、“#0x20”が格納される。   When the same processing is performed from the data at the next address “0x14” to the data at address “0x54”, “# -0x3C”, “# 0x20”, “# 0x20” are stored by the pattern buffer 209.

次に、イベント“LOOP” を取得してステップS260の判定処理を行うと、パターンバッファ208の内容は“LOOP1”になっていて一致しないので、ステップS262でメモリアクセスアドレス情報出力部211がこのラベル“LOOP1”を出力し、ステップS213でメモリアクセスアドレス情報出力部211がパターン“#0x20”、“#0x20”を出力して、ステップS214でパターン比較部210がカウンタ209aの値が“1”より大きいか否かの判定を行う。   Next, when the event “LOOP” is acquired and the determination process of step S260 is performed, the contents of the pattern buffer 208 are “LOOP1” and do not match. Therefore, in step S262, the memory access address information output unit 211 displays this label. “LOOP1” is output, the memory access address information output unit 211 outputs the patterns “# 0x20” and “# 0x20” in step S213, and the pattern comparison unit 210 outputs the value of the counter 209a from “1” in step S214. Judge whether or not it is large.

すると、カウンタ209aの値は“1”以下であるので、ステップS216にスキップして終了フラグを判定する。このとき、終了フラグは“OFF”であるので、ステップS217でCPU201がカウンタ209aをクリアし、ステップS266の手順で、パターン比較部210が一時格納バッファ208の内容“#−0x3C”、“#0x20”、“#0x20”がパターンと一致するか否かを判定する。   Then, since the value of the counter 209a is “1” or less, the process skips to step S216 and determines the end flag. At this time, since the end flag is “OFF”, the CPU 201 clears the counter 209a in step S217, and the pattern comparison unit 210 performs the contents “# -0x3C” and “# 0x20” of the temporary storage buffer 208 in the procedure of step S266. It is determined whether “# 0x20” matches the pattern.

ステップS266における判定の結果、パターンは一致しないので、一時格納バッファ208の内容“#−0x3C”、“#0x20”、“#0x20”をパターンバッファ209に反映させ(ステップS261)、更に、CPU201がラベル“LOOP2”を取得して(ステップS263)、パターンバッファ209によって格納する(ステップS264)。   As a result of the determination in step S266, the patterns do not match. Therefore, the contents “# -0x3C”, “# 0x20”, “# 0x20” of the temporary storage buffer 208 are reflected in the pattern buffer 209 (step S261). The label “LOOP2” is acquired (step S263) and stored in the pattern buffer 209 (step S264).

次のアドレス“0x18”のデータからアドレス“0x58”のデータまで、上記したと同様の処理を行うと、一時格納バッファ208によって“#−0x3C”、“#0x20”、“#0x20” が格納される。   When the same processing as described above is performed from the data at the next address “0x18” to the data at address “0x58”, “# -0x3C”, “# 0x20”, “# 0x20” are stored by the temporary storage buffer 208. The

次に、イベント“LOOP” を取得してステップS265の判定処理を行うと、一時格納バッファ208の内容がパターンと一致するため、CPU201がカウンタ209aの値を“1”増加させて“2”とし(ステップS212)、一致したパターンバッファ2の優先度を上げて(ステップS260)、一時格納バッファ208をクリアする(ステップS219)。   Next, when the event “LOOP” is acquired and the determination process of step S265 is performed, the content of the temporary storage buffer 208 matches the pattern, so the CPU 201 increases the value of the counter 209a by “1” to “2”. (Step S212) The priority of the matched pattern buffer 2 is increased (Step S260), and the temporary storage buffer 208 is cleared (Step S219).

続くアドレス“0x1C”のデータからアドレス“0x6C”の後に来るイベント“LOOP”まで同様に処理を行うと、パターンバッファ1が“#0x20”、“#0x20”、パターンバッファ1のラベルが“LOOP1”、パターンバッファ2が“#−0x3C”、“#0x20”、“#0x20”、パターンバッファ2のラベルが“LOOP2”、カウンタ209aの値が“7”となって、パターンバッファ2の優先度が高いという状態になる。   If the same processing is performed from the data at the subsequent address “0x1C” to the event “LOOP” that comes after the address “0x6C”, the pattern buffer 1 is “# 0x20”, “# 0x20”, and the label of the pattern buffer 1 is “LOOP1”. The pattern buffer 2 is “# -0x3C”, “# 0x20”, “# 0x20”, the label of the pattern buffer 2 is “LOOP2”, the value of the counter 209a is “7”, and the priority of the pattern buffer 2 is It becomes high.

次に、例えばアドレス“0x100”のデータを取得したとすると、上記したと同様にステップS209までの処理を行う。   Next, for example, if the data of the address “0x100” is acquired, the processing up to step S209 is performed as described above.

再び、アドレス“0x10”のデータからループが発生すると、アドレス“0x50”のデータまでは上記したと同様の処理を行い、一時格納バッファ208には“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”が格納される。   When a loop occurs again from the data at address “0x10”, the same processing as described above is performed up to the data at address “0x50”, and “# 0xA4”, “# -0xF0”, “#” are stored in temporary storage buffer 208. 0x20 "and" # 0x20 "are stored.

次に、イベント“LOOP” を取得してステップS265の判定処理を行うと、パターンバッファ209の内容はカウンタ値が最大の“LOOP2”になっていて一致しないので、ステップS262の手順でメモリアクセスアドレス情報出力部211がラベル“LOOP2”を出力し、ステップS213でメモリアクセスアドレス情報出力部211がパターン“#−0x3C”、“#0x20”を出力して、ステップS214でパターン比較部210がカウンタ209aの値が“1”より大きいか否かの判定を行う。   Next, when the event “LOOP” is acquired and the determination process of step S265 is performed, the contents of the pattern buffer 209 are not matched because the counter value is the maximum “LOOP2”. The information output unit 211 outputs the label “LOOP2”. In step S213, the memory access address information output unit 211 outputs the patterns “# -0x3C” and “# 0x20”. In step S214, the pattern comparison unit 210 outputs the counter 209a. It is determined whether or not the value of is greater than “1”.

すると、カウンタ209aの値は“1”より大きいので、ステップS215の手順でこの値を出力して、終了フラグを判定するステップS216の処理を行う。すると、終了フラグは“OFF”であるので、ステップS217の手順でCPU201がカウンタ209aをクリアし、ステップS266の処理を行う。   Then, since the value of the counter 209a is larger than “1”, this value is output in the procedure of step S215, and the process of step S216 for determining the end flag is performed. Then, since the end flag is “OFF”, the CPU 201 clears the counter 209a in the procedure of step S217, and performs the process of step S266.

ステップS266における判定の結果、一時格納バッファ208の内容はパターンと一致しないので、ステップS261でCPU201が一時格納バッファの内容“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”を優先度の低いパターンバッファ1に反映させた後、ステップS263の手順でラベル“LOOP3”を取得し、ステップS264でこのラベルをパターンバッファによって格納して、CPU201がステップS219で一時格納バッファ208をクリアする。   As a result of the determination in step S266, the content of the temporary storage buffer 208 does not match the pattern, so in step S261, the CPU 201 causes the content of the temporary storage buffer “# 0xA4”, “# -0xF0”, “# 0x20”, “# 0x20”. Is reflected in the pattern buffer 1 having a low priority, then the label “LOOP3” is acquired in the procedure of step S263, the label is stored in the pattern buffer in step S264, and the CPU 201 stores the temporary storage buffer 208 in step S219. clear.

次のアドレス“0x14”のデータからアドレス“0x54”のデータまで上記したと同様の処理を行うと、一時格納バッファ208の内容が“#−0x3C”、“#0x20”、“#0x20”、パターンバッファ1が“#0xA4”、“#−0xF0”、“#0x20”、“#0x20”、パターンバッファ2が“#−0x3C”、“#0x20”、“#0x20”という状態になる。   When the same processing as described above is performed from the data of the next address “0x14” to the data of the address “0x54”, the contents of the temporary storage buffer 208 are “# -0x3C”, “# 0x20”, “# 0x20”, pattern The buffer 1 becomes “# 0xA4”, “# -0xF0”, “# 0x20”, “# 0x20”, and the pattern buffer 2 becomes “# -0x3C”, “# 0x20”, “# 0x20”.

次いで、イベント“LOOP” を取得してステップS265の判定処理を行うと、パターンバッファはラベル“LOOP2”に一致するので、CPU201がカウンタ209aの値を“1”増加させて“2”とし(ステップS212)、一致したパターンバッファ2の優先度を上げて(ステップS260)、一時格納バッファをクリアする(ステップS219)。   Next, when the event “LOOP” is acquired and the determination process of step S265 is performed, the pattern buffer matches the label “LOOP2”, so the CPU 201 increments the value of the counter 209a by “1” to “2” (step In S212, the priority of the matched pattern buffer 2 is increased (Step S260), and the temporary storage buffer is cleared (Step S219).

次のアドレス“0x14”のデータからアドレス“0x6C”の後に来るイベント“LOOP”まで同様に処理を行うことにより、図12(b)に示すメモリアクセストレース情報27を取得することができる。   The memory access trace information 27 shown in FIG. 12B can be acquired by performing the same processing from the data of the next address “0x14” to the event “LOOP” that comes after the address “0x6C”.

以上説明したように、このような本発明に係る第5の実施形態のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体によれば、優先度が大きいパターンを残しておくことでパターンを一致させる頻度を多くすることができ、デバッグ作業に必要なデータトレース情報を効率良く取得することが可能となる。   As described above, according to the memory access trace information acquisition method, the memory access trace information acquisition device, the memory access trace information acquisition program, and the recording medium of the fifth embodiment according to the present invention, the priority is By leaving a large pattern, it is possible to increase the frequency of matching the pattern, and it is possible to efficiently acquire data trace information necessary for debugging work.

なお、本実施形態では、一致したパターンの優先度を上げるようにしたが、一般的に知られているデータ置換のアルゴリズムを使用してもよい。   In this embodiment, the priority of the matched pattern is increased, but a generally known data replacement algorithm may be used.

また、パターンバッファの初期値は空に設定したが、発生する頻度の高いパターンを初期値として格納しておいてもよい。   Further, although the initial value of the pattern buffer is set to be empty, a frequently occurring pattern may be stored as the initial value.

本発明のメモリアクセストレース情報取得方法、メモリアクセストレース情報取得装置、メモリアクセストレース情報取得プログラム、及び記録媒体は、メモリに対するアクセス状況を示すデータをデバッグ作業に必要なトレース情報として効率良く取得できるともに、記憶容量に限りのあるメモリを有効に利用してトレース情報のパターンを効率良く検出することを可能にする効果を有し、プログラムのデバッグを支援するシステムのデバッガ等に有用である。   A memory access trace information acquisition method, a memory access trace information acquisition device, a memory access trace information acquisition program, and a recording medium according to the present invention can efficiently acquire data indicating a memory access status as trace information necessary for debugging work. It has the effect of making it possible to efficiently detect a trace information pattern by effectively using a memory having a limited storage capacity, and is useful for a debugger of a system that supports program debugging.

本発明の第1の実施形態に係るメモリアクセストレース情報取得装置の概略構成を示すブロック図1 is a block diagram showing a schematic configuration of a memory access trace information acquisition apparatus according to a first embodiment of the present invention. (a)本発明の第1の実施形態に係るデバッグ対象プログラムのC言語ソースコードの一部を示す図 (b)本発明の第1の実施形態に係るデバッグ対象プログラムの変換されたアセンブリ言語コードの一部を示す図(A) The figure which shows a part of C language source code of the debug object program which concerns on the 1st Embodiment of this invention (b) The assembly language code into which the debug object program which concerns on the 1st Embodiment of this invention was converted Figure showing a part of (a)従来のメモリアクセストレース情報を示す図 (b)本発明の第1の実施形態に係るメモリアクセストレース情報を示す図(A) Diagram showing conventional memory access trace information (b) Diagram showing memory access trace information according to the first embodiment of the present invention 本発明の第1の実施形態に係るメモリアクセストレース情報の取得処理手順を説明するためのフローチャートFlowchart for explaining a memory access trace information acquisition processing procedure according to the first embodiment of the present invention 本発明の第2〜第5の実施形態に係るメモリアクセストレース情報取得装置の概略構成を示すブロック図The block diagram which shows schematic structure of the memory access trace information acquisition apparatus which concerns on the 2nd-5th embodiment of this invention. (a)本発明の第2の実施形態に係るデバッグ対象プログラムのC言語ソースコードの一部を示す図 (b)本発明の第2の実施形態に係るデバッグ対象プログラムの変換されたアセンブリ言語コードの一部を示す図(A) The figure which shows a part of C language source code of the debug object program which concerns on the 2nd Embodiment of this invention (b) The assembly language code into which the debug object program which concerns on the 2nd Embodiment of this invention was converted Figure showing a part of (a)従来のメモリアクセストレース情報を示す図 (b)本発明の第2の実施形態に係るメモリアクセストレース情報を示す図(A) The figure which shows conventional memory access trace information (b) The figure which shows the memory access trace information based on the 2nd Embodiment of this invention 本発明の第2の実施形態に係るメモリアクセストレース情報の取得処理手順を説明するためのフローチャートThe flowchart for demonstrating the acquisition processing procedure of the memory access trace information which concerns on the 2nd Embodiment of this invention. (a)本発明の第3の実施形態に係るメモリアクセストレース情報を示す図 (b)本発明の第3の実施形態に係るメモリアクセストレース情報を示す図(A) Diagram showing memory access trace information according to the third embodiment of the present invention (b) Diagram showing memory access trace information according to the third embodiment of the present invention 本発明の第3の実施形態に係るメモリアクセストレース情報の取得処理手順を説明するためのフローチャートFlowchart for explaining a memory access trace information acquisition processing procedure according to the third embodiment of the present invention 本発明の第4の実施形態に係るデバッグ対象プログラムのソースコードを示す図The figure which shows the source code of the debug object program which concerns on the 4th Embodiment of this invention (a)従来のメモリアクセストレース情報を示す図 (b)本発明の第4の実施形態に係るメモリアクセストレース情報を示す図(A) The figure which shows the conventional memory access trace information (b) The figure which shows the memory access trace information based on the 4th Embodiment of this invention 本発明の第4の実施形態に係るメモリアクセストレース情報の取得処理手順を説明するためのフローチャートThe flowchart for demonstrating the acquisition processing procedure of the memory access trace information which concerns on the 4th Embodiment of this invention. 本発明の第5の実施形態に係るメモリアクセストレース情報の取得処理手順を説明するためのフローチャートThe flowchart for demonstrating the acquisition processing procedure of the memory access trace information which concerns on the 5th Embodiment of this invention

符号の説明Explanation of symbols

100、200 プロセッサ
101、201 CPU
102、202 メモリ
103、203 メモリアクセスアドレス取得部
104、204 アドレス格納部
105、206 オフセット値計算部
106、207 オフセット値格納部
106a、209a カウンタ
107 オフセット値比較部
108、211 メモリアクセスアドレス情報出力部
208 一時格納バッファ
209 パターンバッファ
210 パターン比較部
100, 200 processor 101, 201 CPU
102, 202 Memory 103, 203 Memory access address acquisition unit 104, 204 Address storage unit 105, 206 Offset value calculation unit 106, 207 Offset value storage unit 106a, 209a Counter 107 Offset value comparison unit 108, 211 Memory access address information output unit 208 Temporary storage buffer 209 Pattern buffer 210 Pattern comparison unit

Claims (11)

CPUとメモリを有するプロセッサ上で動作するプログラムにより、前記CPUが前記メモリに対してアクセスしたアクセス状況を示すデータを、トレース情報として取得するメモリアクセストレース情報取得方法であって、
前記メモリに対するアクセスアドレスを格納するステップと、
前記アクセスアドレスと前記アクセスアドレスの一つ前のアクセスアドレスとのオフセット値を1つ以上計算するステップと、
前記オフセット値を1つ以上計算した結果を示すオフセット値群がそれ以前に計算された前記オフセット値群と比較して、一致するか否かを判定する判定ステップと、
前記オフセット値群がそれ以前に計算された前記オフセット値群と一致すると判定した場合に、一致した回数をカウントするカウントステップと、
前記オフセット値群がそれ以前に計算された前記オフセット値群と一致しないと判定した場合に、前記一致した回数を出力する出力ステップと
を有するメモリアクセストレース情報取得方法。
A memory access trace information acquisition method for acquiring, as trace information, data indicating an access status in which the CPU accesses the memory by a program operating on a processor having a CPU and a memory,
Storing an access address for the memory;
Calculating one or more offset values between the access address and the access address immediately before the access address;
A determination step of determining whether or not an offset value group indicating a result of calculating one or more offset values is compared with the previously calculated offset value group; and
When it is determined that the offset value group matches the previously calculated offset value group, a counting step for counting the number of times of matching,
A memory access trace information acquisition method comprising: an output step of outputting the number of times of matching when it is determined that the offset value group does not match the previously calculated offset value group.
請求項1に記載のメモリアクセストレース情報取得方法であって、
前記判定ステップにおいて、前記オフセット値を一つ前の前記オフセット値と比較して、一致するか否かを判定し、
前記カウントステップにおいて、前記オフセット値が一つ前の前記オフセット値と一致すると判定した場合に、一致した回数をカウントし、
前記出力ステップにおいて、前記オフセット値が一つ前の前記オフセット値と一致しないと判定した場合に、前記アクセスアドレス、前記オフセット値、及び前記一致した回数を出力するメモリアクセストレース情報取得方法。
The memory access trace information acquisition method according to claim 1,
In the determination step, the offset value is compared with the previous offset value to determine whether or not they match.
In the counting step, when it is determined that the offset value matches the previous offset value, the number of times of matching is counted,
A memory access trace information acquisition method for outputting the access address, the offset value, and the number of times of matching when it is determined in the output step that the offset value does not match the previous offset value.
請求項1に記載のメモリアクセストレース情報取得方法であって、
前記CPUの前記プログラムを実行するイベントを検出するステップと、
前記イベントが検出されなかった場合に、前記オフセット値を第1のバッファに格納するステップと
を有し、
前記判定ステップにおいて、前記イベントが検出された場合に、前記第1のバッファの内容を第2のバッファに格納された前記オフセット値群を示すパターンと比較して、一致するか否かを判定し、
前記カウントステップにおいて、前記第1のバッファの内容が前記パターンと一致すると判定した場合に、一致した回数をカウントするステップを有し、
前記出力ステップにおいて、前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、前記パターン及び前記一致した回数を出力し、前記第1のバッファの内容を前記第2のバッファの内容に反映するメモリアクセストレース情報取得方法。
The memory access trace information acquisition method according to claim 1,
Detecting an event of executing the program of the CPU;
Storing the offset value in a first buffer if the event is not detected; and
In the determination step, when the event is detected, the contents of the first buffer are compared with a pattern indicating the offset value group stored in the second buffer to determine whether or not they match. ,
In the counting step, when it is determined that the content of the first buffer matches the pattern, the step of counting the number of times of matching,
If it is determined in the output step that the contents of the first buffer do not match the pattern, the pattern and the number of matches are output, and the contents of the first buffer are changed to the contents of the second buffer. To obtain memory access trace information to be reflected
請求項3に記載のメモリアクセストレース情報取得方法であって、更に、
前記イベントを検出する毎に、オフセット値の基準となるベースアドレスを格納するステップと、
前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致すると判定した場合に、前記ベースアドレスを前記第2のバッファに格納するステップと
を有し、
前記出力ステップにおいて、前記第1のバッファの内容が前記パターンと一致しないと判定した場合には、前記パターン、前記一致した回数、及び1つ以上の前記ベースアドレスを示す前記ベースアドレス群を出力するメモリアクセストレース情報取得方法。
The memory access trace information acquisition method according to claim 3, further comprising:
Each time the event is detected, storing a base address that serves as a reference for the offset value;
Storing the base address in the second buffer when the determination step determines that the content of the first buffer matches the pattern; and
If it is determined in the output step that the contents of the first buffer do not match the pattern, the pattern, the number of times of matching, and the base address group indicating one or more base addresses are output. Memory access trace information acquisition method.
請求項3に記載のメモリアクセストレース情報取得方法であって、更に、
前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、
前記パターンに対応するラベルを出力するステップと、
前記パターンを前記出力ステップにおいて既に出力したことのあるパターンと比較して、一致するか否かを判定するステップと、
前記パターンが前記出力ステップにおいて既に出力したことのあるパターンと一致しないと判定した場合に、前記パターンに新規のラベルを付与するステップと、
前記パターンが前記出力ステップにおいて既に出力したことのあるパターンと一致すると判定した場合に、前記既に出力したことのあるパターンと同じラベルを付与するステップと
を有するメモリアクセストレース情報取得方法。
The memory access trace information acquisition method according to claim 3, further comprising:
When it is determined in the determination step that the contents of the first buffer do not match the pattern,
Outputting a label corresponding to the pattern;
Comparing the pattern with a pattern that has already been output in the output step and determining whether or not they match;
A step of assigning a new label to the pattern when it is determined that the pattern does not match a pattern that has already been output in the output step;
A memory access trace information acquisition method comprising: a step of assigning the same label as the pattern that has already been output when it is determined that the pattern matches a pattern that has already been output in the output step.
請求項3に記載のメモリアクセストレース情報取得方法であって、
前記第1のバッファの内容を前記一致した回数が最大となるパターンと比較して、一致するか否かを判定するステップと、
前記第1のバッファの内容が前記一致した回数が最大となるパターンと一致しないと判定した場合に、前記パターンに対応するラベルを出力するステップと、
前記第1のバッファの内容が前記一致した回数が最大となるパターンと一致すると判定した場合に、前記一致したパターンの優先度を上げるステップと
を有し、
前記出力ステップにおいて、前記判定ステップにおいて前記第1のバッファの内容が前記パターンと一致しないと判定した場合に、前記パターンに対応するラベル及び前記一致した回数を出力し、前記第1のバッファの内容を最も優先度の低い前記第2のバッファの内容に反映するメモリアクセストレース情報取得方法。
The memory access trace information acquisition method according to claim 3,
Comparing the contents of the first buffer with the pattern with the largest number of matches and determining whether they match;
Outputting the label corresponding to the pattern when it is determined that the content of the first buffer does not match the pattern having the maximum number of matches;
Increasing the priority of the matched pattern when it is determined that the content of the first buffer matches the pattern with the largest number of matches,
In the output step, when it is determined in the determination step that the content of the first buffer does not match the pattern, the label corresponding to the pattern and the number of times of the match are output, and the content of the first buffer A memory access trace information acquisition method that reflects the contents of the second buffer with the lowest priority.
CPUとメモリを有するプロセッサ上で動作するプログラムにより、前記CPUが前記メモリに対してアクセスしたアクセス状況を示すデータを、トレース情報として取得するメモリアクセストレース情報取得装置であって、
前記CPUの前記メモリに対するアクセスアドレスを取得するアクセスアドレス取得部と、
取得した前記アクセスアドレスを格納するアクセスアドレス格納部と、
前記アクセスアドレス格納部に格納したアクセスアドレスと一つ前の前記アクセスアドレスとのオフセット値を1つ以上計算するオフセット値計算部と、
前記オフセット値を1つ以上計算した結果を示すオフセット値群を格納するオフセット値格納部と、
前記オフセット値格納部に格納したオフセット値群とそれ以前に計算された前記オフセット値群と比較して、一致するか否かを判定するオフセット値比較部と、
前記オフセット値群がそれ以前に計算された前記オフセット値群と一致すると判定した場合に、一致した回数をカウントするカウンタと、
前記オフセット値群がそれ以前に計算された前記オフセット値群と一致しないと判定した場合に、前記カウンタの値を出力するトレース情報出力部と、
を有するメモリアクセストレース情報取得装置。
A memory access trace information acquisition device for acquiring, as trace information, data indicating an access status of the CPU accessing the memory by a program operating on a processor having a CPU and a memory,
An access address acquisition unit for acquiring an access address for the memory of the CPU;
An access address storage unit for storing the acquired access address;
An offset value calculation unit that calculates one or more offset values between the access address stored in the access address storage unit and the previous access address;
An offset value storage unit that stores an offset value group indicating a result of calculating one or more of the offset values;
Comparing the offset value group stored in the offset value storage unit with the offset value group calculated before that, and determining whether or not they match,
A counter that counts the number of times of matching when it is determined that the offset value group matches the previously calculated offset value group;
A trace information output unit that outputs the value of the counter when it is determined that the offset value group does not match the previously calculated offset value group;
A memory access trace information acquisition device.
請求項7に記載のメモリアクセストレース情報取得装置であって、
前記オフセット値比較部は、前記オフセット値格納部に格納したオフセット値と一つ前の前記オフセット値と比較して、一致するか否かを判定し、
前記カウンタは、前記オフセット値が一つ前の前記オフセット値と一致すると判定した場合に、一致した回数をカウントし、
前記トレース情報出力部は、前記オフセット値が一つ前の前記オフセット値と一致しないと判定した場合に、前記アクセスアドレス、前記オフセット値、及び前記カウンタの値を出力するメモリアクセストレース情報取得装置。
The memory access trace information acquisition device according to claim 7,
The offset value comparison unit compares the offset value stored in the offset value storage unit with the previous offset value, and determines whether or not they match.
If the counter determines that the offset value matches the previous offset value, the counter counts the number of matches,
The memory access trace information acquisition device that outputs the access address, the offset value, and the counter value when the trace information output unit determines that the offset value does not match the previous offset value.
請求項7に記載のメモリアクセストレース情報取得装置であって、
前記CPUの前記プログラムを実行するイベントを検出するイベント検出部を有し、
前記オフセット値格納部は、検出した前記イベント間における前記オフセット値を格納するオフセット値バッファおよび前記オフセット値群を示すパターンを格納するパターンバッファを有し、
前記オフセット値比較部は、前記オフセット値バッファに格納した前記オフセット値と前記パターンバッファ格納したパターンを比較して、一致するか否かを判定し、
前記カウンタは、前記オフセット値バッファの内容が前記パターンと一致すると判定した場合に、一致した回数をカウントし、
前記トレース情報出力部は、前記オフセット値バッファの内容が前記パターンと一致しないと判定した場合に、前記パターン及び前記前記カウンタの値を出力するメモリアクセストレース情報取得装置。
The memory access trace information acquisition device according to claim 7,
An event detection unit for detecting an event of executing the program of the CPU;
The offset value storage unit includes an offset value buffer that stores the offset value between the detected events and a pattern buffer that stores a pattern indicating the offset value group,
The offset value comparison unit compares the offset value stored in the offset value buffer with the pattern stored in the pattern buffer, and determines whether or not they match.
When the counter determines that the contents of the offset value buffer match the pattern, the counter counts the number of matches,
The trace information output unit is a memory access trace information acquisition device that outputs the pattern and the value of the counter when it is determined that the content of the offset value buffer does not match the pattern.
請求項1ないし6のいずれかに記載のメモリアクセストレース情報取得方法の各ステップをコンピュータに実行させるためのプログラム。   The program for making a computer perform each step of the memory access trace information acquisition method in any one of Claim 1 thru | or 6. 請求項10に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。   The computer-readable recording medium which recorded the program of Claim 10.
JP2006344541A 2006-12-21 2006-12-21 Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium Withdrawn JP2008158662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006344541A JP2008158662A (en) 2006-12-21 2006-12-21 Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006344541A JP2008158662A (en) 2006-12-21 2006-12-21 Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium

Publications (1)

Publication Number Publication Date
JP2008158662A true JP2008158662A (en) 2008-07-10

Family

ID=39659519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006344541A Withdrawn JP2008158662A (en) 2006-12-21 2006-12-21 Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium

Country Status (1)

Country Link
JP (1) JP2008158662A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013095601A1 (en) * 2011-12-23 2013-06-27 Intel Corporation Instruction for element offset calculation in a multi-dimensional array
US9489196B2 (en) 2011-12-23 2016-11-08 Intel Corporation Multi-element instruction with different read and write masks
US9996350B2 (en) 2014-12-27 2018-06-12 Intel Corporation Hardware apparatuses and methods to prefetch a multidimensional block of elements from a multidimensional array

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013095601A1 (en) * 2011-12-23 2013-06-27 Intel Corporation Instruction for element offset calculation in a multi-dimensional array
CN104081341A (en) * 2011-12-23 2014-10-01 英特尔公司 Instructions for Element Offset Computation in Multidimensional Arrays
US9489196B2 (en) 2011-12-23 2016-11-08 Intel Corporation Multi-element instruction with different read and write masks
US9507593B2 (en) 2011-12-23 2016-11-29 Intel Corporation Instruction for element offset calculation in a multi-dimensional array
CN104081341B (en) * 2011-12-23 2017-10-27 英特尔公司 Instructions for Element Offset Computation in Multidimensional Arrays
US10025591B2 (en) 2011-12-23 2018-07-17 Intel Corporation Instruction for element offset calculation in a multi-dimensional array
US10037208B2 (en) 2011-12-23 2018-07-31 Intel Corporation Multi-element instruction with different read and write masks
US9996350B2 (en) 2014-12-27 2018-06-12 Intel Corporation Hardware apparatuses and methods to prefetch a multidimensional block of elements from a multidimensional array
US10656944B2 (en) 2014-12-27 2020-05-19 Intel Corporation Hardware apparatus and methods to prefetch a multidimensional block of elements from a multidimensional array

Similar Documents

Publication Publication Date Title
EP1130518B1 (en) Software analysis system having an apparatus for selectively collecting analysis data from a target system executing software instrumented with tag statements and method for use thereof
Korel et al. Application of Dynamic Slicing in Program Debugging.
KR101581001B1 (en) Method and apparatus for dynamic analysis of program
EP3387536B1 (en) Method and device for non-intrusively collecting function trace data
US9836379B2 (en) Method and system for generating a memory trace of a program code executable on a programmable target
KR20120031834A (en) Apparatus and method for instrumentation
US20100083237A1 (en) Reducing trace overheads by modifying trace operations
GB2454263A (en) Generating debug information from low level program code
US8448147B2 (en) Heterogenic Coverage Analysis
US20010025295A1 (en) Computer system, memory management method, storage medium and program transmission apparatus
KR20180039830A (en) Apparatus and method for detecting code reuse attack
US6678884B1 (en) Method for determining the status of variables during the execution of optimized code
CN105550575A (en) Method and device for obtaining un-exported function address and data structure offset
US9442826B2 (en) Kernel functionality checker
JP2017167984A (en) Information processing device, information processing program, and inspection system
JP2008158662A (en) Memory access trace information acquisition method, memory access trace information acquisition device, memory access trace information acquisition program, and recording medium
US8756580B2 (en) Instance-based field affinity optimization
US20170364054A1 (en) Numerical controller and variable determining method
WO2002001357A2 (en) A method for allowing execution management of optimized code
EP3379418B1 (en) Trace data representation
CN113439271B (en) Protected operation handling
JP2008250838A (en) Software generation apparatus, method, and program
Ha et al. Efficient On-the-fly Detection of First Races in Nested Parallel Programs0
JP2004030514A (en) Method for analyzing performance
CN120407353A (en) Method, device and computer equipment for querying function execution time

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20100302