Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2923570B2 - In-circuit emulator and microprocessor - Google Patents
[go: Go Back, main page]

JP2923570B2 - In-circuit emulator and microprocessor - Google Patents

In-circuit emulator and microprocessor

Info

Publication number
JP2923570B2
JP2923570B2 JP2104700A JP10470090A JP2923570B2 JP 2923570 B2 JP2923570 B2 JP 2923570B2 JP 2104700 A JP2104700 A JP 2104700A JP 10470090 A JP10470090 A JP 10470090A JP 2923570 B2 JP2923570 B2 JP 2923570B2
Authority
JP
Japan
Prior art keywords
instruction
control circuit
bus cycle
address
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.)
Expired - Fee Related
Application number
JP2104700A
Other languages
Japanese (ja)
Other versions
JPH043230A (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.)
Hitachi Ltd
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI Systems Co Ltd
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 Hitachi Ltd, Hitachi ULSI Systems Co Ltd filed Critical Hitachi Ltd
Priority to JP2104700A priority Critical patent/JP2923570B2/en
Priority to KR1019910006125A priority patent/KR910018909A/en
Priority to EP91303435A priority patent/EP0453268B1/en
Priority to DE69127992T priority patent/DE69127992T2/en
Publication of JPH043230A publication Critical patent/JPH043230A/en
Priority to US08/201,488 priority patent/US5564041A/en
Priority to HK98102618A priority patent/HK1003603A1/en
Application granted granted Critical
Publication of JP2923570B2 publication Critical patent/JP2923570B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、データ処理技術、さらには命令プリフェ
ッチ方式のマイクロプロセッサにおける実行命令の通知
方式に適用して特に有効な技術に関し、例えばノイマン
型マイクロコンピュータに利用して有効な技術に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing technique, and more particularly to a technique which is particularly effective when applied to an execution instruction notification method in an instruction prefetch type microprocessor. It relates to technology that is effective for use in computers.

[従来の技術] 従来提案されているマイクロコンピュータには、実行
すべき命令以外にいくつかの命令を前もって取り込んで
おくプリフェッチ方式の命令レジスタを有するようにさ
れたものがある。このように、プリフェッチ方式の命令
レジスタに予め複数の命令を取り込んでおくことによっ
て、プログラムの実行の高速化が可能になる。
2. Description of the Related Art Some conventional microcomputers have a prefetch-type instruction register for prefetching some instructions in addition to the instruction to be executed. As described above, by pre-fetching a plurality of instructions into the instruction register of the prefetch method, the speed of execution of the program can be increased.

ところで、ユーザが新たにマイクロコンピュータ・シ
ステムやそのソフトウェアを開発した場合、エミュレー
ションを行なってデバッキングを行なうことが多い。
Incidentally, when a user newly develops a microcomputer system or its software, emulation is often performed to perform debugging.

そのようなエミュレーションにおいては、プログラム
中のある命令を実行した時点でプログラムの実行を中断
したり、ある時点からバス上のデータをメモリにトレー
スしたりする。そして、このトレースされたメモリの内
容を解析することで、プログラムの暴走要因などを解明
して、プログラムやシステムのデバッキングが容易に行
なえるようになる。
In such emulation, execution of a program is interrupted when a certain instruction in the program is executed, or data on the bus is traced to a memory from a certain point. Then, by analyzing the contents of the traced memory, the cause of the runaway of the program or the like is clarified, and the debugging of the program or the system can be easily performed.

そのため、エミュレーション中にデータバスやアドレ
スバスを監視して、ブレークポイントやトレースポイン
トを検出することが行なわれる。
Therefore, during emulation, the data bus and the address bus are monitored to detect break points and trace points.

前述したように前もって複数の命令をフェッチする命
令レジスタを有するマイクロコンピュータにおいては、
エミュレーションを行なう場合、実際のバス上に現われ
る命令コードやアドレスは、実行中の命令のものとは異
なることになる。そのため、正しいブレークポイントで
プログラムの実行を中断したり、所望の時点からトレー
スを開始したりすることができないとともに、エミュレ
ーション後におけるトレース内容の解析が困難になる。
As described above, in a microcomputer having an instruction register for fetching a plurality of instructions in advance,
When emulation is performed, the instruction code and address appearing on the actual bus will be different from those of the instruction being executed. Therefore, it is not possible to interrupt the execution of the program at a correct breakpoint or to start tracing from a desired point, and it becomes difficult to analyze the trace contents after emulation.

そこで、実行中の命令のアドレスとプリフェッチ・ア
ドレスとの差を出力するピンを設けて、命令プリフェッ
チ方式のマイクロコンピュータにおける実行中の命令を
外部で知ることができるようにした発明(特開昭62−19
7831号)や割込み機能を利用して1命令実行ごとにプロ
グラムの実行を中断し、マイクロプロセッサの内部状態
を外部へ知らせる他の命令列を実行するようにした発明
(特開昭61−286936号)が提案されている。
Therefore, a pin is provided for outputting the difference between the address of the instruction being executed and the prefetch address, so that the instruction being executed in the instruction prefetch type microcomputer can be externally known (Japanese Patent Application Laid-Open No. Sho 62). −19
Japanese Patent Application Laid-Open No. Sho 61-286936 in which the execution of a program is interrupted each time one instruction is executed by using an interrupt function, and another instruction sequence for notifying the internal state of the microprocessor to the outside is executed. ) Has been proposed.

[発明が解決しようとする課題] 上記従来技術のうち、実行命令のアドレスとプリフェ
ッチ・アドレスとの差を出力するピンを設ける方式にあ
っては、マイクロプロセッサのピン数を増加させたり専
用ピンを追加した別チップを用意しなくてはならないた
めコストが高くなったり開発期間が長くなるとともに、
必要とする情報量の増加に対応できないという欠点があ
る。
[Problems to be Solved by the Invention] Among the above-mentioned prior arts, in a method of providing a pin for outputting a difference between an address of an execution instruction and a prefetch address, the number of pins of the microprocessor is increased or dedicated pins are used. Since it is necessary to prepare additional chips, the cost increases and the development period becomes longer,
There is a drawback in that it cannot cope with an increase in the required information amount.

一方、1命令実行ごとにプログラムを中断する方式に
あっては、リアルタイム性がなくなり、エミュレーショ
ン中にシステムが暴走するおそれがある。
On the other hand, in the method in which the program is interrupted each time one instruction is executed, the real-time property is lost and the system may run away during emulation.

本発明の目的は、ピン数を増加させたり、複雑な外付
け回路を設けることなく、命令プリフェッチ方式のマイ
クロプロセッサにおいて、実行中の命令アドレス等内部
情報を外部へ知らせることができるようにすることにあ
る。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a microprocessor of an instruction prefetch system capable of notifying internal information such as an instruction address being executed to the outside without increasing the number of pins or providing a complicated external circuit. It is in.

本発明の他の目的は、リアルタイム性を損なうことな
く内部情報を外部へ知らせることができるとともに、必
要とする情報量の増加に対する柔軟性の高いマイクロプ
ロセッサを提供することにある。
Another object of the present invention is to provide a microprocessor which can notify internal information to the outside without deteriorating the real-time property, and which is highly flexible with respect to an increase in required information amount.

この発明の前記ならびにそのほかの目的と新規な特徴
については、本明細書の記述および添附図面から明らか
になるであろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

[課題を解決するための手段] 本願において開示される発明のうち代表的なものの概
要を説明すれば、下記のとおりである。
[Means for Solving the Problems] The outline of a typical invention among the inventions disclosed in the present application is as follows.

すなわち、予め複数の命令を保持可能なバッファもし
くはメモリを有するマイクロプロセッサに、ある所定の
動作モードでは1命令実行ごとにプロセッサの内部情報
を外部へ出力するための特殊バスサイクルを挿入する機
能を持たせるようにするものである。
That is, a microprocessor having a buffer or a memory capable of holding a plurality of instructions in advance has a function of inserting a special bus cycle for outputting the internal information of the processor to the outside each time one instruction is executed in a predetermined operation mode. It is to make it.

上記特殊バスサイクルの挿入機能は、外部バス制御回
路もしくはそれに付随する回路としてハードウェアで実
現してもよいし、マイクロプログラム制御のようなファ
ームウェアで実現してもよい。
The function of inserting the special bus cycle may be realized by hardware as an external bus control circuit or a circuit attached thereto, or may be realized by firmware such as microprogram control.

上記特殊バスサイクルで外部へ出力するプロセッサ内
部の情報としては、実行された命令のメモリ空間上での
アドレス(物理アドレスよりも論理アドレスが良い)や
プリフェッチされた命令群の中の当該実行命令を識別す
るためのコードがある。
The internal information of the processor to be output to the outside in the special bus cycle includes an address in the memory space of the executed instruction (a logical address is better than a physical address) and an execution instruction in a prefetched instruction group. There is a code to identify.

[作用] 上記した手段によれば、命令プリフェッチ方式のマイ
クロプロセッサを用いたシステムのエミュレーションに
おいて、いずれの命令が実行されたか外部で容易に知る
ことができるため、正確なエミュレーション制御が可能
になるとともに、トレースデータの解析が容易となりデ
バッグ効率が向上する。
[Operation] According to the above-described means, in emulation of a system using a microprocessor of the instruction prefetch method, it is possible to easily know externally which instruction has been executed, so that accurate emulation control becomes possible. In addition, analysis of trace data is facilitated, and debugging efficiency is improved.

また、本来不用な特殊バスサイクルが挿入されるた
め、完全なリアルタイム性はないが、挿入されるのは1
サイクルのみであるため、割込み機能等で所定の命令列
を実行して内部情報を外部へ知らせる従来方式に比べる
と、リアルタイム性はほとんど損なわれない。
In addition, since a special bus cycle which is originally unnecessary is inserted, there is no complete real-time property.
Since it is only a cycle, the real-time property is hardly impaired as compared with the conventional method in which a predetermined instruction sequence is executed by an interrupt function or the like to notify internal information to the outside.

[実施例] 第1図には本発明を命令プリフェッチ方式のマイクロ
プロセッサに適用した場合の一実施例が示されている。
FIG. 1 shows an embodiment in which the present invention is applied to an instruction prefetch type microprocessor.

特に制限されないが、第1図に示されている各回路ブ
ロックは単結晶シリコン基板のような一個の半導体チッ
プ上において形成される。
Although not particularly limited, each circuit block shown in FIG. 1 is formed on one semiconductor chip such as a single crystal silicon substrate.

この実施例のマイクロプロセッサには、特に制限され
ないが、各々16ビット長の命令コードを2つ保持可能な
2個のFIFO方式の命令バッファ10a,10bが設けられてい
る。また、バスサイクルを制御する外部バス制御回路11
が設けられており、この外部バス制御回路11には、30ビ
ットのアドレスバスADBと32ビットのデータバスDTBが接
続可能にされている。外部バス制御回路11には、データ
バスDTBを介して外部のメモリから一度に32ビット幅で
命令コードやデータを取り込むようにされている。そし
て、命令フェッチサイクルで一度に取り込まれた32ビッ
ト幅の命令コードは、16ビットずつ2つに分割され、上
記2つの命令バッファ10a,10bにそれぞれ格納される。
Although not particularly limited, the microprocessor of this embodiment is provided with two FIFO instruction buffers 10a and 10b each capable of holding two 16-bit instruction codes. Also, an external bus control circuit 11 for controlling a bus cycle.
The external bus control circuit 11 can be connected to a 30-bit address bus ADB and a 32-bit data bus DTB. The external bus control circuit 11 is configured to fetch instruction codes and data from an external memory with a 32-bit width at a time via a data bus DTB. The 32-bit instruction code fetched at one time in the instruction fetch cycle is divided into two 16-bit instruction codes and stored in the two instruction buffers 10a and 10b, respectively.

なお、この実施例のマイクロプロセッサの命令語長は
16ビット×n(nは正の自然数)の可変長である。ま
た、この実施例では、外部バス制御回路11は4ビットの
バイトコードBC0〜BC3を生成して出力可能に構成されて
おり、16ビット単位の命令の取込みやバイト単位でのデ
ータのリード・ライトもできる。このバイトコードBC0
〜BC3は、通常は命令フェッチポインタ15aの下位1ビッ
トもしくは内部バス18を介して演算処理部17より供給さ
れる32ビットのアドレスの下位2ビットに基づいて生成
される。
The instruction word length of the microprocessor of this embodiment is
The variable length is 16 bits × n (n is a positive natural number). Further, in this embodiment, the external bus control circuit 11 is configured to generate and output 4-bit byte codes BC0 to BC3, to take in 16-bit unit instructions and to read / write data in byte units. Can also. This byte code BC0
.About.BC3 is normally generated based on the lower 1 bit of the instruction fetch pointer 15a or the lower 2 bits of a 32-bit address supplied from the arithmetic processing unit 17 via the internal bus 18.

上記命令バッファ10a,10bに格納された命令コードは
セレクタ12を介して16ビット幅の命令デコーダ13または
32ビット幅の即値生成回路14へ選択的に供給可能にされ
ている。上記セレクタ12は、命令フェッチポインタ15a
を有する命令アドレス制御回路15からの制御信号SCによ
って適切なタイミングで切り換えが行なわれる。
The instruction codes stored in the instruction buffers 10a and 10b are transmitted through the selector 12 to the 16-bit instruction decoder 13 or
It can be selectively supplied to an immediate value generation circuit 14 having a 32-bit width. The selector 12 has an instruction fetch pointer 15a
The switching is performed at an appropriate timing by the control signal SC from the instruction address control circuit 15 having the following.

命令デコーダ13は供給された命令コードをデコードし
て、命令長を検出して信号WLによって上記命令アドレス
制御回路15へ知らせたり、マイクロプログラム制御方式
の演算制御回路16に起動をかける。演算制御回路16は演
算器や汎用レジスタ群を有する演算処理部17に対する制
御信号を形成し、命令デコーダ13に保持されている命令
コードに対応する処理を実行させる。
The instruction decoder 13 decodes the supplied instruction code, detects the instruction length, notifies the instruction address control circuit 15 by a signal WL, and activates the arithmetic control circuit 16 of the microprogram control system. The arithmetic control circuit 16 forms a control signal for an arithmetic processing unit 17 having an arithmetic unit and a general-purpose register group, and causes the instruction decoder 13 to execute processing corresponding to the instruction code.

演算結果は、32ビット幅の内部データバス18を介し
て、外部バス制御回路11または命令アドレス制御回路15
に供給される。また、外部メモリより読み込まれたデー
タはデータバス18を介して演算処理部17に供給される。
外部からデータを読み込むときには、演算制御回路16か
ら外部バス制御回路11に対して、データアクセス要求信
号DARが供給される。
The operation result is sent to the external bus control circuit 11 or the instruction address control circuit 15 via the 32-bit internal data bus 18.
Supplied to The data read from the external memory is supplied to the arithmetic processing unit 17 via the data bus 18.
When reading data from the outside, the data access request signal DAR is supplied from the arithmetic control circuit 16 to the external bus control circuit 11.

この実施例では、上記命令アドレス制御回路15内に、
命令フェッチアドレスを保持する命令フェッチポインタ
15aとは別個に、上記命令バッファ10a,10bに取り込まれ
た命令コードのうちいずれを実行すべきか指示する31ビ
ット幅の命令コードポインタ15bと、実行される命令の
先頭アドレスを保持するプログラムカウンタ15cが設け
られており、この命令コードポインタ15bの最下位の1
ビットがセレクタ制御信号SCとして上記セレクタ12に供
給される。命令コードポインタ15bは、命令デコーダ13
からの実行命令の命令語長を示す信号WLに基づいて命令
語長分だけ自動的にインクリメントされる。
In this embodiment, in the instruction address control circuit 15,
Instruction fetch pointer holding instruction fetch address
Separately from 15a, an instruction code pointer 15b having a 31-bit width indicating which of the instruction codes fetched into the instruction buffers 10a and 10b is to be executed, and a program counter 15c holding a start address of the executed instruction Is provided, and the least significant 1 of the instruction code pointer 15b is provided.
The bit is supplied to the selector 12 as the selector control signal SC. The instruction code pointer 15b is
Is automatically incremented by the instruction word length based on the signal WL indicating the instruction word length of the execution instruction from.

一方、命令フェッチポインタ15aに保持されている31
ビット長の命令フェッチアドレスは外部バス制御回路11
に供給されており、外部バス制御回路11はこのうち上位
30ビットを外部アドレスバスADB上に出力する。命令フ
ェッチポインタ15aは命令バッファ10a,10bが一杯になる
まで自動的に更新される。
On the other hand, 31 held in the instruction fetch pointer 15a
The bit-length instruction fetch address is stored in the external bus control circuit 11.
The external bus control circuit 11 is
Outputs 30 bits on the external address bus ADB. The instruction fetch pointer 15a is automatically updated until the instruction buffers 10a and 10b become full.

分岐命令のときは、演算処理部17から供給される分岐
先アドレスが、命令コードポインタ15bにセットされる
とともにプログラムカウンタ15cにもセットされる。プ
ログラムカウンタ15cは、31ビット幅に構成されてお
り、例えばデータ位置が相対アドレスで示されている場
合、このプログラムカウンタ15cの値が内部データバス1
8を介して演算処理部17に送られてディスプレースメン
ト(オフセット)を加算して得られた値がアドレスとし
て外部へ出力される。即値生成回路14は、32ビット幅に
構成されており、命令デコーダ13からの制御信号によっ
て命令語中から即値を抽出して演算処理部17に渡す。
In the case of a branch instruction, the branch destination address supplied from the arithmetic processing unit 17 is set in the instruction code pointer 15b and also in the program counter 15c. The program counter 15c has a 31-bit width. For example, when the data position is indicated by a relative address, the value of the program counter 15c is stored in the internal data bus 1.
The value obtained by adding the displacement (offset) to the arithmetic processing unit 17 via 8 is output to the outside as an address. The immediate value generation circuit 14 has a 32-bit width, extracts an immediate value from an instruction word according to a control signal from the instruction decoder 13, and transfers the extracted immediate value to the arithmetic processing unit 17.

この実施例では、上記外部バス制御回路11に付随して
特殊バスサイクル発生回路19が設けられている。
In this embodiment, a special bus cycle generation circuit 19 is provided in association with the external bus control circuit 11.

また、演算制御回路16から1命令終了ごとに終了通知
信号ENDが特殊バスサイクル発生回路19と命令アドレス
制御回路15に供給される。この信号を受けると命令コー
ドポインタの値(実行命令アドレス)がプログラムカウ
ンタ15cにロードされ、最下位ビットが特殊バスサイク
ル発生回路19に供給される。また、このとき命令バッフ
ァ10a,10bがクリアされる。
Further, an end notification signal END is supplied from the arithmetic control circuit 16 to the special bus cycle generating circuit 19 and the instruction address control circuit 15 each time one instruction is completed. Upon receiving this signal, the value of the instruction code pointer (execution instruction address) is loaded into the program counter 15c, and the least significant bit is supplied to the special bus cycle generation circuit 19. At this time, the instruction buffers 10a and 10b are cleared.

一方、特殊バスサイクル発生回路19は外部から特殊バ
スサイクル発生要求SBRのようなモード指定信号を受け
ると有効にされ、1命令の実行終了を知ると、外部バス
制御回路11に対し、次に実行する命令(16ビット×n
(nは自然数))の先頭が同時に取り込まれた32ビット
長の命令コードの上位側であるのか下位側であるかを外
部へ出力するための特殊バスサイクルを挿入するように
制御信号を与える。
On the other hand, the special bus cycle generation circuit 19 is enabled when a mode designating signal such as a special bus cycle generation request SBR is received from the outside, and when the execution of one instruction is known, the external bus control circuit 11 Instruction (16 bits × n
(N is a natural number)). A control signal is provided so as to insert a special bus cycle for outputting to the outside whether the head of the 32-bit instruction code taken simultaneously is the upper side or the lower side.

ただし、外部バス制御回路11は特殊バスサイクルを優
先させるか、他のバスサイクル(データサイクル等)を
優先させるか判断する機能を有している。
However, the external bus control circuit 11 has a function of determining whether to give priority to a special bus cycle or another bus cycle (such as a data cycle).

この実施例のマイクロプロセッサは、特殊バスサイク
ルによって、プログラムカウンタ15cの最下位ビットに
対応する信号をバイトコードBC0〜BC3によって出力する
ことで、次に実行する命令が32ビットのうち上位側か下
位側かを示す。しかもこの実施例では特殊バスサイクル
挿入時に命令バッファ10a,10bをクリアしているので、
次の命令コードは一度フェッチされていても次のサイク
ルで改めてフェッチし直される。従って、特殊バスサイ
クルの次のサイクルでのデータバス上の信号を見れば実
行される命令コードも知ることができる。
The microprocessor of this embodiment outputs a signal corresponding to the least significant bit of the program counter 15c by the bytecodes BC0 to BC3 in a special bus cycle, so that the next instruction to be executed is the upper or lower of the 32 bits. Indicates the side. Moreover, in this embodiment, the instruction buffers 10a and 10b are cleared when a special bus cycle is inserted.
Even if the next instruction code is fetched once, it is fetched again in the next cycle. Therefore, the instruction code to be executed can be known by looking at the signal on the data bus in the cycle following the special bus cycle.

ただし、特殊バスサイクル挿入時にプログラムカウン
タ15cの最下位ビットに対応する情報のみ出力する代わ
りに、特殊バスサイクルでプログラムカウンタ15cの全
ビットを出力するようにしてもよい。その場合、アドレ
スバスとバイトコードを併用すればよい。このようにす
れば、命令バッファ10a,10bをクリアしなくても次の実
行命令を外部で知ることができる。
However, instead of outputting only information corresponding to the least significant bit of the program counter 15c when a special bus cycle is inserted, all bits of the program counter 15c may be output in a special bus cycle. In that case, the address bus and the byte code may be used together. In this way, the next execution instruction can be externally known without clearing the instruction buffers 10a and 10b.

さらに、この実施例のマイクロプロセッサは、特殊バ
スサイクル実行時にそのバスサイクルが特殊バスサイク
ルであることを、3ビットのバスアクセスタイプ信号BA
T0〜BAT2で示すようにされている。このバスアクセスタ
イプ信号BAT0〜BAT2は、特殊バスサイクル以外にも、命
令取込サイクル、データ書込みサイクル、データ読込み
サイクルあるいはコプロセッサに対するコマンド送信サ
イクル等を識別するために使用される。
Further, the microprocessor of this embodiment confirms that the bus cycle is a special bus cycle during execution of the special bus cycle by using a 3-bit bus access type signal BA.
It is as shown by T0-BAT2. The bus access type signals BAT0 to BAT2 are used to identify an instruction fetch cycle, a data write cycle, a data read cycle, a command transmission cycle to the coprocessor, and the like, in addition to the special bus cycle.

なお、上記実施例では特殊バスサイクル発生回路19が
外部バス制御回路11に付随すると説明したが、特殊バス
サイクル発生回路19が外部バス制御回路11に内蔵もしく
は外部バス制御回路11と一体的に構成されていてもよ
い。
In the above embodiment, the special bus cycle generation circuit 19 is described as being attached to the external bus control circuit 11. However, the special bus cycle generation circuit 19 is built in the external bus control circuit 11 or configured integrally with the external bus control circuit 11. It may be.

また、この実施例のマイクロプロセッサにおいては、
割込み要求があったとき要求元に特殊バスサイクルを使
って応答を返すようにされており、そのときアドレスバ
スADB上に割込みレベル0〜6を示すコード(下位2ビ
ットが00,04,08,0C,10,14,18)をのせるようにさせてい
る。そこで、この実施例では次に実行される命令の上位
/下位を知らせる特殊バスサイクルでは、割込み応答の
ための特殊バスサイクルと区別するため、アドレスバス
ADB上に0000001Cなるコードをのせるようにされてい
る。
In the microprocessor of this embodiment,
When an interrupt request is made, a response is returned to the request source using a special bus cycle. At that time, a code indicating the interrupt level 0 to 6 (the lower 2 bits are 00, 04, 08, 0C, 10,14,18). Therefore, in this embodiment, the special bus cycle for notifying the upper / lower order of the instruction to be executed next is distinguished from the special bus cycle for the interrupt response.
The code 0000001C is put on ADB.

さらに、上記実施例では命令実行直前に上位/下位を
知らせる特殊バスサイクルを入れているが、例えば第1
図の実施例のマイクロプロセッサで命令コードポインタ
15bからプログラムカウンタ15cへの命令アドレスのロー
ドと同時に前の命令アドレスの最下位ビットが特殊バス
サイクル発生回路19に送られてラッチされるような構成
にすることによって、命令実行サイクルの後に特殊バス
サイクルを挿入し、実行した命令が上位または下位のい
ずれであったかを次のバスサイクルで外部へ知らせるよ
うにすることもできる。
Further, in the above embodiment, a special bus cycle for notifying the upper / lower order is inserted immediately before the execution of the instruction.
Instruction code pointer in microprocessor of embodiment shown
By loading the instruction address from 15b to the program counter 15c at the same time that the least significant bit of the previous instruction address is sent to the special bus cycle generation circuit 19 and latched, the special bus is executed after the instruction execution cycle. A cycle may be inserted so that whether the executed instruction is higher or lower is notified to the outside in the next bus cycle.

第2図には、上記マイクロプロセッサを用いたシステ
ムにおいて一例として次のようなプログラムを実行した
場合の各バスの動作タイミングが示されている。
FIG. 2 shows the operation timing of each bus when the following program is executed as an example in a system using the microprocessor.

上記プログラムにおける100番地の命令BEQは分岐命令
で、この命令の実行でLABEL1(アドレス1002番地)へジ
ャンプするときの動作タイミングが第2図に示されてい
る。
The instruction BEQ at address 100 in the above program is a branch instruction, and the operation timing when jumping to LABEL1 (address 1002) by execution of this instruction is shown in FIG.

第2図を参照すると、命令a,bの取込を行なうバスサ
イクルS2の直前のバスサイクルS1でバスアクセスタイプ
信号BAT0〜BAT2が“010"とされて出力され、特殊バスサ
イクルであることが分かるようにされている。そして、
このバスサイクルS1中にバイトコードBC0〜BC3(1101)
によって、次に取り込まれる32ビットの命令コードのう
ち実行される命令の先頭のバイト位置が明示される。図
ではBC0〜BC3のうち“0"が立っているところが実行され
る命令の先頭位置であることを示している。そして、次
のバスサイクルS2ではデータバスを介して命令コードa
とbが取り込まれている(命令レジスタがクリアされて
いるので取り込みと同時に実行される)。これによりバ
スサイクルS2で実行される命令はb(ADD #1,R0.w)で
あることが分かる。
Referring to FIG. 2, the bus access type signals BAT0 to BAT2 are output as "010" in the bus cycle S1 immediately before the bus cycle S2 for taking in the instructions a and b, and the bus cycle is a special bus cycle. It is understood. And
During this bus cycle S1, byte codes BC0 to BC3 (1101)
Specifies the first byte position of the instruction to be executed in the 32-bit instruction code to be fetched next. In the figure, the position where “0” is set among BC0 to BC3 indicates the start position of the instruction to be executed. Then, in the next bus cycle S2, the instruction code a
And b have been fetched (executed simultaneously with the fetch because the instruction register is cleared). This indicates that the instruction executed in the bus cycle S2 is b (ADD # 1, R0.w).

第2図の動作タイミングでは、バスサイクルS2の次の
バスサイクルS3に再び特殊バスサイクルが挿入され、そ
の次のバスサイクルS4で実行される命令が、取込まれる
命令語(32ビット)のうち上位/下位いずれであるかを
外部へ知らせている。
At the operation timing shown in FIG. 2, a special bus cycle is inserted again in the bus cycle S3 next to the bus cycle S2, and the instruction executed in the next bus cycle S4 includes the instruction word (32 bits) taken in. It informs outside whether it is higher or lower.

第2図では、特殊バスサイクルS3でバイトBC0〜BC3が
0111とされているので、次のバスサイクルS4で取り込ま
れる命令c,dのうち実行されるのは命令c(MOV @R0.h,
R1.w)であることが分かる。この命令cはデータ転送命
令であるため、バスサイクルS5でデータ書込みサイクル
が実行されてから命令実行終了信号ENDが出ることにな
る。そのため、次のバスサイクルS6に特殊バスサイクル
が挿入されているのが第2図より分かる。
In FIG. 2, bytes BC0 to BC3 are stored in special bus cycle S3.
Therefore, among the instructions c and d fetched in the next bus cycle S4, the instruction c (MOV@R0.h,
R1.w). Since the instruction c is a data transfer instruction, an instruction execution end signal END is output after the data write cycle is executed in the bus cycle S5. FIG. 2 shows that a special bus cycle is inserted in the next bus cycle S6.

第2図には1ワード命令が実行される場合のみ示され
ているが、2ワード以上の命令実行のときは、上記バス
サイクルS4,S5のように2以上の命令サイクルが連続す
ることになる。
FIG. 2 shows only a case where a one-word instruction is executed. However, when an instruction of two or more words is executed, two or more instruction cycles are continuous as in the bus cycles S4 and S5. .

なお、上記実施例のマイクロプロセッサは命令をすべ
て外部から取込む方式とされているが、内部にキャッシ
ュメモリを設けて、内部から命令を取込む方式としても
よい。ただし、その場合、命令バッファに取り込まれる
命令を外部から知ることができないので、特殊バスサイ
クル挿入モードではキャッシュメモリの動作を停止さ
せ、外部から命令を取り込ませるようにする必要があ
る。従って、外部から供給される特殊バスサイクル要求
信号SBRを、キャッシュメモリの動作を停止させるため
の要求信号と兼ねさせるようにするとよい。
Although the microprocessor of the above embodiment is of a type in which all instructions are fetched from the outside, a method of fetching instructions from the inside may be provided by providing a cache memory inside. However, in this case, since the instruction fetched into the instruction buffer cannot be known from the outside, it is necessary to stop the operation of the cache memory in the special bus cycle insertion mode and fetch the instruction from the outside. Therefore, it is preferable that the special bus cycle request signal SBR supplied from outside is also used as a request signal for stopping the operation of the cache memory.

第3図には上記実施例のマイクロプロセッサを用いた
マイクロコンピュータシステム(ユーザシステム)のエ
ミュレーションを行なうインサーキットエミュレータの
システム構成例を示す。
FIG. 3 shows a system configuration example of an in-circuit emulator that emulates a microcomputer system (user system) using the microprocessor of the above embodiment.

第3図において、1はユーザが開発しデバッグ対象と
なるユーザシステムとしてのマイクロコンピュータシス
テムボード、2は上記ユーザシステム1上のマイクロプ
ロセッサの機能を代行する代行マイクロプロセッサやエ
ミュレーション中ユーザシステムのバス上の信号をサン
プリングして蓄積するトレースメモリ、エミュレーショ
ンや各種デバッグ機能を実現するためのエミュレーショ
ン制御部、プログラムの実行開始やトレースの停止条件
を設定し、条件が成立したときにプログラムもしくはト
レースを停止させるブレークポイント制御部、ユーザシ
ステムにメモリが用意されていない場合に貸し出される
代行メモリ等が内蔵されてなるエミュレータボックスで
ある。このエミュレータボックス2はその本体から延長
されたケーブル3の先端のコネクタ3aが、ユーザシステ
ム1上に設けられたターゲットプロセッサ用のソケット
に挿入されることによりユーザシステムに接続される。
これとともに、エミュレータボックス2はその本体から
延長された別のケーブル4を介して、ホストコンピュー
タとの間のデータ通信を行なうシリアルインタフェース
やその制御を司るマイクロコンピュータ、フロッピディ
スクドライバ5a等が内蔵されたシステム開発装置本体5
に接続されている。
In FIG. 3, reference numeral 1 denotes a microcomputer system board as a user system which is developed and debugged by a user, and 2 is a substitute microprocessor which substitutes the function of the microprocessor on the user system 1 or on a bus of the user system during emulation. Trace memory that samples and accumulates signals, an emulation control unit to implement emulation and various debugging functions, sets program execution start and trace stop conditions, and stops the program or trace when the conditions are met An emulator box having a built-in breakpoint control unit and a proxy memory lent out when no memory is prepared in the user system. The emulator box 2 is connected to the user system by inserting a connector 3a at the end of a cable 3 extended from the main body into a socket for a target processor provided on the user system 1.
At the same time, the emulator box 2 has a built-in serial interface for performing data communication with a host computer, a microcomputer for controlling the serial interface, a floppy disk driver 5a, and the like via another cable 4 extended from the main body. System development device body 5
It is connected to the.

なお、上記装置本体5からは、プリンタ接続用ケーブ
ル6a、ホストコンピュータ接続用ケーブル6b、CRT表示
装置接続用ケーブル6cが延設されている。7はユーザシ
ステム1上から任意の信号をサンプリングするためのプ
ローブである。
A printer connection cable 6a, a host computer connection cable 6b, and a CRT display device connection cable 6c extend from the apparatus main body 5. Reference numeral 7 denotes a probe for sampling an arbitrary signal from the user system 1.

第4図には、上記ユーザシステム1の一構成例と、こ
れに接続されたエミュレータのうちトレースメモリのみ
が代表的に示されている。
FIG. 4 representatively shows a configuration example of the user system 1 and only a trace memory among emulators connected thereto.

第4図において、41が第1図に示されている本発明に
係るマイクロプロセッサで、このマイクロプロセッサ41
にはアドレスバスADBやデータバスDTB、制御バスCTB等
からなるシステムバス42を介して、プログラムやデータ
が格納されたメモリ43、ハードディスクコントローラ等
の周辺デバイス44、トレースメモリ21等が接続されてい
る。
In FIG. 4, reference numeral 41 denotes a microprocessor according to the present invention shown in FIG.
Is connected to a memory 43 storing programs and data, a peripheral device 44 such as a hard disk controller, a trace memory 21, and the like via a system bus 42 including an address bus ADB, a data bus DTB, a control bus CTB, and the like. .

次頁には、第3図のインサーキットエミュレータによ
り第1図の実施例のマイクロプロセッサを用いたユーザ
システム1のエミュレーションを行なってトレースメモ
リ21内に蓄積されたデータの一部が示されている。
The next page shows a part of data accumulated in the trace memory 21 by emulating the user system 1 using the microprocessor of the embodiment of FIG. 1 by the in-circuit emulator of FIG. .

上記データ列において、符号ABで示されている欄に属
するデータはアドレスバス上よりサンプリングされたデ
ータ群(絶対アドレス)、符号DBで示されている欄に属
するデータはデータバス上よりサンプリングされたデー
タ群、符号BCで示されている欄に属するデータはバイト
コードBC0〜BC3をサンプリングしたデータ群、R/Wはリ
ードライト制御信号、BATはバスアクセスタイプ信号を
サンプリングして理解し易いような符号に直して表示し
たものである。
In the above data string, data belonging to the column indicated by AB is a data group (absolute address) sampled from the address bus, and data belonging to the column indicated by DB is sampled from the data bus. Data group, data belonging to the column indicated by reference code BC are data groups obtained by sampling byte codes BC0 to BC3, R / W is a read / write control signal, and BAT is a bus access type signal, which is easy to understand by sampling. It is displayed after being changed to reference numerals.

上記データ列において、BAT欄にPGMと付されている行
のDB欄のコードが命令コードで、DATと付されている行
のDB欄のコードがリード・ライトデータである。また、
BAT欄にI/Pと付されている行にあるデータが特殊バスサ
イクル中にサンプリングしたデータである。この行のBC
欄を見ることによって次のデータ行のDB欄の命令コード
のうち上位/下位のいずれが実行されたのか知ることが
できる。
In the above data sequence, the code in the DB column of the row marked PGM in the BAT column is the instruction code, and the code in the DB column of the row marked DAT is the read / write data. Also,
The data in the row labeled I / P in the BAT column is data sampled during the special bus cycle. BC in this row
By looking at the column, it is possible to know which of the upper and lower instruction codes in the DB column of the next data line has been executed.

第5図には本発明の第2の実施例が示されている。 FIG. 5 shows a second embodiment of the present invention.

この実施例のマイクロプロセッサは、命令バッファ10
と命令デコーダ13および命令実行部20が4組設けられ、
一度に4つの命令を取り込んで、同時に4つの命令を並
行処理できるようにされている。これによって、マイク
ロプロセッサの処理速度が向上される。
The microprocessor of this embodiment includes an instruction buffer 10
, An instruction decoder 13 and four instruction execution units 20 are provided.
Four instructions are fetched at a time, and four instructions can be processed in parallel at the same time. Thereby, the processing speed of the microprocessor is improved.

ただし、このように4つの命令を平行処理できるよう
にしたとしても、実際には同時に取り込んだ4つの命令
のうちある命令は他の命令が実行された結果を待つ場合
があるので必ず同時に実行されるわけではない。従っ
て、例え命令バッファ10が1段のみであってもどの命令
が実行されるか外部からは分からない。
However, even if the four instructions can be processed in parallel in this way, actually, among the four instructions fetched at the same time, some instructions may wait for the result of execution of the other instruction, so they are always executed simultaneously. Not necessarily. Therefore, even if the instruction buffer 10 has only one stage, it is not known from the outside which instruction will be executed.

そこで、この実施例では、外部からの特殊バスサイク
ル発生要求信号BSRが入った場合に、1命令サイクル終
了ごとに次に実行される命令を外部のデータバス上に出
力させるための特殊バスサイクルを挿入する特殊バスサ
イクル発生回路19が設けられている。
Therefore, in this embodiment, when a special bus cycle generation request signal BSR from the outside is input, a special bus cycle for outputting the next instruction to be executed to the external data bus every one instruction cycle is completed. A special bus cycle generating circuit 19 to be inserted is provided.

この特殊バスサイクル発生回路19には、4つの命令実
行部20a〜20dから命令実行終了時にそれぞれ終了信号EN
D1〜END4が供給されるようにされている。また、上記終
了信号END1〜END4は命令アドレス制御回路15にも供給さ
れている。この命令アドレス制御回路15内にはプログラ
ムカウンタとこのプログラムカウンタ内のアドレスから
の相対値で命令アドレスを示す4つの命令ポインタが設
けられており、終了信号END1〜END4を受けると、対応す
る命令ポインタのみ更新される。そしてポインタの値が
特殊バスサイクル発生回路19に送られることにより、い
ずれの命令が実行されたか示す信号が制御バスCTB上に
出力される。
The special bus cycle generating circuit 19 outputs end signals EN from the four instruction execution units 20a to 20d when the instruction execution ends.
D1 to END4 are supplied. The end signals END1 to END4 are also supplied to the instruction address control circuit 15. The instruction address control circuit 15 is provided with a program counter and four instruction pointers indicating an instruction address by a relative value from the address in the program counter. When the end signals END1 to END4 are received, the corresponding instruction pointers are provided. Only updated. When the value of the pointer is sent to the special bus cycle generation circuit 19, a signal indicating which instruction has been executed is output on the control bus CTB.

この実施例のマイクロプロセッサは固定長命令形式に
特に有効である。
The microprocessor of this embodiment is particularly effective for the fixed-length instruction format.

第6図には第5図の実施例のマイクロプロセッサの変
形例が示されている。
FIG. 6 shows a modification of the microprocessor of the embodiment shown in FIG.

この実施例のマイクロプロセッサは、命令バッファ10
a〜10dと命令デコーダ13a〜13dとの間に切換回路31が付
加されている点のみ第5図の実施例と異なる。
The microprocessor of this embodiment includes an instruction buffer 10
5 differs from the embodiment of FIG. 5 only in that a switching circuit 31 is added between a to 10d and the instruction decoders 13a to 13d.

この実施例では、命令バッファ10a〜10dと命令デコー
ダ13a〜13dが一対一の関係になく、各命令バッファ10a
〜10dに取り込まれた命令コードは、いずれの命令デコ
ーダにも供給可能にされている。従って、同時に取り込
まれた4つの命令のうち一部が先に実行終了した場合、
空いた命令デコーダに次の命令コードを入れてやること
により効率良く命令を処理することができる。
In this embodiment, the instruction buffers 10a to 10d and the instruction decoders 13a to 13d are not in a one-to-one relationship.
The instruction code captured in ~ 10d can be supplied to any instruction decoder. Therefore, if some of the four instructions fetched at the same time end first,
The instruction can be processed efficiently by putting the next instruction code into the empty instruction decoder.

この実施例のマイクロプロセッサにも特殊バスサイク
ル発生回路19が設けられており、次に実行される命令の
コードと命令アドレスが外部に出力可能にされている。
The microprocessor of this embodiment is also provided with a special bus cycle generating circuit 19 so that the code of the next instruction to be executed and the instruction address can be output to the outside.

第7図には、本発明をキャッシュメモリ内蔵のマイク
ロプロセッサに適用した場合の実施例が示されている。
マイクロプロセッサ全体の構成は第1図のものとほぼ同
じである。以下、ハードウェアの違いを説明する。
FIG. 7 shows an embodiment in which the present invention is applied to a microprocessor having a built-in cache memory.
The configuration of the entire microprocessor is almost the same as that of FIG. Hereinafter, differences between hardware will be described.

第7図において、22はマイクロプロセッサに内蔵され
たキャッシュメモリである。外部バス制御回路11は、命
令コードを命令バッファ10に供与する機能および命令実
行部20からのデータアクセス要求に従って外部にデータ
アクセスする機能を有する。また、命令取込みの際に先
ずキャッシュメモリ22をアクセスし、ヒットしたときは
キャッシュメモリ内の命令コードを命令バッファ10へ供
与し、ミスヒットしたときはアドレスバスADBをアクセ
スして外部のメモリに命令を取りに行く機能を有してい
る。
In FIG. 7, reference numeral 22 denotes a cache memory built in the microprocessor. The external bus control circuit 11 has a function of providing an instruction code to the instruction buffer 10 and a function of accessing data externally in accordance with a data access request from the instruction execution unit 20. When the instruction is fetched, the cache memory 22 is accessed first, and if a hit occurs, the instruction code in the cache memory is supplied to the instruction buffer 10; if a miss occurs, the address bus ADB is accessed to access the external memory. It has the function of going to get.

特に制限されないが、外部バス制御回路11は、命令ア
ドレス制御回路15または演算処理部17より内部バス18を
介して供給される論理アドレスを物理アドレスに変換す
るアドレス変換テーブル11aを有している。
Although not particularly limited, the external bus control circuit 11 has an address conversion table 11a for converting a logical address supplied from the instruction address control circuit 15 or the arithmetic processing unit 17 via the internal bus 18 into a physical address.

この実施例では固定長命令形式のマイクロプロセッサ
を考えており、そのため命令アドレス制御回路15は、命
令フェッチポインタ15aとプログラムカウンタ15cを備え
ている。
In this embodiment, a microprocessor of a fixed-length instruction format is considered, and therefore, the instruction address control circuit 15 includes an instruction fetch pointer 15a and a program counter 15c.

さらに、この実施例のマイクロプロセッサでは、特殊
バスサイクル発生回路19によって挿入される特殊バスサ
イクルで、実行された命令のコードをデータバスDTB上
に出力するとともにプログラムカウンタ15c内の論理ア
ドレスを命令識別アドレスとしてアドレスバスADB上に
出力するように構成されている。
Further, in the microprocessor of this embodiment, in a special bus cycle inserted by the special bus cycle generation circuit 19, the code of the executed instruction is output onto the data bus DTB and the logical address in the program counter 15c is identified by the instruction. It is configured to output an address on the address bus ADB.

次に、上記マイクロプロセッサの動作について説明す
る。
Next, the operation of the microprocessor will be described.

外部バス制御回路11は、命令取込ポインタ15aの示す
アドレスを先ずアドレス変換テーブル11aで物理アドレ
スに変換し、それをキャッシュメモリ22に送って検索
し、ヒット信号Hを得るとキャッシュメモリ22から命令
コードを読み出し、命令バッファ10へ供与する。命令バ
ッファ10に取り込まれた命令コードは命令デコーダ13に
転送されてデコードされ、命令の種別、アドレッシング
モードの認識、即値生成、演算制御情報等が抽出され
る。この情報により、命令実行部20がデータの転送や演
算等の処理を行なう。
The external bus control circuit 11 first converts the address indicated by the instruction fetch pointer 15a into a physical address in the address conversion table 11a, sends it to the cache memory 22 for searching, and when the hit signal H is obtained, The code is read and provided to the instruction buffer 10. The instruction code taken into the instruction buffer 10 is transferred to the instruction decoder 13 and decoded, and the instruction type, addressing mode recognition, immediate value generation, operation control information, and the like are extracted. Based on this information, the instruction execution unit 20 performs processing such as data transfer and calculation.

そして、命令実行終了ごとに演算処理部16から命令実
行終了信号ENDが出力され、命令アドレス制御回路15お
よび特殊バスサイクル発生回路19に命令実行の終了通知
がなされる。命令アドレス制御回路15ではこの命令の終
了通知を受けると、プログラムカウンタ15cのインクリ
メントが行なわれる。
Then, each time the instruction execution is completed, the instruction processing end signal END is output from the arithmetic processing unit 16, and the instruction address control circuit 15 and the special bus cycle generation circuit 19 are notified of the completion of the instruction execution. When receiving the end notification of the instruction, the instruction address control circuit 15 increments the program counter 15c.

また、プログラムが分岐をする時は、命令実行部20に
おいて作成された分岐先命令アドレスが内部バス18を介
して命令アドレス制御回路15に供給され、プログラムカ
ウンタ15cおよび命令フェッチポインタ15aに設定され
る。
When the program branches, the branch destination instruction address created in the instruction execution unit 20 is supplied to the instruction address control circuit 15 via the internal bus 18 and set in the program counter 15c and the instruction fetch pointer 15a. .

一方、キャッシュメモリ22の検索でミスヒットしたと
きは、上記変換アドレス(物理アドレス)を外部のアド
レスバスADB上に出力し、データバスDTBを介して外部メ
モリから命令コードを取り込んで命令バッファ10に供与
する。また、取り込んだ命令は同時にキャッシュメモリ
22に送り、格納する。
On the other hand, if a miss occurs in the search of the cache memory 22, the translated address (physical address) is output to the external address bus ADB, the instruction code is fetched from the external memory via the data bus DTB, and stored in the instruction buffer 10. Grant. Also, the fetched instructions are simultaneously stored in the cache memory.
Send to 22 for storage.

命令の取込みは自動的に命令フェッチポインタ15aを
インクリメントしながら命令バッファ10が一杯になるま
で行なわれる。命令バッファ10が一杯になると、命令バ
ッファ10から信号FULLが命令アドレス制御回路15に供給
され、命令フェッチポインタ15aの更新が停止される。
Instruction fetching is performed until the instruction buffer 10 becomes full while automatically incrementing the instruction fetch pointer 15a. When the instruction buffer 10 becomes full, the signal FULL is supplied from the instruction buffer 10 to the instruction address control circuit 15, and the updating of the instruction fetch pointer 15a is stopped.

上記の通常動作モードでは、命令コードがキャッシュ
メモリ22内にある場合、プロセッサの外部からは内部の
実行命令が識別できない。この実施例では、外部から特
殊バスサイクル発生要求信号SBRを入れてやると、特殊
バスサイクル挿入モードに移行して内部で実行中の命令
コードおよびその命令の位置を示すアドレスを外部へ出
力する。本特殊モードでの動作は上記通常モードに加
え、プロセッサ内部で命令実行が行なわれ、命令実行の
終了信号ENDが出力されるごとに、特殊バスサイクル発
生回路19が外部バス制御回路11を制御して内部での命令
実行と並行して命令識別アドレスおよび実行命令コード
をそれぞれ空いているアドレスバスADB、データバスDTB
上にのせ、バスアクセスタイプまたはデータタイプを識
別するため信号を特殊バスサイクルであることを示すコ
ードとして制御バスCTB上に出力する。
In the normal operation mode described above, when the instruction code is in the cache memory 22, the execution instruction inside the processor cannot be identified from outside the processor. In this embodiment, when a special bus cycle generation request signal SBR is input from the outside, the mode shifts to a special bus cycle insertion mode, and an instruction code being executed internally and an address indicating the position of the instruction are output to the outside. In this special mode, in addition to the normal mode described above, the instruction is executed inside the processor, and every time the instruction execution end signal END is output, the special bus cycle generation circuit 19 controls the external bus control circuit 11. Address bus ADB and data bus DTB, each having an empty instruction identification address and execution instruction code in parallel with the internal instruction execution.
A signal for identifying the bus access type or the data type is output on the control bus CTB as a code indicating a special bus cycle.

これにより、プロセッサ外部の観測でプロセッサ内部
の実行命令語およびアドレスを識別できる。ただし、こ
のとき、キャッシュミスヒットに起因する本来の命令語
取込みやデータアクセスと競合する可能性はあるが、複
数のバスサイクルの要求が競合した場合、外部バス制御
回路11は予め定められた優先順位に応じて外部バスサイ
クルを発生させる。具体的には、特殊バスサイクル挿入
モードではデータアクセス要求やキャッシュミスヒット
に起因するバスサイクルに優先して特殊バスサイクルを
発生させるようになっている。
Thereby, the execution instruction word and the address inside the processor can be identified by the observation outside the processor. However, at this time, the external bus control circuit 11 may conflict with the original instruction word fetch or data access due to the cache miss, but when the requests of a plurality of bus cycles conflict, the external bus control circuit 11 An external bus cycle is generated according to the order. Specifically, in the special bus cycle insertion mode, a special bus cycle is generated prior to a bus cycle caused by a data access request or a cache mishit.

なお、キャッシュのミスヒットが発生した場合にプロ
セッサが外部メモリに命令を取りに行ったときの命令フ
ェッチサイクルの次には特殊バスサイクルを入れてもよ
いが入れないようにしてもよい。外部バスを監視してい
ればそのような命令フェッチサイクルを識別できるため
である。ただし、ミスヒットの際の命令フェッチサイク
ルの次にそれを外部に示す特殊バスサイクルを挿入しな
いようにすれば、ハードウェアは多少複雑になるが、特
殊バスサイクルのない分だけ高速化できるという利点が
ある。
A special bus cycle may or may not be inserted next to the instruction fetch cycle when the processor fetches an instruction from the external memory when a cache mishit occurs. This is because such instruction fetch cycle can be identified if the external bus is monitored. However, if a special bus cycle indicating the instruction fetch cycle at the time of a mishit is not inserted after the instruction fetch cycle, the hardware becomes slightly complicated, but the speed can be increased by the absence of the special bus cycle. There is.

第8図には、上記マイクロプロセッサを用いたシステ
ムにおいて次のプログラムを実行した場合の各バスの動
作タイミングが示されている。
FIG. 8 shows the operation timing of each bus when the following program is executed in the system using the microprocessor.

なお、第8図の動作タイミングは、命令a〜dがキャ
ッシュメモリ22内にすでに格納されている場合のタイミ
ングである。
The operation timing shown in FIG. 8 is a timing when the instructions a to d are already stored in the cache memory 22.

第8図を参照すると、バスサイクルS1ではプロセッサ
内部で命令aが実行され、バスサイクルS2ではプロセッ
サ内部で命令bが実行されるのと並行して外部データバ
ス上にサイクルS1で実行された命令コードaが、また外
部アドレスバス上にその命令アドレスが出力され、かつ
制御バス上には特殊バスサイクルであることを示すコー
ドが出力されていることが分かる。
Referring to FIG. 8, the instruction a executed in the processor in the bus cycle S1 and the instruction executed in the cycle S1 on the external data bus in parallel with the execution of the instruction b in the processor in the bus cycle S2. It can be seen that the code a is output on the external address bus and its instruction address is output, and the code indicating the special bus cycle is output on the control bus.

また、第8図では、次の命令c(MOV @R0.h,R1.W)
がデータアクセスを伴う命令であるため、プロセッサ内
部では命令cの実行が停止され、バスサイクルS3で特殊
バスサイクルが優先的に実行され、前のサイクルで実行
された命令bの命令コードとアドレスが出力されている
ことが分かる。そして、命令cの実行は特殊バスサイク
ルS3の次のサイクルS4で実行され、アドレスバス上には
所望のデータの位置を示すアドレスが、またデータバス
上にはリードデータがのっている。バスサイクルS4で実
行された命令cのコードとアドレスは次のバスサイクル
S5で外部に出力される。このとき、プロセッサ内では命
令dが並行して実行され、この命令dのコードとアドレ
スは次のバスサイクルS6で外部へ出力される。
In FIG. 8, the following instruction c (MOV@R0.h, R1.W)
Is an instruction accompanied by data access, the execution of the instruction c is stopped inside the processor, the special bus cycle is preferentially executed in the bus cycle S3, and the instruction code and address of the instruction b executed in the previous cycle are changed. You can see that it is output. The execution of the instruction c is executed in the next cycle S4 after the special bus cycle S3, and an address indicating a desired data position is on the address bus, and read data is on the data bus. The code and address of the instruction c executed in the bus cycle S4 are stored in the next bus cycle.
Output to the outside in S5. At this time, the instruction d is executed in parallel in the processor, and the code and address of the instruction d are output to the outside in the next bus cycle S6.

なお、第7図の実施例のマイクロプロセッサでは、特
殊バスサイクルで実行命令のアドレスを論理アドレスで
出力するようにしてるが、プログラムカウンタ15cから
特殊バスサイクル発生回路19に供給される命令識別アド
レスをアドレス変換テーブル11aを通すことによって物
理アドレスとして出力するようにしてもよい。
In the microprocessor of the embodiment shown in FIG. 7, the address of the execution instruction is output as a logical address in the special bus cycle. However, the instruction identification address supplied to the special bus cycle generation circuit 19 from the program counter 15c is used. It may be output as a physical address by passing through the address conversion table 11a.

また、第7図の実施例では固定長命令を扱うマイクロ
プロセッサを示したが、第1図の実施例と同じように、
命令バッファを2組設けるとともに、命令アドレス制御
回路15内に命令コードポインタ15bを付加することで可
変長命令を扱い、しかもキャッシュメモリ内蔵したマイ
クロプロセッサに本発明を適用することも可能である。
Although the embodiment of FIG. 7 shows a microprocessor that handles fixed-length instructions, as in the embodiment of FIG.
By providing two sets of instruction buffers and adding an instruction code pointer 15b in the instruction address control circuit 15, variable-length instructions can be handled, and the present invention can be applied to a microprocessor with a built-in cache memory.

以上説明したように上記実施例では、予め複数の命令
を保持可能なバッファもしくはメモリを有するマイクロ
プロセッサに、ある所定の動作モードでは1命令実行ご
とにプロセッサの内部情報を外部へ出力するための特殊
バスサイクルを挿入する機能を持たせるようにしたの
で、命令プリフェッチ方式のマイクロプロセッサを用い
たシステムのエミュレーションにおいて、いずれの命令
が実行されたか外部で容易に知ることができるため、正
確なエミュレーション制御が可能になるとともに、トレ
ースデータの解析が容易となりデバッグ効率が向上する
という効果がある。
As described above, in the above embodiment, the microprocessor having a buffer or a memory capable of holding a plurality of instructions in advance is provided with a special operation mode for outputting internal information of the processor to the outside each time one instruction is executed in a predetermined operation mode. With the function to insert bus cycles, the emulation of a system using an instruction prefetch type microprocessor can be easily known externally as to which instruction was executed. This makes it possible to analyze trace data easily and improve debugging efficiency.

また、本来不用な特殊バスサイクルが挿入されるた
め、完全なリアルタイム性はないが挿入されるのは1サ
イクルのみであるため、割込み機能等で所定の命令列を
実行して内部情報を外部へ知らせる従来方式に比べる
と、リアルタイム性はほとんど損なわれない。
Also, since a special bus cycle which is originally unnecessary is not inserted, there is no complete real-time property, but only one cycle is inserted. Therefore, a predetermined instruction sequence is executed by an interrupt function or the like to send internal information to the outside. The real-time property is hardly impaired as compared with the conventional method of notifying.

以上本発明者によってなされた発明を実施例に基づき
具体的に説明したが、本発明は上記実施例に限定される
ものではなく、その要旨を逸脱しない範囲で種々変更可
能であることはいうまでもない。例えば、上記実施例で
は特殊バスサイクル挿入モードを外部ピンからの特殊バ
スサイクル発生要求信号SBRに基づいて行なっている
が、特殊バスサイクル発生回路19内にフラグもしくはレ
ジスタを設け、そこへの書込みによって特殊バスサイク
ル挿入モードへ移行させるようにしてもよい。
Although the invention made by the inventor has been specifically described based on the embodiments, the present invention is not limited to the above-described embodiments, and various changes can be made without departing from the gist of the invention. Nor. For example, in the above embodiment, the special bus cycle insertion mode is performed based on the special bus cycle generation request signal SBR from the external pin, but a flag or a register is provided in the special bus cycle generation circuit 19, and writing to the special bus cycle generation circuit 19 is performed. The mode may be shifted to the special bus cycle insertion mode.

以上の説明では主として本発明者によってなされた発
明をその背景となった利用分野であるマイクロプロセッ
サに適用した場合について説明したが、この発明はそれ
に限定されるものでなく、シングルチップマイコンその
他プログラム制御方式のデータ処理装置一般に利用する
ことができる。
In the above description, the case where the invention made by the present inventor is mainly applied to a microprocessor which is a utilization field as a background has been described. However, the present invention is not limited to this, and a single chip microcomputer or other program control It can be used for general-purpose data processing devices.

[発明の効果] 本願において開示される発明のうち代表的なものによ
って得られる効果を簡単に説明すれば下記のとおりであ
る。
[Effects of the Invention] The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、ピン数を増加させたり、複雑な外付け回路
を設けることなく、命令プリフェッチ方式のマイクロプ
ロセッサにおいて実行中の命令アドレス等内部情報を外
部へ知らせることができる。
That is, the internal information such as the instruction address being executed in the instruction prefetch type microprocessor can be notified to the outside without increasing the number of pins or providing a complicated external circuit.

また、リアルタイム性を損なうことなく内部情報を外
部へ知らせることができるとともに、必要とする情報量
の増加に対する柔軟性の高いマイクロプロセッサを実現
することができる。
In addition, it is possible to realize a microprocessor that can notify internal information to the outside without deteriorating the real-time property and that is highly flexible with respect to an increase in required information amount.

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

第1図は本発明に係るマイクロプロセッサの第1の実施
例を示すブロック図、 第2図はその特殊バスサイクル挿入モードでの動作タイ
ミングチャート、 第3図はインサーキットエミュレータの構成例を示す斜
視図、 第4図は本発明に係るマイクロプロセッサを用いたいた
マイクロコンピュータシステムとそのエミュレーション
システムの一部を示すブロック図、 第5図は本発明に係るマイクロプロセッサの第2の実施
例を示すブロック図、 第6図は本発明に係るマイクロプロセッサの第3の実施
例を示すブロック図、 第7図は本発明に係るマイクロプロセッサの第4の実施
例を示すブロック図、 第8部はその特殊バスサイクル挿入モードでの動作タイ
ミングを示すチャートである。 1……ユーザシステム(マイクロコンピュータシステ
ム)、2……エミュレータボックス、3,4……ケーブ
ル、5……システム開発装置本体、11……外部バス制御
回路、15……命令アドレス制御回路、18……システムバ
ス、19……特殊バスサイクル発生回路、20……命令実行
部。
FIG. 1 is a block diagram showing a first embodiment of a microprocessor according to the present invention, FIG. 2 is an operation timing chart in a special bus cycle insertion mode, and FIG. 3 is a perspective view showing a configuration example of an in-circuit emulator. FIG. 4 is a block diagram showing a microcomputer system using a microprocessor according to the present invention and a part of its emulation system. FIG. 5 is a block diagram showing a second embodiment of the microprocessor according to the present invention. FIG. 6 is a block diagram showing a third embodiment of the microprocessor according to the present invention. FIG. 7 is a block diagram showing a fourth embodiment of the microprocessor according to the present invention. 5 is a chart showing operation timing in a bus cycle insertion mode. 1 ... User system (microcomputer system), 2 ... Emulator box, 3,4 ... Cable, 5 ... System development device body, 11 ... External bus control circuit, 15 ... Instruction address control circuit, 18 ... ... system bus, 19 ... special bus cycle generation circuit, 20 ... instruction execution unit.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 近藤 芳行 群馬県高崎市西横手町111番地 株式会 社日立製作所高崎工場内 (72)発明者 橋本 幸治 東京都小平市上水本町5丁目22番1号 日立マイクロコンピュータエンジニアリ ング株式会社内 (56)参考文献 特開 平1−201737(JP,A) 特開 平1−137339(JP,A) (58)調査した分野(Int.Cl.6,DB名) G06F 11/28 - 11/34 ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Yoshiyuki Kondo 111 Nishiyokote-cho, Takasaki City, Gunma Prefecture Inside the Takasaki Plant of Hitachi, Ltd. No. Hitachi Microcomputer Engineering Co., Ltd. (56) References JP-A-1-201737 (JP, A) JP-A-1-137339 (JP, A) (58) Fields studied (Int. Cl. 6 , (DB name) G06F 11/28-11/34

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プログラムデバッグのためのエミュレーシ
ョン中のバス上の信号を採取し、蓄積するためのトレー
スメモリと、マイクロプロセッサと、上記トレースメモ
リへの信号採取および上記を停止させるためのブレーク
ポイント制御回路とを備えたインサーキットエミュレー
タおいて、 上記マイクロプロセッサは、 外部のメモリから取り込まれた複数の命令を保持する命
令バッファと、 上記命令バッファに結合され、取り込まれた命令をデコ
ードし、デコード結果を出力する命令デコーダと、 上記命令デコーダに結合され、デコード結果に従って命
令に対応した処理を実行する命令実行部と、上記命令実
行部に結合され、上記命令バッファに取り込む命令のア
ドレスを保持する命令フェッチポインタを含むアドレス
制御回路と、 上記命令バッファと上記命令実行部と上記アドレス制御
回路とに結合され、上記ブレークポイント制御回路から
の特殊バスサイクル要求信号と上記命令実行部から出力
される1命令の終了を示す信号とに基づいて、一の命令
の実行後次の命令の実行前に、プログラムのデバッグを
可能にするための内部情報を外部へ出力するバスサイク
ルを挿入する機能を有するバスサイクル制御回路と、 から構成され、上記命令バッファと命令デコーダと命令
実行部とアドレス制御回路とバスサイクル制御回路が一
つの半導体チップ上に形成されてなることを特徴とする
インサーキットエミュレータ。
1. A trace memory for collecting and accumulating signals on a bus during emulation for program debugging, a microprocessor, and a breakpoint control for collecting signals to the trace memory and stopping the above. An in-circuit emulator comprising: an instruction buffer for holding a plurality of instructions fetched from an external memory; an instruction buffer coupled to the instruction buffer, decoding the fetched instruction, and a decoding result. An instruction decoder coupled to the instruction decoder and executing a process corresponding to the instruction in accordance with the decoding result; and an instruction coupled to the instruction execution unit and holding an address of the instruction to be taken into the instruction buffer. An address control circuit including a fetch pointer; An instruction buffer coupled to the instruction execution unit and the address control circuit, based on a special bus cycle request signal from the breakpoint control circuit and a signal indicating the end of one instruction output from the instruction execution unit. A bus cycle control circuit having a function of inserting a bus cycle for outputting internal information to enable external debugging of a program after execution of one instruction and before execution of the next instruction; An in-circuit emulator wherein a buffer, an instruction decoder, an instruction execution unit, an address control circuit, and a bus cycle control circuit are formed on one semiconductor chip.
【請求項2】上記バスサイクル制御回路は、上記内部情
報として実行された命令を示す信号を出力することを特
徴とする請求項1に記載のインサーキットエミュレー
タ。
2. The in-circuit emulator according to claim 1, wherein said bus cycle control circuit outputs a signal indicating an instruction executed as said internal information.
【請求項3】複数の命令を並行して実行可能なマイクロ
プロセッサであって、 外部のメモリから取り込まれた複数の命令を保持する複
数の命令バッファと、 上記命令バッファに結合され、取り込まれた命令をデコ
ードし、デコード結果を出力する命令デコーダと、 上記命令デコーダに結合され、デコード結果に従って複
数の命令に対応した処理を並行して実行する命令実行部
と、 上記命令実行部に結合され、上記命令バッファに取り込
む命令のアドレスを保持する命令フェッチポインタを含
むアドレス制御回路と、 上記命令バッファと上記命令実行部と上記アドレス制御
回路とに結合され、特殊バスサイクル要求信号と上記命
令実行部から出力される1命令の終了を示す信号とに基
づいて、異なる2つの命令の実行間に、プログラムのデ
バッグを可能にするための内部情報を外部へ出力するバ
スサイクルを挿入する機能を有するバスサイクル制御回
路と、 から構成され、上記命令バッファと命令デコーダと命令
実行部とアドレス制御回路とバスサイクル制御回路が一
つの半導体チップ上に形成されてなることを特徴とする
マイクロプロセッサ。
3. A microprocessor capable of executing a plurality of instructions in parallel, comprising: a plurality of instruction buffers for holding a plurality of instructions fetched from an external memory; An instruction decoder for decoding an instruction and outputting a decoded result; an instruction executing unit coupled to the instruction decoder, for executing processes corresponding to a plurality of instructions in parallel according to the decoded result; An address control circuit including an instruction fetch pointer for holding an address of an instruction to be fetched into the instruction buffer; and an instruction control unit coupled to the instruction buffer, the instruction execution unit, and the address control circuit. Between the execution of two different instructions based on the output signal indicating the end of one instruction. And a bus cycle control circuit having a function of inserting a bus cycle for outputting internal information for enabling internal buses to the outside. A microprocessor, wherein the control circuit is formed on one semiconductor chip.
【請求項4】上記バスサイクル制御回路は、上記内部情
報を示す信号として実行された命令を示す信号を出力す
ることを特徴とする請求項3に記載のマイクロプロセッ
サ。
4. The microprocessor according to claim 3, wherein said bus cycle control circuit outputs a signal indicating an executed instruction as a signal indicating said internal information.
【請求項5】上記特殊バスサイクル要求信号は、当該マ
イクロプロセッサの外部もしくは内部の所定回路から供
給されることを特徴とする請求項3または4に記載のマ
イクロプロセッサ。
5. The microprocessor according to claim 3, wherein the special bus cycle request signal is supplied from a predetermined circuit external or internal to the microprocessor.
JP2104700A 1990-04-20 1990-04-20 In-circuit emulator and microprocessor Expired - Fee Related JP2923570B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2104700A JP2923570B2 (en) 1990-04-20 1990-04-20 In-circuit emulator and microprocessor
KR1019910006125A KR910018909A (en) 1990-04-20 1991-04-17 Data processing device and system development device using the same
EP91303435A EP0453268B1 (en) 1990-04-20 1991-04-17 A microprocessor for inserting a bus cycle to output an internal information for an emulation
DE69127992T DE69127992T2 (en) 1990-04-20 1991-04-17 Microprocessor for inserting a bus cycle to provide information for an emulation
US08/201,488 US5564041A (en) 1990-04-20 1994-02-24 Microprocessor for inserting a bus cycle in an instruction set to output an internal information for an emulation
HK98102618A HK1003603A1 (en) 1990-04-20 1998-03-27 A microprocessor for inserting a bus cycle to output an internal information for an emulation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2104700A JP2923570B2 (en) 1990-04-20 1990-04-20 In-circuit emulator and microprocessor

Publications (2)

Publication Number Publication Date
JPH043230A JPH043230A (en) 1992-01-08
JP2923570B2 true JP2923570B2 (en) 1999-07-26

Family

ID=14387759

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2104700A Expired - Fee Related JP2923570B2 (en) 1990-04-20 1990-04-20 In-circuit emulator and microprocessor

Country Status (1)

Country Link
JP (1) JP2923570B2 (en)

Also Published As

Publication number Publication date
JPH043230A (en) 1992-01-08

Similar Documents

Publication Publication Date Title
US5127103A (en) Real-time tracing of dynamic local data in high level languages in the presence of process context switches
US5560036A (en) Data processing having incircuit emulation function
US5564041A (en) Microprocessor for inserting a bus cycle in an instruction set to output an internal information for an emulation
KR100439781B1 (en) A data processor, an operation method thereof, a method of executing the debugging operation, and a method of correcting a disadvantage value among the data processor
JP2003085000A (en) Trace information generating apparatus and method
KR100309615B1 (en) High Speed Programmable Logic Controllers (PLC)
EP0762277A1 (en) Data processor with built-in emulation circuit
EP0762279A1 (en) Data processor with built-in emulation circuit
CN104380264B (en) Run time examining report
GB2200484A (en) Detecting and handling memory-mapped i/o by a pipelined computer
US5263153A (en) Monitoring control flow in a microprocessor
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
TW201530320A (en) Data processing apparatus and semiconductor integrated circuit device
HK1003603B (en) A microprocessor for inserting a bus cycle to output an internal information for an emulation
CN104704474A (en) Hardware based run-time instrumentation facility for managed run-times
US5574887A (en) Apparatus and method for emulation routine pointer prefetch
CN104169887A (en) Run-time instrumentation indirect sampling by instruction operation code
US5361389A (en) Apparatus and method for emulation routine instruction issue
US5408622A (en) Apparatus and method for emulation routine control transfer via host jump instruction creation and insertion
CA2003004C (en) Apparatus and method for executing a conditional branch instruction
JPS63193239A (en) Instruction order monitoring device and method
JP2923570B2 (en) In-circuit emulator and microprocessor
US5440757A (en) Data processor having multistage store buffer for processing exceptions
JPS62197831A (en) Data processor
JPH04284546A (en) Data processor and system developing device using the same

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees