JPH07121396A - Emulator - Google Patents

Emulator

Info

Publication number
JPH07121396A
JPH07121396A JP5287578A JP28757893A JPH07121396A JP H07121396 A JPH07121396 A JP H07121396A JP 5287578 A JP5287578 A JP 5287578A JP 28757893 A JP28757893 A JP 28757893A JP H07121396 A JPH07121396 A JP H07121396A
Authority
JP
Japan
Prior art keywords
emulation
information
emulator
processor
target system
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
JP5287578A
Other languages
Japanese (ja)
Inventor
Hideki Takeda
秀貴 武田
Hiroyuki Murata
浩之 村田
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 JP5287578A priority Critical patent/JPH07121396A/en
Publication of JPH07121396A publication Critical patent/JPH07121396A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To confirm the operation of a user by tracing specified register information. CONSTITUTION:The preserved information of a stack pointer and a flag register inside a processor 2 for emulation to carry out for a target processor is outputted through an interface 21 for emulation. This outputted information is stored in a storage area 62 of a trace memory part 6. The stored information is utilized as information for setting the internal state of the processor for emulation at the operation start position when executing a user program again.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、エミュレータさらには
ターゲットシステムを代行制御するためのエミュレーシ
ョン用プロセッサの内部状態を再現するための技術に関
し、例えばインサーキットエミュレータに適用して有効
な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for reproducing the internal state of an emulator and an emulation processor for acting on behalf of a target system, for example, a technique effective when applied to an in-circuit emulator. is there.

【0002】[0002]

【従来の技術】マイクロコンピュータ応用機器(以下単
にターゲットシステムとも記す)の開発において、その
システムデバッグやシステム評価を行うためのエミュレ
ータは、ターゲットシステムのためのマイクロコンピュ
ータもしくはマイクロプロセッサ(以下単にターゲット
プロセッサとも記す)の機能を代行しながらソフトウェ
アデバッグもしくはシステムデバッグを支援する。な
お、エミュレータについて記載された文献の例として
は、日立マイクロコンピュータエンジニアリング(株)
発行(昭和63年10月1日),「日立マイコン技法」
Vol.2 No.2 p21乃至p27がある。この
ようなエミュレータは、ターゲットプロセッサと同等の
マイクロコンピュータやプロセッサ(以下単にエミュレ
ーション用プロセッサとも記す)を備え、ターゲットシ
ステムにおけるターゲットプロセッサ搭載領域にコネク
タやケーブルを介してインタフェースされ、このエミュ
レーション用プロセッサにソフトウェアデバッグ対象と
されるプログラムを実行させてターゲットシステムを代
行制御する。このとき、デバッグ対象プログラムの内容
を任意に変更したりして、その制御状態をトレースし、
所定のブレークポイントでそのトレース結果を確認可能
にしながらターゲットシステムのソフトウェアデバッグ
もしくはシステムデバッグを支援する。
2. Description of the Related Art An emulator for performing system debugging or system evaluation in the development of a microcomputer application device (hereinafter also simply referred to as a target system) is a microcomputer or a microprocessor for the target system (hereinafter simply referred to as a target processor). (Note) to support software debugging or system debugging while substituting the function of (). An example of a document describing the emulator is Hitachi Microcomputer Engineering Co., Ltd.
Published (October 1, 1988), "Hitachi Microcomputer Technique"
Vol. 2 No. 2 p21 to p27. Such an emulator is equipped with a microcomputer or processor (hereinafter also simply referred to as an emulation processor) equivalent to the target processor, and is interfaced with a target processor mounting area in the target system via a connector or a cable. Execute the program to be debugged to control the target system on behalf. At this time, you can change the contents of the debug target program arbitrarily, trace the control state,
It supports software debugging or system debugging of the target system while making it possible to check the trace result at a predetermined breakpoint.

【0003】通常のデバック処理は、次のような方法で
行われる。先ず、ユーザプログラムの実行において所定
のアドレスなど一定の事象が発生する状態でターゲット
システムが停止するようにブレーク制御機能を用いてブ
レークポイントを設定し、次いでエミュレーション制御
機能を用いてデバックに有効なアドレスよりユーザプロ
グラムを実行させてエミュレーションを行う。ユーザプ
ログラムがブレーク制御機能により設定した地点(ブレ
ークポイント)に到達し若しくは一定の事象が発生する
と、ターゲットシステムの動作が停止する。この間、ユ
ーザはトレース制御機能により蓄えられたトレースメモ
リの情報を調べ、正常にターゲットシステムが動作した
か知ることができる。その結果、問題が無ければ順次ユ
ーザプログラムの動作部位を同様にして確認することが
できる。このとき、問題があれば得られたトレース情報
よりハードウエア及びソフトウエアの障害部位を解析す
ることができる。
Normal debug processing is performed by the following method. First, use the break control function to set a breakpoint so that the target system stops when a certain event such as a predetermined address occurs during execution of the user program, and then use the emulation control function to set an effective address for debugging. Emulation is performed by executing a user program. When the user program reaches a point (breakpoint) set by the break control function or a certain event occurs, the operation of the target system stops. During this time, the user can check the information in the trace memory stored by the trace control function to know whether the target system operates normally. As a result, if there is no problem, the operating parts of the user program can be sequentially confirmed in the same manner. At this time, if there is a problem, it is possible to analyze the faulty part of the hardware and software from the obtained trace information.

【0004】従来のエミュレータは、ターゲットシステ
ム及びユーザプログラムをデバックする際、ユーザプロ
グラムの最初から停止部位までの動作を確認するのに有
効であった。再度ユーザプログラムの動作確認をする際
は、前回の停止位置より動作確認をする事ができる。ブ
レークしたときのエミュレーション用プロセッサの内部
状態は、再現可能になりエミュレータ側に退避されるか
らである。したがって、エミュレーション用プロセッサ
の上記退避された内部状態を復帰させることにより、ユ
ーザプログラム停止時の次からエミュレーションを再開
することができる。
The conventional emulator has been effective in confirming the operation from the beginning of the user program to the stop portion when debugging the target system and the user program. When confirming the operation of the user program again, it is possible to confirm the operation from the previous stop position. This is because the internal state of the emulation processor at the time of break becomes reproducible and saved in the emulator side. Therefore, by restoring the saved internal state of the emulation processor, the emulation can be restarted from the time when the user program was stopped.

【0005】[0005]

【発明が解決しようとする課題】上記ブレークポイント
の次から連続的にエミュレーションを行わない場合、例
えばブレークポイントまでのトレース情報を検証した結
果、当該ブレークポイントの手前からエミュレーション
を再開したいような場合は、当該エミュレーションを再
開したい地点におけるエミュレーション用プロセッサの
内部状態を特別に設定しなければならない。しかしなが
ら、ブレーク時に退避可能なエミュレーション用プロセ
ッサの内部状態は、従来ブレークした時点における内部
状態だけであった。このため、任意の地点からエミュレ
ーションを再開するには、当該地点におけるエミュレー
ション用プロッセッサの内部状態を理論的に把握して、
スタックポインタやフラグレジスタなどのレジスタ情報
をエミュレータのコマンドで修正しなければならない。
このような修正すべき情報を理論的に把握するには時間
を要し、エミュレーションに多大な時間を要するという
問題点があることが本発明者らによって明らかにされ
た。更に、上記理論的に把握されたレジスタ情報はエミ
ュレーションを行う過程で実際に得られる内部状態とは
必ずしも一致するとは限らない。このため、上述の任意
の地点からのエミュレーションを再実行させる手法で
は、開発途上のターゲットシステムを高い信頼性を以て
評価することは難しいということが本発明者らによって
見いだされた。
When emulation is not continuously performed after the break point, for example, when the trace information up to the break point is verified and it is desired to restart the emulation before the break point. , The internal state of the emulation processor at the point where the emulation should be restarted must be specially set. However, the internal state of the emulation processor that can be saved at the time of the break is conventionally only the internal state at the time of the break. Therefore, to restart emulation from an arbitrary point, theoretically grasp the internal state of the emulation processor at that point,
Register information such as the stack pointer and flag register must be modified by the emulator command.
The present inventors have revealed that it takes time to theoretically grasp such information to be corrected, and it takes a lot of time for emulation. Further, the theoretically grasped register information does not always match the internal state actually obtained during the emulation process. Therefore, it has been found by the present inventors that it is difficult to evaluate the target system under development with high reliability by the method of re-executing the emulation from the arbitrary point described above.

【0006】本発明の目的は、エミュレーション結果に
基づいて、ユーザプログラムの所望の動作部位からエミ
ュレーションを再開できるエミュレータを提供すること
にある。本発明の別の目的は、ターゲットシステムの実
状態に即したエミュレーションを行うことができるエミ
ュレータを提供することにある。
An object of the present invention is to provide an emulator capable of resuming emulation from a desired operation part of a user program based on the result of emulation. Another object of the present invention is to provide an emulator capable of performing emulation that matches the actual state of the target system.

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

【0008】[0008]

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

【0009】すなわち、ターゲットシステムに対する代
行制御に同期してエミュレーション用プロッセッサ内部
のスタックポインタ及びフラグレジスタの情報を外部に
出力するエミュレーション用インタフェース手段を当該
エミュレーション用プロッセッサに設けると共に、該イ
ンタフェース手段から出力されるスタックポインタ及び
フラグレジスタの保有情報を格納する領域をトレースメ
モリ部に割当てエミュレータを構成する。また、ターゲ
ットシステムの代行制御途上において、エミュレーショ
ン用プロセッサから出力されるアクセスアドレスを、タ
ーゲットシステムに採用されるスタック領域のアドレス
範囲とを比較し、その比較結果の一致に応じてそのアク
セスアドレスを情報の退避に利用されたスタック領域の
アドレスとしてトレースメモリ部に出力する検知回路を
設けてエミュレータを構成する。
That is, an emulation interface means for outputting the information of the stack pointer and flag register inside the emulation processor to the outside in synchronization with the proxy control for the target system is provided in the emulation processor, and is output from the interface means. An area for storing the holding information of the stack pointer and the flag register is allocated to the trace memory unit to configure an emulator. Also, during the proxy control of the target system, the access address output from the emulation processor is compared with the address range of the stack area adopted by the target system, and the access address is informed according to the result of the comparison. An emulator is configured by providing a detection circuit that outputs to the trace memory unit as the address of the stack area used for saving.

【0010】[0010]

【作用】上記した手段によれば、実際にエミュレーショ
ンが行われると、それがする処理状況に応じたスタック
ポインタの値及びフラグレジスタの値が時系列的にトレ
ースメモリ部に蓄積される。一旦、エミュレーションを
実行した範囲内の所望の地点からエミュレーションを再
開するときは、既にトレースされたスタックポインタ及
びフラグレジスタの値の中から当該再開地点の値を利用
してエミュレーション用プロセッサのスタックポインタ
及びフラグレジスタの値を設定する。所望の地点におい
て斯様にエミュレーション用プロセッサの内部状態を再
設定することは、ターゲットシステムの実状態に即した
エミュレーションを可能にする。また、上記した他の手
段によれば、実際にエミュレーションが行われると、そ
れがする処理状況に応じたアクセスアドレスとスタック
領域に保持されたアドレス範囲とを比較し、一致するこ
とにより該アドレスがトレースメモリ部に蓄積される。
一旦、エミュレーションを実行した範囲内の所望の地点
より再開するときは、既にトレースされたアクセスアド
レスを利用してエミュレーションプロセッサの内部状態
を設定する。こうして、ターゲットシステムの実状態に
即したエミュレーションを可能にする。
According to the above-mentioned means, when the emulation is actually performed, the stack pointer value and the flag register value corresponding to the processing status of the emulation are accumulated in time series in the trace memory unit. When the emulation is restarted from a desired point within the range where the emulation is executed, the value of the restart point is used from the values of the stack pointer and the flag register already traced, and the stack pointer of the emulation processor and Set the value of the flag register. Resetting the internal state of the emulation processor at a desired point enables emulation that matches the actual state of the target system. Further, according to the other means described above, when the emulation is actually performed, the access address according to the processing status of the emulation is compared with the address range held in the stack area, and if the addresses match, the address is determined. It is stored in the trace memory unit.
When the emulation is restarted from a desired point within the range, the internal address of the emulation processor is set using the already traced access address. In this way, emulation that matches the actual state of the target system is possible.

【0011】[0011]

【実施例】図3には本発明の一実施例に係るエミュレー
タを適用したシステム構成例が示される。図3に示すよ
うにインサーキットエミュレータ11はソフトウエア開
発用のホストコンピュータなどのシステム開発装置であ
る親計算機10とシリアル回線バスラインを介して、又
エミュレートされるターゲットシステム9とケーブル1
2及びターゲットマイクロコンピュータ用ソケット13
を介して接続される。上記ターゲットシステム9は、マ
イクロコンピュータを応用した適宜用いられるシステム
である。上記インサーキットエミュレータ11は、その
ターゲットシステム9に本来実装されるべきマイクロコ
ンピュータ(以下ターゲットプロセッサとも記す)を代
行制御する。
FIG. 3 shows a system configuration example to which an emulator according to an embodiment of the present invention is applied. As shown in FIG. 3, the in-circuit emulator 11 is connected to a parent computer 10 which is a system development device such as a host computer for software development, a target system 9 and a cable 1 which are emulated via a serial line bus line.
2 and socket 13 for target microcomputer
Connected via. The target system 9 is a system that is appropriately used by applying a microcomputer. The in-circuit emulator 11 controls the microcomputer (hereinafter, also referred to as a target processor) that should be originally mounted on the target system 9 on behalf of the target system 9.

【0012】図2には上記インサーキットエミュレータ
11の一例であるブロック図が示される。同図に示され
るインサーキットエミュレータ11において、エミュレ
ーション用プロセッサ2はスレーブバス4に接続され
る。このスレーブバス4を用いて、エミュレーション用
プロセッサ2から、ターゲットシステムとエミュレーシ
ョン用プロセッサ2が送受信する各種の信号や、エミュ
レーション用プロセッサ2の内部状態に応じた情報など
がターゲットプロセッサ用ソケット13を介して出力さ
れ、また、エミュレーション用プロセッサ2に対し、エ
ミュレーションのための各種制御信号が入力される。
FIG. 2 is a block diagram showing an example of the in-circuit emulator 11. In the in-circuit emulator 11 shown in the figure, the emulation processor 2 is connected to the slave bus 4. Using this slave bus 4, various signals transmitted and received by the emulation processor 2 from the emulation processor 2 and information according to the internal state of the emulation processor 2 are transmitted via the socket 13 for the target processor. Various control signals for emulation are output and input to the emulation processor 2.

【0013】さらに、上記スレーブバス4には、エミュ
レーションプログラムなどを格納する代行メモリ部16
と、ブレーク制御部5と、トレースメモリ部6とエミュ
レーション制御部15などが接続される。エミュレーシ
ョン制御部15は、エミュレーションを行う際にエミュ
レーション用プロセッサにエミュレーションの開始条件
などを設定する。ブレーク制御部5は、エミュレーショ
ン用プロセッサ2の制御状態やスレーブバス4の状態を
監視して、その状態が予め設定された状態に達したとき
に、エミュレータ専用割込みを出力して、エミュレーシ
ョン用プロセッサ2によるユーザプログラムの実行を停
止させ、エミュレーションプログラムを実行させる(ブ
レーク)制御を行う。トレースメモリ部6は、前記エミ
ュレーション用プロセッサ2のリード動作またはライト
動作を示す信号、命令リード動作を示す信号などに基づ
き、スレーブバス4に与えられるアドレスやデータさら
には制御情報を逐次蓄える。代行メモリ部16、ブレー
ク制御部5、トレースメモリ部6はマスタバス3を介し
てマスタマイクロコンピュータ1の制御を受けるように
なっている。マスタバス3は、シリアルインタフェース
14を介して、特に制限はされないもののパーソナルコ
ンピュータなどの親計算機10に接続される。なお、必
要に応じてプローブ18をトレースメモリ部6に直結さ
せた構成を付加することができる。
Further, the slave bus 4 has a substitute memory section 16 for storing an emulation program or the like.
The break control unit 5, the trace memory unit 6, the emulation control unit 15, and the like are connected to each other. The emulation control unit 15 sets emulation start conditions and the like in the emulation processor when performing emulation. The break control unit 5 monitors the control state of the emulation processor 2 and the state of the slave bus 4, and when the state reaches a preset state, outputs an emulator-dedicated interrupt to cause the emulation processor 2 to operate. The execution of the user program is stopped and the emulation program is executed (break). The trace memory unit 6 sequentially stores addresses and data, and further control information given to the slave bus 4, based on a signal indicating a read operation or a write operation of the emulation processor 2, a signal indicating an instruction read operation, and the like. The substitute memory unit 16, the break control unit 5, and the trace memory unit 6 are controlled by the master microcomputer 1 via the master bus 3. The master bus 3 is connected to the parent computer 10 such as a personal computer via the serial interface 14, although not particularly limited thereto. A configuration in which the probe 18 is directly connected to the trace memory unit 6 can be added if necessary.

【0014】図1には、本実施例に係るエミュレータの
要部が示される。図1に示されるマルチプレクサ8は、
同図に代表的に示されたトレースメモリ部6及びブレー
ク制御部5をマスタマイクロコンピュータ1に接続する
のか、又はエミュレーション用プロセッサ2に接続する
のかを選択するための回路である。図2において、その
ようなマルチプレクサ8の機能はブレーク制御部5など
の各回路ブロックに含まれているものと理解されたい。
FIG. 1 shows the main part of the emulator according to this embodiment. The multiplexer 8 shown in FIG.
This is a circuit for selecting whether to connect the trace memory unit 6 and the break control unit 5 typified in the figure to the master microcomputer 1 or the emulation processor 2. In FIG. 2, it should be understood that such a function of the multiplexer 8 is included in each circuit block such as the break control unit 5.

【0015】上記マルチプレクサ8は、エミュレーショ
ン途上において、トレースメモリ部6及びブレーク制御
部5のデータ入出力端子をエミュレーション用プロセッ
サ側に接続する。
The multiplexer 8 connects the data input / output terminals of the trace memory section 6 and the break control section 5 to the emulation processor side during the emulation.

【0016】エミュレーション用プロセッサ2は、デバ
ック対象とされるユーザプログラムを実行するとき、タ
ーゲットシステム9の代行制御に必要な情報をターゲッ
トシステム9との間でやりとりする。この状態はターゲ
ットシステム9と図示しないターゲットプロセッサとの
関係に等しい。更に、エミュレーション用プロセッサ2
はユーザプログラム(ターゲットプログラムとも記す)
若しくはターゲットシステム9の評価のために用いる各
種情報(ターゲットシステム9とやりとりされる情報も
含む)を、後述するエミュレーション用インタフェース
21(図4参照)から出力する。トレースメモリ部は6
は、ターゲットシステム9との間でやりとりされる情報
と共に、上記エミュレーション用インターフェース21
から評価のためにのみ出力される情報を、例えばエミュ
レーション用プロセッサ2が起動するバスサイクル毎に
蓄積していく。特に、エミュレーション用プロセッサ2
は、ユーザプログラムの実行によって設定されるセント
ラルプロセッシングユニット内のスタックポインタの情
報と演算処理による内部状態を示すフラグレジスタの情
報とを、エミュレーションに同期して上記エミュレーシ
ョン用インターフェースから出力する。上記トレースメ
モリ部6は、スタックポインタの情報及びフラグレジス
タの値を蓄積していく格納領域62を備える。
The emulation processor 2 exchanges information necessary for proxy control of the target system 9 with the target system 9 when executing a user program to be debugged. This state is equivalent to the relationship between the target system 9 and a target processor (not shown). Furthermore, the emulation processor 2
Is a user program (also referred to as a target program)
Alternatively, various information used for evaluation of the target system 9 (including information exchanged with the target system 9) is output from the emulation interface 21 (see FIG. 4) described later. Trace memory unit is 6
Together with the information exchanged with the target system 9 together with the emulation interface 21.
The information that is output only for evaluation is accumulated for each bus cycle activated by the emulation processor 2, for example. In particular, the emulation processor 2
Outputs the information of the stack pointer in the central processing unit set by the execution of the user program and the information of the flag register indicating the internal state by the arithmetic processing from the emulation interface in synchronization with the emulation. The trace memory unit 6 is provided with a storage area 62 for accumulating stack pointer information and flag register values.

