JP3089121B2 - Test instruction string generation method - Google Patents
Test instruction string generation methodInfo
- Publication number
- JP3089121B2 JP3089121B2 JP04311859A JP31185992A JP3089121B2 JP 3089121 B2 JP3089121 B2 JP 3089121B2 JP 04311859 A JP04311859 A JP 04311859A JP 31185992 A JP31185992 A JP 31185992A JP 3089121 B2 JP3089121 B2 JP 3089121B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- appearance frequency
- test
- frequency table
- instruction sequence
- 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
Links
Landscapes
- Test And Diagnosis Of Digital Computers (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、計算機システム内のプ
ロセッサの機能をテストするためのテスト命令列の生成
方法に関し、特にユーザ環境で使用される命令の組合せ
を使用してテスト用のマシン命令列を生成するテスト命
令列生成方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for generating a test instruction sequence for testing the function of a processor in a computer system, and more particularly to a method for testing machine instructions using a combination of instructions used in a user environment. The present invention relates to a test instruction sequence generation method for generating a sequence.
【0002】[0002]
【従来の技術】近年、計算機システムにはマイクロ・プ
ロセッサが使用される場合が多い。そして、使用される
マイクロ・プロセッサは、その処理速度を上げるため、
パイプライン制御機構、命令キャッシュ、データ・キャ
ッシュ、そして各種バッファを備える場合が多く、複雑
な構成になっている。2. Description of the Related Art In recent years, a microprocessor is often used in a computer system. And the microprocessor used, in order to increase its processing speed,
It often has a pipeline control mechanism, an instruction cache, a data cache, and various buffers, and has a complicated configuration.
【0003】このような、マイクロ・プロセッサの機能
をテストする場合、すなわち、上記マイクロ・プロセッ
サの機能が正常に動作しているかどうかを網羅的に試験
する場合には、時間的な制約があるため、如何に効果的
に、命令の組合せ試験を行い得るかが重要な課題とな
る。そして、現在の所、乱数を用いてランダムに生成し
た命令列による試験が最適なツールとして用いられてい
る。[0003] When testing the function of the microprocessor, that is, comprehensively testing whether the function of the microprocessor is operating normally, there is a time constraint. An important issue is how to effectively perform a combination test of instructions. At present, a test using an instruction sequence generated randomly using random numbers is used as an optimal tool.
【0004】従来のランダムな命令列を用いた試験方法
では、実装している全マシン命令を対象として、乱数を
用いてランダムに命令を選択し、テスト命令列を生成す
るというのが一般的な方法であった。In a conventional test method using a random instruction sequence, it is general that a test instruction sequence is generated by randomly selecting instructions using random numbers for all mounted machine instructions. Was the way.
【0005】図10は、従来のテスト命令列生成方法の
一例について説明するための図であり、51は命令選択
テーブル、52は乱数生成部、53は乱数生成部で作ら
れた乱数、54は命令選択部、55は命令を展開するメ
モリ部を表している。FIG. 10 is a diagram for explaining an example of a conventional test instruction sequence generation method. Reference numeral 51 denotes an instruction selection table; 52, a random number generation unit; 53, a random number generated by the random number generation unit; An instruction selection unit 55 represents a memory unit that expands instructions.
【0006】図10に示す例では、命令選択テーブル5
1により、実装されたマシン命令に1乃至99までの番
号が付され、命令選択部54は、乱数生成部52が出力
する1乃至99までの乱数に応じて、命令選択テーブル
51から命令を選択してメモリ55に1つずつ命令を展
開する。このようにして、メモリ55上にテスト命令列
が生成される。[0006] In the example shown in FIG.
The number 1 to 99 is assigned to the implemented machine instruction by 1, and the instruction selecting unit 54 selects an instruction from the instruction selection table 51 according to the random number from 1 to 99 output by the random number generation unit 52. Then, the instructions are developed in the memory 55 one by one. In this way, a test instruction sequence is generated on the memory 55.
【0007】[0007]
【発明が解決しようとする課題】上述した従来のランダ
ム命令の生成方法においては、実装している全ての命令
を対象として、乱数により命令を選択してテスト命令列
を生成しているため、オペレーティング・システム(O
S)や、アプリケーション・プログラムで実際に使用す
る命令列とはかなり異なったものとなり、ユーザ環境で
実際に使用される命令の組合せで効果的に試験すること
は困難であった。In the above-described conventional method for generating a random instruction, a test instruction sequence is generated by selecting an instruction with a random number for all of the mounted instructions, so that a test instruction sequence is generated.・ System (O
S) and the sequence of instructions actually used in the application program are considerably different, and it has been difficult to test effectively with a combination of instructions actually used in the user environment.
【0008】本発明は上記問題点に鑑みなされたもので
あり、ユーザ環境で使用される命令の組合せによるマシ
ン命令列を効果的に生成し得るテスト命令列生成方法を
提供することを目的とする。The present invention has been made in view of the above problems, and has as its object to provide a test instruction sequence generating method capable of effectively generating a machine instruction sequence based on a combination of instructions used in a user environment. .
【0009】[0009]
【課題を解決するための手段】本発明によれば、上述の
目的は前記特許請求の範囲に記載した手段により達成さ
れる。According to the present invention, the above objects are achieved by the means as set forth in the appended claims.
【0010】すなわち、請求項1記載の発明について
は、汎用コンパイラにより生成したロード・モジュール
を基に、各マシン命令の出現頻度を登録する命令出現頻
度表を作成し、上記命令出現頻度表に応じた割合で、各
マシン命令を選択するとともに、各マシン命令の出現順
をランダムに決定して、テスト用のマシン命令列を生成
するテスト命令列生成方法である。That is, according to the first aspect of the present invention, an instruction appearance frequency table for registering the appearance frequency of each machine instruction is created based on the load module generated by the general-purpose compiler. This is a test instruction sequence generation method for generating a test machine instruction sequence by selecting each machine instruction at a given ratio and randomly determining the order of appearance of each machine instruction.
【0011】請求項2記載の発明については、上記命令
出現頻度表をコンパイラの種類ごとに作成する請求項1
記載のテスト命令列生成方法である。According to the second aspect of the present invention, the instruction frequency table is created for each type of compiler.
It is a test instruction sequence generation method described above.
【0012】請求項3記載の発明については、上記命令
出現頻度表をコンパイル時のオプティマイズ条件ごとに
作成する請求項1記載のテスト命令列生成方法である。
請求項4記載の発明については、上記命令出現頻度表を
ロード・モジュールのプロフィールごとに作成する請求
項1記載のテスト命令列生成方法である。According to a third aspect of the present invention, there is provided the test instruction sequence generating method according to the first aspect, wherein the instruction appearance frequency table is created for each optimization condition at the time of compilation.
According to a fourth aspect of the present invention, there is provided the test instruction sequence generating method according to the first aspect, wherein the instruction occurrence frequency table is created for each profile of the load module.
【0013】請求項5記載の発明については、異なる基
準で生成された命令出現頻度表を予め複数用意してお
き、上記複数の命令出現頻度表の中から、試験の目的に
応じた命令出現頻度表を選択使用してテスト用のマシン
命令列を生成する請求項1記載のテスト命令列生成方法
である。According to the present invention, a plurality of instruction appearance frequency tables generated based on different standards are prepared in advance, and the instruction appearance frequency according to the purpose of the test is selected from the plurality of instruction appearance frequency tables. 2. The test instruction sequence generation method according to claim 1, wherein a test machine instruction sequence is generated by selectively using a table.
【0014】[0014]
【作用】本発明のテスト命令列生成方法では、従来の乱
数だけに基づいて命令を選択する方法を、ユーザ環境で
の命令出現頻度の範囲において、ランダムに命令を選択
する方法に改めることを基本にしている。According to the test instruction sequence generation method of the present invention, the conventional method of selecting an instruction based only on random numbers is basically changed to a method of selecting an instruction randomly within a range of instruction appearance frequency in a user environment. I have to.
【0015】すなわち、請求項1記載のテスト命令列生
成方法においては、OSやアプリケーション・プログラ
ム等のユーザ環境に適応したロード・モジュールを用い
て、該ロード・モジュール内のマシン命令の出現頻度を
調べ、その出現頻度を考慮してテスト用のマシン命令列
を生成する。That is, in the test instruction sequence generating method according to the first aspect, the frequency of occurrence of machine instructions in the load module is checked using a load module adapted to a user environment such as an OS or an application program. , Generating a test machine instruction sequence in consideration of the appearance frequency.
【0016】以下、その方法について、一例を用いて説
明する。図1は、本発明のテスト命令列生成方法の基本
原理を説明するための図であり、図2は命令選択テーブ
ルについて説明するための図である。Hereinafter, the method will be described using an example. FIG. 1 is a diagram for explaining the basic principle of the test instruction sequence generation method of the present invention, and FIG. 2 is a diagram for explaining an instruction selection table.
【0017】図1において、11はオペレーティング・
システム(OS)あるいはアプリケーション・プログラ
ムのロード・モジュール、11aはロード・モジュール
中のテキスト部、11bはロード・モジュール中のデー
タ部、11cはテキスト部11a内の命令(ビット構
成)、12はロード・モジュールのテキスト部11aを
検索し、命令の出現頻度を求める出現頻度生成プログラ
ム、13は命令のオペコード部をマトリックス(図1の
例では、横方向にオペコードの0,1ビット目を、縦方
向に3,4ビット目を対応させている)にして出現頻度
を記録する命令出現頻度表を表している。また図2にお
いて、14は命令出現頻度表、15は調整後の命令出現
頻度表を表している。In FIG. 1, reference numeral 11 denotes an operating system.
A load module of a system (OS) or an application program, 11a is a text part in the load module, 11b is a data part in the load module, 11c is an instruction (bit configuration) in the text part 11a, and 12 is a load module. An appearance frequency generation program for retrieving the text portion 11a of the module and calculating the occurrence frequency of the instruction. Reference numeral 13 denotes an operation code portion of the instruction in a matrix (in the example of FIG. 1, the 0th and 1st bits of the operation code are set in the horizontal direction and the (Corresponding to the third and fourth bits) to represent an instruction appearance frequency table for recording the appearance frequency. In FIG. 2, reference numeral 14 denotes an instruction appearance frequency table, and reference numeral 15 denotes an adjusted instruction appearance frequency table.
【0018】以下、本発明の方法について順を追って説
明する。 (1)出現頻度生成プログラム12は入力となるロード
・モジュール11を読み込み、その中のテキスト部11
aの命令を1つずつ解析していく。この例では、各命令
11cは4バイト長である。Hereinafter, the method of the present invention will be described step by step. (1) The appearance frequency generation program 12 reads the load module 11 as an input, and reads the text module 11 therein.
The instruction of a is analyzed one by one. In this example, each instruction 11c is 4 bytes long.
【0019】(2)命令11cの先頭4ビットに対応す
る命令出現頻度表13のエントリ(ここに出現頻度が%
値で記憶されている)を読み込み、その出現頻度を式
(1)で求め、再度命令出現頻度表13の該当するエン
トリに書き込み。(2) An entry in the instruction appearance frequency table 13 corresponding to the first 4 bits of the instruction 11c (where the appearance frequency is%
(Stored as a value), the occurrence frequency is obtained by equation (1), and written again to the corresponding entry of the instruction appearance frequency table 13.
【0020】更新ロジックは以下の通りである。 (n×α+1)/(n+1) 式(1) n:これまでの出現命令数であり、命令出現頻度表13
の出現命令数の頂に記録される。The update logic is as follows. (N × α + 1) / (n + 1) Expression (1) n: The number of instructions that have appeared so far, and the instruction appearance frequency table 13
Is recorded at the top of the number of occurrence instructions.
【0021】α:該当する命令のこれまでの出現頻度 (3)さらに他の命令の出現頻度を更新(下げる)しな
ければならず、その出現頻度は式(2)より求め、該当
するエントリに書き込む。Α: Appearance frequency of the corresponding instruction so far (3) The appearance frequency of another instruction must be updated (decreased). The appearance frequency is obtained from equation (2), and Write.
【0022】 (n×α)/(n+1) 式(2) (4)最後に出現命令数を1つ増加させて、命令出現頻
度表13に書き込む。 (5)上記(1)乃至(4)の処理を、テキスト部の最
後の命令まで実行する。(N × α) / (n + 1) Equation (2) (4) Finally, the number of appearing instructions is increased by one and written into the instruction appearance frequency table 13. (5) The processes of (1) to (4) are executed up to the last instruction in the text part.
【0023】上記(1)乃至(5)の処理により生成し
た命令出現頻度表13と、従来技術から、命令の出現頻
度を反映した調整後の命令選択テーブル15を生成す
る。以下、この調整後の命令選択テーブル15の生成論
理について説明する。The instruction frequency table 13 generated by the processing of the above (1) to (5) and the adjusted instruction selection table 15 reflecting the frequency of occurrence of instructions are generated from the prior art. Hereinafter, the generation logic of the adjusted instruction selection table 15 will be described.
【0024】(1)命令選択テーブル14の各エントリ
からオペコードを読み取り、命令出現頻度表13の対応
するエントリに記録された出現頻度を乗じた分のエント
リを、調整後の命令選択テーブル15にコピーする。 (2)図1の場合で説明すると、最初のエントリ(LO
AD命令)の出現頻度は50%であるため、図1の例で
は命令の出現頻度の10%に対して1個エントリとする
ので、1個×5となり、5個のエントリを調整後の命令
選択テーブル15にコピーする。なお、1%単位まで精
度を上げるとすると、1個×50となり、50個のエン
トリを調整後の命令選択テーブル51にコピーする。(1) An operation code is read from each entry of the instruction selection table 14, and an entry obtained by multiplying the corresponding entry of the instruction appearance frequency table 13 by the appearance frequency is copied to the adjusted instruction selection table 15. I do. (2) In the case of FIG. 1, the first entry (LO
AD instruction) is 50%, so in the example of FIG. 1, one entry is provided for 10% of the instruction appearance frequency, so that one entry × 5 is obtained. Copy to selection table 15. If the accuracy is increased to the unit of 1%, it becomes 1 × 50, and 50 entries are copied to the adjusted instruction selection table 51.
【0025】(3)2番目のエントリ(MVI命令)の
出現頻度は0%であるため、このエントリは調整後の命
令選択テーブル15にコピーしない。 (4)3番目のエントリ(STORE命令)の出現頻度
は10%であるため、1個×1となり、1個のエントリ
を調整後の命令選択テーブル15にコピーする。(3) Since the appearance frequency of the second entry (MVI instruction) is 0%, this entry is not copied to the adjusted instruction selection table 15. (4) Since the appearance frequency of the third entry (STORE instruction) is 10%, it becomes 1 × 1 and one entry is copied to the adjusted instruction selection table 15.
【0026】このようにして、命令選択テーブル14の
全てのエントリに対して、処理を続ける。こうしてでき
た調整後の命令選択テーブル15は出現頻度を考慮した
生成テーブルであり、後は、従来技術の場合と同じよう
に、調整後の命令選択テーブル15を用いて乱数により
テスト命令列を生成する。In this way, the processing is continued for all the entries of the instruction selection table 14. The adjusted instruction selection table 15 thus created is a generation table in which the appearance frequency is taken into consideration, and thereafter, a test instruction sequence is generated by random numbers using the adjusted instruction selection table 15 in the same manner as in the prior art. I do.
【0027】このようにして、ユーザ環境に即した命令
の組合せによるテスト命令列を生成することが可能にな
る。In this way, it is possible to generate a test instruction sequence based on a combination of instructions according to the user environment.
【0028】請求項2記載の発明については、上記命令
出現頻度表をコンパイラの種類ごとに作成してファイル
しておき、テストの目的に対応して、最も適切な命令出
現頻度表を前記ファイルより取り出し、この命令出現頻
度表によりテスト命令列を生成する。According to the second aspect of the present invention, the above-mentioned instruction appearance frequency table is created for each type of compiler and stored in a file, and the most appropriate instruction appearance frequency table is obtained from the file according to the purpose of the test. Then, a test instruction sequence is generated using the instruction appearance frequency table.
【0029】すなわち、アプリケーション・プログラム
はその目的により、使用する言語が異なり、そのコンパ
イラの使用・展開する命令列もかなり異なる。そのた
め、コンパイラの種類に応じた命令出現頻度表を用いる
ことにより、さまざまなユーザ環境で実行されるテスト
命令列を効率よく生成することが可能となる。That is, the application program uses a different language depending on its purpose, and the compiler uses and expands the instruction sequence considerably. Therefore, by using the instruction appearance frequency table according to the type of the compiler, it is possible to efficiently generate a test instruction sequence executed in various user environments.
【0030】請求項3記載の発明については、上記命令
出現頻度表をコンパイル時のオプティマイズ条件ごとに
作成してファイルしておき、テストの目的に対応して、
最も適切な命令出現頻度表を前記ファイルより取り出
し、この命令出現頻度表によりテスト命令列を生成す
る。According to the third aspect of the present invention, the instruction appearance frequency table is created and filed for each optimization condition at the time of compiling, and is stored in a file.
The most appropriate instruction frequency table is extracted from the file, and a test instruction sequence is generated based on the instruction frequency table.
【0031】すなわち、コンパイラは一般に、オプティ
マイズ・レベル・オプションを装備しており、そのレベ
ル指定に応じて、展開される命令列が異なる。そこで、
オプティマイズ・レベルごとに、命令出現頻度表を用意
する。このようにして、さまざまなユーザ環境で実行さ
れる命令列を効率よく生成することが可能になる。That is, the compiler is generally equipped with an optimize level option, and the instruction sequence to be expanded differs depending on the level specification. Therefore,
An instruction frequency table is prepared for each optimization level. In this way, it is possible to efficiently generate an instruction sequence to be executed in various user environments.
【0032】請求項4記載の発明については、上記命令
出現頻度表をロード・モジュールのプロフィールごとに
作成してファイルしておき、テストの目的に対応して、
最も適切な命令出現頻度表を前記ファイルより取り出
し、この命令出現頻度表によりテスト命令列を生成す
る。According to the fourth aspect of the present invention, the instruction frequency table is created for each profile of the load module and stored in a file.
The most appropriate instruction frequency table is extracted from the file, and a test instruction sequence is generated based on the instruction frequency table.
【0033】すなわち、ロード・モジュールは、プログ
ラムの性格によって使用する命令と、その組合せがかな
り異なってくる。たとえば、科学技術演算プログラムな
ら浮動小数点演算命令が多く使用され、OSプログラム
なら特権命令が多く使用されるという具合である。その
ため、ユーザ環境に即した命令列を生成するために、プ
ログラムの性格に合った命令出現頻度表を用意する。That is, the load module has a considerably different combination of instructions used depending on the nature of the program. For example, a science and technology operation program often uses floating-point operation instructions, and an OS program often uses privileged instructions. Therefore, in order to generate an instruction sequence suitable for the user environment, an instruction appearance frequency table suitable for the characteristics of the program is prepared.
【0034】請求項5記載の発明については、例えば、
上記コンパイラの種類ごとに作成された命令出現頻度
表、上記コンパイラ時のオプティマイズ条件ごとに作成
された命令出現頻度表、および上記ロード・モジュール
のプロフィールごとに作成された命令出現頻度表等を予
めファイルしておき、テストの目的に対応して、最も適
切な命令出現頻度表を前記ファイルより取り出し、この
命令出現頻度表によりテスト命令列を生成する。According to the invention described in claim 5, for example,
An instruction frequency table created for each type of the compiler, an instruction frequency table created for each optimizing condition at the time of the compiler, an instruction frequency table created for each profile of the load module, and the like are pre-filed. In advance, the most appropriate instruction appearance frequency table is extracted from the file corresponding to the purpose of the test, and a test instruction sequence is generated based on the instruction appearance frequency table.
【0035】このようにして、試験の目的に対応して、
最適なテスト用のマシン命令列を効率的に生成できる。Thus, in accordance with the purpose of the test,
It is possible to efficiently generate an optimal test machine instruction sequence.
【0036】[0036]
(A)第一の実施例 本発明の第一の実施例として、複数のロード・モジュー
ルから命令出現頻度表を作成する方法について説明す
る。なお、本実施例は請求項1記載の発明に対応する実
施例である。(A) First Embodiment As a first embodiment of the present invention, a method of creating an instruction appearance frequency table from a plurality of load modules will be described. This embodiment is an embodiment corresponding to the first aspect of the present invention.
【0037】本発明の第一の実施例は、図1及び図2に
示す基本構成のもとで、出現頻度生成プログラム12
が、図3のフローチャートで示す処理を行うものであ
る。また出現頻度生成プログラム12はOSのもとで動
作するプログラムであり、命令出現頻度表13はファイ
ルとして、システムの記憶装置に存在する。The first embodiment of the present invention is based on the basic structure shown in FIG. 1 and FIG.
Performs the processing shown in the flowchart of FIG. The appearance frequency generation program 12 is a program that operates under the OS, and the instruction appearance frequency table 13 exists as a file in the storage device of the system.
【0038】以下、図3の本発明の第一の実施例での処
理を説明するためのフローチャートにもとづき、その動
作を説明する。なお、以下の説明では、フローチャート
上のステップの意味を、符号[S]で表している。The operation of the first embodiment of the present invention will be described below with reference to the flowchart of FIG. In the following description, the meaning of the steps in the flowchart is represented by reference symbol [S].
【0039】(1)S301において、命令出現頻度表
のファイルを読み込む。 (2)S302において、ロード・モジュール11内の
テキスト部11aを読み込む。(1) In S301, a file of an instruction appearance frequency table is read. (2) In S302, the text section 11a in the load module 11 is read.
【0040】(3)S303において、命令11cのオ
ペコード(先頭4ビット)に対する命令出現頻度表(命
令出現頻度テーブル)13のエントリを求める。 (4)S304において、式(1)から新たな頻度を求
め、エントリを更新する。(3) In S303, an entry of the instruction appearance frequency table (instruction appearance frequency table) 13 for the operation code (first 4 bits) of the instruction 11c is obtained. (4) In S304, a new frequency is obtained from equation (1), and the entry is updated.
【0041】(5)S305において、他の命令の出現
頻度を式(2)を用いて更新する。(5) In S305, the frequency of occurrence of another instruction is updated using equation (2).
【0042】(6)S306において、命令出現頻度表
13の全てのエントリを更新したかどうかを判断する。
結果がYESであれば、S307に移行する。結果がN
Oであれば、S305に戻る。(6) In S306, it is determined whether all the entries of the instruction appearance frequency table 13 have been updated.
If the result is YES, the process moves to S307. The result is N
If O, the process returns to S305.
【0043】(7)S307において、命令出現頻度表
13内の出現命令数を+1する。 (8)S308において、テキスト部11a内の全命令
について上記処理を行ったかどうかを判断する。結果が
YESであれば、S309に移行する。結果がNOであ
れば、S303に戻る。(7) In S307, the number of appearing instructions in the instruction appearance frequency table 13 is incremented by one. (8) In S308, it is determined whether or not the above processing has been performed for all the instructions in the text section 11a. If the result is YES, the process moves to S309. If the result is NO, the process returns to S303.
【0044】(9)S309において、全てのロード・
モジュールについて上記処理を行ったかどうかを判断す
る。結果がYESであれば、S310に移行する。結果
がNOであれば、S302に戻り、他のロード・モジュ
ールを読み込む。(9) In S309, all loads
It is determined whether the above processing has been performed for the module. If the result is YES, the process moves to S310. If the result is NO, the process returns to S302 to read another load module.
【0045】(10)S310において、更新した命令
出現頻度表ファイルを記憶装置に書き込む。(10) In S310, the updated instruction appearance frequency table file is written to the storage device.
【0046】(11)後は、従来技術の場合と同じよう
に、上記命令出現頻度表13を用いて、オリジナルの命
令選択テーブル14から調整後の命令選択テーブル15
を作成し、該調整後の命令選択テーブル15を用いて乱
数によりテスト命令列を生成する。(11) After that, as in the case of the prior art, the adjusted instruction selection table 15 is obtained from the original instruction selection table 14 by using the instruction appearance frequency table 13.
Is generated, and a test instruction sequence is generated by random numbers using the instruction selection table 15 after the adjustment.
【0047】このようにして、出現頻度生成プログラム
12は、複数のロード・モジュール11を入力として、
命令出現頻度表13を作成及び更新する。また多種類の
ロード・モジュール11を用いることで、より平均化さ
れた、ユーザ環境に適した命令出現頻度表13を作成す
ることが可能になる。As described above, the appearance frequency generation program 12 receives the plurality of load modules 11 as inputs,
The instruction appearance frequency table 13 is created and updated. In addition, by using various types of load modules 11, it is possible to create a more averaged instruction appearance frequency table 13 suitable for the user environment.
【0048】(B)第二の実施例 本発明の第二の実施例として、命令出現頻度表をコンパ
イラの種類ごとに作成する方法について説明する。な
お、本実施例は請求項2記載の発明に対応する実施例で
ある。(B) Second Embodiment As a second embodiment of the present invention, a method of creating an instruction appearance frequency table for each type of compiler will be described. This embodiment is an embodiment corresponding to the second aspect of the present invention.
【0049】アプリケーション・プログラムはその目的
により、使用する言語が異なり、そのコンパイラの使用
・展開する命令列もかなり異なる。そのため、目的に応
じた命令出現頻度表を用意することにより、さまざまな
ユーザ環境で実行される命令列を効率よく生成すること
が可能となる。An application program uses a different language depending on its purpose, and its compiler uses and expands an instruction sequence considerably. Therefore, by preparing an instruction appearance frequency table according to the purpose, it is possible to efficiently generate an instruction sequence to be executed in various user environments.
【0050】図4は、命令出現頻度表の具体例を示す図
であり、命令出現頻度表16中に、コンパイラ属性16
aを定義するようにして、コンパイラの種類ごとに命令
出現頻度テーブルを用意する。図4の命令出現頻度表1
6の例では、文字形式でコンパイラ属性を定義している
が、コード化してもよい。出現頻度生成プログラム12
はロード・モジュールに定義してあるコンパイラ属性を
読み込み、命令を解析する時にどの命令出現頻度表を使
用するかを決定する。ロード・モジュールにそのような
属性がない場合は、出現頻度生成プログラムの起動パラ
メタでコンパイラ属性を与える。FIG. 4 is a diagram showing a specific example of the instruction appearance frequency table.
By defining a, an instruction appearance frequency table is prepared for each type of compiler. Instruction appearance frequency table 1 in FIG.
In the example of No. 6, the compiler attribute is defined in a character format, but may be coded. Appearance frequency generation program 12
Reads the compiler attributes defined in the load module and determines which instruction frequency table to use when analyzing instructions. If the load module does not have such an attribute, a compiler attribute is given in the startup parameter of the appearance frequency generation program.
【0051】以上説明した実施例での処理が、図5の本
発明の第二の実施例での処理を説明するためのフローチ
ャートに示される。The processing in the embodiment described above is shown in the flowchart for explaining the processing in the second embodiment of the present invention in FIG.
【0052】以下、図5のフローチャートについて説明
する。 (1)S501において、ロード・モジュールを読み込
む。 (2)S502において、読み込んだロード・モジュー
ルにコンパイラ属性があるかどうかを判断する。結果が
YESの場合には、S503に移行する。結果がNOで
あれば、S504に移行し、コンパイラ属性を起動パラ
メタから獲得してS505に移行する。Hereinafter, the flowchart of FIG. 5 will be described. (1) In S501, a load module is read. (2) In S502, it is determined whether the read load module has a compiler attribute. If the result is YES, the process moves to S503. If the result is NO, the flow shifts to S504, where the compiler attribute is acquired from the startup parameter, and the flow shifts to S505.
【0053】(3)S503において、コンパイラ属性
をロード・モジュールから獲得する。 (4)S505において、コンパイラ属性に対応する出
現頻度表のファイルを読み込む。(3) In S503, a compiler attribute is obtained from the load module. (4) In S505, the file of the appearance frequency table corresponding to the compiler attribute is read.
【0054】(5)以後の処理は、図3に示すフローチ
ャートの場合と同じである。(5) Subsequent processing is the same as in the case of the flowchart shown in FIG.
【0055】(C)第三の実施例 本発明の第三の実施例として、命令出現頻度表にコンパ
イル時のオプティマイズ(最適化)条件を設定する方法
について説明する。なお、本実施例は請求項3記載の発
明に対応する実施例である。(C) Third Embodiment As a third embodiment of the present invention, a method of setting an optimizing (optimizing) condition at the time of compilation in an instruction appearance frequency table will be described. This embodiment is an embodiment corresponding to the third aspect of the present invention.
【0056】コンパイラは一般に、オプティマイズ・レ
ベル・オプションを装備しており、そのレベル指定に応
じて展開される命令列が異なる。そこで、図4に示す命
令出現頻度表16にオプティマイズ・レベル16bの項
目を設けて、オプティマイズ・レベルごとに、命令出現
頻度表を用意する。図4の命令出現頻度表16の例で
は、文字形式でオプティマイズ・レベルを定義している
が、コード化してもよい。The compiler generally has an optimize level option, and the instruction sequence to be expanded differs according to the level specification. Therefore, an item of the optimization level 16b is provided in the instruction appearance frequency table 16 shown in FIG. 4, and the instruction appearance frequency table is prepared for each optimization level. In the example of the instruction appearance frequency table 16 in FIG. 4, the optimization level is defined in a character format, but may be coded.
【0057】出現頻度生成プログラム12はロード・モ
ジュールに定義してあるオプティマイズ・レベルを読み
込み、命令を解析する時にどの命令出現頻度表を使用す
るかを決定する。ロード・モジュールにそのようなレベ
ル定義がない場合は、出現頻度生成プログラムの起動パ
ラメタでオプティマイズ・レベルを与える。The appearance frequency generation program 12 reads the optimization level defined in the load module, and determines which instruction appearance frequency table to use when analyzing instructions. If there is no such level definition in the load module, an optimization level is given in the startup parameter of the appearance frequency generation program.
【0058】このようにして、さまざまなユーザ環境で
実行される命令列を効率よく生成することが可能にな
る。以上説明した実施例での処理が、図6の、本発明の
第三の実施例での処理を説明するためのフローチャート
に示されている。In this way, it is possible to efficiently generate an instruction sequence to be executed in various user environments. The processing in the embodiment described above is shown in the flowchart of FIG. 6 for explaining the processing in the third embodiment of the present invention.
【0059】以下、図6のフローチャートについて説明
する。 (1)S601において、ロード・モジュールを読み込
む。 (2)S602において、オプティマイズ定義があるか
どうかを判断する。結果がYESの場合にはS603に
移行する。結果がNOであれば、S604に移行し、オ
プティマイズ・レベルを起動パラメタから獲得してS6
05に移行する。Hereinafter, the flowchart of FIG. 6 will be described. (1) In S601, a load module is read. (2) In S602, it is determined whether or not there is an optimization definition. If the result is YES, the process moves to S603. If the result is NO, the flow shifts to S604, where the optimization level is obtained from the start-up parameter and S6.
Move to 05.
【0060】(3)S603において、オプティマイズ
・レベルをロード・モジュールから獲得する。 (4)S605において、オプティマイズ・レベルに対
応する命令出現頻度表のファイルを読み込む。(3) In S603, an optimization level is obtained from the load module. (4) In S605, the instruction appearance frequency table file corresponding to the optimization level is read.
【0061】(5)以後の処理は、図3に示すフローチ
ャートとの場合と同じである。(5) Subsequent processing is the same as in the flowchart shown in FIG.
【0062】(D)第四の実施例 本発明の第四の実施例として、命令出現頻度表にロード
・モジュールのプロフィールを設定する方法について説
明する。なお、本実施例は請求項4記載の発明に対応す
る実施例である。(D) Fourth Embodiment As a fourth embodiment of the present invention, a method for setting a profile of a load module in an instruction appearance frequency table will be described. This embodiment is an embodiment corresponding to the invention described in claim 4.
【0063】本発明が対象とするロード・モジュール
は、OSあるいは一般のユーザのアプリケーション・プ
ログラムであり、プログラムの性格によって使用する命
令、その組合せがかなり異なってくる。たとえば、科学
技術演算プログラムの場合は浮動小数点演算命令が多く
使用され、OSプログラムなら特権命令が多く使用され
るという具合である。そのため、ユーザ環境に即した命
令列を生成するには、プログラムの性格に合った命令出
現頻度表を用意することが必要である。The load module to which the present invention is applied is an OS or an application program of a general user, and the instructions to be used and the combination thereof vary considerably depending on the characteristics of the program. For example, in the case of a science and technology operation program, floating-point operation instructions are frequently used, and in an OS program, privileged instructions are often used. Therefore, it is necessary to prepare an instruction appearance frequency table suitable for the characteristics of the program in order to generate an instruction sequence suitable for the user environment.
【0064】そこで、図4に示す命令出現頻度表16に
プロフィール16cを定義し、プロフィールごとに、命
令出現頻度表を用意する。図4の命令出現頻度表16の
例では、文字形式でプロフィールを定義しているが、コ
ード化してもよい。出現頻度生成プログラム12は起動
パラメタから与えられるプロフィールを読み込み、命令
を解析する時にどの命令出現頻度表を使用するかを決定
する。Therefore, a profile 16c is defined in the instruction appearance frequency table 16 shown in FIG. 4, and an instruction appearance frequency table is prepared for each profile. In the example of the command appearance frequency table 16 in FIG. 4, the profile is defined in a character format, but may be coded. The appearance frequency generation program 12 reads the profile given from the startup parameter and determines which instruction appearance frequency table to use when analyzing the instruction.
【0065】以上説明した実施例での処理が、図7の、
本発明の第四の実施例での処理を説明するためのフロー
チャートに示される。以下、図7のフローチャートにつ
いて説明する。The processing in the embodiment described above is similar to the processing in FIG.
This is shown in a flowchart for explaining the processing in the fourth embodiment of the present invention. Hereinafter, the flowchart of FIG. 7 will be described.
【0066】(1)S701において、ロード・モジュ
ールを読み込む。 (2)S702において、プロフィールを起動パラメタ
から獲得する。 (3)S703において、プロフィールに対応する出現
頻度表のファイルを読み込む。(1) In S701, a load module is read. (2) In S702, a profile is obtained from the activation parameters. (3) In S703, a file of the appearance frequency table corresponding to the profile is read.
【0067】(4)以後の処理は、図3のフローチャー
トの場合と同じである。(4) Subsequent processing is the same as in the flowchart of FIG.
【0068】(E)第五の実施例 本発明の第五の実施例として、複数の命令出現頻度表を
選択使用してテスト命令列を生成する方法について説明
する。(E) Fifth Embodiment As a fifth embodiment of the present invention, a method of selecting and using a plurality of instruction appearance frequency tables to generate a test instruction sequence will be described.
【0069】本実施例は、前述した第一の実施例乃至第
四の実施例において作成した命令出現頻度表を利用し
て、テスト命令列を生成する方法であり、請求項5記載
の発明に対応する実施例である。The present embodiment is a method for generating a test instruction sequence using the instruction appearance frequency tables created in the first to fourth embodiments described above. This is a corresponding embodiment.
【0070】図8は、本発明の第五の実施例について説
明するための図である。 (1)テスト命令列生成プログラム27は、試験の種類
に応じて要求される命令出現頻度表ファイル21を読み
込み、その出現頻度に応じて調整後の命令選択テーブル
23を作成する。FIG. 8 is a diagram for explaining a fifth embodiment of the present invention. (1) The test instruction sequence generation program 27 reads the instruction appearance frequency table file 21 required according to the type of test, and creates the adjusted instruction selection table 23 according to the appearance frequency.
【0071】その作成方法は、オリジナルの命令選択テ
ーブル22のファイルの内容を読み取り、その命令の出
現頻度を命令出現頻度表から獲得する。もしその命令が
50%の出現頻度であったならば、エントリを50倍し
て調整後の命令選択テーブル23に登録する。もしその
命令が5%の出現頻度であったならば、エントリを5倍
して登録するという具合である。In the creation method, the content of the file of the original instruction selection table 22 is read, and the frequency of occurrence of the instruction is obtained from the instruction frequency table. If the instruction has an appearance frequency of 50%, the entry is multiplied by 50 and registered in the adjusted instruction selection table 23. If the instruction has an appearance frequency of 5%, the entry is multiplied by 5 and registered.
【0072】(2)このようにして、全命令に対して、
出現頻度表に応じた調整後の命令選択テーブル23を作
成する。 (3)そして乱数生成部24に乱数の生成を要求し、そ
の乱数25を使用して調整後の命令選択テーブル23か
ら命令を獲得し、テスト命令としてテスト命令列ファイ
ル26に書き込む。そして、テスト用の命令列として要
求されたサイズ分の命令を同じ手順で展開していく。(2) Thus, for all instructions,
An adjusted instruction selection table 23 according to the appearance frequency table is created. (3) Then, it requests the random number generation unit 24 to generate a random number, obtains an instruction from the adjusted instruction selection table 23 using the random number 25, and writes it in the test instruction sequence file 26 as a test instruction. Then, instructions of a size required as a test instruction sequence are developed in the same procedure.
【0073】図9は、本発明の第五の実施例での処理を
説明するためのフローチャートである。以下、図9のフ
ローチャートについて説明する。FIG. 9 is a flow chart for explaining the processing in the fifth embodiment of the present invention. Hereinafter, the flowchart of FIG. 9 will be described.
【0074】(1)S901において起動要求に見合う
命令出現頻度表ファイル21を読み込む。 (2)S902において、オリジナルの命令選択テーブ
ル22のファイルを読み込む。(1) In S901, the command frequency table file 21 corresponding to the activation request is read. (2) In S902, the file of the original instruction selection table 22 is read.
【0075】(3)S903において、命令選択テーブ
ル22内のエントリに対応する命令出現頻度を命令出現
頻度表から獲得する。 (4)S904において、その命令出現頻度分のエント
リ数の命令を、調整後の命令選択テーブル23に格納す
る。(3) In S903, an instruction appearance frequency corresponding to an entry in the instruction selection table 22 is obtained from the instruction appearance frequency table. (4) In S904, the instructions of the number of entries corresponding to the instruction appearance frequency are stored in the adjusted instruction selection table 23.
【0076】(5)S905において、命令選択テーブ
ル22の全エントリに対してS903及びS904の処
理を実行したかどうか判断する。結果がYESであれ
ば、S906に移行し、結果がNOであればS903に
戻る。(5) In S905, it is determined whether or not the processing of S903 and S904 has been executed for all entries of the instruction selection table 22. If the result is YES, the process moves to S906, and if the result is NO, the process returns to S903.
【0077】(6)S906において、乱数をもとに調
整後の命令選択テーブル23から命令を選択する。 (7)S907において、テスト用のマシン命令列とし
て、指定サイズ分の命令列を生成したかどうかを判断す
る。結果がYESであれば、S907に移行し、結果が
NOであればS906に戻る。(6) In S906, an instruction is selected from the adjusted instruction selection table 23 based on the random number. (7) In S907, it is determined whether an instruction sequence of a designated size has been generated as a test machine instruction sequence. If the result is YES, the process moves to S907, and if the result is NO, the process returns to S906.
【0078】(8)S908において、生成したテスト
命令列をテスト命令列ファイル26に格納する。(8) In S908, the generated test instruction sequence is stored in the test instruction sequence file 26.
【0079】[0079]
【発明の効果】以上説明したように、本発明のテスト命
令列生成方法を使用することにより、下記の効果が得ら
れる。As described above, the following effects can be obtained by using the test instruction sequence generation method of the present invention.
【0080】(1)試験目的に適した命令のみを使用し
て、テスト命令列を無駄なく生成することが可能とな
る。 (2)本発明の方法は、テスト対象となるマイクロ・プ
ロセッサが異なった場合でも、オリジナルの命令選択テ
ーブルのみをマイクロ・プロセッサに対応させて変更す
ればよく、汎用性がある。(1) A test instruction sequence can be generated without waste by using only instructions suitable for a test purpose. (2) The method of the present invention has versatility, even if the microprocessor to be tested is different, only the original instruction selection table needs to be changed in correspondence with the microprocessor.
【図1】本発明のテスト命令列生成方法の基本原理を説
明するための図である。FIG. 1 is a diagram for explaining a basic principle of a test instruction sequence generation method according to the present invention.
【図2】命令選択テーブルについて説明するための図で
ある。FIG. 2 is a diagram for describing an instruction selection table.
【図3】本発明の第一の実施例での処理を説明するため
のフローチャートである。FIG. 3 is a flowchart illustrating a process according to the first embodiment of the present invention.
【図4】命令出現頻度表の具体例を示す図である。FIG. 4 is a diagram showing a specific example of an instruction appearance frequency table.
【図5】本発明の第二の実施例での処理を説明するため
のフローチャートである。FIG. 5 is a flowchart illustrating a process according to a second embodiment of the present invention.
【図6】本発明の第三の実施例での処理を説明するため
のフローチャートである。FIG. 6 is a flowchart illustrating a process according to a third embodiment of the present invention.
【図7】本発明の第四の実施例での処理を説明するため
のフローチャートである。FIG. 7 is a flowchart illustrating a process according to a fourth embodiment of the present invention.
【図8】本発明の第五の実施例について説明するための
図である。FIG. 8 is a diagram for explaining a fifth embodiment of the present invention.
【図9】本発明の第五の実施例での処理を説明するため
のフローチャートである。FIG. 9 is a flowchart illustrating a process according to a fifth embodiment of the present invention.
【図10】従来のテスト命令列生成方法の一例について
説明するための図である。FIG. 10 is a diagram illustrating an example of a conventional test instruction sequence generation method.
11 ロード・モジュール 11a ロード・モジュール中のテキスト部 11b ロード・モジュール中のデータ部 11c テキスト部内の命令(ビット構成) 12 出現頻度生成プログラム 13 命令出現頻度表 14 命令選択テーブル 15 調整後の命令選択テーブル 16 命令出現頻度表 16a 命令出現頻度表中のコンパイラ属性 16b 命令出現頻度表中のオプティマイズ・レベル 16c 命令出現頻度表中のプロフィール 21 命令出現頻度表ファイル 22 命令選択テーブル 23 調整後の命令選択テーブル 24 乱数発生部 25 乱数 26 テスト命令列ファイル 27 テスト命令列ファイル生成プログラム Reference Signs List 11 load module 11a text part in load module 11b data part in load module 11c instruction in text part (bit configuration) 12 appearance frequency generation program 13 instruction appearance frequency table 14 instruction selection table 15 instruction selection table after adjustment 16 Instruction Appearance Frequency Table 16a Compiler Attributes in Instruction Appearance Frequency Table 16b Optimize Level in Instruction Appearance Frequency Table 16c Profile in Instruction Appearance Frequency Table 21 Instruction Appearance Frequency Table File 22 Instruction Selection Table 23 Adjusted Instruction Selection Table 24 Random number generator 25 Random number 26 Test instruction sequence file 27 Test instruction sequence file generation program
フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 11/22 - 11/26 CSDB(日本国特許庁)Continuation of front page (58) Fields investigated (Int.Cl. 7 , DB name) G06F 11/22-11/26 CSDB (Japan Patent Office)
Claims (5)
モジュールを基に、各マシン命令の出現頻度を登録する
命令出現頻度表を作成し、 上記命令出現頻度表に応じた割合で、各マシン命令を選
択するとともに、 各マシン命令の出現順をランダムに決定して、 テスト用のマシン命令列を生成することを特徴とするテ
スト命令列生成方法。A load generated by a general-purpose compiler.
Based on the module, create an instruction frequency table to register the frequency of each machine instruction, select each machine instruction at a ratio according to the instruction frequency table, and randomly arrange the order of appearance of each machine instruction. A method for generating a test instruction sequence, comprising determining a test instruction sequence and generating a test instruction sequence.
ごとに作成することを特徴とする請求項1記載のテスト
命令列生成方法。2. The test instruction sequence generation method according to claim 1, wherein the instruction appearance frequency table is created for each type of compiler.
プティマイズ条件ごとに作成することを特徴とする請求
項1記載のテスト命令列生成方法。3. The test instruction sequence generation method according to claim 1, wherein the instruction appearance frequency table is created for each optimization condition at the time of compilation.
ルのプロフィールごとに作成することを特徴とする請求
項1記載のテスト命令列生成方法。4. The test instruction sequence generating method according to claim 1, wherein the instruction appearance frequency table is created for each profile of the load module.
を予め複数用意しておき、 上記複数の命令出現頻度表の中から、試験の目的に応じ
た命令出現頻度表を選択使用してテスト用のマシン命令
列を生成することを特徴とする請求項1記載のテスト命
令列生成方法。5. A plurality of instruction appearance frequency tables generated based on different standards are prepared in advance, and an instruction appearance frequency table according to the purpose of the test is selected and used from among the plurality of instruction appearance frequency tables. 2. A method for generating a test instruction sequence according to claim 1, wherein a machine instruction sequence is generated.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP04311859A JP3089121B2 (en) | 1992-11-20 | 1992-11-20 | Test instruction string generation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP04311859A JP3089121B2 (en) | 1992-11-20 | 1992-11-20 | Test instruction string generation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06161805A JPH06161805A (en) | 1994-06-10 |
| JP3089121B2 true JP3089121B2 (en) | 2000-09-18 |
Family
ID=18022282
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP04311859A Expired - Fee Related JP3089121B2 (en) | 1992-11-20 | 1992-11-20 | Test instruction string generation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3089121B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6451989B2 (en) * | 2015-03-31 | 2019-01-16 | 日本電気株式会社 | Information processing apparatus, information processing method, and information processing program |
-
1992
- 1992-11-20 JP JP04311859A patent/JP3089121B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH06161805A (en) | 1994-06-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20030034989A1 (en) | Application editing apparatus and data processing method and program | |
| JPH08314728A (en) | Method and apparatus for converting a source program into an object program | |
| US8136043B2 (en) | GUI generation apparatus and method for generating GUI | |
| JP2000035893A (en) | Method for statically initializing arrangement of data processing system, data processing method, data processing system and computer readable storage medium storing program making computer execute its control procedure | |
| US11556317B2 (en) | Instruction translation support method and information processing apparatus | |
| US20040133595A1 (en) | Generation of persistent document object models | |
| JPH06186956A (en) | Method and apparatus for generation of compiled-raster operation code | |
| EP1990715A1 (en) | System, apparatus and method for programming a computing device | |
| JP3089121B2 (en) | Test instruction string generation method | |
| US6202203B1 (en) | Method of, system for, and computer program product for providing global value numbering | |
| JP2006154993A (en) | Web screen creation method, program, and server | |
| Taube | Stella: Persistent score representation and score editing in common music | |
| JPH10320212A (en) | Optimization method for cache | |
| JP3337763B2 (en) | Drawing description generator | |
| Correll | Graphite: an extensible rendering engine for complex writing systems | |
| CA1184309A (en) | Table-driven apparatus for data display and modification | |
| JP5190899B2 (en) | Information processing apparatus, setting file generation method, and setting file generation program | |
| JPH11154093A (en) | Program Compiler and Recording Medium Recording Compiler Program | |
| Meyer | Cepage: Toward computer-aided design of software | |
| Wang | Music structure design utilizing computer JavaScript | |
| CN120335803A (en) | A low-code development method, device and storage medium based on Amis | |
| JP3417960B2 (en) | Sentence correction support method and device | |
| JP2982725B2 (en) | Automatic program generator | |
| JP2990882B2 (en) | Functional simulation device | |
| JP3070761B2 (en) | Kanji input device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20000704 |
|
| LAPS | Cancellation because of no payment of annual fees |