JP3214459B2 - Simulation method and apparatus - Google Patents

Simulation method and apparatus

Info

Publication number
JP3214459B2
JP3214459B2 JP29335198A JP29335198A JP3214459B2 JP 3214459 B2 JP3214459 B2 JP 3214459B2 JP 29335198 A JP29335198 A JP 29335198A JP 29335198 A JP29335198 A JP 29335198A JP 3214459 B2 JP3214459 B2 JP 3214459B2
Authority
JP
Japan
Prior art keywords
program
target
host
execution time
cpu
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
JP29335198A
Other languages
Japanese (ja)
Other versions
JP2000122898A (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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP29335198A priority Critical patent/JP3214459B2/en
Publication of JP2000122898A publication Critical patent/JP2000122898A/en
Application granted granted Critical
Publication of JP3214459B2 publication Critical patent/JP3214459B2/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]

【発明の属する技術分野】本発明は、シミュレーション
方法及び装置に関し、特に、ターゲットシステム(以
後、ターゲットと略称する)とホストシステム(以後、
ホストと略称する)が異なった種類の中央処理装置(C
PU)からなるクロス開発環境におけるシミュレーショ
ン方法及び装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a simulation method and apparatus, and more particularly, to a target system (hereinafter abbreviated as a target) and a host system (hereinafter abbreviated as a target).
A central processing unit (C) of a different type
PU) in a cross development environment.

【0002】[0002]

【従来の技術】従来、開発対象であるターゲットとホス
トが異なった種類の中央処理装置(CPU)からなるク
ロス開発環境において、ターゲットの動作をシミュレー
ションするシミュレーション方法が知られている。
2. Description of the Related Art Conventionally, there is known a simulation method for simulating the operation of a target in a cross development environment in which a target to be developed and a host are composed of different types of central processing units (CPUs).

【0003】このように、ターゲットとホストのCPU
が異なる場合、ホスト上でターゲット用のオブジェクト
プログラムを動かすには、2つの方法が用いられる。第
1の方法は、ターゲットを構成するCPU(以下、ター
ゲットCPUと略称する)と同等な処理を行うソフトウ
ェアに、オブジェクトプログラムを読み込ませて処理を
行うものであり、第2の方法は、ターゲット用オブジェ
クトプログラムをホスト用オブジェクトプログラムに変
換して、動作させるものである。
As described above, the target and the host CPU
Are different, two methods are used to run the target object program on the host. The first method is to read the object program into software that performs the same processing as a CPU (hereinafter, abbreviated as a target CPU) that configures the target, and to perform the processing. The object program is converted into a host object program and operated.

【0004】第1の方法においては、クロック単位でタ
ーゲットCPUの状態(レジスタ、パイプライン、キャ
ッシュメモリ等の状態)のシミュレーションを行うこと
により、プログラムの実行時間をクロック単位で求める
ことができる。ところが、クロック単位でのCPUの状
態をソフトウェアで管理しているため、その実行に必要
な時間は、実際にターゲットCPUで処理を行う場合の
100倍〜1000倍以上となってしまう。
In the first method, a program execution time can be obtained in clock units by simulating the state of the target CPU (states of registers, pipelines, cache memories, etc.) in clock units. However, since the state of the CPU in clock units is managed by software, the time required for the execution is 100 to 1000 times or more as long as the processing is actually performed by the target CPU.

【0005】このように、シミュレーションに大変な時
間がかかることは、プログラム開発者にとって大きな負
担となるばかりでなく、開発コストの増大化をもたら
す。
[0005] As described above, the fact that a long time is required for the simulation not only imposes a great burden on a program developer, but also increases the development cost.

【0006】これに対し、第2の方法においては、ホス
トCPUによって直接プログラムが実行されるため、基
本的には高速に処理を完了することができる。この第2
の方法による従来のシミュレーション方法を以下に説明
する。
On the other hand, in the second method, since the program is directly executed by the host CPU, the processing can be basically completed at a high speed. This second
A conventional simulation method according to the above method will be described below.

【0007】図3は、従来のシミュレーション方法によ
るシミュレーションの流れを示す説明図である。図3に
示すように、先ず、ターゲット用プログラムAを、ター
ゲット/ホスト変換により、ホストコンピュータ用プロ
グラムBに変換する。つまり、プログラムAがターゲッ
ト用だとそのプログラムAをホストで実行することがで
きないので、ホストで実行することができるように、例
えば命令を変更してホスト用プログラムBとする。
FIG. 3 is an explanatory diagram showing a flow of a simulation by a conventional simulation method. As shown in FIG. 3, first, the target program A is converted into a host computer program B by target / host conversion. That is, if the program A is for the target, the program A cannot be executed on the host, so that the instruction is changed to the host program B so that the program A can be executed on the host.

