JP2701799B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2701799B2
JP2701799B2 JP7180866A JP18086695A JP2701799B2 JP 2701799 B2 JP2701799 B2 JP 2701799B2 JP 7180866 A JP7180866 A JP 7180866A JP 18086695 A JP18086695 A JP 18086695A JP 2701799 B2 JP2701799 B2 JP 2701799B2
Authority
JP
Japan
Prior art keywords
instruction
break
tag
address
cpu
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
JP7180866A
Other languages
Japanese (ja)
Other versions
JPH096648A (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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP7180866A priority Critical patent/JP2701799B2/en
Publication of JPH096648A publication Critical patent/JPH096648A/en
Application granted granted Critical
Publication of JP2701799B2 publication Critical patent/JP2701799B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、命令プリフェッチ方式
のマイクロコンピュータに関し、特にインサーキット・
エミュレータに搭載されるエミュレーションCPUの命
令実行イベント検出機能に特徴を有するマイクロコンピ
ュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction prefetch microcomputer, and more particularly to an in-circuit microcomputer.
The present invention relates to a microcomputer characterized by an instruction execution event detection function of an emulation CPU mounted on an emulator.

【0002】[0002]

【従来の技術】マイクロコンピュータを構成するCPU
として、ユーザのアプリケーションシステムに搭載され
る通常のCPU(以下、本チップと称す)とは別に、エ
ミュレーションCPUが存在する。エミュレーションC
PUは、本チップの機能に加えてソフトウエアデバッグ
のための機能が追加されており、マイクロコンピュータ
を動作させるソフトウエアのデバッグを効率的に行なう
ため用いられるハードウエア・エミュレータ(以下、イ
ンサーキット・エミュレータと称す)あるいはその他の
ソフトウエアデバッグを目的とするハードウエアツール
に搭載されて使用される。インサーキット・エミュレー
タは、エミュレーションCPUが有するソフトウエアデ
バッグのための機能を制御し、エミュレーションCPU
から出力される信号レベル及びそのタイミング情報、す
なわちデバッグ情報に基づいてソフトウエア・デバッグ
機能をユーザに提供するシステムを実現している。
2. Description of the Related Art CPU constituting a microcomputer
An emulation CPU exists separately from a normal CPU (hereinafter, referred to as the present chip) mounted on a user's application system. Emulation C
The PU has a function for software debugging in addition to the functions of this chip, and is a hardware emulator (hereinafter referred to as an in-circuit emulator) used for efficiently debugging software for operating a microcomputer. Emulator) or other hardware tools for software debugging. The in-circuit emulator controls the functions of the emulation CPU for software debugging, and
A system that provides a user with a software debug function based on the signal level output from the CPU and its timing information, that is, debug information, is realized.

【0003】インサーキット・エミュレータが提供する
ソフトウエアデバッグ機能の一つとして、マイクロコン
ピュータのプログラム実行を任意のイベントによりあた
かも停止した様に見せかけたり、再スタートさせたりす
るブレーク機能がある。ここで、イベントとは、CPU
の命令実行の過程で発生する特定の事象である。例え
ば、特定メモリアドレスにロードされたプログラムのフ
ェッチサイクルや、特定アドレスに対するデータリード
サイクルあるいはデータライトサイクル、ユーザによる
非同期な強制ブレークタイミング等が該当する。これら
のイベントは、すべてインサーキット・エミュレータが
有するイベント検出回路により検出され、その出力がエ
ミュレーションCPUへ伝達される。
As one of the software debugging functions provided by the in-circuit emulator, there is a break function for making a program execution of a microcomputer appear as if stopped by an arbitrary event or restarting the program. Here, the event is a CPU
This is a specific event that occurs during the execution of the instruction. For example, a fetch cycle of a program loaded at a specific memory address, a data read cycle or a data write cycle for a specific address, an asynchronous forced break timing by a user, and the like are applicable. These events are all detected by an event detection circuit of the in-circuit emulator, and the output is transmitted to the emulation CPU.

【0004】ブレーク機能を実現するには、主として、
特定の割り込み機能を用いてブレーク状態を実現する方
式が用いられている。ブレーク機能の実現のために使用
される割り込みは、ユーザに公開しないスーパーバイザ
による割り込み機能(以下、スーパーバイザ割り込みと
称す)をエミュレーションCPUに付与して実行するの
が主流である。本チップの資源、すなわちNMI(ノン
マスカブル割り込み;最高優先順位割り込み)のような
ユーザに公開された割り込み機能をブレーク機能の為に
使用する方式は、ユーザのNMIの使用が限定されるた
め、あまり用いられない。
To realize the break function, mainly,
A method of realizing a break state by using a specific interrupt function is used. An interrupt used for realizing the break function is mainly executed by giving an interrupt function by a supervisor (hereinafter, referred to as a supervisor interrupt) not disclosed to a user to the emulation CPU. The method of using the resources of this chip, that is, the interrupt function disclosed to the user, such as NMI (non-maskable interrupt; highest priority interrupt), for the break function is often used because the user's use of the NMI is limited. I can't.

【0005】スーパーバイザ割り込みの起動手段には、
エミュレーションCPUに対し、他の割込み端子同様の
非同期割り込み入力信号を入力して割込みを起動する方
式がある。ただし、スーパーバイザ割り込みの割り込み
信号入力が有効になってから実際にCPUが命令実行を
停止するまでのタイミングについて正確に保証できない
CPUが存在する場合があった。また、命令実行の停止
のタイミングは保証可能であっても、CPUの動作周波
数が遠くなればなるほどエミュレーションCPU外部回
路の遅延が無視できなくなり、エミュレーションCPU
に対してスーパーバイザ割り込みの割り込み信号を有効
にする規定のタイミングを遵守することが困難となる場
合があった。このため、ブレークさせたいアドレスより
もプログラム実行が進んでしまうという問題があった
(以下、命令スリップと称す)。さらに、命令プリフェ
ッチ方式のマイクロコンピュータにおいては、命令フェ
ッチされた命令が必ずしも実行されるとは限らず、特に
分岐命令の直後付近のアドレスにブレーク・ポイントを
設定した場合などは誤ってブレークしてしまう可能性が
高いという問題があった。
[0005] The activation means of the supervisor interrupt includes:
There is a method of starting an interrupt by inputting an asynchronous interrupt input signal similar to other interrupt terminals to an emulation CPU. However, there are cases where there is a CPU that cannot guarantee the timing from when the interrupt signal input of the supervisor interrupt becomes valid until the CPU actually stops executing the instruction. Further, even if the timing of stopping the execution of the instruction can be guaranteed, the longer the operating frequency of the CPU becomes, the more the delay of the emulation CPU external circuit cannot be ignored.
In some cases, it may be difficult to observe the prescribed timing for enabling the interrupt signal of the supervisor interrupt. For this reason, there is a problem that the program execution proceeds beyond the address to be broken (hereinafter, referred to as an instruction slip). Furthermore, in an instruction prefetch type microcomputer, an instruction fetched instruction is not always executed, and a break occurs erroneously particularly when a break point is set at an address near immediately after a branch instruction. There was a problem that the possibility was high.

【0006】命令プリフェッチ方式のマイクロコンピュ
ータにおける上記の問題を部分的に解決する方法、すな
わち指定のアドレスにおかれた命令コードの実行の場合
に限定して誤ブレークを回避する方法が提案されてい
る。
There has been proposed a method of partially solving the above-mentioned problem in the microcomputer of the instruction prefetch system, that is, a method of avoiding an erroneous break only in the case of execution of an instruction code at a specified address. .

【0007】命令プリフェッチ方式のマイクロコンピュ
ータはプリフェッチした命令をすぐに命令デコードして
実行せず、一旦CPU内部の数バイト〜10数バイト程
度の命令キューバッファに取り込み、先に入力されたも
のから順次命令デコードし実行する。そこで、命令プリ
フェッチバスサイクルによるキューバッファへの命令コ
ード取込みと同時に、ブレーク・タグと呼ばれるマーキ
ングビットを入力することにより誤ブレークを回避す
る。そのために、エミュレーションCPUとは別のハー
ドウエアによりエミュレーションCPUのプリフェッチ
サイクルアドレスを監視し、ユーザが予め設定したアド
レスと一致したことを検出した場合に当該検出をあらわ
す信号を有効にし、ブレーク・タグをCPUに入力す
る。さらに、命令キューバッファからプリフェッチコー
ドが命令デコーダに取り出されると同時にブレーク・タ
グを評価し、スーパーバイザ割り込みを起動することに
より誤ブレークと命令スリップを確実に回避できる。す
なわち、任意のアドレスにロードされている命令コード
が、確実に実行された後にブレークさせることが可能で
ある。
The instruction prefetch type microcomputer does not immediately decode and execute the prefetched instruction, but once fetches it into an instruction queue buffer of several bytes to several tens of bytes inside the CPU and sequentially receives the instruction from the first input. Instruction is decoded and executed. Therefore, an erroneous break is avoided by inputting a marking bit called a break tag at the same time as the instruction code is taken into the queue buffer by the instruction prefetch bus cycle. Therefore, the prefetch cycle address of the emulation CPU is monitored by hardware other than the emulation CPU, and when it is detected that the address matches a preset address by the user, a signal representing the detection is enabled, and the break tag is set. Input to CPU. In addition, the break tag is evaluated at the same time that the prefetch code is fetched from the instruction queue buffer to the instruction decoder, and by activating the supervisor interrupt, the erroneous break and the instruction slip can be reliably avoided. That is, it is possible to cause a break after the instruction code loaded at an arbitrary address is reliably executed.

【0008】今日では、インサーキット・エミュレータ
の機能として、ブレーク機能だけではなくトレース機能
や時間計測機能あるいは組み合わせイベント機能等を採
用しているものが多くなってきた。これに対応して、命
令実行イベントは、単にブレーク目的の為だけでなく、
組み合わせイベントの一つとして重要となってきた。そ
して、上述したブレーク・タグを入力する方式は、ブレ
ーク機能のみならず、命令実行検出機能としても重要に
なっている。
[0008] Today, many in-circuit emulators employ not only a break function but also a trace function, a time measurement function, or a combination event function. Correspondingly, instruction execution events are not only for break purposes,
It has become important as one of the combination events. The above-described method of inputting a break tag is important not only as a break function but also as an instruction execution detection function.

【0009】しかし、上述のようにブレーク・タグ入力
のみを有するエミュレーションCPUでは、一旦ブレー
ク・タグを入力してしまうと、そのタグに同期してフェ
ッチされた命令が実行された場合は必ずブレークしてし
まうため、命令実行イベントの検出をブレーク以外の目
的に使用することは不可能であった。そこで、エミュレ
ーションCPUにブレーク・タグのマスクコントロール
を行なう目的の入力端子すなわちブレーク許可信号入力
端子を持つエミュレーションCPUが提案されている。
また、ブレーク目的以外の実行イベント検出用のタグ
(以下、実行イベント検出タグと称す)が付加された命
令が実行された場合に、これをエミュレーションCPU
の外部に出力する実行イベント検出タグ出力信号端子を
設けることにより、命令実行イベントをブレーク目的以
外に利用することがある程度可能となっている。
However, in the emulation CPU having only a break tag input as described above, once a break tag is input, a break occurs whenever an instruction fetched in synchronization with the tag is executed. Therefore, it has been impossible to use the detection of the instruction execution event for any purpose other than the break. Therefore, an emulation CPU having an input terminal for performing a mask control of a break tag in the emulation CPU, that is, a break permission signal input terminal has been proposed.
Further, when an instruction to which an execution event detection tag other than the purpose of a break is added (hereinafter, referred to as an execution event detection tag) is executed, this is executed by the emulation CPU.
By providing an execution event detection tag output signal terminal for outputting to the outside, the instruction execution event can be used for a purpose other than the break purpose to some extent.

