JP2007241431A - Trace data recording device - Google Patents

Trace data recording device Download PDF

Info

Publication number
JP2007241431A
JP2007241431A JP2006059719A JP2006059719A JP2007241431A JP 2007241431 A JP2007241431 A JP 2007241431A JP 2006059719 A JP2006059719 A JP 2006059719A JP 2006059719 A JP2006059719 A JP 2006059719A JP 2007241431 A JP2007241431 A JP 2007241431A
Authority
JP
Japan
Prior art keywords
trace
real
time counter
trace memory
information
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
JP2006059719A
Other languages
Japanese (ja)
Other versions
JP4806577B2 (en
Inventor
Masahiko Nakagawa
昌彦 中川
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2006059719A priority Critical patent/JP4806577B2/en
Publication of JP2007241431A publication Critical patent/JP2007241431A/en
Application granted granted Critical
Publication of JP4806577B2 publication Critical patent/JP4806577B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a trace data recording device for suppressing the bit width of a trace memory, managing a time stamp with the minimum information quantity, and efficiently utilizing the trace memory. <P>SOLUTION: This trace information writing means keeps updating the value of a real time counter in a trace memory in the count-up state by an n bit counter, and when a cycle for writing bus information in the trace memory is decided by a cycle deciding means, the write address of the trace memory is incremented, and the bus information and the value of the n bit counter are written, the n bit counter is reset, and the counting of the n bit counter is started. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、プログラムの開発およびデバッグに使用するインサーキットエミュレータおよびデバッグシステムに関し、特に、トレースデータ記録装置に関する。   The present invention relates to an in-circuit emulator and a debugging system used for program development and debugging, and more particularly to a trace data recording apparatus.

各種システム装置のための組み込み型プログラムの開発においては、プロセッサの動作状況をトレースメモリに取り込み、トレースメモリの内容を解析してデバッグを行う、という手法が一般的に取られている。   In the development of embedded programs for various system devices, a technique is generally taken in which the operation status of a processor is taken into a trace memory, and the contents of the trace memory are analyzed and debugged.

近年、プロセッサの動作速度の高速化が著しい。そのため、プロセッサ内部のトレースバスを外部に引き出してデバックの解析を行うことが、事実上不可能になっている。そこで、プロセッサの動作につき、リアルタイムトレースを行なおうとする場合には、プロセッサ内部にトレースメモリを搭載する必要がある。   In recent years, the operating speed of processors has been significantly increased. For this reason, it is virtually impossible to analyze the debug by drawing the trace bus inside the processor to the outside. Therefore, in order to perform a real-time trace for the operation of the processor, it is necessary to mount a trace memory inside the processor.

しかし、トレースメモリのサイズはコストに大きく影響するため、メモリサイズにも事実上制約がある。そのため、トレースメモリを有効に利用することが課題となっている。   However, since the size of the trace memory greatly affects the cost, the memory size is also practically limited. Therefore, it is a problem to use the trace memory effectively.

トレースメモリの利用時にトレースメモリへの書込みデータ量を少なくする方法として一般的に用いられているものは、次のような方法である。
(1)まず、プログラムが連続したアドレスで実行されている間はトレースメモリへのデータの取り込みを行わない。
(2)分岐命令のサイクルのときのみ、トレースメモリにデータを取り込む。
The following method is generally used as a method for reducing the amount of data written to the trace memory when the trace memory is used.
(1) First, data is not taken into the trace memory while the program is executed at consecutive addresses.
(2) Data is taken into the trace memory only in the cycle of the branch instruction.

上記方法によれば、メモリの使用量は抑えられる。この方法では、トレースメモリへの書き込みの時間間隔がランダムになるため、タイムスタンプの記録が必要になる。タイムスタンプを記録することについては、通常メモリのビット幅を広げることで対応する。   According to the above method, the amount of memory used can be suppressed. In this method, since the time interval for writing to the trace memory is random, it is necessary to record a time stamp. Recording time stamps is usually handled by increasing the bit width of the memory.

このように、バス情報とタイムスタンプをトレースメモリに書き込むことになる。ここで、オーバーフローの頻発を回避するためには、タイムスタンプにはバス情報と同程度のビット幅が必要である。しかし、そうすると、トレースメモリとして取り込めるフレーム数が半減してしまう。   Thus, the bus information and time stamp are written in the trace memory. Here, in order to avoid frequent occurrence of overflow, the time stamp needs to have the same bit width as the bus information. However, this will halve the number of frames that can be captured as a trace memory.

なお、特許文献1に開示される発明は、プログラムトレースデータ記録方式およびトレースメモリに関するものであり、特許文献2は、情報処理システムのトレース情報記録装置に関するものである。いずれの発明でも、常にタイムスタンプの差分がトレースデータとともにトレースメモリに記録されている。
特開2004−30505公報 特開平4−257936号公報
The invention disclosed in Patent Document 1 relates to a program trace data recording method and a trace memory, and Patent Document 2 relates to a trace information recording apparatus of an information processing system. In any of the inventions, the time stamp difference is always recorded in the trace memory together with the trace data.
JP 2004-30505 A JP-A-4-257936

本発明は、トレースメモリのビット幅を抑え、最小限の情報量でタイムスタンプを管理し、トレースメモリを有効に活用するトレースデータ記録装置を提供することを目的とする。   An object of the present invention is to provide a trace data recording apparatus that suppresses the bit width of a trace memory, manages a time stamp with a minimum amount of information, and effectively uses the trace memory.

本発明は、上記の目的を達成するためになされたものである。本発明に係る請求項1に記載のトレースデータ記録装置は、
CPUがプログラムフェッチ又はデータ読み書きを行う時のCPUステータス、アドレスバス、及びデータバスを含むバス情報と、プログラム実行開始からCPUクロックに同期してサイクル数をカウントするリアルタイムカウンタのカウント値とを、所定のサイクル時にトレースメモリに書き込むトレースデータ記録装置において、
バス情報をトレースメモリに書き込むサイクルを判定する書き込みサイクル判定手段と、
バス情報をトレースメモリに書き込んだサイクルからの経過サイクルをカウントするnビットカウンタと、
トレースメモリにリアルタイムカウンタの値を書き込むか、バス情報とnビットカウンタの値を書き込むかを制御し、トレースメモリの各アドレスに記録される情報がリアルタイムカウンタからの値か、バス情報かを識別する情報識別フラグをトレースメモリに書き込むトレース情報書き込み手段とを備え、
トレース情報書き込み手段は、nビットカウンタでカウントアップした状態になれば、リアルタイムカウンタの値をトレースメモリに更新し続け、
サイクル判定手段がバス情報をトレースメモリに書き込むサイクルであると判定すれば、トレースメモリの書き込みアドレスをインクリメントして、バス情報とnビットカウンタの値を書き込み、nビットカウンタをリセットしてnビットカウンタのカウントを開始することを特徴とする。
The present invention has been made to achieve the above object. The trace data recording apparatus according to claim 1 according to the present invention,
CPU status when CPU fetches or reads / writes data, bus information including address bus and data bus, and count value of real-time counter that counts the number of cycles in synchronization with CPU clock from the start of program execution In the trace data recording device that writes to the trace memory during the cycle of
A write cycle determination means for determining a cycle for writing bus information to the trace memory;
An n-bit counter that counts elapsed cycles from the cycle in which the bus information is written to the trace memory;
Controls whether the real-time counter value is written to the trace memory or the bus information and the n-bit counter value, and identifies whether the information recorded in each address of the trace memory is the value from the real-time counter or the bus information Trace information writing means for writing an information identification flag to the trace memory,
The trace information writing means continues to update the value of the real-time counter to the trace memory when the n-bit counter counts up.
If the cycle determination means determines that the cycle is to write the bus information to the trace memory, the trace memory write address is incremented, the bus information and the n-bit counter value are written, the n-bit counter is reset, and the n-bit counter is reset. It is characterized by starting the count.

本発明に係る請求項2に記載のトレースデータ記録装置は、
リアルタイムカウンタのクロックと、CPUの動作クロックが非同期であり、若しくは周波数が異なっており、
nビットカウンタがカウントアップした状態になるまでの時間が、リアルタイムカウンタの下位mビットがカウントアップした状態になるまでの時間よりも、短くなるように設定され、
トレース情報書き込み手段が、バス情報を書き込むときに、バス情報とリアルタイムカウンタの下位mビットをトレースメモリに書き込む
ことを特徴とする請求項1に記載のトレースデータ記録装置である。
The trace data recording device according to claim 2 according to the present invention,
The real-time counter clock and CPU operating clock are asynchronous or have different frequencies.
The time until the n-bit counter is counted up is set to be shorter than the time until the lower m bits of the real-time counter are counted up,
2. The trace data recording apparatus according to claim 1, wherein the trace information writing means writes the bus information and the lower m bits of the real-time counter to the trace memory when writing the bus information.

本発明に係る請求項3に記載のトレースデータ記録装置は、
トレースメモリにバス情報が書き込まれた直後のリアルタイムカウンタの値を記憶して、リアルタイムカウンタが周回するのを監視するリアルタイムカウンタ監視手段を更に含み、
リアルタイムカウンタ監視手段は、トレースメモリにバス情報が書き込まれた直後のリアルタイムカウンタの値を記憶したときから、リアルタイムカウンタが一周したことを検出すると、トレース情報書き込み手段にその旨を通知し、
トレース情報書き込み手段は、リアルタイムカウンタが一周した旨の上記の通知を受けると、トレースメモリへの書き込みアドレスをインクリメントしリアルタイムカウンタの値をトレースメモリに書き込むことを特徴とする請求項1又は2に記載のトレースデータ記録装置である。
The trace data recording device according to claim 3 according to the present invention,
Real-time counter monitoring means for storing the value of the real-time counter immediately after the bus information is written in the trace memory and monitoring the rotation of the real-time counter is further included.
When the real-time counter monitoring means detects that the real-time counter has made a full turn since storing the value of the real-time counter immediately after the bus information is written in the trace memory, it notifies the trace information writing means to that effect,
3. The trace information writing means increments the write address to the trace memory and writes the value of the real-time counter to the trace memory when receiving the notification that the real-time counter has made a round. This is a trace data recording device.

本発明を利用することにより、トレースデータ記録装置において、トレースメモリのビット幅を抑え、最小限の情報量でタイムスタンプを管理し、トレースメモリを有効に活用できる。   By using the present invention, in the trace data recording apparatus, the bit width of the trace memory can be suppressed, the time stamp can be managed with the minimum amount of information, and the trace memory can be effectively utilized.

以下、図面を参照して本発明に係る好適な実施形態を説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments according to the invention will be described with reference to the drawings.

[第1の実施形態]
本発明の第1の実施形態に係るトレースデータ記録装置は、概略、トレースメモリへの前回の書き込みから一定時間以内であれば、バス情報とタイムスタンプの差分(nビット)データとをトレースメモリに書き込み、一定時間以上経過したのであれば、次のトレース情報の書き込みまでタイムスタンプを全ビットトレースメモリに書き込む、というものである。
[First Embodiment]
The trace data recording apparatus according to the first embodiment of the present invention generally includes bus information and time stamp difference (n-bit) data in the trace memory within a certain time from the previous write to the trace memory. If a certain time has elapsed after writing, the time stamp is written in all bit trace memories until the next trace information is written.

図1は、本発明の第1の実施形態に係るトレースデータ記録装置である。図2は、本発明の第1の実施形態に係るトレースデータ記録装置を構成するトレースメモリの記録状況を示す模式図である。図3は、本発明の第1の実施形態に係るトレースデータ記録装置を構成するトレース情報書き込み手段12の動作のフローチャートである。   FIG. 1 shows a trace data recording apparatus according to the first embodiment of the present invention. FIG. 2 is a schematic diagram showing a recording state of the trace memory constituting the trace data recording apparatus according to the first embodiment of the present invention. FIG. 3 is a flowchart of the operation of the trace information writing means 12 constituting the trace data recording apparatus according to the first embodiment of the present invention.

図1に示すトレースデータ記録装置を構成するエバリュエーションチップ2のCPU2Aは、システムクロックによって動作し、ステータス(54)、アドレスバス(52)、データバス(50)などのバス情報がトレースデータとなる。   The CPU 2A of the evaluation chip 2 constituting the trace data recording apparatus shown in FIG. 1 operates in accordance with the system clock, and bus information such as status (54), address bus (52), data bus (50), etc. becomes trace data. .

リアルタイムカウンタ4は、CPU2Aのプログラム実行開始と同時にカウントを開始する。書き込みサイクル判定手段8は、バス情報を監視し、分岐命令などのプログラムフェッチやリード/ライト・サイクルなどのトレースメモリ6に書き込むべきトレースデータを検出すると、トレース情報書き込み手段12に対してトレースデータ書き込みを要求する。   The real-time counter 4 starts counting simultaneously with the start of program execution by the CPU 2A. The write cycle determination means 8 monitors the bus information and, when detecting trace data to be written to the trace memory 6 such as a program fetch such as a branch instruction or a read / write cycle, writes the trace data to the trace information writing means 12. Request.

トレース情報書き込み手段12は、プログラムが実行開始すると、nビットカウンタ10を“カウントアップした状態”にし(図3・S02)、リアルタイムカウンタ4の値をトレースメモリ6の先頭アドレスに繰り返し書き込む(図3・S04、S06、S08・NO)。   When the program starts to be executed, the trace information writing means 12 sets the n-bit counter 10 in the “counted up state” (FIG. 3, S02), and repeatedly writes the value of the real-time counter 4 to the start address of the trace memory 6 (FIG. 3 S04, S06, S08, NO).

書き込みサイクル判定手段8からトレースデータ書き込み要求があると(図3・S08・YES)、トレース情報書き込み手段12は、nビットカウンタ10が“カウントアップした状態”とされていることから、トレースメモリ6への書き込みアドレスをインクリメントして(図3・S10)、バス情報とnビットカウンタ10の値とをトレースメモリ6に書き込み(図3・S12)、nビットカウンタ10のカウントを開始する(図3・S14)。   When there is a trace data write request from the write cycle determining means 8 (FIG. 3, S08, YES), the trace information writing means 12 indicates that the n-bit counter 10 is in the “counted up state”, and therefore the trace memory 6 3 is incremented (FIG. 3, S10), the bus information and the value of the n-bit counter 10 are written to the trace memory 6 (FIG. 3, S12), and the n-bit counter 10 starts counting (FIG. 3). -S14).

トレース情報書き込み手段12は、nビットカウンタ10が“カウントアップした状態”になるまでは、リアルタイムカウンタ4の値のトレースメモリ6への書き込みを停止し(図3・S16・NO、S18・NO)、nビットカウンタ10が“カウントアップした状態”となること、若しくは書き込みサイクル判定手段8からの書き込み要求の発生を待つ。   The trace information writing means 12 stops the writing of the value of the real-time counter 4 to the trace memory 6 until the n-bit counter 10 becomes “counted up” (FIG. 3, S16 / NO, S18 / NO). The n-bit counter 10 waits for a “count-up state” or the generation of a write request from the write cycle determination means 8.

以降、nビットカウンタ10が“カウントアップした状態”になる前に(図3・S16・NO)、書き込みサイクル判定手段8からの書き込み要求があれば(図3・S18・YES)、上記動作(S10、S12、S14)を繰り返す。即ち、トレース情報書き込み手段12は、トレースメモリ6への書き込みアドレスをインクリメントして(図3・S10)、バス情報とnビットカウンタ10の値とをトレースメモリ6に書き込み(図3・S12)、nビットカウンタ10をリセットして再びカウント開始する(図3・S14)。   Thereafter, if there is a write request from the write cycle determining means 8 (FIG. 3, S18, YES) before the n-bit counter 10 becomes “counted up” (FIG. 3, S16, NO), the above operation ( S10, S12, S14) are repeated. That is, the trace information writing means 12 increments the write address to the trace memory 6 (FIG. 3, S10), writes the bus information and the value of the n-bit counter 10 to the trace memory 6 (FIG. 3, S12), The n-bit counter 10 is reset and starts counting again (S14 in FIG. 3).