【0008】次に、変換されたプログラムBをホストコ
ンピュータで実行し、ホスト実行時間bを求める。この
ホスト実行時間bに基づき、ターゲットコンピュータと
ホストコンピュータに関する一般的な性能比であるター
ゲット/ホスト性能比を参照してターゲット実行時間の
見積もりを行い、ターゲット実行時間見積もりaを得
る。
Next, the converted program B is executed by a host computer, and a host execution time b is obtained. Based on the host execution time b, a target execution time is estimated by referring to a target / host performance ratio which is a general performance ratio between the target computer and the host computer, and a target execution time estimate a is obtained.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、このシ
ミュレーション方法の場合、プログラム実行時間の正確
な見積もりを求めることができなかった。即ち、ターゲ
ットCPU上の各命令は、パイプラインやキャッシュメ
モリ等の状態によって実行時間が変化してしまうのに加
え、どの箇所をどの位の回数実行するかが分からないた
め、予め実行時間を求めることが困難である。また、タ
ーゲット用オブジェクトプログラムと変換されたホスト
用オブジェクトプログラムの各命令毎の性能比にはばら
つきがあるため、ターゲットCPUとホストCPUのス
ペック上の性能比から単純に実行時間を推測することが
できない。
However, in the case of this simulation method, it has not been possible to obtain an accurate estimate of the program execution time. That is, since the execution time of each instruction on the target CPU changes depending on the state of the pipeline, the cache memory, and the like, and it is not known which part is executed and how many times, the execution time is obtained in advance. It is difficult. In addition, since the performance ratio of each instruction of the target object program and the converted host object program varies, the execution time cannot be simply estimated from the specification performance ratio of the target CPU and the host CPU. .

【0010】この性能比のばらつきは、以下の理由によ
る。先ず、ホストに対する命令とターゲットに対する命
令が対応していたとしても、これらの命令の実行時間比
が全ての命令において同じとは限らない。次に、ホスト
上にターゲットに対する命令に相当する命令が無い場
合、ターゲットCPUの命令をシミュレートする複数の
ホストCPUの命令からなるルーチンを呼び出さなけれ
ばならないことから、命令が、単純に変換できるものの
場合とシミュレーションルーチンを呼び出す必要がある
ものの場合とで、性能比が大きく変わる。更に、メモリ
構成の違いからアドレスを変換する処理が挿入されるこ
とがあり、変換処理が入るか否かで性能比が大きく変わ
ってしまう。
This variation in the performance ratio is due to the following reasons. First, even if instructions for the host correspond to instructions for the target, the execution time ratio of these instructions is not necessarily the same for all instructions. Next, when there is no instruction corresponding to the instruction for the target on the host, a routine consisting of a plurality of instructions of the host CPU that simulates the instruction of the target CPU must be called. The performance ratio greatly changes between the case and the case where the simulation routine needs to be called. Furthermore, processing for converting addresses may be inserted due to differences in memory configuration, and the performance ratio greatly changes depending on whether or not the conversion processing is performed.

【0011】つまり、ターゲットコンピュータとホスト
コンピュータでは、得意な処理と不得意な処理が一致せ
ず、この得意或いは不得意の割合は各プログラムによっ
ても異なるため、ターゲット/ホスト性能比を一定の値
として表すことができ難い。また、一般的な得意或いは
不得意の割合とプログラム毎の得意或いは不得意の割合
との差が、性能比の精度を下げてしまう。
That is, in the target computer and the host computer, the special processing and the poor processing do not match, and the ratio of the special or poor processing differs depending on each program. Therefore, the target / host performance ratio is set to a constant value. Difficult to represent. In addition, the difference between the ratio of general strength or weakness and the rate of strength or weakness for each program lowers the accuracy of the performance ratio.

【0012】従って、上述した従来のシミュレーション
方法により得られたターゲット実行時間見積もりaは、
ターゲット用プログラムAとは無関係な、コンピュータ
に関する一般的な性能比であるターゲット/ホスト性能
比を利用して得られたものであり、見積もり精度が悪く
なるのが避けられなかった。
Therefore, the target execution time estimate a obtained by the above-mentioned conventional simulation method is
This is obtained by using a target / host performance ratio, which is a general performance ratio of a computer, which is irrelevant to the target program A, and it is inevitable that the estimation accuracy deteriorates.

【0013】なお、このようなシミュレーション方法に
ついては、本出願人による特願平10−081010号
の出願明細書にも開示されている。
Such a simulation method is also disclosed in the specification of Japanese Patent Application No. 10-081010 filed by the present applicant.

【0014】本発明の目的は、開発対象であるターゲッ
トが存在しないクロス開発環境において、ターゲットプ
ログラムの特性を正確に捉えたターゲット実行時間の見
積もりを得ることができるシミュレーション方法及び装
置を提供することである。
An object of the present invention is to provide a simulation method and apparatus capable of obtaining a target execution time estimation that accurately captures the characteristics of a target program in a cross development environment in which there is no target to be developed. is there.

【0015】[0015]

