JP5120103B2 - Debugging method and debugging program - Google Patents

Debugging method and debugging program Download PDF

Info

Publication number
JP5120103B2
JP5120103B2 JP2008167187A JP2008167187A JP5120103B2 JP 5120103 B2 JP5120103 B2 JP 5120103B2 JP 2008167187 A JP2008167187 A JP 2008167187A JP 2008167187 A JP2008167187 A JP 2008167187A JP 5120103 B2 JP5120103 B2 JP 5120103B2
Authority
JP
Japan
Prior art keywords
cpu
software
debug
execution
file
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.)
Expired - Fee Related
Application number
JP2008167187A
Other languages
Japanese (ja)
Other versions
JP2010009279A (en
Inventor
博昭 藤本
隆司 藤田
貴行 佐々木
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2008167187A priority Critical patent/JP5120103B2/en
Publication of JP2010009279A publication Critical patent/JP2010009279A/en
Application granted granted Critical
Publication of JP5120103B2 publication Critical patent/JP5120103B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、CPU(Central Processing Unit)を含むハードウェアおよびCPUにより実行されるソフトウェアを組み合わせて実現されるシステム(ハードウェア/ソフトウェア混在システム)についてコンピュータ上でソフトウェアをデバッグする技術に関する。   The present invention relates to a technology for debugging software on a computer with respect to a system (hardware / software mixed system) realized by combining hardware including a CPU (Central Processing Unit) and software executed by the CPU.

図15は、SoC(System on Chip)の一例を示している。図16は、SoC開発工程の一例を示している。図15に示すように、ファームウェアを実行するCPU1、各種データを格納するメモリ2および各種周辺機能を具現する機能ブロック3、4、5等を集積したSoC6のようなハードウェア/ソフトウェア混在システムを開発する場合、図16に示すように、ハードウェアおよびソフトウェア(CPU上で実行されるファームウェア)の各々に関して仕様決定、実装および検証を順次実施した後、ハードウェアおよびソフトウェアを組み合わせて実現されるシステムに関しての検証(システムレベル検証)を実施する必要がある。ハードウェア/ソフトウェア混在システムのデバッグにおいては、不具合発生時にハードウェア側またはソフトウェア側のどちらに問題があるのかを切り分けるために、ハードウェアおよびソフトウェアの双方の状態を確認する必要がある。   FIG. 15 shows an example of SoC (System on Chip). FIG. 16 shows an example of the SoC development process. As shown in FIG. 15, a hardware / software mixed system such as SoC 6 in which a CPU 1 for executing firmware, a memory 2 for storing various data, and functional blocks 3, 4, 5, etc. for implementing various peripheral functions are integrated is developed. In this case, as shown in FIG. 16, the specification determination, implementation and verification are sequentially performed for each of hardware and software (firmware executed on the CPU), and then the system is realized by combining the hardware and software. It is necessary to carry out verification (system level verification). In debugging a hardware / software mixed system, it is necessary to check the status of both the hardware and software in order to determine whether there is a problem on the hardware side or the software side when a failure occurs.

ハードウェア/ソフトウェア混在システムを検証する手法として、ハードウェア/ソフトウェア協調検証手法が知られている。ハードウェア/ソフトウェア協調検証手法では、CPU以外のハードウェアの動作が論理シミュレータ等により実行され、CPUの動作(ソフトウェアの実行)が命令セットシミュレータ(ISS:Instruction Set Simulator)により実行される。ISSおよび論理シミュレータ等は相互に接続されており、CPUおよびCPU以外のハードウェア間のデータ授受が再現されることで、CPUとその他のハードウェアとを組み合わせたシステムとしての動作が再現される。ハードウェア/ソフトウェア協調検証手法には、論理シミュレータを使用する手法(コ・シミュレーション)と論理エミュレータを使用する手法(コ・エミュレーション)とが存在する。   As a method for verifying a hardware / software mixed system, a hardware / software co-verification method is known. In the hardware / software co-verification method, the operation of hardware other than the CPU is executed by a logic simulator or the like, and the operation of the CPU (software execution) is executed by an instruction set simulator (ISS: Instruction Set Simulator). The ISS, the logic simulator, and the like are connected to each other, and by reproducing data exchange between the CPU and hardware other than the CPU, the operation as a system combining the CPU and other hardware is reproduced. Hardware / software co-verification methods include a method using a logic simulator (co-simulation) and a method using a logic emulator (co-emulation).

図17は、コ・シミュレーションの概要を示している。コ・シミュレーションでは、CPUにより実行されるソフトウェアについてソースファイルをビルド(コンパイルおよびリンク)して実行ファイルを生成した後、ソフトウェアのソースファイルおよび実行ファイルとCPU以外のハードウェアに関するHDL(Hardware Design Language)記述ファイルとを入力としてISSおよび論理シミュレータによりシミュレーションが実行される。コ・シミュレーションは、例えば、図17に示すように、コンピュータ11上のソフトウェア開発ツール12(ISS13およびデバッガ14を具備)と論理シミュレータ15とを使用して実現される。この場合、論理シミュレータ15によりCPU以外のハードウェアの動作が実行され、ISS13によりCPUの動作が実行され、ISS13に接続されたデバッガ14によりソフトウェアデバッグ機能が実現される。このようなコ・シミュレーションにおいては、CPU以外のハードウェアに関するシミュレーションには多くの時間を要するため、これがボトルネックとなり実行速度が例えば数十〜数百Hz程度と遅くなる問題がある。例えば、シミュレーション実行開始後、ブレークポイントに到達するまでに数時間を要してしまうことがある。従って、コ・シミュレーションをソフトウェアデバッグに使用することは現実的ではない。   FIG. 17 shows an outline of co-simulation. In co-simulation, a source file is built (compiled and linked) for software executed by the CPU to generate an execution file, and then the software source file and execution file and HDL (Hardware Design Language) related to hardware other than the CPU Simulation is executed by the ISS and logic simulator with the description file as an input. For example, the co-simulation is realized by using a software development tool 12 (comprising an ISS 13 and a debugger 14) and a logic simulator 15 on the computer 11, as shown in FIG. In this case, the operation of hardware other than the CPU is executed by the logic simulator 15, the operation of the CPU is executed by the ISS 13, and the software debugging function is realized by the debugger 14 connected to the ISS 13. In such a co-simulation, since a lot of time is required for the simulation related to hardware other than the CPU, this becomes a bottleneck, and there is a problem that the execution speed becomes slow, for example, about several tens to several hundreds Hz. For example, it may take several hours to reach a breakpoint after starting simulation execution. Therefore, using co-simulation for software debugging is not practical.

図18は、コ・エミュレーションの概要を示している。コ・シミュレーションにおいて論理シミュレータによりCPU以外のハードウェアの動作が実行されるのに対して、コ・エミュレーションでは、論理エミュレータによりCPU以外のハードウェアの動作が実行される。コ・エミュレーションは、例えば、図18に示ように、コンピュータ21上のエミュレータ制御ツール22(ISS23およびデバッガ24を具備)とコンピュータ21に接続された論理エミュレータ25とを使用して実現される。このようなコ・エミュレーションにおいては、論理エミュレータの実行速度(1MHz)に比べてISSの実行速度が遅いことに加えて、ISSを具備するコンピュータと論理エミュレータとが物理的に別の装置であり、両者を接続するためのインタフェース部分が存在することに起因して、実行速度が著しく低下する。このため、CPUを含めたハードウェア全体をエミュレータにマッピングしてエミュレータ単体で動作させた場合に比べて、実行速度が例えば数十kHz程度と遅くなるという問題がある。
特開2002−366602号公報
FIG. 18 shows an outline of co-emulation. In the co-simulation, the operation of hardware other than the CPU is executed by the logic simulator, whereas in the co-emulation, the operation of hardware other than the CPU is executed by the logic emulator. For example, the co-emulation is realized using an emulator control tool 22 (comprising an ISS 23 and a debugger 24) on the computer 21 and a logic emulator 25 connected to the computer 21, as shown in FIG. In such co-emulation, in addition to the ISS execution speed being slower than the logic emulator execution speed (1 MHz), the computer equipped with the ISS and the logic emulator are physically separate devices, Due to the presence of an interface portion for connecting the two, the execution speed is significantly reduced. For this reason, there is a problem that the execution speed becomes slow, for example, about several tens of kHz, compared to the case where the entire hardware including the CPU is mapped to the emulator and operated as a single emulator.
JP 2002-366602 A

コ・シミュレーションまたはコ・エミュレーションのいずれについても、実行速度が非常に遅いため、ソフトウェアデバッグを短時間で実施することは困難であった。   For both co-simulation and co-emulation, the execution speed was very slow, and it was difficult to perform software debugging in a short time.

本発明の目的は、ハードウェア/ソフトウェア混在システムについてソフトウェアデバッグを短時間で実施することにある。   An object of the present invention is to perform software debugging for a hardware / software mixed system in a short time.

本発明の一態様では、CPUを含むハードウェアおよびCPUにより実行されるソフトウェアを組み合わせて実現されるシステムについてコンピュータ上でソフトウェアをデバッグする際に、第1〜第3工程が実施される。第1工程では、システムのシミュレーションにより生成された波形データファイル、CPUの構成要素を定義したCPU定義ファイル、ソフトウェアのソースファイルおよびソフトウェアの実行ファイルが入力される。第2工程では、波形データファイルおよびCPU定義ファイルに基づいて時刻情報およびCPU内部動作情報が取得されてCPUのソフトウェア実行状態が再現される。第3工程では、時刻情報、CPU内部動作情報、ソフトウェアのソースファイルおよびソフトウェアの実行ファイルに基づいてデバッグ情報が表示される。   In one aspect of the present invention, the first to third steps are performed when debugging software on a computer for a system realized by combining hardware including a CPU and software executed by the CPU. In the first step, a waveform data file generated by system simulation, a CPU definition file defining CPU components, a software source file, and a software execution file are input. In the second step, time information and CPU internal operation information are acquired based on the waveform data file and the CPU definition file, and the software execution state of the CPU is reproduced. In the third step, debug information is displayed based on time information, CPU internal operation information, software source file, and software execution file.

ハードウェア/ソフトウェア混在システムについてソフトウェアデバッグを短時間で実施することができる。この結果、ハードウェア/ソフトウェア混在システムの開発期間の短縮に大きく寄与することができる。   Software debugging can be performed in a short time for a hardware / software mixed system. As a result, it can greatly contribute to shortening the development period of the hardware / software mixed system.

以下、本発明の実施形態について図面を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の一実施形態を示している。図2は、CPU定義ファイルの一例を示している。図3は、ソフトウェアデバッグ部の詳細を示している。図4は、デバッグAPI(Application Program Interface)の一例を示している。図5は、波形情報取得APIの一例を示している。   FIG. 1 shows an embodiment of the present invention. FIG. 2 shows an example of the CPU definition file. FIG. 3 shows details of the software debug unit. FIG. 4 shows an example of a debug API (Application Program Interface). FIG. 5 shows an example of the waveform information acquisition API.

本発明の一実施形態では、図1に示すように、SoCのデバッグを実施する前に、SoCにおけるCPUにより実行されるソフトウェアについて、コンピュータ100上でコンパイラ/リンカ200によりソースファイル110をビルド(コンパイルおよびリンク)して実行ファイル120(バイナリファイル)を生成する。このとき、ソースファイル110をデバッグオプション付きでビルドすることにより、実行ファイル120にデバッグ用付加情報(命令アドレスおよびソースコード行の対応関係を示す情報等)が含まれるようにする。   In one embodiment of the present invention, as shown in FIG. 1, a source file 110 is built (compiled) by a compiler / linker 200 on a computer 100 for software executed by a CPU in the SoC before debugging the SoC. And link) to generate an execution file 120 (binary file). At this time, the source file 110 is built with a debug option so that additional information for debugging (information indicating the correspondence between instruction addresses and source code lines, etc.) is included in the execution file 120.

次に、SoC全体(CPUを含む)のHDL記述ファイル130をエミュレータ300にマッピングするとともに、実行ファイル120をエミュレータ300内のメモリにロードした後、エミュレータ300単体でエミューションを実行して波形データファイル140を生成する。波形データファイル140は、CPUを含むハードウェアの内部信号の信号名、信号値および時刻等の情報を含むものである。なお、波形データファイル140の形式としては、Verilog−HDLで規定されているVCD(Value Change Dump)ファイルがある。   Next, the HDL description file 130 of the entire SoC (including the CPU) is mapped to the emulator 300, and the execution file 120 is loaded into the memory in the emulator 300, and then the emulator 300 is emulated to execute the waveform data file. 140 is generated. The waveform data file 140 includes information such as signal names, signal values, and times of internal signals of hardware including the CPU. The waveform data file 140 has a VCD (Value Change Dump) file defined by Verilog-HDL.

この後、コンピュータ100上でデバッグプログラム400により実現されるハードウェアデバッグ機能(内部信号波形表示)およびソフトウェアデバッグ機能(初期化、ブレークポイント設定、継続実行、ステップ実行、ソースコード表示、変数値表示やメモリデータ表示等)を使用してSoCのデバッグを実施する。これにより、コ・シミュレーションやコ・エミュレーションを用いた場合と同様に、ハードウェアおよびソフトウェアを同時にデバッグすることが可能である。   Thereafter, a hardware debugging function (internal signal waveform display) and a software debugging function (initialization, breakpoint setting, continuous execution, step execution, source code display, variable value display, etc. realized by the debug program 400 on the computer 100 SoC debugging is performed using memory data display or the like. As a result, hardware and software can be debugged simultaneously as in the case of using co-simulation or co-emulation.

デバッグプログラム400は、ソースファイル110、実行ファイル120、波形データファイル140およびCPU定義ファイル150を入力とし、デバッグ制御部160、デバッグ情報出力部170および波形情報出力部180等のGUI(Graphical User Interface)と連動することにより、デバッグ機能を実現している。例えば、デバッグプログラム400は、ソフトウェアデバッグ機能を実現するソフトウェアデバッグ部410、波形データファイル140から時刻や信号値等の情報を取得する波形情報取得部420、波形表示機能(ハードウェアデバッグ機能)を実現する波形情報表示部430等を具現している。   The debug program 400 receives a source file 110, an execution file 120, a waveform data file 140, and a CPU definition file 150 as input, and includes a GUI (Graphical User Interface) such as a debug control unit 160, a debug information output unit 170, and a waveform information output unit 180. Debug function is realized by linking with. For example, the debug program 400 implements a software debug unit 410 that implements a software debug function, a waveform information acquisition unit 420 that obtains information such as time and signal values from the waveform data file 140, and a waveform display function (hardware debug function). The waveform information display unit 430 and the like are implemented.

なお、ソースファイル110はソースコード表示の際に使用され、実行ファイル120はソースコード表示や変数値表示の際に使用される。波形データファイル140は、波形表示の際に使用されるとともに、ソフトウェアデバッグ機能を実現するためにCPUの内部動作に関する情報を取得する際に使用される。CPU定義ファイル150は、波形データファイル140からCPUの内部動作に関する情報を取得する際に使用される。CPU定義ファイル150は、例えば、図2に示すように、CPUの基本的な構成要素(クロック、リセット、プログラムカウンタ、スタックポインタ、フレームポインタ、ステータスレジスタ、命令メモリ、データメモリや汎用レジスタ等)およびそれに対応する内部信号の信号名の情報を含むものである。また、デバッグ制御部160は、ソフトウェアデバッグ機能を実現するための各種処理(初期化処理、ブレークポイント設定処理、継続実行処理、ステップ実行処理、ソースコード表示処理、変数値表示処理やメモリデータ表示処理等)のコマンドを入力する際に使用される。デバッグ情報出力部170は、デバッグ情報(ソースコード、変数値やメモリデータ等)を表示する際に使用される。波形情報出力部180は、波形情報を表示する際に使用される。   The source file 110 is used for displaying source code, and the execution file 120 is used for displaying source code and variable values. The waveform data file 140 is used at the time of waveform display, and is used at the time of acquiring information related to the internal operation of the CPU in order to realize a software debugging function. The CPU definition file 150 is used when acquiring information related to the internal operation of the CPU from the waveform data file 140. For example, as shown in FIG. 2, the CPU definition file 150 includes basic components of the CPU (clock, reset, program counter, stack pointer, frame pointer, status register, instruction memory, data memory, general-purpose register, etc.) It includes information on the signal name of the corresponding internal signal. The debug control unit 160 also performs various processes for realizing the software debugging function (initialization process, breakpoint setting process, continuous execution process, step execution process, source code display process, variable value display process, memory data display process, etc. Etc.) is used when entering commands. The debug information output unit 170 is used when displaying debug information (source code, variable value, memory data, etc.). The waveform information output unit 180 is used when displaying waveform information.

ソフトウェアデバッグ部410は、例えば、図3に示すように、デバッグ処理部411およびデバッグ情報取得部416を有している。デバッグ処理部411は、デバッグAPIを用いて、デバッグ情報取得部416から必要な情報を取得してソースコード表示、変数値表示やメモリデータ表示等の機能を実現するとともに、デバッグ情報取得部416に必要な指示を発行して初期化、ブレークポイント設定、継続実行やステップ実行等の機能を実現する。例えば、デバッグ処理部411は、初期化機能を実現するための初期化制御部412、継続実行機能やステップ実行機能を実現するための実行制御部413、ブレークポイント設定機能を実現するためのブレーク制御部414、ソースコード表示機能、変数値表示機能やメモリデータ表示機能を実現するためのデバッグ情報表示部415等を有している。   For example, as shown in FIG. 3, the software debug unit 410 includes a debug processing unit 411 and a debug information acquisition unit 416. The debug processing unit 411 uses the debug API to acquire necessary information from the debug information acquisition unit 416 to realize functions such as source code display, variable value display, and memory data display, and also to the debug information acquisition unit 416. Issue necessary instructions to implement functions such as initialization, breakpoint setting, continuous execution and step execution. For example, the debug processing unit 411 includes an initialization control unit 412 for realizing an initialization function, an execution control unit 413 for realizing a continuous execution function and a step execution function, and break control for realizing a breakpoint setting function. A debug information display unit 415 for realizing a unit 414, a source code display function, a variable value display function, and a memory data display function.

デバッグ情報取得部416は、CPU定義ファイル150に基づいて波形情報取得APIを用いて時刻やCPUの構成要素(内部信号)の値を波形情報取得部420(波形データファイル140)から取得する。波形情報取得部420(波形データファイル140)から情報を取得する際にCPU定義ファイル150が使用されることで、CPUの種類が変更された場合でもCPU定義ファイル150の内容を変更するだけで容易に対応することが可能になる。なお、コ・シミュレーションやコ・エミュレーションを用いた場合には、ISSが必要となるため、CPUのベンダからISSが提供されていない場合にはハードウェアおよびソフトウェアを同時にデバッグすることができない。   The debug information acquisition unit 416 acquires the time and the value of the component (internal signal) of the CPU from the waveform information acquisition unit 420 (waveform data file 140) using the waveform information acquisition API based on the CPU definition file 150. Since the CPU definition file 150 is used when acquiring information from the waveform information acquisition unit 420 (waveform data file 140), it is easy to change the contents of the CPU definition file 150 even when the CPU type is changed. It becomes possible to cope with. When co-simulation or co-emulation is used, an ISS is required, and therefore hardware and software cannot be debugged simultaneously if the ISS is not provided by the CPU vendor.

例えば、デバッグ情報取得部416は、波形情報取得APIを用いて波形情報取得部420との間で情報の授受を実施する波形情報処理部417、デバッグAPIを用いてデバッグ処理部411との間で情報の授受を実施するデバッグ情報処理部418、時刻、クロックサイクル数、プログラムカウンタ(PC:Program Counter)の値やブレークポイントの値等を保持する情報保持部419等を有している。なお、情報保持部419で保持されるクロックサイクル数は、情報保持部419で保持される時刻が波形データファイル140内のシミュレーション開始時点から何サイクル目に相当するのかを示すものである。情報保持部419では、保持される時刻を波形データファイル140に基づいて予め算出されたCPU内のクロック信号の1サイクルの時間で割った値がクロックサイクル数として保持される。   For example, the debug information acquisition unit 416 communicates with the waveform information acquisition unit 420 using the waveform information acquisition API, and the debug information acquisition unit 417 and the debug processing unit 411 using the debug API. A debug information processing unit 418 that performs transmission / reception of information, an information holding unit 419 that holds a time, the number of clock cycles, a value of a program counter (PC), a value of a breakpoint, and the like are included. Note that the number of clock cycles held by the information holding unit 419 indicates what cycle the time held by the information holding unit 419 corresponds to from the simulation start time in the waveform data file 140. In the information holding unit 419, a value obtained by dividing the held time by the time of one cycle of the clock signal in the CPU calculated in advance based on the waveform data file 140 is held as the number of clock cycles.

デバッグ情報取得部416において、時刻、クロックサイクル数およびプログラムカウンタの値が保持されることで、ある時刻にソフトウェアのどの部分が実行されているのかを特定することができる。従って、デバッグ情報取得部416は、時刻、クロックサイクル数およびプログラムカウンタの値に基づいてCPUの内部動作に関する情報をデバッグ処理部411に供給することで、実際にはソフトウェアを実行していないにも拘わらず、擬似的にCPUが動作しているようにデバッグ処理部411に対して応答することが可能になる。   In the debug information acquisition unit 416, the time, the number of clock cycles, and the value of the program counter are held, so that it is possible to specify which part of the software is being executed at a certain time. Therefore, the debug information acquisition unit 416 supplies information related to the internal operation of the CPU to the debug processing unit 411 based on the time, the number of clock cycles, and the value of the program counter, so that the software is not actually executed. Regardless, it becomes possible to respond to the debug processing unit 411 so that the CPU is operating in a pseudo manner.

なお、デバッグAPIの種類としては、例えば、図4に示すように、初期化API、ブレークポイント設定API、継続実行API、ステップ実行API、PCリードAPI、メモリリードAPI、ブレーク発生通知APIや実行停止通知API等がある。初期化APIは、デバッグ処理部411がデバッグ情報取得部416にソフトウェア実行開始位置情報(CPU内のリセット信号の立ち下がりエッジの発生時刻およびその時刻に対応するCPU内のプログラムカウンタの値)を保持させる際に使用される。ブレークポイント設定APIは、デバッグ処理部416がデバッグ情報取得部416に指定ブレークポイント値を保持させる際に使用される。継続実行APIは、デバッグ処理部411がデバッグ情報取得部416にプログラムカウンタの値をブレークポイントの値、指定ステップ数後の値またはソフトウェアの終端に対応する値のいずれかまで進めさせる際に使用される。ステップ実行APIは、デバッグ処理部411がデバッグ情報取得部416にプログラムカウンタの値を1ステップ後の値まで進めさせる際に使用される。PCリードAPIは、デバッグ処理部411がCPU内のプログラムカウンタの値をデバッグ情報取得部416から取得する際に使用される。メモリリードAPIは、デバッグ処理部411がCPU内のメモリの指定アドレスのデータをデバッグ情報取得部416から取得する際に使用される。ブレーク発生通知APIは、デバッグ情報取得部416がデバッグ処理部411にブレーク発生(プログラムカウンタの値およびブレークポイントの値の一致)を通知する際に使用される。実行停止通知APIは、デバッグ情報取得部416がデバッグ処理部411に実行停止(プログラムカウンタの値を更新する処理の終了)を通知する際に使用される。   As types of debug APIs, for example, as shown in FIG. 4, initialization API, breakpoint setting API, continuous execution API, step execution API, PC read API, memory read API, break occurrence notification API, and execution stop Notification API and the like. In the initialization API, the debug processing unit 411 holds the software execution start position information (the occurrence time of the falling edge of the reset signal in the CPU and the value of the program counter in the CPU corresponding to the time) in the debug information acquisition unit 416. Used when making The breakpoint setting API is used when the debug processing unit 416 causes the debug information acquisition unit 416 to hold a specified breakpoint value. The continuous execution API is used when the debug processing unit 411 causes the debug information acquisition unit 416 to advance the value of the program counter to a breakpoint value, a value after the specified number of steps, or a value corresponding to the end of the software. The The step execution API is used when the debug processing unit 411 causes the debug information acquisition unit 416 to advance the value of the program counter to a value after one step. The PC read API is used when the debug processing unit 411 acquires the value of the program counter in the CPU from the debug information acquisition unit 416. The memory read API is used when the debug processing unit 411 acquires data at a specified address of the memory in the CPU from the debug information acquisition unit 416. The break occurrence notification API is used when the debug information acquisition unit 416 notifies the debug processing unit 411 of the occurrence of a break (a match between the program counter value and the breakpoint value). The execution stop notification API is used when the debug information acquisition unit 416 notifies the debug processing unit 411 of execution stop (end of processing for updating the value of the program counter).

また、波形情報取得APIの種類としては、例えば、図5に示すように、信号値取得APIや信号変化位置取得API等がある。信号値取得APIは、デバッグ情報取得部416が指定信号名の信号に関して指定時刻の値を波形情報取得部420から取得する際に使用される。信号変化位置取得APIは、デバッグ情報取得部416が指定信号名の信号に関して指定時刻後で最初に指定エッジ(立ち上がりエッジ、立ち下がりエッジまたは両エッジ)が発生する時刻およびその時刻の信号値(変化後の信号値)を波形情報取得部420から取得する際に使用される。   Examples of the waveform information acquisition API include a signal value acquisition API and a signal change position acquisition API as shown in FIG. The signal value acquisition API is used when the debug information acquisition unit 416 acquires the value of the specified time from the waveform information acquisition unit 420 regarding the signal with the specified signal name. The signal change position acquisition API includes a time at which a specified edge (rising edge, falling edge, or both edges) is first generated after a specified time with respect to a signal having a specified signal name by the debug information acquiring unit 416 and a signal value (change) at that time. This is used when the later signal value is acquired from the waveform information acquisition unit 420.

ここで、デバッグ機能を実現するための各種処理(初期化処理、ブレークポイント設定処理、継続実行処理、ステップ実行処理、ソースコード表示処理、変数値表示処理、メモリデータ表示処理および波形表示処理)について説明する。   Here, various processes (initialization processing, breakpoint setting processing, continuous execution processing, step execution processing, source code display processing, variable value display processing, memory data display processing, and waveform display processing) for realizing the debug function explain.

図6は、初期化処理を示している。図6(a)は初期化処理時のデータの流れを示しており、図6(b)は初期化処理時の動作を示している。デバッグ制御部160(GUI)を介して初期化コマンドが入力されると、デバッグ処理部411は、デバッグ情報取得部416に対して初期化指示を発行する。これに伴って、デバッグ情報取得部416は、波形情報取得部420を介して波形データファイル140からリセット解除位置情報(CPU内のリセット信号の立ち下がりエッジの発生時刻およびその時刻に対応するCPU内のプログラムカウンタの値)を取得する(ステップS11)。そして、デバッグ情報取得部416は、波形データファイル140から取得した時刻およびプログラムカウンタの値を保持する(ステップS12)。これにより、デバッグ情報取得部416で再現されるCPUのソフトウェア実行状態がソフトウェア実行開始時の状態に設定されたことになる。   FIG. 6 shows the initialization process. FIG. 6A shows the data flow during the initialization process, and FIG. 6B shows the operation during the initialization process. When an initialization command is input via the debug control unit 160 (GUI), the debug processing unit 411 issues an initialization instruction to the debug information acquisition unit 416. Accordingly, the debug information acquisition unit 416 receives the reset release position information (the generation time of the falling edge of the reset signal in the CPU and the CPU corresponding to the time from the waveform data file 140 via the waveform information acquisition unit 420). Of the program counter) is acquired (step S11). The debug information acquisition unit 416 holds the time acquired from the waveform data file 140 and the value of the program counter (step S12). Thereby, the software execution state of the CPU reproduced by the debug information acquisition unit 416 is set to the state at the start of software execution.

図7は、ブレークポイント設定処理を示している。図7(a)はブレークポイント設定処理時のデータの流れを示しており、図7(b)はブレークポイント設定処理時の動作を示している。デバッグ制御部160(GUI)を介してブレークポイント設定コマンド(ブレークポイントの値を含む)が入力されると、デバッグ処理部411は、デバッグ情報取得部416に対してブレークポイント設定指示を発行する。これに伴って、デバッグ情報取得部416は、デバッグ処理部411から供給されるブレークポイントの値を保持する(ステップS21)。なお、ブレークポイントについては、複数の値を設定することが可能である。   FIG. 7 shows a breakpoint setting process. FIG. 7A shows the data flow during the breakpoint setting process, and FIG. 7B shows the operation during the breakpoint setting process. When a breakpoint setting command (including a breakpoint value) is input via the debug control unit 160 (GUI), the debug processing unit 411 issues a breakpoint setting instruction to the debug information acquisition unit 416. Accordingly, the debug information acquisition unit 416 holds the breakpoint value supplied from the debug processing unit 411 (step S21). A plurality of values can be set for the breakpoint.

図8は、継続実行処理を示している。図8(a)は継続実行処理時のデータの流れを示しており、図8(b)は継続実行処理時の動作を示している。デバッグ制御部160(GUI)を介して継続実行コマンド(ステップ数を含む)が入力されると、デバッグ処理部411は、デバッグ情報取得部416に対して継続実行指示を発行する。これに伴って、デバッグ情報取得部416は、波形情報取得部420を介して波形データファイル140からPC変化位置情報(プログラムカウンタの値が次に変化する時刻およびプログラムカウンタの変化後の値)を取得する(ステップS31)。そして、デバッグ情報取得部416は、波形データファイル140から取得した時刻およびプログラムカウンタの値を保持する(ステップS32)。この後、デバッグ情報取得部416は、保持しているプログラムカウンタの値がブレークポイントの値と一致するか否かを判定する(ステップS33)。デバッグ情報取得部416は、プログラムカウンタの値はブレークポイントの値と一致しないと判定した場合、プログラムカウンタの値が変化する毎にCPUのソフトウェア実行状態が1ステップ進むものとして、CPUのソフトウェア実行状態が指定ステップ数(デバッグ処理部411から供給されるステップ数)後の状態まで進んでいるか否かを判定する(ステップS34)。デバッグ情報取得部416は、CPUのソフトウェア実行状態は指定ステップ数後の状態まで進んでいないと判定した場合、保持しているプログラムカウンタの値がソフトウェアの終端に対応する値と一致するか否かを判定する(ステップS35)。デバッグ情報取得部416は、プログラムカウンタの値はソフトウェアの終端に対応する値と一致しないと判定した場合、ステップS31以降の処理を再び実施する。そして、デバッグ情報取得部416は、ステップS33にてプログラムカウンタの値はブレークポイントの値と一致すると判定した場合には、デバッグ処理部411に対してブレーク発生通知(プログラムカウンタの値を含む)を発行し、ステップS34にてCPUのソフトウェア実行状態は指定ステップ数後の状態まで進んでいると判定した場合あるいはステップS35にてプログラムカウンタの値はソフトウェアの終端に対応する値と一致すると判定した場合には、デバッグ処理部411に対して実行停止通知(プログラムカウンタの値を含む)を発行する(ステップS36)。これと同時に、デバッグ情報取得部416は、波形情報表示部430に対して波形表示指示を発行する。これにより、デバッグ情報取得部416で再現されるCPUのソフトウェア実行状態がブレーク発生時の状態、指定ステップ数後の状態またはソフトウェア実行終了時の状態のいずれかまで進められたことになる。   FIG. 8 shows the continuous execution process. FIG. 8A shows the data flow during the continuous execution process, and FIG. 8B shows the operation during the continuous execution process. When a continuous execution command (including the number of steps) is input via the debug control unit 160 (GUI), the debug processing unit 411 issues a continuous execution instruction to the debug information acquisition unit 416. Along with this, the debug information acquisition unit 416 receives the PC change position information (the time when the value of the program counter changes next and the value after the change of the program counter) from the waveform data file 140 via the waveform information acquisition unit 420. Obtain (step S31). The debug information acquisition unit 416 holds the time acquired from the waveform data file 140 and the value of the program counter (step S32). Thereafter, the debug information acquisition unit 416 determines whether or not the held program counter value matches the breakpoint value (step S33). When the debug information acquisition unit 416 determines that the value of the program counter does not match the value of the breakpoint, the software execution state of the CPU is assumed to advance by one step each time the value of the program counter changes. Is determined to have reached the state after the specified number of steps (the number of steps supplied from the debug processing unit 411) (step S34). If the debug information acquisition unit 416 determines that the software execution state of the CPU has not progressed to the state after the specified number of steps, whether or not the value of the held program counter matches the value corresponding to the end of the software. Is determined (step S35). If the debug information acquisition unit 416 determines that the value of the program counter does not match the value corresponding to the end of the software, the debug information acquisition unit 416 performs the processing from step S31 onward. If the debug information acquisition unit 416 determines in step S33 that the value of the program counter matches the value of the breakpoint, the debug information acquisition unit 416 sends a break occurrence notification (including the value of the program counter) to the debug processing unit 411. Issued, and when it is determined in step S34 that the software execution state of the CPU has progressed to the state after the specified number of steps, or when it is determined in step S35 that the value of the program counter matches the value corresponding to the end of the software Is issued to the debug processing unit 411 (including the value of the program counter) (step S36). At the same time, the debug information acquisition unit 416 issues a waveform display instruction to the waveform information display unit 430. Thus, the software execution state of the CPU reproduced by the debug information acquisition unit 416 is advanced to any of the state at the time of the break occurrence, the state after the designated number of steps, or the state at the end of the software execution.

