JPH08212103A - Test data preparing method for multithread processor - Google Patents

Test data preparing method for multithread processor

Info

Publication number
JPH08212103A
JPH08212103A JP7043506A JP4350695A JPH08212103A JP H08212103 A JPH08212103 A JP H08212103A JP 7043506 A JP7043506 A JP 7043506A JP 4350695 A JP4350695 A JP 4350695A JP H08212103 A JPH08212103 A JP H08212103A
Authority
JP
Japan
Prior art keywords
area
file
local
program
value file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7043506A
Other languages
Japanese (ja)
Inventor
Hiroaki Hirata
博章 平田
Kosuke Yoshioka
康介 吉岡
Tomoo Yamashita
智郎 山下
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 Holdings Corp
Original Assignee
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP7043506A priority Critical patent/JPH08212103A/en
Publication of JPH08212103A publication Critical patent/JPH08212103A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To prepare test data for multithread processor verification on the execution environment of a single thread processor. CONSTITUTION: First of all, a shared memory area is damped in a shared area initial value file (step 11a) and next, after local memory areas are successively allocated to respective threads (step 13), the local memory areas are damped in local area initial value files (step 12a). After threads are executed, the local memory areas are damped in local area expected value files again (step 12b) and when the instruction codes of all the threading is completely executed, the shared memory area is damped in a shared area expected value file (step 11b). Thus, exactness in the verification of a multithread processor is improved and time for verification can be shortened as well.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数の独立な命令流の
命令を並列実行するマルチスレッド・プロセッサLSI
を設計・検証する際に用いるマルチスレッド・プロセッ
サのテスト・データ作成方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multi-thread processor LSI for executing a plurality of instructions in an independent instruction stream in parallel.
The present invention relates to a test data creation method for a multi-thread processor used when designing and verifying.

【0002】[0002]

【従来の技術】近年、大規模なマイクロプロセッサLS
Iが開発され、その検証作業には多大のコストが必要と
なってきている。従来、マイクロプロセッサ検証用のテ
スト・プログラムはアセンブラ言語を用いて(又は機械
語で直接)人手で作成されていた。そのテスト・プログ
ラムを動作させるための初期値データも人手で用意する
必要がある。さらに困難なことには、その初期値データ
を用いてテスト・プログラムを動作させた後の結果デー
タ、すなわち期待値データも人手で作成しなければなら
ず、作成時間および正確さの点で大きな費用を要するも
のであった。
2. Description of the Related Art Recently, a large-scale microprocessor LS has been used.
I has been developed, and its verification work requires a great deal of cost. Conventionally, a test program for verifying a microprocessor has been manually created by using an assembler language (or directly in a machine language). It is also necessary to manually prepare the initial value data for operating the test program. What is more difficult is that the result data after operating the test program using the initial value data, that is, the expected value data must also be manually created, which is very expensive in terms of creation time and accuracy. Was required.

【0003】一方、開発されるマイクロプロセッサLS
Iの規模及び複雑度は肥大化の一途をたどり、人手のみ
によるテスト・プログラムの作成では間に合わなくなっ
てきた。LSI開発と並行してソフトウェア開発を行な
うために作成された命令レベル・シミュレータ(命令セ
ットに関するシュミレータ)を用いることで、期待値デ
ータの作成については自動化が達成された。特に、既存
の命令セットに対する互換プロセッサを開発する場合に
は、コンパイラなどのプログラム開発環境もすでに整っ
ており、高級言語で記述された大規模な実用的プログラ
ムをLSI検証の時点でテスト・プログラムとして用い
ることも可能である。
On the other hand, the developed microprocessor LS
The scale and complexity of I have been bloated, and it has become too late to create test programs by hand. By using an instruction level simulator (simulator relating to the instruction set) created for software development in parallel with LSI development, automation has been achieved for creation of expected value data. In particular, when developing a compatible processor for an existing instruction set, a program development environment such as a compiler is already in place, and a large-scale practical program written in a high-level language can be used as a test program at the time of LSI verification. It is also possible to use.

【0004】さらに、メモリ領域のダンプ(データのは
き出し)や実行トレース(各コマンドがどのように実効
されかを記録していくこと)などの、プログラム実行を
制御できるソフトウェア機能を備えれば、実機上でテス
ト・プログラムを実行することにより、命令レベル・シ
ミュレータを用いる場合よりも、より容易に且つ高速に
期待値データを作成することが可能である。
Furthermore, if software functions capable of controlling program execution, such as dumping of data in a memory area (extrusion of data) and execution trace (recording how each command is executed), are provided, the actual machine can be used. By executing the test program above, it is possible to create expected value data more easily and at higher speed than in the case of using the instruction level simulator.

【0005】[0005]

【発明が解決しようとする課題】しかしながら上記のよ
うなプロセッサ検証手法は、既存のアーキテクチャとほ
ぼ同様のアーキテクチャを踏襲する場合にのみ可能であ
る。新規に開発したアーキテクチャをもつプロセッサに
対しては、ソフトウェア的な資産を持たないため、その
検証作業においては、初期のそれと同様、多大の費用が
要求されるという問題点が有った。
However, the processor verification method as described above is possible only when the architecture similar to the existing architecture is followed. Since the processor with the newly developed architecture has no software-like assets, there is a problem in that the verification work requires a great deal of cost as in the initial case.

【0006】本発明のテスト・データ作成方法が対象と
するプロセッサは、命令セット・アーキテクチャが既存
の命令セットと互換性を有するものであって、命令実行
方式には、例えば特開平3−134882号に開示され
たアーキテクチャを採用するものである。特開平3−1
34882号に開示されたプロセッサは、プログラム・
カウンタを複数個持ち、それぞれのプログラム・カウン
タでシーケンス制御される独立な命令流(これをスレッ
ドと呼ぶ)を並列に実行するものである。
The processor targeted by the test data generation method of the present invention has an instruction set architecture compatible with the existing instruction set, and the instruction execution system is disclosed in, for example, Japanese Patent Laid-Open No. 3-134882. It adopts the architecture disclosed in. Japanese Patent Laid-Open No. 3-1
The processor disclosed in 34882 discloses a program
It has a plurality of counters and executes independent instruction streams (called threads) which are sequence-controlled by the respective program counters in parallel.

