JPS6273333A - Emulation control system - Google Patents

Emulation control system

Info

Publication number
JPS6273333A
JPS6273333A JP21406085A JP21406085A JPS6273333A JP S6273333 A JPS6273333 A JP S6273333A JP 21406085 A JP21406085 A JP 21406085A JP 21406085 A JP21406085 A JP 21406085A JP S6273333 A JPS6273333 A JP S6273333A
Authority
JP
Japan
Prior art keywords
instruction
mode
processor
emulation
address space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP21406085A
Other languages
Japanese (ja)
Other versions
JPH0564375B2 (en
Inventor
Junichi Iwasaki
岩先 純一
Takashi Nakayama
貴司 中山
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 JP21406085A priority Critical patent/JPS6273333A/en
Publication of JPS6273333A publication Critical patent/JPS6273333A/en
Publication of JPH0564375B2 publication Critical patent/JPH0564375B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To couple already provided programs consisting of various instruction sets by selecting a desired address space in accordance with the attribute of the address space of a processor to execute instructions. CONSTITUTION:An instruction is executed in a microprocessor MPU 100 by the two-stage pipeline processing consisting of instruction prefetch of a bus interface unit 110 and instruction decoding and execution of an executing unit 150. In the unit 110, the attribute of the physical address of the instruction to be prefetched is checked and is transmitted to the unit 150 as a processor mode signal 153 together with the prefetched instruction. In this case, an address space 605 between addresses 603 and 604 has the attribute of an emulation mode EM and the other address spaces have the attribute of a native mode NM. If a segment register 114 is so determined that a program is executed in an address space 602 in case of the mode EM, the MPU 100 transfer the control to addresses having attributes of modes different from each other during execution of the mode NM as well as the mode EM.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はコンピュータのプロセッサに関し、特に複数の
命令セットをエミュレートできるプロセッサのエミュレ
ーション制御方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a computer processor, and more particularly to an emulation control system for a processor capable of emulating a plurality of instruction sets.

〔概要〕〔overview〕

本発明は、複数種類の命令セットをエミュレートする手
段を有するプロセッサのエミュレーション制御方式にお
いて、 プロセッサのアドレス空間に命令セット個々の属性を付
したアドレス区間を設ける手段と、上記属性によってプ
ロセッサが実行すべき命令が存在するアドレス空間を選
択し命令セットを実行するよう制御を行う手段とを設け
ることにより、プロセッサ・モードを新設することなく
、異なる命令セットで書かれた既存のプログラムを容易
に結合できるようにしたものである。
The present invention provides an emulation control system for a processor having means for emulating a plurality of types of instruction sets. By providing a means for selecting the address space where the instruction to be executed exists and controlling the execution of the instruction set, existing programs written in different instruction sets can be easily combined without creating a new processor mode. This is how it was done.

〔従来の技術〕[Conventional technology]

近年のLSI技術の進歩により、次々と新しいマイクロ
プロセッサが発表されているが、命令セットが同一のま
ま高性能化された例は少ない。多くのマイクロプロセッ
サは過去のマイクロプロセッサの命令セットとは全く異
なる命令セットや上位互換性を持つ命令セットを持つ。
With recent advances in LSI technology, new microprocessors have been released one after another, but there are few examples of improved performance with the same instruction set. Many microprocessors have instruction sets that are completely different or upwardly compatible with those of past microprocessors.

既存のソフトウェアを有効利用するためには、上位互換
性のある命令セットは効果的であるが、過去のマイクロ
プロセッサのアーキテクチャの制限があるため、大幅な
性能向上は望めない。しかし、命令セットの互換性のな
い新しいマイクロプロセッサを開発すると既存のソフト
ウェアを新しいマイクロプロセッサ用に再開発しなけれ
ばならず、再開発のための時間、費用およびバグの発生
による保守の問題が生じる。
Although upwardly compatible instruction sets are effective in making effective use of existing software, significant performance improvements cannot be expected due to limitations of past microprocessor architectures. However, when a new microprocessor with an incompatible instruction set is developed, existing software must be redeveloped for the new microprocessor, creating maintenance problems due to redevelopment time, expense, and bugs. .

そこで、従来、過去のソフトウェアを最大限に利用する
方法として、エミュレーションが用いられている。エミ
ュレーシヨンとは、ひとつのプロセッサのハードウェア
資源を用いて、複数種類の命令セットを実行させること
である。エミュレーションを用いることにより、新しい
アーキテクチャおよび命令セットを持つマイクロプロセ
ッサでありながら、過去のマイクロプロセッサ用のプロ
グラムを実行することができる。エミュレーションをマ
イクロプロセッサ上で実現した従来例としてμP D7
0116(μPD7018/70116ユーザーズ・マ
ニュアル 日本電気(株) 1984年10月12日発
行〉がある。
Therefore, emulation has conventionally been used as a method to make maximum use of past software. Emulation is the use of the hardware resources of a single processor to execute multiple types of instruction sets. Emulation allows a microprocessor with a new architecture and instruction set to run programs designed for older microprocessors. μP D7 is a conventional example of emulation realized on a microprocessor.
0116 (μPD7018/70116 User's Manual, NEC Corporation, published October 12, 1984).

μP D70116は16ビツト・マイクロプロセッサ
の命令セットを実行するネイティブ・モードと、8ビツ
ト・マイクロプロセッサの命令セットを実行するエミュ
レーション・モードとの2つのモードを有する。
The μPD70116 has two modes: a native mode that executes the instruction set of a 16-bit microprocessor, and an emulation mode that executes the instruction set of an 8-bit microprocessor.

第6図はかかる従来例のマイクロプロセッサの要部を示
すブロック構成図である。マイクロプロセッサ200は
、マイクロプロセッサ200の状態を保持する複数のフ
ラグの集合であるプログラム・ステータス・ワード・レ
ジスタ(PSW) 204 、プログラム・ステータス
・ワード・レジスタ204内にあってマイクロプロセッ
サ200がネイティブ・モードで動作しているかエミュ
レーション・モードで動作しているか(この区別をプロ
セッサ・モードという。)を示すモード・フラグ(MF
)205、外部メモリ203からバス202を通して読
み出した命令を解釈する命令デコーダ208、命令デコ
ーダ208から得られた制m信号209をもとにマイク
ロプロセッサ200内の制御を行う制御回路210、制
御回路210によって制御を受けるレジスタや演算論理
回路(ALIJ)を含むデータ処理回路207を含んで
いる。
FIG. 6 is a block diagram showing the main parts of such a conventional microprocessor. The microprocessor 200 has a program status word register (PSW) 204 which is a set of flags that maintain the state of the microprocessor 200. A mode flag (MF
) 205, an instruction decoder 208 that interprets instructions read from the external memory 203 through the bus 202, a control circuit 210 that controls the inside of the microprocessor 200 based on a control signal 209 obtained from the instruction decoder 208, and a control circuit 210. It includes a data processing circuit 207 including registers and an arithmetic and logic circuit (ALIJ) controlled by the ALIJ.

モード・フラグ205の内容がrlJならば、マイクロ
プロセッサ201のプロセッサ・モードはネイティブ・
モードであり、rOJならばエミュレーション・モード
である。モード・フラグ205の内容を示すプロセッサ
・モード信号206によって、命令デコーダ208およ
び制御回路210は2通りの動作を行う。
If the content of mode flag 205 is rlJ, the processor mode of microprocessor 201 is native.
mode, and if it is rOJ, it is emulation mode. Processor mode signal 206 indicating the contents of mode flag 205 causes instruction decoder 208 and control circuit 210 to perform two operations.

第7図に、マイクロプロセッサ200のプロセッサ・モ
ード遷移の様子を示す。システムのリセット303時と
割込み304発生時は、プロセッサ・モードはネイティ
ブ・モード301である。ネイティブ・モード301と
エミュレーション・モード302との間のプロセッサ・
モード切換えは、次の2種類の命令を実行することによ
り行われる。
FIG. 7 shows the processor mode transition of the microprocessor 200. The processor mode is the native mode 301 when the system is reset 303 and when an interrupt 304 occurs. Processor between native mode 301 and emulation mode 302
Mode switching is performed by executing the following two types of commands.

(ア)プロセッサ・モード変更命令 プロセッサ・モード変更命令は、ネイティブ・モードの
命令セット中のBRKEM (ブレーク・フォア・エミ
ュレーション)命令305とエミュレーション・モード
の命令セット中のCALLN(コール・ネイティブ・プ
ロシージャ)命令306であり、各々エミュレーション
・モードおよびネイティブ・モードの命令セットが書か
れたサブルーチンを呼び出すための命令である。プロセ
ッサ・モード変更命令が命令デコーダ208で解釈され
ると、制御回路210の制御によって第8図に示すよう
に以下の動作が行われる。
(a) Processor mode change instruction The processor mode change instruction is the BRKEM (break for emulation) instruction 305 in the native mode instruction set and the CALLN (call native procedure) in the emulation mode instruction set. The instruction 306 is an instruction for calling a subroutine in which instruction sets for emulation mode and native mode are written, respectively. When the processor mode change command is interpreted by the command decoder 208, the following operations are performed under the control of the control circuit 210 as shown in FIG.

(i)ステップ1゜ これから遷移するモードから現在のモードに復帰した際
に次の命令から実行を再開するために、現在のプログラ
ム・ステータス・ワード・レジスタ204の内容psW
 %プログラム・カウンタ211の内容量を、外部メモ
リ203のスタック領域に退避する。
(i) Step 1: The contents of the current program status word register 204 psW are used to resume execution from the next instruction when returning to the current mode from the mode to be transitioned to.
The content of the % program counter 211 is saved to the stack area of the external memory 203.

(ii )ステップ2゜ 外部メモリ203のデコーダ領域からエミュレーション
開始アドレスnを読み出し、プログラム・カウンタ21
1に設定する。
(ii) Step 2 Read the emulation start address n from the decoder area of the external memory 203, and write the emulation start address n to the program counter 21.
Set to 1.

(iii )ステップ3゜ プログラム・ステータス・ワード・レジスタ204内の
モードフラグ205を、BRKEM命令305なら「0
」に、CALLN命令306なら「1」に設定する。以
上の動作の結果、プログラムの実行をn番地に移し、プ
ロセッサ・モードが変更・される。
(iii) Step 3: Set the mode flag 205 in the program status word register 204 to "0" for the BRKEM instruction 305.
", and if it is a CALLN instruction 306, it is set to "1". As a result of the above operations, execution of the program is moved to address n and the processor mode is changed.

(イ)プロセッサ・モード復帰命令 プロセッサ・モード復帰命令は、エミュレーション・モ
ードの命令セット中のRETE?I(リターン・フロム
・エミュレション)命令307とネイティブ・モードの
命令セット中のRET T(リターン・フロム・インタ
ラブド)命令308であり、各々BRXRM命令305
およびCALLN命令306で呼び出されたサブルーチ
ンから復帰するための命令である。プロセッサ・モード
復帰命令か命令デコーダ208で解釈されると、制御回
路210の制御によって第9図に示すように以下の動作
が行われる。
(a) Processor mode return instruction The processor mode return instruction is RETE? in the emulation mode instruction set. I (return from emulation) instruction 307 and RET T (return from interwoven) instruction 308 in the native mode instruction set, each of which is a BRXRM instruction 305.
This is an instruction for returning from the subroutine called by the CALLN instruction 306. When the processor mode return command is interpreted by the command decoder 208, the following operations are performed under the control of the control circuit 210 as shown in FIG.

(i)外部メモリ203のスタック領域から、プロセッ
サ・モード変更命令によって退避しておいた、モード遷
移前のプログラム・ステータス・ワード・レジスタ20
4の内容pswおよびプログラム・カウンタ211の内
容量をそれぞれプログラム・ステータス・ワード・レジ
スタ204およびプログラム・カウンタ211に復帰さ
せる。
(i) Program status word register 20 before mode transition, saved from the stack area of external memory 203 by processor mode change instruction
4 contents psw and the contents of the program counter 211 are returned to the program status word register 204 and the program counter 211, respectively.

(ii )プログラム・ステータス・ワード・レジスタ
204内のモード・フラグ205の内容がモード遷移前
の状態となったことにより、プロセッサ・モードが変化
する。
(ii) The processor mode changes because the contents of the mode flag 205 in the program status word register 204 become the state before the mode transition.

以上の動作の結果、m番地(プロセッサ・モード変更命
令の次の命令)からプログラム実行が再開される。
As a result of the above operations, program execution is resumed from address m (the instruction following the processor mode change instruction).

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来のエミュレーション制御方式には次る述べ
る二つの欠点がある。
The conventional emulation control method described above has the following two drawbacks.

(i)モード・フラグ205がプログラム・ステータス
・ワード・レジスタ204内にあるため、プログラム・
ステータス・ワード・レジスタ204を適当に扱う命令
がない場合は、エミュレーションを実現するために命令
セットにプロセッサ・モード変更/復帰命令を追加しな
ければならない。従来例ではネイティブ・モードのBR
KEM命令およびエミュレーシヨン・モードのCALL
N命令、RETEM命令がそれぞれ元来の16ビツト・
マイクロプロセッサおよび8ビツト・マイクロプロセッ
サの命令セットに追加されている。16ビツト・マイク
ロプロセッサ用および8ビツト・マイクロプロセッサ用
に作成されたプログラムを組合せて新たにプログラムを
作成する場合、プログラム中にプロセッサ・モード変更
/復帰命令を埋込まなければならないが、これは既存の
プログラムに修正を加えることであり、プログラム・ミ
スの原因となる。
(i) Since mode flag 205 is in program status word register 204, the program
If there is no instruction that properly handles the status word register 204, a processor mode change/return instruction must be added to the instruction set to implement emulation. In the conventional example, BR in native mode
KEM instruction and emulation mode CALL
The N and RETEM instructions are each the original 16-bit
It has been added to the instruction set of microprocessors and 8-bit microprocessors. When creating a new program by combining programs created for a 16-bit microprocessor and an 8-bit microprocessor, processor mode change/return instructions must be embedded in the program; This involves making modifications to the program, which can lead to program errors.

(ii)モード・フラグ205がプログラム・ステータ
ス・ワード・レジスタ204内に設けられているため、
ユーザーが誤ってプログラム・ステータス・ワード・レ
ジスタを操作し、意に反したプロセッサ・モード切換え
を行ってしまうおそれがある。
(ii) mode flag 205 is provided in program status word register 204;
There is a risk that the user may accidentally manipulate the program status word register and unexpectedly switch the processor mode.

従来例では、μPD70116のモード・フラグは16
ビツト・マイクロプロセッサでは未定義である。16ビ
ツト・マイクロプロセッサ用に作成されたプログラムは
、モード・フラグについてなんら配慮していないため、
プログラム・ステータス・ワード・レジスタの変更を伴
う命令の実行により意図していないプロセッサ・モード
切換えが起きプロセッサが暴走してしまう恐れがある。
In the conventional example, the mode flag of μPD70116 is 16.
Undefined on bit microprocessors. Programs written for 16-bit microprocessors have no regard for mode flags, so
Execution of an instruction that involves changing the program status word register may cause an unintended processor mode switch and cause the processor to run out of control.

本発明の目的は、上記の欠点を除去することにより、プ
ロセッサ・モードを切換える命令を新設することなく、
異なる命令セットで書かれた既存のプログラムを容易に
結合することのできるエミュレーション制御方式を提供
することにある。
An object of the present invention is to eliminate the above-mentioned drawbacks, thereby eliminating the need to create new instructions for switching processor modes.
An object of the present invention is to provide an emulation control method that can easily combine existing programs written with different instruction sets.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、複数種類の命令セットをエミュレートする手
段を有するプロセッサのエミュレーショ制御方弐におい
て、上記プロセッサのアドレス空間に上記命令セットの
個々の属性を付したアドレス空間を設ける手段と、上記
属性によって上記プロセッサが実行すべき命令が存在す
る上記アドレス空間を選択し上記命令セットを実行する
制御手段とを含むことを特徴とする。
The present invention provides an emulation control method for a processor having means for emulating a plurality of types of instruction sets. and control means for selecting the address space in which the instruction to be executed by the processor exists and executing the instruction set.

〔作用〕[Effect]

本発明は、プロセッサアドレス空間を、例えばエミュレ
ーション・モード用およびネガディプ・モード用のそれ
ぞれの属性を付したアドレス空間に分割し、プロセッサ
の命令を実行するときには、上記属性により、プロセッ
サが実行すべき命令がエミュレーション・モード用のア
ドレス空間に含まれているか、ネガティブ・モード用の
アドレス空間に含まれているかを選択して、命令セット
を実行するように制御されるので、従来のように新たに
プロセッサ・モード変更/復帰命令を必要とすることな
く、異なる命令セットで書かれた既存のプログラムを結
合できる。
The present invention divides the processor address space into address spaces each having attributes for emulation mode and negative dip mode, and when executing instructions of the processor, the instructions to be executed by the processor are determined based on the attributes. The instruction set is controlled to be executed by selecting whether the instruction is included in the emulation mode address space or the negative mode address space. - Existing programs written in different instruction sets can be combined without the need for mode change/return instructions.

〔実施例〕〔Example〕

本発明のエミュレーション制御方式は、エミュレートす
る命令セットが主メモリをどのようにアクセスするかに
よって異なる。以下、それぞれの場合についての実施例
を図面を参照して説明する。
The emulation control scheme of the present invention depends on how the emulated instruction set accesses main memory. Examples for each case will be described below with reference to the drawings.

第1図は本発明の第一実施例によるマイクロプロセッサ
の要部を示すブロック構成図である。本実施例は第6図
に示した従来例と同じ、16ビツト・マイクロプロセッ
サおよび8ビツト・マイクロプロセッサをエミュレート
するマイクロプロセッサである。そして、本実施例は、
8ビツト・マイクロプロセッサは1バイト単位で216
バイトがアドレス可能な主メモリを、はぼ全ての命令で
216バイトをアクセス可能のものである(以下、この
アクセス方式のものをリニア方式という。)。
FIG. 1 is a block diagram showing the main parts of a microprocessor according to a first embodiment of the present invention. This embodiment is a microprocessor that emulates a 16-bit microprocessor and an 8-bit microprocessor, the same as the conventional example shown in FIG. And, in this example,
An 8-bit microprocessor has 216 bytes.
The byte-addressable main memory is one in which 216 bytes can be accessed by almost every instruction (hereinafter, this access method will be referred to as a linear method).

第1図において、マイクロプロセッサ100は命令のブ
リフェッチおよび外部バス101に対するバスサイクル
の駆動を行うバス・インタフェース・ユニット110と
、データ処理の実行を行う実行ユニット150とを含ん
でいる。さらに、バス・インタフェース・ユニット11
0はバスコントロール部111、バス修飾回路(ADH
)116およびエミュレーション制御手段130とを含
んでいる。
In FIG. 1, a microprocessor 100 includes a bus interface unit 110 that performs instruction briefetch and drives bus cycles for an external bus 101, and an execution unit 150 that performs data processing. Furthermore, the bus interface unit 11
0 is the bus control section 111, the bus modification circuit (ADH
) 116 and emulation control means 130.

第1図において、バス・コントロール部111は外部バ
ス101を制御する回路、メイン・データ・バス112
はバス・コントロール部111およびバス・インタフェ
ース・ユニット110、実行ユニット150内の各種レ
ジスタの間でデータを転送するバス、セグメント・レジ
スタ113は216バイトのセグメントの開始アクセス
を16バイト単位で指定するレジスタ、プログラム・セ
グメント・レジスタ(PS)114はマイクロプロセッ
サ100がプリフェッチする命令のセグメントを指定す
るセグメント・レジスタ、ブリフェッチ・ポインタ(P
PP) 115はプログラム・セグメント・レジスタ1
14で示されるセグメント内のオフセット値でマイクロ
プロセッサ100がブリフェッチする命令のアドレスを
示すレジスタ、アドレス修飾回路(ADH)116は、
ブリフェッチ・ポインタ115のインクリメントおよび
プログラム・セグメント・レジスタ114の16倍の値
とブリフェッチ・ポインタ115の値との加算を行う加
算器、物理アドレス・バス117はアドレス修飾回路1
16の出力をバス・コンロール部111、ブリフェッチ
・ポインタ115および比較器122.123に伝える
バス、ブリフェッチ・キュー118は主メモリからバス
・コントロール部111を介してブリフェッチした命令
を命令バス19により蓄えるFIFO(ファースト−イ
ン、ファースト−アウト)型バッファである。エミュレ
ーション上限ポインタ(EUP)120およびエミュレ
ーション下限ポインタ(BLIP)121は、エミュレ
ーション・モードを属性とするアドレス空間の上限と下
限を示すレジスタ、比較器122および123は、エミ
ュレーション上限ポインタ120およびエミュレーヨン
下限ポインタ121の値と命令プリフェッチの際の物理
アドレス・バス117からのアドレス値の大小を判定す
る比較器、アンドゲート124は比較器122および1
23の大小判定出力の論理積を作るゲート、プロセッサ
・モード・キュー125はブリフェッチ・キュー118
の一部であり、命令アドレスの属性を示すアンドゲ−ト
124の出力を蓄積するFIFO型バッファである。
In FIG. 1, a bus control section 111 is a circuit that controls an external bus 101, and a main data bus 112.
is a bus that transfers data between the bus control unit 111, the bus interface unit 110, and various registers in the execution unit 150, and the segment register 113 is a register that specifies the start access of a 216-byte segment in 16-byte units. , a program segment register (PS) 114 is a segment register that specifies a segment of an instruction to be prefetched by the microprocessor 100, and a briefetch pointer (P
PP) 115 is program segment register 1
The address modification circuit (ADH) 116 is a register indicating the address of the instruction to be pre-fetched by the microprocessor 100 at an offset value within the segment indicated by 14.
An adder that increments the briefetch pointer 115 and adds the 16 times the value of the program segment register 114 and the value of the briefetch pointer 115, and the physical address bus 117 is the address modification circuit 1.
16 to the bus control unit 111, briffetch pointer 115, and comparators 122 and 123, and the brifetch queue 118 is a FIFO that stores instructions brifetched from the main memory via the bus control unit 111 via the instruction bus 19. (first-in, first-out) type buffer. An emulation upper limit pointer (EUP) 120 and an emulation lower limit pointer (BLIP) 121 are registers that indicate the upper and lower limits of an address space whose attribute is the emulation mode, and comparators 122 and 123 are registers that indicate the emulation upper limit pointer 120 and emulation lower limit pointer. 121 and the address value from the physical address bus 117 during instruction prefetch, and an AND gate 124 is a comparator that determines the magnitude of the value of 121 and the address value from the physical address bus 117 during instruction prefetch.
The processor mode queue 125, which is a gate that performs the AND of the magnitude judgment outputs of 23, is the briefetch queue 118.
It is a FIFO type buffer that stores the output of the AND gate 124 indicating the attribute of the instruction address.

データ処理回路151は命令に示された演算処理を行う
回路、キュー・データ・バス152はプリフェッチ・キ
ュー118が出力する命令が転送されるバス、プロセッ
サモード信号153は、プロセッサ・モード・キュー1
25から出力されキュー・データ・バス152に出力さ
れる命令の属性示す信号、命令デコーダ154はキュー
・データ・バス152からの命令とプロセッサ・モード
信号153をデコードしてデータ処理回路151を制御
するデコーダ、シーケンサ155はキュー・データ・バ
ス152が示す命令とプロセッサ・モード信号153と
から制御メモリ156とともにデータ処理回路151を
順序制御するシーケンサである。
A data processing circuit 151 is a circuit that performs arithmetic processing indicated in an instruction, a queue data bus 152 is a bus to which instructions output from the prefetch queue 118 are transferred, and a processor mode signal 153 is a circuit that performs arithmetic processing indicated in an instruction.
The instruction decoder 154 decodes the instruction from the queue data bus 152 and the processor mode signal 153 to control the data processing circuit 151. A decoder/sequencer 155 is a sequencer that sequentially controls the data processing circuit 151 together with the control memory 156 based on the instructions indicated by the queue data bus 152 and the processor mode signal 153.

本発明の特徴は、第1図において、アドレス修飾回路1
16、エミュレーション制御手段130、命令デコーダ
154、シーケンサ155および制御メモリ156を設
けたことにある。
The feature of the present invention is that in FIG.
16, emulation control means 130, instruction decoder 154, sequencer 155 and control memory 156 are provided.

次に本実施例の動作について説明する。マイクロプロセ
ッサ100での命令実行は、バス・インクフェース・ユ
ニット110による命令のブリフェッチと、実行ユニッ
ト150による命令のデコードおよび実行の2段のパイ
プライン処理となっている。
Next, the operation of this embodiment will be explained. Instruction execution in the microprocessor 100 is a two-stage pipeline process of instruction briefetching by the bus interface unit 110 and instruction decoding and execution by the execution unit 150.

本実施例においてはバス・インタフェース・ユニット1
10において、ブリフェッチする命令の物理アドレスの
属性を調べ、プロセッサ・モード信号153として、キ
ュー・データ・バス152を通してのブリフェッチした
命令とともに実行ユニット150に伝える。
In this embodiment, bus interface unit 1
At 10, the attributes of the physical address of the instruction to be briefetched are examined and communicated to execution unit 150 as a processor mode signal 153 along with the briefetched instruction over queue data bus 152.

第2図にマイクロプロセッサ100のアドレス空間を示
す。アドレス603および604は、エミュレーション
上限ポインタ120およびエミュレーション下限ポイン
タ121が示すアドレスである。アドレス603と60
4の間のアドレス空間605(斜線部)は、エミュレー
ション・モードの属性を持ち、アドレス空間605以外
のアドレス空間はネイティブ・モードの属性を持つ。エ
ミュレーション・モードでのプログラム実行時の216
バイトのアドレス空間がアドレス空間602となるよう
にプログラム・セグメント・レジスタ114を定めると
、マイクロプロセッサ100がネイティブ・モード、エ
ミュレーション・モードのいずれで実行中であっても、
異なるプロセッサ・モードの属性を持つアドレスへ制御
を移すことができる。制御を移す方法はブランチ命令や
サブルーチンコール/リターン命令などを用いる。
FIG. 2 shows the address space of microprocessor 100. Addresses 603 and 604 are addresses indicated by emulation upper limit pointer 120 and emulation lower limit pointer 121. Addresses 603 and 60
Address space 605 (shaded area) between 4 and 4 has an attribute of emulation mode, and address spaces other than address space 605 have attributes of native mode. 216 when running a program in emulation mode
By defining the program segment register 114 so that the byte address space is the address space 602, whether the microprocessor 100 is running in native mode or emulation mode,
Control can be transferred to addresses with attributes of different processor modes. A branch instruction, a subroutine call/return instruction, or the like is used to transfer control.

第3図(alに、ネイティブ・モードの命令セットで書
かれたメイン・ルーチンから、エミュレーション・モー
ドの命令セットで書かれたサブ・ルーチンを呼出した例
を示し、第3図(blにその逆の例を示す。プログラム
■、■、■、■、711.712.713.714は、
それぞれ第2図のアドレス空間■、■、■、■、611
.612.613.614に存在する。
Figure 3 (al) shows an example of calling a subroutine written in the emulation mode instruction set from a main routine written in the native mode instruction set, and Figure 3 (bl) shows an example of calling a subroutine written in the emulation mode instruction set. An example is shown below.Programs ■, ■, ■, ■, 711.712.713.714 are
Address spaces ■, ■, ■, ■, 611 in Figure 2, respectively.
.. 612.613.614.

ネイティブ・モードとエミュレーション・モードでは、
サブルーチン・コール((:ALL)命令およびリター
ン(RET)命令で用いるスタック領域およびスタック
に格納するデータが異なるため、サブルーチン・コール
を二重に行う。CALL命令720731およびRET
命令724.732はネイティブ・モードの命令セット
のサブルーチン・コール命令およびリターン命令、CA
LL命令721.730およびRET命令722.73
4はエミュレーション・モードの命令セットのサブルー
チン・コール命令およびリターン命令、JP命令723
およびBR命令733はそれぞれエミュレーション・モ
ードおよびネイティブ・モードでのブランチ命令である
In native mode and emulation mode,
Subroutine call ((:ALL) instruction and return (RET) instruction use different stack areas and data stored in the stack, so the subroutine call is performed twice. CALL instruction 720731 and RET instruction
Instructions 724 and 732 are subroutine call and return instructions in the native mode instruction set, CA
LL instruction 721.730 and RET instruction 722.73
4 is a subroutine call instruction and return instruction of the emulation mode instruction set, JP instruction 723
and BR instruction 733 are branch instructions in emulation mode and native mode, respectively.

以上述べたように、本実施例によると、プロセッサ・モ
ードの切換えが特別な命令を新設せずに行え、異なる命
令セットで書かれた既存のサブルーチンおよびメインル
ーチンを改造することなく組合わせることができる。
As described above, according to this embodiment, processor modes can be switched without creating new special instructions, and existing subroutines and main routines written with different instruction sets can be combined without modification. can.

第4図は本発明の第二実施例によるマイクロプロセッサ
の要部を示すプロ・7り構成図で、エミュレーション制
御手段を示す。本実施例は、エミュレートする二つのプ
ロセッサの主メモリをアクセスする方式が、双方ともに
セグメント方式であるマイクロプロセッサである。ここ
でセグメント方式とは、16ビツト・マイクロプロセッ
サは220バイトの主メモリを1バイト単位でアクセス
可能であるが多くの命令では2 tthバイトのセグメ
ントの中だけにアクセスが限定されるアクセス方式をい
う。
FIG. 4 is a block diagram showing the main parts of a microprocessor according to a second embodiment of the present invention, and shows emulation control means. This embodiment is a microprocessor in which the main memories of the two emulated processors are both accessed using the segment method. Here, the segment method refers to an access method in which a 16-bit microprocessor can access 220 bytes of main memory in 1-byte units, but for many instructions, access is limited to only within a 2 tth-byte segment. .

本実施例は、第1図におけるエミュレーション制御手段
130を、第4図に示すエミュレーション制御手段13
0aで置き換えたマイクロプロセッサである。第4図に
おいて、セグメト・レジスタ113aはプログラム・セ
グメントのベースアドレスとして動作する。そしてプロ
グラム・セグメント・レジスタO(PSO) 141 
とプログラム・セグメント・レジスタ1  (Psi 
) 142とは、それぞれモード・フラグ0 (MFO
) 143 、モード・フラグ1 (MFI)144と
が付加される。そしてプロセッサ・モード信号145が
プロセッサ・モード・キュー125に送出される。
In this embodiment, the emulation control means 130 shown in FIG. 1 is replaced with the emulation control means 13 shown in FIG.
This is the microprocessor that was replaced with 0a. In FIG. 4, segment register 113a operates as a base address for a program segment. and program segment register O (PSO) 141
and program segment register 1 (Psi
) 142 means mode flag 0 (MFO
) 143 and mode flag 1 (MFI) 144 are added. Processor mode signal 145 is then sent to processor mode queue 125.

次に、本実施例の動作について説明する。エミュレート
する命令セットは双方共に第5図に類似するセグメント
・テーブルを主メモリ上に持っている。セグメント・テ
ーブル801は、セグメントのベース・アドレス802
、セグメント・サイズ803およびいずれの命令セット
を実行するかを示すプロセッサのモード・フラグ(MP
) 804を含んでいる。マイクロプロセッサが主メモ
リをアクセスするための複数のセグメントの内、命令を
フエ・ノチするためのセグメントをプログラム・セグメ
ントという。モード・フラグ804の内容はセグメント
・テーブル801がプログラム・セグメントとして使用
されるとき有効となる。セグメント・テーブル801か
らセグメントのベース・アドレス802がセグメント・
レジスタ113aへ転送される際、同時にモード・フラ
グ804がモード・フラグ143または144に転送さ
れる。
Next, the operation of this embodiment will be explained. Both emulated instruction sets have segment tables similar to FIG. 5 in main memory. Segment table 801 includes segment base address 802
, segment size 803 and the processor mode flag (MP
) 804. Among the multiple segments used by the microprocessor to access main memory, the segment used to process instructions is called a program segment. The contents of mode flag 804 are valid when segment table 801 is used as a program segment. The segment base address 802 from the segment table 801 is
When transferred to register 113a, mode flag 804 is transferred to mode flag 143 or 144 at the same time.

セグメン・レジスタ113aの内の1個がプログラム・
セグメントのベース・アドレスとして命令のプリフェッ
チに使用されるとき、そのセグメント・レジスタに付加
されたモード・フラグの内容が、プロセッサ・モード信
号145に出力され、プロセッサ・モード・キュー12
5に入力される。プログラム・セグメント・レジスタ(
PSO)141に対応するモード・フラグ(?IFO)
 143の内容が命令セットAを示し、プログラム・セ
グメント・レジスタ(Psi ) 142に対応するモ
ード・フラグ(MFI)の内容が命令セットBを示して
いる場合、プログラム・セグメント・レジスタ141の
セグメント命令セットAを実行していたマイクロプロセ
ッサがプロゲラ・セグメント・レジスタをプログラム・
セグメント・レジスタ142に切り換える命令を実行す
ると、マイクロプロセッサは次の命令から命令セットB
を実行し始める。
One of the segment registers 113a is programmed.
When used as a base address for a segment to prefetch an instruction, the contents of the mode flag attached to that segment register are output to the processor mode signal 145 and sent to the processor mode queue 12.
5 is input. Program segment register (
Mode flag (?IFO) corresponding to PSO) 141
If the contents of 143 indicate instruction set A and the contents of the mode flag (MFI) corresponding to program segment register (Psi) 142 indicate instruction set B, the segment instruction set of program segment register 141 The microprocessor running A programs the Progera segment register.
Executing an instruction to switch to segment register 142 causes the microprocessor to switch to instruction set B starting with the next instruction.
Start executing.

以上のように、プログラム・セグメントを切り換えるこ
とにより、セグメントに属性として付加されたモード・
フラグに従って命令セットを選択する。
As described above, by switching program segments, the mode and
Select instruction set according to flags.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、プロセッサのアドレス空
間に命令セットの個々の属性を付したアドレス空間を設
け、個々のアドレス空間に付けられた属性によってゴミ
ュし・−卜する命令セットを決定することにより、プロ
セッサ・モードを切り換える命令を新設することな(、
異なる命令セットで書かれた既存のプログラムを容易に
結合できるエミュレーションが実現できる効果がある。
As explained above, the present invention provides address spaces in the address space of a processor that are attached with individual attributes of instruction sets, and determines the instruction set to be read or deleted based on the attributes attached to each address space. Therefore, it is not necessary to create a new instruction to switch the processor mode (,
This has the effect of realizing emulation that allows existing programs written with different instruction sets to be easily combined.

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

第1図は本発明の第一実施例によるマイクロプロセッサ
の要部を示すブロック構成図。 第2図は第一実施例のアドレス空間を示す説明図。 第3図(a)、(blは第一実施例におけるプロセッサ
・モード切り換えの説明図。 第4図は本発明の第二実施例によるマイクロプロセッサ
の要部を示すブロック構成図。 第5図は第二実施例のアドレス空間を示す説明図。 第6図は従来例によるマイクロプロセッサの要部を示す
ブロック構成図。 第7図は従来例のプロセッサ・モード変更/復帰命令に
関する状態遷移図。 第8図は従来例のプロセッサ・モード変更命令の動作を
示す説明図。 第9図は従来例のプロセッサ・モード復帰命令の動作を
示す説明図。 100.200・・・マイクロプロセッサ、101・・
・外部バス、110・・・バス・インタフェース・ユニ
ット、111・・・バス・コントロール部、112・・
・メイン・データ・バス、113.113a・・・セグ
メント・レジスタ、114.141.142・・・プロ
グラム・セグメント・レジスタ(PS) 、115・・
・ブリフェッチ・ポインタ(P F P) 、116・
・・アドレス修飾回路(ADM)、117・・・物理ア
ドレス・バス、11B・・・ブリフェッチ・キュー、1
19・・・命令バス、120・・・エミュレーション上
限ポインタ(EUP) 、121・・・エミュレーショ
ン下限ボイタ(E L P) 、122.123・・・
比較器、124・・・アンドゲート、125・・・プロ
セッサ・モード・キュー、130 、L30a・・・エ
ミュレーション制御手段、143.144.205.8
04・・・モード・フラグ、145.153・・・プロ
セッサ・モード信号、150・・・実行ユニット、15
1・・・データ処理回路、152・・・キュー・データ
・バス、154・・・命令デコーダ、155シーケンサ
、156・・・制御メモリ、202・・・バス、203
・・・外部メモリ、204プログラム・ステータス・ワ
ード・レジスタ (P SW) 、206・・・ブロモ
・ノサ・モード信号、207・・・データ処理回路、2
08・・・命令デコーダ、209・・・制御信号、21
0・・・制御回路、211・・・プログラム・カウンタ
、301・・・ネイテイフ゛モード、302・・・エミ
ュレーション・モード、303・・・1ノセツト、30
4・・・割込み、305・・・BRKEM命令、306
・・・CALLN命令、307・・・RETEM命令、
308・・・RET命令、601.602.605.6
11〜614・・・アドレス空間、603.604・・
・アドレス、711〜714・・・ブロク゛ラム、72
0 、?21.730.731・・・CALL命令、7
22.724.732.734・・・PET命令、72
3.733・・・Bl+命令、801・・・セグメント
・テーブル、802・・・ベース・アドレス、803・
・・セグメント・サイズ。 ゝ゛、λ 。 実施例 兇 2 口 π 3 口 34 図 実施例 従来例 先 7 口
FIG. 1 is a block diagram showing the main parts of a microprocessor according to a first embodiment of the present invention. FIG. 2 is an explanatory diagram showing the address space of the first embodiment. Figures 3(a) and (bl are explanatory diagrams of processor mode switching in the first embodiment. Figure 4 is a block diagram showing the main parts of a microprocessor according to the second embodiment of the present invention. Figure 5 is An explanatory diagram showing the address space of the second embodiment. Fig. 6 is a block configuration diagram showing the main parts of a microprocessor according to the conventional example. Fig. 7 is a state transition diagram regarding the processor mode change/return instruction of the conventional example. Fig. 8 is an explanatory diagram showing the operation of a conventional processor mode change instruction. Fig. 9 is an explanatory diagram showing the operation of a conventional processor mode return instruction. 100.200...Microprocessor, 101...
- External bus, 110... Bus interface unit, 111... Bus control section, 112...
- Main data bus, 113.113a... Segment register, 114.141.142... Program segment register (PS), 115...
・Briefetch pointer (PFP), 116・
...Address modification circuit (ADM), 117...Physical address bus, 11B...Briefetch queue, 1
19...Instruction bus, 120...Emulation upper limit pointer (EUP), 121...Emulation lower limit pointer (ELP), 122.123...
Comparator, 124...AND gate, 125...Processor mode queue, 130, L30a...Emulation control means, 143.144.205.8
04...Mode flag, 145.153...Processor mode signal, 150...Execution unit, 15
DESCRIPTION OF SYMBOLS 1... Data processing circuit, 152... Queue data bus, 154... Instruction decoder, 155 Sequencer, 156... Control memory, 202... Bus, 203
... external memory, 204 program status word register (PSW), 206 ... bromo nosa mode signal, 207 ... data processing circuit, 2
08... Instruction decoder, 209... Control signal, 21
0... Control circuit, 211... Program counter, 301... Native mode, 302... Emulation mode, 303... 1 noset, 30
4...Interrupt, 305...BRKEM instruction, 306
...CALLN instruction, 307...RETEM instruction,
308...RET command, 601.602.605.6
11-614...address space, 603.604...
・Address, 711-714... Blockram, 72
0,? 21.730.731...CALL instruction, 7
22.724.732.734...PET instruction, 72
3.733...Bl+instruction, 801...Segment table, 802...Base address, 803...
...Segment size.ゝ゛、λ. Example 兇 2 π 3 34 Figure Embodiment Conventional example 7

Claims (1)

【特許請求の範囲】[Claims] (1)複数種類の命令セットをエミュレートする手段を
有するプロセッサのエミュレーション制御方式において
、 上記プロセッサのアドレス空間に上記命令セットの個々
の属性を付したアドレス空間を設ける手段と、 上記属性によって上記プロセッサが実行すべき命令が存
在する上記アドレス空間を選択し上記命令セットを実行
する制御手段と を含むことを特徴とするエミュレーション制御方式。
(1) In an emulation control method for a processor having means for emulating a plurality of types of instruction sets, means for providing an address space with individual attributes of the instruction set added to the address space of the processor; and control means for selecting the address space in which the instruction to be executed exists and executing the instruction set.
JP21406085A 1985-09-26 1985-09-26 Emulation control system Granted JPS6273333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21406085A JPS6273333A (en) 1985-09-26 1985-09-26 Emulation control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21406085A JPS6273333A (en) 1985-09-26 1985-09-26 Emulation control system

Publications (2)

Publication Number Publication Date
JPS6273333A true JPS6273333A (en) 1987-04-04
JPH0564375B2 JPH0564375B2 (en) 1993-09-14

Family

ID=16649593

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21406085A Granted JPS6273333A (en) 1985-09-26 1985-09-26 Emulation control system

Country Status (1)

Country Link
JP (1) JPS6273333A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895783A (en) * 1994-09-20 1996-04-12 Nec Corp Variable word length type microcomputer
US5548717A (en) * 1991-03-07 1996-08-20 Digital Equipment Corporation Software debugging system and method especially adapted for code debugging within a multi-architecture environment
US5652869A (en) * 1991-03-07 1997-07-29 Digital Equipment Corporation System for executing and debugging multiple codes in a multi-architecture environment using jacketing means for jacketing the cross-domain calls
JP2002536712A (en) * 1999-01-28 2002-10-29 エーティーアイ インターナショナル エスアールエル Execution of a program for a first computer architecture on a computer of a second architecture
JP2008171428A (en) * 2007-01-09 2008-07-24 Internatl Business Mach Corp <Ibm> Method and apparatus for selecting architecture level to which processor appears to conform in specification
JP2010536089A (en) * 2007-08-08 2010-11-25 アナログ デバイシス, インコーポレイテッド Implementation of variable-length instruction coding using alias addressing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5458324A (en) * 1977-10-19 1979-05-11 Hitachi Ltd Information processor
JPS5674749A (en) * 1979-11-26 1981-06-20 Nec Corp Microprogram controlling device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5458324A (en) * 1977-10-19 1979-05-11 Hitachi Ltd Information processor
JPS5674749A (en) * 1979-11-26 1981-06-20 Nec Corp Microprogram controlling device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5548717A (en) * 1991-03-07 1996-08-20 Digital Equipment Corporation Software debugging system and method especially adapted for code debugging within a multi-architecture environment
US5652869A (en) * 1991-03-07 1997-07-29 Digital Equipment Corporation System for executing and debugging multiple codes in a multi-architecture environment using jacketing means for jacketing the cross-domain calls
JPH0895783A (en) * 1994-09-20 1996-04-12 Nec Corp Variable word length type microcomputer
JP2002536712A (en) * 1999-01-28 2002-10-29 エーティーアイ インターナショナル エスアールエル Execution of a program for a first computer architecture on a computer of a second architecture
JP2008171428A (en) * 2007-01-09 2008-07-24 Internatl Business Mach Corp <Ibm> Method and apparatus for selecting architecture level to which processor appears to conform in specification
JP2010536089A (en) * 2007-08-08 2010-11-25 アナログ デバイシス, インコーポレイテッド Implementation of variable-length instruction coding using alias addressing

Also Published As

Publication number Publication date
JPH0564375B2 (en) 1993-09-14

Similar Documents

Publication Publication Date Title
US6564179B1 (en) DSP emulating a microcontroller
US6895460B2 (en) Synchronization of asynchronous emulated interrupts
US4715013A (en) Coprocessor instruction format
US4729094A (en) Method and apparatus for coordinating execution of an instruction by a coprocessor
JP2002116908A (en) Mutual calling between native and nonnative instruction sets
JPH09231093A (en) Method and system for transfer of program control between two architectures
JPWO2003025743A1 (en) Processor system with Java accelerator
JP2008536240A (en) Microprocessor access using native instructions to the operand stack as a register file
US4562538A (en) Microprocessor having decision pointer to process restore position
US4750110A (en) Method and apparatus for executing an instruction contingent upon a condition present in another data processor
US4484274A (en) Computer system with improved process switch routine
US5021991A (en) Coprocessor instruction format
JP4988082B2 (en) Microprocessor and data processing system
EP0525831B1 (en) Method and apparatus for enabling a processor to coordinate with a coprocessor in the execution of an instruction which is in the intruction stream of the processor.
US4821231A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
US4758950A (en) Method and apparatus for selectively delaying an interrupt of a coprocessor
US4914578A (en) Method and apparatus for interrupting a coprocessor
JP2002215387A (en) Data processor provided with instruction translator, and memory interface device
EP0310600A1 (en) Arrangement for software emulation.
JPS6273333A (en) Emulation control system
JPH0380336A (en) Operation intensifier for m byte order word cpu of double operating system computer and operation intensifier for register directive type architecture cpu
US4994961A (en) Coprocessor instruction format
JP3716604B2 (en) Information processing device
US4758978A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
JPH0192843A (en) Data processing apparatus and method

Legal Events

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