JP2954006B2 - Emulation device and emulation method - Google Patents
Emulation device and emulation methodInfo
- Publication number
- JP2954006B2 JP2954006B2 JP7282935A JP28293595A JP2954006B2 JP 2954006 B2 JP2954006 B2 JP 2954006B2 JP 7282935 A JP7282935 A JP 7282935A JP 28293595 A JP28293595 A JP 28293595A JP 2954006 B2 JP2954006 B2 JP 2954006B2
- Authority
- JP
- Japan
- Prior art keywords
- memory
- alt
- interrupt
- program
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 64
- 238000012545 processing Methods 0.000 claims description 74
- 230000008569 process Effects 0.000 claims description 52
- 230000004044 response Effects 0.000 claims description 2
- 238000004458 analytical method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000008859 change Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
Landscapes
- Test And Diagnosis Of Digital Computers (AREA)
Description
【0001】[0001]
【発明の属する技術分野】本発明は、インサーキットエ
ミュレータおよびそのエミュレーション方法に関し、特
にALTを用いた割込み処理方法に関する。[0001] 1. Field of the Invention [0002] The present invention relates to an in-circuit emulator and an emulation method thereof, and more particularly to an interrupt processing method using an ALT.
【0002】[0002]
【従来の技術】従来の技術を説明する前提としてメイン
プログラムあるいはユーザプログラムの処理を一時中断
することで行う処理について説明する。例えば特開昭6
0−238946号公報に示すように、デバッグ用の情
報を得ようとしてメインプログラムから処理を移行させ
た場合があるが、これを図5および図6を用いて説明す
る。2. Description of the Related Art A description will be given of a process performed by temporarily suspending the processing of a main program or a user program as a premise for explaining the conventional technology. For example, JP
As shown in Japanese Patent Application Laid-Open No. 0-238946, there are cases where the processing is shifted from the main program in order to obtain information for debugging. This will be described with reference to FIGS.
【0003】図5は従来の割込みを使用したメモリダン
プ処理を示すブロック図である。処理部A〜C(508
A〜C)にはデバッグ対象となる処理を処理ID(51
0A〜C)により割当てる。この場合デバッグ用の情報
を表示する方法をスナップショットダンプ(以下スナッ
プという)と呼んでいる。FIG. 5 is a block diagram showing a conventional memory dump process using an interrupt. Processing units A to C (508
In A to C), a process to be debugged is identified by a process ID (51).
0A-C). In this case, a method of displaying information for debugging is called a snapshot dump (hereinafter, referred to as snap).
【0004】処理部A〜C(508A〜C)からのトレ
ース指示509A〜Cによってスナップへ処理が移行す
ると、まずデバッグ用スイッチA506Aの状態を読み
とり実際にスナップを行ってよいか判断する(60
1)。ここでスイッチAがONの状態であれば次にデバ
ッグ用スイッチB(506B)の状態を読みとり予め設
定されているスナップ種別用処理ID(510A〜C)
によってスナップ処理を区別する必要があるか判断する
(602)。ここでスイッチBがONの状態であれば処
理IDが一致しているか判断し(603)、一致してい
ればダンプ(画面表示)(604)を行う。次にデバッ
グ用スイッチC(506C)の状態を読みとり、ダンプ
終了後にデバッグへ処理を移行するか、メインプログラ
ムへRETURNするかを判断する(605)。この場
合、スナップ処理だけで合計4回のスイッチ状態の判断
を行うことになる。When the process is shifted to the snap by the trace instructions 509A to 509C from the processing units A to C (508A to 508C), first, the state of the debug switch A 506A is read to determine whether the snap can be actually performed (60).
1). If the switch A is ON, the status of the debug switch B (506B) is read next, and the snap type process ID (510A to C) is set in advance.
It is determined whether the snap processing needs to be distinguished (602). Here, if the switch B is ON, it is determined whether the process IDs match (603), and if they match, a dump (screen display) (604) is performed. Next, the state of the debugging switch C (506C) is read, and it is determined whether to shift the processing to debugging after completion of the dump or to return to the main program (605). In this case, the switch state is determined four times only by the snap processing alone.
【0005】また、特開平4−262429号公報に示
すように、ALTプログラムで処理を行う場合がある。
この場合について図7および図8を用いて説明する。図
7は従来のモニタを使用した割り込み処理を示すブロッ
ク図である。この場合ALTではなくエミュレーション
モニタ(以下モニタという)と呼んでいる。モニタに処
理を移行するためにはエミュレーションCPUに割込み
を入れてユーザプログラムを一時中断して、割込み処理
でモニタ処理を行う必要がある。これによりエミュレー
ションモニタ格納メモリ717に格納されているモニタ
に制御を移すモニタ導入801を行う。このモニタ導入
後の処理では、スーパバイザCPU701からのコマン
ドパケットを読み込む(802)。読込んだコマンドパ
ケットからコマンド解析(803)を行うことによっ
て、どの処理を行うか判断している。次に解析したコマ
ンドに対応するレジスタバンク切替え(804)、レジ
スタ書き込み読出し(805)、メモリ書き込み読出し
(806)に振分け、振り分けられた処理(807)を
行い、モニタを脱出(808)する。As described in Japanese Patent Application Laid-Open No. 4-262429, there is a case where processing is performed by an ALT program.
This case will be described with reference to FIGS. FIG. 7 is a block diagram showing a conventional interrupt process using a monitor. In this case, it is called an emulation monitor (hereinafter referred to as a monitor) instead of the ALT. To shift the processing to the monitor, it is necessary to interrupt the emulation CPU to temporarily suspend the user program, and to perform the monitor processing in the interrupt processing. As a result, a monitor introduction 801 for transferring control to the monitor stored in the emulation monitor storage memory 717 is performed. In the process after the introduction of the monitor, a command packet from the supervisor CPU 701 is read (802). By performing command analysis (803) from the read command packet, it is determined which processing is to be performed. Next, it is assigned to register bank switching (804), register writing / reading (805), and memory writing / reading (806) corresponding to the analyzed command.
【0006】この従来の技術では省略されているが割込
み処理を行うということは、エミュレーションCPUの
共通の資源を使用することになるので、レジスタ群の退
避処理が必要となる。また、コマンド解析を行って処理
を振り分けるような汎用性を持たせた処理では退避しな
ければならない情報が多くなる。Although the interrupt processing is omitted in this conventional technique, performing the interrupt processing uses the common resources of the emulation CPU, so that the register group must be saved. Further, in a process having versatility such as performing a command analysis and distributing a process, much information must be saved.
【0007】また、前述の特開平4−262429号公
報に類似した従来のALTを使用した割込み処理を図9
を用いて説明する。ここでは、スーパバイザCPU上で
実行されるホストプログラムとエミュレーションCPU
上で実行されるユーザプログラム、ALTプログラムに
ついての処理を説明している。ホストプログラムからの
割込み(902)により、ユーザプログラムからALT
プログラムに処理が移行する。次にALTプログラムで
はレジスタ退避(904)、ホストプログラムからのコ
マンド送付(903)で受取ったコマンドデータ(91
0)をコマンド解析(905)する。次にコマンドによ
り、メモリライト処理(906)またはメモリリード処
理(907)を行う。処理終了後、レジスタ復帰(90
8)および割込み復帰(909)を行い、ユーザプログ
ラムへ移行する。この場合でも、その従来の技術と同様
に退避やコマンド解析のために処理に時間がかかってし
まう。FIG. 9 shows a conventional interrupt processing using an ALT similar to the above-mentioned Japanese Patent Application Laid-Open No. 4-262429.
This will be described with reference to FIG. Here, the host program executed on the supervisor CPU and the emulation CPU
The processing of the user program and the ALT program executed above is described. ALT from user program by interrupt (902) from host program
Processing shifts to the program. Next, in the ALT program, the register data is saved (904), and the command data (91) received in the command transmission (903) from the host program is sent.
0) is analyzed (905). Next, a memory write process (906) or a memory read process (907) is performed by a command. After the processing is completed, the register is restored (90
8) and return to interrupt (909), and shift to the user program. Even in this case, the processing takes time because of the evacuation and the command analysis as in the related art.
【0008】[0008]
【発明が解決しようとする課題】上述した従来の技術で
記述したようにスイッチ状態の判断を数多く行っている
ため、ステップ数が増大することである。また、コマン
ド解析を行って処理を振分ける処理を行った場合、退避
しなければならない情報が多くなってしまい、更にステ
ップが増大してしまうという問題がある。However, as described in the above-mentioned prior art, the number of steps is increased because a large number of switch state determinations are made. In addition, when the command analysis is performed and the process of allocating the process is performed, there is a problem that the information that must be saved increases and the number of steps further increases.
【0009】これらが問題となる理由は、ある一定の時
間以上停止してしまうと問題が発生するシステムで従来
の技術を用いた場合に起こる。これらの処理はALT処
理の中で占める割合が大きいため、ALTが行われる処
理が短時間で終了しなくなる。すなわち、中断する時間
が前述のシステムに対応する時間で終了しなければなら
ないにも拘わらず、判断や退避のためにALT処理の時
間が長くなってしまう。この時間内に処理が終了しなか
った場合に前述のシステムは完全な制御ができない状態
になり、システムの破壊を招きかねない。これはエミュ
レーション中に一定時間以上停止してしまうと問題が発
生するシステムで制御が正常に出来なくなってしまった
ために起こってしまう現象で、特にモータ制御のシステ
ムで発生する。The reason why these problems are caused occurs when the conventional technology is used in a system in which a problem occurs if the operation is stopped for a certain period of time or longer. Since these processes account for a large proportion of the ALT process, the process in which the ALT is performed does not end in a short time. That is, although the interruption time must end at a time corresponding to the above-described system, the time of the ALT processing for determination and evacuation becomes long. If the processing is not completed within this time, the above-mentioned system will be in a state where complete control cannot be performed, which may lead to destruction of the system. This is a phenomenon that occurs because control cannot be performed normally in a system in which a problem occurs if emulation is stopped for a certain period of time or more, and particularly occurs in a motor control system.
【0010】本発明の目的は、このような問題を解決
し、ALT処理時間が短縮され、エミュレーション中断
時間を少ししたエミュレーション装置およびそのエミュ
レーション方法を提供することにある。An object of the present invention is to provide an emulation apparatus and an emulation method which solve such a problem, shorten the ALT processing time, and reduce the emulation interruption time.
【0011】[0011]
【課題を解決するための手段】本発明の構成は、被検査
対象であるユーザプログラムとホストプログラムのイン
ターフェースを制御するオルタネート(以下ALTとい
う)プログラムとを実行するエミュレーションCPU
と、前記ホストプログラムを実行するスパバイザCPU
と、前記ホストプログラムから前記ユーザプログラムへ
の割込み処理に先立って前記ホストプログラムにより割
込みベクタを設定する割込みベクタ設定手段と、前記割
込み処理に先立ってホストプログラムにより特定メモリ
エリアに命令を格納するオルタネート(ALT)メモリ
とを有し、前記割込みベクタ設定手段が、割込み処理に
先立ってホストプログラムにより前記ALTメモリにメ
モリライト命令を格納するようにしたことを特徴とす
る。According to the present invention, there is provided an emulation CPU for executing an alternate (ALT) program for controlling an interface between a user program to be inspected and a host program.
And a supervisor CPU for executing the host program
When the interrupt vector setting means for setting the interrupt vector by the said prior from the host program to an interrupt process to the user program host program, the split
Memory specified by the host program prior to
Alternate (ALT) memory for storing instructions in the area
Wherein the interrupt vector setting means performs interrupt processing.
Prior to this, the ALT memory is stored in the ALT memory by the host program.
A memory write instruction is stored .
【0012】本発明において、割込みベクタ設定手段
が、割込み処理に先立ってホストプログラムにより前記
ALTメモリに、前記メモリライト命令の代りにメモリ
リード命令を格納するようにすることができる。In the present invention, interrupt vector setting means
However, before the interrupt processing, the host program
In the ALT memory, a memory is used instead of the memory write instruction.
A read command can be stored .
【0013】[0013]
【0014】また本発明の他の構成は、ホストプログラ
ムにより割込み要求を行う第1のステップと、前記割込
み要求を受けてユーザプログラムを停止する第2のステ
ップと、前記ホストプログラムからのコマンドをALT
プログラムにより実行する第3のステップとにより割込
み処理を行い、その割込み処理に先立って割込みベクタ
を設定する第4のステップとを有するエミュレーション
方法において、メモリライトコマンド受付けを行う第5
のステップと、前記ホストプログラムにより特定メモリ
エリアのALTメモリにメモリライト命令を格納する第
6のステップと、前記割込みベクタの変更および保持を
行う第7のステップとを含んでALT処理を行うことを
特徴とする。According to another aspect of the present invention, there is provided a first step of making an interrupt request by a host program, a second step of stopping the user program in response to the interrupt request, and executing an ALT command from the host program.
In a third have line interrupt processing by the steps, the emulation process and a fourth step of setting the interrupt vector prior to the interrupt processing executed by the program, the performing reception memory write command 5
And a specific memory by the host program.
No. of storing the memory write instruction in the ALT memory of the area
Step 6 and change and hold of the interrupt vector
Performing an ALT process including a seventh step to be performed .
【0015】本発明のエミュレーション方法において、
第6のステップが、前記メモリライト命令の代りに、メ
モリリード命令を格納することもできる。[0015] In the emulation method of the present invention,
In the sixth step, instead of the memory write instruction,
A memory read instruction can also be stored .
【0016】本発明のエミュレーション方法によれば、
従来の技術のALTプログラム内の判断やコマンド解析
を省略し、予めALTメモリ内に特定機能用命令群を準
備する処理を設け、この処理をALTメモリ内の特定エ
リアに対して行うので、ALT処理に必要とする時間を
短縮することができる。According to the emulation method of the present invention,
Since the determination in the ALT program and the command analysis of the prior art are omitted, a process for preparing a specific function instruction group is provided in the ALT memory in advance, and this process is performed for a specific area in the ALT memory. Can be reduced in time required.
【0017】この特定機能用命令群を準備するというこ
とは、ALT処理として判断やコマンド解析を行わなく
てよくなり、従ってレジスタ退避の削減やコマンド解析
等の処理の省略につながり、ALT処理時間の短縮が可
能となる。ただし、レジスタの退避は全く必要がないわ
けではなく、例えばメモリライトであればメモリライト
処理のために必要な数のレジスタの退避を行っている。
また、ALT処理を短縮するため、1バイトのメモリへ
のライト命令に必要最小限の命令の組合わせのみ使うよ
うにしているので、ALT処理の時間が短縮され、エミ
ュレーション中断の時間を抑えることができる。Preparing the instruction group for the specific function eliminates the need to perform judgment and command analysis as ALT processing, which leads to reduction of register save and omission of processing such as command analysis. Shortening becomes possible. However, it is not absolutely necessary to save the registers. For example, in the case of a memory write, the number of registers necessary for the memory write process is saved.
Also, in order to shorten the ALT processing, only the minimum necessary combination of instructions is used for a 1-byte write instruction to the memory, so that the ALT processing time is shortened and the emulation interruption time can be reduced. it can.
【0018】[0018]
【発明の実施の形態】次に本発明の実施の形態について
図面を参照して詳細に説明する。図1は本発明の一実施
の形態を示すブロック図である。この構成の中で本実施
の形態は2つの処理が中心となる。一つは、スーパバイ
ザCPU101にあるホストプログラム104が命令書
込み処理109によりALTメモリ102にあるALT
プログラム105メモリライトに必要な命令を書込んで
おく処理である。もう一つは、ホストプログラム104
からの割込み指示114を受けた割込み制御部107が
エミュレーションCPU103に対し割込みを出力11
5する処理である。これにより制御がユーザプログラム
106からALTプログラム105へ移行する(11
1)。Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a block diagram showing one embodiment of the present invention. In this configuration, two processes are mainly performed in this configuration. One is that the host program 104 in the supervisor CPU 101 executes the instruction writing process 109 to execute the ALT in the ALT memory 102.
This is a process of writing necessary instructions to the program 105 memory write. Another is the host program 104
The interrupt control unit 107 receives the interrupt instruction 114 from the CPU and outputs an interrupt to the emulation CPU 103.
5. As a result, the control shifts from the user program 106 to the ALT program 105 (11
1).
【0019】前述の処理で書込まれたメモリライト命令
を実行しエミュレーションメモリ108へデータを書込
み(110)、制御をユーザプログラムへ返す(11
2)。ここで、エミュレーションCPU103から出力
されるユーザプログラム実行中状態113をホストプロ
グラム104が確認する。この処理でホストプログラム
104は制御がALTプログラム105からユーザプロ
グラム106へ移行したことを認識する。The memory write instruction written in the above process is executed to write data to the emulation memory 108 (110), and control is returned to the user program (11).
2). Here, the host program 104 checks the user program execution state 113 output from the emulation CPU 103. In this process, the host program 104 recognizes that control has been transferred from the ALT program 105 to the user program 106.
【0020】次に、本実施形態の動作について図2のフ
ローチャートにより説明する。ホストプログラム201
では、まず、メモリライトコマンド202でライトを行
うバイト数およびライトするデータを受取る。次にAL
T処理部にメモリライト命令を書込み203を行う。こ
こでは、ALT処理部の特定メモリエリアに予めALT
が処理しなければならないメモリライトに関連するレジ
スタ退避211、メモリライト212、レジスタ復帰2
13、割込み復帰214の各命令を書込んでおく。次に
割込みが発生した時に処理が移行する場所が前述の手順
で書込んだ特定メモリエリアになるように、割込みベク
タを変更する(204)。また、変更前のベクタを保持
しておく。Next, the operation of this embodiment will be described with reference to the flowchart of FIG. Host program 201
First, the number of bytes to be written and the data to be written are received by the memory write command 202. Then AL
A memory write instruction is written 203 to the T processing unit. Here, ALT is stored in a specific memory area of the ALT processing unit in advance.
Register write 211, memory write 212, register restore 2 related to memory write that must be processed
13. Write each instruction of the interrupt return 214. Next, the interrupt vector is changed so that the location to which the processing shifts when an interrupt occurs is the specific memory area written in the above-described procedure (204). Also, the vector before the change is held.
【0021】ここで変更する割込みベクタは特定メモリ
エリアを示すアドレスであるのであらかじめデータとし
てホストプログラム内に記述されている。次に割込みを
発生させる(205)。ここでユーザプログラムからA
LTへ処理が移行され、エミュレーションが一時、中断
されたことになる。ALT処理210ではあらかじめ書
込まれたレジスタ退避211の命令とメモリライト21
2の命令とレジスタ復帰213の命令と、そして割込み
復帰214の命令が実行される。ここでは従来の技術に
あるような判断やコマンド解析は行われないため、AL
T処理が短縮されている。また、割込み復帰214によ
り処理がALT処理210からユーザプログラムへ帰
る。このときALT処理終了215をホストプログラム
が受付けホストプログラム処理を再開する。Since the interrupt vector to be changed is an address indicating a specific memory area, it is described in advance in the host program as data. Next, an interrupt is generated (205). Here, A from the user program
The processing is shifted to LT, and the emulation is temporarily suspended. In the ALT process 210, the instruction of the register save 211 written in advance and the memory write 21
2, the instruction of register return 213, and the instruction of interrupt return 214 are executed. Here, judgment and command analysis as in the prior art are not performed,
The T processing has been shortened. Further, the processing returns from the ALT processing 210 to the user program by the interrupt return 214. At this time, the host program accepts the ALT processing end 215 and restarts the host program processing.
【0022】この後、次の割込みを発生させるまで間隔
を空ける(206)。これは割込みが入ってエミュレー
ションが中断し、再び割込みが入るまでの時間を調整す
るために特定時間のウェイトを入れる処理である。次に
ALT処理210によるメモリライトを続けるかどうか
判断するため、メモリバイト数チェック207を行う。
ここで受取ったライトを行うバイト数をデクリメントし
ていき、ライトを行うバイト数の残りが有れば再び割込
みによるALT処理210を行い、残りが無ければ次の
処理を行う。メモリライトの処理が終了したら、割込み
ベクタを戻す(208)。以上のような流れを経てメモ
リライト終了(209)となる。Thereafter, an interval is provided until the next interrupt is generated (206). This is a process of inserting a wait for a specific time in order to adjust the time until the emulation is interrupted due to the interruption and the interruption is again entered. Next, a memory byte number check 207 is performed to determine whether to continue the memory write by the ALT process 210.
Here, the received number of bytes to be written is decremented. If there is a remaining number of bytes to be written, the ALT process 210 is again performed by the interrupt, and if there is no remaining, the next process is performed. When the memory write process is completed, the interrupt vector is returned (208). The memory write ends (209) through the above flow.
【0023】次に本発明の他の実施形態について図3の
ブロック図および図4のフローチャートにより詳細に説
明する。図3は図1を変形した構成を示しているが、こ
の構成の中で変形例では3つの処理が中心となる。一つ
は、スーパバイザCPU101にあるホストプログラム
104が命令書込み処理109によりALTメモリ10
2にあるALTプログラム105へメモリリードに必要
な命令を書込んでおく処理である。Next, another embodiment of the present invention will be described in detail with reference to the block diagram of FIG. 3 and the flowchart of FIG. FIG. 3 shows a configuration obtained by modifying FIG. 1. In this configuration, three processes are mainly performed in the modified example. One is that the host program 104 in the supervisor CPU 101 executes the instruction writing processing 109 to execute the ALT memory 10.
This is a process for writing an instruction necessary for memory read into the ALT program 105 in the second program.
【0024】もう一つは、ホストプログラム104から
出力される割込み指示113を受けた割込み制御部10
7がエミュレーションCPU103に対し割込み出力1
14する。これにより制御ユーザプログラム106から
ALTプログラム105へ移行される(110)。前述
の処理で書込まれたメモリリードを実行しエミュレーシ
ョンメモリ108からALTメモリのバッファ121に
データを読込み、制御をユーザプログラム106へ返す
(112)。ここで、エミュレーションCPU103か
ら出力されるユーザプログラム実行中状態113をホス
トプログラム104が確認する。この処理でホストプロ
グラム104は制御がALTプログラム105からユー
ザプログラム106へ移行したことを認識する。さらに
もう一つはALTのバッファの内容をホストプログラム
104へ読込む処理122である。The other is that the interrupt controller 10 receives an interrupt instruction 113 output from the host program 104.
7 is an interrupt output to the emulation CPU 103
14 As a result, the process is shifted from the control user program 106 to the ALT program 105 (110). The memory read written in the above process is executed to read data from the emulation memory 108 into the buffer 121 of the ALT memory, and control is returned to the user program 106 (112). Here, the host program 104 checks the user program execution state 113 output from the emulation CPU 103. In this process, the host program 104 recognizes that control has been transferred from the ALT program 105 to the user program 106. The other is a process 122 for reading the contents of the buffer of the ALT into the host program 104.
【0025】次に本実施形態の動作について図4により
説明する。ホストプログラム処理部201では、メモリ
リードコマンド202でリードを行うバイト数を受取
る。次にALT処理部にメモリリード命令を書込み20
3Aを行う。ここでは、ALT処理部の特定メモリエリ
アにあらかじめALTが処理しなければならないメモリ
リードに関連するレジスタ退避211、メモリリード2
12A、レジスタ復帰213、割込み復帰214の各命
令を書込んでおく。次に割込みが発生した時に処理が移
行する場所が前述の手順で書込んだ特定メモリエリアに
なるように、割込みベクタを変更する(204)。ま
た、変更前のベクタを保持する。ここで変更する割込み
ベクタは特定メモリエリアを示すアドレスであるのであ
らかじめデータとしてホストプログラム内に記述されて
いる。Next, the operation of this embodiment will be described with reference to FIG. The host program processing unit 201 receives the number of bytes to be read by the memory read command 202. Next, a memory read instruction is written to the ALT processing unit.
Perform 3A. Here, a register save 211 and a memory read 2 related to a memory read that must be processed by the ALT in advance in a specific memory area of the ALT processing unit.
Instructions of 12A, register return 213, and interrupt return 214 are written in advance. Next, the interrupt vector is changed so that the location to which the processing shifts when an interrupt occurs is the specific memory area written in the above procedure (204). Also, the vector before the change is retained. Since the interrupt vector to be changed is an address indicating a specific memory area, it is described in advance as data in the host program.
【0026】次に割込みを発生させる(205)。ここ
でユーザプログラムからALTへ処理が移行され、エミ
ュレーションが一時、中断されたことになる。ALT処
理210では予め書込まれたレジスタ退避211の命令
とメモリリード212Aの命令とレジスタ復帰213の
命令と、そして割込み復帰214の命令が実行される。
ここでは従来の技術にあるような判断やコマンド解析は
行われないため、ALT処理が短縮されている。割込み
復帰により処理がALT処理210からユーザプログラ
ムへ帰る。このときALT処理終了215をホストプロ
グラムが受付けてホストプログラム処理を再開する。こ
こでのメモリリード処理ではリードした内容をALTの
バッファに書込んでおく。Next, an interrupt is generated (205). Here, the processing is shifted from the user program to the ALT, and the emulation is temporarily suspended. In the ALT process 210, a pre-written instruction for register save 211, an instruction for memory read 212A, an instruction for register return 213, and an instruction for interrupt return 214 are executed.
Here, the ALT processing is shortened because the judgment and the command analysis as in the related art are not performed. The process returns from the ALT process 210 to the user program due to the return from the interrupt. At this time, the host program receives the ALT processing end 215 and restarts the host program processing. In this memory read process, the read contents are written in the buffer of the ALT.
【0027】この後次の割込みを発生させるまで間隔を
空ける(206)。これは割込みが入ってエミュレーシ
ョンが中断し、再び割込みが入るまでの時間を調整する
ために特定時間のウェイトを入れる処理である。次にA
LT処理210によるメモリリードを続けるかどうか判
断するため、メモリバイト数チェック207を行う。こ
こで受取ったリードを行うバイト数をデクリメントして
いき、残りが有れば再び割込みによるALT処理210
を行い、残りが無ければ次の処理を行う。メモリリード
の処理が終了したら割込みベクタを戻す(208)。次
にリードした内容を読込む(208A)。このときAL
Tが置かれている領域にあるバッファに書込まれたデー
タを読み出している。以上のような流れを経てメモリリ
ード終了209となる。Thereafter, an interval is provided until the next interrupt is generated (206). This is a process of inserting a wait for a specific time in order to adjust the time until the emulation is interrupted due to the interruption and the interruption is again entered. Then A
A memory byte number check 207 is performed to determine whether to continue the memory read by the LT process 210. Here, the number of bytes to be read received is decremented.
Is performed, and if there is no remaining, the next processing is performed. When the memory read processing is completed, the interrupt vector is returned (208). Next, the read contents are read (208A). At this time AL
The data written to the buffer in the area where T is located is read. Through the above flow, the memory read ends 209.
【0028】[0028]
【発明の効果】以上説明したように本発明によれば、A
LT処理で行わなければならないステップを短縮するこ
とにより、エミュレーション中断時間を短縮できること
にある。これはユーザプログラム実行中に割込を使用し
てALT処理を行った場合、ユーザプログラムに対する
ALT処理のための割込みによる中断時間が長いと制御
できなくなるアプリケーションを介しているユーザに適
用できる。As described above, according to the present invention, A
An emulation interruption time can be reduced by shortening the steps that must be performed in the LT processing. This is applicable to a user via an application that cannot be controlled if the interruption time due to the ALT processing for the user program is long when the ALT processing is performed using the interrupt during the execution of the user program.
【0029】特に、サーボ関連のアプリケーション開発
ではプログラムによりシビアなタイミングでシステムを
制御しているため、ユーザプログラムの割込みによる中
断が長いとシステム制御に支障をきたしてしまう。例え
ば、モータ制御のシステムの場合であれば、モータが焼
き付く可能性があるが、ここに本発明を適用すればエミ
ュレーション中断時間を意識することなく割込み処理を
行うことができるようになる。In particular, in the development of servo-related applications, the system controls the system at a severe timing by a program. Therefore, a long interruption by a user program interrupt will hinder system control. For example, in the case of a motor control system, there is a possibility that the motor is burned. However, if the present invention is applied here, the interrupt processing can be performed without being aware of the emulation interruption time.
【図1】本発明のエミュレーション方法を説明する実施
形態のブロック図である。FIG. 1 is a block diagram of an embodiment explaining an emulation method of the present invention.
【図2】図1の動作を説明するフローチャートである。FIG. 2 is a flowchart illustrating the operation of FIG.
【図3】本発明の他の実施形態のブロック図である。FIG. 3 is a block diagram of another embodiment of the present invention.
【図4】図3の動作を説明するフローチャートである。FIG. 4 is a flowchart illustrating the operation of FIG. 3;
【図5】従来の割込みを使用したメモリダンプ処理を示
すブロック図である。FIG. 5 is a block diagram showing a conventional memory dump process using an interrupt.
【図6】図5のメモリダンプ処理を説明するフローチャ
ートである。FIG. 6 is a flowchart illustrating a memory dump process of FIG. 5;
【図7】従来のモニタを使用した割込み処理を示すブロ
ック図である。FIG. 7 is a block diagram showing an interrupt process using a conventional monitor.
【図8】図7の動作を説明するフローチャートである。FIG. 8 is a flowchart illustrating the operation of FIG. 7;
【図9】従来のALTを使用した割込み処理を示すフロ
ーチャートである。FIG. 9 is a flowchart showing a conventional interrupt process using ALT.
101,701 スーパバイザCPU 102,702 ALTメモリ 103 エミュレーションCPU 104 ホストプログラム 105 ALTプログラム 106 ユーザプログラム 107 割込み制御部 108,710 エミュレーションメモリ 109 命令書込み処理 110 データ書込み 111 処理移行(ユーザプログラムからALT処
理) 112 処理移行(ALT処理からユーザプログラ
ム) 113 ユーザプログラム実行中状態 114 割込み指示 115 割込み出力 121 バッファ 122 データ読込み 201 ホストプログラム処理部 202 エモリライトコマンド 203 ALT処理部にメモリライト命令書込み 204 書込みベクタ変更及び保持 205 割込み発生 206 割込み間隔 207 メモリバイト数チェック 208 割込みベクタ復帰 208A リード内容読込み 209 メモリライト終了 210 ALT処理 211 レジスタ退避 212 メモリライト 212A メモリリード 213 レジスタ復帰 214 割込み復帰 215 ALT処理終了 501 本体処理装置 502 制御部 503 表示器 504 KB(キーボード) 505 プリンタ 506A〜C デバック用SW−A〜C 507 被デバッグ対象部 508A〜C 処理部A〜C 509A〜C トレース指示(処理部A〜C) 510A〜C 処理ID(処理部A〜C) 511 スイッチ状態チェック部 512 ダンプ処理部 513 デバッガー処理部 514 デバッガー 601,2 SW−A,B 603 処理ID 604 ダンプ(画面表示) 605 SW−C 703 スーパバイザエミュレーションCPU共有メ
モリ 704 DMA転送バッファメモリ 705 DMA転送制御回路 706 DMA状態情報線 707 DMA転送制御プログラム格納メモリ 708 エミュレーションCPUデータバス 709 エミュレーションCPUアドレスバス 711 ターゲットバスインターフェース 712 ターゲットプローブ 713 ターゲットメモリ 714 スーパバイザデータバス 715 スーパバイザアドレスバス 716 DMA転送情報線 717 エミュレーションモニタ格納メモリ 801 モニタ導入 802 割込み処理 803 コマンド解析 804 レジスタバンク切替え 805 レジスタ書込み読出し 806 メモリ書込み読出し 807 処理 808 モニタ脱出 901 メモリライトコマンド受付け 902 割込み発生 903 コマンド送付 904 レジスタ退避 905 コマンド解析 906 メモリライト処理 907 メモリリード処理 908 レジスタ復帰 909 割込み復帰 910 コマンドデータ101, 701 Supervisor CPU 102, 702 ALT memory 103 Emulation CPU 104 Host program 105 ALT program 106 User program 107 Interrupt control unit 108, 710 Emulation memory 109 Instruction writing processing 110 Data writing 111 Processing transition (ALT processing from user program) 112 Processing Transition (from ALT processing to user program) 113 User program executing state 114 Interrupt instruction 115 Interrupt output 121 Buffer 122 Data reading 201 Host program processing unit 202 Emory write command 203 Write memory write instruction to ALT processing unit 204 Change and hold write vector 205 Interrupt generation 206 Interrupt interval 207 Memory byte number check 208 Interrupt Vector return 208A Read contents read 209 Memory write end 210 ALT processing 211 Register save 212 Memory write 212A Memory read 213 Register return 214 Interrupt return 215 ALT processing end 501 Main processor 502 Control unit 503 Display 504 KB (keyboard) 505 Printer 506A CC Debugging SW-ACC 507 Debug target section 508AAC Processing section A〜C 509A〜C Trace instruction (processing section A〜C) 510A〜C Processing ID (processing section A〜C) 511 Switch state check Unit 512 Dump processing unit 513 Debugger processing unit 514 Debugger 601, SW-A, B 603 Process ID 604 Dump (screen display) 605 SW-C 703 Supervisor emulation CPU shared memory 7 4 DMA transfer buffer memory 705 DMA transfer control circuit 706 DMA status information line 707 DMA transfer control program storage memory 708 Emulation CPU data bus 709 Emulation CPU address bus 711 Target bus interface 712 Target probe 713 Target memory 714 Supervisor data bus 715 Supervisor address bus 716 DMA transfer information line 717 Emulation monitor storage memory 801 Monitor introduction 802 Interrupt processing 803 Command analysis 804 Register bank switching 805 Register writing / reading 806 Memory writing / reading 807 Processing 808 Monitor exit 901 Memory write command acceptance 902 Interrupt generation 903 Command sending 904 Register saving 905 Command analysis 906 Memory write processing 907 Memory read processing 908 Register return 909 Interrupt return 910 Command data
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 11/22 - 11/34 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 6 , DB name) G06F 11/22-11/34
Claims (4)
ストプログラムのインターフェースを制御するオルタネ
ート(以下ALTという)プログラムとを実行するエミ
ュレーションCPUと、前記ホストプログラムを実行す
るスパバイザCPUと、前記ホストプログラムから前記
ユーザプログラムへの割込み処理に先立って前記ホスト
プログラムにより割込みベクタを設定する割込みベクタ
設定手段と、前記割込み処理に先立ってホストプログラ
ムにより特定メモリエリアに命令を格納するオルタネー
ト(ALT)メモリとを有し、前記割込みベクタ設定手
段が、割込み処理に先立ってホストプログラムにより前
記ALTメモリにメモリライト命令を格納するようにし
たことを特徴とするエミュレーション装置。And emulation CPU for executing the alternate (hereinafter referred ALT) program for controlling the interface of the user program and the host program as claimed in claim 1 is an object to be inspected, and Supabaiza CPU for executing the host program, the from the host program and interrupt vector setting means for setting the interrupt vector by the host program before the interrupt processing to the user program, the host program before the interrupt processing
Alternate to store instructions in a specific memory area by a program
(ALT) memory, the interrupt vector setting means
Stage is preceded by the host program prior to interrupt processing.
The memory write instruction is stored in the ALT memory.
Emulation and wherein the a.
理に先立ってホストプログラムにより前記ALTメモリ
に、前記メモリライト命令の代りにメモリリード命令を
格納するようにした請求項1記載のエミュレーション装
置。Wherein said interrupt vector setting means, the ALT memory by the host program before the interrupt processing, the memory write instruction emulation device according to claim 1 which is adapted to store memory read instruction instead of.
う第1のステップと、前記割込み要求を受けてユーザプ
ログラムを停止する第2のステップと、前記ホストプロ
グラムからのコマンドをALTプログラムにより実行す
る第3のステップとにより割込み処理を行い、その割込
み処理に先立って割込みベクタを設定する第4のステッ
プとを有するエミュレーション方法において、メモリラ
イトコマンド受付けを行う第5のステップと、前記ホス
トプログラムにより特定メモリエリアのALTメモリに
メモリライト命令を格納する第6のステップと、前記割
込みベクタの変更および保持を行う第7のステップとを
含んでALT処理を行うことを特徴とするエミュレーシ
ョン方法。3. A first step of making an interrupt request by a host program, a second step of stopping the user program in response to the interrupt request, and a third step of executing a command from the host program by an ALT program. There line interrupt processing by the steps, in the emulation process and a fourth step of setting the interrupt vector prior to the interrupt <br/> untreated, scaled
A fifth step of accepting a write command,
ALT memory in a specific memory area
A sixth step of storing a memory write instruction;
And the seventh step of changing and holding the
An emulation method comprising performing ALT processing .
ト命令の代りに、メモリリード命令を格納する請求項3
記載のエミュレーション方法。 4. The method according to claim 1, wherein the sixth step is a step of
Instead of bets instruction, claim 3 for storing memory read command
The emulation method described.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7282935A JP2954006B2 (en) | 1995-10-31 | 1995-10-31 | Emulation device and emulation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7282935A JP2954006B2 (en) | 1995-10-31 | 1995-10-31 | Emulation device and emulation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH09128262A JPH09128262A (en) | 1997-05-16 |
| JP2954006B2 true JP2954006B2 (en) | 1999-09-27 |
Family
ID=17659025
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP7282935A Expired - Lifetime JP2954006B2 (en) | 1995-10-31 | 1995-10-31 | Emulation device and emulation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2954006B2 (en) |
-
1995
- 1995-10-31 JP JP7282935A patent/JP2954006B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH09128262A (en) | 1997-05-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH02171934A (en) | virtual computer system | |
| JPH06103472B2 (en) | Microprocessor for debugging | |
| JPH0679307B2 (en) | Coprocessor parallel operation control method | |
| JP2513417B2 (en) | Information processing device | |
| US5003468A (en) | Guest machine execution control system for virutal machine system | |
| EP0638864A1 (en) | Development support system for microcomputer with internal cache | |
| JP2954006B2 (en) | Emulation device and emulation method | |
| JPH0789328B2 (en) | Data processing device | |
| US7870311B2 (en) | Preemptive packet flow controller | |
| KR100223096B1 (en) | Method and apparatus for observing an internal memory map register | |
| JP3184380B2 (en) | Interrupt control method and multitask system for implementing the same | |
| JPH07152598A (en) | Incircuit emulator | |
| JP2584903B2 (en) | External device control method | |
| JP2000029508A (en) | Programmable controller | |
| US5680646A (en) | Input/output control system | |
| EP0445042A2 (en) | Microprocessor for evaluating an application system | |
| JPH0644193A (en) | I/o register access system | |
| JP2002244890A (en) | Recording device | |
| JPH08147184A (en) | emulator | |
| JPH11184712A (en) | Information processing device | |
| JPH02207340A (en) | Emulation system and emulator | |
| JPH05143718A (en) | Image processor | |
| JPH01302448A (en) | Information processor | |
| JPH09198277A (en) | Emulator device | |
| JPS62187959A (en) | Information processing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19990629 |