【0007】しかしながら従来から開発されてきたプロ
セッサは、単一スレッドの実行を対象としたものであ
り、特開平3−134882号に開示されるようなマル
チスレッド実行を対象としたものは存在しない。ソフト
ウェア的な環境も整っていない状態で、マルチスレッド
・プロセッサの検証を単一スレッド・プロセッサの場合
のように効率良く行なうことは困難であり、このような
マルチスレッド・アーキテクチャを対象としたプロセッ
サのテスト方法に関する報告はこれまでにも見当たらな
い。
However, the processor developed so far is intended for execution of a single thread, and there is no processor intended for multithread execution as disclosed in Japanese Patent Laid-Open No. 3-134882. It is difficult to verify a multi-threaded processor efficiently as in the case of a single-threaded processor without the software environment in place. I haven't seen any reports on test methods.

【0008】本発明はこのような従来の問題点に鑑みて
なされたものであって、単一スレッド・プロセッサの実
行環境上でマルチスレッド・プロセッサ検証用のテスト
・データを自動的に作成し、マルチスレッド・プロセッ
サ検証作業の正確さを向上すると共に、検証作業時間の
短縮を実現するマルチスレッド・プロセッサのテスト・
データ作成方法を実現することを目的とする。
The present invention has been made in view of such conventional problems, and automatically creates test data for multi-thread processor verification in an execution environment of a single-thread processor, Multithreaded processor test that improves accuracy of verification work and shortens verification work time.
The purpose is to realize the data creation method.

【0009】また本発明は、単一スレッド・プロセッサ
の環境上で実行されるテスト・データ作成時のプログラ
ムを、マルチスレッド・プロセッサの機能シミュレータ
(又は論理シミュレータ)上で、そのまま検証に使用す
る能力を備えたマルチスレッド・プロセッサのテスト・
データ作成方法を実現することを目的とする。
Further, the present invention has the ability to use a program at the time of creating test data, which is executed in the environment of a single-thread processor, for verification as it is on a functional simulator (or logic simulator) of a multi-thread processor. Test multi-threaded processor with
The purpose is to realize the data creation method.

【0010】[0010]

【課題を解決するための手段】本願の請求項1の発明
は、本来独立な複数のプログラム・セグメントをリンク
して1つのプログラムとして実機上で実行し、テスト用
の初期値データと期待値データを作成するマルチスレッ
ド・プロセッサのテスト・データ作成方法であって、全
てのプログラム・セグメントの実行に先だってまず共有
メモリ領域を共有領域初期値ファイルにダンプし、次に
プログラム・セグメントの夫々に対して局所メモリ領域
を互いに重ならないように割り付け、プログラム・セグ
メントの夫々に対して順に局所メモリ領域のデータを局
所領域初期値ファイルにダンプし、実機上でリンクされ
た複数のプログラム・セグメントを実行し、共有領域初
期値ファイル及び局所領域初期値ファイルを用いて仮想
的なマルチスレッド・プロセッサを実行し、プログラム
・セグメントを実行した後再び局所メモリ領域のデータ
を局所領域期待値ファイルにダンプし、最後に、全ての
プログラム・セグメントの実行を終えた時点で共有メモ
リ領域を共有領域期待値ファイルにダンプし、実機上で
得られた期待値ファイルと仮想のマルチスレッド・プロ
セッサで得られた実行結果ファイルとを照合することを
特徴とするものである。
According to the invention of claim 1 of the present application, a plurality of originally independent program segments are linked and executed as one program on an actual machine, and initial value data and expected value data for testing are executed. A method for creating test data for a multi-threaded processor, in which the shared memory area is first dumped to a shared area initial value file before execution of all program segments, and then for each of the program segments. Allocate the local memory areas so that they do not overlap each other, dump the data of the local memory areas to the local area initial value file in sequence for each program segment, execute the multiple program segments linked on the actual machine, Virtual multithreading using shared area initial value file and local area initial value file After the processor is executed and the program segment is executed, the data in the local memory area is dumped again to the local area expected value file, and finally the shared memory area is expected to be the shared area when the execution of all program segments is completed. It is characterized in that an expected value file obtained on a real machine and an execution result file obtained by a virtual multi-thread processor are collated with each other by dumping to a value file.

【0011】本願の請求項2の発明は、夫々のプログラ
ム・セグメント実行中のメモリ参照アドレスをトレース
して夫々のトレース・ファイルに記録し、夫々の局所領
域初期値ファイル内のメモリ・ダンプ結果に対して、ト
レース・ファイルに記録されていないアドレスのメモリ
・セル内容をフラッシュして局所領域初期値ファイルを
更新し、夫々の局所領域期待値ファイル内のメモリ・ダ
ンプ結果に対して、トレース・ファイルに記録されてい
ないアドレスのメモリ・セル内容をフラッシュして局所
領域期待値ファイルを更新することを特徴とするもので
ある。
According to the second aspect of the present invention, the memory reference address during execution of each program segment is traced and recorded in each trace file, and the result of the memory dump in each local area initial value file is recorded. In contrast, the contents of memory cells at addresses not recorded in the trace file are flushed to update the local area initial value file, and the trace file is added to the memory dump result in each local area expected value file. The local area expected value file is updated by flushing the contents of the memory cell of the address not recorded in.

