JP2010044577A - Debugging device and method - Google Patents
Debugging device and method Download PDFInfo
- Publication number
- JP2010044577A JP2010044577A JP2008208020A JP2008208020A JP2010044577A JP 2010044577 A JP2010044577 A JP 2010044577A JP 2008208020 A JP2008208020 A JP 2008208020A JP 2008208020 A JP2008208020 A JP 2008208020A JP 2010044577 A JP2010044577 A JP 2010044577A
- Authority
- JP
- Japan
- Prior art keywords
- character string
- program
- string information
- debugging
- 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.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、デバッグ装置及びデバッグ方法に関する。 The present invention relates to a debugging device and a debugging method.
従来より、SoC(System On a Chip)等の半導体装置として、1以上の機能ブロックのハードウェア(以下、H/Wと略す)回路を含み、半導体装置全体の動作はソフトウエアプログラム(以下、S/Wと略す)である制御S/Wにより実行が規定されるような半導体装置がある。このような半導体装置において、H/W回路と制御S/Wが同時に並行して開発される場合は、H/W回路が開発される前に、制御S/Wの動作確認を行うために、H/W回路に代えて、H/W回路のモデル(以下、H/Wモデルという)を含むシミュレーションプログラム、すなわちシミュレータが用いられる。 Conventionally, a semiconductor device such as an SoC (System On a Chip) includes one or more functional block hardware (hereinafter abbreviated as H / W) circuits, and the operation of the entire semiconductor device is a software program (hereinafter referred to as S). There is a semiconductor device whose execution is regulated by a control S / W that is abbreviated as / W). In such a semiconductor device, when the H / W circuit and the control S / W are simultaneously developed in parallel, before the H / W circuit is developed, in order to check the operation of the control S / W, Instead of the H / W circuit, a simulation program including a model of the H / W circuit (hereinafter referred to as an H / W model), that is, a simulator is used.
また、H/Wモデルをシミュレータに組み込む場合、そのH/Wモデルのプログラム(以下、H/Wモデルプログラムという)と制御S/Wとを協調させて動作確認を行う必要がある。その場合、シミュレータはネイティブデバッガでデバッグされ、制御S/Wはクロスデバッガでデバッグされることになる。 In addition, when an H / W model is incorporated in a simulator, it is necessary to check the operation by coordinating the H / W model program (hereinafter referred to as the H / W model program) and the control S / W. In this case, the simulator is debugged with a native debugger, and the control S / W is debugged with a cross debugger.
このため、制御S/W中のある命令によって実行されるあるH/Wモデルプログラム中の対応部分の動作を確認する場合には、デバッグを行う者は、その命令と、その命令に対応する部分のAPI情報を予め対応付けておき、その命令と、そのAPI情報の部分にブレークポイントを設定する、等の繁雑な作業をしながら、動作確認を行わなければならなかった。 For this reason, when checking the operation of the corresponding part in a certain H / W model program executed by a certain instruction in the control S / W, the person who performs the debugging must confirm that instruction and the part corresponding to that instruction. The API information must be associated in advance, and the operation must be confirmed while performing complicated operations such as setting a breakpoint at the command and the API information portion.
また、S/WとH/Wの協調検証に関する技術も提案されている(例えば、特許文献1参照)。
しかし、その提案では、H/WモデルプログラムとS/Wとを協調して検証する方法は開示されているが、2つのプログラムのデバッグをするときの、デバッグのし易さについての具体的な方法については、何ら提案されていない。
However, the proposal discloses a method for verifying the H / W model program and S / W in cooperation with each other. However, when debugging two programs, the concrete ease of debugging is disclosed. No method has been proposed.
そこで、本発明は、H/Wモデルプログラムと制御S/Wの2つのプログラムを同時にデバッグするときに、デバッグし易いデバッグ装置及びデバッグ方法を提供することを目的とする。 Accordingly, an object of the present invention is to provide a debugging device and a debugging method that are easy to debug when simultaneously debugging two programs of an H / W model program and a control S / W.
本発明の一態様によれば、チップ上に設けられる機能ブロックを動作させるための動作プログラムのデバッグを行うデバッグ装置であって、シミュレータに含まれる定義コードであって前記機能ブロックの所定の処理を実行するための前記定義コードの文字列情報を生成し、前記文字列情報を送信するための文字列情報送信プログラムを生成して、生成された前記文字列情報と生成された前記文字列情報送信プログラムとを、前記定義コードに付加する付加処理部と、前記動作プログラム中の命令と、前記所定の処理との命令対応情報を記憶する命令対応情報記憶部と、前記命令対応情報に基づいて、前記定義コードの文字列情報を取得する文字列情報取得部と、取得した前記定義コードの文字列情報を、指定された命令と合成して表示するための合成表示部と、を有するデバッグ装置を提供することができる。 According to one aspect of the present invention, there is provided a debugging device for debugging an operation program for operating a functional block provided on a chip, which is a definition code included in a simulator and performs predetermined processing of the functional block. Generate character string information of the definition code to be executed, generate a character string information transmission program for transmitting the character string information, and transmit the generated character string information and the generated character string information Based on the instruction correspondence information, an addition processing unit that adds a program to the definition code, an instruction in the operation program, an instruction correspondence information storage unit that stores instruction correspondence information with the predetermined process, A character string information acquisition unit that acquires character string information of the definition code, and the acquired character string information of the definition code are combined with a specified instruction and displayed. A composite display of the eye, it is possible to provide a debugging device having a.
本発明によれば、H/Wモデルプログラムと制御S/Wの2つのプログラムを同時にデバッグするときに、デバッグし易いデバッグ装置及びデバッグ方法を実現することができる。 According to the present invention, it is possible to realize a debugging device and a debugging method that are easy to debug when simultaneously debugging two programs of an H / W model program and a control S / W.
以下、図面を参照して本発明の実施の形態を説明する。 Embodiments of the present invention will be described below with reference to the drawings.
まず図1に基づき、本実施の形態に係わるデバッグ装置の構成を説明する。図1は、本実施の形態に係わるデバッグ装置の構成を示す構成図である。 First, the configuration of the debugging apparatus according to the present embodiment will be described with reference to FIG. FIG. 1 is a configuration diagram showing a configuration of a debugging apparatus according to the present embodiment.
図1に示すように、デバッグ装置1は、パーソナルコンピュータ(以下、PCという)、サーバ、ワークステーション等のコンピュータである。デバッグ装置1は、コンピュータ本体11と、表示装置12と、ハードディスク装置等の記憶装置13とを含んで構成される。以下に説明する各種処理は、ソフトウエアプログラムによって実行され、そのソフトウエアプログラムは記憶装置13に記憶され、コンピュータ本体11内のCPU(以下、ホストCPUという)11aによって読み出されて実行される。表示装置12の表示画面12a上には、プロセッサの開発者等のデバッグを行うユーザが各種処理の実行を指示し、かつ処理結果を表示するためのグラフィカルユーザインターフェース(GUI)が表示される。
ユーザの開発対象となるチップ(SoC)は、ユーザが定義した1以上の機能ブロック、すなわちH/W回路を有し、ユーザによって定義あるいは記述されたユーザプログラム(チップ上のCPUによって実行される)によって、チップ全体の動作が決定される、構成変更可能なチップである。ユーザプログラムは、1以上の機能ブロックのH/W回路の動作を制御する制御S/Wである。制御S/Wは、1以上の機能ブロックの動作を含めて、チップ全体の動作を制御する動作プログラムである。1以上の機能ブロックは、それぞれの所定の機能を有し、各機能はモデル化されてソフトウエアプログラムで記述される。すなわち、各機能ブロックは、所定の機能を実現するための所定の処理を実行するための定義コードにより表現されている。ユーザは、デバッグ装置1を用いて、SoCのプロセッサである構成変更可能なプロセッサの制御S/Wと、H/W回路のH/Wモデルのプログラムとのデバッグを行うことができる。
As shown in FIG. 1, the
The chip (SoC) to be developed by the user has one or more functional blocks defined by the user, that is, H / W circuits, and a user program defined or described by the user (executed by the CPU on the chip). This is a reconfigurable chip in which the operation of the entire chip is determined. The user program is a control S / W that controls the operation of the H / W circuit of one or more functional blocks. The control S / W is an operation program that controls the operation of the entire chip including the operation of one or more functional blocks. One or more functional blocks have respective predetermined functions, and each function is modeled and described by a software program. That is, each functional block is expressed by a definition code for executing a predetermined process for realizing a predetermined function. The user can debug the control S / W of the reconfigurable processor that is the processor of the SoC and the H / W model program of the H / W circuit by using the
図2は、デバッグ装置1に含まれるソフトウエアの構成を説明するための図である。デバッグ装置1は、ホストCPU11a上で実行される、ネイティブコンパイラ21、ネイティブデバッガ22,クロスコンパイラ23、クロスデバッガ24、及びターゲットシミュレータ25を含む。これらのソースプログラムは、記憶装置13に記憶され、コンパイルされた実行プログラムが、ホストCPU11a上で実行される。さらに、デバッグ装置1は、ターゲットシミュレータ25上で実行されるユーザプログラム実行ファイル26も含んでいる。
FIG. 2 is a diagram for explaining a configuration of software included in the
ユーザプログラムは、対象チップ上で実行される、ユーザが定義あるいは記述したプログラムで、構成変更可能な特定のチップ上で実行される制御S/Wのプログラム、すなわち動作プログラムである。ユーザプログラムは、専用命令を含んで記述される。ユーザプログラム実行ファイル26は、ユーザプログラムの実行ファイル形式のプログラムである。
The user program is a program defined by or written by the user that is executed on the target chip, and is a control S / W program that is executed on a specific chip whose configuration can be changed, that is, an operation program. The user program is described including dedicated instructions. The user
各機能ブロックの機能をモデル化して記述されたH/Wモデルプログラムは、各H/W毎に、ユーザが定義したプログラムで、複数ある。
ターゲットシミュレータ25は、これらの1以上のH/Wモデルプログラム27と、ターゲットシミュレータ25のプログラム本体25a(図3参照)と合わせて、コンパイルされて生成された実行ファイルである。ターゲットシミュレータ25は、各H/Wモデルプログラム27を実行させて動作のシミュレートをすることができる。従って、ターゲットシミュレータ25は、1以上のH/Wモデルを含む実行ファイル形式のシミュレーションプログラムである。
There are a plurality of H / W model programs described by modeling the function of each functional block, which are defined by the user for each H / W.
The
ネイティブコンパイラ21とネイティブデバッガ22は、それぞれホストCPU11a上で実行されるコンパイラとデバッガである。
クロスコンパイラ23、クロスデバッガ24、及びターゲットシミュレータ25は、ネイティブコンパイラ21によりコンパイルされた、ホストCPU11a上で実行可能な実行形式のプログラムである。
The
The
クロスコンパイラ23は、ユーザプログラムをコンパイルしてユーザプログラム実行ファイル26を生成するプログラムである。ユーザプログラムは、専用命令を含んで記述されるため、クロスコンパイラ23によってのみコンパイル可能である。
The
また、ユーザプログラム実行ファイル26は、ターゲットシミュレータ25によってのみ実行可能であり、H/Wモデルプログラム27は、ターゲットシミュレータ25によってシミュレーションが可能であり、さらにクロスデバッガ24によってデバッグ可能である。
The user
クロスデバッガ24は、ユーザプログラムをデバッグするときに、ターゲットシミュレータ25と通信あるいは情報のやりとりをして、後述するような合成表示を行うことができる。
When debugging the user program, the
図3は、ターゲットシミュレータ実行ファイル25の生成処理の流れを説明するためのフローチャートである。
まず、図3に示すように、H/Wモデルプログラム27に対して、付加処理プログラム31によって、所定の付加情報を付加する付加処理が行われる。H/Wモデルプログラム27は、ソースプログラムであり、複数のH/Wモデルプログラム27がある場合は、それぞれについて付加処理が行われる。付加処理の内容については、後述する。
FIG. 3 is a flowchart for explaining the flow of processing for generating the target
First, as shown in FIG. 3, an additional process for adding predetermined additional information is performed on the H /
付加処理の結果、クロスデバッガ用H/Wモデルプログラム27aが生成される。クロスデバッガ用H/Wモデルプログラム27aも、ソースプログラムである。
As a result of the additional processing, a cross debugger H /
生成されたクロスデバッガ用H/Wモデルプログラム27aは、開発対象のプロセッサモデルを含むターゲットシミュレータ本体のプログラム25aと組み合わされて、ホストマシン用のネイティブコンパイラ21によりコンパイルされ、ターゲットシミュレータ実行ファイル25が生成される。
The generated cross-debugger H / W
次に、付加処理プログラム31による付加処理について、例を挙げて説明する。
図4は、H/Wモデルプログラム27の例を示す図である。図5は、付加処理により生成されたクロスデバッガ用H/Wモデルプログラム27aの例を示す図である。
図4には、例として、「Simple HWE」というソースファイル名のH/Wモデルプログラム27が示されている。図4に示すように、H/Wモデルプログラム27は、クラス名は「HWE」であり、それぞれメソッド名「writeCntlBus」と「readCntlBus」の、2つのメソッドを含むプログラムである。
Next, additional processing by the
FIG. 4 is a diagram illustrating an example of the H /
FIG. 4 shows an H /
図4に示すH/Wモデルプログラム27は、付加処理部である付加処理プログラム31によって、所定の付加情報を付加する処理が施され、その結果、図5のクロスデバッガ用H/Wモデルプログラム27aが生成される。図5に示すように、クロスデバッガ用H/Wモデルプログラム27aは、所定の付加情報として、構造体定義部51と、メソッド文字列部52,53と、メソッド内容送信メソッド部54とが、H/Wモデルプログラム27のコード部の前に、付加されたプログラムである。
The H /
構造体定義部51は、構造体として記述されたメソッド文字列部52,53の構造体の定義が記述された定義情報を含む。メソッド文字列部52,53は、2つのメソッド「writeCntlBus」と「readCntlBus」の文字列情報を含む。メソッド内容送信メソッド部54は、メソッド文字列部52,53の文字列情報を送信するためのメソッドの情報を含む。これらの付加情報が、H/Wモデルプログラム27の前に付加されたのが、クロスデバッガ用H/Wモデルプログラム27aである。
The
図3の付加処理プログラム31の処理内容について、図6を用いて説明する。
図6は、付加処理部としての付加処理プログラム31の処理内容の例を示すフローチャートである。付加処理プログラム31は、記憶装置13に記憶されており、ホストCPU11aにより読み出されて実行される。
The processing contents of the
FIG. 6 is a flowchart showing an example of processing contents of the
H/Wモデルプログラム27に対する付加処理を実行するとき、ユーザは、H/Wモデルプログラム27のソースファイル名と、H/Wモデルプログラム27に含まれるクラス名の情報を、ホストCPU11aに与える。ここでは、ソースファイル名として、「Simple HWE」が、クラス名として「HWE」が与えられたとする。
When executing the additional processing for the H /
従って、ホストCPU11aは、図4の場合、その入力されたソースファイル名「Simple HWE」とクラス名「HWE」の情報を引数として受け取る(ステップS1)。
Accordingly, in the case of FIG. 4, the
ホストCPU11aは、受け取ったソースファイル名とクラス名とに基づいて、対象ファイル中のメソッドを文字列情報として取得する(ステップS2)。このとき、H/Wモデルプログラム27は、「クラス名::メソッド名」というルールに基づいて記述されているので、まず、2つのメソッドが文字列情報として取得される。
The
具体的には、図4において、クラス名「HWE」と、メソッド名「writeCntlBus」とから、コード部41の文字列情報が取得され、クラス名「HWE」と、メソッド名「readCntlBus」とから、コード部42の文字列情報が取得される。メソッド名は、ユーザによって予め定義されているので、ホストCPU11aは、「クラス名::writeCntlBus」と、「クラス名::readCntlBus」の2つのメソッドの文字列情報を、取得することができる。
Specifically, in FIG. 4, the character string information of the
次に、ホストCPU11aは、取得した文字列情報を、構造体配列として定義する(ステップS3)。ここでは、構造体配列は、文字列を含む構造体の配列である。
Next, the
そして、ホストCPU11aは、定義された構造体配列から文字列情報を、要求があったときに送信するためのメソッド内容送信メソッドを定義する(ステップS4)。図5では、そのメソッド内容送信メソッドは、メソッド内容送信メソッド部54において「getFuncLine」として記述されている。すなわち、ステップS4で定義されて生成されたメソッド内容送信メソッドのコードは、クロスデバッガ24からの要求に応じて、メソッド内容の文字列をクロスデバッガ24へ送信するコードである。
Then, the
ホストCPU11aは、定義した構造体配列とメソッド内容送信メソッドを含む付加情報を、H/Wモデルプログラム27に追加する(ステップS5)。
ステップS5の結果、図5に示すように、H/Wモデルプログラム27の部分の前に、構造体定義部51と、ステップS3で定義されて生成された文字列情報の構造体配列部52,53と、ステップS4で定義されて生成されたメソッド内容送信メソッド部54が、追加されて、クロスデバッガ用H/Wモデルプログラム27aが生成される。
The
As a result of step S5, as shown in FIG. 5, before the portion of the H /
クロスデバッガ用H/Wモデルプログラム27aは、ホストマシン用ネイティブコンパイラ21でコンパイルされると、上述した付加情報を含む実行形式のターゲットシミュレータ実行ファイル25となる。
When the host debugger
以上のように、付加処理プログラム31は、ターゲットシミュレータ25に含まれる各機能ブロックの所定の処理を実行するための定義コードの文字列情報を生成する。そして、付加処理プログラム31は、その文字列情報を送信するための文字列情報送信プログラムとしてのメソッド内容送信メソッド部54を生成して、生成された文字列情報と生成された文字列情報送信プログラムとを、各機能ブロックの定義コードに付加する処理を実行する。
As described above, the
ターゲットシミュレータ実行ファイル25は、コード部41、42のメソッド文字列部52,53と、メソッド内容送信メソッド部54とを含むようにしたので、クロスデバッガ24からの、文字列の送信要求コマンドを受信すると、メソッド内容送信メソッド部54のメソッドを実行させて、コード部41、42のメソッド文字列部52,53の情報を、クロスデバッガ24へ送信する。
Since the target
そして、クロスデバッガ24は、受信したメソッド文字列部52,53の情報を、ユーザプログラム26中に含めて表示するミックス表示処理を行う。
Then, the
図7は、クロスデバッガ24を利用して、ユーザプログラム26をデバッグするために表示装置12に表示されている画面の例を示す図である。図8は、ユーザプログラム26中のユーザによって指定された命令に対応する、H/Wモデルプログラム27が表示されている画面の例を示す図である。
FIG. 7 is a diagram showing an example of a screen displayed on the
例えば、図7のように、表示装置12の表示画面12a上に、ユーザプログラム26の一部が表示されている状態で、ユーザが、表示されているある行(ここでは「stcb(a[0],HWE_CBBASE);」の行)に対応するH/Wモデルプログラムの表示の指定を、所定の操作によって、行うと、図8の画面が表示装置12の表示画面12a上に表示される。
For example, as shown in FIG. 7, in a state where a part of the
図7における印61の指す行についてのミックス表示がユーザにより指示されたとすると、図8に示すように、行「stcb(a[0],HWE_CBBASE);」の下に、対応するH/Wモデルプログラムのソースコードを含むソースコード表示部62が表示される。言い換えると、ユーザの指定した行「stcb(a[0],HWE_CBBASE);」と次の行「ldcb(b[0],HWE_CBBASE);」の間に、行「stcb(a[0],HWE_CBBASE);」に対応するH/Wモデルプログラムのソースコードが追加され合成される。
ユーザは、他の行についても、同様に指定すると、同様に対応するH/Wモデルプログラムのソースコードをミックス表示させることができる。
If the user has instructed the mix display for the line indicated by the
If the user designates other lines in the same manner, the source code of the corresponding H / W model program can be displayed in a mixed manner.
次に、そのミックス表示のためのクロスデバッガ24における処理内容について説明する。
クロスデバッガ24における処理の説明の前に、モデル識別テーブルと命令API対応テーブルの2つのテーブルデータについて説明する。
Next, processing contents in the
Before describing the processing in the
ネイティブコンパイラ21が、クロスコンパイラ23と、クロスデバッガ24と、ターゲットシミュレータ25をコンパイルするとき、コンパイルの対象である制御S/WとH/Wモデルプログラムのコンフィギュレーションデータが生成される。コンフィギュレーションデータは、複数のH/Wモデルプログラムのそれぞれが、ホストCPU11aの制御バスアドレス上のどのアドレスの範囲にあるかの情報を含んでいる。よって、各H/Wモデルすなわち各機能ブロックは、制御バスアドレスのデータに基づいて区別すなわち識別することができる。
When the
そこで、そのコンフィギュレーションデータに基づいて、図9に示すようなテーブルが予め作成される。図9は、モデル識別テーブルの例を示す図である。モデル識別テーブル71は、記憶装置13に記憶され、各機能ブロックを識別するための機能ブロック識別情報を記憶する機能ブロック識別情報記憶部を構成する。
Therefore, a table as shown in FIG. 9 is created in advance based on the configuration data. FIG. 9 is a diagram illustrating an example of a model identification table. The model identification table 71 is stored in the
機能ブロック識別情報記憶部としてのモデル識別テーブル71は、制御バスアドレス欄71aと、モデルを特定するためのモデル識別番号欄71bを有し、制御バスアドレスとモデル識別番号のデータが登録されている。図9では、例えば、制御バスアドレス「0x4****」には、機能ブロック識別番号としてのモデル識別番号「0」が対応することが示されている。
The model identification table 71 as a functional block identification information storage unit has a control bus address column 71a and a model
また、ユーザプログラム中の命令と、その命令に対応するH/Wモデルプログラムの対応関係は、ユーザによって予め決められている。図10は、命令API対応テーブルの例を示す図である。命令API対応テーブル72は、記憶装置13に記憶され、動作プログラムとしての制御S/W中の命令と、各機能ブロックにおける所定の処理との命令対応情報を記憶する命令対応情報記憶部を構成する。
Further, the correspondence between the instructions in the user program and the H / W model program corresponding to the instructions is predetermined by the user. FIG. 10 is a diagram illustrating an example of an instruction API correspondence table. The instruction API correspondence table 72 is stored in the
命令対応情報記憶部としての命令API対応テーブル72は、命令欄72aと、API欄72bと、API番号欄72cを有し、ユーザプログラム中の命令と、H/Wモデルプログラムの所定の処理すなわちメソッド名を示すAPIと、APIを特定するAPI番号のデータが登録されている。図10では、例えば、命令「stcb」には、API「writeCntBus」と、そのAPIに対応するAPI番号「1」が対応することが示されている。
The instruction API correspondence table 72 serving as an instruction correspondence information storage unit includes an instruction column 72a, an
図11は、クロスデバッガ24におけるミックス表示処理の流れの例を示すフローチャートである。図12は、ミックス表示が行われるときのユーザインターフェースとしての画面表示、クロスデバッガ24、及びターゲットシミュレータ25間の処理の流れを説明するための図である。
FIG. 11 is a flowchart showing an example of the flow of mix display processing in the
ユーザは、クロスデバッガ24を用いて、図7に示すような表示画面12a上にユーザプログラムを表示させながら、ユーザプログラムのデバッグを行うことができる。そのデバッグ中において、ユーザプログラム中のある命令が、ある機能ブロックに対応するH/Wモデルプログラムを動作させるための命令である場合がある。そして、ユーザは、その命令に対応するH/Wモデルプログラム27のソースプログラムを見て確認するためにミックス表示をさせたい場合、所定の操作を行うことにより、図11の処理を実行させることができる。例えば、その命令を含む行を選択して、所定のコマンドを指定することによって、図11の処理の実行を指示することができる。例えば、図7に示す行についてミックス表示のコマンドが指示されたとする。
The user can debug the user program using the
そのようなコマンドが入力されると、ホストCPU11aは、指定された命令のコードを逆アセンブルする(ステップS11)。
そして、逆アセンブルの結果から、ニモニックとオペランドの情報を取得する(ステップ(S12)。
When such a command is input, the
Then, mnemonic and operand information is acquired from the result of disassembly (step (S12)).
図12に示すように、逆アセンブルの結果から、例えば、「stcb $r11, 0x4000」のニモニックとオペランドの情報が得られる。ここで、「0x4000」は、制御バスアドレスを示す。 As shown in FIG. 12, the mnemonic and operand information “stcb $ r11, 0x4000”, for example, is obtained from the disassembly result. Here, “0x4000” indicates a control bus address.
そこで、上述したモデル識別テーブル71と命令API対応テーブル72とから、モデルの番号と、命令に対応するAPIの番号から、H/WモデルとAPIの特定をすることができる(ステップS13)。すなわち、制御バスアドレスデータ「0x4000」からH/Wモデルの識別番号が特定され、ニモニック「stcb」からAPI番号が特定される。 Therefore, the H / W model and the API can be specified from the model identification table 71 and the instruction API correspondence table 72 described above from the model number and the API number corresponding to the instruction (step S13). That is, the identification number of the H / W model is specified from the control bus address data “0x4000”, and the API number is specified from the mnemonic “stcb”.
そして、その得られたH/Wモデルのモデル識別番号とAPI番号を利用して、H/Wモデルプログラムの文字列の送信要求コマンドを生成して、ターゲットシミュレータ25へ送信する(ステップ(S14)。 Then, by using the model identification number and API number of the obtained H / W model, a character string transmission request command of the H / W model program is generated and transmitted to the target simulator 25 (step (S14)). .
送信要求コマンドは、モデル識別番号とAPI番号の2つの情報を含んだ、例えば、コマンド「getlinestr(0,1)」のようなコマンドである。この場合、そのコマンドにおいて、左側の第1引数「0」はモデル識別番号に対応し、右側の第2引数「1」はAPI番号に対応する。すなわち、制御バスアドレス「0x4000」から、モデル識別番号「0」が抽出され、ニモニック「stcb」から、API番号「1」が抽出されて、送信要求コマンド「getlinestr(0,1)」が生成される。 The transmission request command is a command such as a command “getlinestr (0,1)” including two pieces of information, that is, a model identification number and an API number. In this case, in the command, the first argument “0” on the left corresponds to the model identification number, and the second argument “1” on the right corresponds to the API number. That is, the model identification number “0” is extracted from the control bus address “0x4000”, the API number “1” is extracted from the mnemonic “stcb”, and the transmission request command “getlinestr (0,1)” is generated. The
ターゲットシミュレータ25はその送信要求コマンドを受信すると(ステップS21)、そのH/Wモデルプログラム中に含まれるメソッド内容送信メソッドを実行する(ステップS22)。
When the
具体的には、ターゲットシミュレータ25は、送信要求コマンドに含まれるH/Wモデル識別番号とAPI番号とから特定されるH/Wモデルプログラムの、図5のメソッド内容送信メソッド部54のメソッド内容送信メソッドを実行する。
図13は、メソッド内容送信メソッドを実行させるためのプログラムの例を示す図である。例えば、ターゲットシミュレータ25は、図13に示すようなプログラムを実行することによって、対応するメソッド内容送信メソッドを実行させる。図13において、「int num」がモデル識別番号を示し、「int type」がAPI番号を示す。
Specifically, the
FIG. 13 is a diagram illustrating an example of a program for executing a method content transmission method. For example, the
そのメソッド内容送信メソッドが実行されると、ターゲットシミュレータ25から、H/Wモデルプログラムの文字列情報が、クロスデバッガ24へ送信され、クロスデバッガ24は、そのH/Wモデルプログラムの文字列情報を受信する(ステップS15)。
ステップS14とS15が、命令対応情報に基づいて、機能ブロックの定義コードの文字列情報を取得する文字列情報取得部を構成する。
When the method content transmission method is executed, the character string information of the H / W model program is transmitted from the
Steps S14 and S15 constitute a character string information acquisition unit that acquires character string information of a function block definition code based on the instruction correspondence information.
クロスデバッガ24は、図8に示すように、受信したH/Wモデルプログラムの文字列情報を、指令された命令の下に表示するミックス表示を行う(ステップS16)。
その結果、図8に示すようなミックス表示が画面12a上に行われる。ステップS16が、取得した定義コードの文字列情報を、指定された命令と合成して表示するための合成表示部を構成する。
As shown in FIG. 8, the
As a result, a mix display as shown in FIG. 8 is performed on the
以上のように、本実施の形態によれば、ユーザは、ユーザプログラムのデバッグ時に、ユーザプログラムにおける命令に対応するH/Wモデルプログラムの内容を、併せて見て確認することができる。 As described above, according to the present embodiment, the user can check and confirm the contents of the H / W model program corresponding to the instruction in the user program at the time of debugging the user program.
なお、H/Wモデルプログラムは、図8のような途中にコードを挿入するだけでなく、挿入部分を見やすくするために、挿入されたH/Wモデルプログラム部分の色を、他のコード部とは異なる色にするようにして表示するようにしてもよい。 The H / W model program not only inserts code in the middle as shown in FIG. 8, but also changes the color of the inserted H / W model program part to other code parts in order to make the inserted part easier to see. May be displayed in different colors.
さらに、H/Wモデルプログラムを、図14に示すような別のウインドウ枠内に表示するようにしてもよい。図14は、H/Wモデルプログラムのミックス表示の例を示す図である。例えば、図14に示すように、ウインドウ枠62a内に、H/Wモデルプログラムが表示される。
Further, the H / W model program may be displayed in another window frame as shown in FIG. FIG. 14 is a diagram illustrating an example of the mix display of the H / W model program. For example, as shown in FIG. 14, the H / W model program is displayed in the
以上のように、ユーザは、ユーザプログラム中の命令に対応するH/Wモデルプログラムの内容を確認することができるが、さらに、H/Wモデルプログラムを1ステップずつ実行させる、すなわちシングルステップ実行をさせたい、という場合がある。 As described above, the user can confirm the contents of the H / W model program corresponding to the instructions in the user program, but further, the H / W model program is executed step by step, that is, single step execution is performed. Sometimes you want to let them.
そこで、シングルステップ実行を可能とするための所定のコードの追加処理を、上述した付加処理において、さらに行うようにしてもよい。 Therefore, an addition process of a predetermined code for enabling single-step execution may be further performed in the addition process described above.
図15は、H/Wモデルプログラム27cの例を示す図である。図16は、シングルステップ処理に対応するための所定のコードが付加されたH/Wモデルプログラム27dの例を示す図である。
FIG. 15 is a diagram illustrating an example of the H / W model program 27c. FIG. 16 is a diagram illustrating an example of the H /
図15には、H/Wモデルプログラム27cの2つのコード部41a、42aが示されている。図16には、それらの2つのコード部41a,42aに所定のコードが追加されたH/Wモデルプログラム27dの2つのコード部41b、42bが示されている。
FIG. 15 shows two
図16に示すように、各H/Wモデルプログラムの各行の最後に所定のコードが追加されている。追加されたコードは、「if (ssmode= =1) gmon->singleStep();」である。追加されたコードは、クロスデバッガ24にプログラムの実行制御を戻すためのコードである。言い換えると、このコードは、シングルステップモードに設定されているときには、gmonのクラス中のシングルステップのメソッドを実行させるためのコードである。そして、そのメソッドは、クロスデバッガ24に、H/Wモデルプログラムの実行が停止されたことを通知する処理を行う。
As shown in FIG. 16, a predetermined code is added to the end of each line of each H / W model program. The added code is “if (ssmode == 1) gmon-> singleStep ();”. The added code is a code for returning the execution control of the program to the
そして、クロスデバッガ24において、ユーザがシングルステップモードに設定されると、ターゲットシミュレータ25に、シングルステップモードが設定されたことが通知される。
Then, in the
その結果、ターゲットシミュレータ25内には、「ssmode」の値が「1」に設定される。よって、ターゲットシミュレータ25は、シングルステップモードであるか否かを判定することができる。
As a result, the value of “ssmode” is set to “1” in the
ターゲットシミュレータ25は、H/Wモデルプログラム41b、42bを実行したときに、「ssmode」を参照して、シングルステップモードであるか否かが判定できるので、シングルステップモードのときに各行を実行すると、クロスデバッガ24へ、H/Wモデルプログラムの実行が停止されたことが通知され、クロスデバッガ24に、プログラムの実行制御が戻される。
When the
クロスデバッガ24は、ターゲットシミュレータ25から、H/Wモデルプログラムの実行が停止したことが通知されると、ユーザは、画面上でその停止を認識することができるので、実行を再開させる、別の処理を行う、等のコマンドを指示することができる。
When the
以上のように、上述したデバッグ装置によれば、ユーザプログラムのデバッグ時に、ユーザプログラムにおける命令に対応するH/Wモデルプログラムの内容を、併せて見て確認でき、さらに、H/Wモデルプログラムもシングルステップで動作させることも可能となる。 As described above, according to the debugging device described above, the contents of the H / W model program corresponding to the instruction in the user program can be checked together when debugging the user program. It is also possible to operate in a single step.
以上説明した構成によれば、ユーザは、ユーザプログラムをデバッグするとき、プログラム中に、特に検証したい部分にブレークポイントを設定して、そのブレークポイントを設定した行の直前の行を実行した状態で、シミュレータの実行を停止することをしばしば行う。 According to the configuration described above, when a user debugs a user program, a breakpoint is set in a portion to be particularly verified in the program, and a line immediately before the line where the breakpoint is set is executed. Often, stop running the simulator.
その停止状態において、上述したように、対応するH/Wモデルプログラムの内容を確認したり、さらにシングルステップモードに設定して、H/Wモデルプログラムをシングルステップで実行させることが可能となる。 In the stopped state, as described above, it is possible to confirm the contents of the corresponding H / W model program or to set the single step mode to execute the H / W model program in a single step.
なお、以上説明した動作を実行するプログラムは、コンピュータプログラム製品として、フレキシブルディスク、CD−ROM等の可搬媒体や、ハードディスク等の記憶媒体に、その全体あるいは一部が記録され、あるいは記憶されている。そのプログラムがコンピュータにより読み取られて、動作の全部あるいは一部が実行される。あるいは、そのプログラムの全体あるいは一部を通信ネットワークを介して流通または提供することができる。利用者は、通信ネットワークを介してそのプログラムをダウンロードしてコンピュータにインストールしたり、あるいは記録媒体からコンピュータにインストールすることで、容易に本発明のデバッグ装置を実現することができる。 The program for executing the operations described above is recorded or stored as a computer program product in its entirety or in part on a portable medium such as a flexible disk or CD-ROM or a storage medium such as a hard disk. Yes. The program is read by a computer, and all or part of the operation is executed. Alternatively, all or part of the program can be distributed or provided via a communication network. The user can easily realize the debugging device of the present invention by downloading the program via a communication network and installing the program on a computer, or installing the program from a recording medium on the computer.
本発明は、上述した実施の形態に限定されるものではなく、本発明の要旨を変えない範囲において、種々の変更、改変等が可能である。 The present invention is not limited to the above-described embodiments, and various changes and modifications can be made without departing from the scope of the present invention.
1 デバッグ装置、11 コンピュータ本体、11a CPU、12 表示装置、12a 表示画面、13 記憶装置、27、H/Wモデルプログラム、27a クロスデバッガ用H/Wモデルプログラム
DESCRIPTION OF
Claims (5)
シミュレータに含まれる定義コードであって前記機能ブロックの所定の処理を実行するための前記定義コードの文字列情報を生成し、前記文字列情報を送信するための文字列情報送信プログラムを生成して、生成された前記文字列情報と生成された前記文字列情報送信プログラムとを、前記定義コードに付加する付加処理部と、
前記動作プログラム中の命令と、前記所定の処理との命令対応情報を記憶する命令対応情報記憶部と、
前記命令対応情報に基づいて、前記定義コードの文字列情報を取得する文字列情報取得部と、
取得した前記定義コードの文字列情報を、指定された命令と合成して表示するための合成表示部と、
を有することを特徴とするデバッグ装置。 A debugging device for debugging an operation program for operating a functional block provided on a chip,
A definition code included in the simulator, generating character string information of the definition code for executing predetermined processing of the functional block, and generating a character string information transmission program for transmitting the character string information; An additional processing unit for adding the generated character string information and the generated character string information transmission program to the definition code;
An instruction correspondence information storage unit for storing instruction correspondence information between the instruction in the operation program and the predetermined process;
A character string information acquisition unit that acquires character string information of the definition code based on the instruction correspondence information;
A combined display unit for displaying the obtained character string information of the definition code combined with a specified instruction;
A debugging device comprising:
前記文字列情報取得部は、前記命令対応情報と、前記機能ブロック識別情報とに基づいて、前記定義コードの文字列情報を取得するための取得コマンドを生成して実行することによって、前記定義コードの文字列情報の取得を行うことを特徴とする請求項1に記載のデバッグ装置。 A functional block identification information storage unit for storing functional block identification information for identifying each functional block when a plurality of the functional blocks are provided on the chip;
The character string information acquisition unit generates and executes an acquisition command for acquiring character string information of the definition code based on the instruction correspondence information and the functional block identification information, thereby executing the definition code. The debugging apparatus according to claim 1, wherein the character string information is acquired.
シミュレータに含まれる定義コードであって前記機能ブロックの所定の処理を実行するための前記定義コードの文字列情報を生成し、
前記文字列情報を送信するための文字列情報送信プログラムを生成し、
生成された前記文字列情報と生成された前記文字列情報送信プログラムとを、前記定義コードに付加し、
前記動作プログラム中の指定された命令と、前記所定の処理との命令対応情報に基づいて、前記定義コードの文字列情報を取得し、
取得した前記定義コードの文字列情報を、前記指定された命令と合成して表示する、
ことを特徴とするデバッグ方法。 A debugging method for debugging an operation program for operating a functional block provided on a chip,
A character string information of the definition code for executing a predetermined process of the functional block, which is a definition code included in the simulator,
Generating a character string information transmission program for transmitting the character string information;
The generated character string information and the generated character string information transmission program are added to the definition code,
Based on the instruction correspondence information between the specified instruction in the operation program and the predetermined process, obtain character string information of the definition code,
The obtained character string information of the definition code is combined with the specified instruction and displayed.
A debugging method characterized by that.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008208020A JP2010044577A (en) | 2008-08-12 | 2008-08-12 | Debugging device and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008208020A JP2010044577A (en) | 2008-08-12 | 2008-08-12 | Debugging device and method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010044577A true JP2010044577A (en) | 2010-02-25 |
Family
ID=42015914
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008208020A Pending JP2010044577A (en) | 2008-08-12 | 2008-08-12 | Debugging device and method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010044577A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111708662A (en) * | 2020-05-26 | 2020-09-25 | 新华三技术有限公司 | Debugging method and device |
-
2008
- 2008-08-12 JP JP2008208020A patent/JP2010044577A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111708662A (en) * | 2020-05-26 | 2020-09-25 | 新华三技术有限公司 | Debugging method and device |
CN111708662B (en) * | 2020-05-26 | 2023-09-29 | 新华三技术有限公司 | Debugging method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9754059B2 (en) | Graphical design verification environment generator | |
JP4909877B2 (en) | Debugging apparatus and debugging method | |
De Schutter | Better Software. Faster!: Best Practices in Virtual Prototyping | |
JP2007012003A (en) | System for providing development environment of feature-oriented software product line | |
US9690681B1 (en) | Method and system for automatically generating executable system-level tests | |
JP6763153B2 (en) | Hardware / software co-verification device and hardware / software co-verification method | |
US10691582B2 (en) | Code coverage | |
JP5996125B2 (en) | System construction support device | |
KR20110037140A (en) | System for providing virtual development environment for embedded software | |
Zeng et al. | Graphical model debugger framework for embedded systems | |
US10579761B1 (en) | Method and system for reconstructing a graph presentation of a previously executed verification test | |
JP2010044577A (en) | Debugging device and method | |
CN112765018B (en) | Instrument and meter debugging system and method | |
JP3504605B2 (en) | Software automatic test method | |
JP5120103B2 (en) | Debugging method and debugging program | |
JP5056493B2 (en) | Virtual software generator | |
JP2016126700A (en) | Program verification device, program verification method, and program verification program | |
JP5326292B2 (en) | Software development support system, support method and program | |
Serviss | Code generation using GEODE: a CASE study | |
JP2004287869A (en) | Program execution monitoring device and method | |
US20220100637A1 (en) | Debugging assistance system and debugging assistance method | |
JP2008077278A (en) | Test simulator | |
JP2009223366A (en) | Software generation system, source code communalization method, and program for creating software | |
Faria et al. | Techniques and toolset for conformance testing against UML sequence diagrams | |
JP5928128B2 (en) | Simulation method for digital circuit |