JPH08221277A - Emulation device - Google Patents
Emulation deviceInfo
- Publication number
- JPH08221277A JPH08221277A JP2554295A JP2554295A JPH08221277A JP H08221277 A JPH08221277 A JP H08221277A JP 2554295 A JP2554295 A JP 2554295A JP 2554295 A JP2554295 A JP 2554295A JP H08221277 A JPH08221277 A JP H08221277A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- execution
- executed
- processor
- emulation
- 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
Links
- 238000000034 method Methods 0.000 description 41
- 238000010586 diagram Methods 0.000 description 15
- 239000000284 extract Substances 0.000 description 5
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Landscapes
- Multi Processors (AREA)
Abstract
(57)【要約】
【目的】 オーバヘッドを軽減してエミュレーション速
度を高速化する。
【構成】 それぞれが命令を翻訳・実行する複数のプロ
セッサ0,1,…,M-1 と、ターゲットコンピュータが
実行する機械語命令列TIの命令を1命令ずつ取り出し、
実行順序が連続している命令が異なるプロセッサに割り
当てられるように、複数のプロセッサ0,1,…,M-1
に命令列TIを1命令ずつ割り当てるマルチプロセッサエ
ミュレーション手段10と、複数のプロセッサ0,1,
…,M-1 を並行して動作させる並行エミュレーション手
段101 と、命令がその実行されるべき順序で実行される
ように、各プロセッサにおける命令の実行タイミングを
制御する実行同期制御手段102 とを備える。
(57) [Summary] [Purpose] To reduce overhead and increase emulation speed. [Structure] A plurality of processors 0, 1, ..., M-1 each of which translates / executes an instruction and one instruction of a machine language instruction sequence TI executed by a target computer is extracted,
A plurality of processors 0, 1, ..., M-1 are provided so that instructions whose execution order is continuous are assigned to different processors.
And a plurality of processors 0, 1,
..., parallel emulation means 101 for operating M-1 in parallel, and execution synchronization control means 102 for controlling the instruction execution timing in each processor so that the instructions are executed in the order in which they should be executed .
Description
【0001】[0001]
【産業上の利用分野】本発明は、エミュレーション対象
のコンピュータ(以下、ターゲットコンピュータとい
う)で実行される機械語レベルの命令列から命令を1つ
ずつ取り出して翻訳し、実行してターゲットコンピュー
タの動作を模擬するエミュレーション装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention extracts an instruction from a machine language level instruction sequence executed by a computer to be emulated (hereinafter referred to as a target computer), translates the instruction one by one, and executes the instruction to operate the target computer. The present invention relates to an emulation device that simulates.
【0002】[0002]
【従来の技術】ターゲットコンピュータの命令列を、例
えば、命令セットの内容,データの表現形式,割り込み
機構等の命令セットアーキテクチャーが異なるエミュレ
ーション装置が翻訳,実行してターゲットコンピュータ
の動作を模擬する場合、そのエミュレーション方式は、
ターゲットコンピュータで実行される機械語命令列から
機械語命令を逐次1命令ずつ取り出して翻訳し、実行す
るインタプリート方式と、ターゲットコンピュータで実
行される機械語命令列を最初にすべて取り出し、翻訳し
た後、実行するコンパイル方式とに大別される。2. Description of the Related Art When an instruction sequence of a target computer is translated and executed by an emulation device having a different instruction set architecture such as instruction set content, data expression format, interrupt mechanism, etc., to simulate the operation of the target computer. , Its emulation method is
An interpret method that sequentially extracts and translates machine language instructions one by one from the machine language instruction sequence executed on the target computer, and first retrieves and translates all machine language instruction sequences executed on the target computer. , And the compilation method to be executed.
【0003】図10は、インタプリート方式を採用した従
来のエミュレーション装置によるエミュレーション手順
を示すフローチャートである。従来のエミュレーション
装置は1つのプロセッサを備えたコンピュータとエミュ
レーション用のソフトウェアとからなり、ターゲットコ
ンピュータで実行される機械語レベルの命令列から1つ
の命令を取り出し(S31)、命令を翻訳し(S32)、翻
訳した命令を実行する(S33)。全命令に対して以上の
ステップS31〜S33を繰り返してエミュレーションを終
了する。FIG. 10 is a flow chart showing an emulation procedure by a conventional emulation device adopting the interpret method. The conventional emulation device is composed of a computer having one processor and software for emulation, and extracts one instruction from a machine language level instruction sequence executed in the target computer (S31) and translates the instruction (S32). The translated instruction is executed (S33). The above steps S31 to S33 are repeated for all the instructions to end the emulation.
【0004】図11は、例えばターゲットコンピュータの
命令列が、0,1,2,…,7の順に実行される8個の
命令である場合の従来のエミュレーション装置によるエ
ミュレーションのシーケンス図であって、左側は時間軸
である。このシーケンス図では時間の基本単位を1tと
しており、1つの命令の実行が完了するまでに、命令の
取り出しに1t、命令の翻訳に平均24t、命令の実行に
平均8tの計33tの時間を必要とする場合、命令0〜7
の終了までには 264t(=33t×8)の時間を要する。
即ち、図から明らかなように、従来のエミュレーション
装置におけるエミュレーション時間はターゲットコンピ
ュータの命令列の命令数に比例して増加する。FIG. 11 is a sequence diagram of emulation by a conventional emulation device when the instruction sequence of the target computer is, for example, eight instructions executed in the order of 0, 1, 2, ... The left side is the time axis. In this sequence diagram, the basic unit of time is 1t, and by the time the execution of one instruction is completed, it takes 1t for instruction fetch, 24t for translation of instruction, and 8t for execution of instruction, 33t in total. , Then instructions 0-7
It takes 264t (= 33t × 8) to complete.
That is, as is apparent from the figure, the emulation time in the conventional emulation device increases in proportion to the number of instructions in the instruction sequence of the target computer.
【0005】[0005]
【発明が解決しようとする課題】以上のように、従来の
エミュレーション装置は、命令の実行時間に比して、命
令の取り出し,翻訳といったオーバヘッドの占める割合
が大きいので、エミュレーション速度が遅いという問題
がある。As described above, the conventional emulation device has a problem that the emulation speed is low because the overhead of fetching and translating an instruction is large compared to the execution time of the instruction. is there.
【0006】本発明はこのような問題点を解決するため
になされたものであって、複数のプロセッサを使用して
並行的にエミュレーションすることにより、命令の実行
時間に対する命令の取り出し,翻訳といったオーバヘッ
ドが小さく、エミュレーション速度が高速なエミュレー
ション装置の提供を目的とする。The present invention has been made in order to solve such a problem, and by emulating in parallel using a plurality of processors, the overhead of fetching and translating an instruction with respect to the execution time of the instruction. It is intended to provide an emulation device having a small size and a high emulation speed.
【0007】[0007]
【課題を解決するための手段】第1発明のエミュレーシ
ョン装置は、エミュレーション対象の計算機で実行され
る機械語レベルの命令列から命令を1命令ずつ取り出し
て翻訳し、実行されるべき順序で順次実行することによ
りエミュレーション対象の計算機の動作を模擬するエミ
ュレーション装置において、それぞれが命令を翻訳して
実行する複数のプロセッサと、前記命令列から命令を1
命令ずつ取り出すとともに、前記命令列の各命令が、該
各命令の1つ前に実行されるべき命令の割り当てられた
プロセッサと異なるプロセッサに割り当てられるよう
に、前記各命令を前記複数のプロセッサのいずれか1つ
に割り当てる手段と、前記複数のプロセッサを並行して
動作させる手段と、前記命令列がその実行されるべき順
序で実行されるべく前記複数のプロセッサのそれぞれに
おける命令の実行タイミングを制御する手段とを備えた
ことを特徴とする。An emulation apparatus according to the first aspect of the present invention extracts instructions one by one from a machine language level instruction sequence executed by a computer to be emulated, translates the instructions, and sequentially executes the instructions in the order in which they should be executed. In the emulation device that simulates the operation of the computer to be emulated, a plurality of processors each of which translates and executes an instruction, and one instruction from the instruction sequence
Each instruction is fetched one by one, and each instruction of the instruction sequence is assigned to a processor different from the processor to which the instruction to be executed immediately before the instruction is assigned. Means for allocating one of the plurality of processors, means for operating the plurality of processors in parallel, and controlling the execution timing of instructions in each of the plurality of processors so that the instruction sequence is executed in the order in which it should be executed. And means.
【0008】第2発明のエミュレーション装置は、エミ
ュレーション対象の計算機で実行される機械語レベルの
命令列から命令を1命令ずつ取り出して翻訳し、実行さ
れるべき順序で順次実行することによりエミュレーショ
ン対象の計算機の動作を模擬するエミュレーション装置
において、前記命令列から命令を1命令ずつ取り出す手
段と、それぞれが命令を翻訳して実行するとともに、自
己が実行すべき命令を獲得する手段をそれぞれが有し、
命令を獲得する該手段は、獲得した命令の次の実行順の
命令を獲得しない手段である複数のプロセッサと、該複
数のプロセッサを並行して動作させる手段と、前記命令
列がその実行されるべき順序で実行されるべく前記複数
のプロセッサのそれぞれにおける命令の実行タイミング
を制御する手段とを備えたことを特徴とする。The emulation apparatus of the second invention extracts the instructions one by one from the machine language level instruction sequence executed by the computer to be emulated, translates them, and sequentially executes them in the order in which they should be executed. In an emulation device simulating the operation of a computer, each has means for extracting an instruction from the instruction sequence one by one, and means for translating and executing each instruction and acquiring an instruction to be executed by itself.
The means for acquiring an instruction is a means for not acquiring an instruction in the next execution order of the acquired instruction, a means for operating the plurality of processors in parallel, and the instruction sequence is executed. Means for controlling the execution timing of instructions in each of the plurality of processors so that the instructions are executed in a power order.
【0009】第3発明のエミュレーション装置は、第1
又は第2発明における、各プロセッサの命令の実行タイ
ミングを制御する前記手段は、各プロセッサにおける命
令の実行完了を検出する手段を備え、各プロセッサによ
る命令の実行が、該命令の1つ前に実行すべき命令の実
行完了後に開始されるべく制御する手段であることを特
徴とする。The emulation device of the third invention is the first emulation device.
Alternatively, in the second invention, the means for controlling the execution timing of the instruction of each processor includes means for detecting the completion of execution of the instruction in each processor, and the execution of the instruction by each processor is executed immediately before the instruction. It is a means for controlling to be started after the execution of the instruction to be executed is completed.
【0010】[0010]
【作用】第1発明のエミュレーション装置は、エミュレ
ーション対象の計算機で実行される機械語レベルの命令
列から命令を1命令ずつ取り出し、各命令がその1つ前
に実行されるべき命令の割り当てられたプロセッサと異
なるプロセッサに割り当てられるように、各命令を複数
のプロセッサのいずれか1つに割り当て、複数のプロセ
ッサを並行して動作させてそれぞれに割り当てられた命
令を翻訳・実行させ、各プロセッサは他のプロセッサが
1つの命令を実行している間に、自己に割り当てられ
た、実行中の命令より後の実行順の命令を翻訳し、さら
に、各プロセッサにおける命令の実行タイミングを制御
して、あたかも1つのプロセッサが命令列をその実行す
べき順序で連続的に実行しているようにエミュレーショ
ンを行う。従って、命令の実行以外のオーバヘッドが軽
減されてエミュレーションが高速に行われる。The emulation apparatus of the first invention takes out one instruction at a time from the machine language level instruction sequence executed by the computer to be emulated, and each instruction is assigned the instruction to be executed immediately before that. Each instruction is assigned to one of a plurality of processors so that it can be assigned to a processor different from the processor, and the plurality of processors are operated in parallel to translate and execute the assigned instructions, and each processor is While each processor is executing one instruction, it interprets the instruction assigned to itself, which is in the execution order after the instruction being executed, and controls the execution timing of the instruction in each processor, The emulation is performed so that one processor continuously executes the instruction sequence in the order of execution. Therefore, the overhead other than the execution of instructions is reduced, and emulation is performed at high speed.
【0011】第2発明のエミュレーション装置は、エミ
ュレーション対象の計算機で実行される機械語レベルの
命令列から命令を1命令ずつ取り出し、各プロセッサ側
から命令が獲得されるが、その際、各プロセッサは実行
順序が連続している命令を獲得しないように命令を獲得
し、複数のプロセッサを並行して動作させてそれぞれが
獲得した命令を翻訳・実行させ、各プロセッサは他のプ
ロセッサが1つの命令を実行している間に、自己に割り
当てられた、実行中の命令より後の実行順の命令を翻訳
し、さらに、各プロセッサにおける命令の実行タイミン
グを制御して、あたかも1つのプロセッサが命令列をそ
の実行すべき順序で連続的に実行しているようにエミュ
レーションを行う。従って、命令の実行以外のオーバヘ
ッドが軽減されてエミュレーションが高速に行われる。The emulation apparatus of the second invention takes out one instruction at a time from the machine language level instruction sequence executed by the computer to be emulated and acquires the instruction from each processor side. Instructions are acquired so as not to acquire instructions whose execution order is continuous, and a plurality of processors operate in parallel to translate and execute the acquired instructions, and each processor executes one instruction by another processor. During execution, it translates the instructions assigned to itself and in the order of execution after the instruction being executed, and controls the execution timing of the instructions in each processor so that one processor processes the instruction sequence. Emulation is performed as if they were continuously executed in the order in which they should be executed. Therefore, the overhead other than the execution of instructions is reduced, and emulation is performed at high speed.
【0012】第3発明のエミュレーション装置は、さら
に、各プロセッサにおける命令の実行タイミングを制御
する際、実行しようとする命令の1つ前の実行順の命令
を実行中のプロセッサによる命令の実行完了を検出し、
各プロセッサによる命令の実行が、1つ前に実行すべき
命令の実行完了後に開始されるように制御する。これに
より、命令列に、直前の命令の実行結果を基に演算を行
う命令が含まれている場合であっても、正しい実行結果
が得られる。The emulation apparatus of the third invention further controls the completion of execution of an instruction by the processor which is executing the instruction in the execution order immediately preceding the instruction to be executed when controlling the execution timing of the instruction in each processor. Detect and
The execution of the instruction by each processor is controlled to start after the execution of the instruction to be executed immediately before is completed. As a result, even if the instruction sequence includes an instruction that performs an operation based on the execution result of the immediately preceding instruction, the correct execution result can be obtained.
【0013】[0013]
【実施例】以下、本発明をその実施例を示す図に基づい
て説明する。図1は本発明のエミュレーション装置(以
下、本発明装置という)の構成を示すブロック図であ
る。図中、TIはターゲットコンピュータで実行される機
械語レベルの命令列であって、命令列TIは0,1,2,
…,N−1の順番で実行されるN個の命令で構成されて
おり、各命令は命令の実行順に相当する命令番号で管理
される。本発明装置は、それぞれが命令を翻訳及び実行
するM個のプロセッサを有し、M個のプロセッサは0〜
(M−1)のプロセッサ番号で管理される。マルチプロ
セッサエミュレーション手段10は、命令列TIをその実行
順、即ち命令番号順に1命令ずつ取り出し、各命令を、
各命令の1つ前に実行される命令を割り当てたプロセッ
サと異なるプロセッサに割り当てるべく、例えばプロセ
ッサ番号順にプロセッサ0〜(M−1)にそれぞれ割り
当てる。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings showing its embodiments. FIG. 1 is a block diagram showing the configuration of an emulation device of the present invention (hereinafter referred to as the device of the present invention). In the figure, TI is a machine language level instruction sequence executed by the target computer, and the instruction sequence TI is 0, 1, 2,
, N-1 are executed in the order of N-1, and each instruction is managed by an instruction number corresponding to the execution order of the instruction. The apparatus of the present invention has M processors, each of which translates and executes instructions, where M processors are 0 to
It is managed by the processor number of (M-1). The multiprocessor emulation means 10 fetches the instruction sequence TI one instruction at a time in the order of execution, that is, in the order of instruction numbers, and retrieves each instruction.
In order to assign the instruction to be executed immediately before each instruction to a processor different from the assigned processor, for example, they are assigned to processors 0 to (M-1) in the order of the processor numbers.
【0014】マルチプロセッサエミュレーション手段10
は、複数のプロセッサ0〜(M−1)を並行的に動作さ
せて並行的なエミュレーションを実現する並行エミュレ
ーション手段101 、及び命令列がその実行されるべき順
序で実行されるように、複数のプロセッサ0〜(M−
1)のそれぞれにおける命令の実行タイミングを制御す
る実行同期制御手段102 を含む。図2は本発明装置のエ
ミュレーション手順の概略のフローチャートである。マ
ルチプロセッサエミュレーション手段10は命令列TIから
命令をその実行順に1命令ずつ取り出し(S1)、例え
ば、取り出した命令を順次プロセッサ番号順に割り当
て、即ち、各命令を、各命令の1つ前に実行される命令
を割り当てたプロセッサと異なるプロセッサに割り当て
る(S2)。図3はプロセッサ番号順に命令を割り当て
る場合の割り当て状態の概念図である。並行エミュレー
ション手段101 は複数のプロセッサ0〜(M−1)を並
行して動作させ(S3)、実行同期制御手段102 は各プ
ロセッサにおける命令の実行タイミングを制御する(S
4)。Multiprocessor emulation means 10
Is a parallel emulation means 101 for operating a plurality of processors 0 to (M-1) in parallel to realize parallel emulation; and a plurality of instruction emulations in order to be executed. Processor 0- (M-
The execution synchronization control means 102 for controlling the execution timing of the instruction in each of 1) is included. FIG. 2 is a schematic flowchart of the emulation procedure of the device of the present invention. The multiprocessor emulation means 10 fetches instructions one by one from the instruction sequence TI in the order of execution (S1), for example, sequentially assigns the fetched instructions in processor number order, that is, executes each instruction one instruction before each instruction. The instruction to be assigned is assigned to a processor different from the assigned processor (S2). FIG. 3 is a conceptual diagram of the allocation state when the instructions are allocated in order of processor number. The parallel emulation means 101 operates a plurality of processors 0 to (M-1) in parallel (S3), and the execution synchronization control means 102 controls the instruction execution timing in each processor (S).
4).
【0015】一方、プロセッサ0〜(M−1)は命令獲
得手段0a,1a,2a,…,(M-1)aをそれぞれ有し、自己に
割り当てられるべき命令番号を、エミュレーションに使
用するプロセッサ数と自己のプロセッサ番号とを基に、
後述する定義式で算出してマルチプロセッサエミュレー
ション手段10から獲得する。さらに、プロセッサ0〜
(M−1)は、獲得した命令を翻訳する命令翻訳手段1
b, 2b, …, (M-1)b、及び翻訳された命令を実行する命
令実行手段1c, 2c, …, (M-1)cをそれぞれ備える。On the other hand, the processors 0 to (M-1) have instruction acquiring means 0a, 1a, 2a, ..., (M-1) a, respectively, and the instruction numbers to be assigned to themselves are used for emulation. Based on the number and own processor number,
It is calculated by a definition formula described later and obtained from the multiprocessor emulation means 10. Furthermore, processors 0 to
(M-1) is a command translation means 1 for translating the acquired command.
, (M-1) b, and instruction executing means 1c, 2c, ..., (M-1) c for executing the translated instruction.
【0016】命令獲得手段0a,1a,2a,…,(M-1)aが獲
得命令を決定する定義式は、使用するプロセッサ数をp
s、プロセッサ番号をpn(0起算)、1命令の翻訳・
実行を1ステップとする各プロセッサでの処理のステッ
プ番号をsn(0起算)とした場合、ps×sn+pn
で表される。図4は、エミュレーションに使用するプロ
セッサ数が4つの場合に、プロセッサ番号2のプロセッ
サが上述の定義式に基づいて自己の実行すべき命令を求
める手順を示す図である。ステップ0では、上述の定義
式から、ps×sn+pn=0×4+2=2となるの
で、命令2を獲得し、命令翻訳手段2b及び命令実行手段
2cが命令2を翻訳・実行する。また、次のステップ1で
は、上述の定義式から、ps×sn+pn=1×4+2
=6となるので、命令6を獲得し、命令翻訳手段2b及び
命令実行手段2cが命令6を翻訳・実行する。従って、プ
ロセッサ0〜(M−1)のそれぞれの命令獲得手段0a,
1a,2a,…,(M-1)aは、獲得した命令の次の実行順の命
令を連続して獲得することはない。The definition formula for the instruction acquisition means 0a, 1a, 2a, ..., (M-1) a to determine the acquisition instruction is p
s, processor number pn (starting from 0), translation of 1 instruction
When the step number of the process in each processor that has one step of execution is sn (starting from 0), ps × sn + pn
It is represented by. FIG. 4 is a diagram showing a procedure in which when the number of processors used for emulation is four, the processor with the processor number 2 obtains an instruction to be executed by itself based on the above-described definition formula. In step 0, ps × sn + pn = 0 × 4 + 2 = 2 is obtained from the above definition formula, so that the instruction 2 is acquired, and the instruction translation means 2b and the instruction execution means are acquired.
2c translates and executes instruction 2. Further, in the next step 1, ps × sn + pn = 1 × 4 + 2 from the above definition formula.
= 6, the instruction 6 is acquired, and the instruction translation means 2b and the instruction execution means 2c translate and execute the instruction 6. Therefore, the respective instruction acquisition means 0a of the processors 0 to (M-1),
1a, 2a, ..., (M-1) a do not continuously acquire the next instruction in the execution order after the acquired instruction.
【0017】命令の実行タイミングは、ある命令が直前
の命令の実行結果を基に演算を行っている場合等のよう
に命令間に依存関係が存在し、命令の実行順序を正確に
維持しなければならず、しかも前の命令が完了するまで
次の命令を実行できないような場合に制御が必要であ
る。そのため、実行同期制御手段102 は、命令実行手段
1c, 2c, …, (M-1)cによる命令実行の前後に、他のプロ
セッサによる前の順番の命令実行の完了を検出して自己
のプロセッサが命令の実行を開始してもよいかを確認す
るための「命令実行開始手続き」、及び命令の実行完了
を他のプロセッサに通知する「命令実行完了手続き」
を、命令を実行しようとするプロセッサに行わせること
で、各プロセッサにおける命令の実行タイミングを制御
する。なお、「命令実行開始手続き」及び「命令実行完
了手続き」は各プロセッサが各命令のエミュレーション
を行う都度、各プロセッサに行わせる。The instruction execution timing has a dependency relationship between instructions, such as when a certain instruction performs an operation based on the execution result of the immediately preceding instruction, and the instruction execution order must be accurately maintained. Control is necessary when the next instruction cannot be executed until the previous instruction is completed. Therefore, the execution synchronization control means 102 is an instruction execution means.
Before or after the instruction execution by 1c, 2c,…, (M-1) c, whether the completion of the previous order instruction execution by another processor is detected and whether its own processor may start the instruction execution "Instruction execution start procedure" for confirming, and "Instruction execution completion procedure" for notifying other processors of completion of instruction execution
Is executed by the processor that is going to execute the instruction, so that the execution timing of the instruction in each processor is controlled. The “instruction execution start procedure” and the “instruction execution completion procedure” are executed by each processor each time each processor emulates each instruction.
【0018】さらに、実行同期制御手段102 は、あるプ
ロセッサが命令を実行しようとする場合に、他のプロセ
ッサの実行中の命令が、あるプロセッサが実行しようと
する命令よりも前に実行されている必要がある命令でな
いかを確認するために、プロセッサ0〜(M−1)の個
数に対応する数の要素で構成される符号付整数型の同期
制御テーブル102aを複数のプロセッサ0〜(M−1)が
相互に参照可能な記憶領域に定義する「同期制御テーブ
ルの定義手続き」と、「同期制御テーブルの定義手続
き」で定義された同期制御テーブル102aの各要素の値を
全て「0」に初期化する「同期制御テーブルの初期化手
続き」とを行い、同期制御テーブル102aの要素の値を、
「命令実行完了手続き」が行われる都度、更新する。な
お、「同期制御テーブルの定義手続き」及び「同期制御
テーブルの初期化手続き」はエミュレーションの最初に
一度だけ実行する。図5は、エミュレーションに使用さ
れるプロセッサの数が4つの場合の同期制御テーブル10
2aの概念図である。Further, the execution synchronization control means 102 is such that, when a certain processor attempts to execute an instruction, an instruction being executed by another processor is executed before the instruction which one processor tries to execute. In order to confirm whether or not the instruction is a necessary instruction, a signed integer type synchronization control table 102a composed of a number of elements corresponding to the number of processors 0 to (M-1) is set to a plurality of processors 0 to (M- 1) All values of each element of the synchronization control table 102a defined in the "synchronization control table definition procedure" and the "synchronization control table definition procedure" defined in the mutually referable storage area are set to "0". Perform the "synchronization control table initialization procedure" to initialize the values of the elements of the synchronization control table 102a,
Updated every time the "command execution completion procedure" is performed. The "synchronization control table definition procedure" and the "synchronization control table initialization procedure" are executed only once at the beginning of emulation. FIG. 5 shows the synchronization control table 10 when the number of processors used for emulation is four.
It is a conceptual diagram of 2a.
【0019】図6は、エミュレーションに使用するプロ
セッサ数が4つの場合に、プロセッサ番号2のプロセッ
サが獲得した命令を翻訳・実行してエミュレートする手
順を示す図である。ステップ0において、命令獲得手段
2aが獲得すべき命令番号を算出してマルチプロセッサエ
ミュレーション手段10から獲得し、獲得した命令を命令
翻訳手段2bが翻訳し、命令実行手段2cは、まず実行同期
制御手段102 により提供される「命令実行開始手続き」
を行って、翻訳された命令を、命令の実行開始が可能に
なったタイミングで実行した後、実行同期制御手段102
により提供される「命令実行完了手続き」を行って、命
令の実行完了を他のプロセッサに通知する。FIG. 6 is a diagram showing a procedure for translating / executing an instruction acquired by the processor having the processor number 2 to emulate it when the number of processors used for emulation is four. In step 0, command acquisition means
2a calculates an instruction number to be obtained and obtains it from the multiprocessor emulation means 10, the instruction translation means 2b translates the obtained instruction, and the instruction execution means 2c firstly provides the "instruction provided by the execution synchronization control means 102". Execution start procedure "
And executing the translated instruction at the timing when the execution of the instruction can be started, and then the execution synchronization control means 102
By executing the “instruction execution completion procedure” provided by, the other processors are notified of the completion of execution of the instruction.
【0020】図7は「命令実行開始手続き」の手順を示
すフローチャートである。なお、変数iは命令の番号を
代入する変数、変数eはプロセッサ番号(ゼロ起算)を
代入する変数、変数vは同期制御テーブル102aの要素の
値を代入する変数である。「実行する命令の番号−1」
を変数iに代入し(S11)、命令を実行しようとするプ
ロセッサの番号が「0」か「0以外」かを判断する(S
12)。プロセッサ番号が「0」の場合は、「プロセッサ
数−1」を変数eに代入し(S13)、一方、プロセッサ
番号が「0以外」の場合は、「プロセッサ番号−1」を
変数eに代入する(S14)。FIG. 7 is a flowchart showing the procedure of the "instruction execution start procedure". The variable i is a variable for substituting the instruction number, the variable e is a variable for substituting the processor number (starting from zero), and the variable v is a variable for substituting the values of the elements of the synchronization control table 102a. "Number of instruction to execute-1"
Is assigned to the variable i (S11), and it is determined whether the number of the processor which is to execute the instruction is "0" or "other than 0" (S11).
12). When the processor number is "0", "the number of processors-1" is assigned to the variable e (S13), while when the processor number is "other than 0", "processor number-1" is assigned to the variable e. Yes (S14).
【0021】次に、同期制御テーブル102aのe番の要素
の値、即ち、実行しようとする命令の1つ前の命令を実
行すべきプロセッサの番号に対応する要素の値を変数v
に代入し(S15)、変数iの値と変数vの値とを比較す
る(S16)。変数vの値が変数iの値より大きい場合
(i≧vが偽)、即ち、1つ前に実行されるべき命令の
実行が完了している場合は命令の実行を開始する。ま
た、変数vの値が変数iの値と等しいか又は小さい場合
(i≧vが真)、即ち、1つ前に実行されるべき命令の
実行が完了していない場合は変数vの値が変数iの値よ
り大きくなるまで命令の実行を待ち合わせる(S17)。Next, the value of the e-th element of the synchronization control table 102a, that is, the value of the element corresponding to the number of the processor that should execute the instruction immediately before the instruction to be executed is set to the variable v.
(S15), and the value of the variable i is compared with the value of the variable v (S16). When the value of the variable v is larger than the value of the variable i (i ≧ v is false), that is, when the execution of the instruction to be executed immediately before has been completed, the execution of the instruction is started. When the value of the variable v is equal to or smaller than the value of the variable i (i ≧ v is true), that is, when the execution of the instruction to be executed immediately before is not completed, the value of the variable v is The execution of the instruction is waited until it becomes larger than the value of the variable i (S17).
【0022】図8は「命令実行完了手続き」の手順を示
すフローチャートである。自己のプロセッサ番号を変数
eに代入し(S21)、「実行の完了した命令の番号+プ
ロセッサ数」を変数vに代入する(S22)。同期制御テ
ーブル102aのe番の要素にvを設定して(S23)、手続
きを終了する。即ち、命令の実行が完了した時点で同期
制御テーブル102aの要素の値が、そのプロセッサの次の
ステップで実行すべき命令番号に更新されるので、各プ
ロセッサは、前述の「命令実行開始手続き」において、
1つ前の命令を実行すべきプロセッサに対応する同期制
御テーブル102aの要素の値を参照すれば、1つ前の命令
の実行が完了しているか否かを確認することができる。FIG. 8 is a flow chart showing the procedure of the "instruction execution completion procedure". The processor number of its own is substituted into the variable e (S21), and "the instruction number of the executed instruction + the number of processors" is substituted into the variable v (S22). V is set in the e-th element of the synchronization control table 102a (S23), and the procedure ends. That is, since the value of the element of the synchronization control table 102a is updated to the instruction number to be executed in the next step of the processor at the time when the execution of the instruction is completed, each processor has the above-mentioned “instruction execution start procedure”. At
By referring to the value of the element of the synchronization control table 102a corresponding to the processor that should execute the instruction immediately before, it is possible to confirm whether or not the execution of the instruction immediately before is completed.
【0023】次に、図9に示す4個のプロセッサを用い
た場合の本発明装置の具体的なエミュレーション時間
を、図11を用いて既に説明した1個のプロセッサを用い
た従来装置のシーケンス図におけるエミュレーション時
間と比較して説明する。前述と同様、時間の基本単位を
1tとした場合、エミュレーション対象の命令の獲得に
3t、エミュレーション対象の命令の取り出しに1t、
命令の翻訳に24t、「命令実行開始手続き」に5t、命
令の実行に平均8t、「命令実行完了手続き」に3tの
計44tの時間を必要とする。Next, the specific emulation time of the device of the present invention when the four processors shown in FIG. 9 are used is a sequence diagram of the conventional device using one processor which has already been described with reference to FIG. This will be described in comparison with the emulation time in. Similar to the above, assuming that the basic unit of time is 1t, 3t is used to obtain an emulation target instruction, and 1t is used to fetch an emulation target instruction.
It requires a total of 44t, 24t for translating instructions, 5t for "instruction execution start procedure", 8t on average for executing instructions, and 3t for "instruction execution completion procedure".
【0024】従来装置では各命令のエミュレーションに
33tの時間を必要とするので、命令の実行以外のオーバ
ヘッドは76%(=(33−8)/33)である。また、従来
装置では命令0〜7の8命令の実行完了に 264tの時間
を必要とするので、オーバヘッドは、75%(= (264 −
8×8)/264 )である。以上を、命令を取り出す時間
をR、命令を翻訳する時間の平均をT、翻訳された命令
を実行する時間の平均をE、命令数をNと置き換える
と、オーバヘッドは((R+T)×N)/((R+T+
E)×N)と表される。従って、従来装置では、実行す
る命令数に関係なくオーバヘッドが一定であることがわ
かる。In the conventional device, for emulation of each instruction
Since 33t is required, the overhead other than the execution of the instruction is 76% (= (33-8) / 33). In addition, since the conventional device requires 264t to complete the execution of 8 instructions 0 to 7, the overhead is 75% (= (264-
8 × 8) / 264). If the instruction fetch time is R, the average time to translate the instruction is T, the average time to execute the translated instruction is E, and the number of instructions is N, the overhead is ((R + T) × N). / ((R + T +
E) × N). Therefore, in the conventional device, it can be seen that the overhead is constant regardless of the number of executed instructions.
【0025】本発明装置では各命令のエミュレーション
に44tの時間を必要とするので、従来装置よりも11tの
時間を多く必要とし、オーバヘッドは82%(=(44−
8)/44))である。これは、従来装置にはない「命令
実行開始手続き」と「命令実行完了手続き」を行うため
である。しかし、命令0〜7の8命令の実行完了には 1
21tの時間しか必要とせず、従来装置より 143tの時間
低減が可能となり、オーバヘッドは47%(=(121 −8
×8/121))と低く抑えられる。以上を、命令を獲
得する時間をG、命令を取り出す時間をR、命令を翻訳
する時間の平均をT、翻訳された命令を実行する時間の
平均をE、「命令実行開始手続き」を実行する時間を
S、「命令実行完了手続き」を実行する時間をF、命令
数をNと置き換えると、オーバヘッドは(G+R+T+
S+(F×N))/(G+R+T+S+(E+F)×
N)と表される。従って、本発明装置では、実行する命
令数の増加に従ってオーバヘッドが減少することがわか
る。Since the device of the present invention requires 44t to emulate each instruction, it requires 11t more time than the conventional device, and the overhead is 82% (= (44-
8) / 44)). This is because the “instruction execution start procedure” and the “instruction execution completion procedure” which are not available in the conventional apparatus are performed. However, 1 is required to complete the execution of 8 instructions 0 to 7.
Only 21t time is required, and it is possible to reduce the time by 143t compared to the conventional device, and the overhead is 47% (= (121-8
× 8/121)) and can be kept low. The above is the time to acquire an instruction, the time to fetch an instruction is R, the average time to translate an instruction is T, the average time to execute a translated instruction is E, and the "instruction execution start procedure" is executed. If the time is S, the time to execute the “instruction execution completion procedure” is F, and the number of instructions is N, the overhead is (G + R + T +
S + (F × N)) / (G + R + T + S + (E + F) ×
N). Therefore, in the device of the present invention, it can be seen that the overhead decreases as the number of executed instructions increases.
【0026】[0026]
【発明の効果】以上のように、本発明装置は、複数のプ
ロセッサを使用して並行的にエミュレーションするの
で、命令の実行時間に対する命令の取り出し,翻訳とい
ったオーバヘッドが小さく、エミュレーション速度が高
速であるという優れた効果を奏する。As described above, since the device of the present invention emulates in parallel using a plurality of processors, the overhead of fetching and translating an instruction with respect to the execution time of the instruction is small, and the emulation speed is high. It has an excellent effect.
【図1】本発明装置のブロック図である。FIG. 1 is a block diagram of a device of the present invention.
【図2】本発明装置のエミュレーション動作の概略のフ
ローチャートである。FIG. 2 is a schematic flowchart of an emulation operation of the device of the present invention.
【図3】本発明装置においてプロセッサ番号順に命令を
割り当てる場合の割り当て状態の概念図である。FIG. 3 is a conceptual diagram of an assignment state when instructions are assigned in the order of processor numbers in the device of the present invention.
【図4】本発明装置が自己の実行すべき命令を求める手
順を示す図である。FIG. 4 is a diagram showing a procedure in which the device of the present invention obtains an instruction to be executed by itself.
【図5】本発明装置の同期制御テーブルの概念図であ
る。FIG. 5 is a conceptual diagram of a synchronization control table of the device of the present invention.
【図6】本発明装置のエミュレーション手順を示す図で
ある。FIG. 6 is a diagram showing an emulation procedure of the device of the present invention.
【図7】本発明装置の「命令実行開始手続き」の手順を
示すフローチャートである。FIG. 7 is a flowchart showing a procedure of an “instruction execution start procedure” of the device of the present invention.
【図8】本発明装置の「命令実行完了手続き」の手順を
示すフローチャートである。FIG. 8 is a flowchart showing a procedure of an “instruction execution completion procedure” of the device of the present invention.
【図9】本発明装置の具体的なエミュレーションのシー
ケンス図である。FIG. 9 is a specific emulation sequence diagram of the device of the present invention.
【図10】従来装置のエミュレーション手順を示すフロ
ーチャートである。FIG. 10 is a flowchart showing an emulation procedure of a conventional device.
【図11】従来装置の具体的なエミュレーションのシー
ケンス図である。FIG. 11 is a specific emulation sequence diagram of a conventional device.
0a, 1a, …, (M-1)a 命令獲得手段 0b, 1b, …, (M-1)b 命令翻訳手段 0c, 1c, …, (M-1)c 命令実行手段 10 マルチプロセッサエミュレーション手段 101 並行エミュレーション手段 102 実行同期制御手段 102a 同期制御テーブル TI 機械語命令列 0a, 1a, ..., (M-1) a Instruction acquisition means 0b, 1b, ..., (M-1) b Instruction translation means 0c, 1c, ..., (M-1) c Instruction execution means 10 Multiprocessor emulation means 101 Concurrent emulation means 102 Execution synchronization control means 102a Synchronization control table TI Machine language instruction sequence
Claims (3)
れる機械語レベルの命令列から命令を1命令ずつ取り出
して翻訳し、実行されるべき順序で順次実行することに
よりエミュレーション対象の計算機の動作を模擬するエ
ミュレーション装置において、それぞれが命令を翻訳し
て実行する複数のプロセッサと、前記命令列から命令を
1命令ずつ取り出すとともに、前記命令列の各命令が、
該各命令の1つ前に実行されるべき命令の割り当てられ
たプロセッサと異なるプロセッサに割り当てられるよう
に、前記各命令を前記複数のプロセッサのいずれか1つ
に割り当てる手段と、前記複数のプロセッサを並行して
動作させる手段と、前記命令列がその実行されるべき順
序で実行されるべく前記複数のプロセッサのそれぞれに
おける命令の実行タイミングを制御する手段とを備えた
ことを特徴とするエミュレーション装置。1. An operation of a computer to be emulated is simulated by fetching and translating instructions one by one from a machine language level instruction sequence executed by the computer to be emulated and sequentially executing them in the order in which they should be executed. In the emulation device, a plurality of processors each of which translates and executes an instruction, and one instruction from the instruction sequence, and each instruction of the instruction sequence,
Means for assigning each instruction to one of the plurality of processors so that the instruction is assigned to a processor different from the processor to which the instruction to be executed immediately before each instruction is assigned; An emulation apparatus comprising: means for operating in parallel; and means for controlling the execution timing of instructions in each of the plurality of processors so that the instruction sequence is executed in the order in which it should be executed.
れる機械語レベルの命令列から命令を1命令ずつ取り出
して翻訳し、実行されるべき順序で順次実行することに
よりエミュレーション対象の計算機の動作を模擬するエ
ミュレーション装置において、前記命令列から命令を1
命令ずつ取り出す手段と、それぞれが命令を翻訳して実
行するとともに、自己が実行すべき命令を獲得する手段
をそれぞれが有し、命令を獲得する該手段は、獲得した
命令の次の実行順の命令を獲得しない手段である複数の
プロセッサと、該複数のプロセッサを並行して動作させ
る手段と、前記命令列がその実行されるべき順序で実行
されるべく前記複数のプロセッサのそれぞれにおける命
令の実行タイミングを制御する手段とを備えたことを特
徴とするエミュレーション装置。2. An operation of a computer to be emulated is simulated by fetching and translating instructions one by one from a machine language level instruction sequence executed by the computer to be emulated and sequentially executing them in the order in which they should be executed. In the emulation device, one instruction from the instruction sequence
Each unit has a unit for fetching an instruction and a unit for translating and executing the instruction and for acquiring an instruction to be executed by itself. The unit for acquiring the instruction is the next execution order of the acquired instruction. A plurality of processors that are means for not acquiring instructions, a means for operating the plurality of processors in parallel, and an execution of instructions in each of the plurality of processors so that the instruction sequence is executed in the order in which the instructions should be executed. An emulation device comprising: means for controlling timing.
制御する前記手段は、各プロセッサにおける命令の実行
完了を検出する手段を備え、各プロセッサによる命令の
実行が、該命令の1つ前に実行すべき命令の実行完了後
に開始されるべく制御する手段である請求項1又は2記
載のエミュレーション装置。3. The means for controlling the execution timing of an instruction of each processor comprises means for detecting the completion of execution of an instruction in each processor, and the execution of the instruction by each processor is executed immediately before the instruction. 3. The emulation device according to claim 1, which is a means for controlling to be started after completion of execution of a power instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2554295A JPH08221277A (en) | 1995-02-14 | 1995-02-14 | Emulation device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2554295A JPH08221277A (en) | 1995-02-14 | 1995-02-14 | Emulation device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH08221277A true JPH08221277A (en) | 1996-08-30 |
Family
ID=12168883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2554295A Pending JPH08221277A (en) | 1995-02-14 | 1995-02-14 | Emulation device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH08221277A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006512685A (en) * | 2002-12-31 | 2006-04-13 | トランスメタ コーポレイション | Circuit management method |
JP2006331415A (en) * | 2005-05-09 | 2006-12-07 | Sony Computer Entertainment Europe Ltd | Data processor and data processing method |
KR100724750B1 (en) * | 2003-05-26 | 2007-06-07 | 패밀리 가부시키가이샤 | Chair massagers, covers for massagers, covers for leg rests and massagers |
-
1995
- 1995-02-14 JP JP2554295A patent/JPH08221277A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006512685A (en) * | 2002-12-31 | 2006-04-13 | トランスメタ コーポレイション | Circuit management method |
KR100724750B1 (en) * | 2003-05-26 | 2007-06-07 | 패밀리 가부시키가이샤 | Chair massagers, covers for massagers, covers for leg rests and massagers |
JP2006331415A (en) * | 2005-05-09 | 2006-12-07 | Sony Computer Entertainment Europe Ltd | Data processor and data processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0109567B1 (en) | Accelerated instruction mapping external to source and target instruction streams for near realtime injection into the latter | |
EP1559012B1 (en) | Method and apparatus for performing validation of program code conversion | |
JPH10111818A (en) | Method and system for burst profiling | |
JPH0926876A (en) | Method and apparatus for multiplatform stateless instructionset architecture | |
JP2000155686A (en) | Method and device for executing program in distribution system, computer readable storage medium with program execution procedure in distribution system stored therein and computer system | |
JPH08221277A (en) | Emulation device | |
JP2817786B2 (en) | Simulation apparatus and simulation method | |
US7219335B1 (en) | Method and apparatus for stack emulation during binary translation | |
US5963725A (en) | Simulation system and method for microcomputer program | |
WO2013115561A1 (en) | Data processing system and data simulation method in the system | |
EP1943589A2 (en) | Method for generating a simulation program which can be executed on a host computer | |
JP2003177937A (en) | Apparatus and method for improvement of communication between emulator unit and host device | |
JPH1124940A (en) | Emulation processing system | |
JP2731252B2 (en) | Power plant simulation device and simulation code generation device for the device | |
JPS6334644A (en) | Simulator with functional level | |
CN107220408B (en) | Accelerated calculation method for control algorithm of full-range simulator of nuclear power station | |
JPH03129439A (en) | Debugging system | |
JP2002342126A (en) | Device and method for performing program | |
CN115934526A (en) | Application-level Internet of things firmware simulation execution method and system | |
JPH05224711A (en) | Control method for programmable controller | |
JPH05127945A (en) | Program execution situation analysis system | |
CN113836496A (en) | Code virtualization protection method, system, device and readable storage medium | |
JPH0695921A (en) | Simulation method and program debug system | |
JPH0375832A (en) | Virtual machine control system | |
JPS6378238A (en) | Object code generating device |