【0012】本願の請求項3の発明は、最初のプログラ
ム・セグメントを実行する前にある局所メモリ領域上の
変数をセットし、夫々のプログラム・セグメントの実行
を終了した時点で変数の値を調べ、セットされていれば
局所メモリ領域を局所領域期待値ファイルにダンプし、
フラッシュされていれば停止命令を実行することを特徴
とするものである。
According to a third aspect of the present invention, a variable in a local memory area is set before the first program segment is executed, and the value of the variable is checked when the execution of each program segment is completed. , If set, dump the local memory area to the local area expected value file,
The feature is that a stop instruction is executed if it is flushed.

【0013】[0013]

【作用】このような特徴を有する本願の請求項1の発明
によれば、局所メモリ領域については、プログラム・セ
グメントの夫々に対して局所メモリ領域を互いに重なら
ないように割り付けた後に、プログラム・セグメントの
夫々に対して順に、局所メモリ領域のダンプ、実行、局
所メモリ領域の再ダンプを行なう。このため、各プログ
ラム・セグメントの実行の際に、互いの局所メモリ領域
に対するメモリ・アクセスが重なることなく、各プログ
ラム・セグメント実行の前後におけるメモリ領域の内容
が記録保存される。全てのプログラム・セグメントの実
行に先だってまず共有メモリ領域をダンプし、また、共
有メモリ領域については、本来独立な複数のプログラム
・セグメントをリンクして、1つのプログラムとして実
機上で実行する。また共有領域初期値ファイル及び局所
領域初期値ファイルを用いて仮想のマルチスレッド・プ
ロセッサのプログラムを実行する。全てのプログラム・
セグメントの実行を終えた時点で、再び共有メモリ領域
をダンプするため、全てのプログラム・セグメントの実
行開始時点及び終了時点でのメモリ領域の内容を記録保
存する。次に実機上で得られた期待値ファイルと仮想の
マルチスレッド・プロセッサで得られた実行結果ファイ
ルを照合する。
According to the invention of claim 1 of the present application having such a characteristic, the local memory areas are allocated to the respective program segments so that they do not overlap each other, and then the program segments are allocated. The local memory area is dumped, executed, and the local memory area is redumped in sequence for each of the above. Therefore, when executing each program segment, the contents of the memory area before and after the execution of each program segment are recorded and saved without overlapping memory accesses to each other's local memory areas. Before executing all the program segments, the shared memory area is first dumped, and the shared memory area is linked to a plurality of originally independent program segments and executed as one program on the actual machine. Also, a virtual multithread processor program is executed using the shared area initial value file and the local area initial value file. All programs
Since the shared memory area is dumped again when the execution of the segment is completed, the contents of the memory area at the start and end of execution of all program segments are recorded and saved. Next, the expected value file obtained on the actual machine and the execution result file obtained by the virtual multi-thread processor are compared.

【0014】又本願の請求項2の発明によれば、夫々の
プログラム・セグメント実行中のメモリ参照アドレスを
トレースして、夫々のトレース・ファイルに記録する。
また局所領域のメモリ・ダンプ結果に対してトレース・
ファイルに記録されていないアドレスのメモリの内容を
フラッシュしてダンプ結果を更新する。このため実行中
に参照されなかったメモリの内容はフラッシュされ、参
照されたメモリ・セルの内容のみが残ることとなる。
According to the second aspect of the present invention, the memory reference address during execution of each program segment is traced and recorded in each trace file.
Also, trace the memory dump result in the local area.
Update the dump result by flushing the memory contents of the address not recorded in the file. This causes the contents of the memory that were not referenced during execution to be flushed, leaving only the contents of the referenced memory cells.

【0015】更に本願の請求項3の発明によれば、最初
のプログラム・セグメントを実行する前に、ある局所メ
モリ領域上の変数をセットし、夫々のプログラム・セグ
メントの実行を終了した時点でその変数の値を調べる。
そして、セットされていれば局所メモリ領域のデータを
局所領域期待値ファイルにダンプし、フラッシュされて
いれば停止命令を実行する。このためテスト・データ作
成時には、変数に値がセットされていればダンプを行な
い、検証時には変数の値がフラッシュされていれば停止
命令が実行される。
Further, according to the invention of claim 3 of the present application, a variable in a certain local memory area is set before the first program segment is executed, and when the execution of each program segment is completed, that variable is set. Examine the value of the variable.
Then, if it is set, the data in the local memory area is dumped to the local area expected value file, and if it is flushed, the stop instruction is executed. Therefore, when the test data is created, a dump is performed if the value of the variable is set, and at the time of verification, the stop instruction is executed if the value of the variable is flushed.

【0016】[0016]

【実施例】以下本発明のマルチスレッド・プロセッサの
テスト・データ作成方法の一実施例について、図面を参
照しながら説明する。図2は本実施例におけるテスト・
データ作成環境を示す階層図ある。図2において、ハー
ドウェアであるワークステーション(WS)21は、オ
ペレーティング・システム(OS)22の下で動作する
プロセッサである。テスト・データ作成ツール23、V
erilogシミュレータ24、Verilogで記述
されたマルチスレッド・プロセッサ25、テスト・プロ
グラム(実行可能形式)26a、テスト・プログラム
(Verilog用に変換された形式)26bは、夫々
OS22の上で動作するものである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a test data creating method for a multi-thread processor according to the present invention will be described below with reference to the drawings. Figure 2 shows the test in this example.
It is a hierarchy figure which shows a data creation environment. In FIG. 2, a workstation (WS) 21, which is hardware, is a processor that operates under an operating system (OS) 22. Test data creation tool 23, V
The erilog simulator 24, the multi-thread processor 25 described in Verilog, the test program (executable format) 26a, and the test program (the format converted for Verilog) 26b operate on the OS 22, respectively. .

【0017】一般にWS21は、OS22と呼ばれる基
本ソフトウェアによりハードウェアが管理されたもので
あり、この上で種々のアプリケーション・プログラムが
実行される。本実施例では、開発するマルチスレッド・
プロセッサの命令セットがWS21の命令セットと同一
であるものとし、さらに、マルチスレッド・プロセッサ
はハードウェア記述言語であるVerilog(米国Ca
ndens Design Sstems社)を用いて設計されているもの
とする。
In general, the WS 21 has its hardware managed by basic software called an OS 22, on which various application programs are executed. In this example, the multithread to be developed
The instruction set of the processor is assumed to be the same as that of WS21, and the multi-threaded processor is a hardware description language Verilog (US Ca
ndens Design Sstems).

【0018】テスト・プログラム26aは高級言語また
はアセンブラ言語で記述され、コンパイラまたはアセン
ブラによって実行可能形式に翻訳されたものである。こ
れをテスト・データ作成ツール23の制御のもとで実行
する。OS22に例えばUNIXを使用する場合には、
親プロセスのテスト・プログラム26aをその子プロセ
スとして実行し、テスト・データ作成ツール23はUN
IXのptraceシステム・コールを用いてテスト・
プログラム26aの実行を制御できる。この機構によ
り、テスト・プログラム26aの実行をトレースしてト
レース・ファイルに記録したりメモリ・ダンプを行な
う。
The test program 26a is written in a high level language or an assembler language and is translated into an executable form by a compiler or an assembler. This is executed under the control of the test data creation tool 23. When using UNIX as the OS 22, for example,
The test program 26a of the parent process is executed as its child process, and the test data creation tool 23 is UN
Test using the IX ptrace system call
The execution of the program 26a can be controlled. With this mechanism, the execution of the test program 26a is traced and recorded in a trace file or a memory dump is performed.

【0019】一方、Verilogで記述されたマルチ
スレッド・プロセッサ25は、Verilogシミュレ
ータ24によってマルチスレッド・プロセッサの機能を
仮想的に実現できる。テスト・プログラム26aの命令
コード部分をVerilogシミュレータ24に入力で
きるデータ形式に変換したものがテスト・プログラム2
6bである。Verilogシミュレータ24上の仮想
マルチスレッド・プロセッサ25でテスト・プログラム
26bを実行した結果と、テスト・プログラム26aの
実行結果とが一致していれば、マルチスレッド・プロセ
ッサ25のVerilog記述は正しいことになる。
On the other hand, the multi-thread processor 25 described in Verilog can virtually realize the function of the multi-thread processor by the Verilog simulator 24. The test program 26a is obtained by converting the instruction code portion of the test program 26a into a data format that can be input to the Verilog simulator 24.
6b. If the result of executing the test program 26b by the virtual multi-thread processor 25 on the Verilog simulator 24 and the execution result of the test program 26a match, the Verilog description of the multi-thread processor 25 is correct. .

【0020】図1は本実施例におけるテスト・データ作
成方法のフローチャートである。図1において、ステッ
プ11a,11b,12a,12b,15a,15bの
処理はテスト・データ作成ツール23が担当して処理す
るものであり、その他のステップ13,14,16a,
16b,16cの処理はテスト・プログラム26aに組
み込まれたものである。
FIG. 1 is a flow chart of the test data creating method in this embodiment. In FIG. 1, the processing of steps 11a, 11b, 12a, 12b, 15a, 15b is performed by the test data creation tool 23, and the other steps 13, 14, 16a,
The processes of 16b and 16c are incorporated in the test program 26a.

【0021】図3は本実施例におけるテスト・プログラ
ム実行の流れを摸式的に示すものである。図3におい
て、初期値ファイルとして共有領域初期値ファイル3
1、スレッド1の局所領域初期値ファイル32、スレッ
ド2の局所領域初期値ファイル33が設けられている。
また期待値ファイルとして共有領域期待値ファイル3
4、スレッド1の局所領域期待値ファイル35、スレッ
ド2の局所領域期待値ファイル36が設けられている。
更に実行結果ファイルとして、共有領域実行結果ファイ
ル37、スレッド1の局所領域実行結果ファイル38、
スレッド2の局所領域実行結果ファイル39が設けられ
ている。簡単のためここでは2つのスレッドを並列実行
するのもとしているが、任意数のスレッドに拡張できる
ことは自明である。
FIG. 3 schematically shows the flow of test program execution in this embodiment. In FIG. 3, the shared area initial value file 3 is used as the initial value file.
1, a local area initial value file 32 for thread 1 and a local area initial value file 33 for thread 2 are provided.
Shared area expected value file 3 as expected value file
4, a local area expected value file 35 for thread 1 and a local area expected value file 36 for thread 2 are provided.
Further, as execution result files, a shared area execution result file 37, a local area execution result file 38 of thread 1,
A local area execution result file 39 for thread 2 is provided. For the sake of simplicity, two threads are executed in parallel here, but it is obvious that the number of threads can be extended.

【0022】スレッドとして実行する複数のプログラム
・セグメントはコンパイル時にリンクし、1つのプログ
ラム26aとしてWS21上で逐次実行される。このと
き、図1におけるステップ13、16a、16b、16
cの処理を担当するルーチンをライブラリとして一緒に
リンクしておく。まず、スレッド1の実行を開始する直
前で、テスト・プログラム26aの共有メモリ領域のデ
ータを共有領域初期値ファイル31にダンプする(ステ
ップ11aの処理)。次に、スレッド1の使用する局所
メモリ領域の割り付け(ステップ13の処理)を行な
う。
A plurality of program segments executed as threads are linked at the time of compilation, and are sequentially executed as one program 26a on the WS 21. At this time, steps 13, 16a, 16b, 16 in FIG.
The routine in charge of the processing of c is linked together as a library. First, immediately before the execution of the thread 1 is started, the data in the shared memory area of the test program 26a is dumped to the shared area initial value file 31 (processing of step 11a). Next, the local memory area used by the thread 1 is allocated (processing of step 13).

