JPH01147638A - Instruction execution detector - Google Patents

Instruction execution detector

Info

Publication number
JPH01147638A
JPH01147638A JP62306396A JP30639687A JPH01147638A JP H01147638 A JPH01147638 A JP H01147638A JP 62306396 A JP62306396 A JP 62306396A JP 30639687 A JP30639687 A JP 30639687A JP H01147638 A JPH01147638 A JP H01147638A
Authority
JP
Japan
Prior art keywords
address
instruction
instruction code
output
microprocessor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP62306396A
Other languages
Japanese (ja)
Other versions
JP2535984B2 (en
Inventor
Kenichiro Kuno
久野 賢一郎
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric Corp
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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP62306396A priority Critical patent/JP2535984B2/en
Publication of JPH01147638A publication Critical patent/JPH01147638A/en
Application granted granted Critical
Publication of JP2535984B2 publication Critical patent/JP2535984B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To easily decide whether a microprocessor has executed a prescribed instruction or not by replacing forcibly the instruction code of an address to be executed and decided with another specific instruction code. CONSTITUTION:A comparison address generating circuit 4 detects a bus cycle where the instruction code of a designated address is prefetched by a microprocessor 1 and fetches forcibly the instruction code to be unconditionally branched to a known address into said bus cycle in place of the instruction code to be originally fetched. Then an address coincidence detecting circuit checks whether a branch address is delivered onto an address bus or not. When the address coincidence is detected, the original instruction code is fetched and at the same time a signal showing that a designated instruction code is carried out by the processor 1 is transmitted through a gate 11.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、命令プリフェッチを行うマイクロプロセッサ
用のインサーキット・エミュレータにおいて、プリフェ
ッチされた命令が実行処理に移ったかあるいは無視され
たかを判定するための装置に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention provides an in-circuit emulator for a microprocessor that performs instruction prefetching for determining whether a prefetched instruction has been moved to execution processing or ignored. Regarding the device.

[従来の技術] 最近の、特に16ビツト以上のマイクロプロセッサでは
その処理速度向上のため、命令プリフェッチを行うもの
が多い、このようなマイクロプロセッサは一般に命令キ
ューと呼ばれるバッファ・メモリを内蔵しており、実際
にマイクロプロセッサ内で実行されている命令より数バ
イト先までのアドレスの命令を取り込んでいる。
[Prior Art] Modern microprocessors, especially those with 16 bits or more, often perform instruction prefetching to improve processing speed. Such microprocessors generally have a built-in buffer memory called an instruction queue. , an instruction at an address up to several bytes ahead of the instruction actually being executed within the microprocessor is fetched.

ただし、命令キューに取り込まれた命令がすべて実行さ
れるとは限らず、JUMP命令等が実行された場合は、
命令キューをクリアして新たに命令を取り込む処理を行
う。したがって、このようなマイクロプロセッサに対応
するインサーキット・エミュレータでは、しばしばその
機能の一つとして、あるアドレスの命令が実際に実行さ
れたかあるいは命令キューから捨てられたかを実時間で
判断する回路を付加している。
However, not all instructions captured in the instruction queue will be executed, and if a JUMP instruction etc. is executed,
Clears the instruction queue and processes new instructions. Therefore, in-circuit emulators for such microprocessors often include a circuit that determines in real time whether an instruction at a certain address has been actually executed or discarded from the instruction queue. are doing.

一般にこの判断回路は、マイクロプロセッサが出力する
キューステータスを直接的に、あるいは全命令サイクル
数を登録したメモリを用意しこれを参照することによっ
て行う間接的な手法により、命令キューの内部状態を知
ることによって実現している。
Generally, this judgment circuit learns the internal state of the instruction queue either directly by the queue status output by the microprocessor, or indirectly by preparing a memory in which the total number of instruction cycles is registered and referring to it. This is achieved by

[発明が解決しようとする問題点コ しかしながら、中にはインテル社製80286や803
86のようにキューステータスを外部に出力しないマイ
クロプロセッサも現れており、このようなマイクロプロ
セッサは従来の方式が適用できないため、マイクロプロ
セッサの処理動作に影響を与えずに実時間で命令の実行
判断を行うことは困難である。
[Problems that the invention attempts to solve]However, some of the problems that the invention attempts to solve include
There are also microprocessors such as 86 that do not output queue status to the outside, and conventional methods cannot be applied to such microprocessors, so it is possible to determine the execution of instructions in real time without affecting the processing operations of the microprocessor. is difficult to do.

本発明の目的は、このような点に鑑みてなされたもので
、マイクロプロセッサ外部からの信号をモニタすること
によって、命令実行の判断ができないマイクロプロセッ
サに対して、実行判断をしようとするアドレスの命令コ
ードを強制的に別の特定命令コードに置き換えることに
よって、容易に命令実行の判断をすることのできる命令
実行検出装置を提供することにある。
An object of the present invention has been made in view of the above-mentioned points.The present invention has been made in view of the above-mentioned points, and is capable of determining the address of a microprocessor that is unable to determine whether to execute an instruction by monitoring signals from outside the microprocessor. An object of the present invention is to provide an instruction execution detection device that can easily determine instruction execution by forcibly replacing an instruction code with another specific instruction code.

[問題点を解決するための手段] この様な目的を達成するなめに、本発明では、命令1リ
フエツチを行うターゲット・マイクロプロセッサを搭載
するインサーキット・エミュレータにおいて、 前記マイクロプロセッサのステータス信号を基にして命
令コードフェッチのバスサイクルを示す信号を生成する
ステータスデコーダと、前記マイクロプロセッサのアド
レスバス上のアドレスと、与えられた比較アドレスとを
比較し、一致したときに一致信号を出力するアドレス一
致検出回路と、 前記ステータスデコーダの出力と前記アドレス一致検出
回路の出力とを基にして、命令注入サイクルを示す信号
と、命令注入後に同一アドレスの命令フェッチが発生す
るか否かを監視する期間を示す信号を生成するゲート信
号生成回路と、前記アドレス一致検出回路に与えるアド
レスを生成するものであって、通常は実行判断をしよう
とするアドレスを発生するが、前記ゲート信号生成回路
の出力に基づき命令注入サイクルがアクティブの期間の
み命令を注入しようとするアドレスを発生する比較アド
レス生成回路と、 前記アドレス一致検出回路の出力と前記ゲート信号生成
回路の出力とから命令スワップの期間を示す命令スワッ
プ信号を生成する手段と、前記命令注入サイクル中にデ
ータバス上に出力された本来の命令コードのフェッチを
禁止するためのバッファ手段と、 前記命令注入サイクル中に分岐命令コードをデータバス
上に出力する命令注入手段と、前記アドレス一致検出回
路の出力と、前記ゲート信号生成回路からの監視期間を
示す信号とから実行判断をしようとしたアドレスの命令
が実行されたことを示す信号を出力するゲート手段とを
具備したことを特徴とする。
[Means for Solving the Problems] In order to achieve such an object, the present invention provides an in-circuit emulator equipped with a target microprocessor that performs one-instruction refetch, based on the status signal of the microprocessor. a status decoder that generates a signal indicating the instruction code fetch bus cycle, and an address match that compares the address on the address bus of the microprocessor with the given comparison address and outputs a match signal when they match. a detection circuit; and a signal indicating an instruction injection cycle and a period for monitoring whether an instruction fetch of the same address occurs after instruction injection based on the output of the status decoder and the output of the address coincidence detection circuit. a gate signal generation circuit that generates a signal indicating the signal shown in FIG. a comparison address generation circuit that generates an address to which an instruction is to be injected only while the instruction injection cycle is active; and an instruction swap signal that indicates an instruction swap period from the output of the address match detection circuit and the output of the gate signal generation circuit. means for generating a branch instruction code on the data bus during the instruction injection cycle; buffer means for inhibiting fetching of the original instruction code output on the data bus during the instruction injection cycle; an instruction injection means, a gate means for outputting a signal indicating that an instruction at an address whose execution is to be determined has been executed based on an output of the address coincidence detection circuit and a signal indicating a monitoring period from the gate signal generation circuit; It is characterized by having the following.

[作用] 本発明では、指定したアドレスの命令コードがマイクロ
プロセッサによってプリフェッチされるバスサイクルを
検出し、本来フェッチされるべき命令コードの代わりに
既知のアドレスに無条件分岐する命令コードをそのバス
サイクル中に強制的にフェッチさせ、その後ある一定の
命令フェッチ回数の間に分岐先アドレスがアドレスバス
上に出力されるか否かをアドレス一致検出回路で検出し
、分岐が発生した場合は再び分岐命令を注入したアドレ
スから本来の命令コードをフェッチさせるようにし、前
記ゲート手段の出力信号によってプリフェッチされた指
定アドレスの命令コードがマイクロプロセッサ内の命令
実行部で処理されたかどうかを検知することができる。
[Operation] In the present invention, a bus cycle in which an instruction code at a specified address is prefetched by the microprocessor is detected, and an instruction code that unconditionally branches to a known address is inserted into that bus cycle instead of the instruction code that should be fetched. After that, an address match detection circuit detects whether the branch destination address is output on the address bus during a certain number of instruction fetches, and if a branch occurs, the branch instruction is fetched again. The original instruction code is fetched from the address injected, and it is possible to detect whether the instruction code at the prefetched specified address has been processed by the instruction execution unit in the microprocessor by the output signal of the gate means.

[実施例] 以下図面を参照して本発明の実施例を詳細に説明する。[Example] Embodiments of the present invention will be described in detail below with reference to the drawings.

第1図は本発明に係る命令実行検出装置の一実施例を示
す要部構成図である0図において、1はインサーキット
・エミュレータ上に搭載される命令プリフェッチを行う
タイプのターゲット・マイクロプロセッサである。2は
アドレスの一致を検出する一致検出回路、3はゲート信
号生成回路、4は比較アドレス生成回路、5は3ステー
ト・バッファ、6は命令注入ボート、7は分岐(J U
 M P )命令メモリ、8はアドレス・カウンタ、9
はステータス・デコーダ、10.11はゲートである。
FIG. 1 is a main part configuration diagram showing an embodiment of an instruction execution detection device according to the present invention. In FIG. be. 2 is a match detection circuit that detects address matching, 3 is a gate signal generation circuit, 4 is a comparison address generation circuit, 5 is a 3-state buffer, 6 is an instruction injection board, and 7 is a branch (J U
M P ) instruction memory, 8 is address counter, 9
is a status decoder, and 10.11 is a gate.

一致検出回路2は、マイクロプロセッサのアドレス・バ
ス(ADH3BUS)12上のアドレスと、比較アドレ
ス生成回路4から与えられるアドレスとを比較し、両者
が一致したとき一致信号ADRHITを出力する。
The match detection circuit 2 compares the address on the address bus (ADH3BUS) 12 of the microprocessor with the address given from the comparison address generation circuit 4, and outputs a match signal ADRHIT when the two match.

ゲート信号生成回路3は、ステータス・デコーダ9の出
力すなわち命令コードフェッチのバス・サイクルを示す
   CHCLK信号と、一致検出回路2の出力ADR
HI’T’とを基にして、命令注入サイクルを示す丁W
T下でYで信号と命令注入後に同一アドレスの命令フェ
ッチが発生するか否かを監視する期間を示すMON I
TCYC信号をそれぞれ生成する。
The gate signal generation circuit 3 receives the output of the status decoder 9, that is, the CHCLK signal indicating the instruction code fetch bus cycle, and the output ADR of the coincidence detection circuit 2.
Ding W indicating the instruction injection cycle based on HI'T'
MON I indicating the period of monitoring whether an instruction fetch of the same address occurs after signal and instruction injection at Y under T.
Generate TCYC signals respectively.

比較アドレス生成回路4は一致検出回路2に与える比較
アドレスを生成するものである。この比較アドレスは通
常は実行判断を試みようとするアドレスであるが、特に
前記5WAPCYCがアクティブの期間には命令を注入
しようとするアドレスを比較アドレスとする。
The comparison address generation circuit 4 generates a comparison address to be given to the match detection circuit 2. This comparison address is normally an address to which an execution determination is attempted, but especially during the period when the 5WAPCYC is active, the comparison address is an address to which an instruction is to be injected.

3ステート・バッファ5は、マイクロプロセッサのデー
タ・バス(DATA  BUS)13に接続され、ゲー
ト10の出力5WAPにより本来の命令コードのフェッ
チを禁止するように働く機能等を有する。
The three-state buffer 5 is connected to the data bus (DATA BUS) 13 of the microprocessor, and has a function of inhibiting the fetching of the original instruction code by the output 5WAP of the gate 10.

アドレス・カウンタ8は、ゲート信号生成回路3の出力
       およびステータス・デコーダ9の出力F
 E ’f’      を受け、丁WA丁でYでがア
クティブの期間中にT丁〒τ丁て丁てに同期してアドレ
スの更新を行なう。
The address counter 8 receives the output of the gate signal generation circuit 3 and the output F of the status decoder 9.
E 'f' is received, and the address is updated in synchronization with the T address while the Y is active in the WA address.

JUMP命令メモリ7は、アドレス・カウンタ8から与
えられるアドレスに対して、それと同一のアドレスに戻
るようなディスプレースメントを持つ相対JtJMP命
令コードが予め書き込まれているもので、その命令コー
ドは命令注入ボート6を介して、ゲート10の出力S 
W A P信号のタイミングでマイクロプロセッサのデ
ータ・バスDATA  BUS上に出力される。
The JUMP instruction memory 7 is pre-written with a relative JtJMP instruction code with a displacement such that the address given from the address counter 8 returns to the same address. 6, the output S of gate 10
It is output onto the data bus DATA BUS of the microprocessor at the timing of the W AP signal.

ゲート11は、一致検出回路2の出力 Ayr丁τT下とゲート信号生成回路3の出力MON 
I TCとの論理積をとり、実行判断をしようとしたア
ドレスの命令が実際に実行されたことを示すEXECU
TED信号を出力する。
The gate 11 is connected to the output Ayr τT of the coincidence detection circuit 2 and the output MON of the gate signal generation circuit 3.
EXECU performs logical AND with ITC and indicates that the instruction at the address for which execution was to be determined was actually executed.
Outputs TED signal.

このような構成における動作を次に説明する。The operation in such a configuration will be explained next.

ここでまず本発明の動イヤ原理について説明しておく、
説明を簡明にするために、マイクロプロセッサ内の命令
キューは4バイト、注入するJUMP命令は1バイト命
令と仮定する。一般に命令実行の判断が必要となる場合
は、例えば第2図のフローチャートにおけるアドレスN
のようなポイントである。すなわち、アドレスNの命令
Eはマイクロプロセッサのプリフェッチ処理により直前
の条件分岐命令りの実行処理の前に命令キュー内に取り
込まれるが、命令りの実行結果によっては実行されるこ
となく命令キューがクリアされる場合があるからである
First, I will explain the principle of the moving ear of the present invention.
To simplify the explanation, it is assumed that the instruction queue in the microprocessor is 4 bytes and the JUMP instruction to be injected is 1 byte. Generally, when it is necessary to judge whether to execute an instruction, for example, address N in the flowchart of FIG.
This is a point like this. In other words, the instruction E at address N is fetched into the instruction queue by the microprocessor's prefetch processing before the execution of the immediately preceding conditional branch instruction, but depending on the execution result of the instruction, the instruction queue may be cleared without being executed. This is because there are cases where

そこで本発明て゛は、第3図の(イ)で示すように判断
しようとするアドレスNの命令として、同一アドレスに
無条件分岐する命令(相対ジャンプ命令: JMP、N
)を強制的にフェッチさせる。
Therefore, in the present invention, an instruction (relative jump instruction: JMP, N
) is forced to be fetched.

そしてプログラム処理が進み第3図(ロ)のように条件
分岐命令りが実行ユニットに移った後、分岐が発生すれ
ば、同図(ニ)のように命令キューがクリアされて分岐
アドレスN+3の命令Hが新たに命令キュー内に取り込
まれる。
As the program processing progresses and the conditional branch instruction is transferred to the execution unit as shown in Figure 3 (B), if a branch occurs, the instruction queue is cleared and the branch address N+3 is cleared as shown in Figure 3 (D). Instruction H is newly taken into the instruction queue.

一方、命令りの分岐が生じなかった場合は、第3図(ホ
)のように命令キューがクリアされて分岐先アドレスN
の命令Eが新たに取り込まれるようになる。
On the other hand, if no instruction branch occurs, the instruction queue is cleared and the branch destination address N
instruction E is newly imported.

したがって、相対ジャンプ命令注入の後、命令キューの
容量に相当するバスサイクルの期間中に再度アドレスN
のフェッチサイクルか発生すれば、アドレスNの命令E
は確実に実行される命令と判断できる。この時、注入し
たJMP、Hの命令を実行する時間だけのロス・タイム
が発生するが、10グラム全体の処理時間を考えると無
視できる場合力積1とんどである。
Therefore, after the relative jump instruction injection, the address N is re-injected during the bus cycle period corresponding to the capacity of the instruction queue.
If a fetch cycle occurs, the instruction E at address N
can be determined to be an instruction that will definitely be executed. At this time, a loss time corresponding to the time required to execute the injected JMP and H instructions occurs, but if the processing time of the entire 10 grams is considered, it is negligible if the impulse is 1 or so.

注入するJUMP命令が2バイト以上の場合でも基本的
には同じである。しかし、命令注入期間中に先にフェッ
チした分岐命令による分岐が発生した場合には命令注入
を中止する必要がある。そのため、命令注入アドレスを
モニタする回路が必要とされる。“ さて、第1図の動作について第4図のタイムチャートを
参照して以下に説明する0本実施例では相対JUMP命
令の注入に2バスサイクルを要するものとする。実行判
断を行なおうとするアドレスをNとした場合、比較アド
レス生成回路4からはINが比較アドレスとして出力さ
れており、プリフェッチのためマイクロプロセッサ1が
アドレスバス上にNのアドレスを出力したバスサイクル
で一致検出回路2の出力ADR丁丁TTが第4図(ニ)
に示すようにアクティブとなる。ゲート信号生成回路3
は、この信号から相対JUMP命令の注入に必要なバス
サイクル分の5WAPCYC信号(同図(ホ))を生成
し、ゲート10に与える。
This is basically the same even if the JUMP instruction to be injected is 2 bytes or more. However, if a branch due to a previously fetched branch instruction occurs during the instruction injection period, it is necessary to stop instruction injection. Therefore, a circuit that monitors the instruction injection address is required. “Now, the operation of FIG. 1 will be explained below with reference to the time chart of FIG. 4. In this embodiment, it is assumed that two bus cycles are required to inject a relative JUMP instruction. When the address is N, the comparison address generation circuit 4 outputs IN as the comparison address, and the match detection circuit 2 outputs the bus cycle in which the microprocessor 1 outputs the address N on the address bus for prefetching. ADR Ding Ding TT is shown in Figure 4 (D)
It becomes active as shown in . Gate signal generation circuit 3
generates from this signal a 5WAPCYC signal ((e) in the figure) for the bus cycle required for injecting the relative JUMP instruction, and supplies it to the gate 10.

この       信号がアクティブになっている期間
に発生した命令フェッチバスサイクルでは、前記A  
R3HI下信号上の論理積で得られるSWw下℃号によ
ってDATA  BUS13上に同図(ヌ)のようにJ
MPO、JMPlで示される相対JUMP命令が出力さ
れる。
In the instruction fetch bus cycle that occurs while this signal is active, the A
The SWw lower ℃ signal obtained by the logical product on the R3HI lower signal causes J on the DATA BUS13 as shown in the same figure.
Relative JUMP instructions indicated by MPO and JMPl are output.

相対JUMP命令の注入が終了すると、ゲート信号生成
回路3は再びADDRES  BUS上にNのアドレス
が出現することを監視する期間を定めるMOゲート信号
を生成する。
When the injection of the relative JUMP command ends, the gate signal generation circuit 3 again generates the MO gate signal that defines the period for monitoring the appearance of address N on the ADDRES BUS.

MON I     ゲート信号がアクティブの期間中
にアドレス一致検出回路の出力するADH3HIT信号
がアクティブとなった場合のみ、アドレスNの命令がマ
イクロプロセッサ内で実行されることが確定したことを
示す EXECUTED信号がアクティブとなる。
Only when the ADH3HIT signal output from the address match detection circuit becomes active while the MON I gate signal is active, the EXECUTED signal, which indicates that the instruction at address N is confirmed to be executed in the microprocessor, becomes active. becomes.

ここで、5WAPCYCアクテイブの期間中にマイクロ
プロセッサ内の実行ユニットが分岐命令を実行した場合
を考える必要がある。この場合、5WAPCYCを直ち
に取り消して命令注入を中止させなくてはならない、そ
のため、 5WAPCYC期間中は、アドレス−数種出回路2に与
えられるアドレスをJMPlの命令のアドレスN +1
としておき、分岐が発生してN+1以外のアドレスの命
令フェッチが生じた時は、ADR3HIT信号がネガテ
ィブの、tまであることを検知して、ゲート信号生成回
路3がS W A P CY Cを取り消す。第4図で
はこの時の様子を破線で示している。
Here, it is necessary to consider the case where the execution unit in the microprocessor executes a branch instruction during the 5WAPCYC active period. In this case, 5WAPCYC must be canceled immediately to stop the instruction injection. Therefore, during the 5WAPCYC period, the address given to the address-number output circuit 2 is changed to the address N + 1 of the JMPl instruction.
Assuming that, when a branch occurs and an instruction fetch at an address other than N+1 occurs, the gate signal generation circuit 3 detects that the ADR3HIT signal is negative and is up to t, and cancels SW A P CY C. . In FIG. 4, the situation at this time is shown by broken lines.

以上述べたように、プリフェッチされた指定アドレスの
命令コードがマイクロプロセッサ内の命令実行部で処理
されたことをマイクロプロセッサのバス信号から判断す
ることができる。
As described above, it can be determined from the microprocessor's bus signal that the prefetched instruction code at the specified address has been processed by the instruction execution unit within the microprocessor.

なお、本発明は上記の実施例に限定されるものではなく
、次のようにすることもできる。
It should be noted that the present invention is not limited to the above-mentioned embodiments, but can also be modified as follows.

■相対JUMP命令の注入が1バスサイクルで終了する
ようなマイクロプロセッサの場合は、第1図におけるア
ドレスカウンタおよびJUMP命令メモリが不要となり
、命令注入ボート6に直接相対JtJMP命令コードを
与えることができ、また■実施例では実行判定をしよう
とするアドレスが1点の場合であるが、アドレス空間上
の複数点で実行判定を行う場合には1ビ・ットxnli
成のRAM51をアドレスバスに接続し、予め”1″(
あるいは”0°°)を書き込んでいたアドレスがマイク
ロプロセッサによってアクセスされた時に、アドレス−
数構出を行う方法がある。
■In the case of a microprocessor in which injection of a relative JUMP instruction is completed in one bus cycle, the address counter and JUMP instruction memory shown in FIG. 1 are unnecessary, and the relative JtJMP instruction code can be directly given to the instruction injection board 6. , In addition, in the embodiment, the number of addresses for which execution determination is to be made is one point, but when execution determination is made at multiple points in the address space, 1 bit xnli is used.
Connect the RAM 51 of the configuration to the address bus, and set it to “1” (
Or when the address that was writing "0°°" is accessed by the microprocessor, the address -
There is a way to make several numbers.

この場合は、第5図に示すような構成として。In this case, the configuration is as shown in FIG.

5WAPCYC中で命令注入アドレスの一致を示す5W
APHIT信号と、実効判定アドレスの一致を示すAD
H3HI’T’信号とを分離できるようにする必要があ
る。
5W indicating a match of instruction injection address in 5WAPCYC
AD indicating a match between the APHIT signal and the effective determination address
It is necessary to be able to separate the H3HI'T' signal.

■注入する命令は、同一アドレスへの相対JtJMP命
令以外に、第6図に示すように固定アドレスへの絶対J
UMP命令でも良い。その時は、JUMP先で再び命令
注入したアドレスへ戻すためのJ’UMP命令を実行さ
せる。アドレス一致の検出はJUMP先アドレスの出現
を監視することによって行う。
■ In addition to relative JtJMP instructions to the same address, the instructions to be injected are absolute JtJMP instructions to a fixed address as shown in Figure 6.
A UMP command may also be used. At that time, a J'UMP instruction is executed to return to the address where the instruction was injected at the JUMP destination. Address matching is detected by monitoring the appearance of the JUMP destination address.

[発明の効果] 以上説明したように、本発明によれば、マイクロプロセ
ッサの外部からステータス信号をモニタするだけでは指
定したアドレスの命令実行の判断ができないマイクロプ
ロセッサであっても、プリフェッチする時に既知のアド
レスへ分岐する命令を注入しておき、その分岐先アドレ
スをマイクロプロセッサがアクセスするか否かで実行判
断ができるようになるので、インサーキット・エミュレ
ータにおいて指定アドレスの命令実行時にごく僅かの無
効処理時間が追加されるだけで、プログラムアドレスを
イベント条件とする各種のデバッグをほぼリアルタイム
で実現することができる。
[Effects of the Invention] As described above, according to the present invention, even if a microprocessor cannot determine whether to execute an instruction at a specified address by simply monitoring the status signal from outside the microprocessor, the known By injecting an instruction to branch to the specified address, execution can be determined based on whether or not the microprocessor accesses the branch destination address. Therefore, when the in-circuit emulator executes the instruction at the specified address, there is a very small amount of invalidity. By simply adding processing time, it is possible to perform various types of debugging using program addresses as event conditions in almost real time.

例えば、高級言語デバッグにおいて、各ラインN O、
あるいは関数モジュール名に対応するアドレスをサンプ
ル条件としてトレースを行えば、リアルタイムラインN
O,トレース等が可能となる。
For example, in high-level language debugging, each line N O,
Alternatively, if you trace using the address corresponding to the function module name as a sample condition, real-time line N
O, tracing, etc. becomes possible.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明に係る命令実行検出装置の一実施例を示
す要部構成図、第2図は実行プログラムのフローの一例
を示す図、第3図は本発明の動作原理を説明するための
図、第4図は第1図の構成における動作のタイムチャー
ト、第5図は本発明の他の実施例の要部構成図、第6図
は本発明の他の実施例を説明するための説明図である。 1・・・ターゲット・マイクロプロセッサ、2・・・ア
ドレス−数種出回路、3・・・ゲート信号生成回路、4
・・・比較アドレス生成回路、5・・・3ステート・バ
ッファ、6・・・命令注入ポート、7・・・JUMP命
令メモリ、8・・・アドレス・カウンタ、9・・・ステ
ータス・デコーダ、10.11・・・ゲート、12・・
・アドレス・バス、13・・・データ・バス。
FIG. 1 is a main part configuration diagram showing an embodiment of an instruction execution detection device according to the present invention, FIG. 2 is a diagram showing an example of the flow of an execution program, and FIG. 3 is a diagram for explaining the operating principle of the present invention. , FIG. 4 is a time chart of the operation in the configuration of FIG. 1, FIG. 5 is a block diagram of main parts of another embodiment of the present invention, and FIG. 6 is for explaining another embodiment of the present invention. FIG. 1...Target microprocessor, 2...Address-several output circuit, 3...Gate signal generation circuit, 4
... Comparison address generation circuit, 5 ... 3-state buffer, 6 ... Instruction injection port, 7 ... JUMP instruction memory, 8 ... Address counter, 9 ... Status decoder, 10 .11...gate, 12...
-Address bus, 13...data bus.

Claims (1)

【特許請求の範囲】 命令プリフェッチを行うターゲット・マイクロプロセッ
サを搭載するインサーキット・エミュレータにおいて、 前記マイクロプロセッサのステータス信号を基にして命
令コードフェッチのバスサイクルを示す信号を生成する
ステータスデコーダと、 前記マイクロプロセッサのアドレスバス上のアドレスと
、与えられた比較アドレスとを比較し、一致したときに
一致信号を出力するアドレス一致検出回路と、 前記ステータスデコーダの出力と前記アドレス一致検出
回路の出力とを基にして、命令注入サイクルを示す信号
と、命令注入後に同一アドレスの命令フェッチが発生す
るか否かを監視する期間を示す信号を生成するゲート信
号生成回路と、前記アドレス一致検出回路に与えるアド
レスを生成するものであって、通常は実行判断をしよう
とするアドレスを発生するが、前記ゲート信号生成回路
の出力に基づき命令注入サイクルがアクティブの期間の
み命令を注入しようとするアドレスを発生する比較アド
レス生成回路と、 前記アドレス一致検出回路の出力と前記ゲート信号生成
回路の出力とから命令スワップの期間を示す命令スワッ
プ信号を生成する手段と、 前記命令注入サイクル中にデータバス上に出力された本
来の命令コードのフェッチを禁止するためのバッファ手
段と、 前記命令注入サイクル中に分岐命令コードをデータバス
上に出力する命令注入手段と、 前記アドレス一致検出回路の出力と、前記ゲート信号生
成回路からの監視期間を示す信号とから実行判断をしよ
うとしたアドレスの命令が実行されたことを示す信号を
出力するゲート手段とを具備し、指定したアドレスの命
令コードがマイクロプロセッサによってプリフェッチさ
れるバスサイクルを検出し、本来フェッチされるべき命
令コードの代わりに既知のアドレスに無条件分岐する命
令コードをそのバスサイクル中に強制的にフェッチさせ
、その後ある一定の命令フェッチ回数の間に分岐先アド
レスがアドレスバス上に出力されるか否かをアドレス一
致検出回路で検出し、分岐が発生した場合は再び分岐命
令を注入したアドレスから本来の命令コードをフェッチ
させるようにし、前記ゲート手段の出力信号によってプ
リフェッチされた指定アドレスの命令コードがマイクロ
プロセッサ内の命令実行部で処理されたかどうかを検知
することができるようにしたことを特徴とする命令実行
検出装置。
[Scope of Claims] An in-circuit emulator equipped with a target microprocessor that performs instruction prefetch, comprising: a status decoder that generates a signal indicating a bus cycle for instruction code fetch based on a status signal of the microprocessor; an address match detection circuit that compares an address on the address bus of the microprocessor with a given comparison address and outputs a match signal when they match; and an output of the status decoder and an output of the address match detection circuit. a gate signal generation circuit that generates a signal indicating an instruction injection cycle and a signal indicating a period for monitoring whether or not an instruction fetch of the same address occurs after instruction injection; and an address given to the address coincidence detection circuit. Normally, it generates an address at which an execution decision is to be made, but based on the output of the gate signal generation circuit, it generates an address at which an instruction is to be injected only while the instruction injection cycle is active. an address generation circuit; means for generating an instruction swap signal indicating an instruction swap period from an output of the address match detection circuit and an output of the gate signal generation circuit; buffer means for inhibiting the fetching of the original instruction code; instruction injection means for outputting the branch instruction code onto the data bus during the instruction injection cycle; an output of the address match detection circuit; and the gate signal generation circuit. and a gate means for outputting a signal indicating that an instruction at an address whose execution is to be determined has been executed, and an instruction code at a specified address is prefetched by a microprocessor. Detects a cycle, forces an instruction code that causes an unconditional branch to a known address to be fetched during that bus cycle instead of the instruction code that should have been fetched, and then updates the branch destination address for a certain number of instruction fetches. An address match detection circuit detects whether or not the instruction code is output on the address bus, and when a branch occurs, the original instruction code is fetched again from the address where the branch instruction is injected, and the output signal of the gate means is An instruction execution detection device characterized in that it is capable of detecting whether an instruction code at a specified address prefetched by an instruction code has been processed by an instruction execution unit in a microprocessor.
JP62306396A 1987-12-03 1987-12-03 Instruction execution detector Expired - Fee Related JP2535984B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62306396A JP2535984B2 (en) 1987-12-03 1987-12-03 Instruction execution detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62306396A JP2535984B2 (en) 1987-12-03 1987-12-03 Instruction execution detector

Publications (2)

Publication Number Publication Date
JPH01147638A true JPH01147638A (en) 1989-06-09
JP2535984B2 JP2535984B2 (en) 1996-09-18

Family

ID=17956512

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62306396A Expired - Fee Related JP2535984B2 (en) 1987-12-03 1987-12-03 Instruction execution detector

Country Status (1)

Country Link
JP (1) JP2535984B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59183445A (en) * 1983-04-01 1984-10-18 Mitsubishi Electric Corp Data processor
JPS6225339A (en) * 1985-07-25 1987-02-03 Yokogawa Electric Corp In-circuit emulator

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59183445A (en) * 1983-04-01 1984-10-18 Mitsubishi Electric Corp Data processor
JPS6225339A (en) * 1985-07-25 1987-02-03 Yokogawa Electric Corp In-circuit emulator

Also Published As

Publication number Publication date
JP2535984B2 (en) 1996-09-18

Similar Documents

Publication Publication Date Title
EP1012705B1 (en) Data processing device
US5961637A (en) Split branch system utilizing separate set branch, condition and branch instructions and including dual instruction fetchers
US5560036A (en) Data processing having incircuit emulation function
US5715440A (en) Branch instruction executing device for tracing branch instruments based on instruction type
US7533302B2 (en) Trace and debug method and system for a processor
US6591378B1 (en) Debug controller in a data processor and method therefor
US6289445B2 (en) Circuit and method for initiating exception routines using implicit exception checking
EP2220556B1 (en) A method and a system for accelerating procedure return sequences
JP2001525568A (en) Instruction decoder
EP0227117A2 (en) Program skip operation control system
US6189093B1 (en) System for initiating exception routine in response to memory access exception by storing exception information and exception bit within architectured register
US5301285A (en) Data processor having two instruction registers connected in cascade and two instruction decoders
EP1770507A2 (en) Pipeline processing based on RISC architecture
CA2003004C (en) Apparatus and method for executing a conditional branch instruction
US20080065870A1 (en) Information processing apparatus
JPH01147638A (en) Instruction execution detector
US20010007125A1 (en) Computer system with debug facility
JP2002535749A (en) Processor and method for executing instructions from multiple instruction sources
US5838961A (en) Method of operation and apparatus for optimizing execution of short instruction branches
JP2646957B2 (en) Microprocessor with built-in cache and its trace system
US7240185B2 (en) Computer system with two debug watch modes for controlling execution of guarded instructions upon breakpoint detection
KR100631318B1 (en) Method and instruction decoder for processing conditional jump instruction in a processor with pipelined architecture
EP0525672A2 (en) Microprocessor with program tracing
JPH06103109A (en) Data processor and debugging device using the same
EP1069499A2 (en) Data processing apparatus and method for simultaneously executing plural instructions

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees