Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3362972B2 - Software simulator - Google Patents
[go: Go Back, main page]

JP3362972B2 - Software simulator - Google Patents

Software simulator

Info

Publication number
JP3362972B2
JP3362972B2 JP20558894A JP20558894A JP3362972B2 JP 3362972 B2 JP3362972 B2 JP 3362972B2 JP 20558894 A JP20558894 A JP 20558894A JP 20558894 A JP20558894 A JP 20558894A JP 3362972 B2 JP3362972 B2 JP 3362972B2
Authority
JP
Japan
Prior art keywords
instruction
loop
executed
execution
address
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.)
Expired - Fee Related
Application number
JP20558894A
Other languages
Japanese (ja)
Other versions
JPH0869392A (en
Inventor
素秀 西畑
喜之 岩村
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP20558894A priority Critical patent/JP3362972B2/en
Publication of JPH0869392A publication Critical patent/JPH0869392A/en
Application granted granted Critical
Publication of JP3362972B2 publication Critical patent/JP3362972B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ターゲットのマイクロ
コンピュータ上で動作すべきアプリケーションソフトの
シミュレーションをすることができるソフトウェアシミ
ュレータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a software simulator capable of simulating application software to be operated on a target microcomputer.

【0002】[0002]

【従来の技術】従来、家電製品などに組み込むべきター
ゲットとするマイクロコンピュータが完成していない状
態で、そのマイクロコンピュータ上で動作するアプリケ
ーションソフトの開発や動作検証を行う場合は、ICE
またはソフトウェアシミュレータを用いて行われてい
る。ここで、ICEとは、インサーキットエミュレータ
の略であり、マイクロプロセッサに特有のデバックツー
ルである。ここでソフトウェアシミュレータとは一般
に、他計算機にターゲットとするアプリケーションソフ
トのオブジェクトプログラムを与え、そのアプリケーシ
ョンソフトを実行すべきターゲットととする機種の計算
機の演算と同様の状態を他計算機内に作り出し、模擬的
にこれを実行させるためのものである。
2. Description of the Related Art Conventionally, when a target microcomputer to be incorporated into a home electric appliance or the like has not been completed and application software operating on the microcomputer is developed or operation verification is performed, ICE is required.
Or it is performed using a software simulator. Here, ICE is an abbreviation for in-circuit emulator, which is a debugging tool peculiar to a microprocessor. Here, a software simulator generally gives another computer an object program of the target application software, creates a state in the other computer that is similar to the operation of the computer of the target model to execute the application software, and simulates it. The purpose is to make this happen.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、ICE
を用いたアプリケーションソフトの動作検証では、ター
ゲットのマイクロコンピュータの動作と機能的に差があ
るために、動作確認が不十分となる。したがって、最終
的なアプリケーションソフトの動作確認は、ターゲット
のマイクロコンピュータの完成まで待たなければならな
い。
However, the ICE
In the operation verification of the application software using, there is a functional difference from the operation of the target microcomputer, so the operation confirmation becomes insufficient. Therefore, the final confirmation of the operation of the application software must wait until the completion of the target microcomputer.

【0004】そこで、ICEの代わりに、ソフトウェア
シミュレータが有効な手段となる。ソフトウェアシミュ
レータは、マイクロコンピュータの命令列、入出力等の
動作をターゲットのマイクロコンピュータの仕様書どお
りに作成するので、ICEよりも安定して、アプリケー
ションソフトの開発と動作検証を行なうことができる。
Therefore, instead of ICE, a software simulator is an effective means. Since the software simulator creates operations such as the instruction sequence and input / output of the microcomputer according to the specifications of the target microcomputer, it is more stable than ICE and can develop the application software and verify the operation.

【0005】しかしながら、現状のソフトウェアシミュ
レータでは、その命令を忠実にシミュレーションするた
めに、シミュレーション時間は、ターゲットとするマイ
クロコンピュータでの処理時間よりもかなり遅くなると
いう問題点を有していた。例えば、ターゲットのマイク
ロコンピュータまたはICE上では1秒で処理が終了す
るものが、数分から数十分位かかっていた。
However, the current software simulator has a problem that the simulation time is much slower than the processing time in the target microcomputer in order to faithfully simulate the instruction. For example, on the target microcomputer or ICE, the processing that is completed in 1 second takes several minutes to tens of minutes.

【0006】本発明は上記問題点に鑑み、ソフトウェア
シミュレータ上でのアプリケーションソフトの実行時間
の短縮を図ることができるソフトウェアシミュレータを
提供することを目的とする。
In view of the above problems, it is an object of the present invention to provide a software simulator capable of shortening the execution time of application software on the software simulator.

【0007】[0007]

【課題を解決するための手段】上記目的を達成するた
め、発明では、シミュレーションすべきアプリケーシ
ョンソフトを記憶しているアプリケーションソフト記憶
手段と、ターゲットのマイクロコンピュータのメモリ内
容を保持すべき領域を有しているメモリ内容保持手段
と、ターゲットのマイクロコンピュータのレジスタ内容
を保持すべき領域を有しているレジスタ内容保持手段
と、アプリケーションソフト記憶手段に記憶されている
アプリケーションソフトにおける次にシミュレーション
実行すべき一命令をメモリ内容やレジスタ内容に基づい
て決定する実行命令決定手段と、シミュレーション実行
すべき命令をメモリ内容やレジスタ内容に基づいてシミ
ュレーション実行し、変更されたメモリ内容やレジスタ
内容をメモリ内容保持手段やレジスタ内容保持手段に保
持させるシミュレーション実行手段と、前記シミュレー
ション実行手段で実行した命令がループを構成するする
か否かを検出するループ検出手段と、前記ループ検出手
段でループが検出されたとき、そのループが短縮実行で
きるループか否かを判定する短縮実行判定手段と、短縮
実行できるループがループ回数分実行されたと仮定した
ときのメモリ及びレジスタの内容を予測しその結果をメ
モリ内容保持手段及びレジスタ内容保持手段に反映する
メモリ・レジスタ内容変更手段とから構成されることを
特徴とする。
In order to achieve the above object, the present invention has application software storage means for storing application software to be simulated and an area for holding the memory contents of the target microcomputer. Memory content holding means, register content holding means having an area to hold the register contents of the target microcomputer, and application software stored in the application software storage means. Execution instruction deciding means for deciding one instruction based on the memory content or register content, and simulation execution of the instruction to be executed by simulation based on the memory content or register content, and the modified memory content or register content And a simulation executing means to be held in the register content holding means, a loop detecting means for detecting whether the instruction executed by the simulation executing means constitutes a loop, and a loop detected by the loop detecting means, Shortening execution determination means for determining whether or not the loop can be shortened, and predicting the contents of the memory and the register when it is assumed that the shortened loop has been executed for the number of loops, and storing the result as memory content holding means, It is characterized in that it comprises a memory / register content changing means for reflecting in the register content holding means.

【0008】また、本発明では、さらにループになる可
能性のある命令を保持しているループ命令テーブルと、
ループを短縮して実行することができない命令を保持し
ているループ短縮不能命令テーブルとを備え、前記ルー
プ検出手段は、前記シミュレーション実行手段で実行し
た命令がループ命令テーブルに存在し、かつその命令の
次に実行される命令のアドレスがその命令のアドレスよ
り小さく、更に次に実行される命令のアドレスは既に実
行されたアドレスであることによりループとなるべき命
令列を検出し、前記短縮実行判定手段は、前記ループ検
出手段で検出されたループとなるべき命令列中に、ルー
プ短縮不能命令テーブルに格納されている命令であるル
ープ短縮実行不能命令が存在するか否かを判定するルー
プ命令調査部と、存在しない場合は、そのループを短縮
実行できるループと判断する短縮実行判断部とから構成
されたことを特徴とする。
[0008] In the present invention, a loop instruction table which holds an instruction that may cause loops to be al,
A loop non-shortening instruction table holding instructions that cannot be executed by shortening the loop, and the loop detection means has an instruction executed by the simulation execution means in the loop instruction table, and the instruction The address of the instruction to be executed next is smaller than the address of the instruction, and the address of the instruction to be executed next is the address that has already been executed. A loop instruction check means for determining whether or not a loop shortening unexecutable instruction, which is an instruction stored in the loop shortening impossible instruction table, exists in the instruction sequence to be a loop detected by the loop detecting means. And a shortened execution determination unit that determines that the loop can be shortened if it does not exist. To.

【0009】また、本発明では、さらにターゲットのマ
イクロコンピュータのメモリ内容及びレジスタ内容の変
更履歴とメモリのアクセスした履歴であるメモリアクセ
ス履歴とを保持すべき領域である履歴保持部を備え、前
記短縮実行判断部は、前記ループ検出手段で検出された
ループとなるべき命令列を一命令毎に実行する命令列実
行部と、前記命令列実行部が命令を実行する毎に実行し
た命令順に命令列を保存する命令列保存部と、前記命令
列実行部が命令を実行した際、その実行した命令により
メモリ内容保持手段やレジスタ内容保持手段にアクセス
しその内容を変更する場合は、その変更履歴やメモリア
クセス履歴を履歴保持部に保持するループメモリアクセ
ス保持部と、命令列保存部に保存されている命令列を再
度実行し、このとき実行されていない命令を実行した場
合と、メモリ内容保持手段やレジスタ内容保持手段にア
クセスした場合でその内容の変化が予測できない場合
と、更に命令列中に一度も実行されなかった命令であっ
てメモリ内容やレジスタ内容を変更する可能性のある命
令が存在する場合と以外の場合は、ループが短縮実行で
きる場合と判断するループ短縮実行可能判定部とからこ
う構成されたことを特徴とする。
[0009] In the present invention, it includes a history storage unit is a region for holding a memory access history is changed history and history of access to the memory of the memory contents and register of the microprocessor of the target is al, The shortened execution determination unit includes an instruction sequence execution unit that executes an instruction sequence to be a loop detected by the loop detection unit for each instruction, and an instruction sequence that is executed each time the instruction sequence execution unit executes an instruction. When an instruction sequence storage unit that stores an instruction sequence and the instruction sequence execution unit execute an instruction, if the executed instruction accesses the memory content holding unit or the register content holding unit to change the content, the change The loop memory access holding unit that holds the history and memory access history in the history holding unit and the instruction sequence stored in the instruction sequence storage unit are executed again. If an instruction that has not been executed is executed, if the memory content holding means or the register content holding means is accessed, and the change in the content cannot be predicted, or if the instruction has not been executed in the instruction sequence. It is characterized in that it is configured in this way from the loop shortening executability judging unit that judges that the loop can be shortened except when there is an instruction that may change the memory contents and the register contents.

【0010】また、本発明では前記メモリ・レジスタ内
容変更手段は、ループが短縮実行できる場合と判断され
た場合は、ループを抜ける命令を検出し、その命令とメ
モリの変更履歴とレジスタの変更履歴とメモリのアクセ
ス履歴とに基づいてそのループが終了するまでのループ
回数を短縮実行できるループ回数として算出するループ
実行回数算出部と、メモリ内容保持手段とレジスタ内容
保持手段と履歴保持部とに保持されている内容と算出さ
れた短縮実行できるループ回数とに基づいて、ループ回
数分実行されたと仮定したときのメモリ及びレジスタの
内容を予測しその結果をメモリ内容保持手段及びレジス
タ内容保持手段に反映する変更部とを備えたことを特徴
とする。
Further , in the present invention, the memory / register content changing means detects an instruction that exits the loop when it is determined that the loop can be executed in a shortened manner, and a change history of the instruction and the memory and a change history of the register. And a memory access history, the number of times the loop is executed until the end of the loop is calculated as the number of loops that can be executed in a shortened manner, a memory content holding unit, a register content holding unit, and a history holding unit. The contents of the memory and the register when the number of loops is assumed to be executed are predicted based on the calculated contents and the calculated number of times that the loop can be executed, and the result is reflected in the memory contents holding means and the register contents holding means. And a changing unit for performing the change.

【0011】また、本発明では、さらにループとなるべ
き命令列の先頭アドレスと終了アドレスと、ループ回数
を算出するために必要な情報を引き出すためのアドレス
であるループ回数算出情報アドレスとを、前記変更部が
メモリ内容保持手段及びレジスタ内容保持手段に反映し
たとき保存するループ情報保存手段と、前記ループ算出
手段がループとなるべき命令列を検出したとき、当該命
令列の先頭アドレスと終了アドレスとがループ情報保存
手段に保存されていることによりループが再実行されて
いると判断するループ再実行判断手段とを備え、前記ル
ープ実行回数算出部は、更にループが再実行されている
と判断されたときは、ループ回数算出情報アドレスを用
いてループ回数の算出に必要な情報を引き出し短縮実行
できるループ回数を算出し、前記変更部は、更にループ
が再実行されていると判断されたときは、ループ回数算
出情報アドレスを用いて引き出した情報と短縮実行でき
るループ回数とに基づいて、ループ回数分実行されたと
仮定したときのメモリ及びレジスタに内容を予測しその
結果をメモリ内容保持手段及びレジスタ内容保持手段に
反映することを特徴とする。
[0011] In the present invention, the start address and the end address of the instruction sequence to a loop In addition, a loop count calculation information which is the address for extracting the information necessary to calculate the number of loops, Loop information storage means for storing when the changing unit reflects in the memory content holding means and the register content holding means, and the start address and end address of the instruction string when the loop calculation means detects an instruction string to be a loop And a loop re-execution judging means for judging that the loop is re-executed by being stored in the loop information storage means, and the loop execution frequency calculation unit judges that the loop is re-executed. Loop count calculation information address is used to extract the information required to calculate the loop count and the number of loops can be shortened When it is determined that the loop is being re-executed, the changing unit executes the loop count based on the information extracted using the loop count calculation information address and the loop count that can be shortened. It is characterized in that the contents are predicted in the memory and the register when it is assumed that the result is reflected in the memory contents holding means and the register contents holding means.

【0012】また、本発明では、さらに割り込み動作を
シミュレートする割り込み処理手段と、割り込み動作を
シミュレートする時間である割り込み発生時間を管理し
ていて、割り込み発生時間になると前記割り込み処理手
段に割り込み動作をシミュレートさせる割り込み時間管
理手段と、割り込み時間管理手段に管理されている割り
込み発生時間に基づいて割り込みが発生するまでのルー
プ回数である割り込み発生ループ回数を算出する割り込
み発生回数算出手段と、前記ループ実行回数算出部が算
出したループ回数と、割り込み発生ループ回数とを比較
し、少ない方のループ回数を新たに短縮実行できるルー
プ回数と決定する割り込みループ回数決定手段とを備え
たことを特徴とする。
[0012] In the present invention, an interrupt processing means for simulating an interrupt operation in further, the interrupt operation maintains a a is interrupt generation time period to simulate, to the interrupt processing unit to become interrupt generation time An interrupt time management means for simulating an interrupt operation, and an interrupt generation frequency calculation means for calculating an interrupt generation loop frequency that is a loop frequency until an interrupt occurs based on the interrupt generation time managed by the interrupt time management means. An interrupt loop number determining unit that compares the loop number calculated by the loop execution number calculation unit with the interrupt generation loop number, and determines the smaller loop number as a loop number that can be newly shortened and executed. Characterize.

【0013】また、本発明では、さらにI/Oイベント
をシミュレートするI/Oイベント処理手段と、I/O
イベントが発生する時間であるI/Oイベント発生時間
を管理していて、I/Oイベント発生時間になると前記
I/Oイベント処理手段にI/Oイベントをシミュレー
トさせるI/Oイベント時間管理手段と、I/Oイベン
ト時間管理手段に管理されているI/Oイベント発生時
間に基づいてI/Oイベントが発生するまでのループ回
数であるI/Oイベントループ回数を算出するI/Oイ
ベント発生回数算出手段と、前記ループ実行回数算出部
が算出したループ回数と、I/Oイベントループ回数と
を比較し、少ない方のループ回数を新たに短縮実行でき
るループ回数と決定するI/Oループ回数決定手段とを
備えたことを特徴とする。
[0013] In the present invention, the I / O event processing means of simulating I / O events further, I / O
An I / O event occurrence time, which is a time at which an event occurs, is managed, and when the I / O event occurrence time comes, the I / O event processing means causes the I / O event processing means to simulate an I / O event. And an I / O event occurrence count for calculating the I / O event loop count, which is the number of loops until the I / O event occurs, based on the I / O event occurrence time managed by the I / O event time managing means. An I / O loop count that compares the loop count calculated by the loop calculation count calculation unit and the loop execution count calculation unit with the I / O event loop count, and determines the smaller loop count as a loop count that can be newly shortened and executed. And a determining means.

【0014】[0014]

【作用】上記構成によれば、アプリケーションソフト記
憶手段に記憶されているアプリケーションソフトにおけ
る次にシミュレーション実行すべき一命令が、メモリ内
容やレジスタ内容に基づいて実行命令決定手段によって
決定され、シミュレーション実行手段によりシミュレー
ション実行される。シミュレーション実行された命令が
ループを構成するか否かがループ検出手段により検出さ
れ、検出されたループが短縮実行できるループか否かが
短縮実行判定手段により判定される。短縮実行できるル
ープと判定された場合において、ループがループ回数分
実行されたと仮定したときのメモリ及びレジスタ内容
が、メモリ・レジスタ内容変更手段により予測され、そ
の予測結果がメモリ内容保持手段及びレジスタ内容保持
手段にメモリ・レジスタ内容変更手段により反映される
ので、ループを抜け出た後のシミュレーション実行すべ
き一命令が、実行命令決定手段により決定され、結果と
して、ループが短縮実行される。
According to the above configuration, one to be simulated executed next instruction in the application software stored in the application software storage means is determined by the execution instruction determining means based on the memory contents and register contents, simulation The simulation is executed by the execution means. The loop detection means detects whether or not the instructions executed by simulation form a loop, and the shortened execution determination means determines whether or not the detected loop can be shortened. When it is determined that the loop can be executed in a shortened manner, the memory and register contents assuming that the loop has been executed the number of times of the loop are predicted by the memory / register contents changing means, and the prediction result is the memory contents holding means and the register contents. Since it is reflected in the holding means by the memory / register contents changing means, one instruction to be executed in the simulation after exiting the loop is decided by the execution instruction deciding means, and as a result, the loop is shortened and executed.

【0015】また上記構成によれば、ループ命令テーブ
ルを備えているので、ループ命令テーブルを用いてルー
プとなるべき命令列が検出される。ループ短縮不能命令
テーブルを備えているので、ループ短縮不能命令テーブ
ルを用いてループとなるべき命令列におけるループが、
短縮実行できるループであるか否かが短縮実行判定手段
により判定される。
Further , according to the above configuration, since the loop instruction table is provided, the instruction string to be a loop is detected using the loop instruction table. Since the loop non-shortening instruction table is provided, the loop in the instruction sequence that should be a loop using the loop non-shortening instruction table is
Whether or not the loop can be shortened is determined by the shortening execution determination means.

【0016】また上記構成によれば、前記ループ検出手
段で検出されたループとなるべき命令列が一命令毎に命
令列実行部によって実行されたときに、実行された命令
順に命令列が命令列保存部に保存され、メモリ内容の変
更履歴とメモリアクセス履歴とレジスタの変更履歴がル
ープメモリアクセス保存部により保存されるので、それ
らを用いてループが短縮実行できるループか否かがルー
プ短縮実行可能判定部によって判断される。
According to the above configuration, when the instruction sequence to be a loop detected by the loop detection means is executed by the instruction sequence execution unit for each instruction, the instruction sequence is executed in the order of the executed instructions. The change history of the memory contents, the memory access history, and the register change history are saved in the save unit, and are saved by the loop memory access save unit, so it is possible to shorten the loop by using them. It is judged by the judgment unit.

【0017】また上記構成によれば、ループが短縮でき
る場合は、ループを抜ける命令を検出し、その命令とメ
モリの変更履歴とレジスタの変更履歴とメモリのアクセ
ス履歴とに基づいてそのループが終了するまでのループ
回数がループ実行回数算出部によって算出される。算出
されたループ回数と、メモリの変更履歴とレジスタの変
更履歴とに基づいて、ループ回数分実行されたと仮定し
たときのメモリ及びレジスタの内容が、変更部によって
予測され、その結果が反映されることにより、ループが
短縮実行された状態となる。
Further , according to the above configuration, when the loop can be shortened, an instruction that exits the loop is detected, and the loop is terminated based on the instruction, the memory change history, the register change history, and the memory access history. The loop execution count calculation unit calculates the number of loops up to. Based on the calculated number of loops, the history of memory changes, and the history of register changes, the contents of the memory and the registers when the number of loops is assumed to have been executed are predicted by the changing unit, and the results are reflected. As a result, the loop is shortened.

【0018】また上記構成によれば、ループとなるべき
命令列の先頭アドレスと終了アドレスとループ回数算出
情報アドレスとがループ情報保存手段に保存されるの
で、前記ループ検出手段がループとなるべき命令列を検
出したとき、当該命令列の先頭アドレスと終了アドレス
とが情報保存手段に保存されていることにより、そのル
ープが再実行されていることがループ再実行判断手段に
より判断される。ループが再実行されていると判断され
たときは、ループ回数算出情報アドレスを用いてループ
回数が算出され、そのループ回数とループ回数算出情報
アドレスとを用いてループ回数分実行されたと仮定した
ときのメモリ及びレジスタが、変更部によって予測さ
れ、その結果が反映される。
Further , according to the above configuration, since the start address, the end address, and the loop count calculation information address of the instruction sequence to be looped are stored in the loop information storage means, the loop detection means has instructions to be looped. When the sequence is detected, the loop re-execution determination unit determines that the loop is re-executed by storing the start address and end address of the instruction sequence in the information storage unit. When it is determined that the loop is being re-executed, the loop count is calculated using the loop count calculation information address, and it is assumed that the loop count is executed using the loop count and the loop count calculation information address. The memory and the register of the above are predicted by the change unit, and the result is reflected.

【0019】また上記構成によれば、割り込み発生時間
が割り込み時間管理手段に管理されていて、その割り込
み発生時間に基づいて割り込み発生ループ回数が割り込
み発生回数算出手段により算出される。この割り込み発
生ループ回数と、前記ループ実行回数算出部が算出した
ループ回数とが割り込みループ回数決定手段によって比
較され、少ない方のループ回数が新たに短縮実行できる
ループ回数と決定される。
Further , according to the above configuration, the interrupt generation time is managed by the interrupt time management means, and the interrupt generation loop count is calculated by the interrupt generation count calculation means based on the interrupt generation time. The interrupt loop count and the loop count calculated by the loop execution count calculator are compared by the interrupt loop count determining means, and the smaller loop count is newly determined as the loop count that can be shortened.

【0020】また上記構成によれば、I/Oイベント発
生時間がI/Oイベント発生時間管理手段に管理されて
いて、そのI/Oイベント発生時間に基づいてI/Oイ
ベントループ回数がI/Oイベント発生回数算出手段に
より算出される。このI/Oイベントループ回数と、前
記ループ実行回数算出部が算出したループ回数とがI/
Oループ回数決定手段によって比較され、少ない方のル
ープ回数が新たに短縮実行できるループ回数と決定され
る。
Further , according to the above configuration, the I / O event occurrence time is managed by the I / O event occurrence time managing means, and the I / O event loop count is calculated based on the I / O event occurrence time. It is calculated by the O event occurrence frequency calculation means. The I / O event loop count and the loop count calculated by the loop execution count calculation unit are I / O
The number of loops is compared by the O-loop number determining means, and the smaller number of loops is newly determined as the number of loops that can be shortened.

【0021】[0021]

【実施例】以下本発明の第1の実施例のソフトウェアシ
ミュレータについて、図面を参照しながら説明する。図
1は本発明の実施例におけるソフトウェアシミュレータ
及びソフトウェアシミュレータを取り巻く環境を示す図
である。本図は、コンピュータ本体110とディスク装
置120とキーボード130とディスプレイ140とか
ら構成されている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A software simulator according to a first embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a software simulator and an environment surrounding the software simulator according to an embodiment of the present invention. This figure comprises a computer main body 110, a disk device 120, a keyboard 130, and a display 140.

【0022】コンピュータ本体110は、内部にソフト
ウェアシミュレータ100を有し、ディスク装置120
とキーボード130とディスプレイ140とに接続され
る。ソフトウェアシミュレータ100は、メモリ領域1
01とレジスタ領域102と命令実行部103と命令列
保存部104とループ命令テーブル105とループ短縮
不能命令テーブル106とから構成されている。
The computer main body 110 has a software simulator 100 inside, and a disk device 120.
Is connected to the keyboard 130 and the display 140. The software simulator 100 has a memory area 1
01, register area 102, instruction execution unit 103, instruction sequence storage unit 104, loop instruction table 105, and loop non-shortening instruction table 106.

【0023】メモリ領域101は、ターゲットとするマ
イクロコンピュータのメモリ内容を保持する領域であ
る。シュミレーション実行時には、シミュレートするタ
ーゲットのアプリケーションソフトも格納される。シュ
ミレーション実行時に格納されるアプリケーションソフ
トの例としては、図9、図10、図11、図12、図1
3に示される。そしてこのアプリケーションソフトで使
用されている命令の定義は図14に示され、そのそれぞ
れの命令の意味が図15、図16、図17に示される。
The memory area 101 is an area for holding the memory contents of the target microcomputer. When executing the simulation, the target application software to be simulated is also stored. Examples of the application software stored when the simulation is executed are shown in FIG. 9, FIG. 10, FIG. 11, FIG.
3 is shown. The definition of the instruction used in this application software is shown in FIG. 14, and the meaning of each instruction is shown in FIGS. 15, 16 and 17.

【0024】レジスタ領域102は、シミュレートする
ターゲットのマイクロコンピュータのレジスタ内容を保
持する領域である。命令列保存部104は、ループとな
るべき命令列とその命令列における命令を実行した順番
である実行番号とを保存する領域である。ループ命令テ
ーブル105は、図2に示されるようなテーブルで、ル
ープを構成する可能性のある命令が保持されている。
The register area 102 is an area for holding the register contents of the target microcomputer to be simulated. The instruction sequence storage unit 104 is an area for storing an instruction sequence to be a loop and an execution number, which is the order in which the instructions in the instruction sequence are executed. The loop instruction table 105 is a table as shown in FIG. 2 and holds instructions that may form a loop.

【0025】ループ短縮不能命令テーブル106は、図
3に示されるようなテーブルで、ループを短縮して実行
することができなくなる命令を保持している。履歴保持
部107は、メモリの変更した履歴であるメモリ変更履
歴とレジスタの変更した履歴であるレジスタ変更履歴と
メモリのアクセスした履歴であるメモリアクセス履歴が
保持される領域である。
The loop non-shortening instruction table 106 is a table as shown in FIG. 3, and holds the instructions that cannot be executed by shortening the loop. The history holding unit 107 is an area for holding a memory change history that is a history of memory changes, a register change history that is a history of register changes, and a memory access history that is a history of memory accesses.

【0026】命令実行部103は、ターゲットのアプリ
ケーションソフトの命令列を実行及び短縮実行する部分
であり、具体的には図4、図5の制御フロー図に示す。
まず、シミュレートすべきターゲットのアプリケーショ
ンソフトをディスク装置120からロードしメモリ領域
101に配置する(ステップS500)。レジスタ領域
102中のプログラムカウンタ(不図示)を用い、プロ
グラムカウンタが指し示す位置の命令を、順次、実行す
るとともに、ループを検出する(ステップS501〜ス
テップS506)。ループの検出は、実行した命令がル
ープ命令テーブル105に存在し、かつその命令の次に
実行される命令のアドレスがその命令のアドレスより小
さく、更に次に実行される命令のアドレスは以前に実行
されたアドレスであることにより行う。ここで、ループ
の検出は、現在実行している命令のアドレスをループ終
了アドレス、次に実行される命令のアドレスをループ先
頭アドレスとみなすことによりおこなう。
The instruction execution unit 103 is a portion for executing and shortening the instruction sequence of the target application software, and is specifically shown in the control flow charts of FIGS. 4 and 5.
First, the target application software to be simulated is loaded from the disk device 120 and placed in the memory area 101 (step S500). Using a program counter (not shown) in the register area 102, the instruction at the position indicated by the program counter is sequentially executed and a loop is detected (steps S501 to S506). The loop is detected by executing the instruction in the loop instruction table 105, the address of the instruction executed next to the instruction is smaller than the address of the instruction, and the address of the instruction executed next is executed earlier. It is performed by being the registered address. Here, the loop is detected by regarding the address of the instruction currently being executed as the loop end address and the address of the next instruction to be executed as the loop start address.

【0027】次に、検出されたループを構成する命令列
のなかに、短縮して実行することができない命令が存在
するか否かを、ループ短縮不能命令テーブル106と比
較することにより判断する(ステップS507、ステッ
プS508)。短縮して実行することができない命令が
存在しなければ、さらに、その命令列の命令を順次実行
し、かつ図6に示すような形式で実行した順にその命令
を命令列保存部104に保存し、かつ実行した順番であ
る実行番号も命令に付加して保存する(ステップS50
9〜ステップS513)。次に実行した命令が、メモリ
領域101やレジスタ領域102の内容を変更したかど
うかを判断し、変更している場合は、そのメモリ及びレ
ジスタの変更履歴として図7、図8のような形式で履歴
保持部107に保存する(ステップS514〜ステップ
S517)。次に、全ての命令列の命令を実行し終わっ
たら(ステップS511)、その命令列で構成されるル
ープが短縮実行可能か判断する(ステップS518、ス
テップS519)。ここで、ループが短縮実行可能かど
うかは、以下のようにして判断する。まず、ループの命
令列を再度実行する。このとき、前回実行されていない
命令を今回実行する場合は、ループの短縮実行不能と判
定する。また、メモリ又はレジスタにアクセスしてその
内容を更新する場合であって、前回実行したときのメモ
リ及びレジスタの内容の変化の割合である変化率と今回
実行したときの変化率が異なるときもループの短縮実行
不能と判定する。さらに、ループの命令列を順次先頭か
ら検査し、前回、今回の実行のどちらでも実行されなか
った命令であって、メモリ及びレジスタの内容を変更す
る可能性のある命令(MOV命令、ADD命令、SUB
命令、MUL命令など)が存在することを検出した場合
もループの短縮実行不能と判定する。
Next, it is judged whether or not there is an instruction that cannot be executed in a shortened manner in the instruction sequence forming the detected loop by comparing with the loop incompressible instruction table 106 ( Steps S507 and S508). If there is no instruction that cannot be shortened and executed, the instructions of the instruction sequence are sequentially executed, and the instructions are stored in the instruction sequence storage unit 104 in the order of execution in the format shown in FIG. The execution number, which is the order of execution, is also added to the instruction and saved (step S50).
9-step S513). It is determined whether or not the next executed instruction has changed the contents of the memory area 101 and the register area 102, and if so, the change history of the memory and the register is changed in the format shown in FIGS. 7 and 8. The history is stored in the history holding unit 107 (steps S514 to S517). Next, when the instructions of all the instruction sequences have been executed (step S511), it is determined whether or not the loop formed by the instruction sequences can be shortened (steps S518 and S519). Here, whether or not the loop can be shortened is determined as follows. First, the instruction sequence of the loop is executed again. At this time, if an instruction that has not been executed previously is executed this time, it is determined that the loop cannot be shortened. Also, when accessing the memory or register to update its contents, and when the change rate, which is the rate of change in the contents of the memory and register at the previous execution, is different from the change rate at the current execution, the loop It is determined that the shortened execution of is impossible. Furthermore, the instruction sequence of the loop is sequentially inspected from the beginning, and an instruction that has not been executed in either the previous execution or the present execution and that may change the contents of the memory and the register (MOV instruction, ADD instruction, SUB
Also, when it is detected that there is an instruction, a MUL instruction, etc.), it is determined that the loop cannot be shortened.

【0028】短縮実行不可能であれば、ステップS50
5に進み、短縮実行可能であればさらに、ループする回
数を算出する(ステップS520)。ループする回数
は、以下のように算出される。まず、ループを抜けるジ
ャンプ命令を検出する(ここで、ジャンプ命令は、図1
4に示されるように条件分岐命令と無条件分岐命令の2
種類存在する)。検出されたジャンプ命令が無条件分岐
命令であるときは、その無条件分岐命令に分岐する分岐
元の命令である条件分岐命令を検出する。そして、その
条件分岐命令がその無条件分岐命令に分岐する条件を算
出する。その条件とメモリ及びレジスタの変更履歴とメ
モリのアクセス履歴とに基づいてループ回数を算出す
る。一方、検出されたジャンプ命令が条件分岐命令であ
るときは、この命令によってループを抜ける条件を算出
し、その条件とメモリ及びレジスタの変更履歴とメモリ
のアクセス履歴とに基づいてループ回数を算出する。と
ころでループ回数が無限であると判定したときは、ある
予め決められた回数をループ回数とする。
If the shortened execution is not possible, step S50.
In step 5, the number of times of looping is calculated if shortening is possible (step S520). The number of loops is calculated as follows. First, a jump instruction that exits the loop is detected (here, the jump instruction is as shown in FIG.
2 of the conditional branch instruction and the unconditional branch instruction as shown in 4
Types exist). When the detected jump instruction is an unconditional branch instruction, a conditional branch instruction that is a branch source instruction branching to the unconditional branch instruction is detected. Then, the condition for the conditional branch instruction to branch to the unconditional branch instruction is calculated. The number of loops is calculated based on the condition, the memory and register change history, and the memory access history. On the other hand, when the detected jump instruction is a conditional branch instruction, the condition for exiting the loop is calculated by this instruction, and the number of loops is calculated based on the condition, the memory and register change history, and the memory access history. . When it is determined that the number of loops is infinite, a predetermined number of times is set as the number of loops.