【0023】スレッドが使用する共有データのメモリ領
域は、リンク時にそれぞれ割り当てられるのでここでは
特に考慮する必要はないが、局所データに対するメモリ
領域はプログラム実行時に動的に割り付けるため、スレ
ッドのプログラム・セグメントを実行する前に、スレッ
ド間で局所データのメモリ領域に重なりが生じないよう
に割り付け直す必要がある。この割り付け方法について
は後述する。
The shared data memory areas used by the threads are allocated at the time of linking, so that it is not necessary to consider it here. However, since the memory area for the local data is dynamically allocated at the time of program execution, the thread's program segment is allocated. Before executing, it is necessary to reallocate the memory area of the local data so that the threads do not overlap each other. This allocation method will be described later.

【0024】スレッド1に対する局所メモリ領域の割り
付けを行なった後、この割り付けた局所メモリ領域のデ
ータを局所領域初期値ファイル32にダンプする(ステ
ップ12aの処理)。実際には、スレッド1に局所的な
実行環境情報として、局所メモリ領域以外にレジスタの
内容などをダンプする必要があるが、ここでは省略す
る。そしてスレッド1の実行を開始し(ステップ14の
処理)、スレッド1のプログラム・セグメントを実行す
る。そしてスレッド1の実行直後に、再び局所メモリ領
域のデータを局所領域期待値ファイル35にダンプする
(ステップ12bの処理)。
After allocating the local memory area to the thread 1, the data of the allocated local memory area is dumped to the local area initial value file 32 (processing of step 12a). Actually, as the execution environment information local to the thread 1, it is necessary to dump the contents of the register other than the local memory area, but the description is omitted here. Then, the execution of the thread 1 is started (step 14), and the program segment of the thread 1 is executed. Immediately after the execution of the thread 1, the data in the local memory area is again dumped to the local area expected value file 35 (processing of step 12b).

【0025】次に、スレッド2に対して同様の処理を行
ない、局所領域初期値ファイル33および局所領域期待
値ファイル36を得る。また、スレッド2のプログラム
・セグメントを実行し終えた時点で、共有メモリ領域の
データを共有領域期待値ファイル34にダンプする(ス
テップ11bの処理)。
Next, the same process is performed on the thread 2 to obtain the local area initial value file 33 and the local area expected value file 36. Further, when the program segment of the thread 2 has been executed, the data in the shared memory area is dumped to the shared area expected value file 34 (processing of step 11b).

【0026】Verilogシミュレータ24によって
実現される仮想マルチスレッド・プロセッサ25上で
は、上記のようにして生成されたファイル31、32、
33からメモリ上の初期イメージを作成し、スレッド1
およびスレッド2を並列に実行する。シミュレーション
(実行)終了時に、共有メモリ領域のデータを共有領域
実行結果ファイル37に、スレッド1の局所メモリ領域
のデータを局所領域実行結果ファイル38に、スレッド
2の局所メモリ領域のデータを局所領域実行結果ファイ
ル39に夫々ダンプする。そして、期待値ファイル3
4、35、36と実行結果ファイル37、38、39と
をそれぞれ比較することで、マルチスレッド・プロセッ
サ25のVerilog記述を検証する。
On the virtual multi-thread processor 25 realized by the Verilog simulator 24, the files 31, 32 generated as described above,
Create an initial image in memory from 33, and thread 1
And thread 2 run in parallel. At the end of the simulation (execution), the data in the shared memory area is executed in the shared area execution result file 37, the data in the local memory area of thread 1 is executed in the local area execution result file 38, and the data in the local memory area of thread 2 is executed in the local area. The result files 39 are dumped respectively. And expected value file 3
The Verilog description of the multi-thread processor 25 is verified by comparing 4, 35 and 36 with the execution result files 37, 38 and 39, respectively.

【0027】次に、局所メモリ領域の割り付けのステッ
プ13について説明する。大抵の高級言語では、データ
領域を共有領域と局所領域とに分けて使用する。共有領
域はコンパイル時に割り付けられるのに対して、局所領
域は実行時に割り付けられるもので、スタック領域とも
呼ばれる。スタック領域は一般にサブルーチン内でのみ
使用されるデータを記憶するための領域であり、プログ
ラム実行の時間的経過とともに使用領域のサイズも変化
する。
Next, step 13 of allocating the local memory area will be described. In most high-level languages, the data area is divided into a shared area and a local area. The shared area is allocated at compile time, while the local area is allocated at run time and is also called the stack area. The stack area is an area for storing data which is generally used only in a subroutine, and the size of the used area also changes with the passage of time of program execution.

【0028】この領域内のデータは、一般に、プロセッ
サ内に保持されているスタック・ポインタあるいはフレ
ーム・ポインタからの相対アドレスでアドレッシングさ
れるため、図1におけるステップ13の処理では、この
スタック・ポインタ(又はフレーム・ポインタ)の値を
書き換えることでスタック領域の割り付けを行なう。こ
の様子を図4に示す。図4においてスレッド1のメモリ
空間41aは、共有メモリ領域41bと局所メモリ領域
41cを有している。スレッド2のメモリ空間42a
は、共有メモリ領域42bと局所メモリ領域42cを有
している。テスト・プログラム26aのメモリ空間43
aは、上から順にスレッド1の局所メモリ領域41c、
スレッド2の局所メモリ領域42c、スレッド2の共有
メモリ領域42b、スレッド1の共有メモリ領域41b
を有している。
Since the data in this area is generally addressed by the relative address from the stack pointer or the frame pointer held in the processor, the stack pointer ( Alternatively, the stack area is allocated by rewriting the value of the frame pointer). This is shown in FIG. In FIG. 4, the memory space 41a of the thread 1 has a shared memory area 41b and a local memory area 41c. Memory space 42a of thread 2
Has a shared memory area 42b and a local memory area 42c. Memory space 43 of test program 26a
a is the local memory area 41c of the thread 1 in order from the top,
Local memory area 42c of thread 2, shared memory area 42b of thread 2, shared memory area 41b of thread 1
have.

