JPH04288633A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH04288633A
JPH04288633A JP3021863A JP2186391A JPH04288633A JP H04288633 A JPH04288633 A JP H04288633A JP 3021863 A JP3021863 A JP 3021863A JP 2186391 A JP2186391 A JP 2186391A JP H04288633 A JPH04288633 A JP H04288633A
Authority
JP
Japan
Prior art keywords
microprocessor
instruction
address
xyz
execution
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.)
Pending
Application number
JP3021863A
Other languages
Japanese (ja)
Inventor
Norio Masui
桝井 規雄
Shigeo Mizugaki
水垣 重生
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP3021863A priority Critical patent/JPH04288633A/en
Publication of JPH04288633A publication Critical patent/JPH04288633A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To take out internal information to the external without an emulation monitor program and a context switch by transferring internal information indicating the execution condition of a microprocessor itself to an external memory and jumping the control to a program counter value. CONSTITUTION:When the microprocessor fetches an instruction (2)11-2 at address (xyz), an instruction alpha12-1 is forcibly fetched by the action of hardware control on the outside of the microprocessor. After execution of an instruction (1)11-1 at address (xyz-1), contents of a register where context information of the microprocessor is held are transferred to the designated address of an external memory and increment of the program counter is suppressed by execution of the instruction alpha 12-1. Consequently, the program counter value fetched after execution of the instruction alpha12-1 indicates address (xyz) as it is, and the microprocessor jumps to its own program counter value.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】この発明はマイクロプロセッサの
開発支援用の命令を備えたマイクロプロセッサに関する
ものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor equipped with instructions for supporting microprocessor development.

【0002】0002

【従来の技術】マイクロコンピュータを用いたシステム
の開発支援装置として、エミュレータ(通称in − 
circait emulator , ICE)装置
がある。そして、このエミュレータは、目的システム上
のマイクロプロセッサの代わりに接続され、マイクロプ
ロセッサに入力される信号を全て取り込む。エミュレー
タ内では、目的システム上のマイクロプロセッサの動作
を完全にシミュレートし、動作中のマイクロプロセッサ
の内部状態を外部に取り出すことができる。以下、エミ
ュレータにおいて、ある番地の命令を実行する直前のマ
イクロプロセッサ内部の情報を外部に取り出す動作につ
いて図3を用いて説明する。ここで、マイクロプロセッ
サ内部の情報とは、レジスタの内容等のコンテキスト相
当情報のことである。
[Prior Art] Emulators (commonly known as in-
There is a circuit emulator (ICE) device. This emulator is connected in place of the microprocessor on the target system and captures all signals input to the microprocessor. Inside the emulator, the operation of the microprocessor on the target system can be completely simulated, and the internal state of the microprocessor during operation can be extracted to the outside. Hereinafter, the operation of retrieving the internal information of the microprocessor to the outside immediately before executing an instruction at a certain address in the emulator will be explained using FIG. 3. Here, the information inside the microprocessor refers to information equivalent to the context such as the contents of registers.

【0003】図3はエミュレータにおいて従来のマイク
ロプロセッサの内部情報を取り出す動作の一例を示す模
式図である。この図3において、11−1および11−
2はユーザプログラムの命令(1)および命令(2)を
示し、13はブレイク命令、14はエミュレータモニタ
プログラムである。そして、ここではマイクロプロセッ
サ(xyz−1)番地の命令(1)11−1、(xyz
)番地の命令(2)11−2を順に実行するものとし、
(xyz)番地の命令(2)11−2の実行直前のマイ
クロプロセッサの内部情報を取り出すものとする。
FIG. 3 is a schematic diagram showing an example of the operation of extracting internal information of a conventional microprocessor in an emulator. In this FIG. 3, 11-1 and 11-
2 indicates instructions (1) and (2) of the user program, 13 is a break instruction, and 14 is an emulator monitor program. And here, the instruction (1) 11-1, (xyz-1) of the microprocessor address (xyz-1)
) address (2) 11-2 shall be executed in order,
Assume that the internal information of the microprocessor immediately before execution of instruction (2) 11-2 at address (xyz) is retrieved.