【0017】上記マルチプレクサ8は、エミュレーショ
ン用プロセッサ2によるユーザプログラムの実行が停止
された状態、すなわちブレークされた状態において、ト
レースメモリ部6及びブレーク制御部5をマスタマイク
ロコンピュータ1に接続する。この状態において、トレ
ースメモリ部6にトレースされた情報はマスタマイクロ
コンピュータ1の制御を介して親計算機10に転送可能
にされる。ここで、トレースされた情報を検証した結
果、一旦エミュレーションを実行した範囲内でユーザプ
ログラムの所望の地点からエミュレーションを再開した
いときは、トレースされたスタックポインタ及びフラグ
レジスタの情報を用いてエミュレーション用プロッセサ
2の内部状態を再設定すればよい。すなわち、エミュレ
ーションが行われると、それによるデータ処理状況に応
じたスタックポインタ及びフラグレジスタの値が時系列
的に格納領域62に蓄積されているので、それらの中か
らエミュレーションの再開地点の値を選択してエミュレ
ーション用プロセッサ2のスタックポインタ及びフラグ
レジスタに再設定する。エミュレーション用プロセッサ
2内部の再設定は、その他にプログラムカウンタ、デー
タレジスタ及びアドレスレジスタも必要であるが、それ
らの値は、上記再設定すべきスタックポインタの値で示
されるスタック領域の値をトレースメモリ部6にトレー
スされた情報の中から参照することによって容易に得る
ことができる。これらの再設定の処理は、マスタマイク
ロコンピュータ1の制御に基づいてエミュレーション制
御部15が行う。これにより、トレースされたレジスタ
情報などを前記エミュレーション制御部15に設定する
ことにより、ブレークした地点以前の任意の地点よりエ
ミュレーションを開始することが可能となる。開始され
たユーザプログラムの終了条件は、ブレーク設定値によ
り決まり、この値はブレーク制御部5で設定される。こ
れらの制御動作は、全てマスタマイクロコンピュータ1
による指令により制御される。
The multiplexer 8 connects the trace memory section 6 and the break control section 5 to the master microcomputer 1 in a state where the execution of the user program by the emulation processor 2 is stopped, that is, a break state. In this state, the information traced in the trace memory unit 6 can be transferred to the parent computer 10 under the control of the master microcomputer 1. Here, as a result of verifying the traced information, when it is desired to restart the emulation from a desired point in the user program within the range where the emulation is once executed, the information for the traced stack pointer and flag register is used to emulate the processor for emulation. The internal state of 2 may be reset. That is, when the emulation is performed, the values of the stack pointer and the flag register according to the data processing status due to the emulation are accumulated in the storage area 62 in a time series. Therefore, the value of the emulation restart point is selected from them. Then, the stack pointer and the flag register of the emulation processor 2 are reset. Resetting inside the emulation processor 2 also requires a program counter, a data register, and an address register, but the values of those are the trace area values indicated by the stack pointer values to be reset. It can be easily obtained by referring to the information traced in the part 6. The resetting process is performed by the emulation control unit 15 under the control of the master microcomputer 1. As a result, by setting the traced register information and the like in the emulation control unit 15, it becomes possible to start the emulation from an arbitrary point before the break point. The termination condition of the started user program is determined by the break setting value, and this value is set by the break control unit 5. All of these control operations are performed by the master microcomputer 1.
Controlled by the command.

【0018】図4には、上記エミュレーション用プロセ
ッサ2のブロック構成の一例が示される。同図に示すよ
うにエミュレーション用プロセッサ2は、シングルチッ
プマイクロコンピュータ部分26とエミュレーション用
インタフェース21よりなる。シングルチップマイクロ
コンピュータ部分26は、図示しないターゲットプロセ
ッサに対応する部分である。シングルチップマイクロコ
ンピュータ部分26は、特に限定されないがセントラル
プロセッシングユニット29、リードオンリメモリ2
8、ランダムアクセスメモリ24、タイマ14、シリア
ルインタフェース14、外部バスインタフェース25、
入出力ポート26及びバス制御回路30などから構成さ
れる。これら回路ブロックは、データバス、アドレスバ
ス及びコントロールバスなどを含む内部バス31に共通
に接続されている。前記エミュレーション用インタフェ
ース21は、前記マスタマイクロコンピュータ1と信号
の送受信を行う。外部バスインターフェース25及び入
出力ポート27は、ターゲットシステムとの間で信号の
送受信を行うインタフェースとされる。このインタフェ
ースは、例えばポートの入出力データ、タイマの入出力
信号などを外部とやりとりする。
FIG. 4 shows an example of a block configuration of the emulation processor 2. As shown in the figure, the emulation processor 2 comprises a single chip microcomputer portion 26 and an emulation interface 21. The single chip microcomputer portion 26 is a portion corresponding to a target processor (not shown). The single chip microcomputer portion 26 includes, but is not limited to, the central processing unit 29 and the read only memory 2.
8, random access memory 24, timer 14, serial interface 14, external bus interface 25,
The input / output port 26 and the bus control circuit 30 are included. These circuit blocks are commonly connected to an internal bus 31 including a data bus, an address bus and a control bus. The emulation interface 21 sends and receives signals to and from the master microcomputer 1. The external bus interface 25 and the input / output port 27 are interfaces for transmitting and receiving signals to and from the target system. This interface exchanges input / output data of ports, input / output signals of timers, and the like with the outside.

【0019】図5には、上記シングルチップマイクロコ
ンピュータ部分26におけるセントラルプロセッシング
ユニット(CPUとも記す)29の構成の一例が示され
る。前記スタックポインタ及びフラグレジスタの保有情
報は、ここで得られる。ユーザプログラム実行中は、順
次インストラクションレジスタ37に命令が読み込ま
れ、デコーダ38で命令の解読が行われることによっ
て、各部を制御する内部制御信号が生成される。これに
より当該命令に応じた処理がデータレジスタ33及び演
算器34を介して行われる。その結果は、内部レジスタ
である演算結果などを示すフラグレジスタ35、フラグ
レジスタの値を参照して決定される条件ジャンプによる
プログラムの移動位置を示す状態表示レジスタ36など
に反映される。演算結果や演算対象などは、各種の専
用,汎用レジスタ32に格納される。ここで、専用レジ
スタとしては、割込みの動作モードを示す割込みベクタ
レジスタ,オペコードのフェッチサイクルの数をカウン
トするオペランドフェッチサイクルカウント,LIFO
(ラースト・イン・アウト)形式のスタック領域におい
ても次にスタック可能な領域又は直前にスタックした領
域の先頭アドレスを格納するスタックポインタ32A,
次に実行される命令のアドレスを格納するプログラムカ
ウンタ,インデックスアドレッシングや16ビット演算
に用いられるインデックスレジスタなどが挙げられる。
また、汎用レジスタは、データレジスタ,アドレスレジ
スタなどから構成される。ここで得られるフラグレジス
タ及びスタックポインタの保有情報は、前記エミュレー
ション用インターフェース21により外部に出力され
て、トレース部6に格納可能とされる。
FIG. 5 shows an example of the configuration of a central processing unit (also referred to as a CPU) 29 in the single chip microcomputer portion 26. The possession information of the stack pointer and flag register is obtained here. During execution of the user program, instructions are sequentially read into the instruction register 37, and the decoder 38 decodes the instructions to generate internal control signals for controlling each unit. As a result, processing according to the instruction is performed via the data register 33 and the arithmetic unit 34. The result is reflected in the flag register 35 which is an internal register showing the operation result and the like, the state display register 36 which shows the movement position of the program by the conditional jump determined by referring to the value of the flag register, and the like. The calculation result and the calculation target are stored in various dedicated and general-purpose registers 32. Here, as the dedicated register, an interrupt vector register indicating the operation mode of the interrupt, an operand fetch cycle count for counting the number of operation code fetch cycles, and a LIFO
Also in the stack area of the (last in / out) type, the stack pointer 32A for storing the start address of the next stackable area or the immediately preceding stacked area,
A program counter for storing the address of an instruction to be executed next, an index register used for index addressing and 16-bit arithmetic, and the like can be given.
The general-purpose register includes a data register and an address register. The holding information of the flag register and the stack pointer obtained here is output to the outside by the emulation interface 21 and can be stored in the trace unit 6.

【0020】図6には本発明の別の実施例に係るエミュ
レータの要部が示される。この例は、図1のエミュレー
タに対し、スタックポインタ及びフラグレジスタの値を
外部に出力しない形式のエミュレーション用プロセッサ
を用いるものである。例えば、図1のエミュレータにお
いて、エミュレーション用プロセッサ2の代わりにシン
グルチップマイクロコンピュータ部分26が用いられる
一例が示されている。すなわち、図6には前記エミュレ
ーション用インタフェース21が無い場合のシステム構
成例が示される。図6に示すエミュレータは、図1に示
すエミュレータのようにスタックポインタやフラグレジ
スタの情報を直接トレースメモリ部6に格納する機構が
無いため、その機構に代替しうる検知回路7が付加され
る。この検知回路7では、ユーザプログラム実行中にタ
ーゲットシステムに採用されたスタック領域のアドレス
範囲が初期設定され、ユーザプログラムの実行時にシン
グルチップマイクロコンピュータ部分26から出力され
るアクセスアドレスが上記スタック領域のアドレス範囲
に入るのか比較動作を行う。例えば、ここで比較動作が
行われた場合、上記出力されるアドレスが同一であれば
トレースメモリ部6の領域61に該アクセスアドレスが
格納され、同一でない場合は空白情報が格納される。こ
うして、上記領域61に格納されたアクセスアドレス
は、エミュレーションを行う際のユーザプログラム実行
の指標として用いることができる。すなわち、一旦エミ
ュレーションされた範囲で任意の地点からエミュレーシ
ョンを再開するために、エミュレーション用プロセッサ
のスタックポインタを再設定するとき、上記領域61の
中から当該地点に対応するアドレス情報を参照すればよ
い。尚、他の回路ブロックの構成及び動作は、前記図1
の場合と同じである。
FIG. 6 shows a main part of an emulator according to another embodiment of the present invention. In this example, an emulation processor of a format that does not output the values of the stack pointer and the flag register to the emulator of FIG. 1 is used. For example, in the emulator of FIG. 1, an example in which the single chip microcomputer portion 26 is used instead of the emulation processor 2 is shown. That is, FIG. 6 shows a system configuration example in the case where the emulation interface 21 is not provided. Unlike the emulator shown in FIG. 1, the emulator shown in FIG. 6 does not have a mechanism for directly storing the information of the stack pointer and the flag register in the trace memory unit 6, so that a detection circuit 7 that can substitute for the mechanism is added. In this detection circuit 7, the address range of the stack area adopted in the target system is initialized during execution of the user program, and the access address output from the single-chip microcomputer portion 26 during execution of the user program is the address of the stack area. Perform a comparison operation to see if it falls within the range. For example, when the comparison operation is performed here, if the output addresses are the same, the access address is stored in the area 61 of the trace memory unit 6, and if they are not the same, blank information is stored. In this way, the access address stored in the area 61 can be used as an index for executing the user program during emulation. That is, when resetting the stack pointer of the emulation processor in order to restart the emulation from an arbitrary point within the emulated range, the address information corresponding to the point may be referred to from the area 61. The configuration and operation of other circuit blocks are the same as those shown in FIG.
Is the same as in.

【0021】上記実施例によれば、以下の作用効果を得
るものである。 (1)ユーザプログラム実行時、エミュレーション用プ
ロセッサ2内のセントラルプロセッシングユニット29
で発生するフラグレジスタ及びスタックポインタの保有
情報をエミュレーション用インタフェース21を通じて
トレースメモリ部6の格納領域62へ送ることができ
る。このようにして得られる保有情報は、一旦エミュレ
ーションを行った範囲内で更に任意の地点からエミュレ
ーションを行う場合、当該地点におけるエミュレーショ
ン用プロセッサの内部状態を設定するための条件として
有効に用いられ、任意のユーザプログラム部位のエミュ
レーションを可能にし得る。 (2)ユーザプログラム実行時、シングルチップマイク
ロコンピュータ部分26がアクセスするアクセスアドレ
スと、スタック領域61に保持されたスタック領域のア
ドレス範囲との比較を行い、同一のアドレスであればス
タック領域に該アドレスを格納する。このようにして得
られるアクセスアドレスの情報は、一旦エミュレーショ
ンを行った範囲内で更に任意の地点からエミュレーショ
ンを行う場合、当該地点におけるエミュレーション用プ
ロセッサの内部状態を設定するための条件として有効に
用いられ、任意のユーザプログラム部位のエミュレーシ
ョンを可能にし得る。 (3)上記(1)及び(2)により、ターゲットシステ
ム9に対してエミュレーションを行って得られるような
実状態に即したエミュレーションを所望の地点より行う
ことができ、エミュレーションの信頼性を向上させるこ
とができる。
According to the above embodiment, the following operational effects are obtained. (1) Central processing unit 29 in the emulation processor 2 when executing a user program
The holding information of the flag register and the stack pointer generated in step 2 can be sent to the storage area 62 of the trace memory unit 6 through the emulation interface 21. The retained information obtained in this way is effectively used as a condition for setting the internal state of the emulation processor at the point when the emulation is performed from any point within the range where the emulation is once performed. May allow emulation of the user program portion of the. (2) When the user program is executed, the access address accessed by the single-chip microcomputer portion 26 is compared with the address range of the stack area held in the stack area 61, and if the same address is found, the address is stored in the stack area To store. The access address information obtained in this way is effectively used as a condition for setting the internal state of the emulation processor at the point when the emulation is performed from an arbitrary point within the once emulated range. , May allow emulation of any user program part. (3) By the above (1) and (2), it is possible to perform the emulation in accordance with the actual state obtained by performing the emulation on the target system 9 from a desired point, and improve the reliability of the emulation. be able to.

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

【0023】例えば、上記実施例ではエミュレーション
用プロセッサを1チップ型のシングルチップマイクロコ
ンピュータに対応するものとして説明したが、リードオ
ンリメモリなどの周辺回路を含まないデータプロセッサ
に対応されるものであってもよい。また、ターゲットシ
ステムはサーボモータを用いた応用機器であってもよ
い。また、エミュレーション用プロセッサは、シングル
ボードコンピュータに対応するものであることを妨げな
い。
For example, although the emulation processor has been described as being compatible with a one-chip single-chip microcomputer in the above embodiment, it is compatible with a data processor that does not include a peripheral circuit such as a read-only memory. Good. Further, the target system may be an applied device using a servo motor. Further, the emulation processor does not prevent it from being compatible with a single board computer.

【0024】以上の説明では、主として本発明者によっ
てなされた発明をその背景となった利用分野であるイン
サーキットエミュレータなどに適用した場合について説
明したが、本発明はそれらに限定されるものではなく、
簡易型のシステム評価ツールなどにも適用する事ができ
る。本発明は、少なくともターゲットシステムを代行制
御しながらシステムデバッグもしくはソフトウェアデバ
ッグを行う条件のものに適用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to an in-circuit emulator or the like, which is the field of application which is the background of the invention, has been described, but the present invention is not limited to them. ,
It can also be applied to simple system evaluation tools. The present invention can be applied at least to the condition that system debugging or software debugging is performed while controlling the target system on behalf of the target system.

【0025】[0025]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。すなわち、本発明のエミュレータは、タ
ーゲットシステムの代行制御途上において、エミュレー
ション用インタフェースを通じてトレースメモリ部の格
納領域へ送られるターゲットプロセッサ内のフラグレジ
スタ及びスタックポインタの保有情報を用いることによ
り、任意のユーザプログラム部位のエミュレーションを
可能にするものである。また、本発明のエミュレータ
は、ターゲットシステムの代行制御途上において、シン
グルチップマイクロコンピュータ部分がアクセスするア
クセスアドレスと、トレースメモリ部の領域に保持され
たスタック領域のアドレス範囲との比較の結果、トレー
スメモリ部の領域に格納されたアドレスを用いることに
より、任意のユーザプログラム部位のエミュレーション
を可能にするものである。このように、本発明は、ター
ゲットシステムに対してエミュレーションを行って得ら
れるような実状態に即したエミュレーションを所望の地
点より行うことができ、エミュレーションの信頼性を向
上させるものである。
The effects obtained by the typical ones of the inventions disclosed in the present application will be briefly described as follows. That is, the emulator of the present invention uses the information held by the flag register and the stack pointer in the target processor, which is sent to the storage area of the trace memory unit through the emulation interface during the proxy control of the target system, so that an arbitrary user program It enables the emulation of parts. In addition, the emulator of the present invention compares the access address accessed by the single-chip microcomputer unit with the address range of the stack area held in the area of the trace memory unit during the proxy control of the target system. By using the address stored in the copy area, it is possible to emulate an arbitrary user program part. As described above, the present invention is capable of performing emulation in accordance with the actual state obtained by performing emulation on the target system from a desired point, and improves reliability of emulation.

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

【図1】本実施例に係るエミュレータの要部を示すブロ
ック図である。
FIG. 1 is a block diagram showing a main part of an emulator according to an embodiment.

【図2】インサーキットエミュレータの一例ブロック図
である。
FIG. 2 is a block diagram of an example of an in-circuit emulator.

【図3】本発明の一実施例に係るエミュレータを適用し
たシステム構成図である。
FIG. 3 is a system configuration diagram to which an emulator according to an embodiment of the present invention is applied.

【図4】エミュレーション用プロセッサの一例ブロック
図である。
FIG. 4 is a block diagram of an example of an emulation processor.

【図5】セントラルプロセッシングユニットの一例ブロ
ック図である。
FIG. 5 is a block diagram of an example of a central processing unit.

【図6】本発明の別の一実施例に係るエミュレータの要
部を示すブロック図である。
FIG. 6 is a block diagram showing a main part of an emulator according to another embodiment of the present invention.

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

1 マスタマイクロコンピュータ 2 エミュレーション用プロセッサ 3 マスタバス 4 スレーブバス 5 ブレーク制御部 6 トレースメモリ部 7 検知回路 8 マルチプレクサ 9 ターゲットシステム 26 シングルチップマイクロコンピュータ 29 セントラルプロセッシングユニット 32 専用レジスタ及び汎用レジスタ 32A スタックポインタ 35 フラグレジスタ 61 領域 62 格納領域 1 Master Microcomputer 2 Emulation Processor 3 Master Bus 4 Slave Bus 5 Break Control Section 6 Trace Memory Section 7 Detection Circuit 8 Multiplexer 9 Target System 26 Single Chip Microcomputer 29 Central Processing Unit 32 Special Register and General Purpose Register 32A Stack Pointer 35 Flag Register 61 area 62 storage area

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 エミュレーション用プロセッサを介して
ターゲットシステムを代行制御し、代行制御途上でター
ゲットシステムとの間でやりとりされる情報をトレース
メモリ部に格納してシステムデバッグを行うためのエミ
ュレータであって、上記エミュレーション用プロセッサ
は、情報の退避先を指すスタックポインタの保有情報と
演算処理による内部状態を示すフラグレジスタの保有情
報とを、上記代行制御に同期して外部に出力するエミュ
レーション用インターフェース手段を備え、上記トレー
スメモリ部は、エミュレーション用インターフェース手
段から出力される上記スタックポインタ及びフラグレジ
スタの保有情報を格納する領域を備えて成るものである
ことを特徴とするエミュレータ。
1. An emulator for performing proxy control of a target system via an emulation processor, storing information exchanged with the target system in the course of proxy control in a trace memory unit, and performing system debugging. The emulation processor includes an emulation interface means for outputting the holding information of the stack pointer indicating the save destination of the information and the holding information of the flag register indicating the internal state by the arithmetic processing to the outside in synchronization with the proxy control. The emulator, wherein the trace memory unit comprises an area for storing the stack pointer and flag register holding information output from the emulation interface means.
【請求項2】 エミュレーション用プロセッサを介して
ターゲットシステムを代行制御し、代行制御途上でター
ゲットシステムとの間でやりとりされる情報をトレース
メモリ部に格納してシステムデバッグを行うためのエミ
ュレータにおいて、ターゲットシステムに採用されるス
タック領域のアドレス範囲を保持し、上記代行制御途上
において、エミュレーション用プロセッサから出力され
るアクセスアドレスと上記保持したアドレス範囲とを比
較し、その比較結果の一致に応じてそのアクセスアドレ
スを情報の退避に利用されたスタック領域のアドレスと
してトレースメモリ部に出力する検知回路を設けて成る
ものであることを特徴とするエミュレータ。
2. An emulator for performing system debugging by performing proxy control of a target system through an emulation processor, storing information exchanged with the target system in the course of proxy control in a trace memory unit, and performing system debugging. The address range of the stack area adopted in the system is held, and the access address output from the emulation processor is compared with the held address range during the proxy control, and the access is performed according to the comparison result. An emulator comprising a detection circuit for outputting an address to a trace memory unit as an address of a stack area used for saving information.
JP5287578A 1993-10-22 1993-10-22 Emulator Withdrawn JPH07121396A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5287578A JPH07121396A (en) 1993-10-22 1993-10-22 Emulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5287578A JPH07121396A (en) 1993-10-22 1993-10-22 Emulator

Publications (1)

Publication Number Publication Date
JPH07121396A true JPH07121396A (en) 1995-05-12

Family

ID=17719137

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5287578A Withdrawn JPH07121396A (en) 1993-10-22 1993-10-22 Emulator

Country Status (1)

Country Link
JP (1) JPH07121396A (en)

Similar Documents

Publication Publication Date Title
KR0168656B1 (en) Data processing system
KR970011212B1 (en) Data processor with developement support features
US5594890A (en) Emulation system for emulating CPU core, CPU core with provision for emulation and ASIC having the CPU core
JPH011039A (en) In-circuit emulator
US20020144235A1 (en) Debugging embedded systems
JPS63111545A (en) Microprocessor for debug
JPH0193837A (en) Microprocessor for debug
JP2655615B2 (en) Information processing device
JP2513417B2 (en) Information processing device
EP0638864B1 (en) Development support system for microcomputer with internal cache
JPH07121396A (en) Emulator
JPH08171504A (en) Emulation device
JPH08272770A (en) Microcontroller development system
JPS62197831A (en) Data processor
JP2808757B2 (en) Microprocessor for debugging
JPH0550016B2 (en)
JPH0435779B2 (en)
JPH0682323B2 (en) Debug microprocessor
JPH04314139A (en) Debugging device
JPS63289653A (en) In-circuit emitter
JP2654105B2 (en) Microprocessor
JPS59202546A (en) Debugging device
JPH04123235A (en) Debugging method and system for microprogram
JPH04160650A (en) Microprocessor
JPH07319724A (en) Emulation cpu

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