【0029】一般に局所メモリ領域は、プログラム実行
前に初期化されない。従って、メモリ上のごみデータも
一緒に局所領域初期値ファイルや局所領域期待値ファイ
ルにダンプされてしまう。これは局所領域期待値ファイ
ルと局所領域実行結果ファイルとを比較する際の障害と
なるため、スレッドの実行(ステップ14の処理)を行
なう間、その実行中にアクセスされたデータのアドレス
をトレースする。このトレース結果をもとに、局所領域
初期値ファイルや局所領域期待値ファイル中のデータで
実際に参照されたアドレスのデータのみを残し、参照さ
れていないアドレスについてはその内容をすべて0にフ
ラッシュすることにより、局所領域実行結果ファイルと
の比較の際の障害を取り除く。
Generally, the local memory area is not initialized before program execution. Therefore, the garbage data on the memory is also dumped to the local area initial value file and the local area expected value file. Since this becomes an obstacle when comparing the local area expected value file and the local area execution result file, the address of the data accessed during the execution is traced during the execution of the thread (processing of step 14). . Based on this trace result, only the data of the address actually referred to by the data in the local area initial value file or the local area expected value file is left, and the contents of all unreferenced addresses are flushed to 0. By doing so, the obstacle at the time of comparison with the local area execution result file is removed.

【0030】以上のように本実施例によれば、すべての
プログラム・セグメントの実行に先だって、まず共有メ
モリ領域のデータを共有領域初期値ファイルにダンプ
し、次にプログラム・セグメントの夫々に対して局所メ
モリ領域を互いに重ならないように割り付ける。そして
この後、プログラム・セグメントの夫々に対して順に、
局所メモリ領域のデータを局所領域初期値ファイルにダ
ンプしてプログラム・セグメントを実行する。そして再
び局所メモリ領域のデータを局所領域期待値ファイルに
ダンプし、最後に、全てのプログラム・セグメントの実
行を終えた時点で、共有メモリ領域のデータを共有領域
期待値ファイルにダンプすることにより、単一スレッド
・プロセッサの実行環境上で自動的にマルチスレッド・
プロセッサ検証用のテスト・データを作成することがで
きる。
As described above, according to this embodiment, prior to the execution of all the program segments, the data in the shared memory area is first dumped to the shared area initial value file, and then the program segments are respectively processed. Allocate local memory areas so that they do not overlap each other. And after this, for each of the program segments,
The data in the local memory area is dumped to the local area initial value file and the program segment is executed. Then, the data in the local memory area is again dumped to the local area expected value file, and finally, when the execution of all program segments is finished, the data in the shared memory area is dumped to the shared area expected value file. Automatically multi-threaded on a single-threaded processor execution environment
Test data can be created for processor verification.

【0031】最後に、スレッドの終了に関するトリック
について説明する。まず、最初に局所メモリ領域上の変
数flagを1にセットする(ステップ16aの処
理)。各スレッドはこの変数を参照してはならない。テ
スト・データ作成時には変数flagの値は1のままで
あるので、ステップ16bにおける判定では常にステッ
プ12b側へ制御が流れる。しかし、トレース結果によ
る局所領域初期値ファイルの更新で、Verilogシ
ミュレーション時には、変数flagの値は0にフラッ
シュされてしまっている。従って、ステップ16bにお
ける判定では常にステップ16c側へ制御が流れ、各ス
レッドは夫々実行すべきプログラム・セグメントの実行
を終えると、停止命令を実行して停止する。なお、変数
flagを共有メモリ領域上に持つことでも同様の処理
は可能であるが、この場合には変数flagの参照にレ
ジスタが使用され、シミュレーションに若干の影響があ
る。
Finally, a trick regarding thread termination will be described. First, the variable flag on the local memory area is first set to 1 (processing of step 16a). Each thread should not reference this variable. Since the value of the variable flag remains 1 when the test data is created, the control always flows to the step 12b side in the determination in step 16b. However, due to the update of the local area initial value file based on the trace result, the value of the variable flag is flushed to 0 during the Verilog simulation. Therefore, in the determination in step 16b, control always flows to the side of step 16c, and when each thread finishes executing the program segment to be executed, it executes a stop instruction and stops. The same process can be performed by having the variable flag in the shared memory area, but in this case, the register is used to refer to the variable flag, which has a slight influence on the simulation.

【0032】以上のように本実施例によれば、最初のプ
ログラム・セグメントを実行する前に、ある局所メモリ
領域上の変数をセットし、夫々のプログラム・セグメン
トの実行を終了した時点で変数の値を調べ、セットされ
ていれば局所メモリ領域のデータを局所領域期待値ファ
イルにダンプし、フラッシュされていれば停止命令を実
行することにより、単一スレッド・プロセッサ環境上で
実行されるテスト・データ作成時のプログラムをマルチ
スレッド・プロセッサの機能シミュレータ(あるいは論
理シミュレータ)上でそのまま使用しながら、早く終了
したスレッドによるメモリ更新を抑制・制御して、プロ
セッサのVerilog記述に検証のための余分な記述
を含めることなく、正しく検証作業を行なうことができ
る。なお、本発明は上記実施例に限定されるものではな
く、本発明の趣旨に基づいて種々の変形が可能であり、
これらを本発明の範囲から排除するものではない。
As described above, according to the present embodiment, variables are set in a certain local memory area before the first program segment is executed, and the variables are set when the execution of each program segment is completed. A test executed on a single-threaded processor environment by examining the value, dumping the data in the local memory area to the local area expected value file if set, and executing the stop instruction if it is flushed. While using the program at the time of data creation as it is on the function simulator (or logic simulator) of the multi-thread processor, suppress / control the memory update by the thread that has terminated early, and add extra data for verification to the Verilog description of the processor. Correct verification work can be performed without including the description. The present invention is not limited to the above-mentioned embodiment, and various modifications can be made based on the spirit of the present invention.
They are not excluded from the scope of the present invention.

【0033】[0033]

【発明の効果】以上のように本願の請求項1の発明によ
れば、単一スレッド・プロセッサの実行環境上で自動的
にマルチスレッド・プロセッサ検証用のテスト・データ
を作成することができる。このためマルチスレッド・プ
ロセッサ検証作業の正確さの向上、及び検証作業時間の
短縮を実現することができる。
As described above, according to the first aspect of the present invention, it is possible to automatically create the test data for verifying the multi-thread processor in the execution environment of the single-thread processor. Therefore, the accuracy of the multi-thread processor verification work can be improved and the verification work time can be shortened.

【0034】又本願の請求項2の発明によれば、上記の
発明の効果に加えて、単一スレッド・プロセッサ環境上
でプログラムの実行をする際に、局所メモリ領域上に残
されたゴミ・データを除去できる。このため生成した局
所領域期待値ファイルの内容と、マルチスレッド・プロ
セッサの機能シミュレーション(又は論理シミュレーシ
ョン)結果とを単純に比較して、一致しているか否かを
調べるだけでマルチスレッド・プロセッサの動作確認を
行なうことができる。
According to the invention of claim 2 of the present application, in addition to the effects of the above-mentioned invention, when a program is executed in a single-thread processor environment, dust left on the local memory area Data can be removed. Therefore, the contents of the generated local area expected value file are simply compared with the functional simulation (or logic simulation) result of the multi-thread processor, and the operation of the multi-thread processor is checked only by checking whether they match. Confirmation can be done.

【0035】又本願の請求項3の発明によれば、上記の
発明の効果に加えて、機能シミュレーション(又は論理
シミュレーション)には各スレッドが夫々のプログラム
・セグメントの実行を終えると停止命令を実行される。
このため、スレッド間で実行終了時間のばらつきが存在
しても、早く終了したスレッドがメモリを更新すること
がなく、生成した局所領域期待値ファイルの内容とシミ
ュレーション結果とを比較することで、正しくマルチス
レッド・プロセッサの検証を行なうことができる。
According to the invention of claim 3 of the present application, in addition to the effects of the invention described above, in the functional simulation (or logic simulation), when each thread finishes executing its respective program segment, a stop instruction is executed. To be done.
Therefore, even if there is a variation in the execution end time among threads, the threads that finish early do not update the memory, and by comparing the contents of the generated local area expected value file with the simulation results, Multithreaded processor verification can be performed.

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

【図1】本発明の実施例におけるテスト・データ作成方
法のフローチャートである。
FIG. 1 is a flowchart of a test data creating method according to an embodiment of the present invention.

【図2】本実施例におけるテスト・データ作成環境のソ
フトウェア階層図である。
FIG. 2 is a software hierarchy diagram of a test data creation environment in the present embodiment.

【図3】本実施例におけるテスト・プログラム実行の摸
式図である。
FIG. 3 is a schematic diagram of test program execution in the present embodiment.

【図4】本実施例におけるテスト・プログラムのメモリ
空間マップを示す図である。
FIG. 4 is a diagram showing a memory space map of a test program in this embodiment.

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

21 ワークステーション 22 オペレーティング・システム 23 テスト・データ作成ツール 24 Verilogシミュレータ 25 マルチスレッド・プロセッサのVerilog記
述 26a,26b テスト・プログラム 31 共有領域初期値ファイル 32 スレッド1の局所領域初期値ファイル 33 スレッド2の局所領域初期値ファイル 34 共有領域期待値ファイル 35 スレッド1の局所領域期待値ファイル 36 スレッド2の局所領域期待値ファイル 37 共有領域実行結果ファイル 38 スレッド1の局所領域実行結果ファイル 39 スレッド2の局所領域実行結果ファイル 41a スレッド1のメモリ空間 41b スレッド1の共有メモリ領域 41c スレッド1の局所メモリ領域 42a スレッド2のメモリ空間 42b スレッド2の共有メモリ領域 42c スレッド2の局所メモリ領域 43a テスト・プログラムのメモリ空間
21 workstation 22 operating system 23 test data creation tool 24 Verilog simulator 25 Verilog description of multi-thread processor 26a, 26b test program 31 shared area initial value file 32 local area initial value file 33 thread 1 local of thread 2 Area initial value file 34 Shared area expected value file 35 Local area expected value file of thread 1 36 Local area expected value file of thread 2 37 Shared area execution result file 38 Local area execution result file of thread 1 39 Local area execution of thread 2 Result file 41a Memory space for thread 1 41b Shared memory area for thread 1 41c Local memory area for thread 1 42a Memory space for thread 2 42b Thread 2 Shared memory space of the local memory area 43a test program memory area 42c thread 2

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 本来独立な複数のプログラム・セグメン
トをリンクして1つのプログラムとして実機上で実行
し、テスト用の初期値データと期待値データを作成する
マルチスレッド・プロセッサのテスト・データ作成方法
であって、 全ての前記プログラム・セグメントの実行に先だってま
ず共有メモリ領域を共有領域初期値ファイルにダンプ
し、 次に前記プログラム・セグメントの夫々に対して局所メ
モリ領域を互いに重ならないように割り付け、 前記プログラム・セグメントの夫々に対して順に局所メ
モリ領域のデータを局所領域初期値ファイルにダンプ
し、 実機上でリンクされた複数のプログラム・セグメントを
実行し、 共有領域初期値ファイル及び局所領域初期値ファイルを
用いて仮想的なマルチスレッド・プロセッサを実行し、 前記プログラム・セグメントを実行した後再び局所メモ
リ領域のデータを局所領域期待値ファイルにダンプし、 最後に、全ての前記プログラム・セグメントの実行を終
えた時点で共有メモリ領域を共有領域期待値ファイルに
ダンプし、 実機上で得られた期待値ファイルと仮想のマルチスレッ
ド・プロセッサで得られた実行結果ファイルとを照合す
ることを特徴とするマルチスレッド・プロセッサのテス
ト・データ作成方法。
1. A test data creation method for a multi-thread processor for linking a plurality of originally independent program segments and executing them as one program on an actual machine to create initial value data and expected value data for testing. However, prior to executing all the program segments, the shared memory area is first dumped to the shared area initial value file, and then the local memory areas are allocated to the respective program segments so as not to overlap each other, The data of the local memory area is sequentially dumped to the local area initial value file for each of the above program segments, and a plurality of linked program segments are executed on the actual machine, and the shared area initial value file and local area initial value are Run a virtual multithreaded processor using files, After executing the program segment, the data in the local memory area is dumped to the local area expected value file again, and finally, the shared memory area is changed to the shared area expected value file when the execution of all the program segments is finished. A method for creating test data for a multi-thread processor, which comprises dumping and comparing an expected value file obtained on a real machine with an execution result file obtained by a virtual multi-thread processor.
【請求項2】 夫々の前記プログラム・セグメント実行
中のメモリ参照アドレスをトレースして夫々のトレース
・ファイルに記録し、 夫々の前記局所領域初期値ファイル内のメモリ・ダンプ
結果に対して、前記トレース・ファイルに記録されてい
ないアドレスのメモリ・セル内容をフラッシュして前記
局所領域初期値ファイルを更新し、 夫々の前記局所領域期待値ファイル内のメモリ・ダンプ
結果に対して、前記トレース・ファイルに記録されてい
ないアドレスのメモリ・セル内容をフラッシュして前記
局所領域期待値ファイルを更新することを特徴とする請
求項1記載のマルチスレッド・プロセッサのテスト・デ
ータ作成方法。
2. A memory reference address during execution of each program segment is recorded and recorded in each trace file, and the trace is performed for a memory dump result in each local area initial value file. Update the local area initial value file by flushing the memory cell contents of addresses not recorded in the file, and write the trace file to the trace file for each memory dump result in the local area expected value file. 2. The test data creating method for a multi-thread processor according to claim 1, wherein the contents of memory cells at unrecorded addresses are flushed to update the local area expected value file.
【請求項3】 最初の前記プログラム・セグメントを実
行する前にある局所メモリ領域上の変数をセットし、 夫々の前記プログラム・セグメントの実行を終了した時
点で前記変数の値を調べ、セットされていれば局所メモ
リ領域を局所領域期待値ファイルにダンプし、フラッシ
ュされていれば停止命令を実行することを特徴とする請
求項2記載のマルチスレッド・プロセッサのテスト・デ
ータ作成方法。
3. A variable in a local memory area before the first execution of the program segment is set, and when the execution of each of the program segments is completed, the value of the variable is examined and set. 3. The test data creation method for a multi-thread processor according to claim 2, wherein the local memory area is dumped to a local area expected value file, and the stop instruction is executed if it is flushed.
JP7043506A 1995-02-07 1995-02-07 Test data preparing method for multithread processor Pending JPH08212103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7043506A JPH08212103A (en) 1995-02-07 1995-02-07 Test data preparing method for multithread processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7043506A JPH08212103A (en) 1995-02-07 1995-02-07 Test data preparing method for multithread processor

Publications (1)

Publication Number Publication Date
JPH08212103A true JPH08212103A (en) 1996-08-20

Family

ID=12665624

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7043506A Pending JPH08212103A (en) 1995-02-07 1995-02-07 Test data preparing method for multithread processor

Country Status (1)

Country Link
JP (1) JPH08212103A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008197980A (en) * 2007-02-14 2008-08-28 Nec Corp Failure analysis file weight reduction device for distributed parallel program, its method and its program
CN108874666A (en) * 2018-05-30 2018-11-23 平安普惠企业管理有限公司 Automatic generation of test data, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008197980A (en) * 2007-02-14 2008-08-28 Nec Corp Failure analysis file weight reduction device for distributed parallel program, its method and its program
CN108874666A (en) * 2018-05-30 2018-11-23 平安普惠企业管理有限公司 Automatic generation of test data, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US5313387A (en) Re-execution of edit-compile-run cycles for changed lines of source code, with storage of associated data in buffers
US5325531A (en) Compiler using clean lines table with entries indicating unchanged text lines for incrementally compiling only changed source text lines
US5193191A (en) Incremental linking in source-code development system
US5201050A (en) Line-skip compiler for source-code development system
US5170465A (en) Incremental-scanning compiler for source-code development system
US5182806A (en) Incremental compiler for source-code development system
JP2019537782A (en) System, method and device for vertically integrated instrumentation and trace reconstruction
US20060200806A1 (en) Apparatus, system, and method for trace insertion
US20120198427A1 (en) Ensuring Register Availability for Dynamic Binary Optimization
US20230004368A1 (en) Multi-chip compatible compiling method and device
JPH1083326A (en) Trace data collecting method and computer readable code
Mercer et al. Model checking machine code with the GNU debugger
US5301327A (en) Virtual memory management for source-code development system
US7676774B2 (en) System LSI verification system and system LSI verification method
KR100597414B1 (en) Data processing device and register allocation method using data processing device
EP0406028A2 (en) Incremental compiler for source code development system
Lee et al. Interactive program debugging and optimization for directive-based, efficient gpu computing
JPH09114693A (en) Program development supporting device and program execution device
JP2919302B2 (en) CPU simulation method
KR0125605B1 (en) Method and device for verifying operation of machine language program
JPH08212103A (en) Test data preparing method for multithread processor
Carver et al. Deterministic execution testing of concurrent Ada programs
Melcher et al. Controller synthesis for the “production cell” case study
JP3745968B2 (en) Test system, test method, test program, and computer-readable recording medium recording the test program
JPH0773044A (en) Method and device for optimization compilation