【0010】しかし、上記ブレーク許可信号入力方式に
おいてもなお問題点がある。すなわち、タグがエミュレ
ーションCPUの命令キューバッファに複数存在し、先
に取り込まれたタグが実行イベント検出タグであって、
後に取り込まれたタブがブレーク・タグであった場合、
後者のブレーク・タグ入力に伴うブレーク許可信号が先
に取り込まれている実行イベント検出タグに作用し、誤
ブレークをひきおこす可能性がある点である。したがっ
て、命令実行イベント(ブレークしないイベント)を設
定するアドレスとブレーク・タグを設定するアドレスの
間隔は最低限そのマイクロコンピュータが持つ命令キュ
ーバッファのバイト数以上でなければならない。この制
限を考慮せずイベント設定した場合には実行イベント検
出タグが命令キューから取り出されるタイミングでブレ
ークする可能性があった。さらに、この制限は、ユーザ
の設定時に判断することは非常に困難である。なぜな
ら、プログラム上に条件分岐がある場合、分岐先をすべ
て網羅することは困難であり、しかも分岐先の数バイト
もすべて制限の対象となりうるからである。
However, there is still a problem in the break permission signal input method. That is, a plurality of tags exist in the instruction queue buffer of the emulation CPU, and the tag taken in earlier is an execution event detection tag,
If the later included tab was a break tag,
There is a possibility that a break permission signal accompanying the latter break tag input acts on the previously executed execution event detection tag, causing an erroneous break. Therefore, the interval between the address for setting an instruction execution event (event that does not break) and the address for setting a break tag must be at least as long as the number of bytes of the instruction queue buffer of the microcomputer. If an event is set without considering this limitation, a break may occur at the timing when the execution event detection tag is taken out of the instruction queue. Furthermore, this limitation is very difficult to determine at the time of user setting. This is because, if there is a conditional branch in the program, it is difficult to cover all the branch destinations, and all the bytes at the branch destinations can be restricted.

【0011】図3及び図4を参照して従来技術のブレー
ク・タグ許可信号入力方式の問題点を具体的に説明す
る。図3において、エミュレーションCPU51が、命
令実行イベントが設定されているメモリアドレス100
番地と、命令実行ブレークイベントが設定されている1
01番地の命令コードを順番にプリフェッチした場合を
想定する。
The problems of the prior art break tag enable signal input method will be described in detail with reference to FIGS. 3 and 4. FIG. In FIG. 3, the emulation CPU 51 operates at a memory address 100 where an instruction execution event is set.
Address and instruction execution break event 1
It is assumed that the instruction code at address 01 is prefetched in order.

【0012】まず、エミュレーションCPU51が10
0番地の命令コードをプリフェッチする。アドレスバス
71を監視するアドレス検出回路81には予め100番
地と101番地のアドレスを検出する為の設定がなされ
ており、この時には100番地を検出した信号がイベン
ト統合回路82へ伝達される。イベント統合回路82
は、アドレス検出回路81からの入力信号を、その設定
に従って命令実行イベント検出タグ信号として出力す
る。出力された命令実行イベント検出タグ信号は、OR
ゲート84を経由してタグ入力信号端子61に入力され
る。さらに、エミュレーションCPU51内部の命令キ
ューバッファ52の一部のタグ・ビット53として取り
込まれる。一方、101番地には命令実行ブレーク・イ
ベントが設定されており、エミュレーションCPU51
のプリフェッチサイクルアドレスが101番地であるこ
とをアドレス検出回路81が検出して、検出信号をイベ
ント統合回路に出力する。イベント統合回路82は入力
された101番地の検出信号をブレーク・タグ信号とし
て出力する。出力されたブレーク・タグ信号は、0Rゲ
ート84を経由してタグ入力信号端子61に入力され
る。そして、先の100番地の命令実行イベント実行検
出タグに続いて命令キューバッファ52の一部のタグ・
ビット53に入力される。また、ブレーク・タグ信号の
立ち上がりエッジによりブレーク許可入力信号保持回路
73のフリップ・フロップ73aの出力が有効になり、
ブレーク許可入力信号端子62に入力される。
First, if the emulation CPU 51
Prefetch the instruction code at address 0. The address detection circuit 81 that monitors the address bus 71 is set in advance to detect addresses at addresses 100 and 101. At this time, a signal that detects the address 100 is transmitted to the event integration circuit 82. Event integration circuit 82
Outputs an input signal from the address detection circuit 81 as an instruction execution event detection tag signal according to the setting. The output instruction execution event detection tag signal is OR
The signal is input to the tag input signal terminal 61 via the gate 84. Further, it is taken in as a tag bit 53 of a part of an instruction queue buffer 52 inside the emulation CPU 51. On the other hand, an instruction execution break event is set at address 101, and the emulation CPU 51
The address detection circuit 81 detects that the prefetch cycle address is 101, and outputs a detection signal to the event integration circuit. The event integration circuit 82 outputs the input detection signal at address 101 as a break tag signal. The output break tag signal is input to the tag input signal terminal 61 via the OR gate 84. Then, following the instruction execution event execution detection tag at address 100, some tags in the instruction queue buffer 52
Input to bit 53. Also, the rising edge of the break tag signal enables the output of the flip-flop 73a of the break permission input signal holding circuit 73,
The signal is input to the break permission input signal terminal 62.

【0013】上述のフリップ・フロップ73aの出力
は、実際にエミュレーションCPU51がブレークする
まで、すなわちSVMOD出力信号端子63からの出力
信号がLowになりフリップ・フロップ73aがクリア
されるまでHiレベルが保持される。したがって、その
時までANDゲート55の入力の一方は有効になったま
まであり、命令キューバッファ52に取り込まれた10
0番地と101番地の命令コード及びそれらに付加され
たタグ・ビットのうち先に取り出される方は100番地
の命令コードとタグ・ビットである。このため、100
番地の命令コードが取り出されると同時に、エミュレー
ションCPU51はブレークする。これは、ユーザが意
図した101番地の命令実行でブレークする設定とは明
らかに違っている。
The output of the above-mentioned flip-flop 73a is held at a high level until the emulation CPU 51 actually breaks, that is, until the output signal from the SVMOD output signal terminal 63 becomes low and the flip-flop 73a is cleared. You. Therefore, until then, one of the inputs of AND gate 55 remains valid and 10
Of the instruction codes at addresses 0 and 101 and the tag bits added thereto, the one to be taken out first is the instruction code at address 100 and the tag bit. Therefore, 100
The emulation CPU 51 breaks at the same time that the instruction code at the address is taken out. This is clearly different from the setting intended for the user to break at the execution of the instruction at address 101.

【0014】上記の事態を、図4のタイミングチャート
を参照して説明する。図4において、プリフェッチサイ
クル401は、エミュレーションCPU51の100番
地に対するプリフェッチサイクルであり、プリフェッチ
サイクル402は101番地に対するプリフェッチサイ
クルである。これら100番地と101番地に対するプ
リフェッチサイクルをアドレス比較回路81にて比較し
た結果が404及び405に示すタイミングで有効にな
る。また、101番地には命令実行イベントブレークが
設定されているため、ブレーク許可入力端子62の入力
信号も406のタイミングで有効にされる。また、その
有効レベルは、SVMOD信号が408のタイミングで
有効にされるまで保持される。しかし、100Hの実行
イベント検出タグは407のタイミングで取り出される
ため、ANDゲート55の入力条件が成立し、このとき
にスーパーバイザ割り込み信号が有効になる。したがっ
て、エミュレーションCPU51は、100番地の命令
実行タイミングでブレークしてしまうことになる。
The above situation will be described with reference to the timing chart of FIG. In FIG. 4, a prefetch cycle 401 is a prefetch cycle for the address 100 of the emulation CPU 51, and a prefetch cycle 402 is a prefetch cycle for the address 101. The result of comparing the prefetch cycles for these addresses 100 and 101 by the address comparison circuit 81 becomes valid at the timings 404 and 405. Since an instruction execution event break is set at address 101, the input signal of the break permission input terminal 62 is also enabled at the timing of 406. The valid level is held until the SVMOD signal is made valid at timing 408. However, since the execution event detection tag of 100H is extracted at the timing of 407, the input condition of the AND gate 55 is satisfied, and at this time, the supervisor interrupt signal becomes valid. Therefore, the emulation CPU 51 breaks at the instruction execution timing of address 100.

【0015】[0015]

【発明が解決しようとする課題】上述したように、従来
のマイクロコンピュータでは、実行イベント検出タグと
ブレーク・タグの設定条件によっては、ユーザの意図と
は異なるタイミングの誤ブレークの発生を回避できない
場合があるという欠点があった。
As described above, in the conventional microcomputer, the occurrence of an erroneous break at a timing different from the user's intention cannot be avoided depending on the setting conditions of the execution event detection tag and the break tag. There was a disadvantage that there is.

【0016】本発明は、上記従来の欠点を解消し、実行
イベント検出タグとブレーク・タグの設定条件に関わら
ず誤ブレークの発生を完全に回避できる命令プリフェッ
チ方式のマイクロコンピュータを提供することを目的と
する。
SUMMARY OF THE INVENTION It is an object of the present invention to provide an instruction prefetch type microcomputer which solves the above-mentioned conventional disadvantages and can completely avoid occurrence of an erroneous break regardless of the setting conditions of an execution event detection tag and a break tag. And

【0017】[0017]

【課題を解決するための手段】上記の目的を達成するた
め、本発明は、先にフェッチした命令コードを実行した
か否かに関わらず次の命令コードを順次フェッチしてマ
イクロコンピュータ内部の命令キューバッファに取り込
み、命令キューバッファに取り込んだ順に命令コードを
取り出して実行し、前記取り出された命令コードが分岐
命令であったならば直ちに前記命令キューバッファの内
容をクリアする命令プリフェッチ方式で動作するCPU
をエミュレーションするマイクロコンピュータにおい
て、命令の実行タイミングを報知することを要求する命
令実行イベント検出情報を記憶する第1の記憶手段と、
前記CPUのブレークを要求するブレーク情報を記憶す
る第2の記憶手段と、前記命令キューバッファに取り込
まれる前記命令コードに対応して前記各情報を記憶し、
前記命令キューバッファから前記命令コードが読み出さ
れる際に、前記命令コードに対応して記憶した前記命令
実行イベント検出情報を、前記命令コードの実行タイミ
ングに同期させて前記CPU外部に出力する出力手段
と、前記命令コードに対応して記憶した前記ブレーク情
報を用いて前記CPUの動作をブレークするブレーク手
段とを備える構成としている。
In order to achieve the above object, the present invention provides a method for sequentially fetching the next instruction code regardless of whether or not the previously fetched instruction code has been executed. The instruction queue is fetched into the queue buffer, instruction codes are fetched and executed in the order in which they are fetched into the instruction queue buffer, and if the fetched instruction code is a branch instruction, the operation is performed by an instruction prefetch method of immediately clearing the contents of the instruction queue buffer. CPU
A first storage means for storing instruction execution event detection information for requesting notification of instruction execution timing in a microcomputer emulating
Second storage means for storing break information for requesting a break of the CPU, and storing the information in correspondence with the instruction code fetched into the instruction queue buffer;
Output means for, when the instruction code is read from the instruction queue buffer, outputting the instruction execution event detection information stored corresponding to the instruction code to the outside of the CPU in synchronization with the execution timing of the instruction code; And break means for breaking the operation of the CPU using the break information stored corresponding to the instruction code.