【0004】つぎに動作について説明する。まず、マイ
クロプロセッサが、(xyz)番地の命令(2)11−
2をフェッチする時点でマイクロプロセッサ外部の図示
しない手段によるハードウエア制御の作用によりブレイ
ク命令13を強制フェッチさせる。そして、(xyz−
1)番地の命令(1)11−1の実行後に、ブレイク命
令13の実行により割り込みをかけ、ユーザプログラム
を中断してコンテキスト情報を退避し、エミュレータモ
ニタプログラム14を起動する。つぎに、このエミュレ
ータモニタプログラム14の実行により、マイクロプロ
セッサの内部情報を外部に取り出す。そして、エミュレ
ータモニタプログラム14の実行終了後、ユーザプログ
ラムのコンテキスト情報を復帰させ、(xyz)番地の
本来実行すべき命令(2)11−2をフェッチし、ユー
ザプログラムの実行を再開する。
[0004] Next, the operation will be explained. First, the microprocessor executes the instruction (2) 11- at address (xyz).
At the time of fetching the break instruction 13, the break instruction 13 is forcibly fetched by means of hardware control by means not shown outside the microprocessor. And (xyz-
1) After the instruction at address (1) 11-1 is executed, an interrupt is generated by executing the break instruction 13, the user program is interrupted, context information is saved, and the emulator monitor program 14 is activated. Next, by executing the emulator monitor program 14, the internal information of the microprocessor is extracted to the outside. After the execution of the emulator monitor program 14 is completed, the context information of the user program is restored, the instruction (2) 11-2 at the address (xyz) that is originally to be executed is fetched, and the execution of the user program is resumed.

【0005】[0005]

【発明が解決しようとする課題】解決しようとする問題
点は、従来のマイクロプロセッサは、以上のような方式
でプログラム実行中の内部情報を外部に取り出していた
が、マイクロプロセッサの内部情報を外部に取り出すに
は、エミュレータモニタプログラムが必要である点であ
る。また、従来のマイクロプロセッサでは、コンテキス
トスイッチングを伴うためリアルタイム性を損なうとい
う課題があった。
[Problem to be solved by the invention] The problem to be solved is that conventional microprocessors take out internal information during program execution to the outside using the method described above. The point is that you need an emulator monitor program to take it out. Furthermore, conventional microprocessors have the problem of impairing real-time performance due to context switching.

【0006】この発明はかかる課題を解決するためにな
されたもので、エミュレータモニタプログラムおよびコ
ンテキストスイッチング無しで内部情報を外部に取り出
せるマイクロプロセッサを得ることを目的とする。
The present invention has been made to solve the above problems, and an object of the present invention is to provide a microprocessor that can extract internal information to the outside without an emulator monitor program or context switching.

【0007】[0007]

【課題を解決するための手段】この発明は、マイクロプ
ロセッサのコンテキスト等、マイクロプロセッサ自身の
実行状況を示す内部情報を外部メモリに転送し、かつ自
分自身のプログラムカウンタ値にジャンプする機能を持
つ命令を備えたものである。
[Means for Solving the Problems] The present invention provides an instruction that has the function of transferring internal information indicating the execution status of the microprocessor itself, such as the context of the microprocessor, to an external memory and jumping to its own program counter value. It is equipped with the following.

【0008】[0008]

【作用】この発明においては、エミュレータにおいて、
マイクロプロセッサがある命令をフェッチする時点で、
マイクロプロセッサの内部情報を外部メモリ(図示せず
)に吐き出すとともに自分自身のプログラムカウンタ値
にジャンプする命令を強制フェッチさせることにより、
マイクロプロセッサの内部情報を外部に取り出した後、
本来実行すべき命令を再度フェッチして実行し、その後
のユーザプログラムを矛盾なく実行する。
[Operation] In this invention, in the emulator,
At the point when a microprocessor fetches an instruction,
By discharging the internal information of the microprocessor to an external memory (not shown) and forcibly fetching an instruction to jump to its own program counter value,
After extracting the internal information of the microprocessor to the outside,
To fetch and execute an instruction that should originally be executed again, and to execute a subsequent user program without contradiction.

【0009】[0009]

【実施例】図1はこの発明によるマイクロプロセッサの
一実施例における実行命令の流れを示す模式図で、命令
プリフェッチを行わない低位マイクロプロセッサの場合
において、実行命令の流れの例を示すものである。この
図1において図3と同一符号のものは相当部分を示し、
12−1は命令αで、この命令α12−1はマイクロプ
ロセッサのコンテキスト情報を保持するレジスタの内容
を図示しない手段により指定したアドレスの外部メモリ
に転送するとともに、プログラムカウンタのインクリメ
ントを抑止する機能を持つ。そして、この命令α12−
1は、マイクロプロセッサのコンテキスト等、マイクロ
プロセッサ自身の実行状況を示す内部情報を外部メモリ
に転送し、かつ自分自身のプログラムカウンタ値にジャ
ンプする機能を持つ命令である。
[Embodiment] FIG. 1 is a schematic diagram showing the flow of executed instructions in an embodiment of a microprocessor according to the present invention, and shows an example of the flow of executed instructions in the case of a low-level microprocessor that does not perform instruction prefetching. . In FIG. 1, the same reference numerals as in FIG. 3 indicate corresponding parts,
12-1 is an instruction α, and this instruction α12-1 has a function to transfer the contents of a register that holds context information of the microprocessor to an external memory at a specified address by means not shown, and also to suppress incrementing of the program counter. have And this command α12-
1 is an instruction having a function of transferring internal information indicating the execution status of the microprocessor itself, such as the context of the microprocessor, to an external memory and jumping to its own program counter value.

【0010】そして、命令プリフェッチを行わないマイ
クロプロセッサの場合、命令フェッチ用のプログラムカ
ウンタの計算は全て命令実行と同期して制御されるため
、プログラムカウンタのインクリメントを抑止すること
により、自分自身のプログラムカウンタ値にジャンプす
る機能を実現できる。ここでは、マイクロプロセッサが
(xyz−1)番地の命令(1)11−1、(xyz)
番地の命令(2)11−2を順に実行するものとし、こ
の(xyz)番地の命令(2)11−2の実行直前のマ
イクロプロセッサの内部情報を取り出すものとする。マ
イクロプロセッサが、(xyz)番地の命令(2)11
−2をフェッチする時点でマイクロプロセッサ外部の図
示しない手段によるハードウエア制御の作用により命令
α12−1を強制フェッチさせる。そして、(xyz−
1)番地の命令(1)11−1の実行後に、命令α12
−1の実行により、マイクロプロセッサのコンテキスト
情報を保持するレジスタの内容を図示しない手段で指定
されたアドレスの外部メモリに転送するとともに、プロ
グラムカウンタのインクリメントを抑止する。したがっ
て、命令α12−1実行後にフェッチするプログラムカ
ウンタ値は(xyz)番地のままであり、自分自身のプ
ログラムカウンタ値にジャンプする。(xyz)番地に
は本来実行すべき命令(2)11−2が保持されており
、命令α12−1実行後も本来のユーザプログラムを矛
盾なく実行できる。
In the case of a microprocessor that does not perform instruction prefetching, all calculations of the program counter for instruction fetching are controlled in synchronization with instruction execution. A function to jump to the counter value can be realized. Here, the microprocessor executes the instruction (1)11-1 at address (xyz-1), (xyz)
It is assumed that the instruction (2) 11-2 at address (xyz) is executed in order, and the internal information of the microprocessor immediately before the instruction (2) 11-2 at address (xyz) is executed is extracted. The microprocessor executes the instruction (2) 11 at address (xyz)
-2, the instruction α12-1 is forcibly fetched by means of hardware control by means not shown outside the microprocessor. And (xyz-
1) After executing the instruction at address (1) 11-1, the instruction α12
-1, the contents of the register holding the context information of the microprocessor are transferred to the external memory at the specified address by means not shown, and the increment of the program counter is suppressed. Therefore, the program counter value fetched after execution of the instruction α12-1 remains at the (xyz) address and jumps to its own program counter value. The instruction (2) 11-2 that should originally be executed is held at address (xyz), and the original user program can be executed without contradiction even after the instruction α12-1 is executed.

【0011】つぎに、この発明の他の実施例を図2を用
いて説明する。この図2は命令プリフェッチを行う高位
マイクロプロセッサの場合の実施例において、命令フェ
ッチ動作を示す模式図である。この図2において、命令
1,2・・・6はユーザプログラムの命令であり、12
−2はこの発明により備えた命令βである。ここでは、
簡単のため3段のパイプラインのマイクロプロセッサと
する。そして、この命令β12−2は図1における命令
α12−1と同様、マイクロプロセッサのコンテキスト
情報を保持するレジスタの内容を図示しない手段により
指定したアドレスの外部メモリに転送する機能を持つと
ともに、自分自身のプログラムカウンタ値にジャンプす
る機能を持つ。ここでは、マイクロプロセッサが(xy
z−2)番地から(xyz+3)番地に順に保持された
ユーザプログラムの命令1〜6を順に実行するものとし
、(xyz)番地の命令3の実行直前のマイクロプロセ
ッサの内部情報を取り出すものとする。
Next, another embodiment of the present invention will be explained using FIG. 2. FIG. 2 is a schematic diagram showing an instruction fetch operation in an embodiment of a high-level microprocessor that performs instruction prefetch. In this FIG. 2, instructions 1, 2, . . . 6 are instructions of the user program, and instructions 12
-2 is the instruction β provided according to the present invention. here,
For simplicity, a three-stage pipeline microprocessor is used. This instruction β12-2, like the instruction α12-1 in FIG. It has a function to jump to the program counter value. Here, the microprocessor (xy
It is assumed that instructions 1 to 6 of the user program held in order from address z-2) to address (xyz+3) are executed in order, and internal information of the microprocessor immediately before execution of instruction 3 at address (xyz) is extracted. .

【0012】そして、マイクロプロセッサが、(xyz
)番地の命令3をフェッチする時点でマイクロプロセッ
サ外部の図示しない手段によるハードウエア制御の作用
により命令β12−2を強制フェッチさせる。命令プリ
フェッチを行うマイクロプロセッサの命令フェッチ用プ
ログラムカウンタ計算は命令実行とは無関係に行われる
ため、命令β12−2の強制フェッチ後も後続の(xy
z+1)、(xyz+2)番地から引続き命令5、命令
6をフェッチする。命令β12−2が実行されると、マ
イクロプロセッサのコンテキスト情報を保持するレジス
タ(図示せず)の内容を図示しない手段で指定されたア
ドレスの外部メモリに転送するとともに、自分自身のプ
ログラムカウンタ値(xyz)番地にジャンプする。 したがって、キュー、パイプラインの類は全て初期化さ
れた後、再度(xyz)番地の命令3から順次フェッチ
され、命令β12−2実行後も本来のユーザプロブラム
を矛盾なく実行できる。
[0012] Then, the microprocessor (xyz
) At the time of fetching the instruction 3 at address ), the instruction β12-2 is forcibly fetched by the action of hardware control by means not shown outside the microprocessor. Since the instruction fetch program counter calculation of a microprocessor that performs instruction prefetch is performed independently of instruction execution, the subsequent (xy
Instructions 5 and 6 are subsequently fetched from addresses z+1) and (xyz+2). When instruction β12-2 is executed, it transfers the contents of a register (not shown) that holds context information of the microprocessor to the external memory at the specified address by means not shown, and also transfers its own program counter value ( xyz) Jump to address. Therefore, after all the queues and pipelines are initialized, they are sequentially fetched again starting from instruction 3 at address (xyz), and the original user program can be executed without contradiction even after execution of instruction β12-2.

【0013】[0013]

【発明の効果】以上説明したようにこの発明のマイクロ
プロセッサは、マイクロプロセッサのコンテキスト情報
を保持するレジスタの内容を外部メモリに転送し、かつ
自分自身のプログラムカウンタ値にジャンプする機能を
持つ命令を備え、マイクロプロセッサがある命令をフェ
ッチする時点で、マイクロプロセッサの内部情報を外部
メモリに吐き出すとともに自分自身のプログラムカウン
タ値にジャンプする命令を強制フェッチさせることによ
り、マイクロプロセッサの内部情報を外部に取り出した
後、本来実行すべき命令を再度フェッチして実行し、そ
の後のユーザプログラムを矛盾なく実行するようにした
ので、エミュレータモニタプログラム無しでマイクロプ
ロセッサの内部情報を外部に取り出すことができる効果
がある。また、マイクロプロセッサの内部情報を外部に
取り出す際にコンテキストスイッチングを伴わないため
、リアルタイム性を損なわない効果がある。
[Effects of the Invention] As explained above, the microprocessor of the present invention has an instruction that has the function of transferring the contents of the register that holds the microprocessor's context information to external memory and jumping to its own program counter value. When the microprocessor fetches a certain instruction, the microprocessor's internal information is flushed out to external memory and an instruction that jumps to its own program counter value is forcibly fetched, thereby extracting the microprocessor's internal information to the outside. After that, the instruction that should have been executed is fetched and executed again, and the subsequent user program is executed without any contradiction.This has the effect of allowing the internal information of the microprocessor to be retrieved externally without the need for an emulator monitor program. . Furthermore, since context switching is not involved when extracting the internal information of the microprocessor to the outside, there is an effect that real-time performance is not impaired.

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

【図1】この発明によるマイクロプロセッサの一実施例
において、実行命令の流れを示す模式図である。
FIG. 1 is a schematic diagram showing the flow of execution instructions in an embodiment of a microprocessor according to the present invention.

【図2】この発明の他の実施例において、命令フェッチ
動作を示す模式図である。
FIG. 2 is a schematic diagram showing an instruction fetch operation in another embodiment of the invention.

【図3】エミュレータにおいてこの発明を使用しない従
来のマイクロプロセッサの内部情報を取り出す動作の一
例を示す模式図である。
FIG. 3 is a schematic diagram showing an example of an operation of extracting internal information of a conventional microprocessor that does not use the present invention in an emulator.

【符号の説明】[Explanation of symbols]

11−1  命令(1) 11−2  命令(2) 12−1  命令α 12−2  命令β 11-1 Command (1) 11-2 Command (2) 12-1 Command α 12-2 Instruction β

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  マイクロプロセッサのコンテキスト等
、マイクロプロセッサ自身の実行状況を示す内部情報を
外部メモリに転送し、かつ自分自身のプログラムカウン
タ値にジャンプする機能を持つ命令を備えたことを特徴
とするマイクロプロセッサ。
[Claim 1] A microprocessor is characterized by having an instruction having a function of transferring internal information indicating the execution status of the microprocessor itself, such as the context of the microprocessor, to an external memory and jumping to its own program counter value. microprocessor.
JP3021863A 1991-02-15 1991-02-15 Microprocessor Pending JPH04288633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3021863A JPH04288633A (en) 1991-02-15 1991-02-15 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3021863A JPH04288633A (en) 1991-02-15 1991-02-15 Microprocessor

Publications (1)

Publication Number Publication Date
JPH04288633A true JPH04288633A (en) 1992-10-13

Family

ID=12066962

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3021863A Pending JPH04288633A (en) 1991-02-15 1991-02-15 Microprocessor

Country Status (1)

Country Link
JP (1) JPH04288633A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5649207A (en) * 1994-12-01 1997-07-15 Kawasaki Steel Corporation Microprocessor unit having interrupt mechanism

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5649207A (en) * 1994-12-01 1997-07-15 Kawasaki Steel Corporation Microprocessor unit having interrupt mechanism

Similar Documents

Publication Publication Date Title
JP2731692B2 (en) Debug device
US4879646A (en) Data processing system with a pipelined structure for editing trace memory contents and tracing operations during system debugging
US6760835B1 (en) Instruction branch mispredict streaming
US6209086B1 (en) Method and apparatus for fast response time interrupt control in a pipelined data processor
JP3707581B2 (en) Data processing system having self-aligned stack pointer and method thereof
JP2655615B2 (en) Information processing device
JP2513417B2 (en) Information processing device
JP4465081B2 (en) Efficient sub-instruction emulation in VLIW processor
JPH04288633A (en) Microprocessor
JPH1078887A (en) Debug system and debug method
KR100705872B1 (en) Processor and method of executing instructions from several instruction sources
JPH04288632A (en) One-chip microcomputer
JPH05241827A (en) Command buffer controller
US7818549B2 (en) Event driven digital signal processor with time constraints
JP2808757B2 (en) Microprocessor for debugging
US5802346A (en) Method and system for minimizing the delay in executing branch-on-register instructions
JPH0877037A (en) Jamming device
JP2504224B2 (en) Data processing device
JP2806690B2 (en) Microprocessor
JPH036758A (en) Microprocessor
JPH04145531A (en) Microprogram controller
JPH0259829A (en) Microcomputer
JP2000347931A (en) Cache memory and method for controlling cache memory
JPH08286912A (en) Program controller
JPH04273336A (en) Executing method for foreground monitor program