書き込みサイクル判定手段8からの書き込み要求が来る前にnビットカウンタ10が“カウントアップした状態”になると(図3・S16・YES)、トレース情報書き込み手段12は、トレースメモリ6への書き込みアドレスをインクリメントし(図3・S20)、リアルタイムカウンタ4の値を書き込み続ける(図3・S06、S08・NO)。   When the n-bit counter 10 is in the “counted up state” before the write request from the write cycle determination means 8 is received (S16 / YES in FIG. 3), the trace information writing means 12 sets the write address to the trace memory 6. It increments (FIG. 3, S20) and continues to write the value of the real-time counter 4 (FIG. 3, S06, S08, NO).

図2では、本発明の第1の実施形態に係るトレースデータ記録装置を構成するトレースメモリ6の記録状況、即ち、トレースメモリ6上のデータ構造が示される。情報識別フラグは、データ内容がリアルタイムカウンタ4(の値)のときは“0”であり、データ内容がバス情報及びnビットカウンタ10(の値)のときは“1”である。情報識別フラグの設定は、トレース情報書き込み手段12が行う。   FIG. 2 shows a recording state of the trace memory 6 constituting the trace data recording apparatus according to the first embodiment of the present invention, that is, a data structure on the trace memory 6. The information identification flag is “0” when the data content is the real-time counter 4 (value), and is “1” when the data content is the bus information and the n-bit counter 10 (value). The trace information writing unit 12 sets the information identification flag.

第1の実施形態では、リアルタイムカウンタ4、及びnビットカウンタ10は、CPU1Aと同じシステムクロックで動作している。このため、図1ではそれらに関する記述を省略している。   In the first embodiment, the real-time counter 4 and the n-bit counter 10 operate with the same system clock as the CPU 1A. For this reason, the description regarding them is omitted in FIG.

また、第1の実施形態に係るトレースデータ記録装置では、デバッグ制御手段16がトレースデータ読み出し手段14を制御することにより、トレースメモリ6に記録されたトレースデータが読み出され、通信手段20を経由してホストコンピュータ22上のトレースデータ復元手段26に展開されている。ここで、トレースデータは、トレースメモリ6からシリアルもしくはパラレルの専用出力手段を用いて外部に出力されてもよい。   In the trace data recording apparatus according to the first embodiment, the debug control unit 16 controls the trace data reading unit 14 so that the trace data recorded in the trace memory 6 is read out via the communication unit 20. The data is expanded in the trace data restoring means 26 on the host computer 22. Here, the trace data may be output from the trace memory 6 using serial or parallel dedicated output means.

[第2の実施形態]
本発明の第2の実施形態に係るトレースデータ記録装置は、概略、CPUのクロックとタイムスタンプのクロックとが異なる場合でも、矛盾無く経過時間を算出でき、且つ、トレースメモリ6に記録するタイムスタンプのためのビット幅を増やすことなく、トレースデータを記録できるようにするものである。
[Second Embodiment]
In general, the trace data recording apparatus according to the second embodiment of the present invention can calculate the elapsed time without contradiction even when the clock of the CPU and the clock of the time stamp are different, and the time stamp recorded in the trace memory 6 Therefore, the trace data can be recorded without increasing the bit width.

つまり、上述の第1の実施形態に係るトレースデータ記録装置と異なり、リアルタイムカウンタ4によるタイムスタンプのクロック(第2のクロック発生手段42)が、CPUのシステムクロック(第1のクロック発生手段40)と異なる場合には、経過時間の算出結果に誤差を含み得ることになる。nビットカウンタ10のクロックとしてリアルタイムカウンタ4のクロックを使用することも可能であるが、CPUクロックよりもリアルタイムカウンタ4のクロックが速い場合には、nビットカウンタ10のカウントアップ時間が短くなり、結果としてトレースメモリ6に取り込まれるデータのビット幅が、増やされなければならないことになる。   That is, unlike the trace data recording apparatus according to the first embodiment described above, the time stamp clock (second clock generating means 42) by the real time counter 4 is the CPU system clock (first clock generating means 40). If it is different from the above, an error may be included in the calculation result of the elapsed time. Although it is possible to use the clock of the real-time counter 4 as the clock of the n-bit counter 10, when the clock of the real-time counter 4 is faster than the CPU clock, the count-up time of the n-bit counter 10 is shortened. As a result, the bit width of the data taken into the trace memory 6 must be increased.

そこで、本発明の第2の実施形態に係るトレースデータ記録装置では、リアルタイムカウンタ4の下位ビット(下位mビット)を、バス情報と共に書き込む差分データとして利用する。図4は、本発明の第2の実施形態に係るトレースデータ記録装置の一部である。図5は、本発明の第2の実施形態に係るトレースデータ記録装置を構成するトレースメモリ6の記録状況を示す模式図である。第2の実施形態に係るトレースデータ記録装置は、第1の実施形態に係るトレースデータ記録装置と略同様のものである。従って、図4では両者の差異を中心に示している。   Therefore, in the trace data recording apparatus according to the second embodiment of the present invention, the lower bits (lower m bits) of the real-time counter 4 are used as differential data to be written together with the bus information. FIG. 4 is a part of a trace data recording apparatus according to the second embodiment of the present invention. FIG. 5 is a schematic diagram showing a recording state of the trace memory 6 constituting the trace data recording apparatus according to the second embodiment of the present invention. The trace data recording apparatus according to the second embodiment is substantially the same as the trace data recording apparatus according to the first embodiment. Therefore, FIG. 4 mainly shows the difference between the two.

図4に示すnビットカウンタ10では、nビットカウンタ10が“カウントアップした状態”になるまでの時間が、リアルタイムカウンタ4の下位mビットが“カウントアップした状態”になるまでの時間よりも、やや短くなるように、設定する。図5に示すように、トレース情報書き込み手段12は、書き込みサイクル判定手段8から書き込み要求があると(図3・S08、S18参照)、バス情報とリアルタイムカウンタ4の下位mビットとをトレースメモリ6に書き込み(同・S12参照)、nビットカウンタ10のカウントを開始する(同・S14参照)。以降のトレース情報書き込み手段12の動作は、第1の実施形態と同様である。トレースメモリ6のデータ構造の全体は図5のようになり、バス情報の場合にはリアルタイムカウンタ4の下位mビットの値が書き込まれている。このことにより、経過時間の計算が可能となる。   In the n-bit counter 10 shown in FIG. 4, the time until the n-bit counter 10 becomes “counted up” is shorter than the time until the lower m bits of the real-time counter 4 become “counted up”. Set to be slightly shorter. As shown in FIG. 5, when there is a write request from the write cycle determination means 8 (see S08 and S18 in FIG. 3), the trace information writing means 12 sends the bus information and the lower m bits of the real-time counter 4 to the trace memory 6. (See S12) and the n-bit counter 10 starts counting (see S14). The subsequent operation of the trace information writing unit 12 is the same as that of the first embodiment. The entire data structure of the trace memory 6 is as shown in FIG. 5. In the case of bus information, the value of the lower m bits of the real time counter 4 is written. This makes it possible to calculate the elapsed time.

[第3の実施形態]
本発明の第3の実施形態に係るトレースデータ記録装置は、概略、タイムスタンプのカウンタのビット幅を越える時間の記録をできるようにするものである。つまり、第1及び第2の実施形態に係るトレースデータ記録装置では、タイムスタンプの計測に使用しているカウンタ(リアルタイムカウンタ4)の備えるビット数で計測できる範囲には制限があり、カウンタがオーバーフローした後には経過時間を算出できない。
[Third Embodiment]
The trace data recording apparatus according to the third embodiment of the present invention generally enables recording for a time exceeding the bit width of the time stamp counter. In other words, in the trace data recording apparatus according to the first and second embodiments, the range that can be measured by the number of bits included in the counter (real-time counter 4) used for time stamp measurement is limited, and the counter overflows. After that, the elapsed time cannot be calculated.

