JP2010128681A - Timestamp acquisition circuit and timestamp acquisition method - Google Patents

Timestamp acquisition circuit and timestamp acquisition method Download PDF

Info

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
Application number
JP2008301137A
Other languages
Japanese (ja)
Other versions
JP5312918B2 (en
Inventor
Takayuki Nomiyama
隆行 野見山
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2008301137A priority Critical patent/JP5312918B2/en
Publication of JP2010128681A publication Critical patent/JP2010128681A/en
Application granted granted Critical
Publication of JP5312918B2 publication Critical patent/JP5312918B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that the capacity of a trace memory cannot be increased, and that the circuit scale of a chip to be traced is increased. <P>SOLUTION: The timestamp acquisition circuit includes: a time stamp counter; an OVF flag; an OVF counter; and a trace memory write control circuit. The time stamp counter counts a fixed time interval according to a predetermined clock. The OVF flag records overflow of the time stamp counter. The OVF counter counts the number of times that the time stamp counter overflows. When one trace data are collected, and the OVF flag is turned on, a trace memory write control circuit writes the one trace data, the count value of the time stamp counter and the count value of the OVF counter in a trace memory. <P>COPYRIGHT: (C)2010,JPO&INPIT

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.

特開2007−241431号公報JP 2007-241431 A

トレース情報量が膨大になると、大容量のトレースメモリが必要となる。しかし、エバリュエーションチップに内蔵される程度のメモリ容量では、実際のプログラムデバッグの使用に耐え得ない。よって、現実的には、トレースメモリはエバリュエーションチップの外部に大規模のものを備えることが必須となる。トレースメモリをチップの外部に設ければ、エミュレーション対象のマイコンごとに、エミュレータやデバッグシステムの製品仕様ごとに、トレースメモリの容量を変えることも可能となる。上記公知文献記載の「トレースデータ記録装置」では、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 counter control circuit 30 and an overflow counter control circuit 70, collects trace data from a multi-core processor, adds a time stamp to the trace data, and generates a trace memory. 80 is written. The time stamp counter control circuit 30 can be mounted on the same chip as the processor, and measures a time interval by a time stamp counter 36 that performs a counting operation according to a predetermined clock. The overflow counter control circuit 70 can be mounted outside the processor chip, and supplements the time measurement by the time stamp counter 36 by an overflow counter 71 that counts the number of times the time stamp counter 36 outputs a carry signal. Similarly to the overflow counter control circuit 70, the trace memory 80 can be mounted outside the processor chip.

図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 first processor 13 including a first CPU core 11 and a second processor 14 including a second CPU core 12. The first processor 13 and the second processor 14 output a trace target instruction execution detection signal and trace data when the first CPU core 11 and the second CPU core 12 incorporated therein execute the trace target instruction. . The time stamp counter control circuit 30 inputs these trace target instruction execution detection signals and trace data.

図示するように、タイムスタンプカウンタ制御回路30は、トレースメッセージ生成回路35と、タイムスタンプカウンタ36と、トレースメッセージバッファ37とを有している。図中、タイムスタンプカウンタ36は、トレースメッセージ生成回路35からリセット信号(RES)を受信すると初期化され、ゼロから計数を開始する。タイムスタンプカウンタ36は、所定のクロックに同期して、一定の時間間隔でカウント動作を行い、そのタイムスタンプカウント値は、トレースメッセージ生成回路35に送出される。タイムスタンプカウンタ36は、フルカウントを計数し、オーバーフローすると、キャリー信号を出力する。トレースメッセージ生成回路35は、このキャリー信号を入力する。それから、オーバーフローカウンタ制御回路70も、このキャリー信号を入力する。   As illustrated, the time stamp counter control circuit 30 includes a trace message generation circuit 35, a time stamp counter 36, and a trace message buffer 37. In the figure, the time stamp counter 36 is initialized when it receives a reset signal (RES) from the trace message generation circuit 35, and starts counting from zero. The time stamp counter 36 performs a count operation at a constant time interval in synchronization with a predetermined clock, and the time stamp count value is sent to the trace message generation circuit 35. The time stamp counter 36 counts the full count and outputs a carry signal when it overflows. The trace message generation circuit 35 inputs this carry signal. Then, the overflow counter control circuit 70 also inputs this carry signal.

トレースメッセージ生成回路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 message generation circuit 35 controls an OVF (Overflow) flag 34. 2A and 2B are explanatory diagrams of a method for controlling the OVF flag 34 by the trace message generation circuit 35. FIG. As shown in FIG. 2A, the trace message generation circuit 35 monitors the carry signal output from the time stamp counter 36 (step S10). When the carry signal is received, the OVF flag 34 is set (S12). The OVF flag 34 is turned on. When the second and subsequent carry signals are received, the ON state is maintained as it is. That is, once the carry signal becomes active, the OVF flag 34 is turned on. On the other hand, as shown in FIG. 2B, the trace message generation circuit 35 determines whether or not the generation process of the trace message to be written in the trace message buffer 37 has ended (S14), and if it has ended, the OVF flag 34 is cleared. (S16). The OVF flag 34 is turned off.

トレースメッセージ生成回路35は、トレースメッセージの生成を行う。トレースメッセージ生成回路35は、トレース対象の事象(例えば、実行PC値、直接分岐、間接分岐、RAMアクセス)ごとに、トレースしたデータを決まったフォーマットに整形する。整形されたデータをトレースメッセージと呼ぶ。   The trace message generation circuit 35 generates a trace message. The trace message generation circuit 35 shapes the traced data into a predetermined format for each event to be traced (for example, execution PC value, direct branch, indirect branch, RAM access). The formatted data is called a trace message.

図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 message generation circuit 35 that writes the trace data sent from the first processor 13 and the second processor 14 to the trace message buffer. In FIG. 2C, the trace message generation circuit 35 monitors the trace target instruction execution detection signal sent from the first processor 13 and the second processor 14 (S20). When the trace target instruction execution detection signal is received, the trace message generation circuit 35 generates a trace message, and requests the count value of the overflow counter 71 as necessary (S22). The trace message includes the trace data received from the first processor 13 or the second processor 14, the time stamp count value received from the time stamp counter 36, and the value of the OVF flag 34. Then, in this embodiment, since a multi-core processor is targeted, a processor identifier indicating the trace data from which processor is further included. The trace message generation circuit 35 writes the generated trace message in the trace message buffer 37 (S24).

図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 message generation circuit 35 to the overflow counter control circuit 70. The trace message generation circuit 35 performs count value request processing of the overflow counter 71 when generating a trace message. The trace message generation circuit 35 refers to the OVF flag 34 and determines whether the OVF flag 34 is on or off (S26). When the OVF flag 34 is on, the trace message generation circuit 35 outputs a count value request signal of the overflow counter 71 (S28). On the other hand, when the OVF flag 34 is off, the trace message generation circuit 35 does not output the count value request signal of the overflow counter 71.

従って、トレースメッセージ生成回路35は、OVFフラグ34がオンのとき、生成したトレースメッセージを、トレースメッセージバッファ37に書き込むと共に(S24)、オーバーフローカウンタ71のカウント値要求信号を出力する(S28)。その結果、トレースメッセージと、オーバーフローカウンタ71のカウント値とが対応付けられて、トレースメッセージバッファ37と、OVFカウント値バッファ73とに、それぞれ書き込まれる。一方、OVFフラグ34がオフのときには、結果として、トレースメッセージバッファ37への書き込みのみが行われる(S24)。   Accordingly, when the OVF flag 34 is on, the trace message generation circuit 35 writes the generated trace message in the trace message buffer 37 (S24) and outputs a count value request signal of the overflow counter 71 (S28). As a result, the trace message and the count value of the overflow counter 71 are associated with each other and written to the trace message buffer 37 and the OVF count value buffer 73, respectively. On the other hand, when the OVF flag 34 is OFF, as a result, only writing to the trace message buffer 37 is performed (S24).

トレースメッセージバッファ37は、FIFO(First In First Out:先入れ先出し)バッファで成る。トレースメッセージバッファ37は、トレースメッセージ生成回路35によって生成されたトレースメッセージを、生成された順番にエントリすると共に、先頭のトレースメッセージを出力クロック同期で、バス幅毎に分割して出力する。それぞれの分割データは、一つのトレースメッセージの最初の分割データか、最後の分割データか、途中の分割データか等を示すステータス信号を伴って出力される。   The trace message buffer 37 is a FIFO (First In First Out) buffer. The trace message buffer 37 enters the trace messages generated by the trace message generation circuit 35 in the order in which they are generated, and outputs the head trace message divided by bus width in synchronization with the output clock. Each piece of divided data is output with a status signal indicating whether it is the first piece of divided data, the last piece of divided data, or halfway divided data.

図1において、オーバーフローカウンタ制御回路70は、OVFカウンタ71と、OVFカウント値生成回路72と、OVFカウント値バッファ73と、トレースメモリ書き込み制御回路74とを有している。OVFカウンタ71は、トレースメッセージ生成回路35からリセット信号(RES)を受信すると初期化され、ゼロから計数を開始する。OVFカウンタ71は、タイムスタンプカウンタ36から出力されるキャリー信号の数を計数しており、キャリー信号がアクティブになるごとにカウントアップする。   In FIG. 1, the overflow counter control circuit 70 includes an OVF counter 71, an OVF count value generation circuit 72, an OVF count value buffer 73, and a trace memory write control circuit 74. The OVF counter 71 is initialized when it receives a reset signal (RES) from the trace message generation circuit 35, and starts counting from zero. The OVF counter 71 counts the number of carry signals output from the time stamp counter 36, and counts up each time the carry signal becomes active.

OVFカウント値生成回路72は、トレースメッセージ生成回路35からのOVFカウント値要求信号がアクティブになると、OVFカウンタ71のカウント値を読み出し、そのカウント値をOVFカウント値バッファ73にエントリする。トレースメッセージ生成回路35からのOVFカウント値要求信号がアクティブでは無いときには、OVFカウント値バッファ73への書き込みは行わない。   When the OVF count value request signal from the trace message generation circuit 35 becomes active, the OVF count value generation circuit 72 reads the count value of the OVF counter 71 and enters the count value in the OVF count value buffer 73. When the OVF count value request signal from the trace message generation circuit 35 is not active, writing to the OVF count value buffer 73 is not performed.

OVFカウント値バッファ73は、FIFO(First In First Out:先入れ先出し)バッファで成る。OVFカウント値生成回路72によって生成されたカウント値は、生成された順番に、OVFカウント値バッファ73にエントリされる。   The OVF count value buffer 73 is a FIFO (First In First Out) buffer. The count values generated by the OVF count value generation circuit 72 are entered in the OVF count value buffer 73 in the order of generation.

トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から出力されるトレースメッセージを受け取り、また、OVFカウント値バッファ73から出力されるカウント値を受け取る。そして、トレースメモリ80への書き込みを行う。図3及び図4は、トレースメモリ書き込み制御回路74の動作説明図である。図3は、二つのバッファ37,73及びトレースメモリ80におけるデータ構造の具体例を示したものである。図3の例を参照すると、トレースメッセージバッファ37には六つのエントリがあり、OVFカウント値バッファ73には二つのエントリがある。トレースメッセージバッファ37の六つのエントリを参照すると、四つ目のトレースメッセージにおけるトレースデータを収集したときに、タイムスタンプカウンタ36がオーバーフローし、一個目のキャリー信号が出力されていることが分かる。また、六つ目のトレースメッセージにおけるトレースデータを収集したときに、タイムスタンプカウンタ36がオーバーフローし、二個目のキャリー信号が出力されていることが分かる。   The trace memory write control circuit 74 receives a trace message output from the trace message buffer 37 and receives a count value output from the OVF count value buffer 73. Then, writing to the trace memory 80 is performed. 3 and 4 are explanatory diagrams of the operation of the trace memory write control circuit 74. FIG. FIG. 3 shows a specific example of the data structure in the two buffers 37 and 73 and the trace memory 80. Referring to the example of FIG. 3, the trace message buffer 37 has six entries, and the OVF count value buffer 73 has two entries. Referring to the six entries in the trace message buffer 37, it can be seen that when the trace data in the fourth trace message is collected, the time stamp counter 36 overflows and the first carry signal is output. It can also be seen that when the trace data in the sixth trace message is collected, the time stamp counter 36 overflows and the second carry signal is output.

図3の具体例と、図4のフローチャートとに基づいて、トレースメモリ書き込み制御回路74の書き込み動作を詳細に説明する。まず、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、一つ目のトレースメッセージを読み込む。そして、そのトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。図3に示すように、一つ目のトレースメッセージにおけるオーバーフローフラグはオフなので、トレースメモリ書き込み制御回路74は、トレースメモリ80に、一つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。同様に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、二つ目のトレースメッセージと、三つ目のトレースメッセージとを書き込む(S43)。   The write operation of the trace memory write control circuit 74 will be described in detail based on the specific example of FIG. 3 and the flowchart of FIG. First, the trace memory write control circuit 74 reads the first trace message from the trace message buffer 37. Then, by referring to the overflow flag in the trace message, it is determined whether it is on or off (S40). As shown in FIG. 3, since the overflow flag in the first trace message is off, the trace memory write control circuit 74 writes the first trace message in the trace memory 80 (S43). The write address to the trace memory 80 is incremented (S44). Similarly, the trace memory write control circuit 74 writes the second trace message and the third trace message in the trace memory 80 (S43).

続いて、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、四つ目のトレースメッセージを読み込む。そして、その四つ目のトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。四つ目のトレースメッセージにおけるオーバーフローフラグはオンなので、トレースメモリ書き込み制御回路74は、OVFカウント値バッファから、一個目のOVFカウント値を読み込む。そして、トレースメモリ80に、一個目のOVFカウント値を書き込む(S41)。トレースメモリ80への書き込みアドレスをインクリメントする(S42)。更に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、四つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。   Subsequently, the trace memory write control circuit 74 reads the fourth trace message from the trace message buffer 37. Then, by referring to the overflow flag in the fourth trace message, it is determined whether it is on or off (S40). Since the overflow flag in the fourth trace message is on, the trace memory write control circuit 74 reads the first OVF count value from the OVF count value buffer. Then, the first OVF count value is written in the trace memory 80 (S41). The write address to the trace memory 80 is incremented (S42). Further, the trace memory write control circuit 74 writes the fourth trace message in the trace memory 80 (S43). The write address to the trace memory 80 is incremented (S44).

次に、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、五つ目のトレースメッセージを読み込む。そして、そのトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。五つ目のトレースメッセージにおけるオーバーフローフラグはオフなので、トレースメモリ書き込み制御回路74は、トレースメモリ80に、五つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。   Next, the trace memory write control circuit 74 reads the fifth trace message from the trace message buffer 37. Then, by referring to the overflow flag in the trace message, it is determined whether it is on or off (S40). Since the overflow flag in the fifth trace message is off, the trace memory write control circuit 74 writes the fifth trace message in the trace memory 80 (S43). The write address to the trace memory 80 is incremented (S44).

それから、トレースメモリ書き込み制御回路74は、トレースメッセージバッファ37から、最後の六つ目のトレースメッセージを読み込む。そして、その六つ目のトレースメッセージにおけるオーバーフローフラグを参照し、オンかオフかを判定する(S40)。六つ目のトレースメッセージにおけるオーバーフローフラグはオンなので、トレースメモリ書き込み制御回路74は、OVFカウント値バッファから、最後の二個目のOVFカウント値を読み込む。そして、トレースメモリ80に、二個目のOVFカウント値を書き込む(S41)。トレースメモリ80への書き込みアドレスをインクリメントする(S42)。更に、トレースメモリ書き込み制御回路74は、トレースメモリ80に、六つ目のトレースメッセージを書き込む(S43)。トレースメモリ80への書き込みアドレスをインクリメントする(S44)。   Then, the trace memory write control circuit 74 reads the last sixth trace message from the trace message buffer 37. Then, by referring to the overflow flag in the sixth trace message, it is determined whether it is on or off (S40). Since the overflow flag in the sixth trace message is on, the trace memory write control circuit 74 reads the last second OVF count value from the OVF count value buffer. Then, the second OVF count value is written in the trace memory 80 (S41). The write address to the trace memory 80 is incremented (S42). Further, the trace memory write control circuit 74 writes the sixth trace message in the trace memory 80 (S43). The write address to the trace memory 80 is incremented (S44).

以上の書き込み動作によって、トレースメモリ80の内容は、図3に示した如くになる。図示するように、トレースメッセージバッファ37から読み出したトレースメッセージにおけるオーバーフローフラグがオンのときには、トレースメモリ80には、OVFカウント値と、トレースメッセージとがセットで記憶されている。一方、トレースメッセージバッファ37から読み出したトレースメッセージにおけるオーバーフローフラグがオフのときには、トレースメモリ80には、トレースメッセージのみが記憶されている。   With the above writing operation, the contents of the trace memory 80 become as shown in FIG. As shown in the figure, when the overflow flag in the trace message read from the trace message buffer 37 is on, the trace memory 80 stores the OVF count value and the trace message as a set. On the other hand, when the overflow flag in the trace message read from the trace message buffer 37 is OFF, only the trace message is stored in the trace memory 80.

本実施の形態におけるタイムスタンプ取得回路の全体の動作例について簡単に説明しておく。
ステップ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 1. The time stamp counter 36 and the OVF counter 71 are initialized.
Step 2. The first processor 13 or the second processor 14 executes a user program. At the same time, the time stamp counter 36 and the OVF counter 71 start counting up.
Step 3. When the first processor 13 detects the execution of the trace target instruction in the first CPU core 11, the trace target instruction execution detection signal and the trace data are output to the trace message generation circuit 35.
Step 4. Similarly, when the second processor 14 detects the execution of the trace target instruction by the second CPU core 12, the trace target instruction execution detection signal and the trace data are output to the trace message generation circuit 35.
Step 5. The trace message generation circuit 35 sets the OVF flag 34 once the carry signal of the time stamp counter 36 becomes active before receiving the trace target instruction execution detection signal from the first processor 13 or the second processor 14. The state of the set OVF flag 34 is retained until a trace message is generated after receiving the trace target instruction execution detection signal.
Step 6. When the trace message generation circuit 35 receives the trace target instruction execution detection signal from the first processor 13 and the second processor 14, the trace message generation circuit 35 reads the count value from the time stamp counter 36. At this time, if the OVF flag 34 is set, an OVF count value request signal is output to the OVF count value generation circuit 72.
Step 7. The trace message generation circuit 35 includes trace data from the first processor 13 and the second processor 14 (the processor in the present embodiment is multi-core, and therefore includes information indicating which processor the data is from), and the time stamp count value. , A trace message is generated from the value of the OVF flag 34 and entered in the trace message buffer 37.
Step 8. When receiving the OVF count value request signal, the OVF count value generation circuit 72 enters the count value of the OVF counter 71 in the OVF count value buffer 73.
Step 9. The trace message generation circuit 35 activates the reset signal (RES) and clears the time stamp counter 36 and the OVF counter 71 to zero.
Step 10. The trace message buffer 37 outputs the trace messages to the trace memory write control circuit 74 sequentially from the top.
Step 11. Each time the first processor 13 and the second processor 14 detect execution of the instruction to be traced, the above step 3. ~ Step 9. Execute.
Step 12. The trace memory write control circuit 74 receives the trace message output from the trace message buffer 37. If the overflow flag in the trace message is off, the trace message is written to the trace memory 80 and the write address to the trace memory 80 is incremented.
Step 13. If the overflow flag in the trace message is ON, the trace memory write control circuit 74 first sets the first OVF count value of the OVF count value buffer 73 to the trace memory 80 before writing the trace message to the trace memory 80. After writing and incrementing the address, a trace message is written, and the address of the trace memory 80 is further incremented.

本実施の形態における効果として、次のような効果を挙げることができる。
〔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 trace memory 80 on the same chip as the processor. Therefore, since the capacity of the trace memory 80 can be sufficiently increased, it is possible to obtain a large amount of trace data necessary for program development / debugging of the multi-core chip.
[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 time stamp counter 36 has occurred.

図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 debug chip 41 and the emulator main body 50. In the figure, a socket 21 is mounted on a user target system 20 on which a microcomputer for program development is mounted. The debug chip 41 is responsible for all the functions of the microcomputer to be developed by the program, and has a time stamp control circuit 30 having the above-described functions mounted therein. The debug chip 41 is electrically connected to the user target system 20 via the socket 21. Further, the debug chip 41 is electrically connected to an emulation control circuit 51 that is a component of the emulator main body 50 via the emulation probe 22. The emulation control circuit 51 has an overflow counter control circuit 70 having the above-described functions. The emulation probe 22 plays a role of a cable for transmitting a signal.

エミュレータ本体50は、エミュレーション制御回路51と、トレースメモリ80と、ホストI/F 52とを有している。これらは、別々のチップに実装されている。エミュレータ本体50は、ホストPC 60と、USBケーブルなどによって接続される。ホストPC 60では、デバッガプログラムが実行される。ユーザの操作を受け付けるデバッガプログラムは、ホストI/F 52を介してエミュレータ本体50と通信を行うことができる。   The emulator main body 50 includes an emulation control circuit 51, a trace memory 80, and a host I / F 52. These are mounted on separate chips. The emulator main body 50 is connected to the host PC 60 by a USB cable or the like. In the host PC 60, a debugger program is executed. A debugger program that accepts user operations can communicate with the emulator main body 50 via the host I / F 52.

トレースデータの収集は、デバッガプログラムが実行されるホスト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 host PC 60 in which the debugger program is executed. Further, the trace message stored in the trace memory 80 can be read from the emulator main body 50 to the host PC 60 in response to a request from the host PC 60. In addition, the host PC 60 can set the setting register of the emulation control circuit 51 via the host I / F 52, and can set the setting register of the debug chip 41 via the emulation control circuit 51. It can be carried out. A rectangular circuit block 40 surrounded by a dotted line generally corresponds to the configuration diagram of FIG. This is shown for easy understanding of the correspondence.

図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 main body 55 provided with an evaluation chip. In FIG. 6, the emulator main body 55 includes a peripheral evaluation chip 56, a CPU evaluation chip 43, an emulation control circuit 51, a trace memory 80, and a host I / F 52. These are mounted on separate chips. The CPU evaluation chip 43 is responsible for all functions of the microcomputer to be developed by the program, and has a time stamp control circuit 30 having the above-described functions mounted therein. The CPU evaluation chip 43 is electrically connected to the user target system 20 via the peripheral evaluation chip 56, the emulation probe 22, and the socket 21. Further, the emulator main body 55 is also electrically connected to the emulation control circuit 51. The emulation control circuit 51 has an overflow counter control circuit 70 having the above-described functions.

エミュレータ本体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 main body 55 is connected to the host PC 60 by a USB cable or the like. In the host PC 60, a debugger program is executed. A debugger program that accepts user operations can communicate with the emulator main body 55 via the host I / F 52. Collection of trace data can be started by an instruction from the host PC 60 in which the debugger program is executed. Further, the trace message stored in the trace memory 80 can be read from the emulator main body 55 to the host PC 60 in response to a request from the host PC 60. In addition, the host PC 60 can set the setting register of the emulation control circuit 51 via the host I / F 52, and the setting register of the CPU evaluation chip 43 can be set via the emulation control circuit 51. Settings can be made. Note that a rectangular circuit block 42 surrounded by a dotted line generally corresponds to the configuration diagram of FIG. This correspondence is illustrated for easy understanding.

本発明を実施するための最良の形態の一つを説明するブロック構成図The block block diagram explaining one of the best forms for implementing this invention OVFフラグ34のセット方法を説明するフローチャートA flowchart for explaining a method of setting the OVF flag 34 OVFフラグ34のクリア方法を説明するフローチャートA flowchart for explaining a method of clearing the OVF flag 34 トレースメッセージ生成回路35による書き込み動作を説明するフローチャートFlowchart for explaining a write operation by the trace message generation circuit 35 オーバーフローカウント値の要求方法を説明するフローチャートFlowchart explaining method for requesting overflow count value トレースメモリ書き込み制御回路74の動作を説明するためのデータ構造図Data structure diagram for explaining the operation of the trace memory write control circuit 74 トレースメモリ書き込み制御回路74の動作を説明するフローチャートFlowchart for explaining the operation of the trace memory write control circuit 74 実施例1の構成を説明するブロック図Block diagram for explaining the configuration of the first embodiment 実施例2の構成を説明するブロック図Block diagram for explaining the configuration of the second embodiment

符号の説明Explanation of symbols

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 CPU cores 13 and 14 Processor 20 User target system 21 Socket 22 Emulation probe 30 Time stamp counter control circuit 34 OVF flag 35 Trace message generation circuit 36 Time stamp counter 37 Trace message buffer 40, 42 Circuit block 41 Debug chip 43 CPU Evaluation chip 50, 55 Emulator main body 51 Emulation control circuit 52 Host I / F
56 Peripheral evaluation chip 60 Host PC
70 Overflow counter control circuit 71 OVF counter 72 OVF count value generation circuit 73 OVF count value buffer 74 Trace memory write control circuit 80 Trace memory

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.
前記第一のバッファと、前記第二のバッファとは、FIFOメモリで成り、
前記一のトレースメッセージを記憶することは、
前記第一のバッファに、順番にトレースメッセージを記憶することを含み、
前記オーバーフローカウンタのカウント値を記憶することは、
前記第二のバッファに、順番に前記カウント値を記憶することを含む
請求項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.
JP2008301137A 2008-11-26 2008-11-26 Time stamp acquisition circuit and time stamp acquisition method Expired - Fee Related JP5312918B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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