JPH07219808A - Emulator and its tracking method - Google Patents

Emulator and its tracking method

Info

Publication number
JPH07219808A
JPH07219808A JP6013868A JP1386894A JPH07219808A JP H07219808 A JPH07219808 A JP H07219808A JP 6013868 A JP6013868 A JP 6013868A JP 1386894 A JP1386894 A JP 1386894A JP H07219808 A JPH07219808 A JP H07219808A
Authority
JP
Japan
Prior art keywords
emulator
trace
program counter
memory
microprocessor
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.)
Withdrawn
Application number
JP6013868A
Other languages
Japanese (ja)
Inventor
Tatsuya Suzuki
達也 鈴木
Giichi Aoto
義一 青砥
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Original Assignee
Hitachi Microcomputer System Ltd
Hitachi 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 Hitachi Microcomputer System Ltd, Hitachi Ltd filed Critical Hitachi Microcomputer System Ltd
Priority to JP6013868A priority Critical patent/JPH07219808A/en
Publication of JPH07219808A publication Critical patent/JPH07219808A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To acquire the accurate executing result of tracing of an emulator. CONSTITUTION:In a tracing state of an emulator 1, the program counter value- executed actually by a microprocessor 2 is designated as one of trace acquiring conditions. At the same time, the counter value is stored in a trace memory 7 based on the trace acquiring conditions and in a state related to the data stored in the memory 7.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、エミュレータのトレー
ス方法およびエミュレータ技術に関し、特に、プリフェ
ッチ機能付きのマイクロプロセッサを有するエミュレー
タのトレース技術に適用して有効な技術に関するもので
ある。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an emulator tracing method and an emulator technique, and more particularly to a technique effectively applied to an emulator tracing technique having a microprocessor with a prefetch function.

【0002】[0002]

【従来の技術】マイクロプロセッサ応用機器の開発にお
いてはエミュレータを使用することがある。エミュレー
タは対象マイクロプロセッサあるいはそれと同機能のマ
イクロプロセッサを有し、このマイクロプロセッサによ
ってユーザプログラムを実行、停止させながらユーザシ
ステムを制御することにより、マイクロプロセッサ応用
機器におけるハードウェアおよびソフトウェアのデバッ
グを可能にするものである。
2. Description of the Related Art Emulators are sometimes used in the development of microprocessor application equipment. The emulator has a target microprocessor or a microprocessor with the same function as it. By controlling the user system while executing and stopping the user program by this microprocessor, it is possible to debug the hardware and software in the microprocessor application device. To do.

【0003】一般に、エミュレータでは、リアルタイム
エミュレーション実行時のマイクロプロセッサのアドレ
スバスの情報、データバスの情報および各種情報を取得
するトレース機能を持っており、その内容をバスサイク
ル単位あるいは逆アセンブルによる命令単位で表示する
ことができるようになっている。ここで、トレース取得
の条件は、取得情報の状態によって指定することができ
る。これについては、例えば株式会社日立製作所 H8
/530ASEmodel−II ユーザーズマニュア
ルP49〜P54に記載がある。
Generally, an emulator has a trace function for acquiring information on the address bus, data bus, and various information of the microprocessor during execution of real-time emulation, and the contents thereof are in bus cycle units or instruction units by disassembly. It can be displayed with. Here, the trace acquisition condition can be specified by the state of the acquisition information. Regarding this, for example, Hitachi Ltd. H8
/ 530 ASEmodel-II User's Manual P49 to P54.

【0004】ところで、マイクロプロセッサを構成する
素子集積度の向上に伴い、プリフェッチ機能等のような
種々の機能が半導体チップ内に取り込まれるようになっ
てきている。このプリフェッチ機能は、マイクロプロセ
ッサが次に実行するであろうデータを所定のメモリに予
め記憶する機能である。
Meanwhile, as the degree of integration of elements constituting a microprocessor has been improved, various functions such as a prefetch function have been incorporated in a semiconductor chip. This prefetch function is a function of pre-storing the data that the microprocessor will execute next in a predetermined memory.

【0005】このような従来技術において、エミュレー
タのトレース取得条件の一致判定は、バスサイクル単位
で指定内容と比較することによって行っていた。そし
て、アドレスをトレース条件と比較することによってデ
ータサイクル、リフレッシュサイクルおよびDMA(Di
rect Memory Access) サイクル以外のプリフェッチサイ
クルでデータをトレースメモリに記憶していた。
In such a conventional technique, the coincidence determination of the trace acquisition condition of the emulator has been performed by comparing with the designated content in bus cycle units. Then, by comparing the address with the trace condition, the data cycle, refresh cycle and DMA (Di
The data was stored in the trace memory in the prefetch cycle other than the rect Memory Access) cycle.

【0006】[0006]

【発明が解決しようとする課題】ところが、上記従来の
プリフェッチ機能付きのマイクロプロセッサを有するエ
ミュレータのトレース技術においては、以下の問題があ
ることを本発明者は見い出した。
However, the inventor of the present invention has found that the conventional trace technique for an emulator having a microprocessor with a prefetch function has the following problems.

【0007】第1に、プリフェッチした命令が実際には
実行されない場合があるために、トレースメモリに実際
に実行していない誤ったデータを記憶してしまう場合が
生じ、逆アセンブル表示ができなくなる問題があった。
これを図6および図7を用いて説明する。
First, since the prefetched instruction may not be actually executed, erroneous data that has not been actually executed may be stored in the trace memory, and disassemble display cannot be performed. was there.
This will be described with reference to FIGS. 6 and 7.