そこで、本発明の第3の実施形態に係るトレースデータ記録装置では、リアルタイム監視手段18を設ける。図6は、本発明の第3の実施形態に係るトレースデータ記録装置の一部である。図7は、本発明の第3の実施形態に係るトレースデータ記録装置を構成するトレースメモリの記録状況を示す模式図である。第3の実施形態に係るトレースデータ記録装置も、第1の実施形態に係るトレースデータ記録装置と略同様のものである。従って、図6では両者の差異を中心に示している。   Therefore, in the trace data recording apparatus according to the third embodiment of the present invention, the real time monitoring means 18 is provided. FIG. 6 is a part of a trace data recording apparatus according to the third embodiment of the present invention. FIG. 7 is a schematic diagram showing a recording state of the trace memory constituting the trace data recording apparatus according to the third embodiment of the present invention. The trace data recording apparatus according to the third embodiment is substantially the same as the trace data recording apparatus according to the first embodiment. Therefore, FIG. 6 mainly shows the difference between the two.

上記の第1の実施形態で説明したように、トレース情報書き込み手段12は、書き込みサイクル判定手段8からの書き込み要求があると、トレースメモリ6にトレースデータを書き込んでnビットカウンタ10のカウントを開始し、nビットカウンタ10が“カウントアップした状態”になると、トレースメモリ6にリアルタイムカウンタ4の値を書き込み始める。このとき、リアルタイムカウンタ監視手段18は、トレースメモリ6に書き込み始めた時のカウント値を記憶し、リアルタイムカウンタ4で再びその値が登場するまでリアルタイムカウンタ4を監視する。即ち、リアルタイムカウンタ監視手段18は、リアルタイムカウンタ4の周回を監視する。   As described in the first embodiment, when there is a write request from the write cycle determination unit 8, the trace information writing unit 12 writes the trace data into the trace memory 6 and starts counting by the n-bit counter 10. When the n-bit counter 10 enters the “counted up state”, the value of the real-time counter 4 starts to be written into the trace memory 6. At this time, the real-time counter monitoring means 18 stores the count value at the start of writing in the trace memory 6, and monitors the real-time counter 4 until the value appears again in the real-time counter 4. That is, the real time counter monitoring means 18 monitors the circulation of the real time counter 4.

ここで、リアルタイムカウンタ監視手段18は、リアルタイムカウンタ4が一周したことを検出すると、トレース情報書き込み手段12にその旨を通知する。トレース情報書き込み手段12は、リアルタイムカウンタ4が一周した旨の通知を受けると、トレースメモリ6への書き込みアドレスをインクリメントし、更にリアルタイムカウンタ4の値をトレースメモリ6に書き込む。   Here, when the real-time counter monitoring means 18 detects that the real-time counter 4 has made a round, it notifies the trace information writing means 12 to that effect. When receiving the notification that the real-time counter 4 has made a full turn, the trace information writing means 12 increments the write address to the trace memory 6 and further writes the value of the real-time counter 4 to the trace memory 6.

以上の動作により、トレースメモリ6に記録されたトレースデータにおいて、図7に示すようにリアルタイムカウンタ4の値が連続して書き込まれる箇所が発生し得る。このとき、情報識別フラグ“0”のデータが連続する箇所の連続する個数から“1”だけ引いた数が、そのときにリアルタイムカウンタ4が周回した回数を示すことになる。   As a result of the above operation, in the trace data recorded in the trace memory 6, there may occur a place where the value of the real-time counter 4 is continuously written as shown in FIG. At this time, the number obtained by subtracting “1” from the continuous number of locations where the data of the information identification flag “0” continues indicates the number of times the real-time counter 4 has circulated at that time.

本発明の第1の実施形態に係るトレースデータ記録装置である。1 is a trace data recording apparatus according to a first embodiment of the present invention. 本発明の第1の実施形態に係るトレースデータ記録装置を構成するトレースメモリの記録状況を示す模式図である。It is a schematic diagram which shows the recording condition of the trace memory which comprises the trace data recording device concerning the 1st Embodiment of this invention. 本発明の第1の実施形態に係るトレースデータ記録装置を構成するトレース情報書き込み手段12の動作のフローチャートである。It is a flowchart of operation | movement of the trace information writing means 12 which comprises the trace data recording device based on the 1st Embodiment of this invention. 本発明の第2の実施形態に係るトレースデータ記録装置の一部である。It is a part of trace data recording device concerning a 2nd embodiment of the present invention. 本発明の第2の実施形態に係るトレースデータ記録装置を構成するトレースメモリの記録状況を示す模式図である。It is a schematic diagram which shows the recording condition of the trace memory which comprises the trace data recording device which concerns on the 2nd Embodiment of this invention. 本発明の第3の実施形態に係るトレースデータ記録装置の一部である。It is a part of trace data recording device concerning a 3rd embodiment of the present invention. 本発明の第3の実施形態に係るトレースデータ記録装置を構成するトレースメモリの記録状況を示す模式図である。It is a schematic diagram which shows the recording condition of the trace memory which comprises the trace data recording device which concerns on the 3rd Embodiment of this invention.

符号の説明Explanation of symbols

2・・・エバリュエーションチップ、2A・・・CPU、4・・・リアルタイムカウンタ、6・・・トレースメモリ、10・・・nビットカウンタ、12・・・トレース情報書き込み手段、18・・・リアルタイムカウンタ監視手段。

2 ... evaluation chip, 2A ... CPU, 4 ... real time counter, 6 ... trace memory, 10 ... n bit counter, 12 ... trace information writing means, 18 ... real time Counter monitoring means.

Claims (3)

CPUがプログラムフェッチ又はデータ読み書きを行う時のCPUステータス、アドレスバス、及びデータバスを含むバス情報と、プログラム実行開始からCPUクロックに同期してサイクル数をカウントするリアルタイムカウンタのカウント値とを、所定のサイクル時にトレースメモリに書き込むトレースデータ記録装置において、
バス情報をトレースメモリに書き込むサイクルを判定する書き込みサイクル判定手段と、
バス情報をトレースメモリに書き込んだサイクルからの経過サイクルをカウントするnビットカウンタと、
トレースメモリにリアルタイムカウンタの値を書き込むか、バス情報とnビットカウンタの値を書き込むかを制御し、トレースメモリの各アドレスに記録される情報がリアルタイムカウンタからの値か、バス情報かを識別する情報識別フラグをトレースメモリに書き込むトレース情報書き込み手段とを備え、
トレース情報書き込み手段は、nビットカウンタでカウントアップした状態になれば、リアルタイムカウンタの値をトレースメモリに更新し続け、
サイクル判定手段がバス情報をトレースメモリに書き込むサイクルであると判定すれば、トレースメモリの書き込みアドレスをインクリメントして、バス情報とnビットカウンタの値を書き込み、nビットカウンタをリセットしてnビットカウンタのカウントを開始する
ことを特徴とするトレースデータ記録装置。
CPU status when CPU fetches or reads / writes data, bus information including address bus and data bus, and count value of real-time counter that counts the number of cycles in synchronization with CPU clock from the start of program execution In the trace data recording device that writes to the trace memory during the cycle of
A write cycle determination means for determining a cycle for writing bus information to the trace memory;
An n-bit counter that counts elapsed cycles from the cycle in which the bus information is written to the trace memory;
Controls whether the real-time counter value is written to the trace memory or the bus information and the n-bit counter value, and identifies whether the information recorded at each address of the trace memory is the value from the real-time counter or the bus information Trace information writing means for writing an information identification flag to the trace memory,
The trace information writing means continues to update the value of the real-time counter to the trace memory when the n-bit counter counts up.
If the cycle determination means determines that the cycle is to write the bus information to the trace memory, the trace memory write address is incremented, the bus information and the n-bit counter value are written, the n-bit counter is reset, and the n-bit counter is reset. The trace data recording device is characterized by starting counting.
リアルタイムカウンタのクロックと、CPUの動作クロックが非同期であり、若しくは周波数が異なっており、
nビットカウンタがカウントアップした状態になるまでの時間が、リアルタイムカウンタの下位mビットがカウントアップした状態になるまでの時間よりも、短くなるように設定され、
トレース情報書き込み手段が、バス情報を書き込むときに、バス情報とリアルタイムカウンタの下位mビットをトレースメモリに書き込む
ことを特徴とする請求項1に記載のトレースデータ記録装置。
The real-time counter clock and CPU operating clock are asynchronous or have different frequencies.
The time until the n-bit counter is counted up is set to be shorter than the time until the lower m bits of the real-time counter are counted up,
2. The trace data recording apparatus according to claim 1, wherein the trace information writing means writes the bus information and the lower m bits of the real-time counter to the trace memory when writing the bus information.
トレースメモリにバス情報が書き込まれた直後のリアルタイムカウンタの値を記憶して、リアルタイムカウンタが周回するのを監視するリアルタイムカウンタ監視手段を更に含み、
リアルタイムカウンタ監視手段は、トレースメモリにバス情報が書き込まれた直後のリアルタイムカウンタの値を記憶したときから、リアルタイムカウンタが一周したことを検出すると、トレース情報書き込み手段にその旨を通知し、
トレース情報書き込み手段は、リアルタイムカウンタが一周した旨の上記の通知を受けると、トレースメモリへの書き込みアドレスをインクリメントしリアルタイムカウンタの値をトレースメモリに書き込むことを特徴とする請求項1又は2に記載のトレースデータ記録装置。

Real-time counter monitoring means for storing the value of the real-time counter immediately after the bus information is written in the trace memory and monitoring the rotation of the real-time counter is further included.
When the real-time counter monitoring means detects that the real-time counter has made a full turn since storing the value of the real-time counter immediately after the bus information is written in the trace memory, it notifies the trace information writing means to that effect,
3. The trace information writing means increments the write address to the trace memory and writes the value of the real-time counter to the trace memory when receiving the notification that the real-time counter has made a round. Trace data recording device.

JP2006059719A 2006-03-06 2006-03-06 Trace data recording device Expired - Fee Related JP4806577B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006059719A JP4806577B2 (en) 2006-03-06 2006-03-06 Trace data recording device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006059719A JP4806577B2 (en) 2006-03-06 2006-03-06 Trace data recording device

Publications (2)

Publication Number Publication Date
JP2007241431A true JP2007241431A (en) 2007-09-20
JP4806577B2 JP4806577B2 (en) 2011-11-02

Family

ID=38586947

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006059719A Expired - Fee Related JP4806577B2 (en) 2006-03-06 2006-03-06 Trace data recording device

Country Status (1)

Country Link
JP (1) JP4806577B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128681A (en) * 2008-11-26 2010-06-10 Renesas Electronics Corp Timestamp acquisition circuit and timestamp acquisition method
JP2011181068A (en) * 2010-03-03 2011-09-15 Arm Ltd Method, apparatus and trace module for generating timestamps

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04257936A (en) * 1991-02-12 1992-09-14 Nec Eng Ltd Trace information recorder for information processing system
JPH08161196A (en) * 1994-12-09 1996-06-21 Nec Corp Instruction tracing device
JPH09222934A (en) * 1996-02-16 1997-08-26 Canon Inc Electronic equipment and camera
JP2004310749A (en) * 2003-04-03 2004-11-04 Internatl Business Mach Corp <Ibm> Method and apparatus for performing bus tracing in data processing system having distributed memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04257936A (en) * 1991-02-12 1992-09-14 Nec Eng Ltd Trace information recorder for information processing system
JPH08161196A (en) * 1994-12-09 1996-06-21 Nec Corp Instruction tracing device
JPH09222934A (en) * 1996-02-16 1997-08-26 Canon Inc Electronic equipment and camera
JP2004310749A (en) * 2003-04-03 2004-11-04 Internatl Business Mach Corp <Ibm> Method and apparatus for performing bus tracing in data processing system having distributed memory

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128681A (en) * 2008-11-26 2010-06-10 Renesas Electronics Corp Timestamp acquisition circuit and timestamp acquisition method
JP2011181068A (en) * 2010-03-03 2011-09-15 Arm Ltd Method, apparatus and trace module for generating timestamps

Also Published As

Publication number Publication date
JP4806577B2 (en) 2011-11-02

Similar Documents

Publication Publication Date Title
TWI335512B (en) Technique for using memory attributes
CN107357666B (en) Multi-core parallel system processing method based on hardware protection
TWI461908B (en) Optional logging of debug activities in a real time instruction tracing log
JP2006309760A (en) Monitoring logic and monitoring method for detecting abnormal operation of data processor
US20120036501A1 (en) Method and System for Capturing System and User Events Using Hardware Trace Devices
US9760411B2 (en) Switching a locking mode of an object in a multi-thread program
JP2008009721A (en) Evaluation system and evaluation method thereof
JP2010086364A (en) Information processing device, operation state monitoring device and method
US9792402B1 (en) Method and system for debugging a system on chip under test
US20070226418A1 (en) Processor and method for controlling processor
JP2007199845A (en) Method and device for detecting memory c0rruption
JP4806577B2 (en) Trace data recording device
JP2006318412A (en) Semiconductor device
JP2007207120A (en) System verifying apparatus and its verification method
US10019341B2 (en) Using hardware performance counters to detect stale memory objects
US20110107072A1 (en) Method for self-diagnosing system management interrupt handler
CN106095631B (en) Multi-cycle non-pipeline CPU dynamic debugging method based on finite state machine
JP2009217385A (en) Processor and multiprocessor
JP2009098910A (en) Electronic equipment and memory managing program
JP2005165825A (en) Trace information recorder
KR101539933B1 (en) Method and apparatus for creating log on cpu hang-up
JP5937530B2 (en) Software error analysis device, error information creation device
JP7427143B2 (en) Factor analysis device, factor analysis method, and factor analysis program
JP3068578B2 (en) In-circuit emulator and saturation calculation processing method
JP2017199180A (en) Image processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090126

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101129

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: 20110809

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110815

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140819

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees