[go: up one dir, main page]

JP2005122329A - Software real-time analysis method - Google Patents

Software real-time analysis method Download PDF

Info

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
Application number
JP2003354442A
Other languages
Japanese (ja)
Inventor
Akira Ueda
亮 上田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2003354442A priority Critical patent/JP2005122329A/en
Publication of JP2005122329A publication Critical patent/JP2005122329A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

【課題】 解析対象となるソフトウェアに対してデバッグ専用命令の挿入を行うことによって生じるROMサイズの変化、最適度の低下および性能劣化を伴わずに、デバッグイベントを発生させる前記デバッグ専用命令の追加挿入や削除を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供することによって、ソフトウェア開発効率の改善と向上を図る。
【解決手段】 前記デバッグ専用命令を備えた並列命令実行を行うプロセッサと、前記解析対象となるソフトウェアの中に前記デバッグ専用命令を挿入するためのROM領域をあらかじめ確保するプログラム変換手段と、前記ROM領域に対して前記デバッグ専用命令への命令置換を実施することが可能なプログラム変換手段およびデバッガと、前記デバッグ専用命令の引数によってデバッグイベントの発生タイミングを任意に制御可能なデバッグ装置により、前記解析対象となるソフトウェアのROMサイズ、最適度および性能に対して影響を与えることなく、デバッグイベントの指定を任意に行うことが可能なソフトウェアのリアルタイム解析方法を提供する。
【選択図】 図1
PROBLEM 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)。
特開平6−89200号公報
In this real-time analysis method using a debug event, a dedicated instruction or a group of information output instructions for a specific resource is inserted at a corresponding position, and a means for detecting the execution of the instruction inserted for the debug event and its history are collected. Provision of information necessary for real-time analysis is realized by the means to perform (for example, Patent Document 1).
JP-A-6-89200

しかしながら、従来のデバッグイベントを用いたリアルタイム解析方法では、デバッグイベントの指定位置の変更や削除を行う度に、コンパイル作業もしくはアセンブル作業が必要となりソフトウェアの再構築が発生するため、解析対象となるソフトウェアのソースプログラムレベルで変更が無い場合でも機械語レベルでは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 claim 1 of the present invention inserts a dedicated debug instruction for generating a debug event in the software to be analyzed, and refers to the execution history of the software. A real-time analysis method that executes a parallel instruction execution having a notification function of the debug instruction and instruction execution state, and controls the timing of occurrence of a debug event based on the execution notification information of the debug instruction and debugs A debug device that outputs debug information necessary for analysis when an event occurs, and a ROM area for inserting the debug-dedicated instruction at a location where the instruction parallelism is free, and the ROM area position information is read as ROM information Program conversion means to output as and debug event instructed A ROM size change due to the insertion of the debug-dedicated instruction, a decrease in the optimality, and performance are configured from a debugger that performs instruction replacement processing to the debug-dedicated instruction for the ROM area based on the setting information and the ROM information. It is characterized by no deterioration.

請求項2記載のソフトウェアのリアルタイム解析方法は、請求項1記載のソフトウェアのリアルタイム解析方法において、前記デバッグ専用命令が引数として無効化情報、イベントID情報およびイベント検出タイミング指定情報を持ち、実行時に前記無効化情報にて無効化の指定が行われていない場合にデバッグ装置に対して引数の内容と実行発生を通知することを特徴とする。   The software real-time analysis method according to claim 2 is the software real-time analysis method according to claim 1, wherein the debug-dedicated instruction has invalidation information, event ID information, and event detection timing designation information as arguments. When invalidation is not specified in the invalidation information, the contents of the argument and the occurrence of execution are notified to the debug device.

請求項3記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2のいずれかに記載のソフトウェアのリアルタイム解析方法において、前記デバッグ専用命令が全てのプロセッサ資源に対して影響を与えることなく1マシンサイクルで実行が完了することを特徴とする。   The software real-time analysis method according to claim 3 is the software real-time analysis method according to claim 1 or 2, wherein the debug-dedicated instruction does not affect all processor resources. Execution is completed in a machine cycle.

請求項4記載のソフトウェアのリアルタイム解析方法は、請求項1または請求項2または請求項3に記載のソフトウェアのリアルタイム解析方法において、前記デバッグ装置が、前記イベントID情報と前記イベント検出タイミング指定情報を記憶すると同時に、これらの情報と独立して独自に生成する時刻情報を元にしてデバッグ情報を生成し出力することを特徴とする。   The software real-time analysis method according to claim 4 is the software real-time analysis method according to claim 1, 2 or 3, wherein the debug device receives the event ID information and the event detection timing designation information. At the same time as storing, debug information is generated and output based on time information independently generated from the information.

請求項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 claim 1, claim 2, claim 3, or claim 4, wherein the debug device notifies the instruction execution completion from the processor. FIFO type buffer that stores time information at any time whenever it is received, and corresponds to any instruction executed in the past based on the debug event detection timing designation information notified at the time of execution of the debug dedicated instruction The time information to be extracted is extracted from the FIFO type buffer, and at the same time, the occurrence of a debug event is detected, thereby making it possible to set and detect the occurrence of a debug event for an instruction executed in the past rather than the debug dedicated instruction. And

請求項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 claim 1, claim 2, claim 3, claim 4 or claim 5, wherein the debug device A first counter that operates every time an instruction execution completion notification is received, and instruction execution after an arbitrary specified number of times from execution of the debug-dedicated instruction based on the debug event detection timing information notified when the debug-dedicated instruction is executed Debug event occurrence detection is performed when a debug event is performed, and a debug event can be set and detected for any subsequent instruction to be executed in the future rather than the debug dedicated instruction.

請求項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 claim 1, claim 2, claim 3, claim 4, claim 5, claim 6, or claim 7, The debug device includes a second counter and an event ID comparison mechanism that are operated every time the debug dedicated instruction is notified of execution, and a debug dedicated instruction having an arbitrary event ID specified by event detection timing information is arbitrarily specified It is characterized in that it is possible to set and detect the occurrence of a debug event for the case where it is continuously executed a number of times.

請求項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 claim 1, claim 2, claim 3, claim 4, claim 5, claim 6, claim 7, claim 8, or claim 9. In the software real-time analysis method, when the interrupt or exception occurs in the processor, the storage device indicated by a pointer capable of arbitrarily designating the contents of the FIFO buffer, the first counter, and the second counter The FIFO buffer, the first counter, and the second buffer saved from the address area of the storage device indicated by the pointer when returning from the interrupt or exception processing routine in the previous processor. A stack control mechanism that restores the contents of the counter And by, characterized in that to allow continued real-time analysis even in a situation where asynchronously interrupt or exception occurs.

請求項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 claim 1 or claim 2 or claim 3 or claim 4 or claim 5 or claim 6 or claim 7 or claim 8 or claim 9 or claim. 10. The software real-time analysis method according to 10, wherein the basic block unit is between the first instruction of software or an arbitrary branch instruction and the next branch instruction, so that all parts of the software to be analyzed can be analyzed. The real-time analysis can always be performed.

請求項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 claim 1 or claim 2 or claim 3 or claim 4 or claim 5 or claim 6 or claim 7 or claim 8 or claim 9 or claim. 10. The software analysis method according to claim 10 or claim 11, wherein the program conversion means analyzes the contents of the software to be analyzed last time when converting the software, and includes the first instruction, last instruction of the function and subroutine, and the description of the software. The debug-dedicated instruction is automatically inserted into a place where the insertion of the debug-dedicated instruction is explicitly instructed in step (b).

請求項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 claim 1 or claim 2 or claim 3 or claim 4 or claim 5 or claim 6 or claim 7 or claim 8 or claim 9 or claim. 13. The software real-time analysis method according to claim 10, wherein the program conversion means outputs ROM information including insertion position information of the debug dedicated instruction and the NOP instruction to the debugger. Features.

請求項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 claim 1, claim 2, claim 3, claim 4, claim 5, claim 6, claim 7, claim 8, claim 9, or claim 10. 14. The software real-time analysis method according to claim 10 or claim 11 or claim 12 or claim 13, wherein the ROM information is read, the event ID information and the event information based on the setting information of the instructed debug event and the ROM information, Generates event detection timing specification information and performs instruction replacement processing with dedicated instructions for debugging on the ROM area, enabling real-time analysis that does not require reconfiguration of analysis target software by changing debug event settings It is characterized by that.

以上により、解析対象となるソフトウェアに対してデバッグ専用命令の挿入を行うことによって生じる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, reference numeral 100 denotes a processor (hereinafter referred to as a processor) that executes parallel instructions, 200 denotes a debugging device, 300 denotes program conversion means such as a compiler and assembler, 400 denotes a debugger, and 500 denotes a storage device.

プロセッサ100は、命令を記憶装置500から読み出す命令フェッチ制御部106、命令フェッチ制御部106によってフェッチされた命令を解読する実行命令解析部101、実行命令解読部101によってデバッグ専用命令の実行を検出しデバッグ装置200へ通知するデバッグ専用命令実行通知部102、割込みもしくは例外が発生したことを検出しデバッグ装置200へ通知する割込み発生通知部103、実行命令解読部101によって割込みもしくは例外の処理プログラム中に復帰命令の実行が検出されたことを検出しデバッグ装置200へ通知する復帰命令実行通知部104、1命令実行単位毎に実行完了を検出しデバッグ装置200へ通知する命令実行完了通知部105から構成される並列命令実行が可能なアーキテクチャを持ったプロセッサである。   The processor 100 detects the execution of the debug-dedicated instruction by the instruction fetch control unit 106 that reads an instruction from the storage device 500, the execution instruction analysis unit 101 that decodes the instruction fetched by the instruction fetch control unit 106, and the execution instruction decoding unit 101. A debug dedicated instruction execution notifying unit 102 for notifying the debugging device 200, an interrupt occurrence notifying unit 103 for detecting that an interrupt or exception has occurred and notifying the debugging device 200, and an execution instruction decoding unit 101 during an interrupt or exception processing program. Consists of a return instruction execution notifying unit 104 that detects that execution of a return instruction is detected and notifies the debug device 200, and an instruction execution completion notification unit 105 that detects execution completion and notifies the debug device 200 for each instruction execution unit. Architecture capable of parallel instruction execution Is a processor that Tsu.

デバッグ装置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 debugging device 200 decodes the event ID information and the event detection timing designation information notified from the debug dedicated instruction execution notifying unit 102, and performs a FIFO type buffer 204, an instruction execution count counter 205, and a debug dedicated instruction execution count counter 206 described later. The event information analysis unit 201 that performs control through the bank control unit 207 and the time information independent of the operation of the processor 100 are generated and the time information is notified to the FIFO buffer 204 and the event detection unit 209 described later. A time information generation unit 202; an interrupt detection control unit 203 that receives a notification from the interrupt generation notification unit 103 and the return instruction execution notification unit 104; detects an interrupt or exception occurrence and a return from interrupt or exception processing; and a time information generation Generated by the unit 202 The FIFO buffer 204 having a function of sequentially storing time information and simultaneously outputting information corresponding to a debug event to an event detection unit 209 described later, and the number of instruction executions in response to a notification from the instruction execution completion notification unit 105 An instruction execution counter 205 for counting, a debug dedicated instruction execution counter 206 for counting the number of executions of a debug dedicated instruction having the same ID based on the result decoded by the event information analysis unit 201, a FIFO buffer 204, The instruction execution number counter 205 and the debug dedicated instruction execution number counter 206 are handled as one bank, and the interrupt detection and the return from the interrupt processing detected by the interrupt detection control unit 203 in the debug device 200 in which a plurality of banks are mounted. Bank switching control starting from The bank control unit 207 and a pointer register that can be set to an arbitrary value are provided. When an interrupt is detected by the interrupt detection control unit 203, the FIFO type is used for the address area on the storage device 500 indicated by the pointer register. The contents of the buffer 204, the instruction execution count counter 205, and the debug dedicated instruction execution count counter 206 are written out (push operation), and at the same time, the contents of the pointer register are automatically increased, and from the interrupt processing detected by the interrupt detection control unit 203 In response to the return, the contents of the FIFO buffer 204, instruction execution counter 205, and debug dedicated instruction execution counter 206 saved in the storage device 500 based on the value indicated by the pointer register are read and returned (pop operation). Stack control unit 208 and event information analysis unit 201 Event detection unit 209 that detects an event based on the result of decoding and extracts the corresponding event ID information and time information, and debug information for notifying debugger 400 of information on the debug event detected by event detection unit 209 And a debug information output unit 210 for converting and outputting the data.

プログラム変換手段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 source program 301 to be analyzed, and a machine with optimization that reads the source program 301 and performs conversion to machine language while performing optimization so that the performance and code size are the best. A word block 302 and a basic block extractor 303 for extracting a section from the first instruction of the program or a branch instruction to the next branch instruction as one basic block for inserting a debug-dedicated instruction from the result of the machine language converter 302. As an inspection result of the instruction parallelism checking means 304 and the instruction parallelism checking means 304, the contents of each basic block extracted by the basic block extraction means 303 are read to check whether there is a vacancy in the instruction parallelism. If there is no vacancy in the instruction parallelism, only one or more basic blocks are included. If there is a vacancy in the instruction parallelism as a result of the inspection by the machine language reconversion means 305 that performs the optimization again so that the instruction parallelism exists in the instruction parallelism, and the instruction parallelism inspection means 304, the basic block extraction means 303 Instruction insertion means for inserting a debug-dedicated instruction or NOP instruction into a place where there is a vacancy in the instruction parallelism for the extracted basic block, otherwise, for the basic block obtained from the machine language reconversion means 305 306, an execution object 307 that is a result of processing of the instruction insertion unit 306 on the entire source program 301, and a ROM including position information of a debug-dedicated instruction or NOP instruction inserted by the instruction insertion unit 306 Information 308.