【0008】図6は従来技術におけるエミュレータの命
令実行順序を示している。ここでは、マイクロプロセッ
サは、図6の矢印の実行順序に従って、メモリ上のアド
レス101、102、110、111、112の命令を
順に実行するものとする。
FIG. 6 shows the instruction execution sequence of a conventional emulator. Here, it is assumed that the microprocessor sequentially executes the instructions at the addresses 101, 102, 110, 111, 112 on the memory in the order of execution of the arrows in FIG.

【0009】すなわち、アドレス103〜109の命令
は実行しないものとする。なお、実行されない命令のア
ドレス103、104には図面を見易くするため斜線が
付してある。
That is, it is assumed that the instructions at the addresses 103 to 109 are not executed. It should be noted that the addresses 103 and 104 of the instructions that are not executed are shaded to make the drawing easier to see.

【0010】ここで、従来のバストレースでは、アドレ
スをトレース取得条件と比較することによって、データ
サイクル、リフレッシュサイクル、DMAサイクル以外
のプリフェッチサイクルをトレースしているが、この場
合、図7に示すように、実際には実行していないアドレ
ス103,104の命令もトレースメモリ30に記憶し
ている。
Here, in the conventional bus trace, the prefetch cycle other than the data cycle, refresh cycle, and DMA cycle is traced by comparing the address with the trace acquisition condition. In this case, as shown in FIG. In addition, the instructions of the addresses 103 and 104 which are not actually executed are also stored in the trace memory 30.

【0011】第2に、トレース取得条件を、例えばアド
レス指定による所定の範囲で行った場合、図8のアドレ
ス101、104、111の命令で示すように、実行結
果がトレースメモリ30に部分的に書き込まれることに
なるが、その各切れ目では最後の部分に対する命令実行
状態を示す信号の位置が誤って記憶される場合があり、
逆アセンブル表示ができなくなる問題があった。
Secondly, when the trace acquisition condition is set within a predetermined range by addressing, for example, the execution result is partially stored in the trace memory 30 as shown by the instructions at addresses 101, 104 and 111 in FIG. Although it will be written, the position of the signal indicating the instruction execution state for the last part may be erroneously stored at each break,
There was a problem that disassemble display could not be performed.

【0012】その命令実装状態を示す信号が誤って記憶
されるのは、例えば次の理由からである。すなわち、マ
イクロプロセッサが出力する命令実行状態を示す信号
が、プリフェッチサイクルに対して若干遅れて発生する
ことに起因し、トレースメモリ30に取り込まれる位置
が本来記憶されなければならない位置からずれてしまう
からである。
The signal indicating the instruction implementation state is erroneously stored for the following reason, for example. That is, the signal output from the microprocessor indicating the instruction execution state is generated slightly later than the prefetch cycle, and the position fetched in the trace memory 30 deviates from the position originally stored. Is.

【0013】本発明は上記課題に着目してなされたもの
であり、その目的は、エミュレータのトレースにおい
て、実行結果を正確に取得することのできる技術を提供
することにある。
The present invention has been made in view of the above problems, and an object thereof is to provide a technique capable of accurately acquiring an execution result in tracing of an emulator.

【0014】本発明の前記ならびにその他の目的と新規
な特徴は、明細書の記述および添付図面から明らかにな
るであろう。
The above and other objects and novel features of the present invention will be apparent from the description of the specification and the accompanying drawings.

【0015】[0015]

【課題を解決するための手段】本願において開示される
発明のうち、代表的なものの概要を簡単に説明すれば、
以下のとおりである。
Of the inventions disclosed in the present application, a representative one will be briefly described below.
It is as follows.

【0016】すなわち、本発明のエミュレータのトレー
ス方法は、エミュレーション対象の電子装置をエミュレ
ータ本体に設けられたマイクロプロセッサによって疑似
的に動作させ、前記エミュレーション対象の電子装置の
デバックを行うエミュレータのトレース方法であって、
前記マイクロプロセッサが実際に実行したプログラムカ
ウンタ値を、トレース取得条件の1つとして指定すると
とももに、トレース取得条件に従ってトレースメモリに
記憶されたデータと関連性を持たせた状態でトレースメ
モリに記憶する工程を有するものである。
That is, the emulator tracing method of the present invention is a tracing method of an emulator, in which an electronic device to be emulated is pseudo-operated by a microprocessor provided in the emulator main body to debug the electronic device to be emulated. There
The program counter value actually executed by the microprocessor is specified as one of the trace acquisition conditions, and is also stored in the trace memory in association with the data stored in the trace memory according to the trace acquisition conditions. There is a step of doing.

【0017】また、本発明のエミュレータのトレース方
法は、エミュレーション対象の電子装置をエミュレータ
本体に設けられたマイクロプロセッサによって疑似的に
動作させ、前記エミュレーション対象の電子装置のデバ
ックを行うエミュレータのトレース方法であって、前記
マイクロプロセッサがその動作の際に次に実行するデー
タを予め取得するプリフェッチ工程を有し、前記マイク
ロプロセッサより出力されるプリフェッチ時におけるバ
ス信号の状態およびエミュレータ本体内部の動作信号の
状態に基づいて前記プログラムカウンタ値を生成する工
程と、前記プログラムカウンタ値が、前記エミュレータ
におけるプログラムカウンタ値に一致するか否かを比較
する工程とを有するものである。
The emulator tracing method of the present invention is a tracing method of an emulator, in which an electronic device to be emulated is pseudo-operated by a microprocessor provided in the emulator main body to debug the electronic device to be emulated. The microprocessor has a prefetch step of previously acquiring data to be executed at the time of its operation, the state of the bus signal at the time of prefetch output from the microprocessor and the state of the operation signal inside the emulator main body. And a step of generating the program counter value based on, and comparing the program counter value with the program counter value in the emulator.