【0018】また他の態様では、前記ブレーク手段が、
スーパーバイザ割り込みによってマイクロコンピュータ
の動作をブレークする。
[0018] In another aspect, the breaking means includes:
The operation of the microcomputer is broken by a supervisor interrupt.

【0019】[0019]

【0020】[0020]

【0021】[0021]

【作 用】本発明によれば、マーキング情報付加手段
が、命令コードに、マイクロコンピュータの動作のブレ
ークを要求するマーキング情報とその他のイベントを要
求するマーキング情報とを区別して付加し、ブレーク手
段が、前記マイクロコンピュータの動作のブレークを要
求するマーキング情報を入力し、該マーキング情報を付
加された命令コードに基づく命令の実行を待ってマイク
ロコンピュータの動作をブレークすることにより、正確
にユーザの意図に応じてマイクロコンピュータの動作の
ブレークを実行することができる。
According to the present invention, the marking information adding means distinguishes and adds to the instruction code the marking information requesting a break in the operation of the microcomputer and the marking information requesting another event, By inputting marking information for requesting a break in the operation of the microcomputer and waiting for execution of an instruction based on the instruction code to which the marking information has been added, a break in the operation of the microcomputer allows the user to accurately match the intention of the user. Accordingly, a break in the operation of the microcomputer can be executed.

【0022】[0022]

【実施例】以下、本発明の実施例について図面を参照し
て説明する。図1は、本発明の1実施例によるマイクロ
コンピュータの構成を示すブロック図である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a microcomputer according to one embodiment of the present invention.

【0023】図1において、エミュレーションCPU1
1は、内部に命令キューバッファ12と、その命令キュ
ーに同期してシフトするブレーク・タグ13と実行イベ
ント検出タグ14とを備える。また、命令キューバッフ
ァ12から取り出される命令コードにしたがって当該命
令を実行する実行ユニット15を備える。さらに、エミ
ュレーションCPU11は、ブレーク・タグを入力する
ブレーク・タグ入力信号端子21と、実行イベント検出
タグを入力する実行イベント検出タグ信号入力端子22
と、スーパーバイザ割り込み信号を入力するスーパーバ
イザ割り込み信号入力端子23と、実行イベント検出タ
グの検出信号を出力する実行イベント検出タグ出力信号
端子24と、ブレーク・タグの検出信号を出力するブレ
ーク・タグ出力信号端子25とを備え、アドレスバス3
1及びデータバス32に接続されている。また、スーパ
ーバイザバス33には、エミュレーションCPU11を
監視する命令フェッチ・アドレス比較回路41と、イベ
ントのアサインを行うイベント統合回路42と、実行さ
れたイベントをカウントするイベント・パス・カウンタ
43とが接続している。
In FIG. 1, an emulation CPU 1
1 includes therein an instruction queue buffer 12, a break tag 13 which shifts in synchronization with the instruction queue, and an execution event detection tag 14. Further, it has an execution unit 15 for executing the instruction according to the instruction code extracted from the instruction queue buffer 12. The emulation CPU 11 further includes a break tag input signal terminal 21 for inputting a break tag, and an execution event detection tag signal input terminal 22 for inputting an execution event detection tag.
A supervisor interrupt signal input terminal 23 for inputting a supervisor interrupt signal, an execution event detection tag output signal terminal 24 for outputting a detection signal of the execution event detection tag, and a break tag output signal for outputting a break tag detection signal A terminal 25;
1 and the data bus 32. An instruction fetch address comparison circuit 41 for monitoring the emulation CPU 11, an event integration circuit 42 for assigning events, and an event path counter 43 for counting executed events are connected to the supervisor bus 33. ing.

【0024】エミュレーションCPU11では、命令を
プリフェッチする度にその命令コードが命令キューバッ
ファ12に順に保存される。そして、先に入力された命
令コードから順に取り出されて実行ユニット15に送ら
れ、実行ユニットによって実行される。また、分岐命令
をフェッチしたときは、当該分岐命令が取り出されて実
行ユニット15において分岐命令であることが判明した
時点で、命令キュキューバッファ2内のデータがクリア
される。したがって、分岐命令をフェッチした後命令キ
ューバッファ12から取り出されるまでの間は、エミュ
レーンョンCPU11は分岐命令が置かれていたアドレ
スを越えて命令をフェッチし続ける。実行イベント検出
タグ14、ブレーク・タグ13についても、分岐命令を
フェッチした後に取り込んだものについては、他の命令
コードと同様に、当該分岐命令が事項ユニット15にて
検知された時点でクリアされる。
Each time the emulation CPU 11 prefetches an instruction, its instruction code is sequentially stored in the instruction queue buffer 12. Then, the instruction codes are sequentially fetched from the previously input instruction code, sent to the execution unit 15, and executed by the execution unit. When a branch instruction is fetched, the data in the instruction queue buffer 2 is cleared when the branch instruction is fetched and the execution unit 15 determines that the instruction is a branch instruction. Therefore, after the branch instruction is fetched and taken out of the instruction queue buffer 12, the emulation CPU 11 continues to fetch the instruction beyond the address where the branch instruction is located. As for the execution event detection tag 14 and the break tag 13, those obtained after fetching the branch instruction are cleared when the branch instruction is detected by the matter unit 15, similarly to other instruction codes. .

【0025】命令キューバッファ12において、命令コ
ードと対応して入力された実行イベント検出タグ14及
びブレーク・タグ13は、当該命令コードと同期してシ
フトし、当該命令コードが取り出されて実行ユニットに
て実行される際に、同時に出力される。出力されたタグ
は、実行イベント検出タグ14は実行イベント検出タグ
出力信号端子24から出力されてイベント統合回路42
にフィードバックされる。一方、ブレーク・タグ13
は、ブレーク・タグ出力信号端子25から出力されてブ
レーク・タグを利用する他の回路に送られると共に、O
Rゲート16に入力されてスーパーバイザ割り込み信号
を有効にする。このように、ブレーク・タグ13とブレ
ーク・タグ以外の実行イベント検出タグ14とを区別
し、ブレーク・タグ13のみをスーパーバイザ割り込み
信号を有効にするための条件としたことにより、ブレー
ク・タグ13に対応する命令コードが実行された場合に
のみエミュレーションCPU11はブレークすることと
なる。
In the instruction queue buffer 12, the execution event detection tag 14 and the break tag 13 input in correspondence with the instruction code shift in synchronization with the instruction code, and the instruction code is taken out and sent to the execution unit. Are output at the same time when the command is executed. As for the output tag, the execution event detection tag 14 is output from the execution event detection tag output signal terminal 24 and the event integration circuit 42
Will be fed back. On the other hand, break tag 13
Is output from the break tag output signal terminal 25 and sent to another circuit utilizing the break tag, and
The signal is input to the R gate 16 to enable the supervisor interrupt signal. As described above, the break tag 13 is distinguished from the execution event detection tag 14 other than the break tag, and only the break tag 13 is set as a condition for enabling the supervisor interrupt signal. The emulation CPU 11 breaks only when the corresponding instruction code is executed.

【0026】命令フェッチ・アドレス比較回路41は、
アドレスバス31及びデータバス32に接続しており、
エミュレーションCPU11のプリフェッチサイクルを
監視する。そして、ユーザが設定したアドレスを検出し
たときは、検出信号をイベント統合回路42に出力す
る。
The instruction fetch / address comparison circuit 41
Connected to an address bus 31 and a data bus 32,
The prefetch cycle of the emulation CPU 11 is monitored. Then, when the address set by the user is detected, a detection signal is output to the event integration circuit 42.

【0027】イベント統合回路42は、出力をブレーク
・タグ入力信号端子21、実行イベント検出タグ信号入
力端子22、スーパーバイザ割り込み信号入力端子23
及びイベントバスカウンタの入力に接続し、入力を命令
フェッチ・アドレス比較回路41、イベント・パス・カ
ウンタ43の出力及び実行イベント検出タグ出力信号端
子24に接続している。イベント統合回路42は、命令
フェッチ・アドレス比較回路41を含む前段階のハード
ウエアからイベントを入力し、インサーキット・エミュ
レータにおける当該イベントに対応する機能にアサイン
する機能を有する。例えば、前記命令フェッチ・アドレ
ス比較回路41からのアドレス検出信号を入力したとき
は、検出したアドレスに応じて、エミュレーションCP
U11の実行イベント検出タグ信号入力端子22やブレ
ーク・タグ入力信号端子21等にアサインする。また、
エミュレーションCPU11の実行イベント検出タグ出
力信号端子24から実行イベント検出タグを入力したと
きは、イベント・パス・カウンタ43にアサインする。
The event integration circuit 42 outputs a break tag input signal terminal 21, an execution event detection tag signal input terminal 22, and a supervisor interrupt signal input terminal 23.
The input is connected to the instruction fetch address comparison circuit 41, the output of the event pass counter 43, and the execution event detection tag output signal terminal 24. The event integration circuit 42 has a function of inputting an event from hardware at an earlier stage including the instruction fetch address comparison circuit 41 and assigning it to a function corresponding to the event in the in-circuit emulator. For example, when an address detection signal from the instruction fetch address comparison circuit 41 is input, the emulation CP
Assign it to the execution event detection tag signal input terminal 22, break tag input signal terminal 21, etc. of U11. Also,
When an execution event detection tag is input from the execution event detection tag output signal terminal 24 of the emulation CPU 11, it is assigned to the event path counter 43.

【0028】次に、本実施例の動作について図2のフロ
ーチャートを参照して説明する。エミュレーションCP
Uにおいて、命令プリフェッチサイクルが起動されると
(ステップ201)、命令フェッチ・アドレス比較回路
41によりアドレスバス31上のアドレスが検出されて
検出結果がイベント統合回路42に送られる(ステップ
202)。命令フェッチ・アドレス比較回路41とイベ
ント統合回路42には、予めスーパーバイザバス33を
経由してそれぞれユーザが検出しようとするアドレスと
そのアドレス検出信号の意味が設定されている。また、
イベント統合回路42には、入力された単位ごとの各イ
ベントをどの出力にアサインするかが設定されている。
ここでは、例として100番地に実行イベント検出の設
定を、101番地にブレーク・イベントの設定をしたも
のとする。また、これら2つのアドレスに対し2回のプ
リフェッチサイクルが発生するものとする。
Next, the operation of this embodiment will be described with reference to the flowchart of FIG. Emulation CP
In U, when the instruction prefetch cycle is started (step 201), the address on the address bus 31 is detected by the instruction fetch / address comparison circuit 41, and the detection result is sent to the event integration circuit 42 (step 202). In the instruction fetch / address comparison circuit 41 and the event integration circuit 42, the address to be detected by the user via the supervisor bus 33 and the meaning of the address detection signal are set in advance. Also,
In the event integration circuit 42, it is set to which output each event for each input unit is assigned.
Here, it is assumed that the execution event detection is set at address 100 and the break event is set at address 101 as an example. It is also assumed that two prefetch cycles occur for these two addresses.

【0029】まず、100番地の命令フェッチサイクル
により100番地にロードされている命令コードがデー
タバス32を経由して命令キューバッファ12に取り込
まれる(ステップ203)。これと同時に、当該命令コ
ードに実行イベント検出が設定されているので、イベン
ト統合回路42から命令実行イベント検出タグ入力信号
が出力され、実行イベント検出タグ信号入力端子22か
らタグ・ビットが実行イベント検出タグ14に入力され
る(ステップ204、205)。次に、101番地の命
令フェッチサイクルにより101番地にロードされてい
る命令コードがデータバス32を経由して命令キューバ
ッファ12に取り込まれる(ステップ203)。これと
同時に、当該命令コードにブレーク・イベントが設定さ
れているので、イベント統合回路42からブレーク・タ
グ入力信号が出力され、ブレーク・タグ信号入力端子2
1からタグ・ビットがブレーク・タグ13に入力される
(ステップ206、207)。この時、先に取り込まれ
た100番地の命令コードと実行イベント検出タグ14
は、命令キューバッファ12におけるブレーク・タグ1
3の一つ先にシフトしている。
First, the instruction code loaded at address 100 by the instruction fetch cycle at address 100 is taken into the instruction queue buffer 12 via the data bus 32 (step 203). At the same time, since execution event detection is set in the instruction code, an instruction execution event detection tag input signal is output from the event integration circuit 42, and a tag bit is output from the execution event detection tag signal input terminal 22. The data is input to the tag 14 (steps 204 and 205). Next, the instruction code loaded at the address 101 by the instruction fetch cycle at the address 101 is taken into the instruction queue buffer 12 via the data bus 32 (step 203). At the same time, since a break event is set in the instruction code, a break tag input signal is output from the event integration circuit 42 and the break tag signal input terminal 2
From 1 the tag bit is input to the break tag 13 (steps 206, 207). At this time, the instruction code of address 100 previously taken in and the execution event detection tag 14
Is the break tag 1 in the instruction queue buffer 12.
It is shifted one position ahead of three.

【0030】その後、命令フェッチサイクルが繰り返さ
れ、さらに命令キューバッファ12から実行ユニットへ
の命令コードの取出しが繰り返されて(ステップ20
8)、100番地の命令コードが命令キューバッファ1
2から取り出されると、同時に実行イベント検出タグ1
4からタグ・ビットが出力される(ステップ209、2
10)。出力されたタグ・ビットは、実行イベント検出
タグ出力信号端子24から検出信号となって出力され、
イベント統合回路42にフィードバックされる。そし
て、他のイベントと組み合わせたり、あるいは当該検出
信号の入力によって、イベント・パス・カウンタインク
リメント信号が出力され、イベント・パス・カウンタ4
3の更新が行なわれる。
Thereafter, the instruction fetch cycle is repeated, and the fetching of the instruction code from the instruction queue buffer 12 to the execution unit is repeated (step 20).
8) The instruction code at address 100 is the instruction queue buffer 1
2, the execution event detection tag 1
4 outputs a tag bit (steps 209, 209, 2).
10). The output tag bit is output as a detection signal from the execution event detection tag output signal terminal 24,
This is fed back to the event integration circuit 42. An event path counter increment signal is output in combination with another event or when the detection signal is input, and the event path counter 4
3 are updated.

【0031】次に、101番地の命令コードが命令キュ
ーバッファ12から取り出されると、同時にブレーク・
タグ13からタグ・ビットが出力される(ステップ21
1、212)。出力されたタグ・ビットは、分岐して、
一方はORゲート16に入力してスーパーバイザ割り込
み信号を有効にする。これによって、エミュレーション
CPU11は、当該101番地の命令コードの実行後に
ブレークする(ステップ213)。また、分岐した他方
のタグ・ビットは、ブレーク・タグ出力信号端子25か
ら検出信号となって出力され、インサーキット・エミュ
レータの他の回路にて利用される。
Next, when the instruction code at address 101 is fetched from the instruction queue buffer 12, a break
The tag bit is output from the tag 13 (step 21).
1, 212). The output tag bit is branched and
One is input to the OR gate 16 to enable the supervisor interrupt signal. As a result, the emulation CPU 11 breaks after executing the instruction code at the address 101 (step 213). The other tag bit is output as a detection signal from the break tag output signal terminal 25, and is used by another circuit of the in-circuit emulator.

【0032】以上好ましい実施例をあげて本発明を説明
したが、本発明は必ずしも上記実施例に限定されるもの
ではない。
Although the present invention has been described with reference to the preferred embodiments, the present invention is not necessarily limited to the above embodiments.

【0033】[0033]

【発明の効果】以上説明したように、本発明のマイクロ
コンピュータは、ブレーク・タグとその他のタグとを完
全に分離できるため、命令実行イベントを設定するアド
レスとブレーク・タグを設定するアドレスとの間隔は最
低限そのマイクロコンピュータが内蔵する命令キューバ
ッファの深さすなわちバイト数以上でなければならない
という制限を完全に解消することができ、ユーザの意図
に反する誤ブレークの発生を回避することができるとい
う効果がある。
As described above, the microcomputer of the present invention can completely separate the break tag from the other tags, so that the address for setting the instruction execution event and the address for setting the break tag are different. The limitation that the interval must be at least equal to the depth of the instruction queue buffer built in the microcomputer, that is, the number of bytes, can be completely eliminated, and the occurrence of an erroneous break contrary to the user's intention can be avoided. This has the effect.

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

【図1】 本発明の1実施例にかかるマイクロコンピュ
ータの構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a microcomputer according to one embodiment of the present invention.

【図2】 本実施例の動作を示すフローチャートであ
る。
FIG. 2 is a flowchart illustrating the operation of the present embodiment.

【図3】 従来のマイクロコンピュータの構成を示すブ
ロック図である。
FIG. 3 is a block diagram showing a configuration of a conventional microcomputer.

【図4】 従来のマイクロコンピュータによる誤ブレー
クの発生条件を説明するタイムチャートである。
FIG. 4 is a time chart for explaining a condition of occurrence of an erroneous break by a conventional microcomputer.

【符号の説明】 11 エミュレーションCPU 12 命令キューバッファ 13 ブレーク・タグ 14 実行イベント検出タグ 15 実行ユニット 16 ORゲート 31 アドレスバス 32 データバス 33 スーパーバイザバス 41 命令フェッチ・アドレス比較回路 42 イベント統合回路[Description of Signs] 11 Emulation CPU 12 Instruction queue buffer 13 Break tag 14 Execution event detection tag 15 Execution unit 16 OR gate 31 Address bus 32 Data bus 33 Supervisor bus 41 Instruction fetch address comparison circuit 42 Event integration circuit

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭62−133532(JP,A) 特開 平6−103111(JP,A) 特開 平4−358233(JP,A) 特開 平4−350735(JP,A) 特開 平3−201135(JP,A) 特開 平3−99338(JP,A) 特開 平1−284938(JP,A) 特開 平1−240941(JP,A) JOHN H.CRAWFORD、P ATRICK P.GELSINGER 著 岩谷 宏訳「80386プログラミン グ」工学社(昭63−7−25)、PP. 505−536,573−582 ──────────────────────────────────────────────────続 き Continuation of front page (56) References JP-A-62-133532 (JP, A) JP-A-6-103111 (JP, A) JP-A-4-358233 (JP, A) JP-A-4- 350735 (JP, A) JP-A-3-201135 (JP, A) JP-A-3-99338 (JP, A) JP-A-1-284938 (JP, A) JP-A 1-240941 (JP, A) JOHN H. CRAWFORD, PATRICK P.C. GELSINGER, Translated by Hiroshi Iwatani, "80386 Programming", Kogakusha (63-7-25, 1988), PP. 505-536, 573-582

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 先にフェッチした命令コードを実行した
か否かに関わらず次の命令コードを順次フェッチしてマ
イクロコンピュータ内部の命令キューバッファに取り込
み、命令キューバッファに取り込んだ順に命令コードを
取り出して実行し、前記取り出された命令コードが分岐
命令であったならば直ちに前記命令キューバッファの内
容をクリアする命令プリフェッチ方式で動作するCPU
をエミュレーションするマイクロコンピュータにおい
て、命令の実行タイミングを報知することを要求する命令実
行イベント検出情報を記憶する第1の記憶手段と、 前記CPUのブレークを要求するブレーク情報を記憶す
る第2の記憶手段と、 前記命令キューバッファに取り込まれる前記命令コード
に対応して前記各情報を記憶し、前記命令キューバッフ
ァから前記命令コードが読み出される際に、前記命令コ
ードに対応して記憶した前記命令実行イベント検出情報
を、前記命令コードの実行タイミングに同期させて前記
CPU外部に出力する出力手段と、 前記命令コードに対応して記憶した前記ブレーク情報を
用いて前記CPUの動作をブレークするブレーク手段と
を備えることを特徴とするマイクロコンピュータ。
An instruction code is fetched sequentially into an instruction queue buffer inside a microcomputer regardless of whether or not an instruction code fetched earlier is executed, and instruction codes are taken out in the order in which the instruction codes are fetched into the instruction queue buffer. CPU that operates according to an instruction prefetch method for immediately clearing the contents of the instruction queue buffer if the fetched instruction code is a branch instruction
In a microcomputer that emulates an instruction , an instruction execution requesting that the instruction execution timing be notified is provided.
First storage means for storing line event detection information, and break information for requesting a break of the CPU;
Second storage means, and the instruction code fetched into the instruction queue buffer.
And stores the information in correspondence with the instruction queue buffer.
When the instruction code is read from the
The instruction execution event detection information stored corresponding to the code
Is synchronized with the execution timing of the instruction code.
Output means for outputting to the outside of the CPU, and the break information stored corresponding to the instruction code.
A microcomputer for breaking the operation of the CPU by using the microcomputer.
【請求項2】 前記ブレーク手段が、 スーパーバイザ割り込みによって前記CPUの動作をブ
レークすることを特徴とする請求項1に記載のマイクロ
コンピュータ。
2. The microcomputer according to claim 1, wherein said break means breaks the operation of said CPU by a supervisor interrupt.
JP7180866A 1995-06-24 1995-06-24 Microcomputer Expired - Fee Related JP2701799B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7180866A JP2701799B2 (en) 1995-06-24 1995-06-24 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7180866A JP2701799B2 (en) 1995-06-24 1995-06-24 Microcomputer

Publications (2)

Publication Number Publication Date
JPH096648A JPH096648A (en) 1997-01-10
JP2701799B2 true JP2701799B2 (en) 1998-01-21

Family

ID=16090728

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7180866A Expired - Fee Related JP2701799B2 (en) 1995-06-24 1995-06-24 Microcomputer

Country Status (1)

Country Link
JP (1) JP2701799B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62133532A (en) * 1985-12-05 1987-06-16 Nec Corp Microprocessor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JOHN H.CRAWFORD、PATRICK P.GELSINGER 著 岩谷 宏訳「80386プログラミング」工学社(昭63−7−25)、PP.505−536,573−582

Also Published As

Publication number Publication date
JPH096648A (en) 1997-01-10

Similar Documents

Publication Publication Date Title
JP2731692B2 (en) Debug device
US5564041A (en) Microprocessor for inserting a bus cycle in an instruction set to output an internal information for an emulation
US20020144235A1 (en) Debugging embedded systems
US4747045A (en) Information processing apparatus having an instruction prefetch circuit
GB2281986A (en) Logging program counter on reset.
JP2513417B2 (en) Information processing device
US6839869B2 (en) Trace control circuit for tracing CPU operation in real time
US5129079A (en) Computer system having subinstruction surveillance capability
US5930470A (en) Debugging system and debugging method
JP2701799B2 (en) Microcomputer
JPH07182170A (en) Microprocessor
JPH1011315A (en) In-circuit emulator device and in-circuit emulation method
JP2525492B2 (en) Programmable controller
JP2808757B2 (en) Microprocessor for debugging
JP3001547B1 (en) In-circuit emulator
JP3097602B2 (en) Data processing device
JP2000029508A (en) Programmable controller
JP2002116926A (en) Program processor and program processing method
JP2503210B2 (en) Micro program controller
JP2978841B2 (en) Emulation method for in-circuit emulator
JP2001318802A (en) In-circuit emulator
JPH0535499A (en) Data processing device and method
JP3011166B2 (en) Debug circuit
JPS5875256A (en) Monitoring system for execution instruction processing state
JPH05334126A (en) Information processor

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081003

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091003

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees