JP2011170749A - Simulation device and simulation method - Google Patents

Simulation device and simulation method Download PDF

Info

Publication number
JP2011170749A
JP2011170749A JP2010035920A JP2010035920A JP2011170749A JP 2011170749 A JP2011170749 A JP 2011170749A JP 2010035920 A JP2010035920 A JP 2010035920A JP 2010035920 A JP2010035920 A JP 2010035920A JP 2011170749 A JP2011170749 A JP 2011170749A
Authority
JP
Japan
Prior art keywords
function
instruction
address
stack
functions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010035920A
Other languages
Japanese (ja)
Other versions
JP5504960B2 (en
Inventor
Takayuki Sasaki
貴行 佐々木
Junichi Niitsuma
潤一 新妻
Hiroaki Fujimoto
博昭 藤本
Takashi Fujita
隆司 藤田
Yoshikazu Motomura
義和 本村
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 JP2010035920A priority Critical patent/JP5504960B2/en
Publication of JP2011170749A publication Critical patent/JP2011170749A/en
Application granted granted Critical
Publication of JP5504960B2 publication Critical patent/JP5504960B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To easily verify a design target. <P>SOLUTION: A detection part 11 detects an address range on a memory 22 in which each function executed in a design target 20 is arranged or an address on the memory 22 in which an instruction that moves between functions is arranged. A functional stack generation part 12 compares the address of each instruction executed in the design target 20 with the address range on the memory 22 in which each function is arranged or the address of the instruction that moves between the functions, and generates a functional stack indicative of call relations between the functions according to the result of the comparison. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、シミュレーション装置及びシミュレーション方法に関する。   The present invention relates to a simulation apparatus and a simulation method.

今日のデジタルシステム及びLSI(Large Scale Integrated circuit)の開発において、ソフトウェアとハードウェアが混在したシステムの開発が一般的になってきている。そのようなシステムの開発の際には、ソフトウェアとハードウェアの協調検証が行われ、性能などの最適化が図られている。   In the development of today's digital systems and LSIs (Large Scale Integrated circuits), it has become common to develop systems in which software and hardware are mixed. When developing such a system, software and hardware are collaboratively verified to optimize performance and the like.

ソフトウェアとハードウェアの協調検証の手法として、ソフトウェアの命令を実行する命令セットシミュレータ(ISS:Instruction Set Simulator)と、ハードウェア論理シミュレータやエミュレータを協調させる方法がある。また、ハードウェア論理シミュレーションなどで、プロセッサの実データを使ってソフトウェアを実行させる場合もある。   As a method of cooperative verification between software and hardware, there is a method of coordinating an instruction set simulator (ISS) that executes software instructions with a hardware logic simulator or emulator. In some cases, hardware logic simulation is used to execute software using actual processor data.

特開2007−328722号公報JP 2007-328722 A 特開2003−208339号公報JP 2003-208339 A 特開平10−289128号公報JP-A-10-289128

しかしながら、従来のソフトウェアとハードウェアの協調検証では、ソフトウェアの状態を検証する際、実行中の各関数が本質的には何をしているのかを検証することは困難であった。たとえば、主要関数を見れば処理概要をつかめる可能性もあるが、標準関数(除算関数や剰余算関数など)のような小さな関数は様々な関数から呼ばれるため、実際にはどのような機能を実現するために実行されているのかわかりづらい。   However, in the conventional collaborative verification of software and hardware, when verifying the state of software, it is difficult to verify what each function being executed essentially does. For example, if you look at the main functions, you may get an overview of the processing, but small functions such as standard functions (such as division functions and remainder calculation functions) are called from various functions, so what functions are actually realized. It is hard to understand what is being done to do.

これにより、ソフトウェアとハードウェアの協調検証が困難となっていた。
上記の点を鑑みて、本発明は、設計対象の検証を容易に行うことが可能なシミュレーション装置及びシミュレーション方法を提供することを目的とする。
This made it difficult to collaborate between software and hardware.
In view of the above points, an object of the present invention is to provide a simulation apparatus and a simulation method capable of easily verifying a design object.

上記目的を達成するために、以下のようなシミュレーション装置が提供される。
このシミュレーション装置は、設計対象において実行される各関数が配置されるメモリ上のアドレス範囲、または関数間を移動する命令が配置される前記メモリ上のアドレスを検出する検出部と、前記設計対象で実行される各命令のアドレスと、前記アドレス範囲または前記関数間を移動する命令の前記アドレスとを比較し、比較結果に応じて前記関数間の呼び出し関係を示す関数スタックを生成する関数スタック生成部と、を有する。
In order to achieve the above object, the following simulation apparatus is provided.
The simulation apparatus includes: a detection unit that detects an address range on a memory in which each function to be executed on a design target is arranged, or an address on the memory in which an instruction to move between functions is arranged; and the design target A function stack generation unit that compares the address of each instruction to be executed with the address of the instruction that moves between the address range or the functions and generates a function stack indicating a call relationship between the functions according to the comparison result And having.

開示のシミュレーション装置及びシミュレーション方法によれば、設計対象の検証を容易に行うことができる。   According to the disclosed simulation apparatus and simulation method, it is possible to easily verify a design object.

第1の実施の形態に係るシミュレーション装置を示す図である。It is a figure which shows the simulation apparatus which concerns on 1st Embodiment. 第2の実施の形態に係るコンピュータのハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the computer which concerns on 2nd Embodiment. 本実施の形態のシミュレーション方法の概略を説明する図である。It is a figure explaining the outline of the simulation method of this Embodiment. 設計対象で実行させるソフトウェアの実行形式ファイルを生成する処理の流れを示す図である。It is a figure which shows the flow of the process which produces | generates the execution format file of the software performed with respect to a design object. ディスアセンブルデータの一例を示す図である。It is a figure which shows an example of disassembled data. 割り込みベクタデータの一例を示す図である。It is a figure which shows an example of interrupt vector data. 抽出された関数レンジデータ及び関数間を移動する命令のアドレスの一例の内容を示す図である。It is a figure which shows the content of an example of the address of the command which moves between the extracted function range data and a function. 命令トレースデータの一例を示す図である。It is a figure which shows an example of instruction trace data. 関数スタック生成処理の流れを示す図である。It is a figure which shows the flow of a function stack production | generation process. 関数スタック生成処理の他の例を示す図である。It is a figure which shows the other example of a function stack production | generation process. 関数スタックリストに関数スタックを追加した一例を示す図である。It is a figure which shows an example which added the function stack to the function stack list. CALL命令の検出後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after the detection of a CALL instruction. CALL命令実行後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after CALL instruction execution. RET命令の検出後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after the detection of a RET instruction. RET命令実行後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after RET instruction execution. 割り込みベクタ処理後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after an interrupt vector process. RETI命令の検出時の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list at the time of detection of a RETI instruction. RETI命令実行後の関数スタックリストの一例の状態を示す図である。It is a figure which shows the state of an example of a function stack list after execution of a RETI instruction. 設計対象において実行されるプログラムに含まれるコードと、それを実行して得られた命令トレースデータの一例を示す図である。It is a figure which shows an example of the code contained in the program run in a design object, and the instruction trace data obtained by performing it. 関数トレース情報の一例を示す図である。It is a figure which shows an example of function trace information. 関数トレース情報の他の表示例を示す図である。It is a figure which shows the other example of a display of function trace information. 第3の実施の形態に係るシミュレーション装置の構成を示す図である。It is a figure which shows the structure of the simulation apparatus which concerns on 3rd Embodiment.

以下、本発明のシミュレーション装置及びシミュレーション方法の実施の形態を、図面を参照しつつ説明する。
〔第1の実施の形態〕
図1は、第1の実施の形態に係るシミュレーション装置を示す図である。
Hereinafter, embodiments of a simulation apparatus and a simulation method of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating a simulation apparatus according to the first embodiment.

シミュレーション装置10は、たとえば、SoC(System on a Chip)などのLSIや、各種デジタルシステムの協調設計において、ソフトウェアとハードウェアの協調検証を行うものである。   The simulation apparatus 10 performs, for example, cooperative verification of software and hardware in the cooperative design of LSIs such as SoC (System on a Chip) and various digital systems.

シミュレーション装置10は、検出部11、関数スタック生成部12、関数トレース情報表示部13、記憶部D1,D2,D3,D4,D5を有する。
また、図1では、シミュレーション装置10が検証を行う設計対象の一例の概略構成を示している。この設計対象20は、プログラムカウンタ(PC)21aを含むようなプロセッサ21と、メモリ22を有する。
The simulation apparatus 10 includes a detection unit 11, a function stack generation unit 12, a function trace information display unit 13, and storage units D1, D2, D3, D4, and D5.
In addition, FIG. 1 illustrates a schematic configuration of an example of a design target to be verified by the simulation apparatus 10. The design object 20 includes a processor 21 including a program counter (PC) 21 a and a memory 22.

検出部11は、設計対象20において実行されるソフトウェアの各関数が配置されるメモリ22上のアドレス範囲(以下関数レンジという)、または関数間を移動する命令が配置されるメモリ22上のアドレスなどを検出する。たとえば、検出部11は、ソースコードに対するコンパイル―リンク処理時に、リンカによって実行形式ファイルとともに生成されるデータ(以下リンカデータという)から、関数レンジデータまたは関数間を移動する命令のアドレスを検出する。リンカデータの詳細については後述する。   The detection unit 11 includes an address range on the memory 22 in which each function of software executed on the design target 20 is arranged (hereinafter referred to as a function range), an address on the memory 22 in which an instruction for moving between functions is arranged, or the like. Is detected. For example, the detection unit 11 detects function range data or the address of an instruction that moves between functions from data (hereinafter referred to as linker data) generated by a linker together with an execution format file during compile-link processing for source code. Details of the linker data will be described later.

図1の例では、検出部11は記憶部D1に記憶されたリンカデータから、関数レンジデータまたは関数間を移動する命令のアドレスを検出し、関数レンジデータを記憶部D3、関数間を移動する命令のアドレスを記憶部D4に記憶する。   In the example of FIG. 1, the detection unit 11 detects function address data or the address of an instruction that moves between functions from the linker data stored in the storage unit D1, and moves the function range data between the storage unit D3 and the function. The address of the instruction is stored in the storage unit D4.

関数スタック生成部12は、設計対象20で実行される各命令のアドレスと、関数レンジデータまたは関数間を移動する命令のアドレスとを比較し、比較結果に応じて関数間の呼び出し関係を示す関数スタックを生成する。図1の例では、関数スタックは記憶部D5に記憶される。   The function stack generation unit 12 compares the address of each instruction executed on the design target 20 with the address of the function range data or the instruction that moves between functions, and indicates a call relationship between functions according to the comparison result Create a stack. In the example of FIG. 1, the function stack is stored in the storage unit D5.

設計対象20で実行される各命令のアドレスは、ハードウェア論理シミュレーションで、プログラムカウンタ21aのプログラムカウンタ値をトレースすることで取得可能である。また、各命令のアドレスは、プロセッサ21における図示しないプロセッサコアとキャッシュメモリ間のアドレス線のトレースをとっても取得可能である。   The address of each instruction executed on the design target 20 can be acquired by tracing the program counter value of the program counter 21a by hardware logic simulation. The address of each instruction can also be obtained by tracing the address line between the processor core (not shown) and the cache memory in the processor 21.

関数トレース情報表示部13は、設計対象20におけるシミュレーション時刻に応じた、関数スタックの履歴を関数トレース情報として表示する。
設計対象20において実行される命令のアドレスは命令トレースデータとして、記憶部D2に記憶されている。以下では、設計対象20において実行される各命令のアドレスをプログラムカウンタ値として説明する。
The function trace information display unit 13 displays the function stack history as function trace information according to the simulation time in the design target 20.
The address of the instruction executed in the design object 20 is stored in the storage unit D2 as instruction trace data. Hereinafter, the address of each instruction executed in the design target 20 will be described as a program counter value.

関数スタック生成部12は、プログラムカウンタ値と、関数レンジデータとを比較し、そのプログラムカウンタ値であるときのシミュレーション時刻では、どの関数を実行しているのかを特定する。そして、関数スタック生成部12は、プログラムカウンタ値が現在実行中の関数レンジから外れて、新しい関数の関数レンジに入ったことを検出した場合、その関数間の関係から、関数を呼ぶ動作が起きたのか復帰動作が起きたのかなどを判定する。関数スタック生成部12は、判定結果をもとに、関数間の呼び出し関係を示す関数スタックを更新する。   The function stack generation unit 12 compares the program counter value with the function range data and specifies which function is being executed at the simulation time when the program counter value is the program counter value. When the function stack generation unit 12 detects that the program counter value has deviated from the function range currently being executed and has entered the function range of the new function, an operation to call the function occurs from the relationship between the functions. Or whether a return operation has occurred. The function stack generation unit 12 updates the function stack indicating the call relationship between functions based on the determination result.

また、関数スタック生成部12は、プログラムカウンタ値と、関数間を移動する命令のアドレスとの比較結果をもとに、関数スタックを生成することもできる。関数間を移動する命令は、関数の呼び出し命令、元の関数への復帰命令などである。   The function stack generation unit 12 can also generate a function stack based on the comparison result between the program counter value and the address of an instruction that moves between functions. The instructions for moving between functions are a function call instruction, a return instruction to the original function, and the like.

プログラムカウンタ値が、関数間を移動する命令のアドレスを指定した場合、関数スタック生成部12は、その命令がどの関数への移動を指示しているか検出する。そして、関数スタック生成部12は、検出結果をもとに、関数間の呼び出し関係を示す関数スタックを更新する。   When the program counter value specifies the address of an instruction that moves between functions, the function stack generation unit 12 detects which function the instruction instructs to move to. Then, the function stack generation unit 12 updates the function stack indicating the call relationship between functions based on the detection result.

このような関数スタックを参照することで、ユーザは、実行中の各関数がどの関数から呼ばれ、本質的にどのような処理が行われているかなどが容易に検討可能となる。これにより、ソフトウェアとハードウェアの協調検証が容易になる。   By referring to such a function stack, the user can easily study from which function each function being executed is called and what processing is being performed. This facilitates collaborative verification between software and hardware.

なお、関数スタック生成部12は、実際に関数間の移動が生じたか確認するために、関数レンジデータを参照して、プログラムカウンタ値が関数間を移動する命令によって指定された関数のアドレス範囲内であるか確認するようにしてもよい。ここで、関数スタック生成部12は、プログラムカウンタ値が確かに指定された関数のアドレス範囲内となる場合には、関数間の移動を確定し、関数スタックを更新する(詳細は後述する)。   The function stack generation unit 12 refers to the function range data in order to confirm whether or not the actual movement between functions has occurred, and the program counter value is within the address range of the function specified by the instruction to move between functions. You may make it confirm whether it is. Here, when the program counter value is surely within the address range of the designated function, the function stack generation unit 12 determines the movement between the functions and updates the function stack (details will be described later).

関数トレース情報表示部13は、上記のように更新される関数スタックの履歴を関数トレース情報として表示することで、ユーザは、視覚的に関数の呼び出し関係を参照でき、ソフトウェアとハードウェアの協調検証が容易になる。関数トレース情報の表示処理の具体例については後述する。   The function trace information display unit 13 displays the function stack history updated as described above as the function trace information, so that the user can visually refer to the function call relationship, and the software and hardware cooperative verification Becomes easier. A specific example of the function trace information display process will be described later.

また、検出部11は、リンカデータから割り込みに関する情報を検出して、関数スタック生成部12は、割り込みに関する情報をさらに参照して関数スタックを生成するようにしてもよい。この処理の詳細については後述する。   Further, the detection unit 11 may detect information related to the interrupt from the linker data, and the function stack generation unit 12 may generate the function stack by further referring to the information related to the interrupt. Details of this processing will be described later.

また、図1ではデータや命令を記憶する記憶部D1〜D5を図示しているが、1つのメモリにこれらの情報が記憶されていてもよい。
以下の実施の形態では、シミュレーション装置10を汎用的なコンピュータに適用する場合を例にとり、さらに具体的に説明する。
Moreover, although the memory | storage parts D1-D5 which memorize | store data and a command are illustrated in FIG. 1, such information may be memorize | stored in one memory.
In the following embodiment, a case where the simulation apparatus 10 is applied to a general-purpose computer will be described as an example.

[第2の実施の形態]
以下、第2の実施の形態を図面を参照して詳細に説明する。
図2は、第2の実施の形態に係るコンピュータのハードウェア構成を示す図である。
[Second Embodiment]
Hereinafter, a second embodiment will be described in detail with reference to the drawings.
FIG. 2 is a diagram illustrating a hardware configuration of a computer according to the second embodiment.

コンピュータ30は、CPU(Central Processing Unit)31、RAM(Random Access Memory)32、HDD(Hard Disk Drive)33、グラフィック処理装置34、入力インタフェース35及び通信インタフェース36を有する。   The computer 30 includes a central processing unit (CPU) 31, a random access memory (RAM) 32, a hard disk drive (HDD) 33, a graphic processing device 34, an input interface 35, and a communication interface 36.

CPU31は、コンピュータ30全体を制御する。また、CPU31は、HDD33に格納されたプログラムを実行して、コンピュータ30の各部と連携して、図1で示した検出部11、関数スタック生成部12、関数トレース情報表示部13の機能を実現する。   The CPU 31 controls the entire computer 30. Further, the CPU 31 executes a program stored in the HDD 33 and realizes the functions of the detection unit 11, the function stack generation unit 12, and the function trace information display unit 13 illustrated in FIG. 1 in cooperation with each unit of the computer 30. To do.

RAM32は、CPU31に実行させるオペレーティングシステム(以下、OSと略記する)のプログラムやアプリケーションのプログラムの少なくとも一部を一時的に記憶する。また、RAM32はCPU31による処理に必要な各種データを記憶する。RAM32は、図1で示した記憶部D1〜D5の各種情報を記憶するようにしてもよい。   The RAM 32 temporarily stores at least a part of an operating system (hereinafter abbreviated as OS) program or application program to be executed by the CPU 31. The RAM 32 stores various data necessary for processing by the CPU 31. The RAM 32 may store various information in the storage units D1 to D5 illustrated in FIG.

HDD33は、OSのプログラム、アプリケーションのプログラムを記憶する。また、HDD33はCPU31による処理に必要な各種データを記憶する。なお、HDD33に代えて(または、HDD33と併せて)、SSD(Solid State Drive)など他の種類の記憶装置を用いてもよい。   The HDD 33 stores an OS program and an application program. The HDD 33 stores various data necessary for processing by the CPU 31. Instead of the HDD 33 (or in combination with the HDD 33), another type of storage device such as an SSD (Solid State Drive) may be used.

グラフィック処理装置34は、表示装置34aと接続される。グラフィック処理装置34は、CPU31からの命令に従って、関数トレース情報などを表示装置34aの画面に表示させる。   The graphic processing device 34 is connected to the display device 34a. The graphic processing device 34 displays function trace information and the like on the screen of the display device 34a in accordance with an instruction from the CPU 31.

入力インタフェース35は、キーボード35aとマウス35bと接続される。入力インタフェース35は、キーボード35aやマウス35bから送られてくる信号をCPU31に送信する。   The input interface 35 is connected to a keyboard 35a and a mouse 35b. The input interface 35 transmits signals sent from the keyboard 35a and the mouse 35b to the CPU 31.

通信インタフェース36は、ネットワーク36aと接続される。通信インタフェース36は、ネットワーク36aを介して他の情報処理装置とデータ通信する。
以下、図2で示したようなCPU31がRAM32などと連携して、たとえば、HDD33に格納されたプログラムを実行することで、本実施の形態のシミュレーション方法を実現する場合を例にして説明する。
The communication interface 36 is connected to the network 36a. The communication interface 36 performs data communication with other information processing apparatuses via the network 36a.
Hereinafter, a case where the CPU 31 as shown in FIG. 2 implements the simulation method of the present embodiment by executing a program stored in the HDD 33 in cooperation with the RAM 32 or the like will be described as an example.

図3は、本実施の形態のシミュレーション方法の概略を説明する図である。
まず、CPU31は、関数スタックを生成するために用いるデータの検出処理を行う(ステップS1)。ここでは、CPU31はリンカデータから、関数レンジデータ、関数間を移動する命令のアドレス、割り込みに関するデータ(以下割り込みベクタデータという)を検出し、抽出する。
FIG. 3 is a diagram for explaining the outline of the simulation method of the present embodiment.
First, the CPU 31 performs detection processing of data used to generate a function stack (step S1). Here, the CPU 31 detects and extracts function range data, the address of an instruction that moves between functions, and data related to an interrupt (hereinafter referred to as interrupt vector data) from the linker data.

次に、CPU31は命令トレースデータの他、ステップS1の処理で検出されたデータを用いて、関数スタックを生成する(ステップS2)。
そして、CPU31はグラフィック処理装置34を制御して、関数トレース情報を表示装置34aに表示する(ステップS3)。
Next, the CPU 31 generates a function stack using the data detected in step S1 in addition to the instruction trace data (step S2).
Then, the CPU 31 controls the graphic processing device 34 to display function trace information on the display device 34a (step S3).

以下、各ステップの処理の詳細を説明する。
(データ検出処理)
ここでは、CPU31は、設計対象において実行されるソフトウェアのコンパイル―リンク時に生成されるリンカデータから、関数スタックを生成するために用いるデータを検出する。
Hereinafter, details of the processing of each step will be described.
(Data detection process)
Here, the CPU 31 detects data used to generate a function stack from linker data generated at the time of compiling and linking software executed on the design target.

図4は、設計対象で実行させるソフトウェアの実行形式ファイルを生成する処理の流れを示す図である。
以下の処理において、CPU31はコンパイラ及びリンカとして機能する。
FIG. 4 is a diagram showing a flow of processing for generating an execution format file of software to be executed on the design target.
In the following processing, the CPU 31 functions as a compiler and a linker.

まず、コンパイラによってソースファイル40のコンパイルが行われ、オブジェクトファイル41が生成される(ステップS11)。次に、リンカは生成されたオブジェクトファイル41とライブラリ42中のオブジェクトファイルを結合して、実行可能なファイル、つまり実行形式ファイル43を作成する(ステップS12)。このとき、リンカはリンカデータ44として、たとえば、外部シンボル相互参照情報リスト、ローカルシンボル情報リスト、ディスアセンブルデータ、割り込みベクタデータなどを出力する。   First, the compiler compiles the source file 40 and generates an object file 41 (step S11). Next, the linker combines the generated object file 41 and the object file in the library 42 to create an executable file, that is, an executable format file 43 (step S12). At this time, the linker outputs, as linker data 44, for example, an external symbol cross-reference information list, a local symbol information list, disassembled data, interrupt vector data, and the like.

外部シンボル相互参照情報リストは、リンク後の各モジュールの外部定義シンボルと外部参照シンボルのモジュール間相互参照の情報である。
ローカルシンボル情報リストは、リンク後のモジュールごとのローカルシンボルを含んだ変数や関数などの情報である。
The external symbol cross-reference information list is information on cross-reference between externally defined symbols and external reference symbols of each module after linking.
The local symbol information list is information such as variables and functions including local symbols for each module after linking.

ディスアセンブルデータは、モジュールリンク後の情報をもとに、アセンブラが出力した相対形式のアセンブルリストを絶対形式で表示したものである。アセンブラ言語レベルでのデバッグを行う場合に参照可能であり、機械語の1ステップ単位のアドレスを知ることができる。   The disassembled data is an absolute format display of the relative format assembly list output by the assembler based on the information after module linking. This can be referred to when debugging at the assembler language level, and the address of one step unit of the machine language can be known.

図5は、ディスアセンブルデータの一例を示す図である。
図のように、ディスアセンブルデータは、アドレスと、ディスアセンブルデータにおける行番号と、関数を示すシンボルを含む。
FIG. 5 is a diagram illustrating an example of disassembled data.
As shown, the disassembled data includes an address, a line number in the disassembled data, and a symbol indicating a function.

たとえば、図5のように、割り込みを示す“_vector7”のアドレスが“000E4DFC”であることが示され、割り込みからの復帰命令(以下RETI命令と呼ぶ)がアドレス“000E4BDC”に配置されていることが示されている。   For example, as shown in FIG. 5, it is indicated that the address of “_vector7” indicating an interrupt is “000E4DFC”, and a return instruction from the interrupt (hereinafter referred to as a RETI instruction) is arranged at the address “000E4BDC”. It is shown.

また、“_InterruptFuncA”への呼び出しが存在し、飛び先は“000E0EA2”であることが示されている。また、この呼び出し命令(以下CALL命令と呼ぶ)は“000E4BD0”に配置され、“000E4BEC”に復帰命令(以下RET命令と呼ぶ)が配置されていることが示されている。   In addition, there is a call to “_InterruptFuncA”, and the jump destination is “000E0EA2”. This call instruction (hereinafter referred to as CALL instruction) is arranged in “000E4BD0”, and a return instruction (hereinafter referred to as RET instruction) is arranged in “000E4BEC”.

このようなディスアセンブルデータは、アセンブラをソースコードと対応づけながら解析するために用いられるため、デバッグ情報込みで出力されることが多い。また、コード上は間接アドレッシングであっても、CALL命令では、飛び先のシンボルが明記されていることが多い。図5においても、関数名“LDI”で、飛び先が明記されている。   Since such disassembled data is used to analyze the assembler while associating it with the source code, it is often output including debug information. Further, even if indirect addressing is used on the code, the CALL instruction often specifies a jump destination symbol. Also in FIG. 5, the jump destination is specified by the function name “LDI”.

なお、GCC(GNU Compiler Collection)を用いることでも、同様のディスアンブルデータを取得することができる。
GCCのコンパイラは、コンパイルオプションにデバッグ用のフラグ(“−g”や“−gstabs+”)をつけてコンパイルし、リンカはリンク処理を行って実行形式ファイルを生成する。CPU31は、この実行形式ファイルを入力データとしたobjdumpコマンドを、“−disassemble”オプションを付加して実行することにより、上記と同様のディスアセンブルデータを得ることができる。
It should be noted that similar disable data can be acquired by using GCC (GNU Compiler Collection).
The GCC compiler compiles the compiler with a debugging flag ("-g" or "-gstabs +"), and the linker performs link processing to generate an executable file. The CPU 31 can obtain disassembled data similar to the above by executing the objdump command with the execution format file as input data with the “-disassembling” option added.

図6は、割り込みベクタデータの一例を示す図である。
割り込みベクタデータは、各割り込みベクタごとに、割り込みが発生した場合に処理するプログラムの先頭アドレス(割り込みベクタ値)と、各割り込みベクタに付されたシンボル名を有している。
FIG. 6 is a diagram illustrating an example of interrupt vector data.
The interrupt vector data has, for each interrupt vector, a start address (interrupt vector value) of a program to be processed when an interrupt occurs, and a symbol name assigned to each interrupt vector.

以上のようなリンカデータを、CPU31はnmコマンドで取得されるシンボルテーブルをもとに生成するようにしてもよい。
関数レンジデータや、関数間を移動する命令のアドレスは、たとえば、図5に示したようなディスアセンブルデータから検出され、抽出することができる。
The CPU 31 may generate the linker data as described above based on the symbol table acquired by the nm command.
The function range data and the address of an instruction that moves between functions can be detected and extracted from disassembled data as shown in FIG. 5, for example.

図7は、抽出された関数レンジデータ及び関数間を移動する命令のアドレスの一例の内容を示す図である。図7(A)は関数レンジデータ、図7(B)〜図7(D)は関数間を移動する命令のアドレスの一例の内容を示している。   FIG. 7 is a diagram showing the contents of an example of the extracted function range data and the address of an instruction that moves between functions. FIG. 7A shows the contents of an example of function range data, and FIGS. 7B to 7D show the contents of an example of the address of an instruction that moves between functions.

各関数の関数レンジは、関数の開始アドレスと終了アドレスにより表すことができる。
CPU31は、たとえば、ディスアセンブルデータにおいて、関数のシンボルがあるアドレスから開始アドレスを、次の関数のシンボルがあるアドレス―1から終了アドレスを検出する。そして、CPU31は、これらを図7(A)に示すような関数レンジデータとして、たとえば、RAM32に記憶する。
The function range of each function can be expressed by the start address and end address of the function.
For example, in the disassembled data, the CPU 31 detects a start address from an address where a function symbol exists and an end address from an address-1 where a next function symbol exists. And CPU31 memorize | stores these in RAM32 as function range data as shown to FIG. 7 (A), for example.

なお、1関数が複数に分割されている場合には、関数レンジデータは、分割された領域ごとの開始アドレス及び終了アドレスのリストになる。
また、リンカデータのうち、前述の外部シンボル相互参照情報リストやローカル情報シンボルリストは、少なくとも関数の先頭アドレス情報を含んでいるので、関数レンジデータを生成する際に用いてもよい。
If one function is divided into a plurality of functions, the function range data is a list of start addresses and end addresses for each divided area.
Of the linker data, the external symbol cross-reference information list and the local information symbol list described above include at least the start address information of the function, and may be used when generating function range data.

関数間を移動する命令のうち、CALL命令に関しては、図7(B)に示すように、CALL命令が出現したアドレスと、飛び先アドレスがディスアセンブルデータから抽出され、RAM32などに記憶される。さらに、関数間を移動する命令のうちRET命令に関しては、図7(C)に示すように、RET命令が出現したアドレスがディスアセンブルデータから抽出され、RAM32などに記憶される。関数間を移動する命令のうち割り込みからのRETI命令 に関しては、図7(D)に示すように、割り込みからのRETI命令が出現したアドレスがディスアセンブルデータから抽出され、RAM32などに記憶される。   Among the instructions that move between functions, as for the CALL instruction, as shown in FIG. 7B, the address where the CALL instruction appears and the jump address are extracted from the disassembled data and stored in the RAM 32 or the like. Further, regarding the RET instruction among the instructions for moving between functions, as shown in FIG. 7C, the address where the RET instruction appears is extracted from the disassembled data and stored in the RAM 32 or the like. As for the RETI instruction from the interrupt among the instructions moving between the functions, as shown in FIG. 7D, the address where the RETI instruction from the interrupt appears is extracted from the disassembled data and stored in the RAM 32 or the like.

なお、図6で示したような割り込みベクタデータも、ディスアセンブルデータから検出して、抽出することができる。
次に、図3で示した関数スタック生成処理の詳細を説明する。
The interrupt vector data as shown in FIG. 6 can also be detected and extracted from the disassembled data.
Next, details of the function stack generation processing shown in FIG. 3 will be described.

(関数スタック生成処理)
以下の説明では、まず、関数レンジデータ、割り込みデータ、命令トレースデータを用いて関数スタックを生成する処理を説明する。
(Function stack generation processing)
In the following description, first, processing for generating a function stack using function range data, interrupt data, and instruction trace data will be described.

図8は、命令トレースデータの一例を示す図である。
命令トレースデータは、設計対象におけるハードウェア論理シミュレーションなどにより取得されるシミュレーション時刻ごとのプログラムカウンタ値を有している。プログラムカウンタ値は、たとえば、図1に示したような設計対象20のプロセッサ21が実行する命令を保持するメモリ22のアドレスを示す。
FIG. 8 is a diagram illustrating an example of instruction trace data.
The instruction trace data has a program counter value for each simulation time acquired by hardware logic simulation or the like in the design target. The program counter value indicates, for example, the address of the memory 22 that holds an instruction executed by the processor 21 of the design target 20 as shown in FIG.

図9は、関数スタック生成処理の流れを示す図である。
まず、CPU31は命令トレースデータを1つフェッチする(ステップS20)。たとえば、CPU31は、図8に示したような命令トレースデータの最初の行、シミュレーション時刻“3c526bb”及びその時刻におけるプログラムカウンタ値“e0000”を取得する。このとき、CPU31は、関数レンジデータを参照して、取得したプログラムカウンタ値、つまりアドレスがどの関数の関数レンジに含まれるか調べる。
FIG. 9 is a diagram showing a flow of function stack generation processing.
First, the CPU 31 fetches one instruction trace data (step S20). For example, the CPU 31 acquires the first line of instruction trace data as shown in FIG. 8, the simulation time “3c526bb”, and the program counter value “e0000” at that time. At this time, the CPU 31 refers to the function range data to check which function range the acquired program counter value, that is, the address is included in.

次に、CPU31は、関数レンジデータと、フェッチしたプログラムカウンタ値とを比較し、現在の関数レンジ内であるか否か判定する(ステップS21)。ここで、プログラムカウンタ値が現在の関数レンジ内である場合には、ステップS20の処理に戻る。   Next, the CPU 31 compares the function range data with the fetched program counter value, and determines whether or not it is within the current function range (step S21). If the program counter value is within the current function range, the process returns to step S20.

プログラムカウンタ値が現在の関数レンジ内ではない場合、CPU31は関数間を移動する命令の判定を行う(ステップS22)。ここで、CPU31は、関数間の呼び出し関係を示す関数スタックを表現する関数スタックリスト45を、たとえば、RAM32上に作成する。   If the program counter value is not within the current function range, the CPU 31 determines an instruction to move between functions (step S22). Here, the CPU 31 creates a function stack list 45 that represents a function stack indicating a call relationship between functions, for example, on the RAM 32.

そして、CPU31はステップS22の処理の判別結果に応じて関数スタックリスト45を更新する(ステップS23)。そして、CPU31は、関数スタックリスト45をもとに、関数スタックの更新をRAM32などに出力する(ステップS24)。このとき、CPU31は、関数スタックリスト45の状態を、表示装置34aに表示させるようにしてもよい。関数スタックの履歴は、後述する関数トレース情報の表示処理のために、たとえば、RAM32またはHDD33などに記憶しておく。   Then, the CPU 31 updates the function stack list 45 according to the determination result of the process at step S22 (step S23). Then, the CPU 31 outputs the function stack update to the RAM 32 or the like based on the function stack list 45 (step S24). At this time, the CPU 31 may display the state of the function stack list 45 on the display device 34a. The function stack history is stored in, for example, the RAM 32 or the HDD 33 for display processing of function trace information described later.

さらに、CPU31は、全命令トレースデータのフェッチが終了したか否かを判定する(ステップS25)。全命令トレースデータのフェッチが終了していなければ、ステップS20に戻り、CPU31は命令トレースデータの次の行をフェッチし、以降のステップS21〜S25の処理を繰り返す。全命令トレースデータのフェッチが終了していれば、CPU31は、関数スタックの生成処理を終了する。   Further, the CPU 31 determines whether or not fetching of all instruction trace data has been completed (step S25). If the fetching of all instruction trace data has not been completed, the process returns to step S20, and the CPU 31 fetches the next line of the instruction trace data, and repeats the subsequent steps S21 to S25. If all the instruction trace data has been fetched, the CPU 31 ends the function stack generation processing.

なお、CPU31は、全命令トレースデータのフェッチが終了したか否かを判定する代わりに、たとえば、ユーザにより指定された区間の命令トレースデータのフェッチを終了したか否かを判定するようにしてもよい。   Instead of determining whether or not all the instruction trace data has been fetched, the CPU 31 may determine, for example, whether or not the instruction trace data in the section specified by the user has been fetched. Good.

以下ステップS22,S23の処理を具体的に説明する。
ステップS22の処理において、CPU31は、取得したプログラムカウンタ値が関数スタックのトップ―1の関数の関数レンジ内の場合にはRET命令が発行されたと推定する。そして、CPU31は、ステップS23の処理で、関数スタックリスト45を更新して、関数スタックをポップする。それ以外の場合には、CPU31はCALL命令が発行されたと推定し、検出した関数を関数スタックにプッシュする。
Hereinafter, the processing of steps S22 and S23 will be described in detail.
In the process of step S22, the CPU 31 estimates that a RET instruction has been issued if the acquired program counter value is within the function range of the top-1 function in the function stack. Then, the CPU 31 updates the function stack list 45 and pops the function stack in step S23. In other cases, the CPU 31 estimates that the CALL instruction has been issued, and pushes the detected function onto the function stack.

たとえば、関数A、関数Bの順で呼び出しが発生すると、関数A,Bは、関数スタックリスト45において、関数スタックに関数A、関数Bの順で積まれる。この状態の関数スタックを、[A,B]と表記する。その後、プログラムカウンタ値が関数スタックのトップ―1である関数Aの関数レンジに移動した場合、CPU31は、関数スタックをポップする。これによって、関数スタックは[A]となる。   For example, when calls are generated in the order of function A and function B, the functions A and B are stacked on the function stack in the order of function A and function B in the function stack list 45. The function stack in this state is expressed as [A, B]. Thereafter, when the program counter value moves to the function range of the function A which is the top-1 of the function stack, the CPU 31 pops the function stack. As a result, the function stack becomes [A].

ただし、CPU31は、取得したプログラムカウンタ値が、関数スタックのトップ―1の関数の関数レンジの先頭アドレスである場合、その関数へのCALL命令が発生したと判定し、その関数を関数スタックにプッシュする。   However, if the acquired program counter value is the top address of the function range of the top-1 function in the function stack, the CPU 31 determines that a CALL instruction to the function has occurred and pushes the function onto the function stack. To do.

これにより、同じ関数が、関数A(1回目)→関数B→関数A(2回目)のように、入れ子の関係で呼び出された場合に、RET命令であると誤判定されることを防止することができる。   This prevents the same function from being erroneously determined to be a RET instruction when called in a nested relationship, such as function A (first time) → function B → function A (second time). be able to.

このようにして、CPU31は、関数レンジデータと命令トレースデータとを比較して、関数間を移動する命令を判別できる。これにより、命令トレースデータと関数レンジデータから、関数間の呼び出し関係を示す関数スタックを生成することができる。   In this way, the CPU 31 can determine the instruction to move between functions by comparing the function range data with the instruction trace data. Thereby, a function stack indicating a call relationship between functions can be generated from the instruction trace data and the function range data.

ところで、ある関数へのRET命令と同時に割り込みが入り、RET命令が受理され、割り込み先の関数が実行される場合、関数スタックの遷移に矛盾が生じる場合がある。
たとえば、関数Bの実行中において、関数AへのRET命令と同時に関数Cへの割り込みが生じた場合、各関数の呼び出し関係は、関数A→関数B→関数C(割り込みにより呼ばれる関数)→関数A(復帰)という順になる。このとき、関数スタックは[A]→[A,B]→[A,B,C(int)]→[A,B]と遷移する。最後の関数スタックの状態においてトップは[B]であるので、この関数スタックの遷移では、関数Aへの復帰が再現されていない。なお、C(int)の“int”は関数Cが割り込みによって呼ばれた関数であることを示している。
By the way, when an interrupt occurs at the same time as a RET instruction to a certain function, the RET instruction is accepted, and the interrupt destination function is executed, there may be a contradiction in the transition of the function stack.
For example, when the function B is interrupted simultaneously with the RET instruction to the function A during the execution of the function B, the calling relationship of each function is as follows: function A → function B → function C (function called by interrupt) → function The order is A (return). At this time, the function stack transits from [A] → [A, B] → [A, B, C (int)] → [A, B]. Since the top is [B] in the state of the last function stack, the return to the function A is not reproduced in this transition of the function stack. Note that “int” of C (int) indicates that the function C is a function called by an interrupt.

これに対応するため、CPU31は、たとえば、ステップS20の処理において、図6で示したような割り込みベクタデータを参照することで、割り込み発生に基づく関数間を移動する命令を検出する。そして、CPU31は、割り込みで実行されている関数から復帰するときには、たとえば、1つポップまたは2つポップのうち、矛盾していないほうを選択する。以下、具体的に説明する。   To cope with this, for example, in the process of step S20, the CPU 31 detects an instruction to move between functions based on the occurrence of an interrupt by referring to the interrupt vector data as shown in FIG. Then, when returning from the function executed by the interrupt, the CPU 31 selects, for example, one of the pops or the two pops that is not inconsistent. This will be specifically described below.

CPU31は、割り込みベクタデータを参照して、フェッチされたプログラムカウンタ値が、割り込みベクタデータに含まれるアドレスと一致した場合には、割り込みが発生したことを検出するようにする。   The CPU 31 refers to the interrupt vector data, and detects that an interrupt has occurred when the fetched program counter value matches the address included in the interrupt vector data.

たとえば、関数A→関数B→関数C→(割り込みにより呼ばれる関数)の順で関数の呼び出しがあったとする。この場合、関数Cが呼ばれるタイミングで、割り込みベクタ内のアドレスが検出される。このとき、関数スタックの状態は[A]→[A,B]→[A,B,C(int)]となる。   For example, it is assumed that functions are called in the order of function A → function B → function C → (function called by interrupt). In this case, the address in the interrupt vector is detected at the timing when the function C is called. At this time, the state of the function stack is [A] → [A, B] → [A, B, C (int)].

上記の例で、関数Cへの割り込みの後に、プログラムカウンタ値が関数Aの関数レンジ内(先頭アドレス以外)に戻り、関数Aへの復帰が行われたとする。このとき、CPU31は関数スタックリスト45を参照し、[A,B,C(int)]の後に[A,B]になるように1つポップすると関数スタックのトップが[B]となり矛盾するので、[A,B,C(int)]の後は[A]となるように2つポップを行う。   In the above example, it is assumed that after interruption to the function C, the program counter value returns to within the function range of the function A (other than the top address), and the function A is restored. At this time, if the CPU 31 refers to the function stack list 45 and pops one so that it becomes [A, B] after [A, B, C (int)], the top of the function stack becomes [B], which is inconsistent. After [A, B, C (int)], two pops are performed so as to be [A].

これにより、たとえば、関数AへのRET命令と同時に割り込みが入り、復帰が受理され、割り込み先に飛んだ場合でも、関数スタックは[A]→[A,B]→[A,B,C(int)]→[A]となる。したがって、関数スタックの遷移に矛盾が生じることを防止することができる。   Thus, for example, even when an interrupt is input simultaneously with the RET instruction to the function A, the return is accepted, and the function stack is [A] → [A, B] → [A, B, C ( int)] → [A]. Therefore, it is possible to prevent a contradiction from occurring in the function stack transition.

また、割り込みはどこで発生するかわからないため、プログラムカウンタ値が、関数レンジの先頭アドレスを示す場合に呼び出しとする判別の仕方では、関数スタックに矛盾が生じる場合がある。たとえば、関数A→関数Bの順で呼び出しが発生し、その関数Bの呼び出しと同時に割り込みが発生し、関数Cが呼ばれた場合、関数Bへ復帰する際には、プログラムカウンタ値は、関数Bの関数レンジの先頭アドレスを示す。この場合、上述の判別方式では、復帰とは判別されず、関数Bの呼び出しと判別され、関数スタックは[A]→[A,B]→[A,B,C(int)]→[A,B,C(int),B]となる。   In addition, since it is not known where the interrupt occurs, there is a case where the function stack is inconsistent in the method of determining the call when the program counter value indicates the start address of the function range. For example, if a call occurs in the order of function A → function B, an interrupt occurs simultaneously with the call to function B, and function C is called, when returning to function B, the program counter value is Indicates the start address of the B function range. In this case, in the above discrimination method, it is not discriminated as a return, but is discriminated as a call to the function B, and the function stack is [A] → [A, B] → [A, B, C (int)] → [A , B, C (int), B].

そのため、CPU31は以下のような検証を行う。
プログラムカウンタ値が、割り込みで呼ばれた関数の関数レンジから、次の関数の関数レンジの先頭アドレスに移動した場合、まず、CPU31は、仮の関数スタックを、たとえば、2つ作成する。たとえば、1つは、関数スタックを1つポップまたは2つポップした場合のうち矛盾のないものであり、もう1つは次の関数をプッシュした関数スタックである。
Therefore, the CPU 31 performs the following verification.
When the program counter value moves from the function range of the function called by the interrupt to the start address of the function range of the next function, the CPU 31 first creates two temporary function stacks, for example. For example, one is the one that pops the function stack one or two, and the other is the function stack that pushed the next function.

上記の例の場合、[A,B,C(int)]後に、1つポップした関数スタック[A,B]と、関数Bをプッシュした関数スタック[A,B,C(int),B]が、仮の関数スタックとなる。   In the case of the above example, after [A, B, C (int)], the function stack [A, B] popped by one, and the function stack [A, B, C (int), B] pushed function B Is a temporary function stack.

その後、CPU31は仮の関数スタックを用いて、ステップS20〜S25の処理を繰り返す。たとえば、関数Bの復帰後、関数D→関数E→関数D(復帰)→関数B(復帰)→関数A(復帰)のように、関数の呼び出しが行われた場合、仮の関数スタックの1つである[A,B]を起点とした関数スタックの遷移は以下のようになる。
[A,B]→[A,B,D]→[A,B,D,E]→[A,B,D]→[A,B]→[A]
この場合、矛盾は生じていない。一方、[A,B,C(int),B]を起点とした関数スタックの遷移は以下のようになる。
[A,B,C(int),B]→[A,B,C(int),B,D]→[A,B,C(int),B,D,E]→[A,B,C(int),B,D]→[A,B,C(int),B]
この場合、関数Bへの復帰までは矛盾がないが、次の関数Aへの復帰の際、戻れる関数は関数Cとなり、矛盾が生じる。
Thereafter, the CPU 31 repeats the processes of steps S20 to S25 using the temporary function stack. For example, after the return of the function B, when the function is called as follows: function D → function E → function D (return) → function B (return) → function A (return) The transition of the function stack starting from [A, B] is as follows.
[A, B] → [A, B, D] → [A, B, D, E] → [A, B, D] → [A, B] → [A]
In this case, no contradiction has occurred. On the other hand, the transition of the function stack starting from [A, B, C (int), B] is as follows.
[A, B, C (int), B] → [A, B, C (int), B, D] → [A, B, C (int), B, D, E] → [A, B, C (int), B, D] → [A, B, C (int), B]
In this case, there is no contradiction until the return to the function B, but when returning to the next function A, the function that can be returned becomes the function C, resulting in a contradiction.

したがって、関数スタック[A,B,C(int)]の後は、[A,B]が正しい関数スタックであることがわかる。CPU31は、このような矛盾を検出した場合、たとえば、矛盾していた[A,B,C(int),B]を起点とした関数トレース情報を破棄する。   Therefore, after the function stack [A, B, C (int)], it can be seen that [A, B] is a correct function stack. When detecting such a contradiction, for example, the CPU 31 discards the function trace information starting from [A, B, C (int), B] that is inconsistent.

このように、本実施の形態の関数スタック生成処理では、矛盾しない関数スタックの遷移を見つける検証機能を実現しているので、CALL命令やRET命令など関数間を移動する命令を用いなくとも、精度よく関数トレース情報を生成することができる。   As described above, in the function stack generation processing according to the present embodiment, a verification function for finding a consistent function stack transition is realized. Therefore, even if an instruction for moving between functions such as a CALL instruction or a RET instruction is not used, the accuracy can be improved. The function trace information can be generated well.

次に、関数スタック生成処理の他の例を説明する。ここでは、関数レンジデータ、割り込みデータ、命令トレースデータの他、図7(B)〜(D)に示したような、ディスアセンブルデータから抽出された関数間を移動する命令を用いて関数スタックを生成する処理を説明する。   Next, another example of the function stack generation process will be described. Here, in addition to the function range data, interrupt data, and instruction trace data, the function stack is set using instructions that move between functions extracted from the disassembled data as shown in FIGS. The process to generate will be described.

図10は、関数スタック生成処理の他の例を示す図である。
まず、CPU31は、図9の処理と同様に、命令トレースデータを1つフェッチする(ステップS30)。
FIG. 10 is a diagram illustrating another example of the function stack generation process.
First, the CPU 31 fetches one instruction trace data as in the process of FIG. 9 (step S30).

次に、CPU31は、図9の処理で用いたような関数スタックリストに関数スタックがあるか否かを判定する(ステップS31)。ここで、関数リストに関数スタックがある場合には、ステップS32の処理が実行され、関数スタックがない場合には、ステップS32の処理がスキップされ、ステップS33の処理が実行される。   Next, the CPU 31 determines whether or not there is a function stack in the function stack list as used in the processing of FIG. 9 (step S31). If there is a function stack in the function list, the process of step S32 is executed. If there is no function stack, the process of step S32 is skipped and the process of step S33 is executed.

ステップS32の処理ではコミット処理が実行される。ここでは、CPU31は、各種フラグの状態に応じて、関数の呼び出しの種別の判定を行い、判定結果に応じて関数スタックのポップやプッシュを行う。また、CPU31は、関数スタックの更新に応じて関数トレース情報も更新する。   In the process of step S32, a commit process is executed. Here, the CPU 31 determines the type of function call according to the state of various flags, and pops and pushes the function stack according to the determination result. The CPU 31 also updates function trace information in accordance with the function stack update.

関数スタックがないと判定された場合、またはコミット処理の後、CPU33は、フェッチした命令トレースデータのプログラムカウンタ値が、割り込みベクタに含まれるアドレスか否か判定する(ステップS33)。ここで、プログラムカウンタ値が割り込みベクタに含まれるアドレスと判定された場合、ステップS34の処理が実行され、割り込みベクタに含まれるアドレスではない場合には、ステップS34の処理がスキップされ、ステップS35の処理が実行される。   If it is determined that there is no function stack, or after commit processing, the CPU 33 determines whether or not the program counter value of the fetched instruction trace data is an address included in the interrupt vector (step S33). If it is determined that the program counter value is an address included in the interrupt vector, the process of step S34 is executed. If the address is not included in the interrupt vector, the process of step S34 is skipped, and the process of step S35 is performed. Processing is executed.

ステップS34の処理では割り込みベクタ処理が行われる。ここでは、CPU31は、取得したシミュレーション時刻で実行されている関数の関数レンジを見つけ、この関数が1つ入った関数スタックを作成し、関数スタックリストに追加し、ステップS35の処理に進む。   In the process of step S34, interrupt vector processing is performed. Here, the CPU 31 finds the function range of the function being executed at the obtained simulation time, creates a function stack including this function, adds it to the function stack list, and proceeds to the process of step S35.

ステップS35の処理では、CPU31は、図7(B)〜(D)で示したようなデータを参照し、プログラムカウンタ値が関数間を移動する命令のアドレスを示すものであるか否かを判定する(ステップS35)。なお、この例では、割り込みの有無については、ステップS33の処理で判定済みなので、CPU31は、割り込み以外の関数間を移動する命令の有無についての判定を行う。ここで、プログラムカウンタ値が関数間を移動する命令のアドレスを示すものである場合には、ステップS36の処理が実行され、そうではない場合にはステップS36の処理がスキップされ、ステップS37の処理が実行される。   In the process of step S35, the CPU 31 refers to data as shown in FIGS. 7B to 7D and determines whether or not the program counter value indicates the address of an instruction that moves between functions. (Step S35). In this example, the presence / absence of an interrupt has already been determined in step S33, so the CPU 31 determines whether there is an instruction to move between functions other than the interrupt. If the program counter value indicates the address of an instruction that moves between functions, the process of step S36 is executed. If not, the process of step S36 is skipped, and the process of step S37. Is executed.

ステップS36の処理では、CPU31は、検出された関数間を移動する命令の種別に応じて、フラグを“true”に変更し、ステップS37の処理に進む。
ステップS37の処理では、CPU31は、全命令トレースデータのフェッチが終了したか否かを判定する。全命令トレースデータのフェッチが終了していなければ、ステップS30に戻り、CPU31は命令トレースデータの次の行をフェッチし、以降のステップS31〜S37の処理を繰り返す。全命令トレースデータのフェッチが終了していれば、CPU31は、関数トレース情報の生成処理を終了する。
In the process of step S36, the CPU 31 changes the flag to “true” according to the type of the instruction to move between the detected functions, and proceeds to the process of step S37.
In the process of step S37, the CPU 31 determines whether or not the fetching of all instruction trace data has been completed. If all the instruction trace data has not been fetched, the process returns to step S30, and the CPU 31 fetches the next line of the instruction trace data, and repeats the processes of steps S31 to S37 thereafter. If the fetching of all instruction trace data has been completed, the CPU 31 ends the function trace information generation process.

なお、CPU31は、全命令トレースデータのフェッチが終了したか否かを判定する代わりに、たとえば、ユーザにより指定された区間の命令トレースデータのフェッチを終了したか否かを判定するようにしてもよい。   Instead of determining whether or not all the instruction trace data has been fetched, the CPU 31 may determine, for example, whether or not the instruction trace data in the section specified by the user has been fetched. Good.

以下具体例を用いて、上記の関数スタックの生成処理を説明する。
ステップS30の処理でフェッチされた命令トレースデータの最初の一行目において、プログラムカウンタ値で示されるアドレスが、図8に示すように“e0000”番地であったとする。ステップS31では、まだ関数スタックが存在しないので、関数スタックはないと判定され、ステップS32のコミット処理がスキップされ、ステップS33の処理が行われる。
The function stack generation processing will be described below using a specific example.
Assume that the address indicated by the program counter value is the address “e0000” as shown in FIG. 8 in the first line of the instruction trace data fetched in the process of step S30. In step S31, since there is no function stack yet, it is determined that there is no function stack, the commit process in step S32 is skipped, and the process in step S33 is performed.

ステップS33の処理において、アドレス“e0000”は、図6に示す“_start”の割り込みベクタ値と一致するので、ステップS34の割り込みベクタ処理が実行される。なお、“_start”は、スタートアップルーチンを行うための割り込みを示している。   In the process of step S33, the address “e0000” matches the interrupt vector value of “_start” shown in FIG. 6, so the interrupt vector process of step S34 is executed. “_Start” indicates an interrupt for performing a startup routine.

図11は、関数スタックリストに関数スタックを追加した一例を示す図である。
図11では、割り込みベクタ処理において、関数スタックリスト50に追加された関数スタック51と、割り込みベクタを示す“_start”の関数レンジ51aが示されている。以下では、関数スタック51に積まれる関数を、図11のようにその関数の関数レンジ51aで表すが、たとえば、関数のID番号であってもよい。
FIG. 11 is a diagram illustrating an example in which a function stack is added to the function stack list.
FIG. 11 illustrates a function stack 51 added to the function stack list 50 and a function range 51a of “_start” indicating an interrupt vector in the interrupt vector processing. In the following, a function to be stacked on the function stack 51 is represented by a function range 51a of the function as shown in FIG. 11, but may be an ID number of the function, for example.

関数スタックリスト50には、RETI命令の有無を示すフラグ“is_reti”が記憶されている。また、関数スタック51には、CALL命令の発生の有無を記憶するフラグ“is_call”、RET命令の発生の有無を記憶するフラグ“is_ret”、現在の関数レンジ、行き先の関数レンジが記憶されている。   The function stack list 50 stores a flag “is_reti” indicating the presence or absence of a RETI instruction. The function stack 51 stores a flag “is_call” for storing the presence / absence of a CALL instruction, a flag “is_ret” for storing the presence / absence of a RET instruction, a current function range, and a destination function range. .

なお、“bool”は、“is_reti”などが、trueまたはfalseを格納する整数型の変数であることを宣言している。図11で示す例では何れのフラグも“false”となっている。   Note that “bool” declares that “is_reti” or the like is an integer type variable that stores true or false. In the example shown in FIG. 11, all the flags are “false”.

次に、ステップS35の判定処理が行われるが、前述のように割り込みベクタが検出された場合には、関数間を移動する命令が発生したとは判定されず、ステップS36の処理がスキップされ、ステップS37の判定処理が行われる。ステップS37の判定処理時には、まだ全命令トレースデータのフェッチが終了していないので、ステップS30の処理が再び行われる。   Next, the determination process of step S35 is performed. However, if an interrupt vector is detected as described above, it is not determined that an instruction to move between functions has occurred, and the process of step S36 is skipped. The determination process in step S37 is performed. At the time of the determination process in step S37, since fetching of all instruction trace data has not been completed yet, the process in step S30 is performed again.

ステップS30の処理で命令トレースデータの次の行がフェッチされた後、ステップS31の処理では、図11で示したような関数スタック51が作成されている場合には、関数スタックがあると判定される。これにより、コミット処理が行われるが、図11に示されているように、各フラグは全て“false”になっている。そのため、CPU31は、たとえば、フェッチしたプログラムカウンタ値が関数間を移動する命令の位置を示すものであっても、関数スタックの更新を行わない。   After the next line of the instruction trace data is fetched in the process of step S30, in the process of step S31, if the function stack 51 as shown in FIG. 11 is created, it is determined that there is a function stack. The As a result, the commit process is performed. As shown in FIG. 11, all the flags are “false”. Therefore, the CPU 31 does not update the function stack even if, for example, the fetched program counter value indicates the position of an instruction that moves between functions.

たとえば、ステップS30の処理で、フェッチしたプログラムカウンタ値が関数間を移動する命令の位置を示すものであった場合、ステップS33の判定処理では“NO”と判定され、ステップS35の判定処理では、“YES”と判定される。そして、ステップS36の処理で、関数間を移動する命令の種別に応じたフラグが“true”に変更される。   For example, when the fetched program counter value indicates the position of the instruction to move between functions in the process of step S30, it is determined as “NO” in the determination process of step S33, and in the determination process of step S35, “YES” is determined. In step S36, the flag corresponding to the type of instruction to move between functions is changed to “true”.

図12は、CALL命令の検出後の関数スタックリストの一例の状態を示す図である。
ステップS35の判定処理にてCALL命令が検出されると、CPU31は、CALL命令の飛び先アドレス(図7(B)参照)で示される関数を、関数レンジデータ(図7(A)参照)から検出し、行き先関数レンジとして関数スタック51に登録する。図12では、CALL命令の発生を示すフラグ“is_call”が“true”と変更され、行き先関数レンジとして関数“FuncA”が登録された場合について示されている。
FIG. 12 is a diagram illustrating an example of a function stack list after a CALL instruction is detected.
When the CALL instruction is detected in the determination process in step S35, the CPU 31 changes the function indicated by the jump address of the CALL instruction (see FIG. 7B) from the function range data (see FIG. 7A). It is detected and registered in the function stack 51 as a destination function range. FIG. 12 shows a case where the flag “is_call” indicating the occurrence of the CALL instruction is changed to “true” and the function “FuncA” is registered as the destination function range.

その後、ステップS37の判定処理を介してステップS30の処理に戻り、ステップS31の判定処理を介してコミット処理が実行される。
ここでのコミット処理では、関数スタック51のフラグ“is_call”が“true”であるので、CPU31は、関数レンジデータを参照して、フェッチしたプログラムカウンタ値が、“FuncA”の関数レンジに含まれているか否か判定する。
Thereafter, the process returns to the process of step S30 via the determination process of step S37, and the commit process is executed via the determination process of step S31.
In this commit process, since the flag “is_call” of the function stack 51 is “true”, the CPU 31 refers to the function range data, and the fetched program counter value is included in the function range of “FuncA”. It is determined whether or not.

図13は、CALL命令実行後の関数スタックリストの一例の状態を示す図である。
フェッチしたプログラムカウンタ値が、“FuncA”の関数レンジに含まれている場合、CPU31は、CALL命令が実際に実行され、関数間の移動が発生したと判定する。そして、CPU31は、現在の関数レンジとして“FuncA”を登録し、“FuncA”の関数レンジ51bを関数スタック51に積む。また、CPU31は、フラグ“is_call”を“false”に戻す。
FIG. 13 is a diagram illustrating an example of a function stack list after the CALL instruction is executed.
When the fetched program counter value is included in the function range of “FuncA”, the CPU 31 determines that the CALL instruction is actually executed and movement between functions has occurred. Then, the CPU 31 registers “FuncA” as the current function range, and loads the function range 51 b of “FuncA” on the function stack 51. Further, the CPU 31 returns the flag “is_call” to “false”.

次に、RET命令検出時の、関数スタックの操作について説明する。
図14は、RET命令の検出後の関数スタックリストの一例の状態を示す図である。
ステップS35の判定処理にてRET命令が検出されると、ステップS36の処理では、RET命令の発生を示すフラグ“is_ret”が“true”と変更される。
Next, the operation of the function stack when the RET instruction is detected will be described.
FIG. 14 is a diagram illustrating an exemplary state of the function stack list after detection of the RET instruction.
When the RET instruction is detected in the determination process of step S35, the flag “is_ret” indicating the occurrence of the RET instruction is changed to “true” in the process of step S36.

その後、ステップS37の判定処理を介してステップS30の処理に戻り、ステップS31の判定処理を介してコミット処理が実行される。
CPU31は、関数スタック51のフラグ“is_ret”が“true”であるので、関数レンジデータを参照して、フェッチしたプログラムカウンタ値が、関数スタック51に積まれているトップ―1の関数レンジに含まれているか否かを判定する。図14の例では、トップ―1の関数レンジは、“FuncA”の関数レンジ51bであるので、CPU31は、この関数レンジ51b内に、フェッチしたプログラムカウンタ値が含まれるか否か判定する。
Thereafter, the process returns to the process of step S30 via the determination process of step S37, and the commit process is executed via the determination process of step S31.
Since the flag “is_ret” of the function stack 51 is “true”, the CPU 31 refers to the function range data and includes the fetched program counter value in the top-1 function range stacked in the function stack 51. It is determined whether or not. In the example of FIG. 14, the top-1 function range is the function range 51b of “FuncA”. Therefore, the CPU 31 determines whether or not the fetched program counter value is included in the function range 51b.

図15は、RET命令実行後の関数スタックリストの一例の状態を示す図である。
フェッチしたプログラムカウンタ値が、“FuncA”の関数レンジに含まれている場合、CPU31は、RET命令が実際に実行され、関数間の移動が発生したと判定する。そして、CPU31は、関数スタック51をポップし、現在の関数レンジとして“FuncA”を登録する。また、CPU31は、フラグ“is_ret”を“false”に戻す。
FIG. 15 is a diagram illustrating an example of a function stack list after execution of the RET instruction.
When the fetched program counter value is included in the function range of “FuncA”, the CPU 31 determines that the RET instruction is actually executed and movement between functions has occurred. Then, the CPU 31 pops the function stack 51 and registers “FuncA” as the current function range. Further, the CPU 31 returns the flag “is_ret” to “false”.

次に、割り込み検出時の、関数スタックの操作について説明する。
CPU31は、ステップS33の処理で割り込みを検出すると、ステップS34の割り込みベクタ処理で、先の“_start”の検出時と同様に、新たな関数スタックを形成する。たとえば、図14で示したような関数スタックリスト50の状態(ただし、フラグ“is_ret”は“false”)のとき割り込みが検出されると、関数スタックリスト50は以下のようになる。
Next, the operation of the function stack when an interrupt is detected will be described.
When the CPU 31 detects an interrupt in the process of step S33, the CPU 31 forms a new function stack in the interrupt vector process of step S34 as in the previous detection of “_start”. For example, when an interrupt is detected in the state of the function stack list 50 as shown in FIG. 14 (where the flag “is_ret” is “false”), the function stack list 50 is as follows.

図16は、割り込みベクタ処理後の関数スタックリストの一例の状態を示す図である。
関数スタックリスト50に、新たな関数スタック52が作成されている例を示している。ここでは、“_vector_7”という割り込みベクタが検出された場合の関数スタック52の例を示している。現在の関数レンジとして、“_vector_7”が登録され、“_vector_7”の関数レンジ52aが関数スタック52に積まれている。
FIG. 16 is a diagram illustrating an example of a function stack list after interrupt vector processing.
An example in which a new function stack 52 is created in the function stack list 50 is shown. Here, an example of the function stack 52 when an interrupt vector “_vector — 7” is detected is shown. “_Vector — 7” is registered as the current function range, and the function range 52 a of “_vector — 7” is loaded on the function stack 52.

次に、割り込みからの復帰時の関数スタックの操作について説明する。
図17は、RETI命令の検出時の関数スタックリストの一例の状態を示す図である。
たとえば、CPU31は、図16のような関数スタックリスト50の状態で、ステップS35の処理でRETI命令を検出すると、ステップS36の処理で、図17に示すように、関数スタックリスト50のフラグ“is_reti”を“true”に変更する。
Next, the operation of the function stack when returning from an interrupt will be described.
FIG. 17 is a diagram illustrating an example of a function stack list when a RETI instruction is detected.
For example, when the CPU 31 detects a RETI instruction in the process of step S35 in the state of the function stack list 50 as shown in FIG. 16, in the process of step S36, the flag “is_reti” in the function stack list 50 is shown in FIG. "Is changed to" true ".

その後、ステップS37の判定処理を介してステップS30の処理に戻り、ステップS31の判定処理を介してコミット処理が実行される。
ここでのコミット処理では、関数スタックリスト50のフラグ“is_reti”が“true”であるので、CPU31は、トップ―1の関数スタックのトップの関数レンジに、フェッチしたプログラムカウンタ値が含まれているか否か判定する。図16に示した関数スタックリスト50の場合、トップ―1の関数スタックは関数スタック51であり、関数スタック51のトップの関数レンジは、“FuncB”の関数レンジ51cである。
Thereafter, the process returns to the process of step S30 via the determination process of step S37, and the commit process is executed via the determination process of step S31.
In this commit process, since the flag “is_reti” in the function stack list 50 is “true”, the CPU 31 includes the fetched program counter value in the top function range of the top-1 function stack. Judge whether or not. In the case of the function stack list 50 shown in FIG. 16, the top-1 function stack is the function stack 51, and the top function range of the function stack 51 is the function range 51c of “FuncB”.

図18は、RETI命令実行後の関数スタックリストの一例の状態を示す図である。
トップ―1の関数スタックのトップの関数レンジに、フェッチしたプログラムカウンタ値が含まれていると判定された場合には、CPU31は、実際にRETI命令が実行され、“FuncB”に復帰したと判定する。これにより、CPU31は、たとえば、図17に示したような関数スタックリスト50から、関数スタック52を取り除き、図18で示すような状態に変更する。
FIG. 18 is a diagram illustrating an example of a function stack list after execution of the RETI instruction.
When it is determined that the fetched program counter value is included in the top function range of the top-1 function stack, the CPU 31 determines that the RETI instruction is actually executed and returns to “FuncB”. To do. Thereby, for example, the CPU 31 removes the function stack 52 from the function stack list 50 as shown in FIG. 17 and changes it to the state as shown in FIG.

なお、フラグ“is_reti”が“true”であり、フェッチしたプログラムカウンタ値が、関数スタックのトップの関数レンジに含まれていない場合に、トップ―1の関数レンジへ戻る動作を検出できないまま、割り込み先に移動した可能性がある。CPU31は、これを考慮して、フェッチしたプログラムカウンタ値が、関数スタックのトップの関数レンジに含まれていない場合に、関数スタックのトップ―1の関数レンジに含まれているか否かを判定する。もし、フェッチしたプログラムカウンタ値がトップ―1の関数レンジに含まれている場合には、その関数に復帰させる。たとえば、CPU31は、図18で示した関数スタック51をポップして、関数レンジ51bの“FuncA”に復帰させる。   Note that if the flag “is_reti” is “true” and the fetched program counter value is not included in the top function range of the function stack, an operation to return to the top-1 function range cannot be detected and an interrupt is detected. It may have moved first. In consideration of this, when the fetched program counter value is not included in the top function range of the function stack, the CPU 31 determines whether or not it is included in the top-1 function range of the function stack. . If the fetched program counter value is included in the top-1 function range, the function is returned to that function. For example, the CPU 31 pops the function stack 51 shown in FIG. 18 and restores it to “FuncA” of the function range 51b.

以上のような処理により、矛盾しない関数スタックの履歴を見つける検証機能を有さなくとも、より正確な関数スタックの積み下ろしが再現される。CPU31は、以上のような関数スタックリスト50における関数スタックの履歴を、関数トレース情報として出力し、たとえば、RAM32に記憶する。   Through the processing described above, more accurate function stack loading / unloading is reproduced without having a verification function for finding a consistent function stack history. The CPU 31 outputs the function stack history in the function stack list 50 as described above as function trace information, and stores it in the RAM 32, for example.

また、上記の関数スタック生成処理では、CPU31は、プログラムカウンタ値が、関数間を移動する命令のアドレスに一致した場合、命令トレースデータのフェッチを進め、関数レンジデータをもとに、実際にその命令が実行されたか否かを判定する。そして、CPU31は、実際にその命令が実行されたと判定した場合に、関数スタックの更新を行っている。   Further, in the above function stack generation processing, when the program counter value matches the address of an instruction that moves between functions, the CPU 31 advances the fetch of instruction trace data, and actually performs the operation based on the function range data. Determine if the instruction was executed. When the CPU 31 determines that the instruction has actually been executed, the CPU 31 updates the function stack.

つまり、上記の関数スタック生成処理では、関数間を移動する命令の有効性を検証して、無効な命令を無視することができる。
これによって、より正確な関数スタック及び関数トレース情報が生成可能となる。
In other words, in the function stack generation process described above, the validity of an instruction that moves between functions can be verified, and invalid instructions can be ignored.
As a result, more accurate function stack and function trace information can be generated.

以下、関数間を移動する命令の有効性を検証することによる効果を具体的に説明する。
図19は、設計対象において実行されるプログラムに含まれるコードと、それを実行して得られた命令トレースデータの一例を示す図である。
Hereinafter, the effect of verifying the effectiveness of the instruction for moving between functions will be described in detail.
FIG. 19 is a diagram illustrating an example of code included in a program executed on a design target and instruction trace data obtained by executing the code.

図19(A)に示すように、このコードには、“0xF0000”のようなアドレスと、“RET”などの命令が記述されている。なお、このコードを含む関数のレンジは、開始アドレス“0xF0000”、終了アドレス“0xF0010”であるとする。   As shown in FIG. 19A, this code describes an address such as “0xF0000” and an instruction such as “RET”. It is assumed that the range of the function including this code is the start address “0xF0000” and the end address “0xF0010”.

このとき、図19(A)に示したようなコードを実行することによって、たとえば、図19(B)に示すような命令トレースデータが得られる。図19(B)ではシミュレーション時刻については図示を省略しており、プログラムカウンタ値(アドレス)の遷移を示している。   At this time, by executing the code as shown in FIG. 19A, for example, instruction trace data as shown in FIG. 19B is obtained. In FIG. 19B, the simulation time is not shown, and shows the transition of the program counter value (address).

図19(B)で示される命令トレースデータにおいて、(1)では、RET命令が配置されているアドレス“0xF0006”が読まれたことが示されているが、その次のアドレスは、“0xF0000”となっている。これは、直前のアドレス“0xF0004”における条件分岐(“もし0フラグが立っていたら0xF0000にジャンプ”)が実行されたことを示している。したがって、ここではRET命令は実行されていない。したがってこのようなRET命令は無視すべきである。   In the instruction trace data shown in FIG. 19B, (1) indicates that the address “0xF0006” where the RET instruction is arranged is read, but the next address is “0xF0000”. It has become. This indicates that a conditional branch (“jump to 0xF0000 if the 0 flag is set”) at the previous address “0xF0004” has been executed. Therefore, the RET instruction is not executed here. Therefore, such a RET instruction should be ignored.

本実施の形態の手法では、CPU31は、関数間を移動する命令の検出後、命令トレースデータのフェッチを進め、関数レンジデータをもとに、実際にその命令が実行されたか否かを判定しているので、このようなRET命令を無視することができる。図19(B)の例では、CPU31は、アドレス“0x0006”でRET命令を検出後、アドレス “0x0004”までフェッチを進めた後、前述した関数のレンジから出ていないことを判定しため、RET命令を無視している。   In the method according to the present embodiment, after detecting an instruction that moves between functions, the CPU 31 advances fetching of instruction trace data, and determines whether the instruction is actually executed based on the function range data. Therefore, such a RET instruction can be ignored. In the example of FIG. 19B, after detecting the RET instruction at the address “0x0006”, the CPU 31 advances the fetch to the address “0x0004”, and then determines that it is not out of the function range described above. Ignoring instructions.

一方、図19(B)で示される命令トレースデータにおいて、(2)でも、RET命令が配置されているアドレス“0xF0006”が読まれたことが示されており、次のアドレスは、“0xE0050”となっている。つまり、前述した関数レンジ外のアドレスとなっている。このアドレスが関数スタックのトップ―1の関数の関数レンジ内であれば、(2)のRET命令は行使されて、その命令にあった動作が行われていることがわかる。本実施の形態の手法では、CPU31は、関数間を移動する命令の検出後、命令トレースデータのフェッチを進め、関数レンジデータをもとに、実際にその命令が実行されたか否かを判定しているので、このようなRET命令を有効と判定することができる。   On the other hand, in the instruction trace data shown in FIG. 19B, (2) also indicates that the address “0xF0006” where the RET instruction is arranged is read, and the next address is “0xE0050”. It has become. That is, the address is outside the function range described above. If this address is within the function range of the top-1 function in the function stack, it can be seen that the RET instruction in (2) has been exercised and that the operation corresponding to that instruction has been performed. In the method according to the present embodiment, after detecting an instruction that moves between functions, the CPU 31 advances fetching of instruction trace data, and determines whether the instruction is actually executed based on the function range data. Therefore, it can be determined that such a RET instruction is valid.

これによって、命令の実行有無を設計対象のプロセッサの内部に立ち入らずに判定でき、命令トレースデータに含まれる無効な命令アドレスを検出することができる。また、命令トレースデータの取得時の処理が簡単になり、取得時のエラーに対する耐性を上げることができるという効果も期待できる。   Thus, it is possible to determine whether or not the instruction is executed without entering the design target processor, and it is possible to detect an invalid instruction address included in the instruction trace data. In addition, the processing at the time of acquiring the instruction trace data is simplified, and the effect that the tolerance to the error at the time of acquisition can be increased can be expected.

また、呼び出し先の関数レンジが見つけられない場合には、CPU31が関数間を移動する命令を無視することによって、標準関数など、ディスアセンブルできないコードにも対応できる。   Further, when the function range of the call destination cannot be found, the CPU 31 can deal with a code that cannot be disassembled, such as a standard function, by ignoring an instruction to move between functions.

なお、上記の説明では、関数間を移動する命令の位置が、アドレス(即値)で指定される場合について説明したが、ポインタで指定される場合についても同様に適用可能である。その場合、たとえば、ポインタを格納したレジスタ番号が指定された場合に、関数間を移動する命令が指定されたと判定されるようにすればよい。   In the above description, the case where the position of an instruction that moves between functions is specified by an address (immediate value) has been described. However, the present invention can be similarly applied to a case where the position is specified by a pointer. In this case, for example, when a register number storing a pointer is designated, it may be determined that an instruction for moving between functions is designated.

図9、図10で示したような関数スタック生成処理によって、たとえば、以下のような関数トレース情報が生成される。
図20は、関数トレース情報の一例を示す図である。
By the function stack generation process as shown in FIGS. 9 and 10, for example, the following function trace information is generated.
FIG. 20 is a diagram illustrating an example of function trace information.

図のように関数トレース情報には、たとえば、シミュレーション時刻と、アドレス値(図10の処理では、コミット処理が行われた時点でのプログラムカウンタ値)、そのアドレス値が示す命令が含まれる。また、関数トレース情報には、現在実行中の関数位置、関数スタックリスト、現在実行中の関数のID番号とその関数名に関する情報が含まれる。   As shown in the figure, the function trace information includes, for example, a simulation time, an address value (in the process of FIG. 10, a program counter value at the time when the commit process is performed), and an instruction indicated by the address value. The function trace information includes information on the function position currently being executed, the function stack list, the ID number of the function currently being executed, and the function name.

現在実行中の関数位置において、1つ目の引数(左側の数字)は、現在実行中の関数が含まれる関数スタックリストの関数スタックのインデックス番号を示している。また、2つ目の引数(右側の数字)は、関数スタック中での当該関数のインデックス番号である。関数スタックリストでは、関数のID番号を用いて関数スタックの状態が示されている。   At the position of the function currently being executed, the first argument (the number on the left side) indicates the function stack index number of the function stack list that includes the function currently being executed. The second argument (the number on the right) is the index number of the function in the function stack. In the function stack list, the function stack state is indicated by using the function ID number.

次に、図3で示した関数トレース情報表示処理の詳細を説明する。
(関数トレース情報表示処理)
CPU31は、グラフィック処理装置34を制御して、RAM32またはHDD33などに記憶された関数スタックの履歴を、たとえば、図20で示したような関数トレース情報として表示装置34aに表示する。
Next, details of the function trace information display process shown in FIG. 3 will be described.
(Function trace information display processing)
The CPU 31 controls the graphic processing device 34 to display the function stack history stored in the RAM 32 or HDD 33 on the display device 34a as function trace information as shown in FIG. 20, for example.

ユーザは、このような関数トレース情報を見ると、現在実行中の関数だけではなく、この関数を呼んでいる関数も認識できるため、関数間の呼び出し関係を含む関数の実行状況が容易に理解できる。   By looking at such function trace information, the user can recognize not only the currently executing function but also the function that is calling this function, so that the execution status of the function including the call relationship between functions can be easily understood. .

これにより、たとえば、剰余算関数のような小さな関数が、ユークリッド互除法関数により呼び出されているのか、線形合同法関数により呼び出されているのかなどが容易に判断でき、関数がどのような機能を実現するために実行されているのか認識できる。   This makes it easy to determine whether a small function such as the remainder function is called by the Euclidean algorithm function or the linear congruence function, and what functions the function does. You can see if it is being executed to achieve.

そのため、実際にプログラムを開発した実設計者でなくても、設計対象の動作の把握が容易になり、ソフトウェアとハードウェアの協調検証が容易になる。
また、実設計者であっても、剰余算のコール回数が多いことがわかっているが、どの処理がきっかけで起きているのか調べたいというような場合、上記の関数トレース情報を参照することで直感的、かつ定量的に把握することができるようになる。
Therefore, even if it is not the actual designer who actually developed the program, it becomes easy to grasp the operation of the design object, and the collaborative verification of software and hardware becomes easy.
In addition, even the actual designer knows that the number of remainder calls is high, but if you want to find out what process is causing it, refer to the function trace information above. It becomes possible to grasp intuitively and quantitatively.

また、シミュレーション時刻が含まれる命令トレースデータを、設計対象に対するハードウェア論理シミュレーションを用いて取得したことで、ハードウェアの時間精度で、ソフトウェアとハードウェアの協調検証ができる。   In addition, by acquiring the instruction trace data including the simulation time by using the hardware logic simulation for the design object, the software and hardware can be collaboratively verified with the time accuracy of the hardware.

なお、CPU31は、グラフィック処理装置34により関数トレース情報を以下のような波形データに変換させ、表示装置34aに表示させるようにしてもよい。
図21は、関数トレース情報の他の表示例を示す図である。
The CPU 31 may convert the function trace information into the following waveform data by the graphic processing device 34 and display the waveform data on the display device 34a.
FIG. 21 is a diagram illustrating another display example of the function trace information.

横軸は、シミュレーション時間を示している。図21では、関数のIDと関数名で示された各関数の実行状況が波形データにて示されている。もちろん、関数のIDのみ示すようにしてもよいし、関数名のみ示すようにしてもよい。また、たとえば、“_000_start”のように、IDと関数名の両方の情報を1つの名前で表現するようにしてもよい。   The horizontal axis shows the simulation time. In FIG. 21, the execution status of each function indicated by the function ID and the function name is indicated by waveform data. Of course, only the function ID may be indicated, or only the function name may be indicated. Further, for example, information of both ID and function name may be expressed by one name, such as “_000_start”.

CPU31は、図20で示した関数スタックリスト中の関数スタックに含まれている関数に、その関数スタックのインデックス番号+1の番号を割り当て、グラフィック処理装置34により、その番号に応じた表示の仕方で表示処理させている。   The CPU 31 assigns the function stack index number +1 to the function included in the function stack in the function stack list shown in FIG. 20, and the graphic processor 34 displays the function according to the number. Display processing.

たとえば、CPU31は、図21に示すように、インデックス番号0の関数スタックに含まれる関数“_start”、“_main”、“_EncMain”などには、番号1を割り当て、斜線柄で表示させる。また、CPU31は、インデックス番号1の関数スタックに含まれる関数“_vector 6”、“_Interrupt”などには、番号2を割り当て、縦縞柄で表示させる。また、CPU31は、割り込まれて実行待ちの関数については、たとえば、チェック柄で表示させる。   For example, as shown in FIG. 21, the CPU 31 assigns the number 1 to the functions “_start”, “_main”, “_EncMain”, etc. included in the function stack with the index number 0 and displays them in a hatched pattern. Further, the CPU 31 assigns the number 2 to the functions “_vector 6”, “_Interrupt”, etc. included in the function stack with the index number 1, and displays them in a vertical stripe pattern. Further, the CPU 31 displays, for example, a check pattern for the function waiting for execution.

以上のような表示処理により、ユーザは、関数の実行状況や、関数間の包含関係などを視覚的及び直観的に容易に把握することができる。たとえば、図21に示すように、ID番号“_112”の関数が、関数“_start”、“_main”、“_EncMain”に包含されている様子がすぐにわかる。   Through the display processing as described above, the user can easily grasp the execution status of functions and the inclusion relationship between functions visually and intuitively. For example, as shown in FIG. 21, it can be readily seen that the function having the ID number “_112” is included in the functions “_start”, “_main”, and “_EncMain”.

また、ユーザは、割り込みによる遅延の様子なども、図21に示したような関数トレース情報を参照することで、視覚的及び直観的に把握することができる。
また、第1の実施の形態は、第2の実施の形態において、callの出現とこのコミットを関数レンジの変化とその時のアドレスが関数の先頭番地であることで代用し、ret、retiの出現とこのコミットを関数レンジの変化とその時のアドレスが関数の先頭番地以外であることで代用した方式ということもできる。
Further, the user can visually and intuitively grasp the state of delay due to interruption by referring to the function trace information as shown in FIG.
In the first embodiment, in the second embodiment, the appearance of call and this commit are substituted by the change of the function range and the address at that time being the start address of the function, and the appearance of ret and reti. It can also be said that this commit is substituted by changing the function range and that the address at that time is other than the start address of the function.

〔第3の実施の形態〕
第3の実施の形態のシミュレーション装置では、第2の実施の形態で説明した関数スタックの生成処理を、ISSを用いて行うものである。
[Third Embodiment]
In the simulation apparatus according to the third embodiment, the function stack generation processing described in the second embodiment is performed using ISS.

図22は、第3の実施の形態に係るシミュレーション装置の構成を示す図である。
このシミュレーション装置60は、ISS61、疑似命令メモリ62、疑似データメモリ63、時間書き換え処理部64、記憶部D10,D11,D12を有している。
FIG. 22 is a diagram illustrating a configuration of a simulation apparatus according to the third embodiment.
The simulation apparatus 60 includes an ISS 61, a pseudo instruction memory 62, a pseudo data memory 63, a time rewrite processing unit 64, and storage units D10, D11, and D12.

ISS61は、設計対象20のプロセッサ21の動きを模擬するものである。さらに、本実施の形態のISS61は、第2の実施の形態で説明したような関数スタックの生成処理を行う。   The ISS 61 simulates the movement of the processor 21 of the design target 20. Furthermore, the ISS 61 of this embodiment performs a function stack generation process as described in the second embodiment.

疑似命令メモリ62は、プロセッサ21が実行する命令を格納する命令メモリを模擬するものである。たとえば、リンカデータから検出された関数間を移動する命令などが格納される。また、疑似命令メモリ62は、図6で示したような、割り込みベクタデータを保持するようにしてもよい。   The pseudo instruction memory 62 simulates an instruction memory that stores instructions executed by the processor 21. For example, an instruction for moving between functions detected from the linker data is stored. Further, the pseudo instruction memory 62 may hold interrupt vector data as shown in FIG.

さらに、疑似命令メモリ62は、ISS61と設計対象20のプロセッサ21との精度が異なる場合には、その精度差(抽象度差)を吸収する機能を有する。具体的には、疑似命令メモリ62は、命令トレースデータによりISS61が実施可能な命令以外が指定された場合、その命令をスキップして、ISS61で実施可能な命令をISS61に渡す。これにより、ISS61と設計対象20のプロセッサ21との精度差を吸収することができる。   Further, the pseudo-instruction memory 62 has a function of absorbing the accuracy difference (abstraction level difference) when the ISS 61 and the processor 21 of the design target 20 have different accuracy. Specifically, when an instruction other than an instruction that can be executed by the ISS 61 is designated by the instruction trace data, the pseudo instruction memory 62 skips the instruction and passes the instruction that can be executed by the ISS 61 to the ISS 61. Thereby, the accuracy difference between the ISS 61 and the processor 21 of the design target 20 can be absorbed.

疑似データメモリ63は、プロセッサ21に入力されるデータを格納するデータメモリを模擬するものである。
時間書き換え処理部64は、ISS61から出力される関数トレース情報のシミュレーション時間を、命令トレースデータに含まれるシミュレーション時間に書き換える処理を行う。
The pseudo data memory 63 simulates a data memory that stores data input to the processor 21.
The time rewrite processing unit 64 performs a process of rewriting the simulation time of the function trace information output from the ISS 61 to the simulation time included in the instruction trace data.

記憶部D10は、設計対象20に対するハードウェア論理シミュレーションのシミュレーション時刻ごとのプログラムカウンタ値を、命令トレースデータとして記憶する。なお、ISS61は、設計対象20のプロセッサ21がキャッシュメモリ(図示せず)を含むようなものであっても、これを模擬できる。そのため、ハードウェア論理シミュレーションで命令トレースデータを取得する際に、プロセッサ21におけるプロセッサコアとキャッシュメモリ間のアドレス線のトレースを行わなくても、プロセッサ21の外部端子のトレースを行えばよい。このとき、命令トレースデータとデータが混載している場合には、メモリマップ情報などを用いて分離することができる。   The storage unit D10 stores a program counter value for each simulation time of the hardware logic simulation for the design target 20 as instruction trace data. The ISS 61 can simulate this even if the processor 21 of the design target 20 includes a cache memory (not shown). Therefore, when acquiring instruction trace data by hardware logic simulation, tracing of the external terminal of the processor 21 may be performed without tracing the address line between the processor core and the cache memory in the processor 21. At this time, if the instruction trace data and data are mixed, they can be separated using memory map information or the like.

記憶部D11は、ISS61で用いるデータを記憶する。
記憶部D12は、生成した関数スタックの履歴(関数トレース情報)を記憶する。
なお、シミュレーション装置60の具体的なハードウェア構成は、図2で示したコンピュータ30と同様である。ISS61、疑似命令メモリ62、疑似データメモリ63、時間書き換え処理部64は、ソフトウェアで実現可能である。また、記憶部D10〜D12は、図2で示したようなRAM32またはHDD33を用いて実現可能である。
The storage unit D11 stores data used in the ISS 61.
The storage unit D12 stores a history (function trace information) of the generated function stack.
The specific hardware configuration of the simulation apparatus 60 is the same as that of the computer 30 shown in FIG. The ISS 61, the pseudo instruction memory 62, the pseudo data memory 63, and the time rewrite processing unit 64 can be realized by software. The storage units D10 to D12 can be realized by using the RAM 32 or the HDD 33 as shown in FIG.

このようなシミュレーション装置60では、ISS61は、記憶部D10に記憶された命令トレースデータで指定された命令を疑似命令メモリ62から取得して実行する。このとき疑似命令メモリ62は、ISS61が実行しない命令についてはISS61に渡さない。命令の実行の際にデータが必要な場合には、疑似データメモリ63は記憶部D11からデータを読んで、ISS61に渡す。   In such a simulation device 60, the ISS 61 acquires the instruction specified by the instruction trace data stored in the storage unit D10 from the pseudo instruction memory 62 and executes it. At this time, the pseudo instruction memory 62 does not pass to the ISS 61 those instructions that the ISS 61 does not execute. If data is required when executing the instruction, the pseudo data memory 63 reads the data from the storage unit D11 and passes it to the ISS 61.

ISS61は、疑似命令メモリ62から関数間の移動する命令や割り込みを検出した場合、第2の実施の形態で説明したような関数スタック生成処理により、前述したような関数スタックリストを作成して、関数スタックを生成する。   When the ISS 61 detects an instruction or interrupt that moves between functions from the pseudo-instruction memory 62, the ISS 61 creates a function stack list as described above by the function stack generation process described in the second embodiment, Create a function stack.

なお、このとき出力される関数スタックのシミュレーション時間は、ISS61によるソフトウェアの時間であるので、時間書き換え処理部64は、この時間をハードウェア論理シミュレーションの時間に書き換えてから、記憶部D12に出力する。   Since the simulation time of the function stack output at this time is the time of software by the ISS 61, the time rewrite processing unit 64 rewrites this time to the time of hardware logic simulation and then outputs it to the storage unit D12. .

具体的には、時間書き換え処理部64は、疑似命令メモリ62を介して、ハードウェア論理シミュレーションのシミュレーション時刻が含まれる命令トレースデータを取得する。そして、時間書き換え処理部64は、出力された関数スタックに含まれる各命令が実行される時刻を、その命令が実行される命令トレースデータ上の時刻で書き換える。   Specifically, the time rewrite processing unit 64 acquires instruction trace data including the simulation time of the hardware logic simulation via the pseudo instruction memory 62. Then, the time rewrite processing unit 64 rewrites the time at which each instruction included in the output function stack is executed with the time on the instruction trace data at which the instruction is executed.

これにより、ハードウェア論理シミュレータの時間精度の関数スタック及び関数トレース情報を生成することができ、ハードウェアとソフトウェアの協調検証に用いることができるようになる。たとえば、ISS61から取れるデータ(たとえば、命令種別)と、実際にプロセッサ21が設計データに組み込まれた時の時間情報の関係を、ハードウェア論理シミュレーションの時間精度で比較評価ができる。また、たとえば、命令種別ごとの処理時間の統計データをとることや、命令種別とデータアドレスのアクセス先を使い、アドレス空間ごとのロード・ストアの時間の統計データ、時分割による統計データ、時系列による逐次表示が可能である。数種のプロセッサ21で同等のデータを収得して、グラフ化(波形データ化)すれば、競合を可視化でき、ユーザにより高度な分析を可能にするデータを提供し得る。   As a result, a time-accurate function stack and function trace information of the hardware logic simulator can be generated, and can be used for hardware and software cooperative verification. For example, the relationship between the data (for example, the instruction type) taken from the ISS 61 and the time information when the processor 21 is actually incorporated into the design data can be comparatively evaluated with the time accuracy of the hardware logic simulation. In addition, for example, statistical data on processing time for each instruction type, use of instruction type and data address access destination, load / store time statistical data for each address space, time division statistical data, time series Can be displayed sequentially. If several types of processors 21 obtain the same data and graph it (convert it into waveform data), it is possible to visualize the competition and provide data that allows the user to perform more advanced analysis.

また、上記の説明では、時間書き換え処理部64は、命令トレースデータを利用するとしたが、データトレースデータの時間情報で、関数トレース情報の時間情報を修正するようにしてもよい。   In the above description, the time rewrite processing unit 64 uses the instruction trace data. However, the time information of the function trace information may be corrected with the time information of the data trace data.

以上、第1乃至第3の実施の形態のシミュレーション装置を説明してきたが、上記シミュレーション装置の処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体には、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。磁気記録装置には、HDD、フレキシブルディスク(FD)、磁気テープ(MT)などがある。光ディスクには、DVD(Digital Versatile Disc)、DVD−RAM、CD−ROM(Compact Disc - Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などがある。光磁気記録媒体には、MO(Magneto - Optical disk)などがある。   As mentioned above, although the simulation apparatus of the 1st thru | or 3rd embodiment was demonstrated, the program which described the processing content of the said simulation apparatus can be recorded on the computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include an HDD, a flexible disk (FD), and a magnetic tape (MT). Optical disks include DVD (Digital Versatile Disc), DVD-RAM, CD-ROM (Compact Disc-Read Only Memory), CD-R (Recordable) / RW (ReWritable), and the like. Magneto-optical recording media include MO (Magneto-Optical disk).

上記プログラムを流通させる場合には、たとえば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータに格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When the program is distributed, for example, portable recording media such as DVDs and CD-ROMs on which the program is recorded are sold. It is also possible to store the program in a server computer and transfer the program from the server computer to another computer via a network.

上記プログラムを実行するコンピュータは、たとえば、可搬型記録媒体に記録されたプログラム若しくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送される毎に、逐次、受け取ったプログラムに従った処理を実行することもできる。   The computer that executes the program stores, for example, a program recorded on a portable recording medium or a program transferred from a server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. In addition, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

以上、実施の形態に基づき、本発明のシミュレーション装置及びシミュレーション方法の一観点について説明してきたが、これらは一例にすぎず、上記の記載に限定されるものではない。   As mentioned above, although one viewpoint of the simulation apparatus and simulation method of this invention has been demonstrated based on embodiment, these are only examples and are not limited to said description.

たとえば、図9、図10で示したような関数スタックの生成処理を、FPGA(Programmable Logic Device)などのLSIで実現するようにしてもよい。
また、第3の実施の形態において、ISS61が関数スタックを生成するのではなく、ISS61で検出した関数間を移動する命令のアドレスを、第1または第2の実施の形態における関数スタックの生成処理のための入力情報としてもよい。
For example, the function stack generation processing as shown in FIGS. 9 and 10 may be realized by an LSI such as an FPGA (Programmable Logic Device).
Further, in the third embodiment, the ISS 61 does not generate a function stack, but the address of an instruction that moves between functions detected by the ISS 61 is used as the function stack generation processing in the first or second embodiment. It is good also as input information for.

10 シミュレーション装置
11 検出部
12 関数スタック生成部
13 関数トレース情報表示部
20 設計対象
21 プロセッサ
21a プログラムカウンタ(PC)
22 メモリ
D1〜D5 記憶部
DESCRIPTION OF SYMBOLS 10 Simulation apparatus 11 Detection part 12 Function stack generation part 13 Function trace information display part 20 Design object 21 Processor 21a Program counter (PC)
22 memory D1-D5 storage unit

Claims (5)

設計対象において実行される各関数が配置されるメモリ上のアドレス範囲、または関数間を移動する命令が配置される前記メモリ上のアドレスを検出する検出部と、
前記設計対象で実行される各命令のアドレスと、前記アドレス範囲または前記関数間を移動する命令の前記アドレスとを比較し、比較結果に応じて前記関数間の呼び出し関係を示す関数スタックを生成する関数スタック生成部と、
を有することを特徴とするシミュレーション装置。
A detection unit for detecting an address range on a memory in which each function executed in the design target is arranged, or an address on the memory in which an instruction moving between functions is arranged;
The address of each instruction executed on the design target is compared with the address of the instruction that moves between the address range or the functions, and a function stack indicating a call relationship between the functions is generated according to the comparison result. A function stack generator,
A simulation apparatus comprising:
前記設計対象におけるシミュレーション時刻に応じた前記関数スタックの履歴を表示する表示部をさらに有することを特徴とする請求項1記載のシミュレーション装置。   The simulation apparatus according to claim 1, further comprising a display unit configured to display a history of the function stack according to a simulation time in the design target. 前記関数スタック生成部は、前記設計対象で実行される命令の前記アドレスと、前記関数間を移動する命令の前記アドレスとが一致した場合、前記関数の前記アドレス範囲を参照して実際に関数間を移動したか判定し、判定結果に応じて前記関数スタックを更新することを特徴とする請求項1または2記載のシミュレーション装置。   When the address of the instruction executed on the design target matches the address of the instruction moving between the functions, the function stack generation unit refers to the address range of the function and actually The simulation apparatus according to claim 1, wherein the function stack is updated according to a determination result. 前記関数スタック生成部は命令セットシミュレータを用いて前記関数スタックを生成し、
前記命令セットシミュレータから出力される前記関数スタックに含まれる時間情報を、前記設計対象におけるシミュレーション時刻に合わせて補正する時間書き換え処理部をさらに有することを特徴とする請求項1乃至3記載のシミュレーション装置。
The function stack generation unit generates the function stack using an instruction set simulator,
4. The simulation apparatus according to claim 1, further comprising a time rewriting processing unit that corrects time information included in the function stack output from the instruction set simulator in accordance with a simulation time in the design target. .
設計対象において実行される各関数が配置されるメモリ上のアドレス範囲、または関数間を移動する命令が配置される前記メモリ上のアドレスを検出し、
前記設計対象で実行される各命令のアドレスと、前記アドレス範囲または前記関数間を移動する命令の前記アドレスとを比較し、比較結果に応じて前記関数間の呼び出し関係を示す関数スタックを生成することを特徴とするシミュレーション方法。
Detecting an address range on a memory where each function to be executed in the design object is arranged, or an address on the memory where an instruction moving between functions is arranged;
The address of each instruction executed on the design target is compared with the address of the instruction that moves between the address range or the functions, and a function stack indicating a call relationship between the functions is generated according to the comparison result. A simulation method characterized by that.
JP2010035920A 2010-02-22 2010-02-22 Simulation apparatus and simulation method Expired - Fee Related JP5504960B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010035920A JP5504960B2 (en) 2010-02-22 2010-02-22 Simulation apparatus and simulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010035920A JP5504960B2 (en) 2010-02-22 2010-02-22 Simulation apparatus and simulation method

Publications (2)

Publication Number Publication Date
JP2011170749A true JP2011170749A (en) 2011-09-01
JP5504960B2 JP5504960B2 (en) 2014-05-28

Family

ID=44684784

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010035920A Expired - Fee Related JP5504960B2 (en) 2010-02-22 2010-02-22 Simulation apparatus and simulation method

Country Status (1)

Country Link
JP (1) JP5504960B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109673A (en) * 2011-11-22 2013-06-06 Fujitsu Semiconductor Ltd Simulation device, simulation method, and simulation program
WO2014014200A1 (en) * 2012-07-20 2014-01-23 주식회사 안랩 Computer system, method for shifting address computer system, and method for monitoring system function of computer system
KR20200060180A (en) * 2018-11-21 2020-05-29 숭실대학교산학협력단 Method of call graph extraction in android apps, recording medium and apparatus for performing the method
JP2021068005A (en) * 2019-10-18 2021-04-30 ファナック株式会社 Programming support device, programming support system, and programming support method
JP2021180020A (en) * 2016-10-11 2021-11-18 グリーン ヒルズ ソフトウェア,インコーポレイテッド Systems and methods for summarization and visualization of trace data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01229328A (en) * 1988-03-09 1989-09-13 Hitachi Ltd Pseudo timer control system
JPH05134903A (en) * 1991-11-13 1993-06-01 Nec Corp Program operation analyzing device
JPH05216715A (en) * 1992-02-05 1993-08-27 Nec Corp Function calling and returning detection system
JP2000276373A (en) * 1999-03-23 2000-10-06 Ntt Communicationware Corp Data processing method, data processor and recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01229328A (en) * 1988-03-09 1989-09-13 Hitachi Ltd Pseudo timer control system
JPH05134903A (en) * 1991-11-13 1993-06-01 Nec Corp Program operation analyzing device
JPH05216715A (en) * 1992-02-05 1993-08-27 Nec Corp Function calling and returning detection system
JP2000276373A (en) * 1999-03-23 2000-10-06 Ntt Communicationware Corp Data processing method, data processor and recording medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109673A (en) * 2011-11-22 2013-06-06 Fujitsu Semiconductor Ltd Simulation device, simulation method, and simulation program
WO2014014200A1 (en) * 2012-07-20 2014-01-23 주식회사 안랩 Computer system, method for shifting address computer system, and method for monitoring system function of computer system
JP2021180020A (en) * 2016-10-11 2021-11-18 グリーン ヒルズ ソフトウェア,インコーポレイテッド Systems and methods for summarization and visualization of trace data
JP2022043324A (en) * 2016-10-11 2022-03-15 グリーン ヒルズ ソフトウェア,インコーポレイテッド Systems and methods for summarization and visualization of trace data
JP7051269B2 (en) 2016-10-11 2022-04-11 グリーン ヒルズ ソフトウェア,インコーポレイテッド Systems and methods for summarizing and visualizing trace data
JP7336545B2 (en) 2016-10-11 2023-08-31 グリーン ヒルズ ソフトウェア,インコーポレイテッド System and method for trace data summarization and visualization
KR20200060180A (en) * 2018-11-21 2020-05-29 숭실대학교산학협력단 Method of call graph extraction in android apps, recording medium and apparatus for performing the method
KR102176742B1 (en) * 2018-11-21 2020-11-09 숭실대학교산학협력단 Method of call graph extraction in android apps, recording medium and apparatus for performing the method
JP2021068005A (en) * 2019-10-18 2021-04-30 ファナック株式会社 Programming support device, programming support system, and programming support method
JP7414461B2 (en) 2019-10-18 2024-01-16 ファナック株式会社 Program creation support device, program creation support system, and program creation support method

Also Published As

Publication number Publication date
JP5504960B2 (en) 2014-05-28

Similar Documents

Publication Publication Date Title
CN109426723B (en) Detection method, system, equipment and storage medium using released memory
JP4148527B2 (en) Functional test script generator
US20070011664A1 (en) Device and method for generating an instruction set simulator
JP5504960B2 (en) Simulation apparatus and simulation method
CN113742119A (en) Call stack backtracking method and device of embedded system and computer equipment
JP6342129B2 (en) Source code error position detection apparatus and method for mixed mode program
WO2015008115A1 (en) Method and computer program product for disassembling a mixed machine code
JP2011129028A (en) Test support device for optimizing test scenario to minimize total test time, test device, test support method, and computer program
Wang et al. Accurate source-level simulation of embedded software with respect to compiler optimizations
JP2008176453A (en) Simulation device
US10839124B1 (en) Interactive compilation of software to a hardware language to satisfy formal verification constraints
JP2018156133A (en) Compiler program, information processing apparatus and compilation method
JP2009104252A (en) Debugging support device and debugging support method
JPH10320212A (en) Cache optimizing method
GB2397905A (en) Method for automatically generating and ordering test scripts
JP5891976B2 (en) Compile execution / management method, apparatus, and program
US20090235223A1 (en) Program generation apparatus and program generation method
JP2013218574A (en) Endian problem detection device
CN115470151B (en) Application operation analysis method, computing device and storage medium
JP2003015914A (en) Method for producing test program for evaluating information processing unit, device and program describing processing therefor
JP2014106770A (en) Type check device, type check method and type check program
JP2002014847A (en) Device for checking program and method for the same and recording medium with checking program stored
Matoussi et al. Loop aware CFG matching strategy for accurate performance estimation in IR-level native simulation
JP4679540B2 (en) Program verification method, system, and program
JP2004326237A (en) Test case creation device, test case creation method, test case, and test method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130108

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140131

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140303

R150 Certificate of patent or registration of utility model

Ref document number: 5504960

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees