JPH11345143A - In-circuit emulator - Google Patents
In-circuit emulatorInfo
- Publication number
- JPH11345143A JPH11345143A JP10149752A JP14975298A JPH11345143A JP H11345143 A JPH11345143 A JP H11345143A JP 10149752 A JP10149752 A JP 10149752A JP 14975298 A JP14975298 A JP 14975298A JP H11345143 A JPH11345143 A JP H11345143A
- Authority
- JP
- Japan
- Prior art keywords
- user program
- stop mode
- instruction
- ice
- stop
- 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
Links
Landscapes
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
(57)【要約】
【課題】 ストップモード状態のユーザプログラムへの
割込み処理後のユーザプログラム再実行の際、ユーザプ
ログラム停止前の状態に戻す。
【解決手段】 ユーザプログラムの実行中の割込み処理
の確認を行う(S1)。割込み処理によりユーザプログ
ラム停止を確認、停止前の動作モード(ノーマルモー
ド,ストップモード等)の読み取る(S2)。さらに、
割込みの発生でスタック領域に待避の状態情報を読み込
む(S3)。割込み処理実行し、ユーザプログラムの再
実行を確認し(S4)、停止前の状態のストップモード
確認(S5)により、スタック領域の戻り番地をダミー
の戻り番地に変更(S7)、ダミーの戻り番地にストッ
プモードに入れる命令の書き込み(S8)、ユーザプロ
グラムの戻り番地へ無条件分岐する命令を書き込む(S
9)。その後にリターン命令を実行しユーザプログラム
の再実行の処理を開始する(S6)。
(57) [Summary] [PROBLEMS] To re-execute a user program after an interrupt process to a user program in a stop mode state, the user program returns to a state before the user program was stopped. SOLUTION: Interrupt processing during execution of a user program is confirmed (S1). The stop of the user program is confirmed by the interrupt processing, and the operation mode (normal mode, stop mode, etc.) before the stop is read (S2). further,
When an interrupt occurs, the saved state information is read into the stack area (S3). The interrupt process is executed, the re-execution of the user program is confirmed (S4), and the stop address of the stack area is changed to a dummy return address by the stop mode confirmation (S5) before the stop, and the dummy return address is changed. Write an instruction to enter the stop mode (S8), and write an instruction to branch unconditionally to the return address of the user program (S8).
9). Thereafter, a return instruction is executed to start the process of re-executing the user program (S6).
Description
【0001】[0001]
【発明の属する技術分野】本発明は、マイクロコンピュ
ータの応用ソフトウェアの開発ツールにおいてデバッグ
の効率を図るインサーキットエミュレータに関するもの
である。[0001] 1. Field of the Invention [0002] The present invention relates to an in-circuit emulator for improving debugging efficiency in a development tool for application software of a microcomputer.
【0002】[0002]
【従来の技術】近年、電気製品の待機中の電力をいかに
抑えるかが重要視されている。そのために、電気製品の
低消費電力を実現する上で、多くの電気製品に用いられ
ているマイクロコンピュータの必要な処理以外には、マ
イクロコンピュータの原発振を停止させるとその効果が
大きいことから、低消費電力を実現するためにマイクロ
コンピュータの動作モードの一つに原発振を停止させる
機能(以下、ストップモードと呼ぶ)がある。そのスト
ップモードを用いた応用ソフトウェアを従来のインサー
キットエミュレータ(以下、ICEと呼ぶ)でデバッグ
を行う動作の流れを図5に示す。この図5はユーザプロ
グラムのストップモード中にICE割込処理による動作
を実行したときの状態を示すものである。また、図6
(a)はデバッグを行うストップモードを有するユーザ
プログラムのメインルーチン、図6(b)はユーザプロ
グラムの割込処理、図6(c)はICE割込処理を示す
フローチャートである。2. Description of the Related Art In recent years, importance has been placed on how to suppress electric power during standby of electric appliances. Therefore, in order to realize low power consumption of electrical products, besides the necessary processing of microcomputers used in many electrical products, stopping the original oscillation of the microcomputer has a large effect, One of the operation modes of the microcomputer has a function of stopping original oscillation (hereinafter, referred to as a stop mode) to realize low power consumption. FIG. 5 shows a flow of an operation of debugging application software using the stop mode with a conventional in-circuit emulator (hereinafter referred to as ICE). FIG. 5 shows a state when the operation by the ICE interrupt processing is executed during the stop mode of the user program. FIG.
6A is a flowchart showing a main routine of a user program having a stop mode for debugging, FIG. 6B is a flowchart showing interrupt processing of the user program, and FIG. 6C is a flowchart showing ICE interrupt processing.
【0003】図6(a),(b),(c)において、1
はマイクロコンピュータのユーザプログラムのメインル
ーチン、2はユーザプログラムの割込処理、3は、メイ
ンルーチン1を停止させる操作を行うと、ICEの割り
込みが発生して実行されるICE割込処理、4はユーザ
プログラムの初期設定ルーチンを含む通常処理、5はス
トップモードに入れる命令、6はストップモード中にユ
ーザプログラムの割込処理2が発生してから行われる通
常処理、7は通常処理4の途中にユーザプログラムを停
止させるICE割込処理3の発生による第1の強制ブレ
ーク、8はストップモードに入れる命令5によるストッ
プモード中で割込処理2の発生を待機中にICE割込処
理3の発生による第2の強制ブレーク、9はユーザプロ
グラムの割込処理2からメインルーチン1へ戻すための
リターン命令、10はユーザプログラムの実行停止状態
から再実行させるためのICE割込処理3のICEリタ
ーン命令、11は、ユーザプログラムの実行を停止させ
て、実行されるICE割込処理3によってICEの制御
ソフトウェアで制御されデバッグ等を行う通常割込処理
である。In FIGS. 6 (a), 6 (b) and 6 (c), 1
Is a main routine of a microcomputer user program, 2 is an interrupt process of the user program, 3 is an ICE interrupt process which is executed when an operation of stopping the main routine 1 is performed and an ICE interrupt occurs, and 4 is Normal processing including an initial setting routine of the user program, 5 is an instruction to enter a stop mode, 6 is a normal processing performed after the interrupt processing 2 of the user program occurs during the stop mode, and 7 is in the middle of the normal processing 4. The first forced break is caused by the occurrence of the ICE interrupt processing 3 for stopping the user program, and the first forced break 8 is caused by the occurrence of the ICE interrupt processing 3 while waiting for the occurrence of the interrupt processing 2 in the stop mode by the instruction 5 for entering the stop mode. The second forced break 9 is a return instruction for returning from the interrupt processing 2 of the user program to the main routine 1, 1 Is an ICE return instruction of the ICE interrupt processing 3 for re-executing the user program from the stop state, and 11 is controlled by the ICE control software by the ICE interrupt processing 3 to be executed by stopping the execution of the user program. This is a normal interrupt process for performing debugging and the like.
【0004】図7は図6(a)のメインルーチンと図6
(c)のICE割込処理のフローチャートにおける状態
遷移図で、図8は割込み処理の発生により状態情報を待
避するスタック領域を示す図である。図8において、1
2はフラグステータスの待避領域、13はプログラムの
戻り番地の待避領域、14は各種ステータスの待避領域
であり、これらの待避領域には割込み発生時に自動的に
待避格納される。FIG. 7 shows a main routine of FIG.
FIG. 8C is a state transition diagram in the flowchart of the ICE interrupt processing shown in FIG. 8C. FIG. 8 is a diagram showing a stack area for saving state information due to occurrence of an interrupt processing. In FIG. 8, 1
2 is a save area for the flag status, 13 is a save area for the return address of the program, and 14 is a save area for various statuses. These save areas are automatically saved and stored when an interrupt occurs.
【0005】前記従来例の具体的な動作の例を図7,図
8を用いながら説明する。まず、ユーザプログラムにお
けるメインルーチン1の通常処理4中に、ユーザプログ
ラムを停止させる第1の強制ブレーク7の外部割込みを
発生させる。この第1の強制ブレーク7のICE割込処
理3によってICEの割込み処理に遷移する。このIC
E割込処理3もユーザプログラムの割込処理2と同様
に、ユーザプログラムの状態は図8に示すスタック領域
にそれぞれ待避格納される。また、ICEの制御ソフト
ウェアでは、待避格納されたスタック領域の内容を読み
出し、ユーザプログラムの停止したときの状態をモニタ
にて表示することができる。そして、ユーザにはユーザ
プログラム以外のICE割込処理3を実行しているた
め、ユーザプログラムが停止した状態に見える。さら
に、ユーザプログラムの再実行は、ICE割込処理3の
ICEリターン命令10を実行することで、第1の強制
ブレーク7の発生時にスタック領域に待避格納された資
源が元に戻される。A specific example of the operation of the conventional example will be described with reference to FIGS. First, during the normal processing 4 of the main routine 1 in the user program, an external interrupt of the first forced break 7 for stopping the user program is generated. The ICE interrupt process 3 of the first forced break 7 causes a transition to an ICE interrupt process. This IC
In the E interrupt processing 3 as well, similarly to the interrupt processing 2 of the user program, the state of the user program is saved in the stack area shown in FIG. Further, with the control software of the ICE, the contents of the stack area saved and stored can be read, and the state when the user program is stopped can be displayed on the monitor. Since the user is executing ICE interrupt processing 3 other than the user program, the user program appears to be stopped. Further, when the user program is re-executed, the resources saved in the stack area when the first forced break 7 occurs are restored by executing the ICE return instruction 10 of the ICE interrupt processing 3.
【0006】次に、メインルーチン1のストップモード
に入れる命令5によるストップモード中において、第2
の強制ブレーク8のICE割込処理3が発生し、ICE
の割込み処理へ遷移するが、ここでユーザプログラムの
停止までの動作の流れは前記説明と同様であるため省略
し、その異なる部分について説明する。Next, during the stop mode according to the instruction 5 for entering the stop mode of the main routine 1, the second
ICE interrupt processing 3 of forced break 8 of
In this case, the flow of operation up to the stop of the user program is the same as that described above, and thus will be omitted, and only different parts will be described.
【0007】ユーザプログラムはストップモードである
ことから、その発振は停止しているため、ICE割込処
理3の発生によりストップモードが解除されて発振が開
始される。以下、発振している状態をノーマルモードと
いう。つまりICE割込処理3はノーマルモードで実行
されことになる。そして、この動作の場合には、ユーザ
プログラムの再実行はストップモードの状態で停止され
たので、元のストップモードにする必要がある。[0007] Since the user program is in the stop mode, the oscillation of the user program is stopped. Therefore, the occurrence of the ICE interrupt processing 3 cancels the stop mode and starts the oscillation. Hereinafter, the oscillation state is referred to as a normal mode. That is, the ICE interrupt processing 3 is executed in the normal mode. In the case of this operation, since the re-execution of the user program is stopped in the stop mode, it is necessary to return to the original stop mode.
【0008】しかしながら、ICE割込処理3において
ICEリターン命令10の前でストップモードに入れる
処理を行うと、ICE割込処理3中にストップモードに
入ってしまい、正しくユーザプログラムの前の動作モー
ドに戻ることができない。このために、従来のこのよう
な場合において再実行させるときに、ICEの制御ソフ
トウェアは「ストップモード中であるためノーマルモー
ドにして下さい。」などの警告を出していた。したがっ
て、ユーザは動作モードを制御するレジスタをICEに
より変更するか、再実行するスタートアドレスを指定す
るか、リセットして再実行することが行われていた。However, if the stop mode is entered before the ICE return instruction 10 in the ICE interrupt process 3, the stop mode is entered during the ICE interrupt process 3, and the operation mode immediately returns to the operation mode before the user program. I can't go back. For this reason, when re-executing in such a conventional case, the ICE control software has issued a warning such as "Please enter normal mode because stop mode is in progress." Therefore, the user changes the register for controlling the operation mode by ICE, specifies a start address to be re-executed, or resets and re-executes.
【0009】[0009]
【発明が解決しようとする課題】このような構成のイン
サーキットエミュレータでは、ユーザプログラムにマイ
クロコンピュータの原発振を停止させるストップモード
を有する応用ソフトウェアを開発するデバッグの際に、
ユーザプログラムのストップモード中にICEの割込み
処理を行い、その後ユーザプログラムの再実行を行なえ
るように元のストップモードとするため、ICE割込処
理のICEリターン命令の前にストップモードに入れる
命令を実行させても、ユーザプログラムの実行モードへ
戻る前にICEの割込み処理中にストップモードに入っ
てしまい、元の状態に戻すことができないという問題が
ある。In the in-circuit emulator having such a configuration, when debugging application software having a stop mode for stopping the source oscillation of the microcomputer in the user program,
In order to perform the ICE interrupt processing during the stop mode of the user program and then return to the original stop mode so that the user program can be re-executed, an instruction to enter the stop mode before the ICE return instruction of the ICE interrupt processing is provided. Even if it is executed, there is a problem that the stop mode is entered during the interrupt processing of the ICE before returning to the execution mode of the user program, and it is not possible to return to the original state.
【0010】また、ICEの制御ソフトウェアの処理後
に自動的にストップモードに入れ直すためには、ユーザ
プログラム中でストップモードに入れたアドレスへリタ
ーンすればよい訳であるが、ストップモードに入れる命
令を実行しても直後の命令も実行される可能性があり、
もしその命令が分岐命令であればどこへ戻せば良いかは
判断ができないという問題があった。In order to automatically switch back to the stop mode after the processing of the control software of the ICE, it is necessary to return to the address set in the stop mode in the user program. Even then, the next instruction may be executed,
If the instruction is a branch instruction, there is a problem that it cannot be determined where to return.
【0011】本発明は、前記従来技術の問題を解決する
ことに指向するものであり、ストップモードの状態で停
止されているユーザプログラムにICE割込処理を行な
った後のユーザプログラムの再実行の際、ユーザに何の
制約もなくユーザプログラムを停止した前の状態に戻す
ことができる操作性の優れたICE(インサーキットエ
ミュレータ)を提供することを目的とする。[0011] The present invention is directed to solving the above-mentioned problem of the prior art, and is directed to re-executing the user program after performing an ICE interrupt process on the user program stopped in the stop mode. In this case, it is an object of the present invention to provide an ICE (in-circuit emulator) having excellent operability that can return a user program to a state before the user program was stopped without any restrictions.
【0012】[0012]
【課題を解決するための手段】この目的を達成するため
に、本発明に係るインサーキットエミュレータは、マイ
クロコンピュータの動作モードにおける原発振を停止さ
せる機能と、デバッグするためのインサーキットエミュ
レータの制御ソフトウェアと、制御ソフトウェアの制御
によりリードライト可能なメモリとを有するように構成
したものである。In order to achieve the above object, an in-circuit emulator according to the present invention has a function of stopping original oscillation in an operation mode of a microcomputer and a control software of the in-circuit emulator for debugging. And a memory readable and writable under the control of control software.
【0013】前記構成によれば、ユーザプログラムのス
トップモードの状態で発生した割込み処理の終了後に、
ユーザに何の制約もなくユーザプログラムを停止した前
のストップモードの状態に戻すことができる。According to the above configuration, after the end of the interrupt processing that has occurred in the stop mode of the user program,
The user can return to the stop mode before stopping the user program without any restrictions.
【0014】[0014]
【発明の実施の形態】以下、図面を参照して本発明にお
ける実施の形態を詳細に説明する。図1は、本実施の形
態におけるユーザプログラムのストップモード中にIC
E割込処理を行ない、その後ユーザプログラムを再実行
したとき元のストップモードに入ることを示す図であ
る。また、図2は本発明の実施の形態におけるICEの
制御ソフトウェアの処理動作を示すフローチャートであ
る。図3はICE割込処理後からユーザプログラムの再
実行でストップモードに入れるためのスタックの使い方
を示す図、図4はユーザプログラムにおいてストップモ
ードへ移行し待機状態となった各アドレスの命令を示す
図である。Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a diagram showing an example of an IC during a stop mode of a user program according to the present embodiment.
It is a figure showing that when the E interrupt processing is performed and the user program is re-executed thereafter, the original stop mode is entered. FIG. 2 is a flowchart showing the processing operation of the control software of the ICE according to the embodiment of the present invention. FIG. 3 is a diagram showing how to use the stack to enter the stop mode by re-executing the user program after the ICE interrupt processing, and FIG. 4 shows instructions at each address in the user program which have shifted to the stop mode and are in a standby state. FIG.
【0015】図3において、12のフラグステータスの
待避領域と14の各種ステータスは、図8に示したのと
同様に割込み発生時に自動的にフラグステータスを待避
する領域と各種ステータスを待避する領域であり、15
は、図8のプログラムの戻り番地13を、ICEの制御
ソフトウェアにより書き換えて変更したダミーの戻り番
地、また、16はICEの制御ソフトウェアにより書き
換えられたストップモードに入れる命令、17はメイン
ルーチンの戻り番地へ無条件分岐する命令である。ま
た、図4において、19はユーザプログラム中にあるス
トップモードに入れる命令、20はストップモードに入
れる命令19の直後の第1の命令、21は、ストップモ
ードがユーザの割込みにより解除された時に、一番始め
に実行される第2の命令、22は割込み復帰待ちであ
る。In FIG. 3, a flag status save area 12 and various statuses 14 are an area for automatically saving the flag status and an area for saving the various statuses when an interrupt occurs, as shown in FIG. Yes, 15
Is a dummy return address obtained by rewriting the return address 13 of the program of FIG. 8 by the ICE control software, 16 is an instruction to enter the stop mode rewritten by the ICE control software, and 17 is a return of the main routine. This instruction unconditionally branches to an address. In FIG. 4, reference numeral 19 denotes an instruction to enter a stop mode in the user program, reference numeral 20 denotes a first instruction immediately after the instruction to enter the stop mode, and reference numeral 21 denotes an instruction when the stop mode is released by a user interrupt. The second instruction 22, which is executed first, is waiting for an interrupt return.
【0016】まず、ユーザプログラムのストップモード
中に発生させたICE割込処理で、ユーザプログラムを
実行停止した状態の動作説明を図3、図4を用いて行な
う。図4に示すユーザプログラムのメインルーチンの中
でA番地のストップモードに入れる命令19が実行され
ると、次の命令もプリフェッチ(先取り)しているため
にB番地の第1の命令20が続いて実行される。この時
点まではノーマルモードでありB番地の第1の命令20
を実行した直後で発振は停止してストップモードとな
る。このストップモード中では割込み復帰待ち22の入
力を待機し、ユーザからの割込み復帰によるメインルー
チンへの復帰はアドレスC番地の第2の命令21から実
行されノーマルモードとなる。First, the operation of the ICE interrupt process generated during the stop mode of the user program when the execution of the user program is stopped will be described with reference to FIGS. When an instruction 19 for entering the stop mode at address A is executed in the main routine of the user program shown in FIG. 4, the first instruction 20 at address B follows because the next instruction is also prefetched (prefetched). Executed. Up to this point, the normal mode is set, and the first instruction 20 at the address B is set.
Immediately after executing, the oscillation is stopped and the mode is set to the stop mode. In this stop mode, the input of the interrupt return wait 22 is waited for, and the return to the main routine by the return of the interrupt from the user is executed from the second instruction 21 at the address C to be in the normal mode.
【0017】ここで、ストップモード中の割込み復帰待
ち22の待機状態において、ユーザプログラムの停止操
作を行いデバッグするためICEの制御ソフトウェアの
ICE割込処理が発生すると、ストップモードは、ユー
ザプログラムの割込処理と同様に解除されてノーマルモ
ードとなる。このときのスタック領域の状態は図8に示
すように待避され、図8の戻り番地13には図4に示す
第2の命令21のアドレスC番地が待避される。Here, in the standby mode of the interrupt return wait 22 in the stop mode, when the ICE interrupt processing of the ICE control software for stopping and debugging the user program occurs, the stop mode is set to the interrupt of the user program. As in the case of the loading process, the mode is released and the normal mode is set. The state of the stack area at this time is saved as shown in FIG. 8, and the return address 13 in FIG. 8 saves the address C of the second instruction 21 shown in FIG.
【0018】さらに、ICEの制御ソフトウェアの動作
については図2のフローチャートを使って説明する。ユ
ーザプログラムの実行中に実行停止処理(強制ブレーク
などによる割込みの処理等)の発生によりユーザプログ
ラムが停止したか否かの確認を行う(S1)。処理S1
において、実行停止処理の発生によりユーザプログラム
が停止したことを確認すると、ユーザプログラムの実行
停止処理に入る前のマイクロコンピュータの動作モード
(ノーマルモード,ストップモード等)の読み取りを行
う(S2)。さらに、ICE等による割込みの発生によ
り汎用レジスタから読み込まれ、スタック領域に待避さ
れた状態情報の読み込み処理を行い(S3)、発生した
割込みの処理を実行する。その後、前記割込みの処理の
リターン命令やユーザの操作によるユーザプログラムの
再実行の命令が出されたか否かの確認を行う(S4)。The operation of the ICE control software will be described with reference to the flowchart of FIG. During execution of the user program, it is checked whether or not the user program has been stopped due to the occurrence of an execution stop process (such as an interrupt process due to a forced break) (S1). Processing S1
In step (2), when it is confirmed that the user program has stopped due to the execution stop processing, the microcomputer reads the operation mode (normal mode, stop mode, etc.) before the execution of the user program stops (S2). Further, the CPU reads the status information read from the general-purpose register due to the occurrence of an interrupt by the ICE or the like and is saved in the stack area (S3), and executes the processing of the generated interrupt. Thereafter, it is confirmed whether or not a return instruction for the interrupt processing or an instruction for re-executing the user program by a user operation has been issued (S4).
【0019】前記の処理S4において、再実行の命令が
確認されたとき、前記処理S2で読み込んだ情報からユ
ーザプログラムの停止前の状態がストップモードである
か否かを確認する(S5)。この処理S5においてスト
ップモードでないとき、スタック領域に待避されたアド
レスやステータスの状態情報を汎用レジスタへ書き込み
を行うリターン命令を実行することによりユーザプログ
ラムの再実行の処理を開始する(S6)。In step S4, when the re-execution command is confirmed, it is confirmed from the information read in step S2 whether the state before the stop of the user program is the stop mode (S5). When the stop mode is not set in the process S5, the process of re-executing the user program is started by executing a return instruction for writing the address and status information saved in the stack area to the general-purpose register (S6).
【0020】また、処理S5においてストップモードの
とき、スタック領域に退避されている戻り番地をダミー
の戻り番地に変更する処理を行い(S7)、ダミーの戻
り番地として指定された領域にストップモードに入れる
命令の書き込みを行い(S8))、さらにユーザプログ
ラムの正規の戻り番地に無条件分岐する命令を書き込む
処理を行う(S9)。以上のような処理後にリターン命
令を実行しユーザプログラムの再実行の処理を開始する
(S6)。In the stop mode in step S5, a process of changing the return address saved in the stack area to a dummy return address is performed (S7), and the stop mode is set to the area designated as the dummy return address. An instruction to be inserted is written (S8), and an instruction for unconditionally branching is written to a normal return address of the user program (S9). After the above processing, a return instruction is executed to start the re-execution of the user program (S6).
【0021】具体的には、ストップモードの状態に発生
したICE割込処理後の操作でユーザプログラムを再実
行させ、割込み前と同じストップモードとするとき、図
2に示す処理S4の再実行命令の確認により、ICEの
制御ソフトウェアによって以下の変更を行う。まず、処
理S5でユーザプログラムの停止前の動作モードがスト
ップモードであるか確認する。ストップモードであれば
処理S7において、スタック領域のY番地に待避してい
る戻り番地13(図8参照)には図4に示すメインルー
チンへの戻り番地であるC番地が格納されているが、ダ
ミーの戻り番地15としてV番地に変更する。次に処理
S8でスタック領域のV番地にはストップモードに入れ
る命令16を書き込み、処理S9により次のW番地には
メインルーチンの戻り番地へ無条件分岐する命令17と
して図4に示すC番地へ分岐する命令を書き込む。More specifically, when the user program is re-executed by the operation after the ICE interrupt processing generated in the stop mode state and the same stop mode as before the interruption is executed, the re-execution instruction of the processing S4 shown in FIG. The following changes are made by the control software of the ICE according to the confirmation. First, in step S5, it is confirmed whether the operation mode before the stop of the user program is the stop mode. In the stop mode, in the process S7, the return address 13 (see FIG. 8) evacuated to the address Y in the stack area stores the address C which is the return address to the main routine shown in FIG. The address is changed to the address V as the dummy return address 15. Next, in step S8, an instruction 16 for entering the stop mode is written in the address V of the stack area, and in step S9, the next address W is unconditionally branched to the return address of the main routine. Write the instruction to branch.
【0022】このような前処理を行った状態で、ICE
割込処理のICEリターン命令を実行すると、図3にお
けるスタック領域のX番地,Y番地,Z番地のフラグス
テータス12、ダミーの戻り番地15、各種ステータス
14をマイクロコンピュータが自動的に汎用レジスタに
戻し、ユーザプログラムの再実行が行われる。そして、
ダミーの戻り番地15であるV番地からユーザプログラ
ムは実行されることになり、ストップモードに入れる命
令16が実行されてストップモードに入る。次の命令で
あるW番地の実行後に発振は停止するため、ユーザは何
も注意を払うことなくユーザプログラムがストップモー
ドにおけるICEの操作をすることができる。With such pre-processing, ICE
When the ICE return instruction of the interrupt processing is executed, the microcomputer automatically returns the flag status 12, the dummy return address 15, and various statuses 14 of the addresses X, Y, and Z in the stack area to the general-purpose register in FIG. Then, the user program is re-executed. And
The user program is to be executed from the dummy return address 15, ie, address V, and the instruction 16 to enter the stop mode is executed to enter the stop mode. Since the oscillation stops after the execution of the next instruction, address W, the user program can operate the ICE in the stop mode without paying any attention to the user.
【0023】なお、スタック領域のV番地,W番地の命
令はフラグステータス12、各種ステータス14が変化
しない命令を使わなければならない。また、以上の説明
では、スタック領域を使って説明しているが、未使用領
域のリードライト可能なメモリを用いても同様に実施可
能である。The instructions at addresses V and W in the stack area must use instructions in which the flag status 12 and the various statuses 14 do not change. In the above description, the description is made using the stack area. However, the present invention can be similarly implemented using a rewritable memory in an unused area.
【0024】[0024]
【発明の効果】以上説明したように、本発明によれば、
ユーザに操作上の負担をかけることなくユーザプログラ
ムのストップモードにおけるICEの実行,停止の操作
が可能となり、デバッグを効率よく行うことができると
いう効果を奏する。As described above, according to the present invention,
ICE execution and stop operations can be performed in the stop mode of the user program without imposing a burden on the user, resulting in an effect that debugging can be performed efficiently.
【図1】本発明の実施の形態におけるユーザプログラム
のストップモード中にICE割込処理を行なった後ユー
ザプログラム再実行に元のストップモードに入ることを
示す図FIG. 1 is a diagram showing that an original STOP mode is entered upon re-execution of a user program after performing an ICE interrupt process during a stop mode of the user program according to the embodiment of the present invention;
【図2】本発明の実施の形態におけるICEの制御ソフ
トウェアの処理動作を示すフローチャートFIG. 2 is a flowchart showing a processing operation of ICE control software according to the embodiment of the present invention;
【図3】本発明の実施の形態におけるICE割込処理後
からユーザプログラムの再実行でストップモードに入れ
るためのスタックの使い方を示す図FIG. 3 is a diagram showing how to use a stack for entering a stop mode by re-executing a user program after an ICE interrupt process according to the embodiment of the present invention;
【図4】本発明の実施の形態におけるユーザプログラム
においてストップモードへ移行し待機状態となった各ア
ドレスの命令を示す図FIG. 4 is a diagram showing an instruction of each address in a user program according to the embodiment of the present invention, which has entered a stop mode after entering a stop mode.
【図5】従来のユーザプログラムのストップモード中の
ICE割込処理による動作を実行したときの状態を示す
図FIG. 5 is a diagram showing a state when an operation by an ICE interrupt process in a stop mode of a conventional user program is executed.
【図6】(a)はデバッグを行うストップモードを有す
るユーザプログラムのメインルーチン、(b)はユーザ
プログラムの割込処理、(c)はICE割込処理を示す
フローチャート6A is a flowchart showing a main routine of a user program having a stop mode for debugging, FIG. 6B is a flowchart showing interrupt processing of the user program, and FIG. 6C is a flowchart showing ICE interrupt processing;
【図7】図6(a)のメインルーチンと図6(c)のI
CE割込処理のフローチャートにおける状態遷移図FIG. 7A shows a main routine of FIG. 6A and FIG.
State transition diagram in CE interrupt processing flowchart
【図8】割込み処理の発生により状態情報を待避するス
タック領域を示す図FIG. 8 is a diagram showing a stack area for saving state information due to occurrence of interrupt processing;
1 メインルーチン 2 割込処理 3 ICE割込処理 4,6 通常処理 5,16,19 ストップモードに入れる命令 7,8 強制ブレーク 9 リターン命令 10 ICEリターン命令 11 通常割込処理 12 フラグステータス 13 戻り番地 14 各種ステータス 15 ダミーの戻り番地 17 メインルーチンの戻り番地へ無条件分岐する命令 20 第1の命令 21 第2の命令 22 割込み復帰待ち 1 Main routine 2 Interrupt processing 3 ICE interrupt processing 4,6 Normal processing 5,16,19 Instruction to enter stop mode 7,8 Forced break 9 Return instruction 10 ICE return instruction 11 Normal interrupt processing 12 Flag status 13 Return address 14 Various statuses 15 Dummy return address 17 Instruction that branches unconditionally to main routine return address 20 First instruction 21 Second instruction 22 Waiting for interrupt return
Claims (1)
ける原発振を停止させる機能と、デバッグするためのイ
ンサーキットエミュレータの制御ソフトウェアと、該制
御ソフトウェアの制御によりリードライト可能なメモリ
とを有し、前記原発振を停止した動作モードの状態にお
いて発生した割込み処理の終了後に、前記動作モードの
状態とすることを特徴とするインサーキットエミュレー
タ。The microcomputer has a function of stopping a source oscillation in an operation mode of a microcomputer, control software of an in-circuit emulator for debugging, and a memory readable and writable under the control of the control software. An in-circuit emulator wherein the operation mode is set after the end of the interrupt processing generated in the operation mode in which the operation is stopped.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14975298A JP3410023B2 (en) | 1998-05-29 | 1998-05-29 | In-circuit emulator |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14975298A JP3410023B2 (en) | 1998-05-29 | 1998-05-29 | In-circuit emulator |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH11345143A true JPH11345143A (en) | 1999-12-14 |
| JP3410023B2 JP3410023B2 (en) | 2003-05-26 |
Family
ID=15481987
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP14975298A Expired - Lifetime JP3410023B2 (en) | 1998-05-29 | 1998-05-29 | In-circuit emulator |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3410023B2 (en) |
-
1998
- 1998-05-29 JP JP14975298A patent/JP3410023B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JP3410023B2 (en) | 2003-05-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI478052B (en) | Apparatus and method for handling exception events | |
| JPS63245529A (en) | Register saving and restoring device | |
| US6438708B1 (en) | Information processing apparatus that can hold internal information | |
| JP2005528664A (en) | CPU power-down method and apparatus therefor | |
| US20100153786A1 (en) | Processor, multiprocessor, and debugging method | |
| JP2004348707A (en) | Integrated circuit power saving method | |
| JP2522158B2 (en) | Program debugging method for multiprocessor system | |
| JP3410023B2 (en) | In-circuit emulator | |
| JP2677458B2 (en) | System call execution device | |
| JP2003216449A (en) | Patch processing system | |
| JP2663895B2 (en) | CPU simulator | |
| KR101236393B1 (en) | Electric device and control method thereof | |
| JP3991999B2 (en) | Central processing unit and processor control method | |
| JP3206394B2 (en) | Programmable controller with 5-stage pipeline structure | |
| JPH03163617A (en) | How to warm boot a program in a computer system | |
| JPS6048770B2 (en) | Information processing method | |
| JP3449812B2 (en) | Control electronics | |
| KR20080030319A (en) | Computer system and its control method | |
| JPH03292527A (en) | Arithmetic unit | |
| JP2008015725A (en) | Information processor and program activating method | |
| JPH08272653A (en) | Freeze processing system | |
| JPH0454548A (en) | Memory check system for computer system | |
| JPH0981275A (en) | Processor | |
| JP5194360B2 (en) | Information processing apparatus and control method thereof | |
| JPH11110250A (en) | Software execution mode switching method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080320 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090320 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100320 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110320 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110320 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120320 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130320 Year of fee payment: 10 |