【0018】さらに、本発明のエミュレータのトレース
方法は、マイクロプロセッサの命令実行状態に基づいて
プログラムカウンタ値を生成し、その値をトレース取得
条件の1つとして指定するとともに、トレースメモリに
記憶されたデータと関連性を持たせた状態でトレースメ
モリに記憶する機能を有するプログラムカウンタ生成回
路部を設けたものである。
Further, the emulator tracing method of the present invention generates a program counter value based on the instruction execution state of the microprocessor, specifies the value as one of the trace acquisition conditions, and stores it in the trace memory. A program counter generation circuit section having a function of storing in a trace memory in a state of being associated with data is provided.

【0019】[0019]

【作用】上記した本発明によれば、実際に実行したこと
を意味するプログラムカウンタ値を、トレース取得条件
とすることにより、実際に実行したデータのみをトレー
スメモリに記憶することが可能となる。
According to the present invention described above, by setting the program counter value, which means the actual execution, as the trace acquisition condition, only the actually executed data can be stored in the trace memory.

【0020】また、例えばトレースメモリに取得する命
令等のデータをアドレス範囲で指定するような場合、す
なわち、命令等のデータを部分部分取り出すような場合
でも、トレースメモリ内における各データの集合体の切
れ目における最後のデータ実行状態を示す信号の位置
を、そのデータに対応するプログラムカウンタ値を参照
することによって正確に知ることが可能となる。
In addition, for example, when data such as an instruction to be acquired in the trace memory is specified in an address range, that is, when data such as an instruction is partially extracted, the aggregate of each data in the trace memory is The position of the signal indicating the last data execution state at the break can be accurately known by referring to the program counter value corresponding to the data.

【0021】[0021]

【実施例】図1は本発明の一実施例であるエミュレータ
のブロック図、図2は図1のエミュレータにおけるトレ
ースメモリ部を詳細に示すブロック図、図3は本実施例
のエミュレータの命令実行中におけるバスサイクルタイ
ミングとプログラムカウンタの生成タイミングとのタイ
ミングチャート図、図4は本実施例のエミュレータの命
令実行順序を説明するための説明図、図5はトレースメ
モリへの命令の記憶状態を説明するための説明図であ
る。
FIG. 1 is a block diagram of an emulator which is an embodiment of the present invention, FIG. 2 is a block diagram showing in detail a trace memory section in the emulator of FIG. 1, and FIG. 5 is a timing chart of the bus cycle timing and the generation timing of the program counter in FIG. 4, FIG. 4 is an explanatory diagram for explaining the instruction execution sequence of the emulator of the present embodiment, and FIG. 5 is a description of the instruction storage state in the trace memory. FIG.

【0022】本実施例のエミュレータは、図1に示すよ
うに、例えばマイクロプロセッサ応用機器の開発時に用
いられるエミュレータ1である。
As shown in FIG. 1, the emulator of this embodiment is an emulator 1 used, for example, in developing a microprocessor application device.

【0023】エミュレーション用のマイクロプロセッサ
(Microprocessor Unit 、以下、単にMPUと略す)2
は、エミュレーション対象の電子装置が所有するマイク
ロプロセッサと同等の機能を有するとともに、エミュレ
ータに用いる命令実行状態信号を配線L1 を通じて後述
するプログラムカウンタ生成回路PCに対して伝送する
ことが可能になっている。
Emulation microprocessor (Microprocessor Unit, hereinafter abbreviated as MPU) 2
Has a function equivalent to that of a microprocessor possessed by an electronic device to be emulated, and can transmit an instruction execution state signal used for an emulator to a program counter generation circuit PC described later through a wiring L 1. There is.

【0024】MPU2は、エミュレーションバス3を介
して、エミュレーション制御部4、メモリ5、ブレーク
検出回路6、プログラムカウンタ生成回路PC、トレー
スメモリ7およびエミュレーションメモリ8と電気的に
接続され、さらにユーザインタフェース部9およびユー
ザインタフェースソケット10を介して、ユーザシステ
ム(エミュレーション対象の電子装置)上のマイクロプ
ロセッサ部およびDRAMに接続されるようになってい
る。
The MPU 2 is electrically connected to the emulation control unit 4, the memory 5, the break detection circuit 6, the program counter generation circuit PC, the trace memory 7 and the emulation memory 8 via the emulation bus 3, and further the user interface unit. 9 and the user interface socket 10 are connected to the microprocessor unit and the DRAM on the user system (electronic device to be emulated).

【0025】エミュレーション制御部4は、エミュレー
ション動作を制御するための回路部である。メモリ5
は、エミュレーション動作制御時に使用するデータの格
納されたメモリである。ブレーク検出回路6は、ユーザ
プログラム実行停止条件を検出するための回路部であ
る。トレースメモリ7は、エミュレーション実行結果を
後述するトレース取得条件等に基づいて取得するための
メモリである。エミュレーションメモリ8は、ユーザシ
ステムの任意のアドレスに割り付けて使用することが可
能なメモリである。
The emulation control section 4 is a circuit section for controlling the emulation operation. Memory 5
Is a memory in which data used during emulation operation control is stored. The break detection circuit 6 is a circuit unit for detecting a user program execution stop condition. The trace memory 7 is a memory for acquiring the emulation execution result based on a trace acquisition condition described later. The emulation memory 8 is a memory that can be used by being assigned to any address of the user system.

【0026】ホストCPU11は、エミュレータ1の全
体を制御するための構成部であり、システムバス12を
介してシステムメモリ13、I/Oインタフェース部1
4と電気的に接続されている。I/Oインタフェース部
14にはマンマシンインタフェース用のCRT15およ
びフロッピィディスク装置16が接続されている。
The host CPU 11 is a component for controlling the entire emulator 1, and includes a system memory 13 and an I / O interface unit 1 via a system bus 12.
4 is electrically connected. A CRT 15 for man-machine interface and a floppy disk device 16 are connected to the I / O interface section 14.

【0027】さらに、ホストCPU11は、システムバ
ス12等を介して、エミュレーション制御部4、メモリ
5、ブレーク検出回路6、プログラムカウンタ生成回路
PC、トレースメモリ7およびエミュレーションメモリ
8とアクセスすることが可能となっている。
Further, the host CPU 11 can access the emulation control unit 4, the memory 5, the break detection circuit 6, the program counter generation circuit PC, the trace memory 7 and the emulation memory 8 via the system bus 12 and the like. Has become.

【0028】このようなエミュレータ1において、MP
U2は、エミュレーションの実行に際して、ユーザシス
テム上あるいはエミュレーションメモリ8上のユーザプ
ログラムを実行するようになっている。
In such an emulator 1, the MP
U2 executes the user program on the user system or the emulation memory 8 when executing the emulation.

【0029】エミュレーションメモリ8へのアクセス
は、エミュレーションバス3のアドレスバスを常に監視
することによって行われるようになっている。すなわ
ち、そのアドレスバスの監視中に、エミュレーションメ
モリ割り付けアドレスとなったら、ユーザインタフェー
ス部9の動作を停止させ、エミュレーションメモリ8の
チップセレクト信号またはライトイネーブル信号を出力
することによって行われるようになっている。書き込み
禁止およびアクセス禁止領域の検出も同様にアドレスバ
スを監視することによって行われるようになっている。
The emulation memory 8 is accessed by constantly monitoring the address bus of the emulation bus 3. That is, when the emulation memory allocation address is reached during monitoring of the address bus, the operation of the user interface unit 9 is stopped and the chip select signal or the write enable signal of the emulation memory 8 is output. There is. The detection of the write-prohibited and access-prohibited areas is similarly performed by monitoring the address bus.

【0030】プログラムカウンタ生成回路PCは、上記
したMPU2からの命令実行状態信号、例えばMPU2
より出力されるプリフェッチ時におけるバス信号の状態
およびエミュレータ本体内部の動作信号の状態に基づい
て、プログラムカウンタ値を随時生成する回路であり、
プログラムカウンタバス17を通じてブレーク検出回路
6およびトレースメモリ7と電気的に接続されている。
The program counter generation circuit PC has an instruction execution status signal from the above MPU 2, for example, MPU 2
Is a circuit for generating a program counter value at any time based on the state of the bus signal at the time of prefetching output and the state of the operation signal inside the emulator main body,
The break detection circuit 6 and the trace memory 7 are electrically connected through the program counter bus 17.

【0031】ここで生成されたプログラムカウンタの値
は、トレース取得条件の1つとして指定されるととも
に、トレース取得条件に従ってトレースメモリ7に記憶
された命令等のデータと関連性を持った状態でトレース
メモリ7に記憶されるようになっている。
The value of the program counter generated here is specified as one of the trace acquisition conditions, and traced in a state of being related to the data such as the instruction stored in the trace memory 7 according to the trace acquisition conditions. It is stored in the memory 7.

【0032】すなわち、本実施例においては、実際に実
行したことを意味するプログラムカウンタ値を、トレー
ス取得条件とすることにより、実際に実行した命令等の
データのみをトレースメモリ7に記憶することが可能と
なっている。したがって、エミュレータ1のトレースに
おいて、命令の実行結果を正確に取得することが可能と
なっている。
That is, in the present embodiment, only the data such as the actually executed instruction can be stored in the trace memory 7 by setting the program counter value meaning the actual execution as the trace acquisition condition. It is possible. Therefore, in the trace of the emulator 1, the execution result of the instruction can be accurately acquired.

【0033】また、本実施例においては、プログラムカ
ウンタ値を、トレースメモリ7に記憶した命令等のデー
タと関連性を持たせた状態でトレースメモリ7に記憶す
ることにより、例えばトレースメモリ7に取得する命令
等のデータを、アドレス範囲で指定するような場合、す
なわち、命令等のデータを部分部分取り出すような場合
でも、トレースメモリ7内における各データの集合体の
切れ目における最後のデータ実行状態を示す信号の位置
を、そのデータに対応するプログラムカウンタ値を参照
することによって正確に知ることが可能となっている。
Further, in the present embodiment, the program counter value is stored in the trace memory 7 in a state of being associated with the data such as the instruction stored in the trace memory 7, so that it is obtained in the trace memory 7, for example. Even when the data such as the instruction to be specified is specified in the address range, that is, when the data such as the instruction is partially extracted, the last data execution state at the break of each data aggregate in the trace memory 7 is determined. The position of the indicated signal can be accurately known by referring to the program counter value corresponding to the data.

【0034】次に、トレースメモリ7を図2によって詳
細に説明する。
Next, the trace memory 7 will be described in detail with reference to FIG.

【0035】トレースメモリ7は、トレースメモリ部7
aと、トレース条件設定レジスタ7bと、入力アドレス
選択用マルチプレクサ7cと、条件一致比較回路7d
と、トレースメモリアクセス制御回路7eとを有してい
る。
The trace memory 7 is a trace memory unit 7
a, a trace condition setting register 7b, an input address selection multiplexer 7c, and a condition match comparison circuit 7d.
And a trace memory access control circuit 7e.

【0036】トレースメモリ部7aは、命令等のデータ
を記憶するための記憶部である。トレースメモリ部7a
のAはアドレス端子、CSはチップセレクタ端子、WE
はライトイネーブル端子、Dinは入力端子、Dout は出
力端子を示している。
The trace memory section 7a is a storage section for storing data such as instructions. Trace memory unit 7a
A is an address terminal, CS is a chip selector terminal, WE
Is a write enable terminal, Din is an input terminal, and Dout is an output terminal.

【0037】その入力端子Dinには、エミュレーション
バス3が電気的に接続されている。出力端子Dout に
は、システムバス12が電気的が接続されている。アド
レス端子A、チップセレクタ端子CSおよびライトイネ
ーブル端子WEには、アクセス制御回路7eが電気的に
接続されている。
The emulation bus 3 is electrically connected to the input terminal Din. The system bus 12 is electrically connected to the output terminal Dout. An access control circuit 7e is electrically connected to the address terminal A, the chip selector terminal CS and the write enable terminal WE.

【0038】条件設定レジスタ7bには、ホストCPU
11からシステムバス12を通じて伝送された信号に従
って、トレースモード値およびトレース対象アドレス値
が設定される。なお、条件設定としては、例えば割込み
要求端子状態等のようなアドレス以外の条件設定も可能
であるが、ここでは説明を簡単にするため省略する。
The condition setting register 7b includes a host CPU.
The trace mode value and the trace target address value are set in accordance with the signal transmitted from 11 through the system bus 12. As the condition setting, condition settings other than the address such as the interrupt request terminal state can be set, but the description is omitted here for simplification of description.

【0039】トレースモードには、バストレースと、プ
ログラムカウンタトレースとがあり、この指定により、
入力アドレス選択用マルチプレクサ7eの出力が切り替
わるようになっている。
There are a bus trace and a program counter trace in the trace mode.
The output of the input address selecting multiplexer 7e is switched.

【0040】すなわち、バストレースを指定した場合
は、エミュレーションバス3上のアドレスバス18が選
択され、プログラムカウンタトレースを指定した場合
は、プログラムカウンタバス17が選択されるようにな
っている。設定アドレスの意味もアクセスアドレスとプ
ログラムカウンタとで切り替わるようになっている。
That is, when the bus trace is designated, the address bus 18 on the emulation bus 3 is selected, and when the program counter trace is designated, the program counter bus 17 is selected. The meaning of the set address is also switched between the access address and the program counter.

【0041】条件設定レジスタ7bは、入力アドレス選
択用マルチプレクサ7cとも電気的に接続されている。
入力アドレス選択用マルチプレクサ7cの入力には、上
記したプログラムカウンタバス17を通じてプログラム
カウンタ生成回路PCが電気的に接続されている。ま
た、入力アドレス選択用マルチプレクサ7cの他方の入
力には、アドレスバス18を通じて、エミュレーション
バス3と電気的に接続されている。
The condition setting register 7b is also electrically connected to the input address selecting multiplexer 7c.
The program counter generation circuit PC is electrically connected to the input of the input address selection multiplexer 7c through the program counter bus 17 described above. The other input of the input address selection multiplexer 7c is electrically connected to the emulation bus 3 through the address bus 18.

【0042】さらに、条件設定レジスタ7bの出力およ
び入力アドレス選択用マルチプレクサ7cの出力は、条
件一致比較回路7dの入力に電気的に接続されている。
すなわち、条件一致比較回路7dは、プログラムカウン
タ生成回路PCで生成されたプログラムカウンタ値と、
条件設定レジスタ7bに設定した値とを比較するように
なっている。
Further, the output of the condition setting register 7b and the output of the input address selecting multiplexer 7c are electrically connected to the input of the condition coincidence comparing circuit 7d.
That is, the condition coincidence comparison circuit 7d, the program counter value generated by the program counter generation circuit PC,
The value set in the condition setting register 7b is compared.

【0043】条件一致比較回路7dの出力は、アクセス
制御回路7eの入力と電気的に接続されている。アクセ
ス制御回路7eは、エミュレーション実行時のトレース
メモリ部7aへの書き込み時およびホストCPU11に
よるトレースメモリ部7a内の内容の読み出し時のアド
レス信号の制御、チップセレクタ信号およびライトイネ
ーブル信号の制御を行う回路である。なお、アクセス制
御回路7eは、システムバス12とも電気的に接続さ
れ、システムバス12側から伝送される信号に応じても
その制御が行われるようになっている。
The output of the condition matching comparison circuit 7d is electrically connected to the input of the access control circuit 7e. The access control circuit 7e controls an address signal, a chip selector signal, and a write enable signal when writing to the trace memory unit 7a during emulation and when the host CPU 11 reads the contents in the trace memory unit 7a. Is. The access control circuit 7e is also electrically connected to the system bus 12 and is controlled according to a signal transmitted from the system bus 12 side.

【0044】次に、MPU2の命令実行中におけるプロ
グラムカウンタ生成タイミングを図3に示し、その時の
命令の内容を図4に示し、さらにその時のトレースメモ
リ7の記憶内容を図5に示す。
Next, FIG. 3 shows the program counter generation timing during instruction execution of the MPU 2, FIG. 4 shows the contents of the instruction at that time, and FIG. 5 shows the contents stored in the trace memory 7 at that time.

【0045】今、MPU2は、図4の矢印の実行順序に
従って、メモリ5上のアドレス101、102、11
0、111、112の命令を順に実行するものとする。
すなわち、アドレス103〜109の命令は実行しない
ものとする。なお、実行されない命令のアドレス10
3、104には図面を見易くするため斜線が付してあ
る。
Now, the MPU 2 follows the addresses 101, 102, 11 on the memory 5 according to the execution order of the arrows in FIG.
It is assumed that the instructions 0, 111, and 112 are executed in order.
That is, the instructions at the addresses 103 to 109 are not executed. The address 10 of the instruction that is not executed
3, 3 and 104 are hatched to make the drawings easier to see.

【0046】この時のバスサイクルにおいては、図3に
示すように、アドレス101、102、103、10
4、110、112の命令がプリフェッチされる他に、
データサイクル、リフレッシュサイクルおよびDMAサ
イクルが実行される。
In the bus cycle at this time, as shown in FIG. 3, addresses 101, 102, 103, 10
In addition to prefetching 4, 110 and 112 instructions,
Data cycle, refresh cycle and DMA cycle are executed.

【0047】ここで、本実施例においては、プログラム
カウンタ値をトレース取得条件の1つとして指定してあ
るので、図5に示すように、トレースメモリ7には、実
際に実行されたアドレス101、102、110、11
1、112の命令のみが記憶され、実際には実行されな
かったアドレス103〜109の命令は記憶されていな
い。すなわち、実行結果を正確に取得することが可能と
なっている。
In this embodiment, since the program counter value is designated as one of the trace acquisition conditions, as shown in FIG. 102, 110, 11
Only the instructions of 1 and 112 are stored, and the instructions of the addresses 103 to 109 that are not actually executed are not stored. That is, the execution result can be accurately acquired.

【0048】また、図5には示さないが、トレースメモ
リ7には命令のアドレス101、102、110、11
1、112に関連性を持たせた状態でプログラムカウン
タ値も記憶されている。したがって、図3〜図5では説
明しなかったが、例えば命令を所定のアドレス範囲を指
定して部分部分取り出すような場合であっても、トレー
スメモリ7内における各命令の集合体における最後の部
分の命令実行状態を示す信号の位置を、その命令に対応
するプログラムカウンタ値を参照することによって正確
に知ることが可能となっている。
Although not shown in FIG. 5, the instruction addresses 101, 102, 110 and 11 are stored in the trace memory 7.
The program counter value is also stored in the state where 1 and 112 are related. Therefore, although not described with reference to FIGS. 3 to 5, even when an instruction is partially extracted by designating a predetermined address range, the last portion in the aggregate of each instruction in the trace memory 7 is extracted. The position of the signal indicating the instruction execution state can be accurately known by referring to the program counter value corresponding to the instruction.

【0049】このように本実施例によれば、以下の効果
を得ることが可能となる。
As described above, according to this embodiment, the following effects can be obtained.

【0050】(1).実際に実行したことを意味するプログ
ラムカウンタ値を、トレース取得条件とすることによ
り、実際に実行した命令等のデータのみをトレースメモ
リ7に記憶することが可能となる。したがって、エミュ
レータ1のトレースにおいて、命令の実行結果を正確に
取得することが可能となっている。このため、逆アセン
ブル表示が可能となるとともに、エミュレータ1のデバ
ック効率を向上させることが可能となる。
(1). By setting the program counter value, which means the actual execution, as the trace acquisition condition, it becomes possible to store only the data such as the actually executed instruction in the trace memory 7. Therefore, in the trace of the emulator 1, the execution result of the instruction can be accurately acquired. Therefore, disassemble display can be performed and the debug efficiency of the emulator 1 can be improved.

【0051】(2).プログラムカウンタ値を、トレースメ
モリ7に記憶した命令等のデータと関連性を持たせた状
態でトレースメモリ7に記憶することにより、例えばト
レースメモリ7に取得する命令等のデータを、アドレス
範囲で指定するような場合、すなわち、命令等のデータ
を部分部分取り出すような場合でも、トレースメモリ7
内における各データの集合体の切れ目における最後のデ
ータ実行状態を示す信号の位置を、そのデータに対応す
るプログラムカウンタ値を参照することによって正確に
知ることが可能となる。このため、逆アセンブル表示が
可能となるとともに、エミュレータ1のデバック効率を
向上させることが可能となる。
(2). By storing the program counter value in the trace memory 7 in a state of being associated with the data such as the instruction stored in the trace memory 7, for example, the instruction acquired in the trace memory 7 Even when the data is specified in the address range, that is, when the data such as the instruction is partially extracted, the trace memory 7
It is possible to accurately know the position of the signal indicating the last data execution state at the break of each data aggregate in the above by referring to the program counter value corresponding to the data. Therefore, disassemble display can be performed and the debug efficiency of the emulator 1 can be improved.

【0052】以上、本発明者によってなされた発明を実
施例に基づき具体的に説明したが、本発明は前記実施例
に限定されるものではなく、その要旨を逸脱しない範囲
で種々変更可能であることはいうまでもない。
The invention made by the present inventor has been specifically described above based on the embodiments, but the present invention is not limited to the above embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say.

【0053】例えばトレース取得条件は、プログラムカ
ウンタ値と、他の条件、例えばユーザ側で使用する所定
のデータ値とを組み合わせて指定できるようにしても良
い。また、トレース情報に、ユーザ側の所定のデータ値
を追加しても良い。
For example, the trace acquisition condition may be specified by combining the program counter value and another condition, for example, a predetermined data value used by the user. Further, a predetermined data value on the user side may be added to the trace information.

【0054】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるマイク
ロプロセッサ応用機器のエミュレータに適用した場合に
ついて説明したが、これに限定されず種々適用可能であ
り、例えば他のロジック回路の解析を行うアナライザ等
に適用することも可能である。
In the above description, the case where the invention made by the present inventor is mainly applied to the emulator of the microprocessor application device which is the background field of application has been described, but the present invention is not limited to this and can be variously applied. It is also possible to apply, for example, to an analyzer which analyzes other logic circuits.

【0055】[0055]

【発明の効果】本願において開示される発明のうち、代
表的なものによって得られる効果を簡単に説明すれば、
下記のとおりである。
The effects obtained by the typical ones of the inventions disclosed in the present application will be briefly described as follows.
It is as follows.

【0056】前記した本発明によれば、実際に実行した
ことを意味するプログラムカウンタ値を、トレース取得
条件とすることにより、実際に実行したデータのみをト
レースメモリに記憶することができるので、エミュレー
タのトレースにおいて、命令の実行結果を正確に取得す
ることが可能となる。
According to the above-described present invention, by setting the program counter value, which means the actual execution, as the trace acquisition condition, only the actually executed data can be stored in the trace memory. It is possible to accurately acquire the execution result of the instruction in the trace of.

【0057】また、例えばトレースメモリに取得する命
令等のデータをアドレス範囲で指定するような場合、す
なわち、命令等のデータを部分部分で取り出すような場
合でも、トレースメモリ内における各データの集合体の
切れ目における最後のデータ実行状態を示す信号の位置
を、そのデータに対応するプログラムカウンタ値を参照
することによって正確に知ることが可能となる。
Also, for example, when data such as an instruction to be acquired in the trace memory is specified in an address range, that is, when data such as an instruction is extracted in a partial portion, a set of data in the trace memory is collected. The position of the signal indicating the last data execution state at the break can be accurately known by referring to the program counter value corresponding to the data.

【0058】このため、逆アセンブル表示が可能となる
とともに、エミュレータのデバック効率を向上させるこ
とが可能となる。
Therefore, disassemble display can be performed, and the debugging efficiency of the emulator can be improved.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例であるエミュレータのブロッ
ク図である。
FIG. 1 is a block diagram of an emulator that is an embodiment of the present invention.

【図2】図1のエミュレータにおけるトレースメモリを
詳細に示すブロック図である。
FIG. 2 is a block diagram showing in detail a trace memory in the emulator of FIG.

【図3】本実施例のエミュレータの命令実行中における
バスサイクルタイミングとプログラムカウンタの生成タ
イミングとのタイミングチャート図である。
FIG. 3 is a timing chart of bus cycle timing and program counter generation timing during instruction execution of the emulator of this embodiment.

【図4】本実施例のエミュレータの命令実行順序を説明
するための説明図である。
FIG. 4 is an explanatory diagram for explaining an instruction execution order of the emulator of this embodiment.

【図5】トレースメモリへの命令の記憶状態を説明する
ための説明図である。
FIG. 5 is an explanatory diagram for explaining a storage state of instructions in a trace memory.

【図6】従来技術におけるエミュレータの命令実行順序
を説明するための説明図である。
FIG. 6 is an explanatory diagram for explaining an instruction execution order of an emulator according to a conventional technique.

【図7】従来技術におけるトレースメモリへの命令の記
憶状態を説明するための説明図である。
FIG. 7 is an explanatory diagram for explaining a storage state of instructions in a trace memory according to a conventional technique.

【図8】従来技術におけるトレースメモリへの命令の記
憶状態を説明するための説明図である。
FIG. 8 is an explanatory diagram for explaining a storage state of instructions in a trace memory according to a conventional technique.

【符号の説明】[Explanation of symbols]

1 エミュレータ 2 マイクロプロセッサ 3 エミュレーションバス 4 エミュレーション制御部 5 メモリ 6 ブレーク検出回路 7 トレースメモリ 7a トレースメモリ部 7b トレース条件設定レジスタ 7c 入力アドレス選択用マルチプレクサ 7d 条件一致比較回路 7e トレースメモリアクセス制御回路 8 エミュレーションメモリ 9 ユーザインタフェース部 10 ユーザインタフェースソケット 11 ホストCPU 12 システムバス 13 システムメモリ 14 I/Oインタフェース部 15 CRT 16 フロッピィディスク装置 17 プログラムカウンタバス 18 アドレスバス PC プログラムカウンタ生成回路 30 トレースメモリ 1 emulator 2 microprocessor 3 emulation bus 4 emulation control unit 5 memory 6 break detection circuit 7 trace memory 7a trace memory unit 7b trace condition setting register 7c input address selection multiplexer 7d condition match comparison circuit 7e trace memory access control circuit 8 emulation memory 9 User Interface Section 10 User Interface Socket 11 Host CPU 12 System Bus 13 System Memory 14 I / O Interface Section 15 CRT 16 Floppy Disk Unit 17 Program Counter Bus 18 Address Bus PC Program Counter Generation Circuit 30 Trace Memory

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 エミュレーション対象の電子装置をエミ
ュレータ本体に設けられたマイクロプロセッサによって
疑似的に動作させ、前記エミュレーション対象の電子装
置のデバックを行うエミュレータのトレース方法であっ
て、前記マイクロプロセッサが実際に実行したプログラ
ムカウンタ値を、トレース取得条件の1つに指定すると
ともに、前記トレース取得条件に従ってトレースメモリ
に記憶されたデータと関連性を持たせた状態で前記トレ
ースメモリに記憶する工程を有することを特徴とするエ
ミュレータのトレース方法。
1. A tracing method of an emulator, wherein an emulation target electronic device is pseudo-operated by a microprocessor provided in an emulator main body to debug the emulation target electronic device. Specifying the executed program counter value as one of the trace acquisition conditions and storing it in the trace memory in association with the data stored in the trace memory according to the trace acquisition condition. Characteristic emulator tracing method.
【請求項2】 前記マイクロプロセッサの動作の際に、
次に実行するデータを予め取得するプリフェッチ工程を
有することを特徴とする請求項1記載のエミュレータの
トレース方法。
2. When the microprocessor operates,
2. The emulator tracing method according to claim 1, further comprising a prefetch step of previously acquiring data to be executed.
【請求項3】 請求項2記載のエミュレータのトレース
方法において、前記マイクロプロセッサより出力される
プリフェッチ時におけるバス信号の状態およびエミュレ
ータ本体内部の動作信号の状態に基づいて前記プログラ
ムカウンタ値を生成する工程と、前記プログラムカウン
タ値が、前記エミュレータにおけるプログラムカウンタ
値と一致するか否かを比較する工程とを有することを特
徴とするエミュレータのトレース方法。
3. The emulator trace method according to claim 2, wherein the program counter value is generated based on a state of a bus signal output from the microprocessor at the time of prefetch and a state of an operation signal inside the emulator main body. And a step of comparing whether or not the program counter value matches the program counter value in the emulator, the tracing method of the emulator.
【請求項4】 エミュレーション対象の電子装置をエミ
ュレータ本体に設けられたマイクロプロセッサによって
疑似的に動作させ、前記エミュレーション対象の電子装
置のデバックを行うエミュレータであって、前記マイク
ロプロセッサの命令実行状態に基づいてプログラムカウ
ンタ値を生成し、その値をトレース取得条件の1つとし
て指定するとともに、トレースメモリに記憶されたデー
タと関連性を持たせた状態で前記トレースメモリに記憶
する機能を有するプログラムカウンタ生成回路部を設け
たことを特徴とするエミュレータ。
4. An emulator that emulates an electronic device to be emulated by a microprocessor provided in an emulator main body to debug the electronic device to be emulated, based on an instruction execution state of the microprocessor. To generate a program counter value, specify the value as one of trace acquisition conditions, and store the program counter value in the trace memory in a state associated with the data stored in the trace memory. An emulator having a circuit section.
【請求項5】 前記マイクロプロセッサが次に実行する
データを予め取得するプリフェッチ機能を有することを
特徴とする請求項4記載のエミュレータ。
5. The emulator according to claim 4, wherein the microprocessor has a prefetch function for previously acquiring data to be executed next.
JP6013868A 1994-02-07 1994-02-07 Emulator and its tracking method Withdrawn JPH07219808A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6013868A JPH07219808A (en) 1994-02-07 1994-02-07 Emulator and its tracking method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6013868A JPH07219808A (en) 1994-02-07 1994-02-07 Emulator and its tracking method

Publications (1)

Publication Number Publication Date
JPH07219808A true JPH07219808A (en) 1995-08-18

Family

ID=11845225

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6013868A Withdrawn JPH07219808A (en) 1994-02-07 1994-02-07 Emulator and its tracking method

Country Status (1)

Country Link
JP (1) JPH07219808A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008310508A (en) * 2007-06-13 2008-12-25 Renesas Technology Corp Debugging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008310508A (en) * 2007-06-13 2008-12-25 Renesas Technology Corp Debugging device

Similar Documents

Publication Publication Date Title
US6665821B1 (en) Microcomputer, electronic equipment, and debugging system
JP4190114B2 (en) Microcomputer
US7533302B2 (en) Trace and debug method and system for a processor
US20100011250A1 (en) Microcontroller information extraction system and method
US20060075310A1 (en) Microcomputer and trace control method capable of tracing desired task
EP0530816A2 (en) Microprocessor with cache memory and trace analyzer therefor
US5930470A (en) Debugging system and debugging method
US20050086454A1 (en) System and methods for providing a debug function built-in type microcomputer
JPH07219808A (en) Emulator and its tracking method
JP2005353020A (en) Simulation system for computer program
JP2760228B2 (en) Microprocessor with built-in cache memory and its trace analyzer
JPH1083318A (en) Electronic circuit analyzing device
JP3214459B2 (en) Simulation method and apparatus
JP2002541582A (en) Method and system for updating user memory in an emulator system
JPH0793180A (en) Microprocessor
KR100189977B1 (en) Emulator system having trace function and trace method
JPH08328898A (en) User space access method and emulator
JP2575025B2 (en) In-circuit emulator
JP2004348635A (en) Method for developing program
JPH06348543A (en) Method for connection with input/output simulator
KR100658485B1 (en) Microprocessor development system
JPH07160524A (en) Emulator
JPH0679278B2 (en) Microcomputer development equipment
JPH05151020A (en) Digital signal processor
JPH08147191A (en) Emulator and microcomputer development supporting device using the same

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010508