JP2010128681A - Timestamp acquisition circuit and timestamp acquisition method - Google Patents
Timestamp acquisition circuit and timestamp acquisition method Download PDFInfo
- Publication number
- JP2010128681A JP2010128681A JP2008301137A JP2008301137A JP2010128681A JP 2010128681 A JP2010128681 A JP 2010128681A JP 2008301137 A JP2008301137 A JP 2008301137A JP 2008301137 A JP2008301137 A JP 2008301137A JP 2010128681 A JP2010128681 A JP 2010128681A
- Authority
- JP
- Japan
- Prior art keywords
- trace
- counter
- time stamp
- overflow
- buffer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、タイムスタンプ取得回路及びタイムスタンプ取得方法に関する。 The present invention relates to a time stamp acquisition circuit and a time stamp acquisition method.
マイコンのプログラム開発及びデバッグには、エミュレータやデバッグシステムが使用される。エミュレータやデバッグシステムは、マイコンからトレースデータを収集することができ、また、プログラム開発者は、その収集されたトレースデータを解析して、効率的に作業を進めることが可能である。 An emulator or a debugging system is used for microcomputer program development and debugging. The emulator and the debugging system can collect trace data from the microcomputer, and the program developer can analyze the collected trace data and work efficiently.
近年、エミュレータやデバッグシステムに求められるトレース情報量が増え続けている。データトレースを行うときには、アクセスアドレス値、アクセスデータ値のみならず、アクセス命令実行プログラムカウンタ値(Program Counter 値:PC値)の収集が求められている。また、プログラム実行トレースに関しては、最近では、分岐トレースが広く採用されている。分岐トレースを行うときには、分岐命令実行時の分岐元/分岐先PC値の収集が求められている。分岐トレースを行うと分かるのであるが、分岐回数が多く、分岐頻度が高いプログラムも存在し、また、プログラムのデバッグでは、数日間に亘るプログラム実行状況をトレースすることも珍しくはない。よって、分岐トレースでは、分岐回数が膨大になることが多々あり、この場合には、トレース情報量が肥大化してしまう。更に、近年のマルチコアチップの登場により、CPUの個数分だけトレースデータを収集しなければならなくなっている。 In recent years, the amount of trace information required for emulators and debug systems continues to increase. When performing data tracing, it is required to collect not only access address values and access data values, but also access instruction execution program counter values (Program Counter values: PC values). As for the program execution trace, a branch trace has been widely adopted recently. When branch tracing is performed, collection of branch source / branch destination PC values at the time of branch instruction execution is required. As can be seen from the branch trace, there are programs having a high branch frequency and a high branch frequency, and it is not uncommon to trace the program execution status for several days in debugging the program. Therefore, in the branch trace, the number of branches is often enormous, and in this case, the amount of trace information is enlarged. Furthermore, with the advent of multi-core chips in recent years, it is necessary to collect trace data for the number of CPUs.
一般に、トレースメモリには、トレースデータと共に、そのトレースデータを収集した時間を示すタイムスタンプがセットで蓄積される。トレースメモリを有効活用するために、タイムスタンプのデータ量を縮小する技術が知られる。特開2007−241431号公報(特許文献1参照)に記載された「トレースデータ記録装置」の発明は、リアルタイムカウンタのビット数よりも少ないビット数でカウントを行うnビットカウンタを用いる。nビットカウンタは、トレース対象のバス情報をトレースメモリに書き込んだ間隔をカウントしており、トレースメモリには、バス情報と、nビットカウンタのカウント値とが対応付けられて記憶される。但し、nビットカウンタがフルカウントになった場合には、リアルタイムカウンタのカウント値がトレースメモリに記憶される。nビットカウンタのカウント値は、リアルタイムカウンタのカウント値よりもビット数が少ないので、トレースメモリに記憶されるデータ量が全体として小さくなる。 Generally, a time stamp indicating the time when the trace data is collected is stored in the trace memory together with the trace data. In order to effectively use the trace memory, a technique for reducing the amount of time stamp data is known. The invention of “Trace Data Recording Device” described in Japanese Patent Application Laid-Open No. 2007-241431 (see Patent Document 1) uses an n-bit counter that counts with a bit number smaller than that of the real-time counter. The n-bit counter counts the interval at which the trace target bus information is written to the trace memory, and the bus information and the count value of the n-bit counter are stored in the trace memory in association with each other. However, when the n-bit counter reaches full count, the count value of the real-time counter is stored in the trace memory. Since the count value of the n-bit counter has a smaller number of bits than the count value of the real-time counter, the amount of data stored in the trace memory is reduced as a whole.
トレース情報量が膨大になると、大容量のトレースメモリが必要となる。しかし、エバリュエーションチップに内蔵される程度のメモリ容量では、実際のプログラムデバッグの使用に耐え得ない。よって、現実的には、トレースメモリはエバリュエーションチップの外部に大規模のものを備えることが必須となる。トレースメモリをチップの外部に設ければ、エミュレーション対象のマイコンごとに、エミュレータやデバッグシステムの製品仕様ごとに、トレースメモリの容量を変えることも可能となる。上記公知文献記載の「トレースデータ記録装置」では、CPUとトレースメモリとが同一のチップに実装されている。そのため、トレースメモリの大容量化が難しいという課題がある。 When the amount of trace information becomes enormous, a large amount of trace memory is required. However, the memory capacity that is built into the evaluation chip cannot withstand the actual use of program debugging. Therefore, in reality, it is indispensable to provide a large scale memory outside the evaluation chip. If the trace memory is provided outside the chip, the capacity of the trace memory can be changed for each microcomputer to be emulated and for each product specification of the emulator and the debug system. In the “trace data recording apparatus” described in the above-mentioned known document, the CPU and the trace memory are mounted on the same chip. Therefore, there is a problem that it is difficult to increase the capacity of the trace memory.
特に、マイコン製品の中にエミュレーション機能を内蔵するデバッグチップでは、回路規模をできるだけ小さくし、チップコストを抑えたいという要求がある。内蔵されるタイムスタンプ用カウンタのビット数は少ないほど、その回路規模が小さいほどチップコストの面で好ましい。しかし、上記公知文献記載の技術では、nビットカウンタのほかに、回路規模が非常に大きいリアルタイムカウンタを搭載しているので、コスト高を招いているという課題がある。 In particular, a debug chip having an emulation function built into a microcomputer product is required to reduce the circuit scale as much as possible and to reduce the chip cost. The smaller the number of bits of the built-in time stamp counter and the smaller the circuit scale, the better in terms of chip cost. However, in the technique described in the above-mentioned known document, there is a problem that the cost is increased because a real-time counter having a very large circuit scale is mounted in addition to the n-bit counter.
以下に、[発明を実施するための最良の形態]で使用される番号・符号を用いて、[課題を解決するための手段]を説明する。これらの番号・符号は、[特許請求の範囲]の記載と[発明を実施するための最良の形態]との対応関係を明らかにするために括弧付きで付加されたものである。ただし、それらの番号・符号を、[特許請求の範囲]に記載されている発明の技術的範囲の解釈に用いてはならない。 [Means for Solving the Problems] will be described below using the numbers and symbols used in [Best Mode for Carrying Out the Invention]. These numbers and symbols are added in parentheses in order to clarify the correspondence between the description of [Claims] and [Best Mode for Carrying Out the Invention]. However, these numbers and symbols should not be used for the interpretation of the technical scope of the invention described in [Claims].
本発明の一つ目のアスペクトによるタイムスタンプ取得回路は、タイムスタンプカウンタ(36)と、オーバーフローフラグ(34)と、オーバーフローカウンタ(71)と、トレースメモリ書き込み制御回路(74)とを具備する。タイムスタンプカウンタ(36)は、所定のクロックに従って、一定の時間間隔を計数する。オーバーフローフラグ(34)は、タイムスタンプカウンタ(36)がオーバーフローしたことを記録する。オーバーフローカウンタ(71)は、タイムスタンプカウンタ(36)がオーバーフローした回数を計数する。トレースメモリ書き込み制御回路(74)は、一のトレースデータが収集された場合において、オーバーフローフラグ(34)がオンになっていたときには、一のトレースデータと、タイムスタンプカウンタ(36)のカウント値と、オーバーフローカウンタ(71)のカウント値とをトレースメモリ(80)に書き込む。 The time stamp acquisition circuit according to the first aspect of the present invention includes a time stamp counter (36), an overflow flag (34), an overflow counter (71), and a trace memory write control circuit (74). The time stamp counter (36) counts constant time intervals according to a predetermined clock. The overflow flag (34) records that the time stamp counter (36) has overflowed. The overflow counter (71) counts the number of times the time stamp counter (36) has overflowed. When one trace data is collected and the overflow flag (34) is turned on, the trace memory write control circuit (74) sets one trace data and the count value of the time stamp counter (36). The count value of the overflow counter (71) is written into the trace memory (80).
本発明の二つ目のアスペクトによるタイムスタンプ取得方法は、時間間隔を計数することと、記録することと、回数を計数することと、書き込むこととを具備する。計数することにおいては、所定のクロックを与えられるタイムスタンプカウンタ(36)により、一定の時間間隔を計数する。記録することにおいては、タイムスタンプカウンタ(36)がオーバーフローしたことをオーバーフローフラグ(34)に記録する。回数を計数することにおいては、オーバーフローカウンタ(71)により、タイムスタンプカウンタ(36)がオーバーフローした回数を計数する。書き込むことにおいては、一のトレースデータが収集された場合において、オーバーフローフラグ(34)がオンになっていたときには、一のトレースデータと、タイムスタンプカウンタ(36)のカウント値と、オーバーフローカウンタ(71)のカウント値とをトレースメモリ(80)に書き込む。 The time stamp acquisition method according to the second aspect of the present invention includes counting the time interval, recording, counting the number of times, and writing. In counting, a predetermined time interval is counted by a time stamp counter (36) to which a predetermined clock is given. In recording, the overflow flag (34) records that the time stamp counter (36) has overflowed. In counting the number of times, the overflow counter (71) counts the number of times the time stamp counter (36) has overflowed. In writing, when one trace data is collected and the overflow flag (34) is on, the one trace data, the count value of the time stamp counter (36), and the overflow counter (71 ) Is written to the trace memory (80).
これらのタイムスタンプ取得回路及びタイムスタンプ取得方法は、タイムスタンプカウンタ(36)のカウント値と、オーバーフローカウンタ(71)のカウント値とを合わせることで、かなり長い時間を計測することが可能になる。また、トレース対象とするチップの内部にタイムスタンプカウンタ(36)を設け、そのチップの外部にオーバーフローカウンタ(72)を設けることにより、トレース対象とするチップの回路規模を抑制し、コストダウンを図ることができる。さらに、トレースメモリ(80)も、トレース対象とするチップの外部に設けることが可能であるから、トレースメモリ(80)を大容量化することができる。 These time stamp acquisition circuits and time stamp acquisition methods can measure a considerably long time by combining the count value of the time stamp counter (36) and the count value of the overflow counter (71). Further, by providing a time stamp counter (36) inside the chip to be traced and providing an overflow counter (72) outside the chip, the circuit scale of the chip to be traced is suppressed and the cost is reduced. be able to. Furthermore, since the trace memory (80) can also be provided outside the chip to be traced, the capacity of the trace memory (80) can be increased.
本発明によれば、トレースメモリを大容量化することができる。また、トレース対象とするデバッグチップやエバリュエーションチップの回路規模を小さくすることができる。 According to the present invention, the capacity of the trace memory can be increased. In addition, the circuit scale of the debug chip or evaluation chip to be traced can be reduced.
図1は、本発明を実施するための最良の形態の一つを説明するブロック構成図である。図1において、タイムスタンプ取得回路は、タイムスタンプカウンタ制御回路30と、オーバーフローカウンタ制御回路70とを備え、マルチコアのプロセッサからトレースデータを収集し、そのトレースデータにタイムスタンプを付加して、トレースメモリ80への書き込みを行っている。タイムスタンプカウンタ制御回路30は、プロセッサと同一のチップに実装することができ、所定のクロックに従ってカウント動作を行うタイムスタンプカウンタ36によって、時間間隔を計測する。オーバーフローカウンタ制御回路70は、プロセッサチップの外部に実装することができ、タイムスタンプカウンタ36がキャリー信号を出力した回数を計数するオーバーフローカウンタ71によって、タイムスタンプカウンタ36による時間計測を補足する。トレースメモリ80は、オーバーフローカウンタ制御回路70と同様に、プロセッサチップの外部に実装することができる。
FIG. 1 is a block diagram illustrating one of the best modes for carrying out the present invention. In FIG. 1, the time stamp acquisition circuit includes a time stamp
図1に示すように、本実施の形態によるタイムスタンプ取得回路は、マルチコアのプロセッサからトレースデータを収集することができる。このマルチコアのプロセッサは、第1CPUコア11を含む第1プロセッサ13と、第2CPUコア12を含む第2プロセッサ14とを有している。第1プロセッサ13、及び、第2プロセッサ14は、各々が内蔵する第1CPUコア11、及び、第2CPUコア12がトレース対象命令を実行すると、トレース対象命令実行検出信号と、トレースデータとを出力する。タイムスタンプカウンタ制御回路30は、これらのトレース対象命令実行検出信号と、トレースデータとを入力する。
As shown in FIG. 1, the time stamp acquisition circuit according to the present embodiment can collect trace data from a multi-core processor. This multi-core processor has a
図示するように、タイムスタンプカウンタ制御回路30は、トレースメッセージ生成回路35と、タイムスタンプカウンタ36と、トレースメッセージバッファ37とを有している。図中、タイムスタンプカウンタ36は、トレースメッセージ生成回路35からリセット信号(RES)を受信すると初期化され、ゼロから計数を開始する。タイムスタンプカウンタ36は、所定のクロックに同期して、一定の時間間隔でカウント動作を行い、そのタイムスタンプカウント値は、トレースメッセージ生成回路35に送出される。タイムスタンプカウンタ36は、フルカウントを計数し、オーバーフローすると、キャリー信号を出力する。トレースメッセージ生成回路35は、このキャリー信号を入力する。それから、オーバーフローカウンタ制御回路70も、このキャリー信号を入力する。
As illustrated, the time stamp
トレースメッセージ生成回路35は、OVF(Overflow:オーバーフロー)フラグ34の制御を行っている。図2A及び図2Bは、トレースメッセージ生成回路35によるOVFフラグ34の制御方法の説明図である。図2Aに示すように、トレースメッセージ生成回路35は、タイムスタンプカウンタ36から出力されるキャリー信号を監視する(ステップS10)。そして、キャリー信号を受信すると、OVFフラグ34をセットする(S12)。OVFフラグ34は、オンになる。2回目以降のキャリー信号を受信した場合には、そのままオン状態を維持する。すなわち、一度でもキャリー信号がアクティブになると、OVFフラグ34はオンになる。一方、図2Bに示すように、トレースメッセージ生成回路35は、トレースメッセージバッファ37に書き込むトレースメッセージの生成処理が終了したか否かを判定し(S14)、終了したならば、OVFフラグ34をクリアする(S16)。OVFフラグ34はオフになる。
The trace
トレースメッセージ生成回路35は、トレースメッセージの生成を行う。トレースメッセージ生成回路35は、トレース対象の事象(例えば、実行PC値、直接分岐、間接分岐、RAMアクセス)ごとに、トレースしたデータを決まったフォーマットに整形する。整形されたデータをトレースメッセージと呼ぶ。
The trace
図2Cは、第1プロセッサ13、及び、第2プロセッサ14から送出されるトレースデータを、トレースメッセージバッファに書き込むトレースメッセージ生成回路35の動作説明図である。図2Cにおいて、トレースメッセージ生成回路35は、第1プロセッサ13、及び、第2プロセッサ14から送出されるトレース対象命令実行検出信号を監視している(S20)。トレース対象命令実行検出信号を受信すると、トレースメッセージ生成回路35は、トレースメッセージの生成を行い、また、必要に応じて、オーバーフローカウンタ71のカウント値を要求する(S22)。トレースメッセージには、第1プロセッサ13又は第2プロセッサ14から受け取るトレースデータと、タイムスタンプカウンタ36から受け取るタイムスタンプカウント値と、OVFフラグ34の値とが含まれる。それから、本実施の形態では、マルチコアのプロセッサを対象としているので、更に、どちらのプロセッサからのトレースデータかを示すプロセッサ識別子も含まれる。トレースメッセージ生成回路35は、生成したトレースメッセージを、トレースメッセージバッファ37に書き込む(S24)。
FIG. 2C is an operation explanatory diagram of the trace
図2Dは、トレースメッセージ生成回路35が、オーバーフローカウンタ制御回路70に対して行っているオーバーフローカウント値の要求方法の説明図である。トレースメッセージ生成回路35は、トレースメッセージの生成を行うときに、オーバーフローカウンタ71のカウント値要求処理を行っている。トレースメッセージ生成回路35は、OVFフラグ34を参照し、OVFフラグ34のオン/オフを判定する(S26)。OVFフラグ34がオンのとき、トレースメッセージ生成回路35は、オーバーフローカウンタ71のカウント値要求信号を出力する(S28)。一方、OVFフラグ34がオフのとき、トレースメッセージ生成回路35は、オーバーフローカウンタ71のカウント値要求信号を出力することを行わない。
FIG. 2D is an explanatory diagram of an overflow count value requesting method performed by the trace
従って、トレースメッセージ生成回路35は、OVFフラグ34がオンのとき、生成したトレースメッセージを、トレースメッセージバッファ37に書き込むと共に(S24)、オーバーフローカウンタ71のカウント値要求信号を出力する(S28)。その結果、トレースメッセージと、オーバーフローカウンタ71のカウント値とが対応付けられて、トレースメッセージバッファ37と、OVFカウント値バッファ73とに、それぞれ書き込まれる。一方、OVFフラグ34がオフのときには、結果として、トレースメッセージバッファ37への書き込みのみが行われる(S24)。
Accordingly, when the
トレースメッセージバッファ37は、FIFO(First In First Out:先入れ先出し)バッファで成る。トレースメッセージバッファ37は、トレースメッセージ生成回路35によって生成されたトレースメッセージを、生成された順番にエントリすると共に、先頭のトレースメッセージを出力クロック同期で、バス幅毎に分割して出力する。それぞれの分割データは、一つのトレースメッセージの最初の分割データか、最後の分割データか、途中の分割データか等を示すステータス信号を伴って出力される。
The
図1において、オーバーフローカウンタ制御回路70は、OVFカウンタ71と、OVFカウント値生成回路72と、OVFカウント値バッファ73と、トレースメモリ書き込み制御回路74とを有している。OVFカウンタ71は、トレースメッセージ生成回路35からリセット信号(RES)を受信すると初期化され、ゼロから計数を開始する。OVFカウンタ71は、タイムスタンプカウンタ36から出力されるキャリー信号の数を計数しており、キャリー信号がアクティブになるごとにカウントアップする。
In FIG. 1, the overflow
OVFカウント値生成回路72は、トレースメッセージ生成回路35からのOVFカウント値要求信号がアクティブになると、OVFカウンタ71のカウント値を読み出し、そのカウント値をOVFカウント値バッファ73にエントリする。トレースメッセージ生成回路35からのOVFカウント値要求信号がアクティブでは無いときには、OVFカウント値バッファ73への書き込みは行わない。
When the OVF count value request signal from the trace
OVFカウント値バッファ73は、FIFO(First In First Out:先入れ先出し)バッファで成る。OVFカウント値生成回路72によって生成されたカウント値は、生成された順番に、OVFカウント値バッファ73にエントリされる。
The OVF
トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から出力されるトレースメッセージを受け取り、また、OVFカウント値バッファ73から出力されるカウント値を受け取る。そして、トレースメモリ80への書き込みを行う。図3及び図4は、トレースメモリ書き込み制御回路74の動作説明図である。図3は、二つのバッファ37,73及びトレースメモリ80におけるデータ構造の具体例を示したものである。図3の例を参照すると、トレースメッセージバッファ37には六つのエントリがあり、OVFカウント値バッファ73には二つのエントリがある。トレースメッセージバッファ37の六つのエントリを参照すると、四つ目のトレースメッセージにおけるトレースデータを収集したときに、タイムスタンプカウンタ36がオーバーフローし、一個目のキャリー信号が出力されていることが分かる。また、六つ目のトレースメッセージにおけるトレースデータを収集したときに、タイムスタンプカウンタ36がオーバーフローし、二個目のキャリー信号が出力されていることが分かる。
The trace memory
図3の具体例と、図4のフローチャートとに基づいて、トレースメモリ書き込み制御回路74の書き込み動作を詳細に説明する。まず、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、一つ目のトレースメッセージを読み込む。そして、そのトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。図3に示すように、一つ目のトレースメッセージにおけるオーバーフローフラグはオフなので、トレースメモリ書き込み制御回路74は、トレースメモリ80に、一つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。同様に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、二つ目のトレースメッセージと、三つ目のトレースメッセージとを書き込む(S43)。
The write operation of the trace memory
続いて、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、四つ目のトレースメッセージを読み込む。そして、その四つ目のトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。四つ目のトレースメッセージにおけるオーバーフローフラグはオンなので、トレースメモリ書き込み制御回路74は、OVFカウント値バッファから、一個目のOVFカウント値を読み込む。そして、トレースメモリ80に、一個目のOVFカウント値を書き込む(S41)。トレースメモリ80への書き込みアドレスをインクリメントする(S42)。更に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、四つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。
Subsequently, the trace memory
次に、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、五つ目のトレースメッセージを読み込む。そして、そのトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。五つ目のトレースメッセージにおけるオーバーフローフラグはオフなので、トレースメモリ書き込み制御回路74は、トレースメモリ80に、五つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。
Next, the trace memory
それから、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、最後の六つ目のトレースメッセージを読み込む。そして、その六つ目のトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。六つ目のトレースメッセージにおけるオーバーフローフラグはオンなので、トレースメモリ書き込み制御回路74は、OVFカウント値バッファから、最後の二個目のOVFカウント値を読み込む。そして、トレースメモリ80に、二個目のOVFカウント値を書き込む(S41)。トレースメモリ80への書き込みアドレスをインクリメントする(S42)。更に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、六つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。
Then, the trace memory
以上の書き込み動作によって、トレースメモリ80の内容は、図3に示した如くになる。図示するように、トレースメッセージバッファ37から読み出したトレースメッセージにおけるオーバーフローフラグがオンのときには、トレースメモリ80には、OVFカウント値と、トレースメッセージとがセットで記憶されている。一方、トレースメッセージバッファ37から読み出したトレースメッセージにおけるオーバーフローフラグがオフのときには、トレースメモリ80には、トレースメッセージのみが記憶されている。
With the above writing operation, the contents of the
本実施の形態におけるタイムスタンプ取得回路の全体の動作例について簡単に説明しておく。
ステップ1.タイムスタンプカウンタ36、OVFカウンタ71を初期化する。
ステップ2.第1プロセッサ13又は第2プロセッサ14にて、ユーザプログラムを実行する。同時にタイムスタンプカウンタ36、OVFカウンタ71のカウントアップを開始する。
ステップ3.第1プロセッサ13が第1CPUコア11でトレース対象命令の実行を検出すると、トレース対象命令実行検出信号とトレースデータとがトレースメッセージ生成回路35に出力される。
ステップ4.同様に、第2プロセッサ14が第2CPUコア12でトレース対象命令の実行を検出すると、トレース対象命令実行検出信号とトレースデータとがトレースメッセージ生成回路35に出力される。
ステップ5.トレースメッセージ生成回路35は、第1プロセッサ13又は第2プロセッサ14から、トレース対象命令実行検出信号を受け取る前に、一度でもタイムスタンプカウンタ36のキャリー信号がアクティブになると、OVFフラグ34をセットする。セットしたOVFフラグ34の状態は、トレース対象命令実行検出信号を受け取ったあと、トレースメッセージを生成するまで、保持する。
ステップ6.トレースメッセージ生成回路35は、第1プロセッサ13および第2プロセッサ14から、トレース対象命令実行検出信号を受け取ると、タイムスタンプカウンタ36からカウント値をリードする。また、このとき、OVFフラグ34がセットされていれば、OVFカウント値要求信号をOVFカウント値生成回路72に出力する。
ステップ7.トレースメッセージ生成回路35は、第1プロセッサ13及び第2プロセッサ14からのトレースデータ(本実施の形態におけるプロセッサはマルチコアなので、どちらのプロセッサからのデータかを示す情報を含む。)、タイムスタンプカウント値、OVFフラグ34の値からトレースメッセージを生成し、トレースメッセージバッファ37にエントリする。
ステップ8.OVFカウント値生成回路72は、OVFカウント値要求信号を受け取ると、OVFカウンタ71のカウント値をOVFカウント値バッファ73にエントリする。
ステップ9.トレースメッセージ生成回路35は、リセット信号(RES)をアクティブにし、タイムスタンプカウンタ36、OVFカウンタ71を0クリアする。
ステップ10.トレースメッセージバッファ37は、トレースメッセージを先頭から順次、トレースメモリ書き込み制御回路74に出力する。
ステップ11.第1プロセッサ13、第2プロセッサ14が、トレース対象命令の実行を検出するたびに、上記ステップ3.〜ステップ9.を実行する。
ステップ12.トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から出力されるトレースメッセージを受け取る。そのトレースメッセージ内のオーバーフローフラグがオフであれば、トレースメッセージをトレースメモリ80に書き込み、トレースメモリ80への書き込みアドレスをインクリメントする。
ステップ13.トレースメモリ書き込み制御回路74は、そのトレースメッセージ内のオーバーフローフラグがオンであれば、トレースメッセージをトレースメモリ80に書き込む前に、OVFカウント値バッファ73の先頭のOVFカウント値を先にトレースメモリ80に書き込み、アドレスをインクリメントした後で、トレースメッセージを書き込み、更にトレースメモリ80のアドレスをインクリメントする。
An overall operation example of the time stamp acquisition circuit in this embodiment will be briefly described.
Step 3. When the
Step 4. Similarly, when the
Step 5. The trace
Step 6. When the trace
Step 7. The trace
Step 8. When receiving the OVF count value request signal, the OVF count
Step 9. The trace
Step 10. The
本実施の形態における効果として、次のような効果を挙げることができる。
〔1〕本実施の形態においては、トレースメモリ80を、プロセッサと同一のチップに設ける必要が無い。よって、トレースメモリ80の容量を十分に大きくすることができるので、マルチコアチップのプログラム開発/デバッグに必要な大量のトレースデータの取得を可能にするという効果がある。
〔2〕本実施の形態においては、プロセッサと同一のチップに、比較的小さなタイムスタンプカウンタを一つ設ければ良いので、出力バスのバス幅が拡がることを抑制することができる。よって、デバッグチップ、エバリュエーションチップのコストを低減できるという効果がある。また、タイムスタンプカウンタの回路規模は、上記特許文献1の図1に示されているようなリアルタイムカウンタの回路規模と比較すると、かなりの小型化を図ることが可能である。よって、デバッグチップ、エバリュエーションチップの回路規模を相当小さくすることができるという効果がある。
〔3〕本実施の形態においては、トレースメッセージと、OVFカウント値とを別々に異なるFIFOに保持しているが、これらは対応付けられて書き込まれている。よって、タイムスタンプカウンタ36のオーバーフローが、トレースメッセージバッファ(FIFO)37を経由して順次出力されるトレースメッセージのどのメッセージ間で発生したかを容易に特定できるという効果がある。
The following effects can be given as effects in the present embodiment.
[1] In this embodiment, it is not necessary to provide the
[2] In this embodiment, since only one relatively small time stamp counter is provided on the same chip as the processor, it is possible to suppress an increase in the bus width of the output bus. Therefore, the cost of the debug chip and the evaluation chip can be reduced. Further, the circuit scale of the time stamp counter can be considerably reduced as compared with the circuit scale of the real-time counter as shown in FIG. Therefore, there is an effect that the circuit scale of the debug chip and the evaluation chip can be considerably reduced.
[3] In this embodiment, the trace message and the OVF count value are separately held in different FIFOs, but these are written in association with each other. Therefore, there is an effect that it is possible to easily specify between which of the trace messages sequentially output via the trace message buffer (FIFO) 37 the overflow of the
図5に、実施例1の構成を説明するブロック図を示す。実施例1は、上述した実施の形態によるタイムスタンプ取得回路を、デバッグチップ41と、エミュレータ本体50とに組み込んだ例である。図中、プログラム開発対象のマイクロコンピュータが搭載されるユーザーターゲットシステム20に、ソケット21が実装されている。デバッグチップ41は、プログラム開発対象のマイクロコンピュータが持つ全機能を担い、また、上述した諸機能を備えるタイムスタンプ制御回路30を内部に実装している。デバッグチップ41は、ソケット21を介して電気的にユーザーターゲットシステム20と接続されている。更に、デバッグチップ41は、エミュレーションプローブ22を介して、エミュレータ本体50の構成要素であるエミュレーション制御回路51と電気的に接続されている。エミュレーション制御回路51は、上述した諸機能を備えるオーバーフローカウンタ制御回路70を有している。エミュレーションプローブ22は、信号を伝達するケーブルの役割を担っている。
FIG. 5 is a block diagram illustrating the configuration of the first embodiment. Example 1 is an example in which the time stamp acquisition circuit according to the above-described embodiment is incorporated in the
エミュレータ本体50は、エミュレーション制御回路51と、トレースメモリ80と、ホストI/F 52とを有している。これらは、別々のチップに実装されている。エミュレータ本体50は、ホストPC 60と、USBケーブルなどによって接続される。ホストPC 60では、デバッガプログラムが実行される。ユーザの操作を受け付けるデバッガプログラムは、ホストI/F 52を介してエミュレータ本体50と通信を行うことができる。
The emulator
トレースデータの収集は、デバッガプログラムが実行されるホストPC 60からの指示によって開始することができる。また、ホストPC 60からの要求により、トレースメモリ80に保存されたトレースメッセージを、エミュレータ本体50からホストPC 60へ読み出すことが可能である。ホストPC 60は、その他、ホストI/F 52を介して、エミュレーション制御回路51の設定レジスタの設定を行うことができ、また、エミュレーション制御回路51を介して、デバッグチップ41の設定レジスタの設定を行うことができる。なお、点線で囲んだ矩形の回路ブロック40は、図1の構成図と概ね対応している。その対応関係を分かり易く説明するために図示したものである。
Collection of trace data can be started by an instruction from the
図6に、実施例2の構成を説明するブロック図を示す。実施例2は、上述した実施の形態によるタイムスタンプ取得回路を、エバリュエーションチップを備えたエミュレータ本体55内部に全て組み込んだ例である。図6において、エミュレータ本体55は、周辺エバリュエーションチップ56と、CPUエバリュエーションチップ43と、エミュレーション制御回路51と、トレースメモリ80と、ホストI/F 52とを有している。これらは、別々のチップに実装されている。CPUエバリュエーションチップ43は、プログラム開発対象のマイクロコンピュータが持つ全機能を担い、また、上述した諸機能を備えるタイムスタンプ制御回路30を内部に実装している。CPUエバリュエーションチップ43は、周辺エバリュエーションチップ56と、エミュレーションプローブ22と、ソケット21とを介して、電気的にユーザーターゲットシステム20と接続されている。また、エミュレータ本体55のエミュレーション制御回路51とも電気的に接続されている。エミュレーション制御回路51は、上述した諸機能を備えるオーバーフローカウンタ制御回路70を有している。
FIG. 6 is a block diagram illustrating the configuration of the second embodiment. Example 2 is an example in which the time stamp acquisition circuit according to the above-described embodiment is all incorporated in the emulator
エミュレータ本体55は、ホストPC 60と、USBケーブルなどによって接続される。ホストPC 60では、デバッガプログラムが実行される。ユーザの操作を受け付けるデバッガプログラムは、ホストI/F 52を介してエミュレータ本体55と通信を行うことが可能である。トレースデータの収集は、デバッガプログラムが実行されるホストPC 60からの指示によって開始することができる。また、ホストPC 60からの要求により、トレースメモリ80に保存されたトレースメッセージを、エミュレータ本体55からホストPC 60へ読み出すことができる。ホストPC 60は、その他、ホストI/F 52を介して、エミュレーション制御回路51の設定レジスタの設定を行うことができ、また、エミュレーション制御回路51を介して、CPUエバリュエーションチップ43の設定レジスタの設定を行うことができる。なお、点線で囲んだ矩形の回路ブロック42は、図1の構成図と概ね対応している。その対応関係を分かり易く説明するために図示したものである。
The emulator
11,12 CPUコア
13,14 プロセッサ
20 ユーザーターゲットシステム
21 ソケット
22 エミュレーションプローブ
30 タイムスタンプカウンタ制御回路
34 OVFフラグ
35 トレースメッセージ生成回路
36 タイムスタンプカウンタ
37 トレースメッセージバッファ
40,42 回路ブロック
41 デバッグチップ
43 CPUエバリュエーションチップ
50,55 エミュレータ本体
51 エミュレーション制御回路
52 ホストI/F
56 周辺エバリュエーションチップ
60 ホストPC
70 オーバーフローカウンタ制御回路
71 OVFカウンタ
72 OVFカウント値生成回路
73 OVFカウント値バッファ
74 トレースメモリ書き込み制御回路
80 トレースメモリ
11, 12
56
70 Overflow
Claims (10)
前記タイムスタンプカウンタがオーバーフローしたことを記録するオーバーフローフラグと、
前記タイムスタンプカウンタがオーバーフローした回数を計数するオーバーフローカウンタと、
一のトレースデータが収集された場合において、前記オーバーフローフラグがオンになっていたときには、前記一のトレースデータと、前記タイムスタンプカウンタのカウント値と、前記オーバーフローカウンタのカウント値とをトレースメモリに書き込むトレースメモリ書き込み制御回路とを具備する
タイムスタンプ取得回路。 A time stamp counter that counts a certain time interval according to a predetermined clock; and
An overflow flag for recording that the time stamp counter has overflowed;
An overflow counter that counts the number of times the time stamp counter overflows;
When the one trace data is collected and the overflow flag is on, the one trace data, the count value of the time stamp counter, and the count value of the overflow counter are written to the trace memory. A time stamp acquisition circuit comprising a trace memory write control circuit.
前記一のトレースメッセージを記憶する第一のバッファと、
前記一のトレースデータが収集された場合において、前記オーバーフローフラグがオンになっていたときに、前記オーバーフローカウンタのカウント値を記憶する第二のバッファとを更に具備し、
トレースメモリ書き込み制御回路は、
前記第一のバッファから読み出した前記一のトレースメッセージにおけるオーバーフローフラグの値がオフになっていた場合には、前記一のトレースメッセージを前記トレースメモリに書き込み、
前記第一のバッファから読み出した前記一のトレースメッセージにおけるオーバーフローフラグの値がオンになっていた場合には、前記一のトレースメッセージと、前記第二のバッファに記憶された前記オーバーフローカウンタのカウント値とを前記トレースメモリに書き込む
請求項1記載のタイムスタンプ取得回路。 A trace message generation circuit that generates a trace message including the trace data, a count value of the time stamp counter, and a value of the overflow flag when the trace data is collected;
A first buffer for storing the one trace message;
A second buffer for storing a count value of the overflow counter when the overflow flag is on when the one trace data is collected;
Trace memory write control circuit
If the value of the overflow flag in the one trace message read from the first buffer is off, the one trace message is written to the trace memory,
If the value of the overflow flag in the one trace message read from the first buffer is on, the one trace message and the count value of the overflow counter stored in the second buffer The time stamp acquisition circuit according to claim 1.
FIFO(First In First Out)メモリで成り、
前記トレースメッセージ生成回路は、
前記一のトレースメッセージを生成すると、前記一のトレースメッセージを前記第一のバッファに書き込むと共に、前記一のトレースメッセージにおけるオーバーフローフラグの値がオンであった場合には、前記オーバーフローカウンタのカウント値を前記第二のバッファに書き込むことを要求する制御信号を出力する
請求項2記載のタイムスタンプ取得回路。 The first buffer and the second buffer are:
It consists of FIFO (First In First Out) memory,
The trace message generation circuit includes:
When the one trace message is generated, the one trace message is written into the first buffer, and when the value of the overflow flag in the one trace message is ON, the count value of the overflow counter is set. The time stamp acquisition circuit according to claim 2, wherein a control signal for requesting writing to the second buffer is output.
前記チップの外部に、前記オーバーフローカウンタを設けた
請求項3記載のタイムスタンプ取得回路。 Provide the time stamp counter inside the chip to be traced,
The time stamp acquisition circuit according to claim 3, wherein the overflow counter is provided outside the chip.
デバッグチップ又はCPUエバリュエーションチップである
請求項4記載のタイムスタンプ取得回路。 The chip is
The time stamp acquisition circuit according to claim 4, wherein the time stamp acquisition circuit is a debug chip or a CPU evaluation chip.
前記タイムスタンプカウンタがオーバーフローしたことをオーバーフローフラグに記録することと、
オーバーフローカウンタにより、前記タイムスタンプカウンタがオーバーフローした回数を計数することと、
一のトレースデータが収集された場合において、前記オーバーフローフラグがオンになっていたときには、前記一のトレースデータと、前記タイムスタンプカウンタのカウント値と、前記オーバーフローカウンタのカウント値とをトレースメモリに書き込むこととを具備する
タイムスタンプ取得方法。 Counting a certain time interval by a time stamp counter provided with a predetermined clock;
Recording in the overflow flag that the time stamp counter has overflowed;
Counting the number of times the time stamp counter overflowed by an overflow counter;
When the one trace data is collected and the overflow flag is on, the one trace data, the count value of the time stamp counter, and the count value of the overflow counter are written to the trace memory. A time stamp acquisition method.
第一のバッファに、前記一のトレースメッセージを記憶することと、
前記一のトレースデータが収集された場合において、前記オーバーフローフラグがオンになっていたときには、
前記一のトレースメッセージに追加して、前記オーバーフローカウンタのカウント値を前記トレースメモリに書き込むべき旨を表示することと、
第二のバッファに、前記オーバーフローカウンタのカウント値を記憶することとを更に具備し、
前記書き込むことは、
前記第一のバッファから前記一のトレースメッセージを読み込むことと、
前記一のトレースメッセージに対して、前記書き込むべき旨の表示がなされていなかった場合には、前記一のトレースメッセージを前記トレースメモリに書き込むことと、
前記一のトレースメッセージに対して、前記書き込むべき旨の表示がなされていた場合には、前記第二のバッファから前記オーバーフローカウンタのカウント値を読み込み、前記一のトレースメッセージと、前記オーバーフローカウンタのカウント値とを前記トレースメモリに書き込むこととを含む
請求項6記載のタイムスタンプ取得方法。 Generating one trace message including the one trace data and a count value of the time stamp counter when the one trace data is collected;
Storing the one trace message in a first buffer;
When the one trace data is collected and the overflow flag is on,
In addition to the one trace message, indicating that the count value of the overflow counter should be written to the trace memory;
Storing the count value of the overflow counter in a second buffer;
The writing is
Reading the one trace message from the first buffer;
Writing the one trace message to the trace memory if the indication to write is not made for the one trace message;
If the indication to write is displayed for the one trace message, the count value of the overflow counter is read from the second buffer, and the count value of the one trace message and the overflow counter is read. The time stamp acquisition method according to claim 6, further comprising: writing a value into the trace memory.
前記一のトレースメッセージに、前記オーバーフローフラグの値を更に含めたものを、前記第一のバッファに記憶することを含み、
前記書き込むことは、
前記一のトレースメッセージにおけるオーバーフローフラグの値がオフになっていた場合を、前記書き込むべき旨の表示がなされていなかった場合とすることと、
前記一のトレースメッセージにおけるオーバーフローフラグの値がオンになっていた場合を、前記書き込むべき旨の表示がなされていた場合とすることとを更に含む
請求項7記載のタイムスタンプ取得方法。 The display is
Storing the one trace message further including the value of the overflow flag in the first buffer;
The writing is
When the value of the overflow flag in the one trace message is off, the case where the indication to write is not made,
The time stamp acquisition method according to claim 7, further comprising: when the overflow flag value in the one trace message is turned on, when indicating that the writing should be performed.
前記一のトレースメッセージを記憶することは、
前記第一のバッファに、順番にトレースメッセージを記憶することを含み、
前記オーバーフローカウンタのカウント値を記憶することは、
前記第二のバッファに、順番に前記カウント値を記憶することを含む
請求項8記載のタイムスタンプ取得方法。 The first buffer and the second buffer are composed of FIFO memories,
Storing the one trace message comprises:
Storing trace messages in order in the first buffer;
Storing the count value of the overflow counter,
The time stamp acquisition method according to claim 8, further comprising storing the count values in order in the second buffer.
前記チップの外部に、前記オーバーフローカウンタを設けることとを更に具備する
請求項9記載のタイムスタンプ取得方法。 Providing the time stamp counter inside the chip to be traced;
The time stamp acquisition method according to claim 9, further comprising: providing the overflow counter outside the chip.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008301137A JP5312918B2 (en) | 2008-11-26 | 2008-11-26 | Time stamp acquisition circuit and time stamp acquisition method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008301137A JP5312918B2 (en) | 2008-11-26 | 2008-11-26 | Time stamp acquisition circuit and time stamp acquisition method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010128681A true JP2010128681A (en) | 2010-06-10 |
JP5312918B2 JP5312918B2 (en) | 2013-10-09 |
Family
ID=42329043
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008301137A Expired - Fee Related JP5312918B2 (en) | 2008-11-26 | 2008-11-26 | Time stamp acquisition circuit and time stamp acquisition method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5312918B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014054101A1 (en) * | 2012-10-01 | 2014-04-10 | 富士通株式会社 | Information processing device and performance analysis data collection method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124958A (en) * | 1997-06-30 | 1999-01-29 | Nec Corp | Trace data reduction system |
JP2000194580A (en) * | 1998-12-24 | 2000-07-14 | Denso Corp | Cpu development assisting device |
JP2005222446A (en) * | 2004-02-09 | 2005-08-18 | Matsushita Electric Ind Co Ltd | On-board debugging apparatus and semiconductor circuit apparatus |
JP2005322035A (en) * | 2004-05-10 | 2005-11-17 | Toshiba Corp | Development support device and method therefor |
JP2007241431A (en) * | 2006-03-06 | 2007-09-20 | Ricoh Co Ltd | Trace data recording device |
-
2008
- 2008-11-26 JP JP2008301137A patent/JP5312918B2/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124958A (en) * | 1997-06-30 | 1999-01-29 | Nec Corp | Trace data reduction system |
JP2000194580A (en) * | 1998-12-24 | 2000-07-14 | Denso Corp | Cpu development assisting device |
JP2005222446A (en) * | 2004-02-09 | 2005-08-18 | Matsushita Electric Ind Co Ltd | On-board debugging apparatus and semiconductor circuit apparatus |
JP2005322035A (en) * | 2004-05-10 | 2005-11-17 | Toshiba Corp | Development support device and method therefor |
JP2007241431A (en) * | 2006-03-06 | 2007-09-20 | Ricoh Co Ltd | Trace data recording device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014054101A1 (en) * | 2012-10-01 | 2014-04-10 | 富士通株式会社 | Information processing device and performance analysis data collection method |
JPWO2014054101A1 (en) * | 2012-10-01 | 2016-08-25 | 富士通株式会社 | Information processing apparatus and performance analysis data collection method |
US9740541B2 (en) | 2012-10-01 | 2017-08-22 | Fujitsu Limited | Information processing apparatus and method of collecting performance analysis data |
Also Published As
Publication number | Publication date |
---|---|
JP5312918B2 (en) | 2013-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4138021B2 (en) | Processor-based device, method for providing software performance profiling information, and software development system for generating and analyzing software performance profiling information | |
US9342468B2 (en) | Memory time stamp register external to first and second processors | |
JP4512380B2 (en) | Method and apparatus for processing data and computer program product | |
US8527812B2 (en) | Information processing device | |
JP3684831B2 (en) | Microcomputer, electronic equipment and debugging system | |
US8935574B2 (en) | Correlating traces in a computing system | |
JP2008513875A (en) | Method and apparatus for non-intrusive tracking | |
US7596719B2 (en) | Microcontroller information extraction system and method | |
JP2008234652A (en) | Technique for generating trace stream for data processing apparatus | |
US9069896B2 (en) | Data processor device for handling a watchpoint and method thereof | |
US6484273B1 (en) | Integrated EJTAG external bus interface | |
CN111367742A (en) | Method, device, terminal and computer readable storage medium for debugging MVP processor | |
JP2003263337A (en) | Debug function-incorporated microcomputer | |
EP1125200B1 (en) | Maintaining object size information concurrent with data optimization for debugging | |
JP5312918B2 (en) | Time stamp acquisition circuit and time stamp acquisition method | |
JP2008225694A (en) | Semiconductor integrated circuit and error analysis method | |
JP2016091277A (en) | Trace system and IC chip | |
JP2006323726A (en) | Monitor program and real-time trace system | |
JPH0713806A (en) | Bus tracing device for microprocessor | |
JP2005165825A (en) | Trace information recorder | |
TW201321972A (en) | Debugging method and computer system using the same | |
US11144687B1 (en) | Method and system providing visualization of sub-circuit iterations based on handshake signals | |
CN108681500B (en) | System with transaction recording capability and transaction recording method | |
US20230376403A1 (en) | Debug device, debug system, and debug method for testing storage device | |
JP3000779B2 (en) | Information collection method of processor execution status |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20111019 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130627 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130701 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130703 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |