JP2535984B2 - Instruction execution detector - Google Patents

Instruction execution detector

Info

Publication number
JP2535984B2
JP2535984B2 JP62306396A JP30639687A JP2535984B2 JP 2535984 B2 JP2535984 B2 JP 2535984B2 JP 62306396 A JP62306396 A JP 62306396A JP 30639687 A JP30639687 A JP 30639687A JP 2535984 B2 JP2535984 B2 JP 2535984B2
Authority
JP
Japan
Prior art keywords
instruction
address
output
microprocessor
signal
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 - Fee Related
Application number
JP62306396A
Other languages
Japanese (ja)
Other versions
JPH01147638A (en
Inventor
賢一郎 久野
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

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、命令プリフェッチを行うマイクロプロセッ
サ用のインサーキット・エミュレータにおいて、プリフ
ェッチされた命令が実行処理に移ったかあるいは無視さ
れたかを判定するための装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial application] The present invention is for determining whether a prefetched instruction is transferred to an execution process or ignored in an in-circuit emulator for a microprocessor that performs instruction prefetch. Of equipment.

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

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

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

[発明が解決しようとする問題点] しかしながら、中にはインテル社製80286や80386のよ
うにキューステータスを外部に出力しないマイクロプロ
セッサも現れており、このようなマイクロプロセッサは
従来の方式が適用できないため、マイクロプロセッサの
処理動作に影響を与えずに実時間で命令の実行判断を行
うことは困難である。
[Problems to be Solved by the Invention] However, some microprocessors, such as Intel's 80286 and 80386, which do not output the queue status to the outside have appeared, and the conventional method cannot be applied to such a microprocessor. Therefore, it is difficult to determine the instruction execution in real time without affecting the processing operation of the microprocessor.

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

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

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

[実施例] 以下図面を参照して本発明の実施例を詳細に説明す
る。第1図は本発明に係る命令実行検出装置の一実施例
を示す要部構造図である。図において、1はインサーキ
ット・エミュレータ上に搭載される命令プリフェッチを
行うタイプのターゲット・マイクロプロセッサである。
2はアドレスの一致を検出する一致検出回路、3はゲー
ト信号生成回路、4は比較アドレス生成回路、5は3ス
テート・バッファ、6は命令中ポート、7は分岐(JUM
P)命令メモリ、8はアドレス・カウンタ、9はステー
タス・デコーダ、10,11はゲートである。
Embodiments Embodiments of the present invention will be described in detail below with reference to the drawings. FIG. 1 is a structural diagram of a main part showing an embodiment of an instruction execution detecting device according to the present invention. In the figure, reference numeral 1 is a target microprocessor of the type which is mounted on an in-circuit emulator and performs instruction prefetch.
2 is a coincidence detection circuit for detecting address coincidence, 3 is a gate signal generation circuit, 4 is a comparison address generation circuit, 5 is a 3-state buffer, 6 is an instruction port, and 7 is a branch (JUM).
P) instruction memory, 8 is an address counter, 9 is a status decoder, and 10 and 11 are gates.

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

ゲート信号生成回路3は、ステータス・デコーダ9の
出力すなわち命令コードフェッチのバス・サイクルを示
す▲▼信号と、一致検出回路2の出力
▲▼とを基にして、命令注入サイクルを示
す▲▼信号と命令注入後に同一アドレス
の命令フェッチが発生するか否かを監視する期間を示す
▲▼信号をそれぞれ生成する。
The gate signal generation circuit 3 indicates the instruction injection cycle based on the output of the status decoder 9, that is, the signal indicating the instruction code fetch bus cycle, and the output of the coincidence detection circuit 2. And a signal indicating the period for monitoring whether or not an instruction fetch of the same address occurs after the instruction injection is generated.

比較アドレス生成回路4は一致検出回路2に与える比
較アドレスを生成するものである。この比較アドレスは
通常は実行判断を試みようとするアドレスであるが、特
に前記▲▼がアクティブの期間には命令
を注入しようとするアドレスを比較アドレスとする。
The comparison address generation circuit 4 generates a comparison address to be given to the match detection circuit 2. This comparison address is usually an address for which execution judgment is to be attempted, but an address for which an instruction is to be injected is used as a comparison address, especially when the above-mentioned {circle around ()} is active.

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

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

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

ゲート11は、一致検出回路2の出力▲
▼とゲート信号生成回路3の出力▲▼
との論理積をとり、実行判断をしようとしたアドレスの
命令が実際に実行されたことを示す▲
▼信号を出力する。
The gate 11 outputs the output of the coincidence detection circuit 2
▼ and the output of the gate signal generation circuit 3 ▲ ▼
And indicates that the instruction at the address for which the execution decision was made was actually executed.
▼ Output a signal.

このような構成における動作を次に説明する。ここで
まず本発明の動作原理について説明しておく。説明を簡
明にするために、マイクロプロセッサ内の命令キューは
4バイト、注入するJUMP命令は1バイト命令と仮定す
る。一般に命令実行の判断が必要となる場合は、例えば
第2図のフローチャートにおけるアドレスNのようなポ
イントである。すなわち、アドレスNの命令Eはマイク
ロプロセッサのプリフェッチ処理により直前の条件分岐
命令Dの実行処理の前に命令のキュー内に取り込まれる
が、命令Dの実行結果によっては実行されることなく命
令キューがクリアされる場合があるからである。
The operation in such a configuration will be described below. First, the operating principle of the present invention will be described. For simplicity of explanation, it is assumed that the instruction queue in the microprocessor is 4 bytes and the injected JUMP instruction is 1 byte. Generally, when it is necessary to judge the execution of an instruction, it is a point such as address N in the flowchart of FIG. That is, the instruction E of the address N is taken into the instruction queue by the prefetch processing of the microprocessor before the execution processing of the immediately preceding conditional branch instruction D, but the instruction queue is not executed depending on the execution result of the instruction D. This is because it may be cleared.

そこで本発明では、第3図の(イ)で示すように判断
しようとするアドレスNの命令として、同一アドレスに
無条件分岐する命令(相対ジャンプ命令:JMP.N)を強制
的にフェッチさせる。そしてプログラム処理が進み第3
図(ロ)のように条件分岐命令Dが実行ユニットに移っ
た後、分岐が発生すれば、同図(ニ)のように命令キュ
ーがクリアされて分岐アドレスN+3の命令Hが新たに
命令キュー内に取り込まれる。
Therefore, in the present invention, as the instruction of the address N to be judged as shown in FIG. 3B, the instruction (relative jump instruction: JMP.N) for unconditionally branching to the same address is forcibly fetched. Then the program processing proceeds and the third
If a branch occurs after the conditional branch instruction D moves to the execution unit as shown in FIG. 6B, the instruction queue is cleared and the instruction H at branch address N + 3 is newly added to the instruction queue as shown in FIG. Taken in.

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

したがって、相対ジャンプ命令注入の後、命令キュー
の容量に相当するバスサイクルの期間中に再度アドレス
Nのフェッチサイクルが発生すれば、アドレスNの命令
Eは確実に実行される命令と判断できる。この時、注入
したJMP.Nの命令を実行する時間だけのロス・タイムが
発生するが、プログラム全体の処理時間を考えると無視
できる場合がほとんどである。
Therefore, if the fetch cycle of the address N occurs again during the bus cycle corresponding to the capacity of the instruction queue after the injection of the relative jump instruction, the instruction E of the address N can be determined to be the instruction to be surely executed. At this time, a loss time corresponding to the time to execute the injected JMP.N instruction occurs, but in most cases it can be ignored considering the processing time of the entire program.

注入するJUMP命令が2バイト以上の場合でも基本的に
は同じである。しかし、命令注入期間中に先にフェッチ
した分岐命令による分岐が発生した場合には命令注入を
中止する必要がある。そのため、命令注入アドレスをモ
ニタする回路が必要とされる。
It is basically the same even if the injected JUMP instruction is 2 bytes or more. However, it is necessary to stop the instruction injection when the branch by the previously fetched branch instruction occurs during the instruction injection period. Therefore, a circuit for monitoring the instruction injection address is needed.

さて、第1図の動作について第4図のタイムチャート
を参照して以下に説明する。本実施例では相対JUMP命令
の注入に2バスサイクルを要するものとする。実行判断
を行なおうとするアドレスをNとした場合、比較アドレ
ス生成回路4からは値Nが比較アドレスとして出力され
ており、プリフェッチのためマイクロプロセッサ1がア
ドレスバス上にNのアドレスを出力したバスサイクルで
一致検出回路2の出力▲▼が第4図
(ニ)に示すようにアクティブとなる。ゲート信号生成
回路3は、この信号から相対JUMP命令の注入に必要なバ
スサイクル分の▲▼信号(同図(ホ))
を生成し、ゲート10に与える。
Now, the operation of FIG. 1 will be described below with reference to the time chart of FIG. In this embodiment, it is assumed that two bus cycles are required to inject the relative JUMP instruction. When the address for which execution determination is to be made is N, the value N is output from the comparison address generation circuit 4 as the comparison address, and the microprocessor 1 outputs the address N on the address bus for prefetch. In the cycle, the output ▲ ▼ of the coincidence detection circuit 2 becomes active as shown in FIG. From this signal, the gate signal generation circuit 3 outputs a ▲ ▼ signal for the bus cycle necessary for injecting the relative JUMP instruction ((e) in the figure).
Is generated and given to the gate 10.

この▲▼信号がアクティブになってい
る期間に発生した命令フェッチバスサイクルでは、前記
▲▼信号との論理積で得られる▲
▼信号によってDATA BUS13上に同図(ヌ)のようにJ
MP0,JMP1で示される相対JUMP命令が出力される。
In the instruction fetch bus cycle that occurs during the period in which this signal is active, it is obtained by the logical product with the above signal.
▼ Depending on the signal, J on DATA BUS 13 as shown in the figure
The relative JUMP instruction indicated by MP0 and JMP1 is output.

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

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

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

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

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

相対JUMP命令の注入が1バスサイクルで終了するよう
なマイクロプロセッサの場合は、第1図におけるアドレ
スカウンタおよびJUMP命令メモリが不要となり、命令注
入ポート6に直接相対JUMP命令コードを与えることがで
き、また▲▼ゲート信号の生成も不要と
なる。
In the case of the microprocessor in which the injection of the relative JUMP instruction is completed in one bus cycle, the address counter and the JUMP instruction memory shown in FIG. 1 are unnecessary, and the relative injection JUMP instruction code can be directly given to the instruction injection port 6. Further, it is not necessary to generate the gate signal.

実施例では実行判定をしようとするアドレスが1点の
場合であるが、アドレス空間上の複数点で実行判定を行
う場合には1ビットxn構成のRAM51をアドレスバスに接
続し、予め“1"(あるいは“0")を書き込んでいたアド
レスがマイクロプロセッサによってアクセスされた時
に、アドレス一致検出を行う方法がある。
In the embodiment, the execution judgment is made at one address. However, when the execution judgment is made at a plurality of points in the address space, the RAM 51 of 1-bit xn configuration is connected to the address bus and "1" is set in advance. There is a method of detecting an address match when the address in which (or "0") was written is accessed by the microprocessor.

この場合は、第5図に示すような構成として,▲
▼中で命令注入アドレスの一致を示す▲
▼信号と、実効判定アドレスの一致を示す▲
▼信号とを分離できるようにする必要が
ある。
In this case, the configuration as shown in FIG.
▼ Indicates that the instruction injection address matches ▲
▼ Indicates that the signal matches the effective judgment address ▲
▼ It is necessary to be able to separate the signal.

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

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

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

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

第1図は本発明に係る命令実行検出装置の一実施例を示
す要部構成図、第2図は実行プログラムのフローの一例
を示す図、第3図は本発明の動作原理を説明するための
図、第4図は第1図の構成における動作のタイムチャー
ト、第5図は本発明の他の実施例の要部構成図、第6図
は本発明の他の実施例を説明するための説明図である。 1……ターゲット・マイクロプロセッサ、2……アドレ
ス一致検出回路、3……ゲート信号生成回路、4……比
較アドレス生成回路、5……3ステート・バッファ、6
……命令注入ポート、7……JUMP命令メモリ、8……ア
ドレス・カウンタ、9……ステータス・デコーダ、10,1
1……ゲート、12……アドレス・バス、13……データ・
バス。
FIG. 1 is a block diagram of an essential part showing an embodiment of an instruction execution detecting device according to the present invention, FIG. 2 is a view showing an example of the flow of an execution program, and FIG. 3 is for explaining the operating principle of the present invention. FIG. 4, FIG. 4 is a time chart of the operation in the configuration of FIG. 1, FIG. 5 is a configuration diagram of a main part 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 match detection 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,1
1 …… Gate, 12 …… Address bus, 13 …… Data
bus.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】命令プリフェッチを行うターゲット・マイ
クロプロセッサを搭載するインサーキット・エミュレー
タにおいて、 前記マイクロプロセッサのステータス信号を基にして命
令コードフェッチのバスサイクルを示す信号を生成する
ステータスデコーダと、 前記マイクロプロセッサのアドレスバス上のアドレス
と、与えられた比較アドレスとを比較し、一致したとき
に一致信号を出力するアドレス一致検出回路と、 前記ステータスデコーダの出力と前記アドレス一致検出
回路の出力とを基にして、命令注入サイクルを示す信号
と、命令注入後に同一アドレスの命令フェッチが発生す
るか否かを監視する期間を示す信号を生成するゲート信
号生成回路と、 前記アドレス一致検出回路に与えるアドレスを生成する
ものであって、通常は実行判断をしようとするアドレス
を発生するが、前記ゲート信号生成回路の出力に基づき
命令注入サイクルがアクティブの期間のみ命令を注入し
ようとするアドレスを発生する比較アドレス生成回路
と、 前記アドレス一致検出回路の出力と前記ゲート信号生成
回路の出力とから命令スワップの期間を示す命令スワッ
プ信号を生成する手段と、 前記命令注入サイクル中にデータバス上に出力された本
来の命令コードのフエッチを禁止するためのバッファ手
段と、 前記命令注入サイクル中に分岐命令コードをデータバス
上に出力する命令注入手段と、 前記アドレス一致検出回路の出力と、前記ゲート信号生
成回路からの監視期間を示す信号とから実行判断をしよ
うとしたアドレスの命令が実行されたことを示す信号を
出力するゲート手段と を具備し、指定したアドレスの命令コードがマイクロプ
ロセッサによってプリフェッチされるバスサイクルを検
出し、本来フェッチされるべき命令コードの代わりに既
知のアドレスに無条件分岐する命令コードをそのバスサ
イクル中に強制的にフェッチさせ、その後ある一定の命
令フェッチ回数の間に分岐先アドレスがアドレスバス上
に出力されるか否かをアドレス一致検出回路で検出し、
分岐が発生した場合は再び分岐命令を注入したアドレス
から本来の命令コードをフェッチさせるようにし、前記
ゲート手段の出力信号によってプリフェッチされた指定
アドレスの命令コードがマイクロプロセッサ内の命令実
行部で処理されたかどうかを検知することができるよう
にしたことを特徴とする命令実行検出装置。
1. An in-circuit emulator equipped with a target microprocessor that performs instruction prefetch, and a status decoder that generates a signal indicating a bus cycle of 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 processor with a given comparison address and outputs a match signal when they match, based on the output of the status decoder and the output of the address match detection circuit. A gate signal generation circuit for generating a signal indicating an instruction injection cycle, a signal for indicating a period for monitoring whether an instruction fetch of the same address occurs after instruction injection, and an address given to the address coincidence detection circuit. Something to generate, usually run A comparison address generation circuit for generating an address for which a decision is to be made, and for generating an address for which an instruction is to be injected only during an active period of the instruction injection cycle based on the output of the gate signal generation circuit; Means for generating an instruction swap signal indicating an instruction swap period from the output and the output of the gate signal generation circuit; and for inhibiting the fetch of the original instruction code output on the data bus during the instruction injection cycle. Execution judgment based on buffer means, instruction injection means for outputting a branch instruction code onto the data bus during the instruction injection cycle, output of the address coincidence detection circuit, and a signal indicating the monitoring period from the gate signal generation circuit And a gate means for outputting a signal indicating that the instruction of the address that has tried to execute is executed. , Detects the bus cycle in which the instruction code of the specified address is prefetched by the microprocessor, and forcibly fetches the instruction code that unconditionally branches to a known address instead of the instruction code that should be originally fetched during that bus cycle. Then, the address match detection circuit detects whether or not the branch destination address is output on the address bus during a certain number of instruction fetches,
When a branch occurs, the original instruction code is fetched again from the address into which the branch instruction is injected, and the instruction code of the designated address prefetched by the output signal of the gate means is processed by the instruction execution unit in the microprocessor. An instruction execution detection device characterized in that it is possible to detect whether or not it has been hit.
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 JPH01147638A (en) 1989-06-09
JP2535984B2 true 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)

Family Cites Families (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
JPH01147638A (en) 1989-06-09

Similar Documents

Publication Publication Date Title
US5961637A (en) Split branch system utilizing separate set branch, condition and branch instructions and including dual instruction fetchers
US6754856B2 (en) Memory access debug facility
US4847753A (en) Pipelined computer
US4701844A (en) Dual cache for independent prefetch and execution units
US5226130A (en) Method and apparatus for store-into-instruction-stream detection and maintaining branch prediction cache consistency
AU632558B2 (en) Method and apparatus for controlling the conversion of virtual to physical memory addresses in a digital computer system
US5715440A (en) Branch instruction executing device for tracing branch instruments based on instruction type
CA2658829A1 (en) Debug circuit comparing processor instruction set operating mode
US6760835B1 (en) Instruction branch mispredict streaming
US5301285A (en) Data processor having two instruction registers connected in cascade and two instruction decoders
US5276825A (en) Apparatus for quickly determining actual jump addresses by assuming each instruction of a plurality of fetched instructions is a jump instruction
CA2003004C (en) Apparatus and method for executing a conditional branch instruction
JP2583525B2 (en) Data processing device
JP2535984B2 (en) Instruction execution detector
US20020099927A1 (en) System and method for determining operand access to data
EP0633521B1 (en) Microprocessor including circuit for generating signal used for tracing executed instruction stream
JP2646957B2 (en) Microprocessor with built-in cache and its trace system
EP0525672A2 (en) Microprocessor with program tracing
JP2581565B2 (en) Data processing device that executes guarded instructions
US7240185B2 (en) Computer system with two debug watch modes for controlling execution of guarded instructions upon breakpoint detection
JP2532560B2 (en) Data processing device for high-performance exception handling
JPH06202907A (en) Debug support device
JPH04319741A (en) Microprocessor having debugging supporting function
JPS63204327A (en) Control system for detection of undefined instruction
JPH05120071A (en) Data processor

Legal Events

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