JPH02236734A - Emulation system for microprocessor - Google Patents

Emulation system for microprocessor

Info

Publication number
JPH02236734A
JPH02236734A JP5926189A JP5926189A JPH02236734A JP H02236734 A JPH02236734 A JP H02236734A JP 5926189 A JP5926189 A JP 5926189A JP 5926189 A JP5926189 A JP 5926189A JP H02236734 A JPH02236734 A JP H02236734A
Authority
JP
Japan
Prior art keywords
microprocessor
instruction
emulation
instructions
memory
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
JP5926189A
Other languages
Japanese (ja)
Inventor
Tetsuo Miura
三浦 哲雄
Daisaku Ide
井手 大作
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
NEC Engineering Ltd
Original Assignee
NEC Corp
NEC Engineering 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 NEC Corp, NEC Engineering Ltd filed Critical NEC Corp
Priority to JP5926189A priority Critical patent/JPH02236734A/en
Publication of JPH02236734A publication Critical patent/JPH02236734A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To enable emulation to be performed even when architecture is remarkably different by switching the output of an instruction decode unit and that of an emulation memory appropriately, and inputting them to a second microprocessor. CONSTITUTION:The instruction decode unit 3 fetches and decodes the instruction of a first microprocessor, and outputs the instruction of a second microprocessor 1 required for the emulation of the above instruction. Also, the emulation memory 4 holds another instruction of the second microprocessor 1 required for the emulation of the instruction of the first microprocessor. When the emulation is performed by using the second microprocessor having the architecture different from that of the first microprocessor, the output of the instruction decode unit 3 and that of the emulation memory 4 are switched appropriately and inputted to the second microprocessor 1. Thereby, it is possible to easily perform the emulation even by the microprocessor having remarkably different architecture.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はマイクロプロセッサのエミュレーシツン方式に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a microprocessor emulation system.

〔従来の技術〕[Conventional technology]

従来、特定のアーキテクチャを有する第1のマイクロプ
ロセッサを、それとは異なるアーキテクチャを有する第
2のマイクロプロセッサを使用してエミュレーションす
る場合、第2のマイクロプロセッサ内に組み込まれたP
 L A (ProgramableLogic Ar
ray)或いはR O M (Read Only M
emory)等のエミュレーション用回路を第1のマイ
クロプロセッサのエミュレーションに適する内容に変更
することにより実現していた。
Conventionally, when a first microprocessor having a specific architecture is emulated using a second microprocessor having a different architecture, the P embedded in the second microprocessor is
L A (Programmable Logic Ar
ray) or R O M (Read Only M
This has been realized by changing the emulation circuit such as Emory to one suitable for emulation of the first microprocessor.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の方式でもエミュレーションは可能である
が、マイクロプロセッサの内部に組み込めるエミュレー
ション用回路の規模には制限があるため、エミュレーシ
ョンの対象となる第1のマイク口プロセッサのアーキテ
クチャが第2のマイクロプロセッサのアーキテクチャと
大幅に異なる場合、内部のエミュレーション用回路では
足りず、エミュレーションが困難になるという欠点があ
る。
Although emulation is possible with the conventional method described above, there is a limit to the scale of the emulation circuit that can be built into the microprocessor, so the architecture of the first microphone processor that is the target of emulation is changed to the second microprocessor. If the architecture is significantly different from that of the previous one, the disadvantage is that the internal emulation circuit is insufficient and emulation becomes difficult.

本発明はこのような従来の欠点を解決したものであり、
その目的は、エミュレーション用回路の規模の制限を無
くし、アーキテクチャが大幅に異なる場合であってもエ
ミュレーシaンを可能にすることのできるマイクロプロ
セッサのエミュレーション方式を提供することにある. 〔課題を解決するための手段〕 本発明は上記の目的を達成するために、特定のアーキテ
クチャを有する第1のマイクロプロセッサをそれとは異
なるアーキテクチャを有する第2のマイクロプロセッサ
を使用してエミュレーションする方式において、前記第
1のマイクロプロセッサの命令をフェッチして解読しそ
の命令をエミュレーションするのに必要な前記第2のマ
イクロプロセッサの命令を出力する命令デコードユニッ
トと、前記第1のマイクロプロセッサの命令をエミュレ
ーションするのに必要な前記第2のマイクロプロセッサ
のその他の命令を格納するエミュレーションメモリとを
備え、前記命令デコードユニットの出力と前記エミュレ
ーションメモリの出力とを適宜切り替えて前記第2のマ
イクロプロセッサへ入力するようにしている。
The present invention solves these conventional drawbacks,
The purpose is to provide a microprocessor emulation method that eliminates limitations on the scale of emulation circuits and enables emulation even when the architectures are significantly different. [Means for Solving the Problems] In order to achieve the above object, the present invention provides a method of emulating a first microprocessor having a specific architecture using a second microprocessor having a different architecture. an instruction decode unit that fetches and decodes the instructions of the first microprocessor and outputs the instructions of the second microprocessor necessary to emulate the instructions; an emulation memory for storing other instructions of the second microprocessor necessary for emulation, and the output of the instruction decoding unit and the output of the emulation memory are appropriately switched and inputted to the second microprocessor. I try to do that.

〔作用〕[Effect]

本発明のマイクロプロセンサのエミュレーション方式に
おいては、命令デコードユニットが第1のマイクロプロ
セッサの命令をフエフチして解読しその命令をエミュレ
ーションするのに必要な第2のマイクロプロセッサの命
令を出力し、また、エミュレーションメモリが、第1の
マイクロプロセッサの命令をエミュレーションするのに
必要な第2のマイクロプロセッサのその他の命令を保持
しており、特定のアーキテクチャを有する第1のマイク
ロプロセッサをそれとは異なるアーキテクチャを有する
第2のマイクロプロセッサを使用してエミュレーション
する際、命令デコードユニットの出力とエミュレーショ
ンメモリの出力とが適宜切り替えられて第2のマイクロ
プロセッサへ入力される。
In the microprocessor sensor emulation system of the present invention, the instruction decoding unit decodes and decodes the instructions of the first microprocessor and outputs the instructions of the second microprocessor necessary for emulating the instructions; , an emulation memory retains other instructions of the second microprocessor necessary to emulate the instructions of the first microprocessor, and emulates a first microprocessor having a particular architecture with a different architecture. When performing emulation using a second microprocessor having a second microprocessor, the output of the instruction decode unit and the output of the emulation memory are appropriately switched and input to the second microprocessor.

〔実施例〕〔Example〕

次に、本発明の実施例について図面を参照して詳細に説
明する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明のマイクロプロセッサのエミュレーショ
ン方式の一実施例の要部ブロック図である。この実施例
は、エミュレーション対象となるマイクロプロセッサ(
第1のマイクロプロセッサ)と異なるアーキテクチャを
有するマイクロプロセッサ(第2のマイクロプロセッサ
)1と、メモリ2と、命令デコードユニント3と、エミ
ュレーションメモリ4とで構成されている。
FIG. 1 is a block diagram of essential parts of an embodiment of a microprocessor emulation system according to the present invention. This embodiment uses a microprocessor to be emulated (
The microprocessor (second microprocessor) 1 has a different architecture from that of the first microprocessor (first microprocessor), a memory 2, an instruction decode unit 3, and an emulation memory 4.

第2のマイクロプロセッサ1は、ほとんどの命令を1ク
ロックで実行するR I S C (Reduce I
n−struction Set Cosputer)
型のプロセッサであり、データバス11,アドレスバス
12に接続されると共に、それ自身の命令バス21.命
令アドレスバス22が外部に引き出されている. メモリ2は、エミュレーション対象となる第1のマイク
ロプロセッサのフ゜ログラムおよびデータを格納するメ
モリであり、データバス1lおよびアドレスバスl2に
接続されている。
The second microprocessor 1 is a RISC (Reduce I) processor that executes most instructions in one clock.
n-structure Set computer)
type of processor, which is connected to a data bus 11, an address bus 12, and has its own instruction bus 21. The instruction address bus 22 is drawn out to the outside. The memory 2 is a memory that stores a program and data of a first microprocessor to be emulated, and is connected to a data bus 11 and an address bus 12.

命令デコードユニット3は、メモリ2に格納されている
第1のマイクロプロセッサの命令をフエッチして解読し
、その命令をエミュレーションするのに必要な第2のマ
イクロプロセッサlの所定の命令を出力する回路であり
、データバスl1アドレスバス12,命令バス21.信
号線31および信号線32に接続されている。
The instruction decoding unit 3 is a circuit that fetches and decodes the instructions of the first microprocessor stored in the memory 2, and outputs predetermined instructions of the second microprocessor l necessary for emulating the instructions. , a data bus l1, an address bus 12, an instruction bus 21 . It is connected to the signal line 31 and the signal line 32.

エミュレーションメモリ4は、第1のマイクロプロセッ
サの命令をエミュレーションするのに必要な第2のマイ
クロプロセッサ1のその他の命令を格納しておくメモリ
であり、命令バス21.命令アドレスバス22.信号線
32および信号線31に接続されている.ここで、エミ
ュレーションメモリ4は、命令デコードユニット3によ
って信号線32が所定のレベル例えば論理値“1″にさ
れると、命令アドレスバス22のアドレスで指定された
場所に格納された命令を命令バス21に出力する。また
、1区切りのエミュレーシジンを終了すると、信号線3
1のレベルを所定のレベル例えば論理値“1”にするこ
とにより、その旨を命令デコードユニソト3に通知する
ものである。命令デコードユニット3とエミュレーショ
ンメモリ4の出力は共に命令バス21を介して第2のマ
イクロブロセノサlに入力されるが、一方が有為の信号
を出力している間は他方はハイインピーダンス状態にな
る如く、その両出力は互いに干渉せずに選択的に第2の
マイクロプロセッサ1に供給されるものである。
The emulation memory 4 is a memory that stores other instructions of the second microprocessor 1 necessary for emulating the instructions of the first microprocessor, and includes the instruction bus 21. Instruction address bus 22. It is connected to the signal line 32 and the signal line 31. Here, when the signal line 32 is set to a predetermined level, for example, a logical value "1" by the instruction decode unit 3, the emulation memory 4 transfers the instruction stored in the location specified by the address of the instruction address bus 22 to the instruction bus. Output to 21. Also, when one section of emulation is finished, the signal line 3
By setting the level of 1 to a predetermined level, such as a logical value of "1", the instruction decode unit 3 is notified of this fact. The outputs of the instruction decode unit 3 and the emulation memory 4 are both input to the second microprocessor l via the instruction bus 21, but while one outputs a valid signal, the other is in a high impedance state. As shown, both outputs are selectively supplied to the second microprocessor 1 without interfering with each other.

第1図の構成にてエミュレーションを行う場合、エミュ
レーション対象となる第1のマイクロブロセノサのプロ
グラムおよびデータはメモリ2に格納される。また、そ
の各命令をエミュレーションする際に必要となる第2の
マイクロプロセッサ1の命令は、その一部が命令デコー
ドユニソト3で生成され(換言すれば、そのように予め
命令デコードユニット3を作ってお<)、エミュレーシ
ョンに必要な残りの命令はエミュレーションメモリ4に
格納される.エミュレーション動作が開始されると、命
令デコードユニット3がメモリ2から第1のマイクロプ
ロセッサの命令をフエ,チして解読し、その命令のエミ
エレーシッンに必要な第2のマイクロプロセッサlの命
令を逐次に発生して命令バス2Iを介してマイクロプロ
セッサlに供給する.このとき、本実施例では、フェッ
チされた命令が特定の命令であるときは、それをエミュ
レーションする為の複数の命令を命令デコードユニット
3が全て生成して出力し、他の命令については、1つの
命令をエミュレーションするのに必要な複数の命令のう
ちの所定の命令のみを命令デコードユニット3が生成し
、残りの命令はエミュレーションメモリ4から読み出さ
れる。後者の場合、命令デコードユニット3は、適当な
タイミングで信号線32のレベルを論理値“1′にする
When emulating with the configuration shown in FIG. 1, the program and data of the first microprocessor to be emulated are stored in the memory 2. Further, some of the instructions of the second microprocessor 1 necessary for emulating each instruction are generated by the instruction decode unit 3 (in other words, the instruction decode unit 3 is created in advance in this way). Then, the remaining instructions necessary for emulation are stored in the emulation memory 4. When the emulation operation is started, the instruction decoding unit 3 retrieves and decodes the instructions of the first microprocessor from the memory 2, and sequentially decodes the instructions of the second microprocessor l necessary for emulating the instructions. is generated and supplied to the microprocessor l via the instruction bus 2I. At this time, in this embodiment, when the fetched instruction is a specific instruction, the instruction decode unit 3 generates and outputs all the plural instructions for emulating it, and for other instructions, only one instruction is generated. The instruction decode unit 3 generates only a predetermined instruction among the plurality of instructions necessary for emulating one instruction, and the remaining instructions are read from the emulation memory 4. In the latter case, the instruction decode unit 3 sets the level of the signal line 32 to the logical value "1" at an appropriate timing.

これによって、エミュレーションメモリ4内の命令アド
レスバス22で指定された場所から読み出された命令が
命令バス2lを介して第2のマイクロプロセッサ1に供
給される。第2のマイクロプロセッサ1は命令バス21
を介して供給される命令を実行するものであり、内部レ
ジスタ間の加算やデータバス11およびアドレスバスl
2を介してのメモリ2へのアクセス等を行い、結果とし
て第1のマイクロプロセッサの命令のエミュレーション
を達成する。
As a result, the instruction read from the location specified by the instruction address bus 22 in the emulation memory 4 is supplied to the second microprocessor 1 via the instruction bus 2l. The second microprocessor 1 has an instruction bus 21
It executes instructions supplied via the internal registers, and performs additions between internal registers and data bus
2, and as a result emulation of the instructions of the first microprocessor is achieved.

次に、エミュレーシ目ン対象となる第1のマイクロプロ
セッサの命令形式,エミュレーションを行う第2のマイ
クロプロセッサ1の命令形式の具体例について説明し、
第1のマイクロプロセッサの或る1つの命令を例にして
本実施例の動作をより詳しく説明する。
Next, specific examples of the instruction format of the first microprocessor to be emulated and the instruction format of the second microprocessor 1 that performs emulation will be explained.
The operation of this embodiment will be explained in more detail using one instruction of the first microprocessor as an example.

第2図は第1のマイクロプロセッサの命令形式を示す.
同図において、フィールドf21はオペレーションコー
ドOPを格納するフィールド、フィールドf22は第1
オペランドとなるレジスタR1を、フィールドf23は
インデックスレジスタX2を、フィールドf24はペー
スレジスタB2をそれぞれ指示するフィールドであり、
フィールド[25はディスプレイスメント値D2を格納
するフィールドである.インデックスレジスタX2に格
納されている値(X2)とペースレジスタB2に格納さ
れている値(B2)とディスプレイスメント値D2とが
加算されて第2オペランドとなるメモリのアドレスが求
められるものである.第3図(al. (bl, tc
)は第2のマイクロプロセッサ1の命令形式を示す.同
図(a)において、フィールド[31はオベレーシコン
コードOPを格納するフィールド、フィールド[32は
デスティネーションレジスタRAt−、フィールドf3
3はソースレジスタRBを、フィールドf34はソース
レジスタRCをそれぞれ指示するフィールドである.ま
た同図(b)において、フィールドf35はオペレーシ
ッンコードoPを格納するフィールド、フィールドf3
6は当該命令がブランチ命令のときブランチ先アドレス
(BRANCH  ADDRESS)を格納するフィー
ルドである。更に同図(Clにおいて、フィールド[3
7はオペレーションコードOPを格納するフィールド、
フィールドf3BはデスティネーションレジスタRAを
指示するフィールド、フィールド『39はイミーディエ
イトデータ(IMMEDIATE  DATA)を格納
するフィールドである. 第2図の命令形式で表される第1のマイクロプロセッサ
のロード命令(メモリ上のオペランドをレジスタへ転送
する命令であり、第2図を参照すると、フィールドf2
3,f24,[25で指定されるインデックスレジスタ
X2の内容とペースレジスタB2の内容とディスプレイ
スメント値D2とを加算して得られるメモリのアドレス
の内容を、フィールド[22で指定されるレジスタR1
へ転送する命令である)をエミュレーションする場合、
例えば第4図に示す第2のマイクロプロセッサ1の6個
の命令を使用する.ここで、命令■〜■については第1
図の命令デコードユニット3で生成され、命令■〜■は
エミュレーションメモI7 4に格納される.なお、各
命令の内容は次の通りである. ・命令■ 第3図(Clの型の命令であり、ディスプレイスメント
値D2を第2のマイクロプロセッサ1内の汎用レジスタ
R36へ転送する命令である。
Figure 2 shows the instruction format of the first microprocessor.
In the figure, field f21 is a field for storing an operation code OP, and field f22 is a field for storing an operation code OP.
The field f23 indicates the register R1 which is the operand, the field f23 indicates the index register X2, and the field f24 indicates the pace register B2.
Field [25 is a field that stores displacement value D2. The value (X2) stored in the index register X2, the value (B2) stored in the pace register B2, and the displacement value D2 are added to obtain the memory address that becomes the second operand. Figure 3 (al. (bl, tc
) indicates the instruction format of the second microprocessor 1. In FIG. 3(a), field [31 is a field for storing the overlapping code OP, field [32 is a destination register RAt-, field f3
3 is a field indicating source register RB, and field f34 is a field indicating source register RC. In addition, in FIG. 3B, field f35 is a field for storing an operating code oP, and field f3 is a field for storing an operating code oP.
6 is a field that stores a branch destination address (BRANCH ADDRESS) when the instruction is a branch instruction. Furthermore, in the same figure (in Cl, field [3
7 is a field that stores the operation code OP;
Field f3B is a field that specifies destination register RA, and field ``39'' is a field that stores immediate data (IMMEDIATE DATA). The first microprocessor's load instruction (an instruction to transfer an operand in memory to a register, which is expressed in the instruction format shown in FIG. 2) is a field f2
3, f24, the contents of the memory address obtained by adding the contents of index register
), which is an instruction to transfer to
For example, six instructions of the second microprocessor 1 shown in FIG. 4 are used. Here, for commands ■~■, the first
The instructions 1 to 2 are generated by the instruction decode unit 3 shown in the figure, and are stored in the emulation memory I74. The contents of each command are as follows.・Instruction ■ FIG. 3 (This is a Cl type instruction, and is an instruction to transfer the displacement value D2 to the general-purpose register R36 in the second microprocessor 1.

・命令■ 第3図(alO型の命令であり、第2のマイクロプロセ
ッサ1内のソースレジスタRC,RBおよびデスティネ
ーションレジスタRAを指定する間接ポインタIPRC
,IPRBおよびIPRAに、各フィールドの値X2,
B2,Rlを転送する命令である。
・Instruction ■ Figure 3 (This is an alO type instruction, and an indirect pointer IPRC that specifies the source registers RC, RB and destination register RA in the second microprocessor 1)
, IPRB and IPRA, each field value X2,
This is an instruction to transfer B2 and Rl.

命令■ 第3図(′b)の型の命令であり、引き続いて実行する
エミュレーションメモリ4に格納されている■の命令へ
ブランチさせる命令である。
Instruction (2) This is an instruction of the type shown in FIG. 3 ('b), and is an instruction to branch to the instruction (2) stored in the emulation memory 4 to be executed subsequently.

・命令■ 第3図(alO型の命令であり、間接ポインタIPRC
,IPRBで示される汎用レジスタX2,B2の内容(
X2),  (B2)を加算して汎用レジスタR34ヘ
セフトする命令である。
・Instruction■ Figure 3 (alO type instruction, indirect pointer IPRC
, the contents of general-purpose registers X2 and B2 indicated by IPRB (
This is an instruction to add X2) and (B2) and theft to general-purpose register R34.

・命令■ 同じく第3図(In)の型の命令であり、汎用レジスタ
R34の内容( (X2)+ (B2)l と汎用レジ
スタR36の内容D2を加算して汎用レジスタR35ヘ
セットする命令である. ・命令■ 同じく第3図(alO型の命令であり、アドレスが汎用
レジスタR35の内容( ( (X2)+ (B2)+
D21 )で示されるメモリ2の内容を間接ポインタI
PRAで示される汎用レジスタRAへ転送する命令であ
る。なお、この命令■が読み出されると、エミュレーシ
ョンメモリ4から信号線31に論理値“1”が出力され
るようになっている。
・Instruction■ This is also an instruction of the type shown in Figure 3 (In), and is an instruction to add the contents of general-purpose register R34 ((X2) + (B2)l and the contents D2 of general-purpose register R36 and set it to general-purpose register R35. . ・Instruction ■ Also shown in Figure 3 (This is an alO type instruction, and the address is the contents of general-purpose register R35 ( ( (X2) + (B2) +
D21 ) The contents of memory 2 indicated by indirect pointer I
This is an instruction to transfer to general-purpose register RA indicated by PRA. It should be noted that when this instruction (2) is read out, a logic value "1" is output from the emulation memory 4 to the signal line 31.

動作にあっては、先ず命令デコードユニット3が第1の
マイクロプロセッサのロード命令をメモリ2からフェッ
チして解読し、命令のを生成して命令バス21に出力す
る.第2のマイクロプロセッサlはこの命令■を受ける
と、その命令■中のディスプレイスメント値D2を内部
のレジスタR36に転送する. 次のクロフクで命令デコードユニット3は命令■を生成
して命令バス2lに出力し、第2のマイクロプロセッサ
lはこれに応答して内部のソースレジスタRC.RBお
よびデスティネーションレジスタRAを指定する間接ポ
インタIPRC,IPRB,IPRAに、命令■の各フ
ィールドの値を転送する。
In operation, first, the instruction decode unit 3 fetches the load instruction of the first microprocessor from the memory 2, decodes it, generates an instruction, and outputs it to the instruction bus 21. When the second microprocessor l receives this instruction (2), it transfers the displacement value D2 in the instruction (2) to the internal register R36. At the next clock, the instruction decoding unit 3 generates the instruction (2) and outputs it to the instruction bus 2l, and the second microprocessor l responds to this by generating the instruction (2) in the internal source register RC. The values of each field of instruction (2) are transferred to indirect pointers IPRC, IPRB, and IPRA that specify RB and destination register RA.

次のクロソクで命令デコードユニット3は第4図の命令
■を生成して命令バス21に出力する。
At the next crosshair, the instruction decode unit 3 generates the instruction (2) shown in FIG. 4 and outputs it to the instruction bus 21.

命令■はブランチ命令であり、これを受けた第2のマイ
クロプロセッサ1はプログラムカウンタPCに命令■の
フィールドで指定されたブランチ先アドレスをセットす
る.ブランチ先アドレスは引き続いて実行するエミュレ
ーションメモリ4に格納されている命令■のアドレスで
あり、このアドレスが命令アドレスバス22に出力され
る。また命令デコードユニット3は命令■の実行に同期
して信号線32のレベルを論理値“1”にし、エミュレ
ーションメモリ4の出力を命令バス21に出力させる. 従って、次のクロックでは、エミュレーションメモリ4
から第4図の命令■が命令バス21に出力され、第2の
マイクロプロセッサ1は間接ポインタIPRC,IPR
Bで示される汎用レジスタRC,RBの内容(X2),
  (B2)を加算して汎用レジスタR34ヘセソトす
る.このときプログラムカウンタPCが更新され命令ア
ドレスバス22がエミュレーションメモリ4上の命令■
の位置を指示する。
The instruction ■ is a branch instruction, and upon receiving it, the second microprocessor 1 sets the branch destination address specified in the field of the instruction ■ in the program counter PC. The branch destination address is the address of the instruction (2) stored in the emulation memory 4 to be executed subsequently, and this address is output to the instruction address bus 22. Further, the instruction decode unit 3 sets the level of the signal line 32 to a logical value "1" in synchronization with the execution of the instruction (2), and outputs the output of the emulation memory 4 to the instruction bus 21. Therefore, at the next clock, emulation memory 4
4 is output to the instruction bus 21, and the second microprocessor 1 outputs the indirect pointers IPRC and IPR.
Contents of general-purpose registers RC and RB indicated by B (X2),
(B2) is added and transferred to general-purpose register R34. At this time, the program counter PC is updated and the instruction address bus 22 reads the instruction on the emulation memory 4.
Indicate the location of

続《クロックでエミュレーションメモリ4から命令■が
命令バス21に出力される。第2のマイクロプロセッサ
lはこの命令■を受けることにより、汎用レジスタR3
4の内容{ (X2)+ (B2)}と汎用レジスタR
36の内容D2を加算して汎用レジスクR35ヘセント
する。この結果、汎用レジスタR35に、ロード命令で
の第2オペランドのメモリアドレス( ( (X2)+
 (B2)+D2) )が作成されたことになる。なお
、このときプログラムカウンタPCが更新される.続く
クロックでエミュレーションメモリ4から命令■が読み
出されて第2のマイクロプロセッサlに供給される。第
2のマイクロプロセッサ1はこれに応答して、汎用レジ
スタR35が保持するメモリ2のアドレスをアクセスし
、その内容を間接ポインタIPRAで示される汎用レジ
スタRAへ転送する.この命令■の実行によりロード命
令のエミエレーションが完了する。
Continuation 《Instruction ■ is output from the emulation memory 4 to the instruction bus 21 with the clock. By receiving this instruction ■, the second microprocessor l receives the general-purpose register R3.
Contents of 4 { (X2) + (B2)} and general-purpose register R
The contents D2 of 36 are added and sent to the general register R35. As a result, the memory address of the second operand in the load instruction (((X2)+
(B2)+D2) ) has been created. Note that the program counter PC is updated at this time. At the subsequent clock, the instruction (2) is read from the emulation memory 4 and supplied to the second microprocessor (1). In response, the second microprocessor 1 accesses the address of the memory 2 held by the general-purpose register R35, and transfers its contents to the general-purpose register RA indicated by the indirect pointer IPRA. Execution of this instruction ■ completes the emulation of the load instruction.

命令■をエミュレーションメモリ4が命令バス21に出
力するのと同期して信号線3lのレベルが論理値“1”
にセットされ、命令デコードユニット3はこれを検出す
ると、既にメモリ2からフェッチしていた次に実行すべ
き第1のマイクロプロセッサの命令を解読して作成した
第2のマイクロプロセッサの命令を命令バス21へ出力
し、次の命令のエミュレーションを開始する.なお、命
令■の出力と同期して信号線31のレベルを論理値“l
1にする構成は、例えば命令■と同一アドレスに設けら
れた論理値“1”の付加ビットを信号線31に出力する
構成を採用することができる.このように本例では、命
令デコードユニット3が第2のマイクロプロセッサ1へ
出力する命令は、第1のマイクロプロセッサの命令に含
まれるレジスタ指定フィールド,ディスプレイスメント
値.イミーディエイトデータを第2のマイクロプロセッ
サ1内のレジスタヘセットする命令およびエミュレーシ
ョンメモリ4ヘブランチさせる命令であり、これ以外の
命令はエミュレーションメモリ4が第2のマイクロプロ
セッサ1へ出力する.また、前述したように命令デコー
ドユニット3が第1のマイクロプロセッサの特定の命令
のエミュレーションについて第2のマイクロプロセッサ
1の全ての命令を出力することも可能である.第2のマ
イクロプロセッサ1の性能を充分に引き出すためには、
命令を高速に供給する必要がある。
In synchronization with the emulation memory 4 outputting the instruction ■ to the instruction bus 21, the level of the signal line 3l changes to the logical value "1".
When the instruction decode unit 3 detects this, it decodes the first microprocessor instruction that has already been fetched from the memory 2 and is to be executed next, and transfers the created second microprocessor instruction to the instruction bus. 21 and starts emulating the next instruction. Note that the level of the signal line 31 is changed to the logical value "l" in synchronization with the output of the command
For example, a configuration in which an additional bit with a logical value of "1" provided at the same address as the instruction (■) is outputted to the signal line 31 can be adopted. In this example, the instruction that the instruction decode unit 3 outputs to the second microprocessor 1 is based on the register specification field, displacement value, etc. included in the instruction of the first microprocessor. These are an instruction to set immediate data in a register in the second microprocessor 1 and an instruction to branch to the emulation memory 4. Other instructions are output from the emulation memory 4 to the second microprocessor 1. Furthermore, as described above, it is also possible for the instruction decoding unit 3 to output all instructions of the second microprocessor 1 for emulation of a specific instruction of the first microprocessor. In order to fully utilize the performance of the second microprocessor 1,
It is necessary to supply instructions quickly.

これをエミュレーションメモリ4で実現することは高速
の大容量のメモリを必要として価格の上昇,実装スペー
スの増加を招き、得策ではない.これに対し命令デコー
ドユニット3は比較的安価に高速に命令を供給すること
が可能である。従って、高速に実行すべき第1のマイク
ロプロセッサの特定の命令のエミュレーションについて
は命令デコードユニット3が第2のマイクロプロセッサ
lの全ての命令を供給するようにし、それほど高速に実
行する必要のない第1のマイクロプロセッサの命令のエ
ミュレーションについてはエミュレーションメモリ4か
らも命令を供給するようにすれば、適切なコストでもっ
て比較的高速のエミュレーションが可能になるものであ
る。
Achieving this with emulation memory 4 would require a high-speed, large-capacity memory, leading to an increase in price and mounting space, which is not a good idea. In contrast, the instruction decode unit 3 can supply instructions relatively inexpensively and at high speed. Therefore, for emulation of a specific instruction of the first microprocessor that needs to be executed at high speed, the instruction decoding unit 3 supplies all the instructions of the second microprocessor l, and for emulation of a specific instruction of the first microprocessor that needs to be executed at high speed, Regarding the emulation of the instructions of the microprocessor 1, if the instructions are also supplied from the emulation memory 4, relatively high-speed emulation can be achieved at an appropriate cost.

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

以上説明したように、本発明のマイクロプロセッサのエ
ミュレーション方式は、第1のマイクロプロセッサのエ
ミュレーションに使用する第2のマイクロプロセッサの
外部に、第1のマイクロプロセッサの命令をフエソチし
て解読しその命令をエミュレーションするのに必要な第
2のマイクロプロセッサの命令を出力する命令デコード
ユニソトと、第1のマイクロプロセッサの命令をエミュ
レーションするのに必要な第2のマイクロプロセッサの
その他の命令を格納するエミュレーシタンメモリとを設
けたものであり、命令デコードユニットおよびエミュレ
ーションメモリの規模は第2のマイクロプロセッサと独
立に任意に設定できるため、アーキテクチャの大幅に異
なるマイクロプロセッサについても容易にエミュレーシ
ョンすることが可能となる. また、第1のマイクロプロセッサの命令をエミュレーシ
ョンするのに必要な第2のマイクロプロセッサの命令を
、エミヱレーションメモリからだけでなく、命令の高速
な供給が可能な命令デコードユニソトからも供給するよ
うにして適宜両出力を切り替えるものであり、高速に実
行すべき第1のマイクロプロセッサの特定の命令のエミ
ュレーションについては命令デコードユニットが第2の
マイクロプロセッサ1の全ての命令を供給するようにし
、それほど高速に実行する必要のない第1のマイクロプ
ロセッサの命令のエミュレーションについてはエミュレ
ーシタンメモリからも命令を供給するようにすることに
より、適切なコストでもって比較的高速のエミュレーシ
ョンが可能になるものである. この結果、本発明によれば、各アプリケーション毎に使
用されている専用アーキテクチャをもつマイクロプロセ
ッサを汎用の高速のマイクロプロセッサで高速にエミエ
レーションを行い、装置やシステムの性能の向上がはか
れる効果がある.
As explained above, the microprocessor emulation method of the present invention transmits and decodes the instructions of the first microprocessor to an external device of the second microprocessor used for emulation of the first microprocessor. an instruction decode unit that outputs the instructions of the second microprocessor necessary to emulate the instructions of the second microprocessor, and an emulator that stores other instructions of the second microprocessor that are necessary to emulate the instructions of the first microprocessor. The size of the instruction decode unit and emulation memory can be arbitrarily set independently from the second microprocessor, making it possible to easily emulate microprocessors with significantly different architectures. Become. In addition, the instructions for the second microprocessor necessary to emulate the instructions for the first microprocessor are supplied not only from the emulation memory but also from an instruction decode unit that can supply instructions at high speed. For emulation of specific instructions of the first microprocessor 1 that should be executed at high speed, the instruction decode unit supplies all instructions of the second microprocessor 1. As for the emulation of the instructions of the first microprocessor that do not need to be executed at a very high speed, by supplying the instructions from the emulator memory as well, relatively high-speed emulation can be achieved at a reasonable cost. be. As a result, according to the present invention, it is possible to quickly emulate a microprocessor with a dedicated architecture used for each application with a general-purpose high-speed microprocessor, thereby improving the performance of devices and systems. be.

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

第1図は本発明の一実施例の要部ブロック図、第2図は
第1のマイクロプロセッサの命令形式を示す図、 第3図は第2のマイクロプロセッサの命令形式を示す図
および、 第4図は第1のマイクロプロセノサのロード命令をエミ
ュレーシランする際に第2のマイクロプロセッサに供給
される命令の一例を示す図である.図において、 1・・・第2のマイクロプロセッサ 2・・・メモリ 3・・・命令デコードユニット 4・・・エミュレーションメモリ 11・・・データパス 12・・・アドレスバス 2l・・・命令バス 22・・・命令アドレスバス 31,32・・・信号線 特許出願人 日本電気株式会社外1名
FIG. 1 is a block diagram of a main part of an embodiment of the present invention, FIG. 2 is a diagram showing the instruction format of the first microprocessor, FIG. 3 is a diagram showing the instruction format of the second microprocessor, and FIG. FIG. 4 is a diagram showing an example of instructions supplied to the second microprocessor when emulating and executing a load instruction of the first microprocessor. In the figure, 1... second microprocessor 2... memory 3... instruction decode unit 4... emulation memory 11... data path 12... address bus 2l... instruction bus 22... ...Command address bus 31, 32...Signal line Patent applicant: 1 person other than NEC Corporation

Claims (1)

【特許請求の範囲】 特定のアーキテクチャを有する第1のマイクロプロセッ
サをそれとは異なるアーキテクチャを有する第2のマイ
クロプロセッサを使用してエミュレーションする方式に
おいて、 前記第1のマイクロプロセッサの命令をフェッチして解
読し該命令をエミュレーションするのに必要な前記第2
のマイクロプロセッサの命令を出力する命令デコードユ
ニットと、 前記第1のマイクロプロセッサの命令をエミュレーショ
ンするのに必要な前記第2のマイクロプロセッサのその
他の命令を格納するエミュレーションメモリとを備え、 前記命令デコードユニットの出力と前記エミュレーショ
ンメモリの出力とを適宜切り替えて前記第2のマイクロ
プロセッサへ入力することを特徴とするマイクロプロセ
ッサのエミュレーション方式。
[Scope of Claims] A method for emulating a first microprocessor having a specific architecture using a second microprocessor having a different architecture, comprising: fetching and decoding instructions of the first microprocessor; and the second instruction necessary to emulate the instruction.
an instruction decode unit that outputs instructions of the second microprocessor; and an emulation memory that stores other instructions of the second microprocessor necessary for emulating the instructions of the first microprocessor; A microprocessor emulation system characterized in that the output of the unit and the output of the emulation memory are switched as appropriate and inputted to the second microprocessor.
JP5926189A 1989-03-10 1989-03-10 Emulation system for microprocessor Pending JPH02236734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5926189A JPH02236734A (en) 1989-03-10 1989-03-10 Emulation system for microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5926189A JPH02236734A (en) 1989-03-10 1989-03-10 Emulation system for microprocessor

Publications (1)

Publication Number Publication Date
JPH02236734A true JPH02236734A (en) 1990-09-19

Family

ID=13108256

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5926189A Pending JPH02236734A (en) 1989-03-10 1989-03-10 Emulation system for microprocessor

Country Status (1)

Country Link
JP (1) JPH02236734A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5758140A (en) * 1996-01-25 1998-05-26 International Business Machines Corporation Method and system for emulating instructions by performing an operation directly using special-purpose register contents

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5758140A (en) * 1996-01-25 1998-05-26 International Business Machines Corporation Method and system for emulating instructions by performing an operation directly using special-purpose register contents

Similar Documents

Publication Publication Date Title
KR100440841B1 (en) Microcomputer
CN101236487B (en) Multi-word storage/reading method of memory subsystem and circuit thereof
US5077657A (en) Emulator Assist unit which forms addresses of user instruction operands in response to emulator assist unit commands from host processor
EP0464494A2 (en) A high performance pipelined emulator
US20040177211A1 (en) Microcontroller instruction set
US20020188830A1 (en) Bit replacement and extraction instructions
WO2003042819A1 (en) Method and apparatus for interfacing a processor to a coprocessor
JPH07117897B2 (en) Prefetch circuit for data processing system
US5666510A (en) Data processing device having an expandable address space
JP2001504959A (en) 8-bit microcontroller with RISC architecture
US5742801A (en) Microprocessor to which additional instructions are added and instructions addition method thereof
JP2002215387A (en) Data processing device with instruction translator and memory interface device
JPS623461B2 (en)
EP0226991A2 (en) Data-processing device
JP3727395B2 (en) Microcomputer
JPH02236734A (en) Emulation system for microprocessor
US6233675B1 (en) Facility to allow fast execution of and, or, and test instructions
JP3547585B2 (en) Microprocessor having conditional execution instruction
JPH0667896A (en) Single chip microcomputer
JP2918570B2 (en) Central processing unit
JP2731618B2 (en) emulator
JP2696578B2 (en) Data processing device
JP2002163104A (en) Microcomputer
JP2883489B2 (en) Instruction processing unit
JP2869414B1 (en) Data processing device