図9は、ステップ実行処理を示している。図9(a)はステップ実行処理時のデータの流れを示しており、図9(b)はステップ実行処理時の動作を示している。デバッグ制御部160(GUI)を介してステップ実行コマンドが入力されると、デバッグ処理部411は、デバッグ情報取得部416に対してステップ実行指示を発行する。これに伴って、デバッグ情報取得部416は、波形情報取得部420を介して波形データファイル140からPC変化位置情報(プログラムカウンタの値が次に変化する時刻およびプログラムカウンタの変化後の値)を取得する(ステップS41)。そして、デバッグ情報取得部416は、波形データファイル140から取得した時刻およびプログラムカウンタの値を保持する(ステップS42)。この後、デバッグ情報取得部416は、保持しているプログラムカウンタの値がブレークポイントの値と一致するか否かを判定する(ステップS43)。次に、デバッグ情報取得部416は、保持しているプログラムカウンタの値がソフトウェアの終端に対応する値と一致するか否かを判定する(ステップS44)。そして、デバッグ情報取得部416は、ステップS43にてプログラムカウンタの値はブレークポイントの値と一致すると判定した場合には、デバッグ処理部411に対してブレーク発生通知(プログラムカウンタの値を含む)を発行し、ステップS43にてプログラムカウンタの値はブレークポイントの値と一致しないと判定した場合には、デバッグ処理部411に対して実行停止通知(プログラムカウンタの値を含む)を発行する(ステップS45)。これと同時に、デバッグ情報取得部416は、波形情報表示部430に対して波形表示指示を発行する。これにより、デバッグ情報取得部416で再現されるCPUのソフトウェア実行状態が1ステップ後の状態まで進められたことになる。   FIG. 9 shows the step execution process. FIG. 9A shows the data flow during the step execution process, and FIG. 9B shows the operation during the step execution process. When a step execution command is input via the debug control unit 160 (GUI), the debug processing unit 411 issues a step execution instruction to the debug information acquisition unit 416. Along with this, the debug information acquisition unit 416 receives the PC change position information (the time when the value of the program counter changes next and the value after the change of the program counter) from the waveform data file 140 via the waveform information acquisition unit 420. Obtain (step S41). The debug information acquisition unit 416 holds the time acquired from the waveform data file 140 and the value of the program counter (step S42). Thereafter, the debug information acquisition unit 416 determines whether or not the held program counter value matches the breakpoint value (step S43). Next, the debug information acquisition unit 416 determines whether or not the value of the held program counter matches the value corresponding to the end of the software (step S44). If the debug information acquisition unit 416 determines in step S43 that the value of the program counter matches the value of the breakpoint, the debug information acquisition unit 416 notifies the debug processing unit 411 of the occurrence of a break (including the value of the program counter). When it is determined that the value of the program counter does not match the value of the breakpoint in step S43, an execution stop notification (including the value of the program counter) is issued to the debug processing unit 411 (step S45). ). At the same time, the debug information acquisition unit 416 issues a waveform display instruction to the waveform information display unit 430. As a result, the CPU software execution state reproduced by the debug information acquisition unit 416 is advanced to the state after one step.

図10は、ソースコード表示処理を示している。図10(a)はソースコード表示処理時のデータの流れを示しており、図10(b)はソースコード表示処理時の動作を示している。デバッグ情報取得部416からデバッグ処理部411に対してブレーク発生通知または実行停止通知が発行されると(継続実行処理またはステップ実行処理が終了すると)、デバッグ処理部411は、デバッグ情報取得部416で保持されているプログラムカウンタの値を取得する(ステップS51)。次に、デバッグ処理部411は、実行ファイル120内のデバッグ用付加情報(命令アドレスおよびソースコード行の対応関係を示す情報)を利用して、デバッグ情報取得部416から取得したプログラムカウンタの値に対応するソースコード行を特定する(ステップS52)。そして、デバッグ処理部411は、実行ファイル120内のデバッグ用付加情報に基づいて特定したソースコード行についてソースファイル110からソースコードを取得し(ステップS53)、取得したソースコードをデバッグ情報出力部170(GUI)に表示する(ステップS54)。なお、デバッグ処理部411は、デバッグ情報取得部416で保持されているプログラムカウンタの値に加えて時刻やクロックサイクル数を取得し、ソースコードに加えてプログラムカウンタの値、時刻やクロックサイクル数をデバッグ情報出力部170(GUI)に表示することも可能である。   FIG. 10 shows source code display processing. FIG. 10A shows the flow of data during the source code display process, and FIG. 10B shows the operation during the source code display process. When a break occurrence notification or an execution stop notification is issued from the debug information acquisition unit 416 to the debug processing unit 411 (when the continuous execution process or the step execution process ends), the debug processing unit 411 uses the debug information acquisition unit 416. The value of the held program counter is acquired (step S51). Next, the debug processing unit 411 uses the additional information for debugging (information indicating the correspondence relationship between the instruction address and the source code line) in the execution file 120 to set the value of the program counter acquired from the debug information acquisition unit 416. A corresponding source code line is specified (step S52). The debug processing unit 411 acquires the source code from the source file 110 for the source code line specified based on the debug additional information in the execution file 120 (step S53), and the acquired source code is output to the debug information output unit 170. (GUI) is displayed (step S54). The debug processing unit 411 acquires the time and the number of clock cycles in addition to the value of the program counter held in the debug information acquisition unit 416, and the value of the program counter, the time and the number of clock cycles in addition to the source code. It is also possible to display on the debug information output unit 170 (GUI).

図11は、変数値表示処理を示している。図11(a)は変数値表示処理時のデータの流れを示しており、図11(b)は変数値表示処理時の動作を示している。デバッグ制御部160(GUI)を介して変数値表示コマンド(変数名を含む)が予め入力されている場合には、デバッグ情報取得部416からデバッグ処理部411に対してブレーク発生通知または実行停止通知が発行されると、デバッグ処理部411は、実行ファイル120内のデバッグ用付加情報を利用して、指定変数名の変数についてアドレスおよび種類を特定する(ステップS61)。次に、デバッグ処理部411は、変数の種類がグローバル変数であるか否かを判定する(ステップS62)。デバッグ処理部411は、変数の種類はグローバル変数であると判定した場合、波形情報取得部420およびデバッグ情報取得部416を介して波形データファイル140からCPU内のメモリの該当アドレス(ステップS61で特定したアドレス)のデータを変数の値として取得し(ステップS63)、取得した変数の値をデバッグ情報出力部170(GUI)に表示する(ステップS64)。また、デバッグ処理部411は、変数の種類はグローバル変数ではない(変数の種類はローカル変数である)と判定した場合、波形情報取得部420およびデバッグ情報取得部416を介して波形データファイル140からCPU内のメモリに格納されている実行対象関数のスタックフレームデータを取得し(ステップS65)、取得したスタックフレームデータに指定変数名の変数が含まれているか否かを判定する(ステップS66)。デバッグ処理部411は、スタックフレームデータに指定変数名の変数は含まれていると判定した場合、スタックフレームデータから変数の値を抽出し(ステップS67)、抽出した変数の値をデバッグ情報出力部170(GUI)に表示する(ステップS68)。なお、デバッグ処理部411は、スタックフレームデータに指定変数名の変数は含まれていないと判定した場合、デバッグ情報出力部170(GUI)に何も表示しない。   FIG. 11 shows variable value display processing. FIG. 11A shows the data flow during the variable value display process, and FIG. 11B shows the operation during the variable value display process. When a variable value display command (including a variable name) is input in advance via the debug control unit 160 (GUI), a break occurrence notification or execution stop notification is sent from the debug information acquisition unit 416 to the debug processing unit 411. Is issued, the debug processing unit 411 uses the additional information for debugging in the execution file 120 to identify the address and type of the variable of the specified variable name (step S61). Next, the debug processing unit 411 determines whether or not the variable type is a global variable (step S62). If the debug processing unit 411 determines that the type of the variable is a global variable, the corresponding address of the memory in the CPU (specified in step S61) from the waveform data file 140 via the waveform information acquisition unit 420 and the debug information acquisition unit 416. Data) is acquired as a variable value (step S63), and the acquired variable value is displayed on the debug information output unit 170 (GUI) (step S64). Further, when the debug processing unit 411 determines that the variable type is not a global variable (the variable type is a local variable), the debug processing unit 411 receives the waveform information from the waveform data file 140 via the waveform information acquisition unit 420 and the debug information acquisition unit 416. The stack frame data of the execution target function stored in the memory in the CPU is acquired (step S65), and it is determined whether or not the acquired stack frame data includes a variable with the specified variable name (step S66). If the debug processing unit 411 determines that the variable having the specified variable name is included in the stack frame data, the debug processing unit 411 extracts the value of the variable from the stack frame data (step S67), and uses the extracted variable value as the debug information output unit. 170 (GUI) is displayed (step S68). Note that if the debug processing unit 411 determines that the variable of the specified variable name is not included in the stack frame data, nothing is displayed on the debug information output unit 170 (GUI).

図12は、メモリデータ表示処理を示している。図12(a)はメモリデータ表示処理時のデータの流れを示しており、図12(b)はメモリデータ表示処理時の動作を示している。デバッグ制御部160(GUI)を介してメモリデータ表示コマンド(アドレスを含む)が予め入力されている場合には、デバッグ情報取得部416からデバッグ情報処理部411に対してブレーク発生通知または実行停止通知が発行されると、デバッグ処理部411は、波形情報取得部420およびデバッグ情報取得部416を介して波形データファイル140からCPU内のメモリの指定アドレス(指定アドレス範囲)のデータを取得し(ステップS71)、取得したメモリデータをデバッグ情報出力部170(GUI)に表示する(ステップS72)。   FIG. 12 shows the memory data display process. FIG. 12A shows the data flow during the memory data display process, and FIG. 12B shows the operation during the memory data display process. When a memory data display command (including an address) is input in advance via the debug control unit 160 (GUI), a break occurrence notification or an execution stop notification is sent from the debug information acquisition unit 416 to the debug information processing unit 411. Is issued, the debug processing unit 411 acquires the data of the specified address (specified address range) of the memory in the CPU from the waveform data file 140 via the waveform information acquisition unit 420 and the debug information acquisition unit 416 (step S71) The acquired memory data is displayed on the debug information output unit 170 (GUI) (step S72).

図13は、波形表示処理を示している。図13(a)は波形表示処理時のデータの流れを示しており、図13(b)は波形表示処理時の動作を示している。デバッグ情報取得部416から波形情報表示部430に対して波形表示指示(時刻を含む)が発行されると(継続実行処理またはステップ実行処理が終了すると)、波形情報表示部430は、デバッグ情報取得部416で保持されている時刻を取得する(ステップS81)。そして、波形情報表示部430は、波形情報取得部420を介して波形データファイル140から指定時刻(デバッグ情報取得部416から供給される時刻)に対応する波形情報を取得し(ステップS82)、取得した波形情報を波形情報出力部180(GUI)に表示する(ステップS83)。これにより、波形情報の表示とデバッグ情報(ソースコード、変数値やメモリデータ等)の表示とを同期させることが可能である。   FIG. 13 shows the waveform display process. FIG. 13A shows the flow of data during the waveform display process, and FIG. 13B shows the operation during the waveform display process. When a waveform display instruction (including time) is issued from the debug information acquisition unit 416 to the waveform information display unit 430 (when the continuous execution process or the step execution process ends), the waveform information display unit 430 acquires the debug information. The time held by the unit 416 is acquired (step S81). Then, the waveform information display unit 430 acquires the waveform information corresponding to the specified time (the time supplied from the debug information acquisition unit 416) from the waveform data file 140 via the waveform information acquisition unit 420 (Step S82). The obtained waveform information is displayed on the waveform information output unit 180 (GUI) (step S83). Thereby, it is possible to synchronize the display of waveform information and the display of debug information (source code, variable values, memory data, etc.).

次に、以上のような各種処理により実現されるデバッグ機能を使用してソフトウェアデバッグを実施する場合について説明する。   Next, a case where software debugging is performed using a debugging function realized by the various processes as described above will be described.

図14は、ソフトウェアデバッグの処理フローの一例を示している。まず、ソフトウェア開発者がデバッグ制御部160(GUI)を介して初期化コマンドを入力することで、デバッグ情報取得部416において、波形データファイル140から取得したソフトウェア実行開始位置情報(時刻およびプログラムカウンタの値)が保持される(ステップS101)。次に、ソフトウェア開発者がデバッグ制御部160(GUI)を介してブレークポイント設定コマンドを入力することで、デバッグ情報取得部416において、ブレークポイントの値が保持される(ステップS102)。この後、ソフトウェア開発者がデバッグ制御部160(GUI)を介して継続実行コマンドを入力することで、デバッグ情報取得部416において、保持されているプログラムカウンタの値がブレークポイントの値と一致するまで、PC変化位置情報(時刻およびプログラムカウンタの値)を取得して時刻およびプログラムカウンタの値を更新する処理が繰り返される(ステップS103)。デバッグ情報取得部416において、保持されているプログラムカウンタの値がブレークポイントの値と一致すると、デバッグ情報取得部416からデバッグ処理部411に対してブレーク発生通知が発行される(ステップS104)。これに伴って、デバッグ情報(プログラムカウンタの値に対応するソースコード等)がデバッグ情報出力部170(GUI)に表示される(ステップS105)。そして、ソフトウェア開発者は、デバッグ情報出力部170(GUI)に表示されたデバッグ情報に基づいてソフトウェアの不具合解析を実施し、デバッグを終了するか否かを判断する(ステップS106)。ソフトウェア開発者がデバッグを終了しない(デバッグを継続する)と判断した場合には、ソフトウェア開発者がデバッグ制御部160(GUI)を介してステップ実行コマンドを入力することで、デバッグ情報取得部416において、保持されている時刻およびプログラムカウンタの値が更新され、CPUのソフトウェア実行状態が擬似的に1ステップ進められる(ステップS107)。これに伴って、デバッグ情報出力部170(GUI)に表示されるデバッグ情報が更新される。そして、ソフトウェア開発者は、ソフトウェアの不具合を特定できた場合、デバッグを終了すると判断し、ソースファイル110のソースコードを修正する(ステップS108)。   FIG. 14 shows an example of a processing flow of software debugging. First, when a software developer inputs an initialization command via the debug control unit 160 (GUI), the debug information acquisition unit 416 performs software execution start position information (time and program counter information acquired from the waveform data file 140). Value) is held (step S101). Next, when the software developer inputs a breakpoint setting command via the debug control unit 160 (GUI), the debug information acquisition unit 416 holds the breakpoint value (step S102). Thereafter, the software developer inputs a continuous execution command via the debug control unit 160 (GUI) until the value of the program counter held in the debug information acquisition unit 416 matches the value of the breakpoint. The process of acquiring the PC change position information (time and program counter value) and updating the time and program counter value is repeated (step S103). When the stored program counter value matches the breakpoint value in the debug information acquisition unit 416, a break occurrence notification is issued from the debug information acquisition unit 416 to the debug processing unit 411 (step S104). Along with this, debug information (such as source code corresponding to the value of the program counter) is displayed on the debug information output unit 170 (GUI) (step S105). Then, the software developer performs a software failure analysis based on the debug information displayed on the debug information output unit 170 (GUI), and determines whether or not to end the debugging (step S106). When the software developer determines that the debugging is not finished (continues the debugging), the software developer inputs a step execution command via the debug control unit 160 (GUI), so that the debug information acquisition unit 416 The held time and the value of the program counter are updated, and the software execution state of the CPU is advanced one step in a pseudo manner (step S107). Along with this, the debug information displayed on the debug information output unit 170 (GUI) is updated. Then, when the software developer can identify the software defect, the software developer determines that the debugging is finished, and corrects the source code of the source file 110 (step S108).

以上のような本発明の一実施形態では、ISSを使用せずに波形データファイルからCPUの内部動作に関する情報を取得してソフトウェアデバッグ機能を実現しているため、ハードウェアのシミュレーションを同時に実施する必要がなくなる。従って、コ・エミュレーションを用いた場合に比べて大幅に実行速度を向上させることが可能になる(コ・エミュレーション:数十kHz程度、本発明の一実施形態:数百kHz程度)。これにより、ソフトウェアデバッグを短時間で実施することができる。この結果、ハードウェア/ソフトウェア混在システムの開発期間の短縮に大きく寄与することができる。   In the embodiment of the present invention as described above, since the software debugging function is realized by acquiring information related to the internal operation of the CPU from the waveform data file without using the ISS, the hardware simulation is simultaneously performed. There is no need. Therefore, the execution speed can be significantly improved as compared with the case where co-emulation is used (co-emulation: about several tens of kHz, one embodiment of the present invention: about several hundred kHz). Thereby, software debugging can be performed in a short time. As a result, it can greatly contribute to shortening the development period of the hardware / software mixed system.

以上の実施形態に関して、更に以下の付記を開示する。
(付記1)
CPUを含むハードウェアおよび前記CPUにより実行されるソフトウェアを組み合わせて実現されるシステムについて、コンピュータ上で前記ソフトウェアをデバッグするデバッグ方法であって、
前記システムのシミュレーションにより生成された波形データファイル、前記CPUの構成要素を定義したCPU定義ファイル、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルを入力する第1工程と、
前記波形データファイルおよび前記CPU定義ファイルに基づいて時刻情報およびCPU内部動作情報を取得して、前記CPUのソフトウェア実行状態を再現する第2工程と、
前記時刻情報、前記CPU内部動作情報、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルに基づいてデバッグ情報を表示する第3工程とを含むことを特徴とするデバッグ方法。
(付記2)
付記1に記載のデバッグ方法において、
前記第2工程は、
前記時刻情報および前記CPU内部動作情報を前記CPU内のプログラムカウンタの値が次に変化する際の情報に更新する処理を繰り返すことにより、前記CPUのソフトウェア実行状態を所望の状態まで進める継続実行工程と、
前記時刻情報および前記CPU内部動作情報を前記CPU内のプログラムカウンタの値が次に変化する際の情報に更新することにより、前記CPUのソフトウェア実行状態を次の状態まで進めるステップ実行工程とを含むことを特徴とするデバッグ方法。
(付記3)
付記2に記載のデバッグ方法において、
前記第2工程は、前記継続実行工程の実施中に前記CPU内部動作情報に含まれる前記CPU内のプログラムカウンタの値が予め設定されたブレークポイントの値と一致するのに伴って、ブレーク発生を通知して前記継続実行工程を終了させるブレーク工程を含むことを特徴とするデバッグ方法。
(付記4)
付記1〜付記3のいずれか1項に記載のデバッグ方法において、
前記第3工程は、前記CPU内部動作情報に含まれる前記CPU内のプログラムカウンタの値に対応する前記ソフトウェアのソースコードを表示するソースコード表示工程を含むことを特徴とするデバッグ方法。
(付記5)
付記1〜付記4のいずれか1項に記載のデバッグ方法において、
前記第3工程は、前記CPU内部動作情報に含まれる前記ソフトウェアの指定変数の値を表示する変数値表示工程を含むことを特徴とするデバッグ方法。
(付記6)
付記1〜付記5のいずれか1項に記載のデバッグ方法において、
前記第3工程は、前記CPU内部動作情報に含まれる前記CPU内のメモリの指定アドレスのデータを表示するメモリデータ表示工程を含むことを特徴とするデバッグ方法。
(付記7)
付記1〜付記6のいずれか1項に記載のデバッグ方法において、
前記時刻情報および前記波形データファイルに基づいて波形情報を表示する第4工程を含むことを特徴とするデバッグ方法。
(付記8)
CPUを含むハードウェアおよび前記CPUにより実行されるソフトウェアを組み合わせて実現されるシステムについて前記ソフトウェアをデバッグするためのコンピュータに、
前記システムのシミュレーションにより生成された波形データファイル、前記CPUの構成要素を定義したCPU定義ファイル、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルを入力する第1工程と、
前記波形データファイルおよび前記CPU定義ファイルに基づいて時刻情報およびCPU内部動作情報を取得して前記CPUのソフトウェア実行状態を再現する第2工程と、
前記時刻情報、前記CPU内部動作情報、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルに基づいてデバッグ情報を表示する第3工程とを実行させることを特徴とするデバッグプログラム。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
A debugging method for debugging the software on a computer for a system realized by combining hardware including a CPU and software executed by the CPU,
A first step of inputting a waveform data file generated by simulation of the system, a CPU definition file defining the components of the CPU, a source file of the software, and an execution file of the software;
A second step of acquiring time information and CPU internal operation information based on the waveform data file and the CPU definition file, and reproducing the software execution state of the CPU;
And a third step of displaying debug information based on the time information, the CPU internal operation information, the software source file, and the software execution file.
(Appendix 2)
In the debugging method described in Appendix 1,
The second step includes
Continuous execution step of advancing the software execution state of the CPU to a desired state by repeating the process of updating the time information and the CPU internal operation information to information when the value of the program counter in the CPU next changes When,
A step execution step of updating the software execution state of the CPU to the next state by updating the time information and the CPU internal operation information to information when the value of the program counter in the CPU changes next. A debugging method characterized by that.
(Appendix 3)
In the debugging method described in Appendix 2,
In the second step, a break occurs when the value of the program counter in the CPU included in the CPU internal operation information coincides with a preset break point value during the execution of the continuous execution step. A debugging method comprising a break step of notifying and terminating the continuous execution step.
(Appendix 4)
In the debugging method according to any one of appendix 1 to appendix 3,
The debugging method according to claim 3, wherein the third step includes a source code display step of displaying a source code of the software corresponding to a value of a program counter in the CPU included in the CPU internal operation information.
(Appendix 5)
In the debugging method according to any one of appendix 1 to appendix 4,
The debugging method according to claim 3, wherein the third step includes a variable value display step of displaying a value of a designated variable of the software included in the CPU internal operation information.
(Appendix 6)
In the debugging method according to any one of appendix 1 to appendix 5,
The debugging method according to claim 3, wherein the third step includes a memory data display step of displaying data at a specified address of a memory in the CPU included in the CPU internal operation information.
(Appendix 7)
In the debugging method according to any one of appendix 1 to appendix 6,
A debugging method comprising: a fourth step of displaying waveform information based on the time information and the waveform data file.
(Appendix 8)
A computer for debugging the software of a system realized by combining hardware including a CPU and software executed by the CPU,
A first step of inputting a waveform data file generated by simulation of the system, a CPU definition file defining the components of the CPU, a source file of the software, and an execution file of the software;
A second step of acquiring time information and CPU internal operation information based on the waveform data file and the CPU definition file and reproducing the software execution state of the CPU;
And a third step of displaying debug information based on the time information, the CPU internal operation information, the software source file, and the software execution file.

以上、本発明について詳細に説明してきたが、前述の実施形態は発明の一例に過ぎず、本発明はこれに限定されるものではない。本発明を逸脱しない範囲で変形可能であることは明らかである。   Although the present invention has been described in detail above, the above-described embodiment is merely an example of the present invention, and the present invention is not limited to this. Obviously, modifications can be made without departing from the scope of the present invention.

本発明の一実施形態を示す図である。It is a figure which shows one Embodiment of this invention. CPU定義ファイルの一例を示す図である。It is a figure which shows an example of a CPU definition file. ソフトウェアデバッグ部の詳細を示す図である。It is a figure which shows the detail of a software debug part. デバッグAPIの一例を示す図である。It is a figure which shows an example of debug API. 波形情報取得APIの一例を示す図である。It is a figure which shows an example of waveform information acquisition API. 初期化処理を示す図である。It is a figure which shows the initialization process. ブレークポイント設定処理示す図である。It is a figure which shows a breakpoint setting process. 継続実行処理を示す図である。It is a figure which shows a continuous execution process. ステップ実行処理を示す図である。It is a figure which shows a step execution process. ソースコード表示処理を示す図である。It is a figure which shows a source code display process. 変数値表示処理を示す図である。It is a figure which shows a variable value display process. メモリデータ表示処理を示す図である。It is a figure which shows a memory data display process. 波形表示処理を示す図である。It is a figure which shows a waveform display process. ソフトウェアデバッグの処理フローの一例を示す図である。It is a figure which shows an example of the processing flow of software debugging. SoCの一例を示す図である。It is a figure which shows an example of SoC. SoC開発工程の一例を示す図である。It is a figure which shows an example of a SoC development process. コ・シミュレーションの概要を示す図である。It is a figure which shows the outline | summary of co-simulation. コ・エミュレーションの概要を示す図である。It is a figure which shows the outline | summary of co-emulation.

符号の説明Explanation of symbols

100‥コンピュータ;110‥ソースファイル;120‥実行ファイル;130‥HDL記述ファイル;140‥波形データファイル;150‥CPU定義ファイル;160‥デバッグ制御部;170‥デバッグ情報出力部;180‥波形情報出力部;200‥コンパイラ/リンカ;300‥エミュレータ;400‥デバッグプログラム;410‥ソフトウェアデバッグ部;411‥デバッグ処理部;412‥初期化制御部;413‥実行制御部;414‥ブレーク制御部;415‥デバッグ情報表示部;416‥デバッグ情報取得部;417‥波形情報処理部;418‥デバッグ情報処理部;419‥情報保持部;420‥波形情報取得部;430‥波形情報表示部 100. Computer; 110 Source file; 120 Executable file; 130 HDL description file; 140 Waveform data file; 150 CPU definition file; 160 Debug control unit; 170 Debug information output unit; 200: Compiler / Linker; 300 ... Emulator; 400 ... Debug Program; 410 ... Software Debugging Unit; 411 ... Debug Processing Unit; 412 ... Initialization Control Unit; Debug information display section; 416 Debug information acquisition section; 417 Waveform information processing section; 418 Debug information processing section; 419 Information storage section; 420 Waveform information acquisition section; 430 Waveform information display section

Claims (5)

CPUを含むハードウェアおよび前記CPUにより実行されるソフトウェアを組み合わせて実現されるシステムについて、コンピュータ上で前記ソフトウェアをデバッグするデバッグ方法であって、
前記システムのシミュレーションにより生成された波形データファイル、前記CPUの構成要素を定義したCPU定義ファイル、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルを入力する第1工程と、
前記波形データファイルおよび前記CPU定義ファイルに基づいて時刻情報およびCPU内部動作情報を取得して、前記CPUのソフトウェア実行状態を再現する第2工程と、
前記時刻情報、前記CPU内部動作情報、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルに基づいてデバッグ情報を表示する第3工程とを含むことを特徴とするデバッグ方法。
A debugging method for debugging the software on a computer for a system realized by combining hardware including a CPU and software executed by the CPU,
A first step of inputting a waveform data file generated by simulation of the system, a CPU definition file defining the components of the CPU, a source file of the software, and an execution file of the software;
A second step of acquiring time information and CPU internal operation information based on the waveform data file and the CPU definition file, and reproducing the software execution state of the CPU;
And a third step of displaying debug information based on the time information, the CPU internal operation information, the software source file, and the software execution file.
請求項1に記載のデバッグ方法において、
前記第2工程は、
前記時刻情報および前記CPU内部動作情報を前記CPU内のプログラムカウンタの値が次に変化する際の情報に更新する処理を繰り返すことにより、前記CPUのソフトウェア実行状態を所望の状態まで進める継続実行工程と、
前記時刻情報および前記CPU内部動作情報を前記CPU内のプログラムカウンタの値が次に変化する際の情報に更新することにより、前記CPUのソフトウェア実行状態を次の状態まで進めるステップ実行工程とを含むことを特徴とするデバッグ方法。
The debugging method according to claim 1,
The second step includes
Continuous execution step of advancing the software execution state of the CPU to a desired state by repeating the process of updating the time information and the CPU internal operation information to information when the value of the program counter in the CPU next changes When,
A step execution step of updating the software execution state of the CPU to the next state by updating the time information and the CPU internal operation information to information when the value of the program counter in the CPU changes next. A debugging method characterized by that.
請求項2に記載のデバッグ方法において、
前記第2工程は、前記継続実行工程の実施中に前記CPU内部動作情報に含まれる前記CPU内のプログラムカウンタの値が予め設定されたブレークポイントの値と一致するのに伴って、ブレーク発生を通知して前記継続実行工程を終了させるブレーク工程を含むことを特徴とするデバッグ方法。
The debugging method according to claim 2, wherein
In the second step, a break occurs when the value of the program counter in the CPU included in the CPU internal operation information coincides with a preset break point value during the execution of the continuous execution step. A debugging method comprising a break step of notifying and terminating the continuous execution step.
請求項1〜請求項3のいずれか1項に記載のデバッグ方法において、
前記第3工程は、前記CPU内部動作情報に含まれる前記CPU内のプログラムカウンタの値に対応する前記ソフトウェアのソースコードを表示するソースコード表示工程を含むことを特徴とするデバッグ方法。
In the debugging method of any one of Claims 1-3,
The debugging method according to claim 3, wherein the third step includes a source code display step of displaying a source code of the software corresponding to a value of a program counter in the CPU included in the CPU internal operation information.
CPUを含むハードウェアおよび前記CPUにより実行されるソフトウェアを組み合わせて実現されるシステムについて前記ソフトウェアをデバッグするためのコンピュータに、
前記システムのシミュレーションにより生成された波形データファイル、前記CPUの構成要素を定義したCPU定義ファイル、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルを入力する第1工程と、
前記波形データファイルおよび前記CPU定義ファイルに基づいて時刻情報およびCPU内部動作情報を取得して前記CPUのソフトウェア実行状態を再現する第2工程と、
前記時刻情報、前記CPU内部動作情報、前記ソフトウェアのソースファイルおよび前記ソフトウェアの実行ファイルに基づいてデバッグ情報を表示する第3工程とを実行させることを特徴とするデバッグプログラム。
A computer for debugging the software of a system realized by combining hardware including a CPU and software executed by the CPU,
A first step of inputting a waveform data file generated by simulation of the system, a CPU definition file defining the components of the CPU, a source file of the software, and an execution file of the software;
A second step of acquiring time information and CPU internal operation information based on the waveform data file and the CPU definition file and reproducing the software execution state of the CPU;
And a third step of displaying debug information based on the time information, the CPU internal operation information, the software source file, and the software execution file.
JP2008167187A 2008-06-26 2008-06-26 Debugging method and debugging program Expired - Fee Related JP5120103B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008167187A JP5120103B2 (en) 2008-06-26 2008-06-26 Debugging method and debugging program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008167187A JP5120103B2 (en) 2008-06-26 2008-06-26 Debugging method and debugging program

Publications (2)

Publication Number Publication Date
JP2010009279A JP2010009279A (en) 2010-01-14
JP5120103B2 true JP5120103B2 (en) 2013-01-16

Family

ID=41589705

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008167187A Expired - Fee Related JP5120103B2 (en) 2008-06-26 2008-06-26 Debugging method and debugging program

Country Status (1)

Country Link
JP (1) JP5120103B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6477196B2 (en) * 2015-04-23 2019-03-06 株式会社明電舎 Linkage method and linkage program between digital circuit simulator waveform and software design drawing
CN112948200A (en) * 2021-02-01 2021-06-11 湖南品腾电子科技有限公司 MCU-based memory reusability verification system and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001350646A (en) * 2000-06-06 2001-12-21 Advantest Corp Semiconductor testing system
JP2002108649A (en) * 2000-09-29 2002-04-12 Toshiba Corp Recording medium in which program to support trace analysis is recorded and program product
JP2002342113A (en) * 2001-05-15 2002-11-29 Hitachi Ltd Method for displaying program performance situation, performing device thereof and processing program thereof
JP2007334812A (en) * 2006-06-19 2007-12-27 Nec Electronics Corp Simulator and simulation method

Also Published As

Publication number Publication date
JP2010009279A (en) 2010-01-14

Similar Documents

Publication Publication Date Title
US8180620B2 (en) Apparatus and method for performing hardware and software co-verification testing
JP2795244B2 (en) Program debugging system
WO2007001108A1 (en) System for providing feature-oriented software product line engineering environment
US20070061641A1 (en) Apparatus and method for generating test driver
US10592703B1 (en) Method and system for processing verification tests for testing a design under test
Iyenghar et al. Towards model-based test automation for embedded systems using UML and UTP
JP6763153B2 (en) Hardware / software co-verification device and hardware / software co-verification method
US20090112554A1 (en) Test Bench, Method, and Computer Program Product for Performing a Test Case on an Integrated Circuit
Goli et al. Automated design understanding of SystemC-based virtual prototypes: Data extraction, analysis and visualization
JP2004348606A (en) Higher-order synthesizer, model creation method for hardware verification, and hardware verification method
JP5120103B2 (en) Debugging method and debugging program
CN109783837A (en) Emulator, analogue system, emulation mode and simulated program
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
Patel et al. Model-driven validation of SystemC designs
Friske et al. Improving test coverage for UML state machines using transition instrumentation
Tolvanen et al. Metamodeling for medical devices: Code generation, model-debugging and run-time synchronization
JP6318976B2 (en) DEBUG CIRCUIT, DEBUGGER DEVICE, SEMICONDUCTOR DEVICE, AND DEBUG METHOD
JP5387521B2 (en) Logic verification scenario generation device and logic verification scenario generation program
JP2016126700A (en) Program verification device, program verification method, and program verification program
JP3745968B2 (en) Test system, test method, test program, and computer-readable recording medium recording the test program
CN117313650B (en) Chip test verification method and application device thereof
JP2009217720A (en) Program generating device and program generating method
JP4893028B2 (en) Chipset emulation apparatus and method
Bhasin et al. Software Architecture Based Regression Testing
JP6147094B2 (en) Information processing apparatus, information processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110315

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120912

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120925

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121008

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

Free format text: PAYMENT UNTIL: 20151102

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees