JP2005122329A - Software real-time analysis method - Google Patents
Software real-time analysis method Download PDFInfo
- Publication number
- JP2005122329A JP2005122329A JP2003354442A JP2003354442A JP2005122329A JP 2005122329 A JP2005122329 A JP 2005122329A JP 2003354442 A JP2003354442 A JP 2003354442A JP 2003354442 A JP2003354442 A JP 2003354442A JP 2005122329 A JP2005122329 A JP 2005122329A
- Authority
- JP
- Japan
- Prior art keywords
- debug
- instruction
- software
- information
- event
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
【課題】 解析対象となるソフトウェアに対してデバッグ専用命令の挿入を行うことによって生じるROMサイズの変化、最適度の低下および性能劣化を伴わずに、デバッグイベントを発生させる前記デバッグ専用命令の追加挿入や削除を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供することによって、ソフトウェア開発効率の改善と向上を図る。
【解決手段】 前記デバッグ専用命令を備えた並列命令実行を行うプロセッサと、前記解析対象となるソフトウェアの中に前記デバッグ専用命令を挿入するためのROM領域をあらかじめ確保するプログラム変換手段と、前記ROM領域に対して前記デバッグ専用命令への命令置換を実施することが可能なプログラム変換手段およびデバッガと、前記デバッグ専用命令の引数によってデバッグイベントの発生タイミングを任意に制御可能なデバッグ装置により、前記解析対象となるソフトウェアのROMサイズ、最適度および性能に対して影響を与えることなく、デバッグイベントの指定を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供する。
【選択図】 図1PROBLEM TO BE SOLVED: To additionally insert a debug-dedicated instruction that generates a debug event without causing a change in ROM size, a decrease in optimality, and a performance deterioration caused by inserting the debug-dedicated instruction into software to be analyzed. The software development efficiency is improved and improved by providing a software real-time analysis method that can be arbitrarily deleted or deleted.
A processor for executing parallel instructions including the debug-dedicated instructions, program conversion means for preliminarily securing a ROM area for inserting the debug-dedicated instructions in the analysis target software, and the ROM Analyzing the program by means of program conversion means and a debugger capable of executing instruction replacement with the debug-dedicated instruction for a region, and a debug device capable of arbitrarily controlling the timing of occurrence of a debug event by an argument of the debug-dedicated instruction Provided is a software real-time analysis method capable of arbitrarily specifying a debug event without affecting the ROM size, optimality, and performance of the target software.
[Selection] Figure 1
Description
本発明は、プロセッサ上で動作するソフトウェアの動作をリアルタイム解析する際に用いる解析方法に関するものである。 The present invention relates to an analysis method for use in real-time analysis of the operation of software running on a processor.
ソフトウェアの動作をリアルタイム解析する方法として、従来より解析対象ソフトウェア上に存在する任意の着眼点に対してデバッグイベントを設定し、そのデバッグイベントの発生経過履歴を参照することでソフトウェアの論理的動作や処理性能解析を行うという方法が広く用いられている。 As a method for real-time analysis of software operations, debug events can be set for any point of interest existing in the analysis target software, and the logical operation of the software can be determined by referring to the history of occurrence of the debug events. A method of performing processing performance analysis is widely used.
このデバッグイベントを用いたリアルタイム解析方法では、専用命令もしくは特定資源に対する情報出力命令群を該当位置に挿入し、これらデバッグイベントのために挿入された命令の実行を検出する手段と、その履歴を収集する手段によってリアルタイム解析に必要な情報提供が実現されている(例えば、特許文献1)。
しかしながら、従来のデバッグイベントを用いたリアルタイム解析方法では、デバッグイベントの指定位置の変更や削除を行う度に、コンパイル作業もしくはアセンブル作業が必要となりソフトウェアの再構築が発生するため、解析対象となるソフトウェアのソースプログラムレベルで変更が無い場合でも機械語レベルではROMサイズやプログラムカウンタの割当に変化が生じるので、解析作業のために解析対象に対して変化を与えるという解析作業の本質を損なう結果を招く問題点があった。 However, in the real-time analysis method using the conventional debug event, every time the specified position of the debug event is changed or deleted, the compiling or assembling work is required and the software is reconstructed. Even if there is no change at the source program level, the ROM size and the program counter allocation will change at the machine language level, resulting in a loss of the essence of the analysis work that changes the analysis target for the analysis work. There was a problem.
また、デバッグ用に命令を挿入することにより、挿入箇所の前後に存在する命令郡の構造に変化が発生することが原因で解析対象となるソフトウェア部分の最適度が下がってしまうという問題点があった。 In addition, there is a problem in that the optimality of the software part to be analyzed is lowered due to a change in the structure of the instruction group existing before and after the insertion place by inserting the instruction for debugging. It was.
また、専用命令を使用せずに特定資源に対する情報出力命令群を挿入する場合においてはデバッグイベントの設定数に比例して性能劣化を伴うという大きな問題点があった。
本発明では、前記従来技術における前記問題点を解決するために、解析対象のソフトウェアのROMサイズの変化、最適度の低下や性能劣化を伴わずに、任意にデバッグイベントの追加設定や削除を行うことが可能なリアルタイム解析方法を提供することを目的とする。
In addition, when an information output instruction group for a specific resource is inserted without using a dedicated instruction, there is a serious problem that the performance is deteriorated in proportion to the set number of debug events.
In the present invention, in order to solve the above-described problems in the conventional technology, additional setting or deletion of debug events is arbitrarily performed without changing the ROM size of the analysis target software, decreasing the optimality, or degrading the performance. It is an object of the present invention to provide a real-time analysis method capable of performing the above.
この目的を達成するために、本発明の請求項1記載のソフトウェアのリアルタイム解析方法は、解析対象となるソフトウェアにデバッグイベントを発生させるためのデバッグ専用命令を挿入しその実行履歴を参照するソフトウェアのリアルタイム解析方法であって、前記デバッグ専用命令と命令実行状態の通知機能を備えた並列命令実行を行うプロセッサと、前記デバッグ専用命令の実行通知情報に基づいてデバッグイベントの発生タイミングを制御し、デバッグイベントの発生時に解析に必要なデバッグ情報を出力するデバッグ装置と、命令並列度が空いている箇所に前記デバッグ専用命令を挿入するためのROM領域を確保し、前記ROM領域の位置情報をROM情報として出力するプログラム変換手段と、指示されたデバッグイベントの設定情報と前記ROM情報に基づいて前記ROM領域に対してデバッグ専用命令への命令置換処理を行うデバッガから構成される、前記デバッグ専用命令の挿入によるROMサイズの変化、最適度の低下および性能の劣化が発生しないことを特徴とする。
In order to achieve this object, the software real-time analysis method according to
請求項2記載のソフトウェアのリアルタイム解析方法は、請求項1記載のソフトウェアのリアルタイム解析方法において、前記デバッグ専用命令が引数として無効化情報、イベントID情報およびイベント検出タイミング指定情報を持ち、実行時に前記無効化情報にて無効化の指定が行われていない場合にデバッグ装置に対して引数の内容と実行発生を通知することを特徴とする。
The software real-time analysis method according to
請求項3記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2のいずれかに記載のソフトウェアのリアルタイム解析方法において、前記デバッグ専用命令が全てのプロセッサ資源に対して影響を与えることなく1マシンサイクルで実行が完了することを特徴とする。
The software real-time analysis method according to
請求項4記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記イベントID情報と前記イベント検出タイミング指定情報を記憶すると同時に、これらの情報と独立して独自に生成する時刻情報を元にしてデバッグ情報を生成し出力することを特徴とする。
The software real-time analysis method according to
請求項5記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記プロセッサからの命令実行完了通知を受ける度ににそのときの時刻情報を随時記憶するFIFO型バッファを備え、前記デバッグ専用命令実行時に通知される前記デバッグイベント検出タイミング指定情報に基づいて、過去に実行された任意の命令に対応する時刻情報を前記FIFO型バッファより抽出すると同時に、デバッグイベントの発生検出を行うことで、前記デバッグ専用命令よりも過去に実行された命令に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする。
The software real-time analysis method according to claim 5 is the software real-time analysis method according to
請求項6記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記プロセッサからの命令実行完了通知を受ける度に動作する第1のカウンタを備え、前記デバッグ専用命令実行時に通知される前記デバッグイベント検出タイミング情報に基づいて、前記デバッグ専用命令の実行から任意指定回数後の命令実行が行われた時にデバッグイベント発生検出を行うことで、前記デバッグ専用命令よりも未来に実行される任意の後続命令に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする。
The software real-time analysis method according to claim 6 is the software real-time analysis method according to
請求項7記載のソフトウェアのリアルタイム解析方法は、請求項5または請求項6に記載のソフトウェアのリアルタイム解析方法において、前記プロセッサ上で条件分岐を含む全ての分岐命令が実行された際に、前記FIFO型バッファおよび前記第1のカウンタの内容を無効化し、ソフトウェアの不具合などによる意図しない分岐動作発生による誤ったデバッグイベント発生検出を行わないようにすることで、ソフトウェアの不具合に影響されず如何なる状況下でも正確なデバッグイベント発生検出を可能とすることを特徴とする。 The software real-time analysis method according to claim 7 is the software real-time analysis method according to claim 5 or 6, wherein when all branch instructions including conditional branches are executed on the processor, the FIFO is executed. By disabling the contents of the type buffer and the first counter so that an erroneous debug event occurrence detection due to an unintended branch operation caused by a software failure or the like is not performed, the software is not affected by a software failure and under any circumstances However, it is characterized by enabling accurate detection of debug events.
請求項8記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記デバッグ専用命令の実行通知を受ける度に動作する第2のカウンタとイベントID比較機構を備え、イベント検出タイミング情報により指定される任意のイベントIDを持つデバッグ専用命令が任意の指定回数連続実行された場合に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする。
The software real-time analysis method according to claim 8 is the software real-time analysis method according to
請求項9記載のソフトウェアのリアルタイム解析方法は、請求項8記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタにて構成される1つバンクを複数備え、前記プロセッサ上で割込みまたは例外の発生時および割込みまたは例外の処理ルーチンからの復帰時においても、これらのバンクを切替制御することによって割込みや例外が非同期的に発生する状況下でもリアルタイム解析を継続可能とすることを特徴とする。 The software real-time analysis method according to claim 9 is the software real-time analysis method according to claim 8, wherein the debug device includes the FIFO buffer, the first counter, and the second counter. A situation in which an interrupt or an exception is generated asynchronously by switching control of these banks even when an interrupt or exception occurs on the processor and when the interrupt or exception is returned from the processing routine. The feature is that real-time analysis can be continued even under.
請求項10記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記プロセッサにおける割込みまたは例外の発生時に、前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタの内容を任意指定可能なポインタが示す記憶装置のアドレス領域に対して退避し、前期プロセッサにおける割込みまたは例外の処理ルーチンからの復帰時に、前記ポインタが示す記憶装置のアドレス領域より退避された前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタの内容を復帰させるスタック制御機構を備えることによって、非同期的に割込みや例外が発生する状況下でもリアルタイム解析を継続可能とすることを特徴とする。
The software real-time analysis method according to claim 10 is the method according to
請求項11記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10に記載のソフトウェアのリアルタイム解析方法において、前記基本ブロック単位をソフトウェアの先頭命令もしくは任意の分岐命令から次の分岐命令までの間とすることにより、解析対象となるソフトウェアの全ての箇所に対して常にリアルタイム解析を行うことを可能ととすることを特徴とする。
The real-time analysis method for software according to claim 11 is the method of
請求項12記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10または請求項11に記載のソフトウェア解析方法において、前記プログラム変換手段が、前回解析対象となるソフトウェアの変換時にその内容を解析し、関数やサブルーチンの先頭命令、最後尾命令および前記ソフトウェアの記述上にて明示的に前記デバッグ専用命令の挿入が指示された箇所に対して自動的に前記デバッグ専用命令の挿入を行うことを特徴とする。
The software real-time analysis method according to claim 12 is the method of
請求項13記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10または請求項11または請求項12に記載のソフトウェアのリアルタイム解析方法において、前記プログラム変換手段が、前記デバッグ専用命令と前記NOP命令の挿入位置情報を含んだROM情報を前記デバッガに出力することを特徴とする。
The software real-time analysis method according to claim 13 is the method of
請求項14記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10または請求項11または請求項12または請求項13に記載のソフトウェアのリアルタイム解析方法において、前記ROM情報を読み込み、指示されたデバッグイベントの設定情報と前記ROM情報に基づいて前記イベントID情報および前記イベント検出タイミング指定情報を生成し、前記ROM領域に対してデバッグ専用命令への命令置換処理を行うことで、デバッグイベントの設定変更による解析対象ソフトウェアの再構築を必要としないリアルタイム解析を可能とすることを特徴とする。
The software real-time analysis method according to claim 14 is the method according to
以上により、解析対象となるソフトウェアに対してデバッグ専用命令の挿入を行うことによって生じるROMサイズの変化、最適度の低下および性能劣化を伴わずに、デバッグイベントを発生させる前期デバッグ専用命令の追加挿入や削除を任意に行うことが可能なリアルタイム解析方法を提供することができる。 As described above, additional insertion of the previous debugging instruction that generates a debugging event without changing the ROM size, reducing the optimality, and degrading the performance caused by inserting the debugging instruction into the software to be analyzed It is possible to provide a real-time analysis method that can be arbitrarily deleted or deleted.
以上のように、解析対象となるソフトウェアに対して前記デバッグ専用命令の挿入を行うことによって生じるROMサイズの変化、最適度の低下および性能劣化を伴わずに、デバッグイベントを発生させる前記デバッグ専用命令の追加挿入や削除を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供することによって、ソフトウェア開発効率の改善と向上を図ることができる。 As described above, the debug-dedicated instruction that generates a debug event without causing a change in ROM size, a decrease in optimality, and a performance deterioration caused by inserting the debug-dedicated instruction into software to be analyzed The software development efficiency can be improved and improved by providing a software real-time analysis method capable of arbitrarily inserting and deleting the software.
以下、本発明の実施の形態について、図1,図2,図3,図4,図5,図6を参照しながら説明する。
図1は本発明のリアルタイム解析方法の構成を説明するブロック図,図2はプロセッサが備えるデバッグ専用命令の仕様例を示す図,図3はデバッグ専用命令を挿入するためのROM領域を確保するプログラム変化手段の動作を示す図,図4はデバッグ専用命令の後続命令に対するデバッグイベント指定が行われている場合の動作を例示した図,図5はデバッグ専用命令よりも前に存在する命令に対するデバッグイベント指定が行われている場合の動作を例示した図,図6は非同期的に発生する割込みや例外による分岐発生時の動作を例示した図である。
Hereinafter, embodiments of the present invention will be described with reference to FIGS. 1, 2, 3, 4, 5 and 6.
FIG. 1 is a block diagram for explaining the configuration of the real-time analysis method of the present invention, FIG. 2 is a diagram showing an example of the specification of a debug dedicated instruction provided in the processor, and FIG. 3 is a program for securing a ROM area for inserting the debug dedicated instruction FIG. 4 is a diagram illustrating the operation of the changing means, FIG. 4 is a diagram illustrating an operation when a debug event is specified for a subsequent instruction of the debug dedicated instruction, and FIG. 5 is a debug event for an instruction existing before the debug dedicated instruction. FIG. 6 is a diagram illustrating an operation when designation is performed, and FIG. 6 is a diagram illustrating an operation when a branch occurs due to an interrupt or exception that occurs asynchronously.
図1において、100は並列命令実行を行うプロセッサ(以降プロセッサと称する)、200はデバッグ装置、300はコンパイラやアセンブラといったプログラム変換手段、400はデバッガ、500は記憶装置である。
In FIG. 1,
プロセッサ100は、命令を記憶装置500から読み出す命令フェッチ制御部106、命令フェッチ制御部106によってフェッチされた命令を解読する実行命令解析部101、実行命令解読部101によってデバッグ専用命令の実行を検出しデバッグ装置200へ通知するデバッグ専用命令実行通知部102、割込みもしくは例外が発生したことを検出しデバッグ装置200へ通知する割込み発生通知部103、実行命令解読部101によって割込みもしくは例外の処理プログラム中に復帰命令の実行が検出されたことを検出しデバッグ装置200へ通知する復帰命令実行通知部104、1命令実行単位毎に実行完了を検出しデバッグ装置200へ通知する命令実行完了通知部105から構成される並列命令実行が可能なアーキテクチャを持ったプロセッサである。
The
デバッグ装置200は、デバッグ専用命令実行通知部102より通知されたイベントID情報およびイベント検出タイミング指定情報の解読を行い後述するFIFO型バッファ204,命令実行回数カウンタ205,デバッグ専用命令実行回数カウンタ206に対する制御をバンク制御部207を通じて行うイベント情報解析部201と、プロセッサ100の動作とは独立して独自の時刻情報を生成し後述するFIFO型バッファ204およびイベント検出部209に対して時刻情報を通知する時刻情報生成部202と、割込み発生通知部103および復帰命令実行通知部104からの通知を受けて割込みもしくは例外発生および割込みもしくは例外処理からの復帰を検出する割込み検出制御部203と、時刻情報生成部202にて生成された時刻情報を逐次記憶すると同時に後述のイベント検出部209に対してデバッグイベントに対応した情報を出力する機能を備えるFIFO型バッファ204と、命令実行完了通知部105からの通知を受けて命令実行回数をカウントする命令実行回数カウンタ205と、イベント情報解析部201にて解読された結果に基づいて同一IDを持つデバッグ専用命令の実行回数をカウントするデバッグ専用命令実行回数カウンタ206と、FIFO型バッファ204,命令実行回数カウンタ205,デバッグ専用命令実行回数カウンタ206を1つのバンクとして取り扱い、このバンクが複数搭載されているデバッグ装置200にて割込み検出制御部203で検出される割込み発生および割込み処理からの復帰を起点としてバンクの切換制御を行うバンク制御部207と、任意の値に設定可能なポインタレジスタを備え、割込み検出制御部203で検出される割込み発生を受けて前記ポインタレジスタが示す記憶装置500上のアドレス領域に対してFIFO型バッファ204,命令実行回数カウンタ205,デバッグ専用命令実行回数カウンタ206の内容を書き出す(プッシュ動作)と同時にポインタレジスタの内容を自動的に増加させ、割込み検出制御部203で検出される割込み処理からの復帰を受けて前記ポインタレジスタが示す値を元に記憶装置500へ退避されているFIFO型バッファ204,命令実行回数カウンタ205,デバッグ専用命令実行回数カウンタ206の内容を読み出して復帰(ポップ動作)させるスタック制御部208と、イベント情報解析部201の解読結果を元にイベント検出を行い該当するイベントID情報と時刻情報を抽出するイベント検出部209と、イベント検出部209にて検出されたデバッグイベントの情報をデバッガ400へ通知するためのデバッグ情報へ変換し出力するデバッグ情報出力部210とから構成される。
The
プログラム変換手段300は、解析対象となるソースプログラム301と、ソースプログラム301を読み込んで性能やコードサイズが最も優れた結果になるよう最適化を行いながら機械語へ変換を行う最適化を伴った機械語変換手段302と、機械語変換手段302の結果からデバッグ専用命令の挿入のためにプログラムの先頭命令もしくは分岐命令から次回の分岐命令までの区間を一つの基本ブロックとして抽出する基本ブロック抽出手段303と、基本ブロック抽出手段303にて抽出された基本ブロック毎にその内容を読みとって命令並列度の空きがあるかどうかを調べる命令並列度検査手段304と、命令並列度検査手段304の検査結果として命令並列度に空きが全く無かった場合に該当する基本ブロックのみを最低1つ以上の空きが命令並列度に存在するように再び最適化を行う機械語再変換手段305と、命令並列度検査手段304の検査結果として命令並列度に空きがあった場合は基本ブロック抽出手段303にて抽出された基本ブロックを対象に、そうでない場合は機械語再変換手段305から得られる基本ブロックを対象にデバッグ専用命令もしくはNOP命令を命令並列度の空きがある場所に対して挿入する命令挿入手段306と、ソースプログラム301全体に対して命令挿入手段306の処理が行われた結果である実行オブジェクト307と、命令挿入手段306にて挿入されたデバッグ専用命令もしくはNOP命令の位置情報を含んだROM情報308とから構成される。
The program conversion means 300 includes a
デバッガ400は、デバッグ装置200内のデバッグ情報出力部210より出力されたデバッグ情報を受信するデバッグ情報受信部401と、デバッグ情報受信部401にて受信したデバッグ情報を解読して表示するデバッグ情報表示部402と、操作部405からの指示に従って後述の命令挿入情報解析部404から得られるデバッグ専用命令およびNOP命令の挿入位置情報を元に記憶装置500上のデバッグ専用命令とNOP命令の命令置換処理を行うデバッグイベント設定変更制御部403と、プログラム変換装置300にて得られるROM情報308を読み込んでデバッグ専用命令およびNOP命令の挿入位置情報を得る命令挿入情報解析部404と、デバッガ400を使用する作業者とのユーザインターフェースの役割を果たす操作部405から構成される。
The
次に、本発明の動作に関して説明する。
図2において、デバッグ専用命令コード600が機械語のニモニックであり、引数としてイベントID情報601とイベント検出タイミング指定情報602がある。イベント検出タイミング指定情報602は、イベント設定対象命令がデバッグ専用命令600から見て前にあるか後ろにあるかを示す方向指定情報603、イベント設定対象命令の位置を示すデバッグ専用命令600からのオフセット命令数であるオフセット命令数指定情報604、デバッグイベント発生条件となるデバッグ専用命令実行回数指定情報605、実行時にイベントID情報601とイベント検出タイミング指定情報602を無効なものとして扱うように指定するデバッグ専用命令無効化指定情報606から構成される。
Next, the operation of the present invention will be described.
In FIG. 2, the debug dedicated
図3において、ソースプログラム例610を機械語変換手段302にて最適化を行って変換した結果が機械語変換結果例611である。この機械語変換結果例611を基本ブロック抽出手段303にかけて抽出された基本ブロック例が基本ブロック例612となる。この基本ブロック例612に対して命令並列度検査手段304にて検査を行うと、基本ブロック例612には命令並列度に空きが全く無いため、機械語再変換手段305にて命令並列度に空きができるように再変換を行う。その結果例が機械語再変換結果例613と再変換後の基本ブロック例614となる。再変換後の基本ブロック例614にはデバッグ専用命令挿入可能箇所例615が存在するので、この箇所に対して命令挿入手段306にてデバッグ専用命令もしくはNOP命令の挿入を行い、実行オブジェクト307が生成され、これが記憶装置500に格納される。
In FIG. 3, a machine language conversion result example 611 is a result obtained by performing optimization by converting the source program example 610 by the machine
プロセッサ100は、記憶装置500から命令フェッチ制御部107を通じて実行する命令を取り込み、実行命令解析部101にてどのような命令かを判別しながら動作を行う。この実行命令解析部101にて命令フェッチ制御部107から取り込んだ命令がデバッグ専用命令コード600を示した場合、デバッグ専用命令無効化指定情報606の内容が偽であればデバッグ専用命令実行通知部102を通じてデバッグ装置200に対してデバッグ専用命令実行と引数であるイベントID情報601およびイベント検出タイミング指定情報602の通知を行い、命令フェッチ制御部107から取り込んだ命令が割込みもしくは例外処理からの復帰を行う命令を示していた場合は復帰命令実行通知部104を通じてデバッグ装置200に対して通知を行う。
The
図4に示した命令例では、イベントID情報が0x55、デバッグ専用命令より2つ後で実行される命令(Inst C0、Inst C1、Inst C2)に対するイベント設定がなされている。 In the example of the instruction shown in FIG. 4, the event ID information is 0x55, and an event is set for an instruction (Inst C0, Inst C1, Inst C2) that is executed two times after the debug-dedicated instruction.
図4に示した命令例が実行されると、デバッグ専用命令実行を受けて命令実行回数カウンタ205にオフセット値である0x2が設定され、以降、命令実行が行われる度に0x1ずつカウンタ値が減少していく。そして、命令実行回数カウンタ205の値が0x0になった時点、つまり、デバッグ専用命令より2つ後の命令が実行された時にデバッグイベントの発生が検出されることになる。このように、デバッグ専用命令実行時に通知される方向指定情報603がデバッグ専用命令よりも後ろ側を示す場合、オフセット命令数指定情報604の内容が命令実行回数カウンタ205にセットされると同時にカウンタ動作が有効化される。そして命令実行回数カウンタ205の動作が有効な状態でかつその値が0x0になった時点でデバッグイベントを検出することによって、デバッグ専用命令よりも後に実行される命令に対するイベント設定およびデバッグイベント検出が可能となる。
When the instruction example shown in FIG. 4 is executed, 0x2 which is an offset value is set in the instruction
図5における命令例では、イベントID情報が0xAA、デバッグ専用命令より2つ前に実行される命令(Inst B0、Inst B1、Inst B2)に対するイベント設定がなされている。ここで、FIFO型バッファ204には命令実行毎に常時時刻情報生成部202で作られた時刻情報が記憶される。
In the example of the instruction in FIG. 5, event ID information is 0xAA, and an event is set for an instruction (Inst B0, Inst B1, Inst B2) that is executed two times before the debug-dedicated instruction. Here, the
図5に示した命令例が実行されると、デバッグ専用命令の実行を受けた時点でイベント情報解析部201が方向指定情報603およびオフセット命令数指定情報604よりFIFO型バッファの−2に存在するデバッグ専用命令よりも2つ前に実行された命令に対応する時刻情報がデバッグイベントの時刻情報として選択、抽出される。
When the instruction example shown in FIG. 5 is executed, the event
つまり、デバッグ専用命令より2つ前の命令が実行された時の状態がデバッグイベント内容としてデバッグ専用命令の実行時に検出されることになる。このようにデバッグ専用命令実行時に通知される方向指定情報603がデバッグ専用命令よりも前側を示す場合、オフセット命令数指定情報604の内容に基づいてFIFO型バッファ204の中から時刻情報が抽出されることで、デバッグ専用命令よりも前に実行される命令に対するイベント設定およびデバッグイベント検出が可能となる。
That is, the state when the instruction two before the debug-dedicated instruction is executed is detected as the debug event content when the debug-dedicated instruction is executed. As described above, when the
図6の想定条件として、FIFO型バッファ204、命令実行回数カウンタ205、デバッグ専用命令実行回数カウンタ206を一つのバンクとしてこれを2つ備えたバンク制御部207、かつ、これらのバンクが共に充填されている場合に記憶装置500へバンクの内容を退避・復帰するためのスタック制御部208を備えたデバッグ装置200が存在するものとする。
As an assumption condition of FIG. 6, the
図6は、プログラム中のある基本ブロックにおける先頭命令620から命令が実行されて行き、基本ブロック内の命令621に対して割込みが発生して割込み処理先頭命令623へ分岐し、その割込み処理中の命令624にて多重に例外が発生し例外処理先頭命令626へ再び分岐し、例外処理からの復帰命令627で例外が発生する割込み処理内の命内の命令624へ復帰した後、基本ブロック内の割込みが発生した命令621へと復帰して基本ブロック最終命令622まで命令実行が行われる場合のものである。
FIG. 6 shows that an instruction is executed from the
まず、最初の割込みにおいて、バンク制御部207は、使用バンクをバンク0からバンク1に切り換える。そして、次の例外発生時には、バンク0の内容破壊を防ぐためスタック制御部208によってバンク0の内容を記憶装置500へ退避すると同時にバンク制御部207は使用バンクをバンク0に切り換える。次に、例外処理からの復帰時にはスタック制御部208は記憶装置500へ退避していたバンク0の内容を復帰させると同時にバンク制御部207が使用バンクをバンク1へ戻す。そして、最後の割込み処理からの復帰時に、バンク制御部207が使用バンクをバンク0に戻すことによって、非同期的に発生する割込みや例外による分岐が原因でFIFO型バッファ204、命令実行回数カウンタ205、デバッグ専用命令実行回数カウンタ206の内容破壊が回避されるため非同期的に発生する割込みや例外による分岐が発生するような状況下でもデバッグイベントの検出可能状態を維持し続けることが可能となる。
First, in the first interrupt, the
なお、バンク制御部207およびスタック制御部208は、いずれかのみが存在する場合であっても図6の例と同様の効果を得ることが可能であり、実際のハードウェアコストや処理性能といった面で利用形態を選択することが可能である。
Note that even if only one of the
以上により、解析対象となるソフトウェアに対して前記デバッグ専用命令の挿入を行うことによって生じるROMサイズの変化、最適度の低下および性能劣化を伴わずに、デバッグイベントを発生させる前記デバッグ専用命令の追加挿入や削除を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供することによって、ソフトウェア開発効率の改善と向上を図ることができる。 As described above, the addition of the debug-dedicated instruction that generates a debug event without causing a change in ROM size, a decrease in the optimum degree, and a performance deterioration caused by inserting the debug-dedicated instruction into the analysis target software. Software development efficiency can be improved and improved by providing a software real-time analysis method that can be arbitrarily inserted and deleted.
本発明にかかるソフトウェアのリアルタイム解析方法は、解析対象のソフトウェアのROMサイズ変化、最適度の低下や性能劣化を伴わずに、任意にデバッグイベントの追加設定や削除を行うことが可能であるため、ソフトウェアをリアルタイム解析する際に用いる解析方法として有用である。 Since the software real-time analysis method according to the present invention can arbitrarily set and delete debug events without causing a change in the ROM size of the analysis target software, a decrease in optimality, or performance degradation, It is useful as an analysis method used for real-time analysis of software.
100・・・プロセッサ
101・・・実行命令解読部
102・・・デバッグ専用命令実行通知部
103・・・割込み発生通知部
104・・・復帰命令実行通知部
105・・・命令実行完了通知部
106・・・命令フェッチ制御部
200・・・デバッグ装置
201・・・イベント情報解析部
202・・・時刻情報生成部
203・・・割込み検出制御部
204・・・FIFO型バッファ
205・・・命令実行回数カウンタ
206・・・デバッグ専用命令実行回数カウンタ
207・・・バンク制御部
208・・・スタック制御部
209・・・イベント検出部
210・・・デバッグ情報出力部
300・・・プログラム変換手段
301・・・ソースプログラム
302・・・機械語変換手段
303・・・基本ブロック抽出手段
304・・・命令並列度検査手段
305・・・機械語再変換手段
306・・・命令挿入手段
307・・・実行オブジェクト
308・・・ROM情報
400・・・デバッガ
401・・・デバッグ情報受信部
402・・・デバッグ情報表示部
403・・・デバッグイベント設定変更制御部
404・・・命令挿入情報解析部
405・・・操作部
500・・・記憶装置
600・・・デバッグ専用命令コード
601・・・イベントID情報
602・・・イベント検出タイミング指定情報
603・・・方向指定情報
604・・・オフセット命令数指定情報
605・・・デバッグ専用命令実行回数指定情報
606・・・デバッグ専用命令無効化指定情報
610・・・ソースプログラム例
611・・・機械語変換結果例
612・・・基本ブロック例
613・・・機械語再変換結果例
614・・・再変換後の基本ブロック例
615・・・デバッグ専用命令挿入可能箇所例
620・・・基本ブロック先頭命令
621・・・割込みが入る基本ブロック内の命令
622・・・基本ブロック最終命令
623・・・割込み処理先頭命令
624・・・例外が発生する割込み処理内の命令
626・・・例外処理先頭命令
627・・・例外処理からの復帰命令
DESCRIPTION OF
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003354442A JP2005122329A (en) | 2003-10-15 | 2003-10-15 | Software real-time analysis method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003354442A JP2005122329A (en) | 2003-10-15 | 2003-10-15 | Software real-time analysis method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2005122329A true JP2005122329A (en) | 2005-05-12 |
Family
ID=34612354
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2003354442A Pending JP2005122329A (en) | 2003-10-15 | 2003-10-15 | Software real-time analysis method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2005122329A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007133716A (en) * | 2005-11-11 | 2007-05-31 | Matsushita Electric Ind Co Ltd | Translation method and execution notification instruction embedding method |
-
2003
- 2003-10-15 JP JP2003354442A patent/JP2005122329A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007133716A (en) * | 2005-11-11 | 2007-05-31 | Matsushita Electric Ind Co Ltd | Translation method and execution notification instruction embedding method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4233893B2 (en) | Instruction tracing in data processing systems. | |
| KR101994636B1 (en) | Tracing of a data processing apparatus | |
| US6754856B2 (en) | Memory access debug facility | |
| JP5478531B2 (en) | Method, apparatus and trace module for generating a time stamp | |
| JP5485982B2 (en) | System for providing trace data in a data processor having a pipelined architecture | |
| US8037363B2 (en) | Generation of trace elements within a data processing apparatus | |
| US8578351B2 (en) | Hybrid mechanism for more efficient emulation and method therefor | |
| TWI461908B (en) | Optional logging of debug activities in a real time instruction tracing log | |
| US12204906B2 (en) | Profiling of sampled operations processed by processing circuitry | |
| CN101154259A (en) | General automated unpacking engine and method | |
| KR20020039370A (en) | Controlling instruction translation using dynamic feedback | |
| KR100247900B1 (en) | Program Converter and Processor | |
| JP2002342114A (en) | Processor that can collect trace data | |
| Tuck et al. | SoftSig: software-exposed hardware signatures for code analysis and optimization | |
| Kim et al. | Implementing optimizations at decode time | |
| JP2005122329A (en) | Software real-time analysis method | |
| US9361204B2 (en) | Generating trace data including a lockup identifier indicating occurrence of a lockup state | |
| JP2005215816A (en) | Performance profiling method using hardware monitor | |
| US7827543B1 (en) | Method and apparatus for profiling data addresses | |
| Parravicini et al. | The cost of speculation: Revisiting overheads in the V8 JavaScript engine | |
| US7496899B2 (en) | Preventing loss of traced information in a data processing apparatus | |
| JP2014182478A (en) | Performance profiling device, and performance profiling method | |
| JP4725240B2 (en) | Data trace method and trace module | |
| JP2919406B2 (en) | Performance evaluation method | |
| JPH0528002A (en) | Microprocessor |