【課題を解決するための手段】上記目的を達成するた
め、本発明に係るシミュレーション方法は、ターゲット
命令からなる第1のプログラムをホスト命令からなる第
2のプログラムに変換し、前記第2のプログラムをホス
トCPUで実行して前記第2のプログラムのホスト実行
時間を求め、ターゲットCPUのハードウェアで処理す
るのと同等の処理を行うソフトウェアを用いてターゲッ
ト命令からなる前記第1のプログラムをホストCPUに
よりシミュレーションして得られるターゲットCPU上
のクロック数から前記第1のプログラムをターゲットC
PUにより実行する場合のターゲット実行時間を求め、
両実行時間からターゲット/ホスト性能比を求める処理
と、ターゲット命令からなる被測定プログラムをホスト
命令からなる第3のプログラムに変換し、前記第3のプ
ログラムをホストCPUで実行して前記第3のプログラ
ムの実行時間を求め、前記第3のプログラムの実行時間
と前記ターゲット/ホスト性能比に基づき、前記被測定
プログラムを前記ターゲットで実行した場合のターゲッ
ト実行時間見積もりを求める処理とを有することを特徴
としている。
In order to achieve the above object, a simulation method according to the present invention provides a simulation method in which a first program composed of a target instruction is converted to a first program composed of a host instruction .
Into a second program, the second program running on the host CPU obtains the host execution time of the second program, using software for performing processing that is equivalent to processing by the target CPU hardware From the number of clocks on the target CPU obtained by simulating the first program consisting of target instructions by the host CPU, the first program
Find the target execution time when executing by PU,
Processing to determine the target / host performance ratio from both execution times and host program to be measured consisting of target instructions
The program is converted into a third program comprising instructions, and the third program
The program is executed by the host CPU to execute the third program.
Obtains the execution time of arm, the third program execution time and the on the basis of the target / host performance ratio, characterized by having a process of obtaining the target execution time estimate when the measured program executed by the target And

【0016】上記構成を有することにより、ターゲット
命令からなる第1のプログラムをホスト命令からなる第
2のプログラムに変換し、前記第2のプログラムをホス
トCPUで実行して求めた前記第2のプログラムのホス
ト実行時間、ターゲットCPUのハードウェアで処理
するのと同等の処理を行うソフトウェアを用いてターゲ
ット命令からなる前記第1のプログラムをホストCPU
によりシミュレーションして得られるターゲットCPU
上のクロック数から求めた前記第1のプログラムをター
ゲットCPUにより実行する場合のターゲット実行時
ターゲット/ホスト性能比を求め、ターゲット命
令からなる被測定プログラムをホスト命令からなる第3
のプログラムに変換し、前記第3のプログラムをホスト
CPUで実行して求めた前記第3のプログラムの実行時
間と、前記ターゲット/ホスト性能比に基づき、前記
測定プログラムを前記ターゲットで実行した場合のター
ゲット実行時間見積もりが求められる。これにより、開
発対象であるターゲットが存在しないクロス開発環境に
おいて、ターゲットプログラムの特性を正確に捉えた、
ターゲット実行時間の見積もりを短い時間で得ることが
できる。
[0016] With the above configuration, the first program consisting of the target instruction can be replaced by the first program consisting of the host instruction .
Into a second program, using the host execution time of the second program of the second program was determined by running on the host CPU, a software for performing processing that is equivalent to processing by the target CPU hardware The first program comprising the target instruction by the host CPU
CPU obtained by simulation
During target runtime when executing the first program determined from the number of clocks on the target CPU
Pressurized et al., Asked the target / host performance ratio, the target life
Third comprising the measurement program of decree host instruction
And converts the third program into a host
At the time of execution of the third program obtained by execution by the CPU
And while, on the basis of the target / host performance ratio, the a target execution time estimate when the measured program executed by the target are determined. As a result, in a cross development environment where there is no target to be developed, the characteristics of the target program can be accurately captured.
An estimate of the target execution time can be obtained in a short time.

【0017】また、本発明に係るシミュレーション装置
により、上記シミュレーション方法を実現することがで
きる。
Further, the above simulation method can be realized by the simulation device according to the present invention.

【0018】[0018]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面を参照して説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0019】図1は、本発明の実施の形態に係るシミュ
レーション装置を示すブロック図である。図1に示すよ
うに、シミュレーション装置10は、ホストを構成する
ホストCPU11と、ホストメモリ12とを有し、ホス
トメモリ12には、シミュレーションプログラム13が
格納される。
FIG. 1 is a block diagram showing a simulation apparatus according to an embodiment of the present invention. As shown in FIG. 1, the simulation apparatus 10 has a host CPU 11 constituting a host, and a host memory 12, and a simulation program 13 is stored in the host memory 12.

【0020】このシミュレーション装置10により、開
発対象であるターゲットとホストが異なった種類の中央
処理装置(CPU)からなるクロス開発環境において、
ターゲットが存在しない場合であっても、ターゲット用
のプログラムAに基づいてターゲットの動作をシミュレ
ーションすることができる。
With this simulation apparatus 10, in a cross development environment in which a target to be developed and a host are composed of different types of central processing units (CPUs),
Even when the target does not exist, the operation of the target can be simulated based on the program A for the target.

【0021】シミュレーションプログラム13の実行に
より、ホストメモリ12には、ターゲット実行ルーチン
14、状態変更(デバッガ)ルーチン15、レジスタ情
報16、パイプライン情報17、キャッシュメモリ情報
18、及びターゲットメモリ情報19の各領域が確保さ
れる。
By executing the simulation program 13, each of the target execution routine 14, the state change (debugger) routine 15, the register information 16, the pipeline information 17, the cache memory information 18, and the target memory information 19 is stored in the host memory 12. An area is reserved.

【0022】ターゲット実行ルーチン14は、現在のタ
ーゲットの状態から次のクロックでのターゲットの状態
(レジスタ情報、パイプライン情報、キャッシュメモリ
情報、ターゲットメモリ情報等の状態)を作り出すプロ
グラムからなり、ターゲット実行が何回行われたかで、
ターゲット実行に要するクロック数が分かる。即ち、ク
ロック単位でターゲットCPUの状態のシミュレーショ
ンを行うことにより、プログラムの実行時間をクロック
単位で求めることができる。
The target execution routine 14 is a program for creating a target state (register information, pipeline information, cache memory information, target memory information, etc.) at the next clock from the current target state. The number of times
The number of clocks required for target execution can be found. That is, by simulating the state of the target CPU in clock units, the execution time of the program can be obtained in clock units.

【0023】このターゲット実行により、パイプライン
上にある各命令に基づいてレジスタやターゲットメモリ
/キャッシュメモリが更新され、パイプラインが新しい
命令を実行することが可能ならターゲットメモリから新
しい命令が読み込まれる。読み込みの際は、キャッシュ
メモリが更新される。最後に、次のパイプラインの状態
を作り出す。
With this target execution, the register and the target memory / cache memory are updated based on each instruction on the pipeline, and a new instruction is read from the target memory if the pipeline can execute a new instruction. When reading, the cache memory is updated. Finally, create the next pipeline state.

【0024】状態変更(デバッガ)ルーチン15は、タ
ーゲット状態をユーザが操作するためのプログラムから
なり、これによってユーザは、デバッグ作業においてタ
ーゲットの状態を変更したり、ターゲット用のプログラ
ム実行のためにターゲット状態の各要素を初期化するこ
とができる。この初期化には、ターゲットメモリに実行
対象となるプログラムを置く作業も含まれる。
The state change (debugger) routine 15 is composed of a program for the user to manipulate the target state, so that the user can change the state of the target in a debugging operation or execute the target program for executing the target program. Each element of the state can be initialized. This initialization includes the operation of placing the program to be executed in the target memory.

【0025】レジスタ情報16は、シミュレートするタ
ーゲットCPUが持っているレジスタに収められる値を
保存する場所であり、パイプライン情報17は、シミュ
レートするターゲットCPUが処理を行っているパイプ
ラインの途中経過を保存する場所である。パイプライン
による並列処理をシミュレートするには、パイプライン
内にある処理が滞りなく行える状態か否かの状態把握が
必要となる。
The register information 16 is a place for storing a value stored in a register of the target CPU to be simulated, and the pipeline information 17 is a part of the pipeline in which the target CPU to be simulated is processing. This is where you save your progress. In order to simulate the parallel processing by the pipeline, it is necessary to know whether the processing in the pipeline can be performed without delay.

【0026】キャッシュメモリ情報18は、シミュレー
トするターゲットCPUに備えられ、若しくはこのター
ゲットCPUにつながれているキャッシュメモリが持っ
ている、どこの位置のメモリをキャッシュしているか等
の情報を、保存する場所である。
The cache memory information 18 is provided for the target CPU to be simulated, or stores information such as the location of the memory cached in the cache memory connected to the target CPU. Location.

【0027】キャッシュメモリには、CPUが新たに読
み込んだデータが同時に書き込まれ、CPUが次にデー
タを読み込むとき、キャッシュメモリに必要なデータが
あれば、キャッシュメモリから読み込む。これにより、
メインメモリにアクセスする回数が減る。つまり、キャ
ッシュメモリに、そのときに必要な情報が入っていれば
処理が速いが、入っていないと遅いメモリにアクセスし
て一旦待たなければならず処理が遅くなるので、実行時
間を見積もるときに必要なデータが何処に入っているの
かを記録する必要がある。
Data newly read by the CPU is simultaneously written into the cache memory, and when the CPU next reads data, if there is necessary data in the cache memory, the data is read from the cache memory. This allows
The number of accesses to the main memory is reduced. In other words, if the necessary information is stored in the cache memory at that time, the process is fast, but if it is not, the slow memory must be accessed and temporarily waited, so the process becomes slow, so when estimating the execution time It is necessary to record where necessary data is stored.

【0028】ターゲットメモリ情報19は、シミュレー
トするターゲットCPUに備えられ、若しくはこのター
ゲットCPUにつながれているメモリに保存される内容
を、保存する場所である。実行時間見積もりの対象とな
るプログラムは、ここに置かれる。
The target memory information 19 is a place where the contents stored in the target CPU to be simulated or stored in the memory connected to the target CPU are stored. The program whose execution time is to be estimated is placed here.

【0029】図2は、図1のシミュレーション装置を用
いたシミュレーションの流れを示す説明図である。図2
に示すように、先ず、ターゲット用のプログラムAか
ら、ホスト実行によるホスト実行時間b及びシミュレー
ションによるターゲット実行時間aを求めて、ターゲッ
ト/ホスト性能比を得る。次に、シミュレーション目的
のプログラムA´に基づき、ターゲット/ホスト性能比
を参照してターゲット実行時間を見積もり、ターゲット
実行時間見積もりa´を得る。
FIG. 2 is an explanatory diagram showing a flow of a simulation using the simulation apparatus of FIG. FIG.
As shown in (1), first, a host execution time b by host execution and a target execution time a by simulation are obtained from the target program A to obtain a target / host performance ratio. Next, based on the simulation purpose program A ', the target execution time is estimated with reference to the target / host performance ratio to obtain a target execution time estimate a'.

【0030】ホスト実行によるホスト実行時間bは、タ
ーゲット用のプログラムAから、ターゲット/ホスト変
換処理によりホスト用のプログラムBを求めた後、この
ホスト用のプログラムBをホストで実行することによ
り、即ち、ターゲット命令をホスト命令に変換してシミ
ュレーションを行うことにより得られる。
The host execution time b due to execution of the host is obtained by obtaining the host program B from the target program A by the target / host conversion process, and then executing the host program B on the host. , By converting a target instruction into a host instruction and performing a simulation.

【0031】このシミュレーションによるターゲット実
行時間の見積もりは、ターゲットレス環境で行われる
が、プログラムがターゲット用だとそのプログラムをホ
ストで実行することができないので、ホストで実行する
ことができるように、例えば命令を変更してホスト用の
プログラムBを作成する。
The estimation of the target execution time by this simulation is performed in a targetless environment. However, if the program is for a target, the program cannot be executed by the host. The host program B is created by changing the instruction.

【0032】シミュレーションによるターゲット実行時
間aは、ターゲット用のプログラムAから、ターゲット
動作のシミュレーションにより、即ち、ターゲットのハ
ードウェアで処理するのと同等の処理を行うソフトウェ
アでターゲット命令をシミュレーションして、得られ
る。シミュレーションに際し、ターゲット用のプログラ
ムAは、シミュレーション装置10のターゲットメモリ
情報19に読み込まれ、ターゲット実行ルーチン14に
より実行されてクロック数が得られ、このクロック数と
設計で決められるクロック周期により実行時間を求める
ことができる。
The target execution time a by the simulation is obtained from the target program A by simulating the target operation, that is, by simulating the target instruction with software that performs the same processing as that performed by the target hardware. Can be At the time of the simulation, the target program A is read into the target memory information 19 of the simulation apparatus 10 and executed by the target execution routine 14 to obtain the number of clocks. The execution time is determined by the number of clocks and the clock cycle determined by design. You can ask.

【0033】即ち、1回だけターゲットの動作状態を含
めたシミュレーションを行うことにより、プログラムA
に対する正確なターゲット実行時間aが求められる。
That is, by executing a simulation including the operation state of the target only once, the program A
, An accurate target execution time a is obtained.

【0034】このターゲット実行時間aとホスト実行時
間bの2つの実行時間から、ターゲットとホストの性能
比を求める。この性能比は、プログラムに組み込まれた
各種命令単体の比ではなくプログラム全体の比を求め、
このプログラムにおけるホストに対するターゲットの正
確な性能比を求めることができる。
From the two execution times, the target execution time a and the host execution time b, the performance ratio between the target and the host is determined. This performance ratio is not the ratio of various instructions alone incorporated in the program, but the ratio of the entire program.
The exact performance ratio of the target to the host in this program can be determined.

【0035】シミュレーション目的のプログラム(被測
定プログラム)A´は、ユーザ所望の仕様による未完成
のターゲットシステムに合わせ、プログラムA(作成元
プログラム)に改造・修正等を加えて作成される。この
シミュレーション目的のプログラムA´から、ターゲッ
ト/ホスト変換処理によりホスト用のプログラムB´を
作成した後、ホスト用のプログラムB´をホストで実行
し、ホスト実行時間(被測定プログラム実行時間)b´
を求める。
The program A 'for simulation (program to be measured) A' is created by modifying or modifying the program A (creation source program) in accordance with an unfinished target system according to the specifications desired by the user. After creating a host program B 'from the simulation purpose program A' by target / host conversion processing, the host program B 'is executed on the host, and the host execution time (measured program execution time) b'
Ask for.

【0036】このホスト実行時間b´に基づき、先に求
めたターゲット/ホスト性能比を参照してターゲット実
行時間の見積もりを行い、ターゲット実行時間見積もり
a´を得る。
Based on the host execution time b ', the target execution time is estimated by referring to the target / host performance ratio obtained previously, and the target execution time estimate a' is obtained.

【0037】従って、シミュレーションにより正確なク
ロック数が求まり、このクロック数によりプログラムA
の特性におけるターゲット/ホスト性能比が正確に分か
ることから、プログラムAを一部修正したプログラムA
´についてのプログラム実行時間を、より正確に見積も
ることができる。
Therefore, the exact number of clocks is obtained by simulation, and the program A
Program A partially modified from Program A because the target / host performance ratio in the characteristics of
'Can be more accurately estimated.

【0038】このように、本発明によれば、ターゲット
不在のクロス開発環境において、ターゲット/ホスト性
能比を1回測定しておきホストでプログラムAを実行し
ただけで、プログラムB´のホスト実行時間b´とター
ゲット/ホスト性能比から、プログラムAを改造・修正
したプログラムA´のターゲット実行時間a´を高速且
つ高精度で見積もることができる。
As described above, according to the present invention, in the cross development environment where no target is present, the target / host performance ratio is measured once and the host executes the program A only by executing the program A. From b 'and the target / host performance ratio, the target execution time a' of the program A 'obtained by remodeling or modifying the program A can be estimated at high speed and with high accuracy.

【0039】つまり、プログラムA´をターゲット/ホ
スト変換して求めたプログラムB´については、ホスト
コンピュータ上で直接実行し処理結果を得るので、実行
時間がごく短い。加えて、ターゲット/ホスト性能比
は、命令単体の比ではなくプログラム全体の比になって
いることから、従来のように命令単体で性能比を求めて
いた場合に比べ、プログラムの流れを把握したより正確
な性能比に基づいて、ターゲット実行時間a´を正確に
見積もることができる。
In other words, the execution time of the program B 'obtained by subjecting the program A' to target / host conversion is very short because it is directly executed on the host computer to obtain the processing result. In addition, since the target / host performance ratio is not the ratio of the instruction itself but the ratio of the entire program, the flow of the program was grasped compared to the case where the performance ratio was obtained by the instruction alone as in the past. Based on the more accurate performance ratio, the target execution time a 'can be accurately estimated.

【0040】この結果、実行時間短縮等のプログラム調
整を行う際に、必要な調整の程度及び調整後の効果が明
らかになって、工数の減縮が可能になる。
As a result, when performing program adjustment such as execution time reduction, the degree of necessary adjustment and the effect after adjustment become clear, and the man-hour can be reduced.

【0041】即ち、プログラム全体における実行時間が
正確に分からないままプログラムの実行時間を短くしよ
うとすれば、どれだけ調整すれば良いのか、その調整が
初期仕様に基づきどこまで可能か或いは不可能なのかの
見当が付かず、調整結果を個々に確かめながら行わなけ
ればならないので、調整工数がかかり非常に大変であ
る。しかしながら、実行時間を正確に見積もることによ
って必要な調整の程度及び調整後の効果を明らかにする
ことができる。
That is, if an attempt is made to shorten the execution time of a program without knowing the execution time of the entire program accurately, how much should be adjusted, and how much adjustment is possible or impossible based on the initial specifications. Since it is necessary to check the adjustment results individually without performing any adjustments, the adjustment man-hours are very long. However, by accurately estimating the execution time, it is possible to clarify the degree of adjustment required and the effect after adjustment.

【0042】また、ターゲット時間をシミュレーション
するのは、例えば1千倍の時間がかかるというように大
変な労力を要し、開発者にとって大きな負担となると共
に開発コストの増大を招くが、上述したように、正確さ
を得るために1回だけは実際の測定を行い、その結果に
基づいて以後のプログラム修正に対する正確な実行時間
の見積もりを得ることで、開発者の負担を軽減すると共
に開発コストを削減することができる。
Also, simulating the target time requires a great deal of labor, for example, it takes 1000 times longer, and places a great burden on the developer and increases the development cost. In addition, in order to obtain accuracy, the actual measurement is performed only once, and based on the result, an accurate estimation of the execution time for the subsequent program correction is obtained, thereby reducing the burden on the developer and reducing the development cost. Can be reduced.

【0043】なお、図1のターゲット実行ルーチンと各
種情報を、ターゲットCPUの電子(論理)回路をシミ
ュレーションする電子(論理)回路シミュレータを用い
た電子回路シミュレーション/論理回路シミュレーショ
ン及びその組み合わせに、一部或いは全体を置き換える
ことができる。例えば、ターゲット実行ルーチンの次の
クロックのパイプライン情報を作る部分とパイプライン
情報を、パイプライン及びそれを構成する演算器等の回
路をシミュレーションする電子(論理)回路シミュレー
タで置き換えることができる。
The target execution routine and various information shown in FIG. 1 are partially used in an electronic circuit simulation / logic circuit simulation using an electronic (logical) circuit simulator for simulating an electronic (logical) circuit of the target CPU, and a combination thereof. Alternatively, the whole can be replaced. For example, the part of the target execution routine that creates pipeline information for the next clock and the pipeline information can be replaced with an electronic (logic) circuit simulator that simulates the pipeline and circuits such as arithmetic units that constitute the pipeline.

【0044】[0044]

【発明の効果】以上説明したように、本発明によれば、
ターゲット命令からなる第1のプログラムをホスト命令
からなる第2のプログラムに変換し、前記第2のプログ
ラムをホストCPUで実行して求めた前記第2のプログ
ラムのホスト実行時間、ターゲットCPUのハードウ
ェアで処理するのと同等の処理を行うソフトウェアを用
いてターゲット命令からなる前記第1のプログラムをホ
ストCPUによりシミュレーションして得られるターゲ
ットCPU上のクロック数から求めた前記第1のプログ
ラムをターゲットCPUにより実行する場合のターゲッ
ト実行時間かターゲット/ホスト性能比を求め、タ
ーゲット命令からなる被測定プログラムをホスト命令か
らなる第3のプログラムに変換し、前記第3のプログラ
ムをホストCPUで実行して求めた前記第3のプログラ
ムの実行時間と、前記ターゲット/ホスト性能比に基づ
き、前記被測定プログラムを前記ターゲットで実行した
場合のターゲット実行時間見積もりが求められるので、
開発対象であるターゲットが存在しないクロス開発環境
において、ターゲットプログラムの特性を正確に捉え
た、ターゲット実行時間の見積もりを短い時間で得るこ
とができる。
As described above, according to the present invention,
Host program to execute a first program consisting of target instructions
Into a second program of, performing a host execution time of the second program found, the same processing as for processing in the target CPU hardware to execute the second program in the host CPU target run time or during et when the first program determined from the number of clocks on the obtained target CPU the first program of target instructions by simulating by the host CPU to execute the target CPU using software obtains the target / host performance ratio, data
Target program consisting of target instruction is a host instruction
Into a third program, and the third program
The third program obtained by executing the program on the host CPU.
And execution time of the beam, on the basis of the target / host performance ratio, the so target execution time estimate when the measured program executed by the target are determined,
In a cross-development environment in which there is no target to be developed, it is possible to obtain a target execution time estimate that accurately captures the characteristics of a target program in a short time.

【0045】この結果、実行時間短縮等のプログラム調
整を行う際に、必要な調整の程度及び調整後の効果が明
らかになって、工数の減縮が可能になると共に、プログ
ラム修正に対する正確な実行時間の見積もりを得ること
で、開発者の負担を軽減すると共に開発コストを削減す
ることができる。
As a result, when performing program adjustment such as execution time reduction, the degree of necessary adjustment and the effect after adjustment become clear, the man-hour can be reduced, and the accurate execution time for program correction can be reduced. By obtaining the estimate, the burden on the developer can be reduced and the development cost can be reduced.

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

【図1】本発明の実施の形態に係るシミュレーション装
置を示すブロック図である。
FIG. 1 is a block diagram showing a simulation device according to an embodiment of the present invention.

【図2】図1のシミュレーション装置を用いたシミュレ
ーションの流れを示す説明図である。
FIG. 2 is an explanatory diagram showing a flow of a simulation using the simulation device of FIG. 1;

【図3】従来のシミュレーション方法によるシミュレー
ションの流れを示す説明図である。
FIG. 3 is an explanatory diagram showing a flow of a simulation according to a conventional simulation method.

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

10 シミュレーション装置 11 ホストCPU 12 ホストメモリ 13 シミュレーションプログラム 14 ターゲット実行ルーチン 15 状態変更(デバッガ)ルーチン 16 レジスタ情報 17 パイプライン情報 18 キャッシュメモリ情報 19 ターゲットメモリ情報 A ターゲット用のプログラム A´ シミュレーション目的のプログラム B ホスト用のプログラム B´ ホスト用のプログラム a ターゲット実行時間 a´ ターゲット実行時間見積もり b ホスト実行時間 b´ ホスト実行時間 Reference Signs List 10 simulation apparatus 11 host CPU 12 host memory 13 simulation program 14 target execution routine 15 state change (debugger) routine 16 register information 17 pipeline information 18 cache memory information 19 target memory information A target program A ′ simulation target program B Host program B 'Host program a Target execution time a' Target execution time estimation b Host execution time b 'Host execution time

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ターゲット命令からなる第1のプログラム
をホスト命令からなる第2のプログラムに変換し、前記
第2のプログラムをホストCPUで実行して前記第2の
プログラムのホスト実行時間を求め、ターゲットCPU
のハードウェアで処理するのと同等の処理を行うソフト
ウェアを用いてターゲット命令からなる前記第1のプロ
グラムをホストCPUによりシミュレーションして得ら
れるターゲットCPU上のクロック数から前記第1のプ
ログラムをターゲットCPUにより実行する場合のター
ゲット実行時間を求め、両実行時間からターゲット/ホ
スト性能比を求める処理と、ターゲット命令からなる 被測定プログラムをホスト命令
からなる第3のプログラムに変換し、前記第3のプログ
ラムをホストCPUで実行して前記第3のプログラムの
実行時間を求め、前記第3のプログラムの実行時間と前
記ターゲット/ホスト性能比に基づき、前記被測定プロ
グラムを前記ターゲットで実行した場合のターゲット実
行時間見積もりを求める処理とを有することを特徴とす
るシミュレーション方法。
A first program consisting of a target instruction is converted into a second program consisting of a host instruction, and the second program is executed by a host CPU to execute the second program on the host. Find time, target CPU
The first program, which is obtained by simulating the first program consisting of target instructions by the host CPU using software that performs processing equivalent to that executed by the hardware of seeking target execution time when executed by a processing for obtaining the target / host performance ratio from both the execution time, the host commands the measured program of target instructions
Converted into a third program consisting of the third program
And the third program is executed by the host CPU.
Obtains the execution time, based on the execution time and the target / host performance ratio of the third program, and having a process for obtaining the target execution time estimate when the measured program executed by the target Simulation method.
【請求項2】前記被測定プログラムは、前記第1のプロ
グラムに命令の追加、削除又は変更の改造、修正を加え
て作成されたものであることを特徴とする請求項1に記
載のシミュレーション方法。
Wherein the measured program, the additional instructions in the first program, the simulation method according to claim 1, characterized in that it was created by adding modifications of deleting or changing, modification .
【請求項3】ターゲット命令からなる第1のプログラム
をホスト命令からなる第2のプログラムに変換し、前記
第2のプログラムをホストCPUで実行して前記第2の
プログラムのホスト実行時間を求め、ターゲットCPU
のハードウェアで処理するのと同等の処理を行うソフト
ウェアを用いてターゲット命令からなる前記第1のプロ
グラムをホストCPUによりシミュレーションして得ら
れるターゲットCPU上のクロック数から前記第1のプ
ログラムをターゲットCPUにより実行する場合のター
ゲット実行時間を求め、両実行時間からターゲット/ホ
スト性能比を求め、ターゲット命令からなる被測定プロ
グラムをホスト命令からなる第3のプロ グラムに変換
し、前記第3のプログラムをホストCPUで実行して前
記第3のプログラムの実行時間を求め、前記第3のプロ
グラム実行時間と前記ターゲット/ホスト性能比に基
づき、前記被測定プログラムを前記ターゲットで実行し
た場合のターゲット実行時間見積もりを求めるシミュレ
ーション機能を備えたことを特徴とするシミュレーショ
ン装置。
Wherein converting the first program of the target instruction to the second program of the host command, the host execution of said second program by executing the <br/> second program on the host CPU Find time, target CPU
The first program, which is obtained by simulating the first program consisting of target instructions by the host CPU using software that performs processing equivalent to that executed by the hardware of seeking target execution time for executing a obtains a target / host performance ratio from both execution time, converted into the third program comprising the measurement program of the target command from the host instruction
Then, the third program is executed by the host CPU , and
Obtains the execution time of the serial third program, based on the third pro <br/> execution time and the target / host performance ratio of grams of target execution time estimate when the measured program executed by the target A simulation device comprising a simulation function for obtaining
JP29335198A 1998-10-15 1998-10-15 Simulation method and apparatus Expired - Fee Related JP3214459B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29335198A JP3214459B2 (en) 1998-10-15 1998-10-15 Simulation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29335198A JP3214459B2 (en) 1998-10-15 1998-10-15 Simulation method and apparatus

Publications (2)

Publication Number Publication Date
JP2000122898A JP2000122898A (en) 2000-04-28
JP3214459B2 true JP3214459B2 (en) 2001-10-02

Family

ID=17793679

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29335198A Expired - Fee Related JP3214459B2 (en) 1998-10-15 1998-10-15 Simulation method and apparatus

Country Status (1)

Country Link
JP (1) JP3214459B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007299212A (en) * 2006-04-28 2007-11-15 Fujitsu Ten Ltd Apparatus and method for evaluating porting of software
JP6187264B2 (en) 2014-01-07 2017-08-30 富士通株式会社 Calculation method, calculation program, and calculation apparatus
JP2023087354A (en) * 2021-12-13 2023-06-23 日立Astemo株式会社 Simulation method

Also Published As

Publication number Publication date
JP2000122898A (en) 2000-04-28

Similar Documents

Publication Publication Date Title
US8725485B2 (en) Simulation method and simulation apparatus
JP6448195B2 (en) Method for randomly accessing signal values of FPGA at runtime, data processing apparatus, computer program, digital storage medium, and method of implementing FPGA build
US6983234B1 (en) System and method for validating processor performance and functionality
JP3608915B2 (en) Multiprocessing system performance evaluation method and apparatus, and storage medium storing multiprocessing system performance evaluation program
CN114168200B (en) System and method for verifying memory access consistency of multi-core processor
CN116167310A (en) Method and device for verifying cache consistency of multi-core processor
US6212493B1 (en) Profile directed simulation used to target time-critical crossproducts during random vector testing
JP2012502340A (en) Simulating processor execution with branch override
JPH04233040A (en) Simulation system for executing computer program
US9658849B2 (en) Processor simulation environment
JP5034916B2 (en) Performance evaluation model generation method, system performance evaluation method, and performance evaluation model generation apparatus
JP2004348606A (en) Higher-order synthesizer, model creation method for hardware verification, and hardware verification method
JP3214459B2 (en) Simulation method and apparatus
US20030070117A1 (en) Simulation apparatus and simulation method
US20230056423A1 (en) Processor core simulator including trace-based coherent cache driven memory traffic generator
US20040015792A1 (en) Method for creating standard VHDL test environments
JP2007052783A (en) Simulation of data processor
JP2011238137A (en) Performance estimation device
JP2000293557A (en) Simulation method for power consumption
JP3647287B2 (en) Multiprocessor system performance evaluation method and apparatus
JP2011145880A (en) Generation method for test task used in logic verification of semiconductor integrated circuit
JPH10187484A (en) Simulator
JP2994280B2 (en) Computer system performance evaluation method
JP2001236247A (en) Software simulator and simulation processing method
CN108604205B (en) Test point creating method, device and system

Legal Events

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