【0029】次にループ回数とメモリ及びレジスタの変
化率から、ループ回数分実行されたと仮定したときのメ
モリとレジスタの内容を予測し、その予測内容を現在の
メモリ及びレジスタに反映させ、ループを短縮実行する
(ステップS521)。その後、レジスタ領域102の
プログラムカウンタの値をループ先頭アドレスに設定
し、通常のシミュレーションに戻る。
Next, the contents of the memory and the register when it is assumed that the loop has been executed for the number of times of the loop are predicted from the number of times of the loop and the change of the memory and the register, and the predicted contents are reflected in the current memory and the register, and the loop Shortened execution (step S521). After that, the value of the program counter in the register area 102 is set to the loop top address, and the normal simulation is resumed.

【0030】ディスク装置120は、ターゲットのマイ
クロコンピュータで動作すべきアプリケーションプログ
ラムを保持する。キーボード130は、ソフトウェアシ
ミュレータの操作指示を受け付ける。ディスプレイ14
0は、シミュレートされた結果等を表示する。次に、図
9に示される具体的なアプリケーションソフトの例を用
いたシミュレーション動作を説明するため、簡単に図9
のアプリケーションソフトの構造を説明し、その後にシ
ミュレーション動作について説明する。
The disk device 120 holds an application program to be operated by the target microcomputer. The keyboard 130 receives an operation instruction of the software simulator. Display 14
0 displays a simulated result or the like. Next, in order to explain the simulation operation using the specific application software example shown in FIG.
The structure of the application software will be described, and then the simulation operation will be described.

【0031】図9は、本発明で実施されるべきアプリケ
ーションソフトの例である。これは、アセンブリ言語で
書かれているプログラムである。プログラムで使用され
ている命令は、図14に定義され、図15、図16、図
17にその意味が記載されている。92に示される部分
は、命令部である。91に示される部分は、このプログ
ラム内における命令行の相対的なアドレスを示すアドレ
ス部である。93に示される部分は、ループとなるべき
命令列が保存されるときに添付される命令列の実行番号
である。
FIG. 9 shows an example of application software to be implemented by the present invention. This is a program written in assembly language. The commands used in the program are defined in FIG. 14 and their meanings are described in FIGS. 15, 16 and 17. The part indicated by 92 is a command part. The part indicated by 91 is an address part indicating the relative address of the instruction line in this program. The part indicated by 93 is the execution number of the instruction sequence attached when the instruction sequence to be a loop is stored.

【0032】次に、図9に示される具体的なアプリケー
ションソフトの例を用いた、ループを短縮実行できる場
合のシミュレーション動作を説明する。ここで、以下の
説明文の先頭には、1〜10などの番号がつけられてい
る。この番号は、処理のまとまり毎につけられている番
号であり、後に図10、図11・・・のアプリケーショ
ンソフトを用いてシミュレーション動作を説明する時に
使用するためのものである。
Next, the simulation operation in the case where the loop can be shortened by using the example of the specific application software shown in FIG. 9 will be described. Here, numbers such as 1 to 10 are attached to the beginning of the following description. This number is a number assigned to each group of processes, and is used later when the simulation operation is described using the application software of FIGS.

【0033】1、先頭の命令から順次通常のシミュレー
ション動作及びループの検索動作(ステップS501〜
ステップS506)を※2に示す行まで繰り返す。 2、ループ命令テーブル105には、「JMP」と「B
LT」が保持されているとすると、※2の行での命令
は、ループ命令テーブル105に存在する命令「BL
T」であるが、飛び先のアドレスが現在のアドレスより
大きいので、ループを構成しないと判断される(ステッ
プS503、ステップS504)。よってここでは通常
のシミュレーションを行う。
1. Normal simulation operation and loop search operation sequentially from the first instruction (steps S501 to S501)
Repeat step S506) up to the line indicated by * 2. 2. In the loop instruction table 105, "JMP" and "B
Assuming that “LT” is held, the instruction in the line of * 2 is the instruction “BL existing in the loop instruction table 105.
However, since the jump destination address is larger than the current address, it is determined that the loop is not formed (steps S503 and S504). Therefore, a normal simulation is performed here.

【0034】3、※3での行の命令も、2の場合と同様
に、ループを構成しないと判断される(ステップS50
3、ステップS504)。よってここでは通常のシミュ
レーションを行う。 4、以下※1に達するまで、通常のシミュレーション動
作及びループの検索動作を行う(ステップS501〜ス
テップS506)。
As in the case of 2, the instructions of the lines 3 and * 3 are also determined not to form a loop (step S50).
3, step S504). Therefore, a normal simulation is performed here. 4. Normal simulation operation and loop search operation are performed until the following * 1 is reached (steps S501 to S506).

【0035】5、※1の行での命令「JMP」は、ルー
プ命令テーブル105に存在する命令であり、飛び先の
アドレスが現在のアドレスよりも小さいので、ループを
構成すると判断される(ステップS503、ステップS
504)。このとき、ループの先頭アドレスは、add
r3となり、ループの終了アドレスは、※1となる。 6、ループ短縮不能命令テーブル106には、「MU
L」が保持されているとする。ループが構成されると判
断された場合は、そのループ内の命令なかに、ループ短
縮不能命令テーブル106の保持している命令「MU
L」が存在しないかどうか判断する(ステップS50
7、ステップS508)。判断した結果、命令「MU
L」は存在しないので、次のステップに進む。
The instruction "JMP" in the line of 5, * 1 is an instruction existing in the loop instruction table 105, and the jump destination address is smaller than the current address, so it is judged that a loop is formed (step S503, step S
504). At this time, the start address of the loop is add
It becomes r3, and the end address of the loop becomes * 1. 6. In the loop non-shortening instruction table 106, "MU
It is assumed that “L” is held. When it is determined that the loop is configured, the instruction “MU” held in the loop non-shortening instruction table 106 is included in the instructions in the loop.
It is determined whether "L" does not exist (step S50).
7, step S508). As a result of the judgment, the instruction "MU
Since L ”does not exist, the process proceeds to the next step.

【0036】7、さらに、ループの先頭から順次命令を
実行するとともにその命令と、実行番号と、実行した命
令によりメモリ及びレジスタが変更された場合のメモリ
及びレジスタの変更履歴とが、図18、図19に示され
るように各命令行の実行毎に記録される(ステップS5
09、ステップS517)。図18(a)における図
は、実行番号1に示される命令の実行の後に、保存され
た命令とメモリ及びレジスタの変更履歴を示す。181
に示される部分は、実行番号1で保存した命令及び実行
番号である。この内181aは、保存した命令であり、
181bは、実行番号である。182で示される部分
は、メモリの変更履歴が保存されるべき部分である。1
83に示される部分は、保存したレジスタの変更履歴で
ある。この内183aは、実行番号1でアクセスしたレ
ジスタ名であり、183bは、レジスタに前回アクセス
したときレジスタの内容であり、183cは、今回レジ
スタにアクセスしたときのレジスタの内容であり、18
4dは、実行番号である。図18(b)における図は、
実行番号2に示される命令の実行の後に、保存された命
令とメモリ及びレジスタの変更履歴を示す。そして18
5などに示される「→」は、ポインタを表してる。以下
同様に図18(c)(d)・・・図19(g)における
図は、実行番号3、4・・・7に示される命令の実行の
後に、保存された命令とメモリ及びレジスタの変更履歴
を示す。メモリの変更履歴は、図19(f)に示される
ように保存される。182aは、実行番号6でアクセス
したメモリ名であり、182bは、メモリに前回アクセ
スしたときメモリの内容であり、182cは、今回メモ
リにアクセスしたときのメモリの内容であり、184d
は、実行番号である。
7. Further, FIG. 18, in which the instructions are sequentially executed from the beginning of the loop, the instructions, the execution numbers, and the memory and register change history when the memory and registers are changed by the executed instruction are shown in FIG. As shown in FIG. 19, it is recorded for each execution of each instruction line (step S5).
09, step S517). The diagram in FIG. 18A shows the stored instruction and the change history of the memory and the register after the execution of the instruction indicated by the execution number 1. 181
The part indicated by is the instruction and the execution number saved in the execution number 1. Of these, 181a is the saved instruction,
181b is an execution number. The part indicated by 182 is a part where the change history of the memory should be saved. 1
The part indicated by 83 is the change history of the saved register. Of these, 183a is the name of the register accessed with execution number 1, 183b is the content of the register when the register was last accessed, and 183c is the content of the register when the register is accessed this time.
4d is an execution number. The diagram in FIG. 18 (b) is
After execution of the instruction indicated by execution number 2, the saved history and the change history of the memory and the register are shown. And 18
“→” shown in 5 and the like represents a pointer. Similarly, the diagrams in FIGS. 18 (c), (d), ..., 19 (g) show that after the execution of the instructions indicated by the execution numbers 3, 4, ... Indicates the change history. The change history of the memory is saved as shown in FIG. 182a is the name of the memory accessed with the execution number 6, 182b is the content of the memory when the memory was accessed last time, 182c is the content of the memory when the memory is accessed this time, 184d
Is the run number.

【0037】8、ループを再度実行し、ループが短縮実
行可能かどうかを調べる(ステップS518、ステップ
S519)。本例では、短縮実行可能と判断される。 9、短縮実行できるループ回数を算出する(ステップS
520)。本例では、ループを抜ける命令は、※3のJ
MP命令である。そしてこのJMP命令の前の命令が条
件分岐命令であるので、※3のJMP命令が実行される
ためには、BLT命令の条件が成立しなければ良い。B
LT命令の条件が成立しないのは、フラグが負でなけれ
ば良い、つまりCMP命令において、Reg1≧100
であれば良い。従って、実行番号7でのReg1の内容
は3であるので、97回ループを短縮することができ
る。
8. The loop is executed again to check whether the loop can be shortened (steps S518 and S519). In this example, it is determined that shortening is possible. 9. Calculate the number of loops that can be shortened (step S
520). In this example, the instruction to exit the loop is J in * 3.
MP command. Since the instruction before this JMP instruction is a conditional branch instruction, in order for the JMP instruction of * 3 to be executed, it is sufficient that the condition of the BLT instruction is not satisfied. B
The condition of the LT instruction is not satisfied unless the flag is negative, that is, Reg1 ≧ 100 in the CMP instruction.
If it is good. Therefore, since the content of Reg1 at execution number 7 is 3, the loop can be shortened 97 times.

【0038】10、ループを短縮実行する(ステップS
521)。具体的には、求められたループの回数分実行
されたと仮定したときのメモリとレジスタの内容を予測
し、その予測内容を現在のメモリ及びレジスタに反映さ
せ、ループを短縮実行する。その後通常のシミュレーシ
ョンに戻る。次に、図10に示される具体的なアプリケ
ーションソフトの例を用いた、ループを短縮実行できな
い場合のシミュレーション動作を説明する。
10. Shorten the loop (step S)
521). Specifically, the contents of the memory and the register when it is assumed that the loop has been executed for the obtained number of times are predicted, the predicted contents are reflected in the current memory and register, and the loop is shortened. Then return to the normal simulation. Next, a simulation operation in the case where the loop cannot be shortened and executed by using a specific application software example shown in FIG. 10 will be described.

【0039】図4、図5の動作フロー図においてステッ
プS501〜ステップS504の動作は、図9を用いて
説明したシミュレーション動作の説明1〜5と同様の手
順で行う。 6、ループ短縮不能命令テーブル106には、「MU
L」が保持されているとする。ループ内の命令のなか
に、ループ短縮不能命令テーブル106の保持している
命令「MUL」が存在するかどうかを判断する(ステッ
プS507、ステップS508)。判断した結果、命令
「MUL」が11に示す部分に存在するので、ステップ
S505に戻り、ループと判断されていたループの先頭
であるAddr3の命令から通常のシミュレーションを
行う。
In the operation flow charts of FIGS. 4 and 5, the operations of steps S501 to S504 are performed in the same procedure as the explanations 1 to 5 of the simulation operation described with reference to FIG. 6. In the loop non-shortening instruction table 106, "MU
It is assumed that “L” is held. It is determined whether or not the instruction “MUL” held in the loop unreducible instruction table 106 exists among the instructions in the loop (steps S507 and S508). As a result of the judgment, since the instruction "MUL" exists in the portion indicated by 11, the process returns to step S505, and the normal simulation is performed from the instruction of Addr3, which is the head of the loop that was determined to be the loop.

【0040】次に、図11に示される具体的なアプリケ
ーションソフトの例を用いた、ループを短縮実行できな
い場合のシミュレーション動作を説明する。図4、図5
の動作フロー図においてステップS501〜ステップS
517の動作は、図9を用いて説明したシミュレーショ
ン動作の説明1〜7と同様の手順で行う。7の終了後
は、実行した命令と、実行番号と、実行した命令により
変更されたメモリ及びレジスタの変更履歴とメモリのア
クセス履歴とが、図20に示されるように記録されてい
る。
Next, the simulation operation in the case where the loop cannot be shortened by using the example of the specific application software shown in FIG. 11 will be described. 4 and 5
Steps S501 to S in the operation flow chart of FIG.
The operation of 517 is performed in the same procedure as the description 1 to 7 of the simulation operation described with reference to FIG. After the end of 7, the executed instruction, the execution number, the change history of the memory and the register changed by the executed instruction, and the access history of the memory are recorded as shown in FIG.

【0041】8、ループを再度実行し、ループが短縮実
行可能かどうかを調べる(ステップS518、ステップ
S519)。本例の場合では、図20のメモリの変更履
歴に示すように前回の実行でのMem1の変化率は、変
更前が1であり変更後が3であることより2であるのに
対して、再度実行したときは、Mem1の変化率が3と
なるので、短縮実行不可能と判断される。
8. The loop is executed again to check whether the loop can be shortened (steps S518 and S519). In the case of this example, the change rate of Mem1 in the previous execution is 2 as shown in the memory change history of FIG. When it is re-executed, the change rate of Mem1 becomes 3, so it is determined that shortening cannot be executed.

【0042】以上のようにして、ループ命令を検出し、
そのループを実際の回数分実行することなく、実際にシ
ミュレーションした場合と同じ状態にすることで、その
ループの実際の処理時間を短縮することができる。例え
ば、タイマを使用したアプリケーションソフトの検証で
は、タイムアップ時刻まで、ループ処理で待っている場
合が多い。したがって、タイマのタイムアップ時刻まで
のループを短縮実行することにより、実際のタイムアッ
プ時刻まで待つことなしに、動作確認することができ
る。すなわち、本発明のソフトウェアシミュレータで
は、ターゲット上で数分または数十分タイマで待つよう
なアプリケーションソフトの動作検証をわずか数秒で動
作検証することができる。
As described above, the loop instruction is detected,
The actual processing time of the loop can be shortened by setting the same state as in the case of the actual simulation without executing the loop the actual number of times. For example, in verification of application software using a timer, there are many cases in which a loop process waits until the time is up. Therefore, the operation can be confirmed without waiting for the actual time-up time by performing the loop up to the time-up time of the timer. That is, with the software simulator of the present invention, the operation verification of the application software, which waits for a few minutes or tens of minutes on the target, can be verified in a few seconds.

【0043】以下本発明の第2の実施例のソフトウェア
シミュレータについて、図面を参照しながら説明する。
図21は本発明の実施例におけるソフトウェアシミュレ
ータの構成を取り巻く環境を示すものである。本図は、
コンピュータ本体110とディスク装置120とキーボ
ード130とディスプレイ140とから構成されてい
る。これらは、第1の実施例と同様であるので説明を省
略し、コンピュータ本体110に有されるソフトウェア
シミュレータ200について説明する。
A software simulator according to the second embodiment of the present invention will be described below with reference to the drawings.
FIG. 21 shows the environment surrounding the configuration of the software simulator in the embodiment of the present invention. This figure shows
It is composed of a computer main body 110, a disk device 120, a keyboard 130, and a display 140. Since these are the same as those in the first embodiment, description thereof is omitted, and the software simulator 200 included in the computer main body 110 will be described.

【0044】ソフトウェアシミュレータ200の構成
は、第1の実施例の命令実行部103の代わりに命令実
行部203が設けられ、そしてループ短縮命令情報保存
部210が新たに設けられた以外は第1の実施例と同じ
である。以下異なった構成のみ説明する。ループ短縮命
令情報保存部210は、図22に示されるように、ルー
プの先頭アドレスとループの終了アドレスとループ回数
算出情報アドレスと次の要素へのポインタを保存してい
る。ここで、ループ回数算出情報アドレスは、ループ回
数を算出する際に必要とされる情報のアドレスのことで
あり、具体的には、当該ループのメモリ変更履歴とメモ
リアクセス履歴とが保持されている履歴保持部107に
おけるアドレスと、当該ループのレジスタの変更履歴が
保持されているレジスタ領域102におけるアドレス
と、当該ループを構成する命令列が保存されている命令
列保存部104におけるアドレスとである。
The software simulator 200 has a first configuration except that an instruction execution unit 203 is provided in place of the instruction execution unit 103 of the first embodiment, and a loop shortening instruction information storage unit 210 is newly provided. Same as the embodiment. Only different configurations will be described below. As shown in FIG. 22, the loop shortening instruction information storage unit 210 stores a loop start address, a loop end address, a loop count calculation information address, and a pointer to the next element. Here, the loop count calculation information address is an address of information required when calculating the loop count. Specifically, the memory change history and the memory access history of the loop are held. An address in the history holding unit 107, an address in the register area 102 in which the register change history of the loop is held, and an address in the instruction sequence storage unit 104 in which the instruction sequence forming the loop is stored.

【0045】命令実行部203は、ターゲットのアプリ
ケーションソフトの命令列を実行及び短縮実行する部分
であり、具体的には、図23、図24の制御フロー図に
示す。この制御フロー図は、第一の実施例に制御フロー
図である図4、図5とほぼ同様であるので、異なってい
る所のみ説明する。異なっている点は二点ある。まず第
一点目として第一の実施例の図4におけるステップS5
04の下に、ループが以前に実行されたかの判断ステッ
プS523が追加された点である。二点目としてステッ
プS521の下にステップS522が追加された点であ
る。以下これらのステップについて説明する。
The instruction execution section 203 is a section for executing and shortening the instruction sequence of the target application software, and specifically, it is shown in the control flow charts of FIGS. 23 and 24. Since this control flow chart is almost the same as the control flow charts of FIGS. 4 and 5 in the first embodiment, only different points will be described. There are two differences. First, as a first point, step S5 in FIG. 4 of the first embodiment.
Below 04, a step S523 for determining whether the loop has been executed before is added. The second point is that step S522 is added below step S521. These steps will be described below.

【0046】まずステップS522では、ステップS5
21で短縮実行したループについて、図22に示すよう
にループの先頭アドレスとループの終了アドレスとルー
プ回数算出情報アドレスとをリスト構造にてループ短縮
命令情報保存部210に保存する。ステップS523で
は、ステップS504にて検出されたループが以前に実
行されたかどうかを判断する。その判断は以下のように
して実行される。まずステップS504にて検出された
ループの先頭アドレスと終了アドレスとをループ短縮命
令情報保存部210の保存している先頭アドレスと終了
アドレスとそれぞれ比較する。一致しなければ、以下ス
テップS507に進む。一致すれば、同じループが以前
に実行したと判断する。以前に実行されたと判断された
ときはステップS507からステップS519までの処
理がスキップされ、ステップS520に進む。また、ス
テップS507からステップS519までの処理がスキ
ップされたときのステップS520でのループ回数の算
出は、ループ短縮命令情報保存部210の保存している
ループ回数算出情報アドレスを用い、ループ回数の算出
に必要な情報を引き出し、実施例1と同様の手法でルー
プ回数を算出する。同様に、ステップS521でのルー
プの短縮実行は、算出されたループ回数とループ回数算
出情報アドレスより引き出されるメモリ及びレジスタの
変化率とを用いて、ループ回数分実行されたと仮定した
ときのメモリとレジスタの内容を予測し、その予測結果
を現在のメモリ及びレジスタに反映させることにより行
う。
First, in step S522, step S5
As for the loop that has been shortened in step 21, the loop start address, the loop end address, and the loop count calculation information address are stored in the loop shortening instruction information storage unit 210 in a list structure as shown in FIG. In step S523, it is determined whether the loop detected in step S504 has been executed before. The judgment is executed as follows. First, the start address and end address of the loop detected in step S504 are compared with the start address and end address stored in the loop shortening instruction information storage unit 210, respectively. If they do not match, the process proceeds to step S507. If they match, it is determined that the same loop has been executed before. When it is determined that the processing has been executed previously, the processing from step S507 to step S519 is skipped, and the process proceeds to step S520. Further, when the processing from step S507 to step S519 is skipped, the calculation of the loop count in step S520 uses the loop count calculation information address stored in the loop shortening instruction information storage unit 210 to calculate the loop count. Necessary information is extracted and the number of loops is calculated by the same method as in the first embodiment. Similarly, the shortened execution of the loop in step S521 is performed using the calculated loop count and the change rate of the memory and the register derived from the loop count calculation information address, assuming that the memory has been executed for the loop count. This is done by predicting the contents of the register and reflecting the prediction result in the current memory and register.

【0047】以上のようにして、一度短縮実行されたル
ープが再度実行されるとき、短縮実行の処理を一部省略
することにより実行時間をより短縮することが可能とな
る。以下本発明の第3の実施例のソフトウェアシミュレ
ータについて、図面を参照しながら説明する。図25は
本発明の実施例におけるソフトウェアシミュレータの構
成を取り巻く環境を示すものである。本図は、コンピュ
ータ本体110とディスク装置120とキーボード13
0とディスプレイ140とから構成されている。これら
は、第1の実施例と同様であるので説明を省略し、コン
ピュータ本体110に有されるソフトウェアシミュレー
タ300について説明する。
As described above, when the loop which has been shortened once is executed again, the execution time can be further shortened by omitting a part of the shortening process. A software simulator according to the third embodiment of the present invention will be described below with reference to the drawings. FIG. 25 shows the environment surrounding the configuration of the software simulator in the embodiment of the present invention. This figure shows a computer main body 110, a disk device 120, and a keyboard 13.
0 and a display 140. Since these are the same as those in the first embodiment, description thereof will be omitted, and the software simulator 300 included in the computer main body 110 will be described.

【0048】ソフトウェアシミュレータ300の構成
は、第1の実施例の命令実行部103の代わりに命令実
行部303が設けられ、そして割り込み処理部307と
時間管理部306が新たに設けられた以外は第1の実施
と同じである。以下異なっている構成要素のみ説明す
る。割り込み処理部307は、シミュレータ上で割り込
み動作をシミュレートする。
The software simulator 300 has the same configuration as that of the first embodiment except that an instruction execution unit 303 is provided instead of the instruction execution unit 103 of the first embodiment, and an interrupt processing unit 307 and a time management unit 306 are newly provided. It is the same as the implementation of 1. Only different components will be described below. The interrupt processing unit 307 simulates an interrupt operation on the simulator.

【0049】時間管理部308は、割り込み動作をシミ
ュレートする時の割り込み発生時間を管理していて、割
り込み発生時間になると割り込み処理部307を起動す
る。命令実行部303は、ターゲットのアプリケーショ
ンソフトの命令列を実行及び短縮実行する部分であり、
具体的には、図26、図27の制御フロー図に示す。こ
の制御フロー図は、第一の実施例の制御フロー図である
図4、図5とほぼ同様であるので、異なっている所のみ
説明する。図5の制御フロー図におけるステップS52
0とステップS521の間に、ステップS1301〜ス
テップS1305の処理ステップが追加されている点が
異なる。以下これらの処理ステップについて説明する。
まず第一の実施例におけるステップS520と同様の方
法で算出したループ終了条件が満たされるまでのループ
回数を算出する(ステップS520)。そして割り込み
処理が存在するがどうかを時間管理部308を参照する
ことにより判断する(ステップS1301)。ここで、
割り込み処理が存在しないときは、ループ終了条件が満
たされるまでのループ回数を短縮実行できるループ回数
としステップS521に進む(ステップS1305)。
割り込み処理が存在するときは、割り込み発生までのル
ープ回数を算出し(ステップS1302)、ループ終了
条件が満たされるまでのループ回数と比較する(ステッ
プS1303)。ここでステップS1302における割
り込み発生までのループ回数は、時間管理部308で管
理されている割り込み発生時間と1回ループするのに必
要な時間とに基づいて求められる。もし、割り込み発生
までのループの回数の方が、ループ終了条件が満たされ
るまでのループ回数よりも少ないときは、割り込み発生
までのループの回数を短縮実行できるループ回数として
ステップS521を実行する(ステップS1304)。
そうでないとき、つまりループ終了条件が満たされるま
でのループ回数の方が少ないときは、この回数を短縮実
行できるループ回数としてステップS521に進む(ス
テップS1305)。
The time management unit 308 manages the interrupt generation time when simulating the interrupt operation, and activates the interrupt processing unit 307 when the interrupt generation time is reached. The instruction execution unit 303 is a unit that executes and shortens the instruction sequence of the target application software,
Specifically, it is shown in the control flow charts of FIGS. Since this control flow chart is almost the same as the control flow charts of the first embodiment shown in FIGS. 4 and 5, only different points will be described. Step S52 in the control flow chart of FIG.
The difference is that the processing steps of steps S1301 to S1305 are added between 0 and step S521. These processing steps will be described below.
First, the number of loops until the loop end condition calculated by the same method as step S520 in the first embodiment is satisfied is calculated (step S520). Then, it is determined whether there is an interrupt process by referring to the time management unit 308 (step S1301). here,
If there is no interrupt processing, the number of loops until the loop end condition is satisfied is set to the number of loops that can be shortened and the process proceeds to step S521 (step S1305).
If interrupt processing is present, the number of loops until the occurrence of an interrupt is calculated (step S1302) and compared with the number of loops until the loop end condition is satisfied (step S1303). Here, the number of loops until the interrupt is generated in step S1302 is obtained based on the interrupt generation time managed by the time management unit 308 and the time required for one loop. If the number of loops until the interrupt is generated is smaller than the number of loops until the loop end condition is satisfied, step S521 is executed as the number of times that the number of loops until the interrupt is generated can be shortened (step S521). S1304).
If not, that is, if the number of loops until the loop end condition is satisfied is smaller, this number is set as the number of loops that can be shortened and the process proceeds to step S521 (step S1305).

【0050】次に、図12に示される具体的なアプリケ
ーションソフトの例を用いた、ループを短縮実行できる
場合のシミュレーション動作を説明する。図26、図2
7の動作フロー図においてステップS501〜ステップ
S519の動作は、図9を用いて説明したシミュレーシ
ョン動作の説明1〜8と同様の手順で行う。また、実行
した命令と、実行番号と、実行した命令によりメモリ及
びレジスタが変更された場合のメモリ及びレジスタの変
更履歴とメモリのアクセス履歴とが、図28に示される
ように記録される。
Next, the simulation operation when the loop can be shortened by using the example of the specific application software shown in FIG. 12 will be described. 26 and FIG.
In the operation flow chart of FIG. 7, the operations of steps S501 to S519 are performed in the same procedure as the descriptions 1 to 8 of the simulation operation described with reference to FIG. Further, the executed instruction, the execution number, the change history of the memory and the register when the memory and the register are changed by the executed instruction, and the access history of the memory are recorded as shown in FIG.

【0051】9、短縮実行できるループ回数を算出する
(ステップS520〜ステップS1305)。具体的に
は、まずループ終了条件が満たされるまでのループ回数
を算出する(ステップS520)。この場合、無限ルー
プとなるので、適当な値500回をループ終了条件が満
たされるまでのループ回数とみなす。次に、時間管理部
308が管理している割り込み発生までの時間が100
0サイクルであり、そして1回ループするのに必要な時
間が5サイクルであれば割り込み発生までのループ回数
は、200回と算出される(ステップS1301、ステ
ップS1302)。次に、ループ終了条件が満たされる
までのループ回数と割り込み発生までのループ回数とを
比較すると割り込み発生までの回数の方が回数が少ない
ので、割り込みが先に発生すると判断し、割り込み発生
までのループの回数を短縮実行できるループ回数とする
(ステップS1303、ステップS1304)。このと
き、割り込み発生までのループ回数は、200回である
が、短縮実行できる回数は、199回に設定される。そ
の理由は、200回に設定すると、ループ短縮実行した
時と同時に割り込みが発生するので、それを防ぐためで
ある。
9. The number of loops that can be shortened is calculated (steps S520 to S1305). Specifically, first, the number of loops until the loop end condition is satisfied is calculated (step S520). In this case, since the loop is infinite, an appropriate value of 500 is regarded as the number of loops until the loop end condition is satisfied. Next, the time until the interrupt occurrence managed by the time management unit 308 is 100
If it is 0 cycle and the time required to loop once is 5 cycles, the number of loops until the interrupt is generated is calculated to be 200 (steps S1301 and S1302). Next, comparing the number of loops until the loop end condition is satisfied with the number of loops until an interrupt occurs, the number of times until an interrupt occurs is smaller, so it is determined that an interrupt will occur first, and The number of loops is set to the number of loops that can be shortened (steps S1303 and S1304). At this time, the number of loops up to the occurrence of an interrupt is 200, but the number of times that can be shortened is set to 199. The reason is that if it is set to 200 times, an interrupt occurs at the same time when the loop shortening is executed, so that it is prevented.

【0052】10、ループを短縮実行する(ステップS
521)。具体的には、求められたループの回数分実行
されたと仮定したときのメモリとレジスタの内容を予測
し、その予測内容を現在のメモリ及びレジスタに反映さ
せ、ループを短縮実行する。その後通常のシミュレーシ
ョンに戻る。 以上のようにして、ループしている最中に割り込みが発
生するときでも、割り込み発生までループを短縮実行
し、割り込み発生時には通常のシミュレーション処理に
戻すことで、割り込みが発生する時でも、正しく割り込
み処理をシミュレーションしかつループを短縮実行する
ことができる。
10. Shorten the loop (step S)
521). Specifically, the contents of the memory and the register when it is assumed that the loop has been executed for the obtained number of times are predicted, the predicted contents are reflected in the current memory and register, and the loop is shortened. Then return to the normal simulation. As described above, even when an interrupt occurs during looping, the loop is shortened until the interrupt occurs, and when the interrupt occurs, normal simulation processing is resumed, so that the interrupt is generated correctly even when the interrupt occurs. The process can be simulated and the loop can be shortened.

【0053】以下本発明の第4の実施例のソフトウェア
シミュレータについて、図面を参照しながら説明する。
図29は本発明の実施例におけるソフトウェアシミュレ
ータの構成を取り巻く環境を示すものである。本図は、
コンピュータ本体110とディスク装置120とキーボ
ード130とディスプレイ140とから構成されてい
る。これらは、第1の実施例と同様であるので説明を省
略し、コンピュータ本体110に有されるソフトウェア
シミュレータ400について説明する。
A software simulator according to the fourth embodiment of the present invention will be described below with reference to the drawings.
FIG. 29 shows the environment surrounding the configuration of the software simulator in the embodiment of the present invention. This figure shows
It is composed of a computer main body 110, a disk device 120, a keyboard 130, and a display 140. Since these are the same as those in the first embodiment, description thereof is omitted, and the software simulator 400 included in the computer main body 110 will be described.

【0054】ソフトウェアシミュレータ400の構成
は、第1の実施例の命令実行部103の代わりに命令実
行部403が設けられ、そしてI/O処理部407と時
間管理部408が新たに設けられた以外は第1の実施と
同じである。以下異なっている構成要素のみ説明する。
I/O処理部407は、シミュレータ上でI/Oイベン
トをシミュレートする。
The software simulator 400 has a configuration in which an instruction execution unit 403 is provided instead of the instruction execution unit 103 of the first embodiment, and an I / O processing unit 407 and a time management unit 408 are newly provided. Is the same as the first implementation. Only different components will be described below.
The I / O processing unit 407 simulates an I / O event on the simulator.

【0055】時間管理部408は、I/Oイベントが発
生するまでの時間を管理していて、I/Oイベントが発
生する時間になるとI/O処理部407を起動する。命
令実行部403は、ターゲットのアプリケーションソフ
トの命令列を実行及び短縮実行する部分であり、具体的
には、図30、図31の制御フロー図に示す。この制御
フロー図は、第一の実施例に制御フロー図である図4、
図5とほぼ同様であるので、異なっている所のみ説明す
る。図5の制御フロー図におけるステップS520とス
テップS521の間に、ステップS1501〜ステップ
S1505の処理ステップが追加されている点が異な
る。以下これらの処理ステップについて説明する。まず
第一の実施例におけるステップS520と同様の方法で
算出したループ終了条件が満たされるまでのループ回数
を算出する(ステップS520)。そしてI/Oイベン
トが存在するがどうかを時間管理部408を参照するこ
とにより判断する(ステップS1501)。ここで、I
/Oイベントが存在しないときは、ループ終了条件が満
たされるまでのループ回数を短縮実行できるループ回数
としステップS521を実行する(ステップS150
5)。I/Oイベントが存在するときは、I/Oイベン
ト発生までのループ回数を算出し(ステップS150
2)、ループ終了条件が満たされるまでのループ回数と
比較する(ステップS1503)。ここでステップS1
502におけるI/Oイベント発生までのループ回数
は、時間管理部408で管理されているI/Oイベント
が発生するまでの時間と1回ループするのに必要な時間
とに基づいて求められる。もし、I/Oイベント発生ま
でのループの回数の方が、ループ終了条件が満たされる
までのループの回数よりも少ないときは、I/Oイベン
ト発生までのループ回数を短縮実行できるループ回数と
してステップS521を実行する(ステップS130
4)。そうでない時、つまり終了条件が満たされるまで
のループ回数の方が少ない時は、この回数を短縮実行で
きるループ回数としてステップS521に進む(ステッ
プS1305)。
The time management unit 408 manages the time until the I / O event occurs, and activates the I / O processing unit 407 at the time when the I / O event occurs. The instruction execution unit 403 is a portion that executes and shortens the instruction sequence of the target application software, and is specifically shown in the control flow charts of FIGS. 30 and 31. This control flow chart is the control flow chart of the first embodiment shown in FIG.
Since it is almost the same as FIG. 5, only different points will be described. The difference is that the processing steps of steps S1501 to S1505 are added between step S520 and step S521 in the control flow diagram of FIG. These processing steps will be described below. First, the number of loops until the loop end condition calculated by the same method as step S520 in the first embodiment is satisfied is calculated (step S520). Then, it is determined whether or not there is an I / O event by referring to the time management unit 408 (step S1501). Where I
When there is no / O event, the number of loops until the loop end condition is satisfied is set to the number of loops that can be shortened, and step S521 is executed (step S150).
5). If an I / O event exists, the number of loops until the I / O event occurs is calculated (step S150
2) Compare with the number of loops until the loop end condition is satisfied (step S1503). Here step S1
The number of loops until the occurrence of an I / O event in 502 is calculated based on the time until the occurrence of the I / O event managed by the time management unit 408 and the time required for one loop. If the number of loops until the I / O event occurs is smaller than the number of loops until the loop end condition is satisfied, the number of loops until the I / O event occurs is shortened to Execute S521 (step S130)
4). If not, that is, if the number of loops until the end condition is satisfied is smaller, this number is set as the number of loops that can be shortened, and the process proceeds to step S521 (step S1305).

【0056】次に、図13に示される具体的なアプリケ
ーションソフトの例を用いた、ループを短縮実行できる
場合のシミュレーション動作を説明する。図30、図3
1の動作フロー図においてステップS501〜ステップ
S519の動作は、図9を用いて説明したシミュレーシ
ョン動作の説明1〜8と同様の手順で行う。また、実行
した命令と、実行番号と、実行した命令によりメモリ及
びレジスタが変更された場合のメモリ及びレジスタの変
更履歴とメモリのアクセス情報とが、図32に示される
ように記録される。
Next, the simulation operation when the loop can be shortened by using the example of the specific application software shown in FIG. 13 will be described. 30 and 3
In the operation flow chart of FIG. 1, the operations of steps S501 to S519 are performed in the same procedure as the description 1-8 of the simulation operation described with reference to FIG. Further, the executed instruction, the execution number, the change history of the memory and the register when the memory and the register are changed by the executed instruction, and the memory access information are recorded as shown in FIG.

【0057】9、短縮実行できるループ回数を算出する
(ステップS520〜ステップS1505)。具体的に
は、まずループ終了条件が満たされるまでのループ回数
を算出する(ステップS520)。この場合、無限ルー
プとなるので、ループ回数を計測できず、適当な値50
0回をループ終了条件が満たされるまでのループ回数と
みなす。次に、時間管理部408が管理しているI/O
イベント発生までの時間が1000サイクルであり、そ
してループの命令列を1回ループさせるのに必要な時間
が10サイクルであれば割り込み発生までのループ回数
は、100回と算出される(ステップS1501、ステ
ップS1502)。次に、ループ終了条件が満たされる
までのループ回数とI/Oイベント発生までのループ回
数とを比較するとI/Oイベント発生までの回数の方が
回数が少ないので、I/Oイベントが先に発生すると判
断し、I/Oイベント発生までのループの回数を短縮実
行できるループ回数とする(ステップS1503、ステ
ップS1504)。このとき、I/Oイベント発生まで
のループ回数は、100回であるが、短縮実行できる回
数は、99回に設定される。その理由は、100回に設
定すると、ループ短縮実行した時と同時にI/Oイベン
トが発生するのを防ぐためである。
9. The number of loops that can be shortened is calculated (steps S520 to S1505). Specifically, first, the number of loops until the loop end condition is satisfied is calculated (step S520). In this case, since it becomes an infinite loop, the number of loops cannot be measured and an appropriate value 50
0 times is regarded as the number of loops until the loop end condition is satisfied. Next, the I / O managed by the time management unit 408
If the time until the event occurs is 1000 cycles and the time required to loop the instruction string of the loop once is 10 cycles, the number of loops until the interrupt occurs is calculated to be 100 (step S1501, Step S1502). Next, comparing the number of loops until the loop end condition is satisfied with the number of loops until the I / O event occurs, the number of times until the I / O event occurs is smaller, so the I / O event comes first. When it is determined that the I / O event occurs, the number of loops until the I / O event occurs is set to the number of loops that can be shortened (steps S1503 and S1504). At this time, the number of loops until the occurrence of the I / O event is 100, but the number of times that can be shortened is set to 99. The reason is that when set to 100 times, the I / O event is prevented from occurring at the same time when the loop shortening is executed.

【0058】以上のようにして、ループ中にI/Oイベ
ントが発生するときでも、I/Oイベント発生時までル
ープを短縮実行し、I/Oイベント発生時には通常のシ
ミュレーション処理に戻すことで、正しくシミュレーシ
ョン実行しかつループを短縮することができる。なお、
使用されている命令は、代表的なもののみを使用してい
るため、これら以外の命令を使用することも当然考えら
れる。
As described above, even when an I / O event occurs in the loop, the loop is shortened until the I / O event occurs, and when the I / O event occurs, the normal simulation process is resumed. The simulation can be executed correctly and the loop can be shortened. In addition,
Since only the typical instructions are used, it is naturally conceivable to use other instructions.

【0059】また、ループ命令テーブルやループ短縮不
能命令テーブルに格納されている命令は、例示した命令
には限らない。また、アセンブリ言語を使用してシミュ
レートしているが、他の言語を使用することも考えられ
る。
The instructions stored in the loop instruction table and the loop non-shortening instruction table are not limited to the illustrated instructions. Although the simulation is performed using the assembly language, it is also possible to use another language.

【0060】以上のように、発明では、ループ検出手
段によりループが検出され、そのループが短縮実行でき
るか否かが短縮実行判定手段により判定され、メモリ・
レジスタ内容変更手段によってループが短縮実行された
と同じ状態となるので、ソフトウェアシミュレータ上で
のアプリケーションソフトの実行時間を短縮することが
できる。
As described above, according to the present invention, the loop detection means detects a loop, and the shortened execution determination means determines whether or not the loop can be shortened.
Since the loop state is shortened by the register content changing means, the execution time of the application software on the software simulator can be shortened.

【0061】また、本発明では、短縮実行可能なループ
が、ループ命令テーブルとループ短縮不能命令テーブル
とを用いて検出されるので、短縮実行可能なループの検
出が迅速に行われ、ソフトウェアシミュレータ上でのア
プリケーションソフトの実行時間を短縮することができ
る。また、本発明では、再度実行した命令列が保存され
ている命令列保存部とメモリ内容保持手段とレジスタ内
容保持手段と履歴保持部とを用いてループが短縮実行で
きるか否かがループ短縮実行可能判定部によって判断さ
れるので、より正確にループが短縮実行でき、ソフトウ
ェアシミュレータ上でのアプリケーションソフトの実行
時間を短縮することができる。
Further , according to the present invention, the loops that can be shortened are detected by using the loop instruction table and the loop non-shortening instruction table. Therefore, the loops that can be shortened can be detected quickly, and the loop can be detected on the software simulator. The execution time of application software can be shortened. Further, according to the present invention, whether or not the loop can be shortened by using the instruction sequence storage unit in which the re-executed instruction sequence is stored, the memory content holding unit, the register content holding unit, and the history holding unit is loop shortened execution. Since it is determined by the possibility determination unit, the loop can be executed more accurately and the execution time of the application software on the software simulator can be shortened.

【0062】また、本発明では、実行回数算出部がルー
プの回数を算出し、その回数に基づいて変更部が、ルー
プ回数実行されたと仮定したときのメモリ及びレジスタ
の内容を予測しその結果がメモリ内容保持手段及びレジ
スタ内容保持手段に反映されるので、ループ回数分実行
された状態と同じ状態となり、より正確にループが短縮
実行されソフトウェアシミュレータ上でのアプリケーシ
ョンソフトの実行時間を短縮することができる。
Further , in the present invention, the execution number calculation unit calculates the number of loops, and based on the number of times, the changing unit predicts the contents of the memory and the register when it is assumed that the loop number of times has been executed, and the result is Since it is reflected in the memory content holding means and the register content holding means, the state becomes the same as the state executed by the number of loops, the loop is executed more accurately and the execution time of the application software on the software simulator can be shortened. it can.

【0063】また、本発明では、ループが短縮実行され
たとき、命令列の先頭アドレスと終了アドレスとループ
回数算出情報アドレスとがループ情報保持手段によって
保存され、ループが検出されたときにループ回数算出情
報アドレスを用いてそのループが再実行されたか否かが
判断でき、ループが再実行されている場合は、ループの
検出以降の処理であって、ループ回数の算出以前の処理
を省略することができるので、ループの短縮実行に要す
る処理を簡略化することが出来ることにより、アプリケ
ーションソフトの実行時間をさらに短縮することができ
る。
Further , according to the present invention, when the loop is executed in a shortened manner, the start address and end address of the instruction sequence and the loop count calculation information address are stored by the loop information holding means, and the loop count is detected when the loop is detected. Whether or not the loop is re-executed can be determined using the calculated information address. If the loop is re-executed, the processing after the detection of the loop, and the processing before the calculation of the number of loops can be omitted. Since the processing required for shortening the loop can be simplified, the execution time of the application software can be further shortened.

【0064】また、本発明では、割り込み時間管理手段
に管理されている割り込み発生時間に基づいて、短縮実
行できるループ回数が割り込みループ回数決定手段によ
って決定され、決定されたループ回数に基づいてループ
が短縮実行することができるので、割り込み動作がシミ
ュレートされる場合であっても、ソフトウェアシミュレ
ータ上でのアプリケーションソフトの実行時間を短縮す
ることができる。
Further , in the present invention, the number of loops that can be shortened is determined by the interrupt loop number determining means based on the interrupt generation time managed by the interrupt time managing means, and the loop is executed based on the determined loop number. Because it can be executed in a short time , software simulation can be performed even when interrupt operation is simulated.
It is possible to reduce the execution time of the application software on over data.

【0065】また、本発明では、I/Oイベント時間管
理手段に管理されているI/Oイベント発生時間に基づ
いて、短縮実行できるループ回数がI/Oイベントルー
プ回数決定手段によって決定され、決定されたループ回
数に基づいてループが短縮実行することができるので、
I/Oイベントがシミュレートされる場合であっても、
ソフトウェアシミュレータ上でのアプリケーションソフ
トの実行時間を短縮することができる。
Further , in the present invention, the number of loops that can be shortened is determined by the I / O event loop number determining means based on the I / O event occurrence time managed by the I / O event time managing means. Since the loop can be shortened based on the number of loops,
Even when I / O events are simulated,
The execution time of application software on the software simulator can be shortened.

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

【図1】第1の実施例におけるソフトウェアシミュレー
タ及びソフトウェアシミュレータを取り巻く環境を示す
図である。
FIG. 1 is a diagram showing a software simulator and an environment surrounding a software simulator in a first embodiment.

【図2】ループ命令テーブル105を示す図である。FIG. 2 is a diagram showing a loop instruction table 105.

【図3】ループ短縮不能命令テーブル106を示す図で
ある。
FIG. 3 is a diagram showing a loop non-shortening instruction table 106.

【図4】命令実行部103の制御フローを示す図であ
る。
FIG. 4 is a diagram showing a control flow of an instruction execution unit 103.

【図5】図4の続きの図である。FIG. 5 is a continuation of FIG. 4;

【図6】命令列保存部104に格納形式を示す図であ
る。
FIG. 6 is a diagram showing a storage format in an instruction sequence storage unit 104.

【図7】履歴保持部107におけるメモリ変更履歴を示
す図である。
7 is a diagram showing a memory change history in a history holding unit 107. FIG.

【図8】履歴保持部107におけるレジスタ変更履歴を
示す図である。
8 is a diagram showing a register change history in the history holding unit 107. FIG.

【図9】シミュレートするターゲットのアプリケーショ
ンソフトの例である。
FIG. 9 shows an example of target application software to be simulated.

【図10】シミュレートするターゲットのアプリケーシ
ョンソフトの例である。
FIG. 10 is an example of target application software to be simulated.

【図11】シミュレートするターゲットのアプリケーシ
ョンソフトの例である。
FIG. 11 is an example of target application software to be simulated.

【図12】シミュレートするターゲットのアプリケーシ
ョンソフトの例である。
FIG. 12 is an example of target application software to be simulated.

【図13】シミュレートするターゲットのアプリケーシ
ョンソフトの例である。
FIG. 13 is an example of target application software to be simulated.

【図14】アプリケーションソフトで使用されている命
令の定義を示す表である。
FIG. 14 is a table showing the definition of an instruction used in application software.

【図15】転送命令を説明するための図である。FIG. 15 is a diagram for explaining a transfer instruction.

【図16】算術演算命令を説明するための図である。FIG. 16 is a diagram for explaining an arithmetic operation instruction.

【図17】比較・ジャンプ命令を説明するための図であ
る。
FIG. 17 is a diagram for explaining a compare / jump instruction.

【図18】メモリ及びレジスタの変更履歴を示す図であ
る。
FIG. 18 is a diagram showing a change history of a memory and a register.

【図19】図18の続きの図である。FIG. 19 is a view illustrating a sequel to FIG. 18;

【図20】メモリ及びレジスタの変更履歴とメモリのア
クセス履歴とを示す図である。
FIG. 20 is a diagram showing a memory and register change history and a memory access history.

【図21】第2の実施例におけるソフトウェアシミュレ
ータ及びソフトウェアシミュレータを取り巻く環境を示
す図である。
FIG. 21 is a diagram showing a software simulator and an environment surrounding the software simulator in the second embodiment.

【図22】ループ短縮命令情報保存部210が保存して
いる内容を示す図である。
FIG. 22 is a diagram showing contents stored in a loop shortening instruction information storage unit 210.

【図23】命令実行部203の制御フローを示す図であ
る。
FIG. 23 is a diagram showing a control flow of the instruction execution unit 203.

【図24】図23の続きの図である。FIG. 24 is a view illustrating a sequel to FIG. 23;

【図25】第3の実施例におけるソフトウェアシミュレ
ータ及びソフトウェアシミュレータを取り巻く環境を示
す図である。
FIG. 25 is a diagram showing a software simulator and an environment surrounding the software simulator in the third embodiment.

【図26】命令実行部303の制御フローを示す図であ
る。
FIG. 26 is a diagram showing a control flow of the instruction execution unit 303.

【図27】図26の続きの図である。FIG. 27 is a view illustrating a sequel to FIG. 26;

【図28】メモリ及びレジスタの変更履歴とメモリのア
クセス履歴とを示す図である。
FIG. 28 is a diagram showing a memory and register change history and a memory access history.

【図29】第4の実施例におけるソフトウェアシミュレ
ータ及びソフトウェアシミュレータを取り巻く環境を示
す図である。
FIG. 29 is a diagram showing a software simulator and an environment surrounding the software simulator in the fourth embodiment.

【図30】命令実行部403の制御フローを示す図であ
る。
FIG. 30 is a diagram showing a control flow of the instruction execution unit 403.

【図31】図30の続きの図である。FIG. 31 is a view illustrating a sequel to FIG. 30;

【図32】メモリ及びレジスタの変更履歴とメモリのア
クセス履歴とを示す図である。
FIG. 32 is a diagram showing a memory and register change history and a memory access history.

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

110 コンピュータ本体 100 ソフトウェアシミュレータ 101 メモリ領域 102 レジスタ領域 103 命令実行部 104 命令列保存部 105 ループ命令テーブル 106 ループ短縮不能命令テーブル 120 ディスク装置 130 キーボード 140 ディスプレイ 200 ソフトウェアシミュレータ 203 命令実行部 210 ループ短縮命令情報保存部 300 ソフトウェアシミュレータ 307 割り込み処理部 308 時間管理部 400 ソフトウェアシミュレータ 403 命令実行部 407 I/O処理部 408 時間管理部 110 computer 100 software simulator 101 memory area 102 register area 103 instruction execution unit 104 instruction string storage unit 105 loop instruction table 106 Loop non-shortening instruction table 120 disk unit 130 keyboard 140 display 200 software simulator 203 instruction execution unit 210 Loop shortening instruction information storage unit 300 software simulator 307 Interrupt processing unit 308 Time Management Department 400 software simulator 403 Command execution unit 407 I / O processing unit 408 hour management department

フロントページの続き (56)参考文献 特開 昭62−194549(JP,A) 特開 昭63−58550(JP,A) 特開 平1−159743(JP,A) 特開 平7−295832(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 11/28 G06F 9/44 G06F 9/455 Continuation of the front page (56) Reference JP 62-194549 (JP, A) JP 63-58550 (JP, A) JP 1-1599743 (JP, A) JP 7-295832 (JP , A) (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 11/28 G06F 9/44 G06F 9/455

Claims (20)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ーゲットとするアプリケーションソフ
トを擬似的に実行するソフトウェアシミュレーション装
置であって、 次に実行される命令のアドレスが以前に実行されたアド
レスであることにより、当該次に実行される命令のアド
レスを先頭アドレスとし、現在のアドレスを終了アドレ
スとする命令列を、前記アプリケーションソフトから検
出する検出手段と、 前記検出手段により検出された命令列を、忠実にシミュ
レーションすることなく短縮して実行することができる
か否かを判定する短縮実行判定手段と、 前記短縮実行判定手段により短縮して実行することがで
きると判定された命令列を短縮して実行することによ
り、忠実にシミュレーションするよりも処理時間を短縮
する短縮実行手段とを備えることを特徴とするソフトウ
ェアシミュレーション装置。
1. A software simulation apparatus for executing an application software in a pseudo manner to data Getto, by the address of the instruction is previously executed address to be executed next is executed to the next A detection unit that detects the instruction sequence having the address of the instruction as the start address and the current address as the end address from the application software, and shortens the instruction sequence detected by the detection unit without faithfully simulating A shortened execution determination means for determining whether or not it can be executed, and an instruction sequence determined to be shortened and executed by the shortened execution determination means are shortened and executed to perform a faithful simulation. And a shortening execution means for shortening the processing time. Simulation apparatus.
【請求項2】 前記ソフトウェアシミュレーション装置
は、さらに、前記命令列を構成する 可能性がある命令を保持してい
令テーブルを備え、 前記検出手段は、現在のアドレスの 命令が命令テーブルに存在し、かつ、
当該命令の次に実行される命令のアドレスが当該命令の
アドレスよりも小さく、更に次に実行される命令のアド
レスは以前に実行されたアドレスであることにより、
命令列を検出することを特徴とする請求項1記載の
ソフトウェアシミュレーション装置
Wherein said software simulation apparatus <br/> further that holds the potential is instructions constituting the instruction sequence
Instruction includes a table, before dangerous out means, the current instruction address is present in the instruction table, and,
By the address of the instruction to be executed next the instruction is smaller than the address of the instruction, a further address the address of the instruction previously executed to be executed next, previous
Software simulation apparatus according to claim 1, characterized in that to detect the serial instruction stream.
【請求項3】 ーゲットとするアプリケーションソフ
トを擬似的に実行するソフトウェアシミュレーション装
置であって、 命令列のなかに存在すると、当該命令列を、忠実にシミ
ュレーションすることなく短縮して実行することができ
なくなる命令を保持している短縮不能命令テーブルと、 判定対象となる命令列を検出する検出手段と、 前記検出手段により検出された命令列のなかに、短縮不
能命令テーブルに保持されている命令が存在するか否か
を判定し、存在しない場合は、当該命令列を、忠実にシ
ミュレーションすることなく短縮して実行することがで
きると判断する短縮実行判定手段と、 前記短縮実行判定手段により短縮して実行することがで
きると判定された命令列を短縮して実行することによ
り、忠実にシミュレーションするよりも処理時間を短縮
する短縮実行手段とを備えることを特徴とするソフトウ
ェアシミュレーション装置。
3. A software simulation apparatus for performing pseudo application software to data Getto, to be present within the instruction sequence, the instruction sequence, to be executed by shortening without faithfully simulate A non-shortenable instruction table that holds instructions that cannot be executed, a detection unit that detects an instruction sequence to be determined, and an instruction that is held in the non-shortenable instruction table among the instruction sequences detected by the detection unit. Whether or not exists, and if it does not exist, the instruction sequence is shortened by the shortening execution determining unit that determines that the instruction sequence can be shortened and executed without faithfully simulating, and shortened by the shortening execution determining unit. Faithfully simulate by shortening and executing the instruction sequence that is determined to be executed And a shortening execution unit that shortens the processing time.
【請求項4】 ーゲットとするアプリケーションソフ
トを擬似的に実行するソフトウェアシミュレーション装
置であって、 命令列のなかに存在すると、当該命令列を、忠実にシミ
ュレーションすることなく短縮して実行することができ
なくなる命令を保持している短縮不能命令テーブルと、 判定対象となる命令列を検出する検出手段と、 前記検出手段により検出された命令列のなかに、短縮不
能命令テーブルに保持されている命令が存在する場合
と、前記検出手段により検出された命令列が再度実行さ
れる際に、前回実行されていない命令を今回実行する場
合と、メモリ又はレジスタの内容が更新される場合であ
って、前回実行されたときのメモリ及びレジスタの内容
の変化と、今回実行されたときの内容の変化とに基づい
て、メモリ及びレジスタの内容の変化が予測できない場
合と、前回、及び、今回のどちらでも実行されていない
命令であって、メモリ又はレジスタの内容を変更する可
能性のある命令が存在する場合とにおいては、当該命令
列を、忠実にシミュレーションすることなく短縮して実
行することができないと判断する短縮実行判定手段と、 前記検出手段により検出され、かつ、前記短縮実行判定
手段により短縮して実行できないと判定されなかった命
令列を、短縮して実行することにより、忠実にシミュレ
ーションするよりも処理時間を短縮する短縮実行手段と
を備えることを特徴とするソフトウェアシミュレーショ
ン装置。
4. A software simulation apparatus for performing pseudo application software to data Getto, to be present within the instruction sequence, the instruction sequence, to be executed by shortening without faithfully simulate A non-shortenable instruction table that holds instructions that cannot be executed, a detection unit that detects an instruction sequence to be determined, and an instruction that is held in the non-shortenable instruction table among the instruction sequences detected by the detection unit. Is present, when the instruction sequence detected by the detection means is executed again, when an instruction not previously executed is executed this time, and when the contents of the memory or the register are updated, Based on the changes in the contents of the memory and registers when it was executed last time and the changes in the contents when this time was executed, If the change in the contents of the register cannot be predicted, or if there is an instruction that has not been executed both last time and this time and that may change the contents of the memory or register, A shortened execution determination unit that determines that the instruction sequence cannot be shortened and executed without faithfully simulating; and the detection unit that is detected and that the shortened execution determination unit determines that the instruction sequence cannot be shortened and executed. A software simulation device, comprising: a shortening execution unit that shortens a processing sequence that is shorter than a faithful simulation by shortening and executing an unsuccessful instruction sequence.
【請求項5】 ーゲットとするアプリケーションソフ
トを擬似的に実行するソフトウェアシミュレーション装
置であって、 メモリの変更された履歴であるメモリ変更履歴と、レジ
スタの変更された履歴であるレジスタ変更履歴と、メモ
リのアクセスされた履歴であるメモリアクセス履歴とを
保持する履歴保持手段と、 前記アプリケーションソフトの中から、短縮して実行す
ることができるループを検出するループ検出手段と、 メモリ又はレジスタの内容が更新される場合に、メモリ
及びレジスタの内容の変化の割合である変化率を算出す
る変化率算出手段と、 前記ループ検出手段により検出された短縮して実行する
ことができるループを抜ける条件を算出し、算出した条
件と、前記履歴保持手段に保持されたメモリ変更履歴と
レジスタ変更履歴とメモリアクセス履歴とに基づいて、
当該ループが終了するまでのループ回数を算出するルー
プ実行回数算出手段と、 前記変化率算出手段により算出された変化率と前記ルー
プ実行回数算出手段により算出されたループ回数とに基
づいて、当該ループがループ回数分実行されたと仮定し
たときのメモリ及びレジスタの内容を予測し、その結果
をメモリ内容保持手段及びレジスタ内容保持手段の内容
に反映させる事により、前記ループ検出手段により検出
されたループを、短縮して実行することにより、忠実に
シミュレーションするよりも処理時間を短縮する短縮実
行手段とを備えることを特徴とするソフトウェアシミュ
レーション装置。
5. A software simulation apparatus for performing pseudo application software to data Getto, a memory change history is altered history memory, and registers the change history is altered history register, A history holding unit that holds a memory access history that is a history of memory access, a loop detection unit that detects a loop that can be executed in a shortened manner from the application software, and a memory or register contents A change rate calculating means for calculating a change rate, which is a rate of change in the contents of the memory and the register when updated, and a condition for exiting a loop which can be executed in a shortened manner detected by the loop detecting means. Then, the calculated condition, the memory change history and the register change held in the history holding means. Based on history and memory access history
Based on the loop execution number calculation means for calculating the number of loops until the loop is terminated, the change rate calculated by the change rate calculation means, and the loop number calculated by the loop execution number calculation means, the loop Is executed for the number of loops, the contents of the memory and the register are predicted, and the result is reflected in the contents of the memory content holding means and the register content holding means to detect the loop detected by the loop detection means. A software simulation device comprising: a shortening execution unit that shortens the processing time by performing the simulation in a shorter time than the faithful simulation.
【請求項6】 前記ソフトウェアシミュレーション装置
は、さら 一度短縮して実行されたループを構成する命令列の、
頭アドレスと終了アドレスと、ループ回数を算出するた
めに必要な情報であるループ回数算出情報とを保存する
ループ情報保存手段と、 前記ループ検出手段によりループ検出されたとき、
出されたループの先頭アドレスと終了アドレスとを、
ープ情報保存手段に保存されている先頭アドレスと終了
アドレスとそれぞれ比較し、一致すれば、同じループを
以前に実行したと判断するループ再実行判断手段とを備
え、 前記ループ実行回数算出手段は、ループ再実行判断手段により同じ ループを以前に実行し
と判断された場合には、ループ回数算出情報を用い
短縮できるループ回数を算出することを特徴とする請求
5に記載のソフトウェアシミュレーション装置
Wherein said software simulation apparatus <br/> is the further, the instruction sequence constituting once for short loop is executed, the start address and the end address, required to calculate the number of loops and loop information storage means for storing the number of loops calculation information is information, when a loop is detected by the loop detecting unit, search
The start address of the issued loop and end address, the head address stored in the loop information storage means the end
Compare each with the address, and if they match, the same loop
A loop re-execution judging means for judging that the loop has been executed before, and the loop execution count calculating means has previously executed the same loop by the loop re-execution judging means.
If it is determined that using the loop count calculation information
Software simulation apparatus according to claim 5, characterized in that to calculate the number of loops that can be shortened.
【請求項7】 前記ソフトウェアシミュレーション装置
は、さら 割り込み動作をシミュレートする割り込み処理手段と、 割り込み動作をシミュレートする時割り込み発生時間
を管理していて、割り込み発生時間になると前記割り込
み処理手段に割り込み動作をシミュレートさせる割り込
み時間管理手段と 割り込み時間管理手段により管理される割り込み発生時
と、1回ループするのに必要な時間とに基づいて
り込みが発生するまでのループ回数を算出する割り込み
発生回数算出手段と、 前記ループ実行回数算出手段により算出されたループ回
数と、前記割り込み発生回数算出手段により算出された
ループ回数とを比較し、少ない方のループ回数を
きるループ回数とする割り込みループ回数決定手段と
を備えことを特徴とする請求項5及び請求項6の何れ
か1項に記載のソフトウェアシミュレーション装置
Wherein said software simulation apparatus <br/> is a further, and the interruption processing means for simulating an interrupt operation, and manages the interrupt occurrence time when simulating an interrupt operation, interrupt generation time and interrupt time managing means for simulating an interrupt operation to the said interrupt processing means, and an interrupt generation time managed by the interrupt time managing means, based on the time required to loop once or interrupted compares the interrupt occurrence count calculating means for calculating a loop times remaining before the loop count calculated by the loop execution frequency calculation unit, and a <br/> loop count calculated by the interrupt occurrence count calculating means, the number of loops of the smaller, shorten
Any claim 5 and claim 6, characterized in that Ru and an interrupt loop number determination means shall be the number of loops that can be
Or software simulation apparatus according to item 1.
【請求項8】 前記ソフトウェアシミュレーション装置
は、さら I/OイベントをシミュレートするI/Oイベント処理
手段と、 I/Oイベントが発生するまでの間を管理していて、
I/Oイベント発生する時間になると前記I/Oイベ
ント処理手段にI/OイベントをシミュレートさせるI
/Oイベント時間管理手段と I/Oイベント時間管理手段により管理されるI/Oイ
ベント発生するまでの時間と、1回ループするのに必
要な時間とに基づいてI/Oイベントが発生するまで
のループ回数を算出するI/Oイベント発生回数算出手
段と、 前記ループ実行回数算出手段により算出されたループ回
数と、前記I/Oイベント発生回数算出手段により算出
されたループ回数とを比較し、少ない方のループ回数
縮できるループ回数とするI/Oループ回数決定
手段とを備えことを特徴とする請求項5及び請求項
の何れか1項に記載のソフトウェアシミュレーション装
Wherein said software simulation apparatus <br/> is a further, and I / O event processing means of simulating I / O events, manages the time until I / O event occurs hand,
I / O event to simulate the I / O event to the I / O event processing means it is time to generate I
/ A O event time management means, time to I / O event occurs that is more manageable to the I / O event time management means,必to loop once
Based on the main time, and I / O event occurrence count calculating means for calculating a loop times remaining before I / O event occurs, the loop number which is calculated by the loop execution frequency calculation unit, the I / Calculated by O event occurrence frequency calculation means
Has been compared with the number of loops, the number of loops lesser claim 5 and claim, characterized in that Ru and an I / O loop number determination means shall be the number of loops that can be shortened 6
Software simulation instrumentation according to any one of
Place
【請求項9】 プログラムで使用されている命令を実行9. Executing instructions used in a program
する命令実行装置であって、An instruction execution device for 前記プログラムを記憶しているプログラム記憶手段と、Program storage means for storing the program, 前記プログラム記憶手段に記憶されているプログラム内In the program stored in the program storage means
における所定の命令列を実行し、当該所定の命令列を前Execute the given instruction sequence in
回実行したときの実行結果の内容の変化の割合である変A change that is the rate of change in the content of the execution result when it is executed twice.
化率に基づいて、当該所定の命令列の実行結果の内容をBased on the conversion rate, the content of the execution result of the predetermined instruction sequence is
予測する実行手段とを備えることを特徴とする命令実行Instruction execution, characterized in that it comprises an executing means for predicting
装置。apparatus.
【請求項10】 前記実行手段は、10. The executing means comprises: 前記変化率に加え前記所定の命令列の実行回数に基づいBased on the number of executions of the predetermined instruction sequence in addition to the rate of change
て、前記所定の命令列が当該回数分実行されたと仮定しAssuming that the predetermined instruction sequence has been executed that number of times,
たときの実行結果の内容を予測する予測手段と、Prediction means for predicting the content of the execution result when 前記予測手段により予測された内容を実行結果とする短A short whose execution result is the content predicted by the prediction means.
縮実行手段とを含むことを特徴とする請求項9に記載の10. The contraction executing means is included.
命令実行装置。Instruction execution unit.
【請求項11】 前記実行手段は、11. The executing means comprises: 前記所定の命令列を再度実行し、前回実行したときの変Re-execute the specified instruction sequence, and change the previous instruction
化率と今回実行したときの変化率とが異なるか否かを判Determine whether the conversion rate and the change rate when executed this time are different.
定し、変化率が異なるときには短縮実行不可能と判定すIf the rate of change is different, it is determined that shortening cannot be performed.
る短縮実行判定手段を含むことを特徴とする請求項9及10. The shortening execution determination means is included.
び10の何れか1項に記載の命令実行装置。11. The instruction execution device according to any one of 1 to 10.
【請求項12】 前記短縮実行判定手段は、さらに、12. The shortening execution determination means further comprises: 前回実行されていない命令を今回実行する場合、及び、If an instruction that was not executed previously is executed this time, and
前回、今回のどちらでも実行されなかった命令であっIt was an instruction that was not executed either last time or this time.
て、実行結果の内容を変更する可能性のある命令が存在And there is an instruction that may change the content of the execution result.
する場合には短縮実行不可能と判定することを特徴とすIf it does, it is determined that it cannot be shortened.
る請求項11に記載の命令実行装置。The instruction execution device according to claim 11, further comprising:
【請求項13】 前記命令実行装置は、さらに、13. The instruction execution device further comprises: 前記所定の命令列を構成する可能性のある命令を保持しHolds instructions that may form the predetermined instruction sequence
ている命令テーブルを備え、Equipped with an instruction table, 前記実行手段は、さらに、The execution means further comprises 実行した命令が前記命令テーブルに存在し、かつその命The executed instruction exists in the instruction table and its life is
令の次に実行される命令のアドレスが、前記実行した命The address of the instruction to be executed after the
令のアドレスよりも小さく、更に前記次に実行される命Is smaller than the address of the command, and is the life to be executed next.
令のアドレスは以前に実行されたアドレスである場合If the address of the decree is an address that was previously executed
に、前記次に実行And then run される命令のアドレスを先頭アドレスStart address
とし、前記実行した命令のアドレスを最終アドレスとすAnd the address of the executed instruction is the final address.
る命令列を前記所定の命令列として検出する検出手段をDetecting means for detecting the instruction sequence as the predetermined instruction sequence
含むことを特徴とする請求項9〜12の何れか1項に記It is included in any one of Claims 9-12 characterized by including.
載の命令実行装置。Instruction execution device.
【請求項14】14. 前記実行手段は、さらに、The execution means further comprises ループを構成する命令列を前記所定の命令列として検出Detect the instruction sequence that forms a loop as the predetermined instruction sequence
する検出手段を含むことを特徴とする請求項9〜12の13. The detecting device according to claim 9, further comprising:
何れか1項に記載の命令実行装置。The instruction execution device according to any one of claims.
【請求項15】 記憶されているプログラムに使用され15. Used for stored programs
ている命令を実行する命令実行方法であって、An instruction execution method for executing an instruction, 前記記憶されているプログラム内における所定の命令列Predetermined instruction sequence in the stored program
を実行し、当該所定の命令列を前回実行したときの実行And the previous execution of the specified instruction sequence
結果の内容の変化の割合である変化率に基づいて、当該Based on the rate of change, which is the rate of change in the content of the result,
所定の命令列の実行結果の内容を予測する実行ステップExecution step for predicting the content of the execution result of a predetermined instruction sequence
を備えることを特徴とする命令実行方法。An instruction execution method comprising:
【請求項16】 前記実行ステップは、16. The executing step comprises: 前記変化率に加え前記所定の命令列の実行回数に基づいBased on the number of executions of the predetermined instruction sequence in addition to the rate of change
て、前記所定の命令列が当該回数分実行されたと仮定しAssuming that the predetermined instruction sequence has been executed that number of times,
たときの実行結果の内容を予測する予測サブステップPrediction substep that predicts the content of the execution result when
と、When, 前記予測サブステップにより予測された内容を実行結果Execution result of the content predicted by the prediction sub-step
とする短縮実行サブステップとを含むことを特徴とするAnd a shortened execution sub-step
請求項15に記載の命令実行方法。The instruction execution method according to claim 15.
【請求項17】 前記実行ステップは、17. The executing step comprises: 前記所定の命令列を再度実行し、前回実行したときの変Re-execute the specified instruction sequence, and change the previous instruction
化率と今回実行したときの変化率とが異なるか否かを判Determine whether the conversion rate and the change rate when executed this time are different.
定し、変化率が異なるときには短縮実行不可能と判定すIf the rate of change is different, it is determined that shortening cannot be performed.
る短縮実行判定サブステップを含むことを特徴とする請A contract characterized by including a shortened execution determination sub-step
求項15及び16の何れか1項に記載の命令実行方法。The instruction execution method according to any one of claim 15 and claim 16.
【請求項18】 前記短縮実行判定サブステップは、さ18. The shortening execution determination sub-step comprises:
らに、In addition, 前回実行されていない命令を今回実行する場合、及び、If an instruction that was not executed previously is executed this time, and
前回、今回のどちらでも実行されなかった命令であっIt was an instruction that was not executed either last time or this time.
て、実行結果の内容を変更する可能性のある命令が存在And there is an instruction that may change the content of the execution result.
する場合には短縮実行不可能と判定することIf it does, it is determined that it cannot be shortened を特徴とすCharacterized by
る請求項17に記載の命令実行方法。18. The instruction execution method according to claim 17, wherein
【請求項19】 前記実行ステップは、さらに、19. The executing step further comprises: 実行した命令が、前記所定の命令列を構成する可能性のIt is possible that the executed instructions may form the predetermined instruction sequence.
ある命令を保持している命令テーブルに存在し、かつそIt exists in the instruction table that holds an instruction and
の命令の次に実行される命令のアドレスが、前記実行しThe address of the instruction to be executed next to
た命令のアドレスよりも小さく、更に前記次に実行されLess than the address of the instruction
る命令のアドレスは以前に実行されたアドレスである場If the address of the instruction to be executed is the previously executed address,
合に、前記次に実行される命令のアドレスを先頭アドレIf the address of the next instruction to be executed is
スとし、前記実行した命令のアドレスを最終アドレスとThe address of the executed instruction as the final address
する命令列を前記所定の命令列として検出する検出サブTo detect the instruction sequence to be executed as the predetermined instruction sequence
ステップを含むことを特徴とする請求項15〜18の何What is claimed in claims 15-18, characterized in that it comprises steps.
れか1項に記載の命令実行方法。The instruction execution method according to item 1.
【請求項20】20. 前記実行ステップは、さらに、The execution step further includes ループを構成する命令列を前記所定の命令列として検出Detect the instruction sequence that forms a loop as the predetermined instruction sequence
する検出サブステップを含むことを特徴とする請求項12. A sub-step of detecting is included.
5〜18の何れか1項に記載の命令実行方法。The instruction execution method according to any one of 5 to 18.
JP20558894A 1994-08-30 1994-08-30 Software simulator Expired - Fee Related JP3362972B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20558894A JP3362972B2 (en) 1994-08-30 1994-08-30 Software simulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20558894A JP3362972B2 (en) 1994-08-30 1994-08-30 Software simulator

Publications (2)

Publication Number Publication Date
JPH0869392A JPH0869392A (en) 1996-03-12
JP3362972B2 true JP3362972B2 (en) 2003-01-07

Family

ID=16509373

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20558894A Expired - Fee Related JP3362972B2 (en) 1994-08-30 1994-08-30 Software simulator

Country Status (1)

Country Link
JP (1) JP3362972B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4243463B2 (en) 2002-08-19 2009-03-25 株式会社半導体理工学研究センター Instruction scheduling simulation method and simulation system
JP5412900B2 (en) * 2009-03-16 2014-02-12 株式会社リコー Embedded program simulator and simulation method
JP5602599B2 (en) * 2010-11-30 2014-10-08 インターナショナル・ビジネス・マシーンズ・コーポレーション Loop detection device, loop detection method, and loop detection program

Also Published As

Publication number Publication date
JPH0869392A (en) 1996-03-12

Similar Documents

Publication Publication Date Title
US5729554A (en) Speculative execution of test patterns in a random test generator
US6052524A (en) System and method for simulation of integrated hardware and software components
US7139936B2 (en) Method and apparatus for verifying the correctness of a processor behavioral model
US6983234B1 (en) System and method for validating processor performance and functionality
US6212493B1 (en) Profile directed simulation used to target time-critical crossproducts during random vector testing
JPH1196130A (en) Multi-processing system performance evaluation method and apparatus, and storage medium storing multi-processing system performance evaluation program
JP3373607B2 (en) Method and apparatus for automatically generating instruction sequence for verifying control mechanism of processor
EP2335170A1 (en) Simulated processor execution using branch override
CN106933727B (en) Verification method and verification device of processor interrupt mechanism
US20240061984A1 (en) A method for an automatic design and verification of a processor&#39;s programming and verification tools
JP3362972B2 (en) Software simulator
JP2001209411A (en) PLC simulator
US20030070117A1 (en) Simulation apparatus and simulation method
CN119201695B (en) Instruction verification method, device, electronic device and storage medium
CN103678114A (en) Apparatus and method for generating assertion, and apparatus and method for verifying processor
US20020078422A1 (en) VLSI layout design jobs scheduling method
JP3147851B2 (en) Simulation method, simulation device, and storage medium storing simulation program
JPS6022772B2 (en) Simulated failure control method
Große et al. Simulation-based equivalence checking between SystemC models at different levels of abstraction
Bose Performance test case generation for microprocessors
CN109753308A (en) Verify system and instruction path monitoring method in instruction path
JPH07253909A (en) Microprogram verification method
US20250284604A1 (en) Technique for generating tests for a processing device
EP4575876A1 (en) A method for an automatic design and verification of a processor&#39;s programming and simulation tools
JP3396365B2 (en) Method and apparatus for automatically generating an input sequence for simulation-based logic verification, and method and apparatus for outputting a state set time series for generating the input sequence for logic verification

Legal Events

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