デバッガ400は、デバッグ装置200内のデバッグ情報出力部210より出力されたデバッグ情報を受信するデバッグ情報受信部401と、デバッグ情報受信部401にて受信したデバッグ情報を解読して表示するデバッグ情報表示部402と、操作部405からの指示に従って後述の命令挿入情報解析部404から得られるデバッグ専用命令およびNOP命令の挿入位置情報を元に記憶装置500上のデバッグ専用命令とNOP命令の命令置換処理を行うデバッグイベント設定変更制御部403と、プログラム変換装置300にて得られるROM情報308を読み込んでデバッグ専用命令およびNOP命令の挿入位置情報を得る命令挿入情報解析部404と、デバッガ400を使用する作業者とのユーザインターフェースの役割を果たす操作部405から構成される。   The debugger 400 includes a debug information receiving unit 401 that receives debug information output from the debug information output unit 210 in the debug device 200, and a debug information display that decodes and displays the debug information received by the debug information receiving unit 401. Instruction replacement processing of the dedicated debug instruction and the NOP instruction on the storage device 500 based on the debug dedicated instruction and the insertion position information of the NOP instruction obtained from the instruction insertion information analyzing unit 404 described later in accordance with the instruction from the unit 402 and the operation unit 405 A debug event setting change control unit 403 that performs the above, an instruction insertion information analysis unit 404 that reads ROM information 308 obtained by the program conversion apparatus 300 and obtains insertion position information of a dedicated debug instruction and a NOP instruction, and a debugger 400. Acting as a user interface with workers Consisting of work unit 405.

次に、本発明の動作に関して説明する。
図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 instruction code 600 is a machine language mnemonic, and there are event ID information 601 and event detection timing designation information 602 as arguments. Event detection timing designation information 602 includes direction designation information 603 indicating whether the event setting target instruction is in front of or behind the debug dedicated instruction 600, and an offset from the debug dedicated instruction 600 indicating the position of the event setting target instruction. Offset instruction number designation information 604 that is the number of instructions, debug dedicated instruction execution count designation information 605 that is a debug event generation condition, and debug that designates event ID information 601 and event detection timing designation information 602 to be treated as invalid at the time of execution It consists of dedicated instruction invalidation designation information 606.

図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 language conversion unit 302. A basic block example extracted by applying the machine language conversion result example 611 to the basic block extracting unit 303 becomes a basic block example 612. When the basic block example 612 is inspected by the instruction parallelism checking unit 304, the basic parallel block example 612 has no space in the instruction parallelism. Re-convert so that The result examples are a machine language reconversion result example 613 and a reconverted basic block example 614. Since the example 615 where the debug dedicated instruction can be inserted exists in the basic block example 614 after the reconversion, the instruction inserting unit 306 inserts the debug dedicated instruction or the NOP instruction into this place, and the execution object 307 is generated. This is stored in the storage device 500.

プロセッサ100は、記憶装置500から命令フェッチ制御部107を通じて実行する命令を取り込み、実行命令解析部101にてどのような命令かを判別しながら動作を行う。この実行命令解析部101にて命令フェッチ制御部107から取り込んだ命令がデバッグ専用命令コード600を示した場合、デバッグ専用命令無効化指定情報606の内容が偽であればデバッグ専用命令実行通知部102を通じてデバッグ装置200に対してデバッグ専用命令実行と引数であるイベントID情報601およびイベント検出タイミング指定情報602の通知を行い、命令フェッチ制御部107から取り込んだ命令が割込みもしくは例外処理からの復帰を行う命令を示していた場合は復帰命令実行通知部104を通じてデバッグ装置200に対して通知を行う。   The processor 100 fetches an instruction to be executed from the storage device 500 through the instruction fetch control unit 107, and performs an operation while determining an instruction in the execution instruction analysis unit 101. When the instruction fetched from the instruction fetch control unit 107 by the execution instruction analysis unit 101 indicates the debug dedicated instruction code 600, if the content of the debug dedicated instruction invalidation designation information 606 is false, the debug dedicated instruction execution notification unit 102 Through the debug device 200, the event ID information 601 and the event detection timing designation information 602 as arguments are notified to the debug device 200, and the instruction fetched from the instruction fetch control unit 107 returns from interrupt or exception processing. If an instruction is indicated, the debug apparatus 200 is notified through the return instruction execution notification unit 104.

図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 execution number counter 205 in response to execution of the debug dedicated instruction, and thereafter the counter value decreases by 0x1 every time the instruction is executed. I will do it. Then, the occurrence of a debug event is detected when the value of the instruction execution count counter 205 becomes 0x0, that is, when an instruction two steps after the debug-dedicated instruction is executed. As described above, when the direction designation information 603 notified when the debug dedicated instruction is executed indicates the rear side of the debug dedicated instruction, the contents of the offset instruction count designation information 604 are set in the instruction execution count counter 205 and at the same time the counter operation. Is activated. By detecting a debug event when the operation of the instruction execution counter 205 is valid and its value reaches 0x0, it is possible to set an event and detect a debug event for an instruction executed after a debug-dedicated instruction. It becomes.

図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 FIFO type buffer 204 always stores time information created by the time information generating unit 202 every time an instruction is executed.

図5に示した命令例が実行されると、デバッグ専用命令の実行を受けた時点でイベント情報解析部201が方向指定情報603およびオフセット命令数指定情報604よりFIFO型バッファの−2に存在するデバッグ専用命令よりも2つ前に実行された命令に対応する時刻情報がデバッグイベントの時刻情報として選択、抽出される。   When the instruction example shown in FIG. 5 is executed, the event information analysis unit 201 exists in the FIFO buffer −2 based on the direction designation information 603 and the offset instruction number designation information 604 when the execution of the debug-dedicated instruction is received. The time information corresponding to the instruction executed two times before the debug dedicated instruction is selected and extracted as the time information of the debug 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 direction designation information 603 notified when the debug dedicated instruction is executed indicates the front side of the debug dedicated instruction, the time information is extracted from the FIFO buffer 204 based on the contents of the offset instruction number designation information 604. Thus, it is possible to set an event and detect a debug event for an instruction executed before a debug-dedicated instruction.

図6の想定条件として、FIFO型バッファ204、命令実行回数カウンタ205、デバッグ専用命令実行回数カウンタ206を一つのバンクとしてこれを2つ備えたバンク制御部207、かつ、これらのバンクが共に充填されている場合に記憶装置500へバンクの内容を退避・復帰するためのスタック制御部208を備えたデバッグ装置200が存在するものとする。   As an assumption condition of FIG. 6, the bank control unit 207 including the FIFO buffer 204, the instruction execution count counter 205, and the debug dedicated instruction execution count counter 206 as one bank, and these banks are filled together. Assume that there is a debugging device 200 including a stack control unit 208 for saving / returning the contents of a bank to / from the storage device 500.

図6は、プログラム中のある基本ブロックにおける先頭命令620から命令が実行されて行き、基本ブロック内の命令621に対して割込みが発生して割込み処理先頭命令623へ分岐し、その割込み処理中の命令624にて多重に例外が発生し例外処理先頭命令626へ再び分岐し、例外処理からの復帰命令627で例外が発生する割込み処理内の命内の命令624へ復帰した後、基本ブロック内の割込みが発生した命令621へと復帰して基本ブロック最終命令622まで命令実行が行われる場合のものである。   FIG. 6 shows that an instruction is executed from the head instruction 620 in a certain basic block in the program, an interrupt is generated for the instruction 621 in the basic block, and branches to the interrupt processing head instruction 623. Multiple exceptions occur at the instruction 624 and branch back to the exception processing head instruction 626. After returning to the instruction 624 in the interrupt process in which an exception occurs at the return instruction 627 from exception processing, This is a case where execution returns to the basic block final instruction 622 after returning to the instruction 621 where the interrupt occurred.

まず、最初の割込みにおいて、バンク制御部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 bank control unit 207 switches the bank to be used from bank 0 to bank 1. Then, when the next exception occurs, the bank control unit 207 switches the bank to be used to bank 0 at the same time that the stack control unit 208 saves the contents of bank 0 to the storage device 500 in order to prevent destruction of the contents of bank 0. Next, at the time of return from exception processing, the stack control unit 208 restores the contents of the bank 0 saved in the storage device 500, and at the same time, the bank control unit 207 returns the used bank to the bank 1. Then, when returning from the last interrupt processing, the bank control unit 207 returns the bank to be used to bank 0, so that the FIFO buffer 204, the instruction execution counter 205, Since the contents of the debug dedicated instruction execution counter 206 are prevented from being destroyed, it is possible to continue to maintain the debug event detectable state even in a situation where a branch due to an interrupt or exception that occurs asynchronously occurs.

なお、バンク制御部207およびスタック制御部208は、いずれかのみが存在する場合であっても図6の例と同様の効果を得ることが可能であり、実際のハードウェアコストや処理性能といった面で利用形態を選択することが可能である。   Note that even if only one of the bank control unit 207 and the stack control unit 208 is present, it is possible to obtain the same effect as the example of FIG. 6, such as actual hardware cost and processing performance. It is possible to select the usage form.

以上により、解析対象となるソフトウェアに対して前記デバッグ専用命令の挿入を行うことによって生じる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.

本発明のリアルタイム解析方法の構成を説明するブロック図The block diagram explaining the structure of the real-time analysis method of this invention プロセッサが備えるデバッグ専用命令の仕様例を示す図The figure which shows the example of the specification of the debug exclusive instruction which the processor has デバッグ専用命令もしくはデバッグ専用命令置換用NOP命令の挿入を説明するプログラム変換図Program conversion diagram explaining insertion of debug-specific instructions or debug-specific instruction replacement NOP instructions デバッグ専用命令よりも後ろにある後続命令に対するイベント設定が行われている場合の動作を例示した図The figure which illustrated the operation when the event setting is done for the succeeding instruction after the debug dedicated instruction デバッグ専用命令よりも前にある後続命令に対するイベント設定が行われている場合の動作を例示した図The figure which illustrated the operation when the event setting is done for the subsequent instruction before the debug-dedicated instruction 非同期的に発生する想定外の割込みや例外による分岐発生時の動作を例示した図Diagram illustrating the operation when a branch occurs due to an unexpected interrupt or exception that occurs asynchronously

符号の説明Explanation of symbols

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 SYMBOLS 100 ... Processor 101 ... Execution instruction decoding part 102 ... Debug exclusive instruction execution notification part 103 ... Interrupt generation notification part 104 ... Return instruction execution notification part 105 ... Instruction execution completion notification part 106 ... Instruction fetch control unit 200 ... Debug device 201 ... Event information analysis unit 202 ... Time information generation unit 203 ... Interrupt detection control unit 204 ... FIFO type buffer 205 ... Instruction execution Number-of-times counter 206 ... Dedicated instruction execution number counter for debugging 207 ... Bank control unit 208 ... Stack control unit 209 ... Event detection unit 210 ... Debug information output unit 300 ... Program conversion means 301 ..Source program 302 ... Machine language conversion means 303 ... Basic block extraction means 304 ... Instruction parallelism checking means 305... Machine language reconversion means 306... Instruction insertion means 307... Execution object 308... ROM information 400 ... debugger 401 ... debug information receiving unit 402. Debug information display unit 403 ... Debug event setting change control unit 404 ... Instruction insertion information analysis unit 405 ... Operation unit 500 ... Storage device 600 ... Debug dedicated instruction code 601 ... Event ID information 602 ... Event detection timing designation information 603 ... Direction designation information 604 ... Offset instruction number designation information 605 ... Debug dedicated instruction execution count designation information 606 ... Debug dedicated instruction invalidation designation information 610 Source program example 611 Machine language conversion result example 612 Basic block example 613 ..Example of machine language re-conversion result 614: Example of basic block after re-conversion 615 ... Example of location where debug dedicated instruction can be inserted 620 ... Basic block head instruction 621 ... Instruction in basic block where interrupt is entered 622... Basic block final instruction 623... Interrupt processing head instruction 624... Interrupt instruction in which exception occurs 626... Exception processing head instruction 627.

Claims (13)

解析対象となるソフトウェアにデバッグイベントを発生させるためのデバッグ専用命令を挿入しその実行履歴を参照するソフトウェアのリアルタイム解析方法において、前記デバッグ専用命令と命令実行状態の通知機能を備えた並列命令実行を行うプロセッサと、前記デバッグ専用命令の実行通知情報に基づいてデバッグイベントの発生タイミングを制御し、デバッグイベントの発生時に解析に必要なデバッグ情報を出力するデバッグ装置と、命令並列度が空いている箇所に前記デバッグ専用命令を挿入するためのROM領域を確保し、前記ROM領域の位置情報をROM情報として出力するプログラム変換手段と、指示されたデバッグイベントの設定情報と前記ROM情報に基づいて前記ROM領域に対してデバッグ専用命令への命令置換処理を行うデバッガから構成される、前記デバッグ専用命令の挿入によるROMサイズの変化、最適度の低下および性能の劣化が発生しないことを特徴とするソフトウェアのリアルタイム解析方法。   In a software real-time analysis method for inserting a debug-dedicated instruction for generating a debug event in software to be analyzed and referring to its execution history, the parallel instruction execution having the debug-dedicated instruction and instruction execution state notification function is performed. The processor to be executed, the debug device for controlling the timing of occurrence of the debug event based on the execution notification information of the debug dedicated instruction, and outputting the debug information necessary for the analysis when the debug event occurs, and the portion where the instruction parallelism is free Secures a ROM area for inserting the debug-dedicated instructions, and outputs program location means for outputting the ROM area position information as ROM information; the ROM based on the setting information of the instructed debug event and the ROM information; Replace instruction with dedicated debug instruction for area It consists debugger performs management, the debugging dedicated instruction insertion changes in ROM size by real-time analysis method software, wherein the reduction and performance deterioration of the optimum degree does not occur. 引数として無効化情報、イベントID情報およびイベント検出タイミング指定情報を持ち、実行時に前記無効化情報にて無効化の指定が行われていない場合にデバッグ装置に対して引数の内容と実行発生を通知することを特徴とする前記デバッグ専用命令を備えた請求項1記載のソフトウェアのリアルタイム解析方法。   Has invalidation information, event ID information, and event detection timing designation information as arguments, and notifies the debug device of the contents of the argument and execution occurrence when invalidation is not specified in the invalidation information at the time of execution The software real-time analysis method according to claim 1, further comprising the debug-dedicated instruction. 前記デバッグ専用命令が全てのプロセッサ資源に対して影響を与えることなく1マシンサイクルで実行が完了することを特徴とする請求項1または請求項2のいずれかに記載のソフトウェアのリアルタイム解析方法。   3. The software real-time analysis method according to claim 1, wherein execution of the debug-dedicated instruction is completed in one machine cycle without affecting all processor resources. 前記デバッグ装置が、前記イベントID情報と前記イベント検出タイミング指定情報を記憶すると同時に、これらの情報と独立して独自に生成する時刻情報を元にしてデバッグ情報を生成し出力することを特徴とする請求項1または請求項2または請求項3に記載のソフトウェアのリアルタイム解析方法。   The debug device stores the event ID information and the event detection timing designation information, and at the same time generates and outputs debug information based on time information independently generated from the information. The real-time analysis method for software according to claim 1, claim 2, or claim 3. 前記デバッグ装置が、前記プロセッサからの命令実行完了通知を受ける度にそのときの時刻情報を随時記憶するFIFO型バッファを備え、前記デバッグ専用命令実行時に通知される前記デバッグイベント検出タイミング指定情報に基づいて、過去に実行された任意の命令に対応する時刻情報を前記FIFO型バッファより抽出すると同時に、デバッグイベントの発生検出を行うことで、前記デバッグ専用命令よりも過去に実行された命令に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする請求項1または請求項2または請求項3または請求項4に記載のソフトウェアのリアルタイム解析方法。   Each time the debug device receives an instruction execution completion notification from the processor, it includes a FIFO buffer for storing time information at that time, and based on the debug event detection timing designation information notified when the debug dedicated instruction is executed. In addition, by extracting time information corresponding to an arbitrary instruction executed in the past from the FIFO type buffer and simultaneously detecting occurrence of a debug event, a debug event for an instruction executed in the past rather than the debug dedicated instruction is detected. The real-time analysis method for software according to claim 1, wherein the setting and occurrence detection are enabled. 前記デバッグ装置が、前記プロセッサからの命令実行完了通知を受ける度に動作する第1のカウンタを備え、前記デバッグ専用命令実行時に通知される前記デバッグイベント検出タイミング情報に基づいて、前記デバッグ専用命令の実行から任意指定回数後の命令実行が行われた時にデバッグイベント発生検出を行うことで、前記デバッグ専用命令よりも未来に実行される任意の後続命令に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5に記載のソフトウェアのリアルタイム解析方法。   The debug device includes a first counter that operates every time an instruction execution completion notification is received from the processor, and based on the debug event detection timing information notified when the debug dedicated instruction is executed, By detecting the occurrence of a debug event when an instruction is executed an arbitrary number of times after execution, it is possible to set and detect the occurrence of a debug event for any subsequent instruction executed in the future rather than the dedicated instruction for debugging. The software real-time analysis method according to claim 1, claim 2, claim 3, claim 4, or claim 5. 前記プロセッサ上で条件分岐を含む全ての分岐命令が実行された際に、前記FIFO型バッファおよび前記第1のカウンタの内容を無効化し、ソフトウェアの不具合などによる意図しない分岐動作発生による誤ったデバッグイベント発生検出を行わないようにすることで、ソフトウェアの不具合に影響されず如何なる状況下でも正確なデバッグイベント発生検出を可能とすることを特徴とする請求項5または請求項6に記載のソフトウェアのリアルタイム解析方法。   When all branch instructions including conditional branches are executed on the processor, the contents of the FIFO buffer and the first counter are invalidated, and an erroneous debug event due to an unintended branch operation due to a software malfunction or the like 7. The software real-time according to claim 5 or 6, wherein the occurrence of the debug event can be accurately detected under any circumstances by not performing the occurrence detection. analysis method. 前記デバッグ装置が、前記デバッグ専用命令の実行通知を受ける度に動作する第2のカウンタとイベントID比較機構を備え、イベント検出タイミング情報により指定される任意のイベントIDを持つデバッグ専用命令が任意の指定回数連続実行された場合に対するデバッグイベントの設定と発生検出を可能とすることを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7に記載のソフトウェアのリアルタイム解析方法。   The debug device includes a second counter and an event ID comparison mechanism that are operated each time receiving an execution notification of the debug-dedicated instruction, and a debug-dedicated instruction having an arbitrary event ID specified by event detection timing information is arbitrary The debug event can be set and detected when the specified number of times of continuous execution is performed. The claim 1, the claim 2, the claim 3, the claim 4, the claim 5, the claim 6, or the claim 8. The software real-time analysis method according to 7. 前記デバッグ装置が、前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタにて構成される1つのバンクを複数備え、前記プロセッサ上で割込みまたは例外の発生時および割込みまたは例外の処理ルーチンからの復帰時において、これらのバンクを切替制御することによって割込みや例外が非同期的に発生する状況下でもリアルタイム解析を継続可能とすることを特徴とする請求項8記載のソフトウェアのリアルタイム解析方法。   The debug device includes a plurality of banks including the FIFO type buffer, the first counter, and the second counter, and generates an interrupt or exception on the processor and an interrupt or exception processing routine. 9. The software real-time analysis method according to claim 8, wherein, at the time of recovery, real-time analysis can be continued even under a situation in which interrupts and exceptions occur asynchronously by switching control of these banks. 前記デバッグ装置が、前記プロセッサにおける割込みまたは例外の発生時に、前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタの内容を任意指定可能なポインタが示す記憶装置のアドレス領域に対して退避し、前記プロセッサにおける割込みまたは例外の処理ルーチンからの復帰時に、前記ポインタが示す記憶装置のアドレス領域より退避された前記FIFO型バッファ,前記第1のカウンタおよび前記第2のカウンタの内容を復帰させるスタック制御機構を備えることによって、非同期的に割込みや例外が発生する状況下でもリアルタイム解析を継続可能とすることを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9に記載のソフトウェアのリアルタイム解析方法。   When the debug device generates an interrupt or exception in the processor, the contents of the FIFO buffer, the first counter, and the second counter are saved in an address area of a storage device indicated by a pointer that can be arbitrarily designated. At the time of return from the interrupt or exception processing routine in the processor, the contents of the FIFO buffer, the first counter, and the second counter saved from the address area of the storage device indicated by the pointer are restored. 3. The real-time analysis can be continued even in a situation where an interrupt or an exception occurs asynchronously by providing a stack control mechanism, or claim 3 or claim 4, or claim 4 or claim 5 or claim 6 or claim 7 or claim 8 or claim 9 Real-time analysis method of the mounting of the software. 前記ソフトウェアの先頭命令もしくは任意の分岐命令から次の分岐命令までの命令区間を1つの基本ブロックとして扱う前記プログラム変換手段が、前記デバッグ専用命令の挿入を除いた状態で前記解析対象のソフトウェアを最適化を行った結果に対して、前記基本ブロック毎に命令並列度が空いている箇所に対して前記デバッグ専用命令を挿入するためのROM領域を確保するためにNOP命令を挿入することで、前記解析対象となるソフトウェアの全ての箇所に対して常にデバッグイベントの設定が任意に可能な状態を維持することを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10に記載のソフトウェアのリアルタイム解析方法。   The program conversion means that handles the instruction section from the first instruction of the software or an arbitrary branch instruction to the next branch instruction as one basic block optimizes the analysis target software in a state excluding the insertion of the debug dedicated instruction. As a result of the conversion, by inserting a NOP instruction to secure a ROM area for inserting the debug-dedicated instruction at a place where the instruction parallelism is vacant for each basic block, 6. A state in which a debug event can be arbitrarily set is always maintained for all portions of software to be analyzed. 6. The claim 3, the claim 4, or the claim 5 Or real-time solution of software according to claim 6 or claim 7 or claim 8 or claim 9 or claim 10 Method. 前記プログラム変換手段が、前回解析対象となるソフトウェアの変換時にその内容を解析し、関数やサブルーチンの先頭命令、最後尾命令および前記ソフトウェアの記述上にて明示的に前記デバッグ専用命令の挿入が指示された箇所に対して自動的に前記デバッグ専用命令の挿入を行うことを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10または請求項11に記載のソフトウェアのリアルタイム解析方法。   The program conversion means analyzes the content of the software to be analyzed last time, and explicitly inserts the debug-dedicated instruction on the first instruction, last instruction of the function or subroutine and the description of the software. 5. The debug-specific instruction is automatically inserted into a designated location, or claim 2, or claim 3, or claim 4, or claim 5 or claim 6 or claim 7 or The software real-time analysis method according to claim 8, claim 9, claim 10, or claim 11. 前記プログラム変換手段が、前記デバッグ専用命令と前記NOP命令の挿入位置情報を含んだROM情報を前記デバッガに対して出力することを特徴とする請求項1または請求項2または請求項3または請求項4または請求項5または請求項6または請求項7または請求項8または請求項9または請求項10または請求項11または請求項12に記載のソフトウェアのリアルタイム解析方法。   4. The program conversion unit outputs ROM information including insertion position information of the debug dedicated instruction and the NOP instruction to the debugger. The software real-time analysis method according to claim 4 or claim 5 or claim 6 or claim 7 or claim 8 or claim 9 or claim 10 or claim 11 or claim 12.
JP2003354442A 2003-10-15 2003-10-15 Software real-time analysis method Pending JP2005122329A (en)

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)

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

Cited By (1)

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