JP2011060080A - Simulation apparatus, simulation method and program for simulation - Google Patents
Simulation apparatus, simulation method and program for simulation Download PDFInfo
- Publication number
- JP2011060080A JP2011060080A JP2009210234A JP2009210234A JP2011060080A JP 2011060080 A JP2011060080 A JP 2011060080A JP 2009210234 A JP2009210234 A JP 2009210234A JP 2009210234 A JP2009210234 A JP 2009210234A JP 2011060080 A JP2011060080 A JP 2011060080A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- decode
- command
- memory
- simulation
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、シミュレーション装置に関し、特にマイコンの動作をシミュレーションしデバッグするシミュレーション装置に関する。 The present invention relates to a simulation apparatus, and more particularly to a simulation apparatus that simulates and debugs the operation of a microcomputer.
ここでは、計算機等の動作をシミュレーションするシミュレーション装置をシミュレータと呼ぶ。従来技術のシミュレータの一例として、特開2005−63165号公報(特許文献1)に仮想計算機の高速エミュレータが開示されている。この従来技術では、エミュレータに、命令フェッチとデコードの処理の結果を保存しておくデコードキャッシュを設ける。命令の最初の実行時に、デコードキャッシュにデコードした結果を保存しておく。次回の実行の際には保存したキャッシュの内容を再利用する。デコードキャッシュには、仮想命令ポインタをキーとして実行処理ルーチンのアドレスと対応させて保持する。実行処理ルーチンでは、仮想命令に対応した実行処理を行なう。仮想命令ポインタに基づいて命令のフェッチ時にデコードキャッシュを調べ、デコード結果が存在すればそれを使用し、デコード結果が存在しなければ仮想命令ポインタに基づいて命令をデコードし、結果をデコードキャッシュに登録する。 Here, a simulation device that simulates the operation of a computer or the like is called a simulator. As an example of a prior art simulator, Japanese Unexamined Patent Application Publication No. 2005-63165 (Patent Document 1) discloses a high-speed emulator for a virtual machine. In this prior art, the emulator is provided with a decode cache for storing the results of instruction fetch and decode processing. At the first execution of the instruction, the decoded result is stored in the decode cache. The saved cache contents are reused at the next execution. In the decode cache, a virtual instruction pointer is used as a key and held in correspondence with the address of the execution processing routine. In the execution processing routine, execution processing corresponding to the virtual instruction is performed. Checks the decode cache when fetching an instruction based on the virtual instruction pointer, uses the decode result if it exists, decodes the instruction based on the virtual instruction pointer if the decode result does not exist, and registers the result in the decode cache To do.
従来技術のシミュレータでは、命令がデバッガのメモリウィンドウ等で直接編集された場合、デコード・キャッシュの内容と異なってしまい、正しい命令の実行が行えない。 In the simulator of the prior art, when the instruction is directly edited in the memory window of the debugger, the contents are different from the contents of the decode cache, and the correct instruction cannot be executed.
従来技術のシミュレータでは、シミュレータに命令フェッチとデコードの処理の結果を保存しておくデコード・キャッシュを設ける。命令の最初の実行時に、デコード・キャッシュにデコードした結果を保存しておく。次回の実行の際には保存したキャッシュの内容を再利用し、実行を高速化することができた。 In the prior art simulator, the simulator is provided with a decode cache for storing the results of instruction fetch and decode processing. At the first execution of the instruction, the decoded result is stored in the decode cache. At the next execution, the saved cache contents could be reused to speed up the execution.
従来技術の問題点は、命令がデバッガのメモリウィンドウ等で直接編集され、デコード・キャッシュの内容と異なってしまった場合の考慮がない点である。 The problem with the prior art is that there is no consideration when the instruction is directly edited in the memory window of the debugger or the like and differs from the contents of the decode cache.
従来技術の課題であったメモリ上で書き換えが発生した場合の考慮に関して、デコード・キャッシュに変更フラグを追加することで対処する。メモリ上で書き換えが発生した場合には、変更フラグをセットし、実行時に、対象命令のデコード・キャッシュに変更フラグがあれば、再フェッチ・デコードを行うという工夫を行うことで解決を図る。 Regarding the consideration when rewriting occurs on the memory, which is a problem of the prior art, it is dealt with by adding a change flag to the decode cache. When rewriting occurs in the memory, the change flag is set, and if there is a change flag in the decoding cache of the target instruction at the time of execution, the solution is achieved by performing refetching / decoding.
本発明のシミュレータ(シミュレーション装置)は、命令変更通知部と、実行シミュレーション部を具備する。命令変更通知部は、メモリが書き換えられた際、書き換えられた内容が命令であれば、該当する命令のデコード・キャッシュに変更フラグを立てる。実行シミュレーション部は、該当命令実行時に、デコード・キャッシュに変更フラグがあるかを検出し、変更フラグがあれば、再フェッチ・デコードを行う。 The simulator (simulation apparatus) of the present invention includes an instruction change notification unit and an execution simulation unit. When the memory is rewritten and the rewritten content is an instruction, the instruction change notification unit sets a change flag in the decode cache of the corresponding instruction. The execution simulation unit detects whether there is a change flag in the decode cache at the time of execution of the corresponding instruction, and if there is a change flag, performs refetch / decode.
メモリ上の変更情報をデコード・キャッシュに通知する手段を確立し、メモリ上に変更があった際、デコード・キャッシュに変更フラグを立て、実行時に変更フラグがあった場合、メモリから再度フェッチ・デコードを行ってから、随時正しい命令実行することができる。 Establishing a means to notify the decoding cache of the change information in the memory. When there is a change in the memory, a change flag is set in the decode cache. If there is a change flag at the time of execution, fetch / decode from the memory again. After executing the above, the correct instruction can be executed at any time.
以下に、本発明の第1実施形態について添付図面を参照して説明する。
本発明のシミュレータは、マイコンの動作をシミュレーションするシミュレーション装置であり、PC(パソコン)と、当該PC上で動くアプリケーションプログラムとの組み合わせにより実現される。本発明のシミュレータを使うことにより、PC上でマイコンの動作をシミュレーションすることが可能となる。なお、PCは一例に過ぎない。他にも、本発明のシミュレータを実現するハードウェアの例として、I/O(Input/Output)ボード、シンクライアントサーバ、ワークステーション、メインフレーム、スーパーコンピュータ、携帯端末、家庭用ゲーム機、情報家電(information home appliance)、POS(Point of Sale)端末、OA(Office Automation)機器等が考えられる。また、本発明のシミュレータは、端末やサーバに限らず、中継機器や周辺機器でも良い。但し、実際には、これらの例に限定されない。
Hereinafter, a first embodiment of the present invention will be described with reference to the accompanying drawings.
The simulator of the present invention is a simulation device that simulates the operation of a microcomputer, and is realized by a combination of a PC (personal computer) and an application program that runs on the PC. By using the simulator of the present invention, it is possible to simulate the operation of the microcomputer on the PC. A PC is only an example. Other examples of hardware for realizing the simulator of the present invention include an I / O (Input / Output) board, a thin client server, a workstation, a mainframe, a supercomputer, a portable terminal, a home game machine, and an information appliance. (Information home application), POS (Point of Sale) terminals, OA (Office Automation) devices, and the like are conceivable. The simulator of the present invention is not limited to a terminal or a server, and may be a relay device or a peripheral device. However, actually, it is not limited to these examples.
図1の本発明のシミュレータの構成図を参考して、説明する。
本発明のシミュレータ(シミュレーション装置)10は、デバッガ部11と、シミュレーション部12を備える。
This will be described with reference to the block diagram of the simulator of the present invention in FIG.
A simulator (simulation apparatus) 10 according to the present invention includes a
デバッガ部11は、コマンド入力部111と、実行コマンド処理部112と、メモリ書き込み処理部113を含む。
The
シミュレーション部12は、メモリシミュレーション部121と、デコード・キャッシュ122と、実行シミュレーション部123を含む。
The
メモリシミュレーション部121は、マイコンのメモリをシミュレーションする部分である。デコード・キャッシュ122は、命令の先頭アドレスと、デコード情報に加え、命令の書き換えの有無を示す変更フラグを持つ。実行シミュレーション部123は、マイコンの命令実行処理をシミュレーションする部分である。
The
メモリシミュレーション部121は、命令変更通知部1211を含む。
The
実行シミュレーション部123は、実行管理部1231と、フェッチ・デコード部1232と、実行部1233を含む。
The
実行対象プログラム110は、本発明のシミュレータ10がシミュレーションするマイコン上で動作する、コンパイラ等で言語処理されたオブジェクトファイルである。この実行対象プログラム110は、デバッガ部11にダウンロードされた際、コマンド入力部111から、メモリ書き込み処理部113を介してメモリシミュレーション部121にダウンロードされる。
The
コマンド入力部111は、実行コマンドが入力されると、入力された実行コマンドを、実行コマンド処理部112を介して、実行シミュレーション部123の実行管理部1231へ通知する。
When an execution command is input, the
実行管理部1231は、デコード・キャッシュ122上で、次に実行する命令と一致するアドレスを検索することで、その命令のデコード情報がキャッシュされていないか検索を行う。フェッチ・デコード部1232は、該当命令のデコード情報がない場合、デコードを行い、デコード・キャッシュ122にアドレスとデコード情報を登録する。その後、実行部1233は、デコード・キャッシュ122に登録されたデコード情報を使って、命令実行する。また、実行部1233は、該当命令のデコード情報がある場合、そのデコード情報を使って、命令実行する。
The
但し、実行管理部1231がデコード・キャッシュ122上の該当命令に変更フラグが立っていることを発見した場合には、フェッチ・デコード部1232は、再フェッチ・デコードを行い、デコード情報を更新し、変更フラグをリセットする。実行部1233は、更新されたデコード情報を使って、命令実行する。
However, if the
コマンド入力部111から命令に対する書き換え要求があった場合には、メモリ書き込み処理部113は、当該書き換え要求をメモリシミュレーション部121へ通知する。メモリシミュレーション部121によるメモリ書換え後に、命令変更通知部1211は、デコード・キャッシュ122の該当場所に変更フラグをセットする。
When there is a rewrite request for an instruction from the
例えば、デバッガ部11及びシミュレーション部12は、プログラムで駆動されるCPU等のハードウェアと、そのハードウェアを駆動して所望の処理を実行するソフトウェアと、そのソフトウェアを格納する記憶装置によって実現される。なお、コマンド入力部111は、外部の入力装置や記憶装置から情報を取得するためのインターフェース(I/F:interface)を有していても良い。
For example, the
デバッガ部11及びシミュレーション部12を実現するハードウェアの例として、CPU(Central Processing Unit)、マイクロプロセッサ(microprocessor)、マイクロコントローラ、或いは、同様の機能を有する半導体集積回路(Integrated Circuit(IC))等が考えられる。但し、実際には、これらの例に限定されない。
Examples of hardware for realizing the
デバッガ部11及びシミュレーション部12で使用されるプログラムやデータを格納する記憶装置の例として、RAM(Random Access Memory)やEEPROM(Electrically Erasable and Programmable Read Only Memory)やフラッシュメモリ等の半導体記憶装置、HDD(Hard Disk Drive)やSSD(Solid State Drive)等の補助記憶装置、又は、DVD(Digital Versatile Disk)やメモリカード等の記憶媒体(メディア)等が考えられる。なお、コンピュータ本体に内蔵された記憶装置に限らず、周辺機器(外付けHDD等)や外部のサーバ(ストレージサーバ等)に設置された記憶装置、或いは、NAS(Network Attached Storage)でも良い。但し、実際には、これらの例に限定されない。
Examples of storage devices that store programs and data used in the
図2A、図2Bに、本発明のシミュレータの動作のフローチャートを示す。 2A and 2B show a flowchart of the operation of the simulator of the present invention.
(1)ステップS201
ユーザ操作あるいは起動設定により、シミュレータ10を起動する。これにより、シミュレータ10は、稼動状態となる。
(1) Step S201
The
(2)ステップS202
シミュレータ10は、シミュレーション/デバッグ対象のプログラム(実行対象プログラム110)をダウンロードする。
(2) Step S202
The
(3)ステップS203
その後、シミュレータ10は、コマンド待ち状態となる。
(3) Step S203
Thereafter, the
(4)ステップS204
シミュレータ10に対してコマンド実行が行われる。コマンド入力部111は、シミュレータ10がコマンド待ち状態の時に、実行コマンドの入力を受け付ける。
(4) Step S204
Command execution is performed on the
(5)ステップS205
コマンド入力部111は、実行コマンドが入力されると、入力された実行コマンドが一命令実行コマンドかどうか判定する。コマンド入力部111は、入力された実行コマンドが一命令実行コマンドであれば、入力された実行コマンドを、実行コマンド処理部112を介して、実行シミュレーション部123の実行管理部1231へ通知する。
(5) Step S205
When an execution command is input, the
(6)ステップS206
実行管理部1231は、通知された実行コマンドに示された命令(対象命令)と一致するアドレスがないか、デコード・キャッシュ122を検索する。
(6) Step S206
The
(7)ステップS207
実行管理部1231は、デコード・キャッシュ122に対象命令のデコード情報がキャッシュされていているかどうか確認することで、対象命令が存在するかどうか確認する。
(7) Step S207
The
(8)ステップS208
実行管理部1231は、対象命令のデコード情報がキャッシュされている場合、デコード・キャッシュ122上の対象命令に変更フラグがセットされているか確認する。
(8) Step S208
When the decode information of the target instruction is cached, the
(9)ステップS209
フェッチ・デコード部1232は、対象命令のデコード情報がキャッシュされていない場合、あるいは変更フラグがセットされていない場合、対象命令が存在しないと判断し、フェッチ・デコードを行う。
(9) Step S209
When the decoding information of the target instruction is not cached or when the change flag is not set, the fetch /
(10)ステップS210
フェッチ・デコード部1232は、フェッチ・デコードを行った結果、得られたデコード情報をデコード・キャッシュ122に登録する。
(10) Step S210
The fetch /
(11)ステップS211
フェッチ・デコード部1232は、デコード・キャッシュ122上の対象命令に変更フラグがセットされていた場合は、変更フラグをリセットする。
(11) Step S211
The fetch /
(12)ステップS212
実行部1233は、デコード・キャッシュ122上の対象命令に変更フラグがセットされていない状態であれば、そのまま対象命令を実行する。対象命令の実行後、シミュレータ10は、コマンド待ち状態となる。
(12) Step S212
If the change flag is not set in the target instruction on the
(13)ステップS213
また、実行部1233は、デコード・キャッシュ122上に対象命令のデコード情報がキャッシュされていて、変更フラグがセットされていなければ、このデコード情報を基に、対象命令を実行する。対象命令の実行後、シミュレータ10は、コマンド待ち状態となる。
(13) Step S213
The
(14)ステップS214
また、コマンド入力部111は、入力された実行コマンドが一命令実行コマンドでなければ、入力された実行コマンドがメモリ書換えコマンドかどうか判定する。
(14) Step S214
Further, if the input execution command is not a one-instruction execution command, the
(15)ステップS215
コマンド入力部111は、入力された実行コマンドがメモリ書換えコマンドでない場合、その他のコマンドであったと判断し、その他のコマンドを処理すべき処理部に通知し、その他のコマンドに対する処理を行う。その他のコマンドに対する処理の実行後、シミュレータ10は、コマンド待ち状態となる。
(15) Step S215
If the input execution command is not a memory rewrite command, the
(16)ステップS216
コマンド入力部111は、入力された実行コマンドがメモリ書換えコマンドである場合、メモリ書き込み処理部113を介して、メモリ書換えコマンドをメモリシミュレーション部121へ通知する。メモリシミュレーション部121は、メモリ書換えコマンドに応じて、メモリの内容を書き換える。
(16) Step S216
If the input execution command is a memory rewrite command, the
(17)ステップS217
メモリシミュレーション部121は、そのメモリ書換えコマンドが対象命令に対する書き換え要求であったかどうか確認する。そのメモリ書換えコマンドが対象命令に対する書き換え要求でなかった場合、シミュレータ10は、コマンド待ち状態となる。
(17) Step S217
The
(18)ステップS218
命令変更通知部1211は、そのメモリ書換えコマンドが対象命令に対する書き換え要求であった場合、デコード・キャッシュ122の該当場所に変更フラグをセットする。
(18) Step S218
If the memory rewrite command is a rewrite request for the target instruction, the instruction
以下に、実際の動作の全体概要(実施例)について説明する。
本発明のシミュレータ10を起動し(ステップS201)、シミュレーション/デバッグ対象のプログラムをダウンロードする(ステップS202)。
The overall outline (example) of the actual operation will be described below.
The
その後、シミュレータ10は、コマンド待ち(ステップS203)状態となるが、コマンド実行され(ステップS204)、そのコマンドが一命令実行コマンドであれば(ステップS205)、デコード・キャッシュ122を検索し(ステップS206)、対象命令が存在しない場合には、フェッチ・デコードを行い(ステップS209)、デコード・キャッシュ122に登録する(ステップS210)。変更フラグもセットされていない場合は(ステップS211)、そのまま実行を行う(ステップS212)。
Thereafter, the
次に、シミュレータ10は、この命令を実行する際に、デコード・キャッシュ122を検索して(ステップS206)、対象命令のデコード情報がキャッシュされていて(ステップS207)、変更フラグがセットされていなければ(ステップS208)、このデコード情報を基に実行できる(ステップS213)。
Next, when executing this instruction, the
メモリ書換えコマンド(ステップS214)を使って、命令の書換え要求が来た場合には、本発明のシミュレータ10はメモリの内容を書き換えた後(ステップS216)、その書き換えた領域が命令であることを確認して(ステップS217)、デコード・キャッシュ122の該当命令に変更フラグをセットする(ステップS218)。
When an instruction rewrite request is received using the memory rewrite command (step S214), the
その後、変更された命令を実行する際には、デコード・キャッシュ122を検索し(ステップS206)、その対象命令情報があっても(ステップS207)、変更フラグがあることから(ステップS208)、再フェッチ・デコードが必要と判断し、デコード・キャッシュ122に再登録し(ステップS210)、変更フラグをクリアし(ステップS211)、実行を行う(ステップS212)。
Thereafter, when executing the changed instruction, the
こうして、命令の書換えが発生した場合に、正しく命令実行が行える。 Thus, the instruction can be correctly executed when the instruction is rewritten.
このように、本発明のシミュレータでは、メモリシミュレーション部に、メモリを書換えた時に、その書き換えたメモリが命令であれば、デコード・キャッシュに変更フラグを立てる命令変更通知部を用意し、命令の書換えを実行時に検知する実行管理部を用意することで、命令が書き換われた場合も、正しく実行できるようにした。 As described above, in the simulator of the present invention, when the memory is rewritten in the memory simulation unit, if the rewritten memory is an instruction, an instruction change notification unit for setting a change flag in the decode cache is prepared. By preparing an execution management unit that detects when the command is executed, it can be executed correctly even if the command is rewritten.
以上、本発明の実施形態を詳述してきたが、実際には、上記の実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の変更があっても本発明に含まれる。 As mentioned above, although embodiment of this invention was explained in full detail, actually, it is not restricted to said embodiment, Even if there is a change of the range which does not deviate from the summary of this invention, it is included in this invention.
10… シミュレータ(シミュレーション装置)
11… デバッガ部
110… 実行対象プログラム
111… コマンド入力部
112… 実行コマンド処理部
113… メモリ書き込み処理部
12… シミュレーション部
121… メモリシミュレーション部
1211… 命令変更通知部
122… デコード・キャッシュ
123… 実行シミュレーション部
1231… 実行管理部
1232… フェッチ・デコード部
1233… 実行部
10 ... Simulator (simulation device)
DESCRIPTION OF
Claims (15)
命令の実行時に、前記命令のデコード・キャッシュに変更フラグがあるか確認し、前記デコード・キャッシュに変更フラグがあれば、再フェッチ・デコードを行う実行シミュレーション部と
を具備する
シミュレーション装置。 When the memory is rewritten, if the rewritten content is an instruction, an instruction change notification unit that sets a change flag in the decode cache of the instruction, and
A simulation apparatus comprising: an execution simulation unit that checks whether or not there is a change flag in the decode cache of the instruction at the time of execution of the instruction, and performs refetch / decode if the change flag is in the decode cache.
前記実行シミュレーション部は、
前記命令の実行時に、前記デコード・キャッシュ上で、前記命令と一致するアドレスを検索し、前記命令のデコード情報がキャッシュされていないか検索を行う実行管理部と、
前記命令のデコード情報がキャッシュされていない場合、フェッチ・デコードを行い、前記デコード・キャッシュにアドレスとデコード情報を登録するフェッチ・デコード部と、
前記命令のデコード情報がキャッシュされていない場合、前記フェッチ・デコード部により前記デコード・キャッシュに登録されたデコード情報を使って前記命令を実行し、前記命令のデコード情報がキャッシュされている場合、前記キャッシュされているデコード情報を使って前記命令を実行する実行部と
を更に具備する
シミュレーション装置。 The simulation apparatus according to claim 1,
The execution simulation unit
An execution management unit that searches the decode cache for an address that matches the instruction at the time of execution of the instruction, and searches whether the decode information of the instruction is cached;
If the instruction decode information is not cached, fetch / decode, and a fetch / decode unit that registers an address and decode information in the decode cache;
When the decode information of the instruction is not cached, the instruction is executed using the decode information registered in the decode cache by the fetch / decode unit, and when the decode information of the instruction is cached, A simulation apparatus further comprising: an execution unit that executes the instruction using cached decode information.
前記フェッチ・デコード部は、前記実行シミュレーション部が前記デコード・キャッシュ上の前記命令に変更フラグが立っていることを発見した場合には、再フェッチ・デコードを行い、既存のデコード情報を更新し、変更フラグをリセットする
シミュレーション装置。 The simulation apparatus according to claim 2,
When the execution simulation unit finds that a change flag is set in the instruction on the decode cache, the fetch / decode unit performs re-fetch / decode, updates existing decode information, Simulation device that resets the change flag.
メモリをシミュレーションするメモリシミュレーション部と、
実行コマンドが入力されると、前記入力された実行コマンドが一命令実行コマンドかどうか判定し、前記入力された実行コマンドが一命令実行コマンドでなければ、前記入力された実行コマンドがメモリ書換えコマンドかどうか判定するコマンド入力部と、
前記入力された実行コマンドが一命令実行コマンドであれば、前記一命令実行コマンドを前記実行シミュレーション部へ通知する実行コマンド処理部と、
前記入力された実行コマンドがメモリ書換えコマンドであれば、前記メモリ書換えコマンドを前記メモリシミュレーション部へ通知するメモリ書き込み処理部と
を更に具備する
シミュレーション装置。 The simulation apparatus according to any one of claims 1 to 3,
A memory simulation unit for simulating a memory;
When an execution command is input, it is determined whether the input execution command is a single instruction execution command. If the input execution command is not a single instruction execution command, the input execution command is a memory rewrite command. A command input section for determining whether or not
If the input execution command is a one-instruction execution command, an execution command processing unit that notifies the execution simulation unit of the one-instruction execution command;
A simulation apparatus, further comprising: a memory write processor that notifies the memory rewrite command of the memory rewrite command if the input execution command is a memory rewrite command.
前記メモリシミュレーション部は、前記メモリ書換えコマンドに応じて、メモリの内容を書き換え、前記メモリ書換えコマンドが前記命令に対する書き換え要求であったかどうか確認し、
前記命令変更通知部は、前記メモリ書換えコマンドが前記命令に対する書き換え要求であった場合、前記メモリシミュレーション部によるメモリ書換え後に、前記デコード・キャッシュの該当場所に変更フラグをセットする
シミュレーション装置。 The simulation apparatus according to claim 4,
The memory simulation unit rewrites the contents of the memory in response to the memory rewrite command, and checks whether the memory rewrite command is a rewrite request for the instruction,
The instruction change notification unit, when the memory rewrite command is a rewrite request for the instruction, sets a change flag at a corresponding location in the decode cache after the memory rewrite by the memory simulation unit.
メモリが書き換えられた際、書き換えられた内容が命令であれば、当該命令のデコード・キャッシュに変更フラグを立て、
命令の実行時に、前記命令のデコード・キャッシュに変更フラグがあるか確認し、前記デコード・キャッシュに変更フラグがあれば、再フェッチ・デコードを行う
シミュレーション方法。 A computer-implemented simulation method comprising:
If the rewritten content is an instruction when the memory is rewritten, a change flag is set in the decode cache of the instruction,
A simulation method in which, when an instruction is executed, whether or not there is a change flag in the decode cache of the instruction, and if there is a change flag in the decode cache, refetch / decode is performed.
前記命令の実行時に、前記デコード・キャッシュ上で、前記命令と一致するアドレスを検索し、前記命令のデコード情報がキャッシュされていないか検索を行い、
前記命令のデコード情報がキャッシュされていない場合、フェッチ・デコードを行い、前記デコード・キャッシュにアドレスとデコード情報を登録し、前記デコード・キャッシュに登録されたデコード情報を使って前記命令を実行し、
前記命令のデコード情報がキャッシュされている場合、前記キャッシュされているデコード情報を使って前記命令を実行する
シミュレーション方法。 The simulation method according to claim 6, comprising:
When the instruction is executed, the address that matches the instruction is searched on the decode cache, and whether the decode information of the instruction is cached is searched.
If the decode information of the instruction is not cached, fetch and decode, register an address and decode information in the decode cache, execute the instruction using the decode information registered in the decode cache,
When the decode information of the instruction is cached, the instruction is executed using the cached decode information.
前記デコード・キャッシュ上の前記命令に変更フラグが立っていることを発見した場合には、再フェッチ・デコードを行い、既存のデコード情報を更新し、変更フラグをリセットする
シミュレーション方法。 The simulation method according to claim 7, comprising:
A simulation method in which when it is found that a change flag is set in the instruction on the decode cache, refetch / decode is performed, existing decode information is updated, and the change flag is reset.
実行コマンドが入力されると、前記入力された実行コマンドが一命令実行コマンドかどうか判定し、
前記入力された実行コマンドが一命令実行コマンドであれば、前記一命令実行コマンドに基づいて命令実行処理をシミュレーションし、
前記入力された実行コマンドが一命令実行コマンドでなければ、前記入力された実行コマンドがメモリ書換えコマンドかどうか判定し、
前記入力された実行コマンドがメモリ書換えコマンドであれば、前記メモリ書換えコマンドに基づいてメモリの内容を書き換える
シミュレーション方法。 A simulation method according to any one of claims 6 to 8,
When an execution command is input, it is determined whether the input execution command is a one-instruction execution command,
If the input execution command is a single instruction execution command, the instruction execution process is simulated based on the single instruction execution command,
If the input execution command is not a one-instruction execution command, determine whether the input execution command is a memory rewrite command;
A simulation method for rewriting memory contents based on the memory rewrite command if the input execution command is a memory rewrite command.
前記メモリ書換えコマンドに基づいてメモリの内容を書き換えた際、前記メモリ書換えコマンドが前記命令に対する書き換え要求であったかどうか確認し、
前記メモリ書換えコマンドが前記命令に対する書き換え要求であった場合、メモリ書換え後に、前記デコード・キャッシュの該当場所に変更フラグをセットする
シミュレーション方法。 The simulation method according to claim 9, wherein
When rewriting the contents of the memory based on the memory rewrite command, check whether the memory rewrite command is a rewrite request for the instruction,
When the memory rewrite command is a rewrite request for the instruction, a change flag is set at a corresponding location in the decode cache after the memory is rewritten.
メモリが書き換えられた際、書き換えられた内容が命令であれば、当該命令のデコード・キャッシュに変更フラグを立てるステップと、
命令の実行時に、前記命令のデコード・キャッシュに変更フラグがあるか確認し、前記デコード・キャッシュに変更フラグがあれば、再フェッチ・デコードを行うステップと
をコンピュータに実行させるための
シミュレーション用プログラム。 A simulation program executed by a computer,
If the rewritten content is an instruction when the memory is rewritten, a step of setting a change flag in the decode cache of the instruction;
A simulation program for causing a computer to check whether or not there is a change flag in the decode cache of the instruction at the time of executing the instruction, and to perform refetch / decode if there is a change flag in the decode cache.
前記命令の実行時に、前記デコード・キャッシュ上で、前記命令と一致するアドレスを検索し、前記命令のデコード情報がキャッシュされていないか検索を行うステップと、
前記命令のデコード情報がキャッシュされていない場合、フェッチ・デコードを行い、前記デコード・キャッシュにアドレスとデコード情報を登録し、前記デコード・キャッシュに登録されたデコード情報を使って前記命令を実行するステップと、
前記命令のデコード情報がキャッシュされている場合、前記キャッシュされているデコード情報を使って前記命令を実行するステップと
を更にコンピュータに実行させるための
シミュレーション用プログラム。 A simulation program according to claim 11, comprising:
Searching for an address that matches the instruction on the decode cache when the instruction is executed, and searching whether the decode information of the instruction is cached;
If the decode information of the instruction is not cached, performing fetch / decode, registering an address and decode information in the decode cache, and executing the instruction using the decode information registered in the decode cache When,
A simulation program for causing a computer to further execute a step of executing the instruction using the cached decoding information when the decoding information of the instruction is cached.
前記デコード・キャッシュ上の前記命令に変更フラグが立っていることを発見した場合には、再フェッチ・デコードを行い、既存のデコード情報を更新し、変更フラグをリセットするステップ
を更にコンピュータに実行させるための
シミュレーション用プログラム。 A simulation program according to claim 12, comprising:
When it is found that a change flag is set in the instruction on the decode cache, the computer is further executed to perform refetch / decode, update the existing decode information, and reset the change flag. Simulation program for.
実行コマンドが入力されると、前記入力された実行コマンドが一命令実行コマンドかどうか判定するステップと、
前記入力された実行コマンドが一命令実行コマンドであれば、前記一命令実行コマンドに基づいて命令実行処理をシミュレーションするステップと、
前記入力された実行コマンドが一命令実行コマンドでなければ、前記入力された実行コマンドがメモリ書換えコマンドかどうか判定するステップと、
前記入力された実行コマンドがメモリ書換えコマンドであれば、前記メモリ書換えコマンドに基づいてメモリの内容を書き換えるステップと
を更にコンピュータに実行させるための
シミュレーション用プログラム。 A simulation program according to any one of claims 11 to 13,
When an execution command is input, determining whether the input execution command is a one-instruction execution command;
If the input execution command is a single instruction execution command, simulating instruction execution processing based on the single instruction execution command;
If the input execution command is not a one-instruction execution command, determining whether the input execution command is a memory rewrite command; and
A simulation program for causing a computer to further execute a step of rewriting the contents of a memory based on the memory rewrite command if the input execution command is a memory rewrite command.
前記メモリ書換えコマンドに基づいてメモリの内容を書き換えた際、前記メモリ書換えコマンドが前記命令に対する書き換え要求であったかどうか確認するステップと、
前記メモリ書換えコマンドが前記命令に対する書き換え要求であった場合、メモリ書換え後に、前記デコード・キャッシュの該当場所に変更フラグをセットするステップと
を更にコンピュータに実行させるための
シミュレーション用プログラム。 A simulation program according to claim 14,
When rewriting the contents of the memory based on the memory rewrite command, checking whether the memory rewrite command is a rewrite request for the instruction;
A simulation program for causing a computer to further execute a step of setting a change flag at a corresponding location in the decode cache after a memory rewrite when the memory rewrite command is a rewrite request for the instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009210234A JP5322867B2 (en) | 2009-09-11 | 2009-09-11 | Simulation device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009210234A JP5322867B2 (en) | 2009-09-11 | 2009-09-11 | Simulation device |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2011060080A true JP2011060080A (en) | 2011-03-24 |
JP2011060080A5 JP2011060080A5 (en) | 2012-03-29 |
JP5322867B2 JP5322867B2 (en) | 2013-10-23 |
Family
ID=43947621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009210234A Expired - Fee Related JP5322867B2 (en) | 2009-09-11 | 2009-09-11 | Simulation device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5322867B2 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000231495A (en) * | 1999-02-10 | 2000-08-22 | Nec Corp | Virtual machine |
JP2002024086A (en) * | 2000-07-12 | 2002-01-25 | Mitsubishi Electric Corp | Microcomputer, computer system and instruction code update method |
JP2007094986A (en) * | 2005-09-30 | 2007-04-12 | Fujitsu Ltd | Simulation apparatus and simulation method |
-
2009
- 2009-09-11 JP JP2009210234A patent/JP5322867B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000231495A (en) * | 1999-02-10 | 2000-08-22 | Nec Corp | Virtual machine |
JP2002024086A (en) * | 2000-07-12 | 2002-01-25 | Mitsubishi Electric Corp | Microcomputer, computer system and instruction code update method |
JP2007094986A (en) * | 2005-09-30 | 2007-04-12 | Fujitsu Ltd | Simulation apparatus and simulation method |
Non-Patent Citations (6)
Title |
---|
CSND200300525008; 中森 章: 'コンピュータアーキテクチャ その直感的アプローチ(3)' Oh!X 2001春号, 20010301, p.240-255, ソフトバンクパブリッシング株式会社 * |
CSND200300525010; 中森 章: 'コンピュータアーキテクチャ その直感的アプローチ(5)' Oh!X 2001春号, 20010301, p.276-285, ソフトバンクパブリッシング株式会社 * |
CSNG200600108002; 大津 金光: '新世代マイクロプロセッサアーキテクチャ(後編)' 情報処理 IPSJ MAGAZINE 第46巻 第11号, 20051115, p.1224-1229, 社団法人情報処理学会 * |
JPN6013033733; 中森 章: 'コンピュータアーキテクチャ その直感的アプローチ(3)' Oh!X 2001春号, 20010301, p.240-255, ソフトバンクパブリッシング株式会社 * |
JPN6013033735; 中森 章: 'コンピュータアーキテクチャ その直感的アプローチ(5)' Oh!X 2001春号, 20010301, p.276-285, ソフトバンクパブリッシング株式会社 * |
JPN6013033738; 大津 金光: '新世代マイクロプロセッサアーキテクチャ(後編)' 情報処理 IPSJ MAGAZINE 第46巻 第11号, 20051115, p.1224-1229, 社団法人情報処理学会 * |
Also Published As
Publication number | Publication date |
---|---|
JP5322867B2 (en) | 2013-10-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9256428B2 (en) | Load latency speculation in an out-of-order computer processor | |
TWI522915B (en) | Method and apparatus for guest return address stack emulation supporting speculation | |
JP6507435B2 (en) | Instruction emulation processor, method, and system | |
JP5608594B2 (en) | Preload instruction control | |
US9753730B2 (en) | Decoding instructions from multiple instructions sets | |
US9858057B2 (en) | Methods and apparatus to validate translated guest code in a dynamic binary translator | |
US10318419B2 (en) | Flush avoidance in a load store unit | |
JP2007525737A5 (en) | ||
US10824494B2 (en) | Operation of a multi-slice processor implementing exception handling in a nested translation environment | |
JP5318197B2 (en) | Device emulation support in the host data processor | |
US9652245B2 (en) | Branch prediction for indirect jumps by hashing current and previous branch instruction addresses | |
JP6234639B2 (en) | Simulation apparatus, simulation method, and simulation program | |
JP5536593B2 (en) | Optimization device, optimization method, and compiler program | |
JP5322867B2 (en) | Simulation device | |
CN108446186B (en) | Method for recovering Dex source file from shelled Android application program | |
CN113835927B (en) | Instruction execution method, computing device and storage medium | |
CN114036066A (en) | Unit testing method and device, computing equipment and readable storage medium | |
CN117270967A (en) | Automatic generation method and device of instruction set architecture simulator based on model driving | |
CN117130721A (en) | WebAssemblely code execution method and device | |
Ai et al. | The research of code relocation about U-boot transplant based on embedded systems | |
CN114911483A (en) | Method for realizing QXL (QXL) display of virtual machine in UEFI (unified extensible firmware interface) operation stage | |
Lynch | How to port Linux when the hardware turns soft |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120213 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120213 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130626 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130709 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130716 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |