JPH0434181B2 - - Google Patents

Info

Publication number
JPH0434181B2
JPH0434181B2 JP56201620A JP20162081A JPH0434181B2 JP H0434181 B2 JPH0434181 B2 JP H0434181B2 JP 56201620 A JP56201620 A JP 56201620A JP 20162081 A JP20162081 A JP 20162081A JP H0434181 B2 JPH0434181 B2 JP H0434181B2
Authority
JP
Japan
Prior art keywords
data
instruction
branch
memory means
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP56201620A
Other languages
Japanese (ja)
Other versions
JPS58103047A (en
Inventor
Takeshi Nakadokoro
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP56201620A priority Critical patent/JPS58103047A/en
Publication of JPS58103047A publication Critical patent/JPS58103047A/en
Publication of JPH0434181B2 publication Critical patent/JPH0434181B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 本発明は、デイジタル電子計算機によつて実行
された命令を記憶する場合に、特にその実行順序
および実行回数を知る必要がない場合に好適な実
行命令を記憶する命令トレース装置に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention provides an instruction trace system for storing executed instructions, which is suitable for storing instructions executed by a digital computer, especially when it is not necessary to know the order of execution and the number of times of execution. Regarding equipment.

最近、ソフトウエアプログラムの高信頼化のた
めに、テストのために用意したすべてのテストデ
ータを実行させた時に、被テストプログラム中の
パスの実行がどの程度網らされたかを測定する、
テスト充分性評価が行なわれており、その際に命
令トレース装置を用いれば、被テストプログラム
の実行に影響を与えないという利点がある。
Recently, in order to improve the reliability of software programs, when all the test data prepared for the test is executed, the extent to which the execution of the paths in the program under test is shaded is measured.
Test sufficiency evaluation is performed, and if an instruction tracing device is used at that time, there is an advantage that the execution of the program under test is not affected.

従来の命令トレース装置は、すべての実行命令
あるいは分岐命令をその実行順序に従つて記憶す
るため、記憶すべき命令が膨大となり、大きな記
憶容量を有する記憶装置を必要とするという欠
点、およびこの記憶容量の制限のために命令トレ
ースの期間が比較的短時間に限られるという欠点
があつた。
Conventional instruction trace devices store all executed instructions or branch instructions in their execution order, so the number of instructions to be stored becomes enormous, requiring a storage device with a large storage capacity. The drawback was that the instruction trace period was limited to a relatively short period of time due to capacity limitations.

本発明の目的は、この問題を解決するために、
小さな記憶容量を有する記憶装置を用いるだけで
よく、かつ、命令トレースの期間を長時間にでき
る命令トレース装置を提供することにある。
The purpose of the present invention is to solve this problem by
It is an object of the present invention to provide an instruction tracing device which requires only the use of a storage device having a small storage capacity and which can extend the period of instruction tracing.

このような目的を達成するために、本発明で
は、最も最近に入力された特定個数の、分岐命令
アドレスとその分岐アドレスの対を別の高速アク
セス記憶装置に記憶しておき、新たに記憶させよ
うとする分岐命令アドレスと分岐先アドレスの対
が、この記憶装置内に記憶されている時はそれを
トレース記憶装置に記憶しないようにしたことに
特徴がある。
In order to achieve such an objective, the present invention stores a specific number of most recently input pairs of branch instruction addresses and their branch addresses in a separate high-speed access storage device, and then stores them newly. A feature of this method is that when a pair of a branch instruction address and a branch destination address to be executed is stored in this storage device, it is not stored in the trace storage device.

本発明は、プログラムのテストを行つた際に、
未だ1度も実行されていないパスの検出を、命令
トレースによつて行う場合に有効である。すなわ
ち、通常、命令トレースはプログラムの実行順序
を調べるのに用いるので、分岐命令の実行順序が
重要であるが、未実行パス検出の場合は、実行の
有無のみ調べれば良く、そのような場合に本発明
を適用すれば効果的である。
In the present invention, when testing a program,
This is effective when detecting a path that has never been executed by using instruction tracing. In other words, instruction tracing is normally used to check the execution order of a program, so the execution order of branch instructions is important, but in the case of unexecuted path detection, it is only necessary to check whether or not execution has occurred; Applying the present invention is effective.

以下、本発明の実施例を図面により説明する。 Embodiments of the present invention will be described below with reference to the drawings.

第1図は本発明による命令トレース装置の一実
施例の構成を示すものである。従来の命令トレー
ス装置は、デイジタル電子計算機1において実行
される命令に関する、命令アドレス、命令の種
類、分岐先アドレスなどのデータを取込み、分岐
命令選択部2において分岐命令のみを選択し、ト
レース用メモリ制御部5においてその分岐命令の
命令アドレスと分岐先アドレスの対をトレース用
メモリ制御部5を通してトレース用メモリ6に書
き込むという動作をデイジタル電子計算機1にお
いて命令が実行される毎に繰返すと共に、トレー
ス用メモリ6に書き込まれたデータが一定量にな
るとそのデータをトレース用メモリ制御部5が外
部記憶装置7に書き出すようになつている。
FIG. 1 shows the configuration of an embodiment of an instruction tracing device according to the present invention. A conventional instruction trace device takes in data such as an instruction address, instruction type, and branch destination address regarding an instruction to be executed in a digital computer 1, selects only the branch instruction in a branch instruction selection unit 2, and stores the data in a trace memory. The control unit 5 repeats the operation of writing the pair of the instruction address and branch destination address of the branch instruction into the trace memory 6 through the trace memory control unit 5 every time an instruction is executed in the digital computer 1. When the data written in the memory 6 reaches a certain amount, the trace memory control section 5 writes the data to the external storage device 7.

第1図の命令トレース装置100内の照合用メ
モリ制御部3および高速アクセス可能な照合用メ
モリ4は本発明により設けられた部分であり、照
合用メモリ制御部3は次の動作を行う。
The verification memory control section 3 and the high-speed accessible verification memory 4 in the instruction tracing device 100 shown in FIG. 1 are parts provided according to the present invention, and the verification memory control section 3 performs the following operations.

(1) 分岐命令選択部2によつて選択された分岐命
令の命令アドレスと分岐先アドレスの対と同じ
ものが照合用メモリ4内に有るか否かを調べ、
もし有れば、本データをトレース用メモリ制御
部5に送らないようにする。従つて、本データ
はトレース用メモリ6には書き込まれない。
(1) Check whether the same pair of instruction address and branch destination address of the branch instruction selected by the branch instruction selection unit 2 exists in the verification memory 4;
If there is, this data is not sent to the trace memory control section 5. Therefore, this data is not written to the trace memory 6.

(2) 本データが照合メモリ4内に無い場合は、そ
のデータを照合メモリ4内に書き込むと共に、
トレース用メモリ制御部5に送り、トレース用
メモリ6にも書き込む。
(2) If this data is not in the verification memory 4, write that data in the verification memory 4, and
It is sent to the trace memory control unit 5 and also written to the trace memory 6.

(3) (2)において、本データを書き込む場合に、照
合用メモリ4内に空きエリアが無い場合は、既
に書き込まれているデータのうちで初めに書き
込まれたデータのエリアに本データを書き込
む。
(3) In (2), when writing this data, if there is no free area in the verification memory 4, write this data in the area of the data that was written first among the data that has already been written. .

第2図は第1図の照合用メモリ制御部3での動
作の詳細なフローを示すものである。
FIG. 2 shows a detailed flow of operations in the collation memory control section 3 of FIG. 1.

第2図に示すように、まず、ステツプ11にお
いて、サーチ用ポインタspに照合メモリ4の先頭
番地をセツトする。次に、ステツプ12において
分岐命令選択部2より分岐命令が送られてくる
と、その入力された分岐命令アドレスと分岐先ア
ドレスの対が、ポインタspで指す照合メモリ4内
のデータと同じかどうかを調べ、もし、同じであ
れば、処理を終了してデータをトレース用メモリ
制御部に送らないようにする。
As shown in FIG. 2, first, in step 11, the starting address of the collation memory 4 is set in the search pointer sp. Next, in step 12, when a branch instruction is sent from the branch instruction selection unit 2, whether the input pair of branch instruction address and branch destination address is the same as the data in the collation memory 4 pointed to by the pointer sp. If they are the same, the process is terminated and data is not sent to the trace memory control unit.

一方、入力されたデータがポインタspで指す照
合メモリ4のデータと同じでなければ、ステツプ
13において、ポインタspに1データ分の長さを
加え、ステツプ14において、その値が照合メモ
リ4の最後尾番地より大きいかどうかを調べ、も
し、大きくなければ上述したステツプ12からの
動作を繰り返す。もし、ポインタspの値が照合メ
モリ4の最後尾番地より大きくなれば、ステツプ
15に進み、書き込み用ポインタwpの指す照合
メモリ4内のエリアに入力データを書き込む。次
に、ステツプ16,17では、ポインタwpに1
データ分の長さを加え、その値が、照合メモリ4
の最後尾番地より大きいかどうかを調べ、もし大
きければ、ステツプ18において、ポインタwp
に照合メモリ4の先頭番地をセツトする。
On the other hand, if the input data is not the same as the data in the collation memory 4 pointed to by the pointer sp, in step 13, the length of one data is added to the pointer sp, and in step 14, the value is set at the end of the collation memory 4. It is checked whether it is larger than the tail address, and if it is not larger, the operations from step 12 described above are repeated. If the value of the pointer sp becomes larger than the last address of the collation memory 4, the process advances to step 15 and the input data is written in the area in the collation memory 4 pointed to by the write pointer wp. Next, in steps 16 and 17, the pointer wp is set to 1.
The length of the data is added, and the value is
If it is larger than the last address of wp, in step 18, the pointer wp is
The starting address of the collation memory 4 is set at .

なお、上述した例では、入力データと照合用メ
モリ4内データとの比較は、照合用メモリ4の最
後尾番地まで行なわれる場合について説明した
が、書き込み用ポインタwpの指す番地まで行な
うようにしてもよい。
In the above example, the comparison between the input data and the data in the verification memory 4 is performed up to the last address of the verification memory 4. Good too.

本発明の具体的な動作例を説明するために、次
のようなフオートラン(Fortran)プログラムが
計算機1上で実行される場合を考える。
To explain a specific example of the operation of the present invention, consider a case where the following Fortran program is executed on the computer 1.

10 READ(5100)MAX 20 I=1 30 CONTINUE 40 I=I+1 50 IF(I.LE.MAX)GOTO30 60 STOP 本プログラムにおいて、文番号50の実行により
IMAXが成立している場合は、文番号30への
分岐が生じる。従つて、例えばMAXが100の場
合、プログラムの実行順と文番号で表すと、 10 20 30 40 50100回繰返す 〓 60 となる。
10 READ (5100) MAX 20 I=1 30 CONTINUE 40 I=I+1 50 IF (I.LE.MAX) GOTO30 60 STOP In this program, if IMAX is established by executing statement number 50, statement number 30 A branch occurs. Therefore, for example, if MAX is 100, the program execution order and statement numbers are 10 20 30 40 50100 times = 60.

これに本発明の実施例を適用した場合、以下の
動作をする。
When the embodiment of the present invention is applied to this, the following operation is performed.

(1) 文番号10,20,30,40の文は分岐命令を含ま
ないので、分岐命令選択部2を通過しない。
(1) Since the statements with statement numbers 10, 20, 30, and 40 do not include branch instructions, they do not pass through the branch instruction selection unit 2.

(2) 文番号50は分岐命令選択部を通過後、照合用
メモリ制御部3が文番号50のアドレスと分岐先
である文番号30のアドレスの対を照合用メモリ
4に記憶すると共に、そのデータをトレース用
メモリ制御部5に送る。
(2) After statement number 50 passes through the branch instruction selection unit, the matching memory control unit 3 stores the pair of the address of statement number 50 and the address of statement number 30, which is the branch destination, in the matching memory 4, and The data is sent to the trace memory control section 5.

(3) 文番号50の2度目以降の実行時は、照合用メ
モリ制御部3が、照合用メモリ4内に文番号50
から文番号30への分岐データが記憶されている
ことを確認して、そのデータをトレース用メモ
リ制御部5へ送らないようにする。
(3) When executing statement number 50 for the second time or later, the collation memory control unit 3 stores statement number 50 in the collation memory 4.
It is confirmed that the branch data from to statement number 30 is stored, and the data is not sent to the trace memory control unit 5.

(4) トレース用メモリ制御部5は、照合用メモリ
制御部3から送られる分岐データをトレース用
メモリ6に記憶する。
(4) The trace memory control unit 5 stores the branch data sent from the verification memory control unit 3 in the trace memory 6.

以上のように、従来の命令トレース装置では文
番号50から30への分岐データをその実際の実行回
数分(上記例では99回分)だけトレース用メモリ
に記憶するが、本実施例では1回分で済む。
As described above, in the conventional instruction trace device, the branch data from statement number 50 to statement number 30 is stored in the trace memory for the number of times it is actually executed (99 times in the above example), but in this embodiment, it is stored for only one time. It's over.

なお、本発明の実施例には第3図および第4図
に示すような変形例が考えられる。
It should be noted that modifications of the embodiment of the present invention as shown in FIGS. 3 and 4 can be considered.

第3図は、第1図の照合用メモリ4の代りに、
トレース用メモリ6を兼用する例である。通常は
照合用メモリ4はその用法に依存してトレース用
メモリ6よりもアクセス時間が短いものを用いる
必要がある場合が多いが、その必要のない場合
は、本方式が可能である。
In FIG. 3, instead of the collation memory 4 in FIG. 1,
This is an example in which the trace memory 6 is also used. Normally, it is often necessary to use a verification memory 4 with a shorter access time than the trace memory 6 depending on its usage, but if this is not necessary, this method is possible.

第4図は、第1図のトレース用メモリ6を設け
ず、直接、外部記憶装置7に書き込む例である。
通常は外部記憶装置への書き込みに要する時間は
トレース用命令の入力間隔よりも大きいため、ト
レース用メモリ6をバツフアとして用いるが、そ
うでない場合は本方式が可能である。
FIG. 4 shows an example in which the trace memory 6 of FIG. 1 is not provided and data is written directly to the external storage device 7.
Normally, the time required to write to the external storage device is longer than the input interval of trace commands, so the trace memory 6 is used as a buffer, but if this is not the case, this method is possible.

以上述べた実施例からも解るように、本発明に
よれば、従来の命令トレース装置において、実際
の実行回数分の分岐命令データを収集していたも
のをほとんどの場合1回分のデータだけ収集する
ようにしたため、トレース用メモリの使用効率を
大幅に向上できる。
As can be seen from the embodiments described above, according to the present invention, in most cases, data for only one branch instruction is collected instead of the conventional instruction tracing device that collects branch instruction data for the actual number of executions. As a result, trace memory usage efficiency can be greatly improved.

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

第1図は本発明による命令トレース装置の一実
施例の構成図、第2図は第1図の照合用メモリ制
御部の動作の一例を示すフローチヤート、第3図
および第4図はそれぞれ本発明による命令トレー
ス装置の他の実施例の構成図である。 3……照合用メモリ制御部、4……照合用メモ
リ、6……トレース用メモリ。
FIG. 1 is a block diagram of an embodiment of an instruction tracing device according to the present invention, FIG. 2 is a flowchart showing an example of the operation of the verification memory control section of FIG. 1, and FIGS. FIG. 3 is a block diagram of another embodiment of the instruction tracing device according to the invention. 3...Memory control unit for verification, 4...Memory for verification, 6...Memory for tracing.

Claims (1)

【特許請求の範囲】 1 入力された分岐命令毎にその格納アドレスと
その分岐先アドレスとの対のデータを少なくとも
一つ以上記憶する第1のメモリ手段と、前記第1
のメモリ手段を検索することによつて新たに入力
された分岐命令の格納アドレスとその分岐先アド
レスとの対のデータが、上記第1のメモリ手段に
記憶されているかどうかを照合し、記憶されてい
ない時のみそのデータをトレースデータとして得
る制御手段とを備えたことを特徴とする命令トレ
ース装置。 2 上記の新たに入力された分岐命令の格納アド
レスとその分岐先アドレスとの対のデータが上記
第1のメモリ手段に記憶されていない場合で、か
つ、上記第1のメモリ手段に空きエリアがある場
合に、上記の新たに入力された分岐命令の格納ア
ドレスとその分岐先アドレスとの対のデータを上
記第1のメモリ手段に書き込むことを特徴とする
特許請求の範囲第1項記載の命令トレース装置。 3 上記の新たに入力された分岐命令の格納アド
レスとその分岐先アドレスとの対のデータが上記
第1のメモリ手段に記憶されていない場合で、か
つ、上記第1のメモリ手段に空きエリアがない場
合に、上記第1のメモリ手段に既に書き込まれて
いるデータのなかで、最も早く書き込まれたデー
タのエリアに上記の新たに入力された分岐命令の
格納アドレスとその分岐先アドレスとの対のデー
タを書き込むことを特徴とする特許請求の範囲第
1項記載の命令トレース装置。 4 上記分岐命令の格納アドレスまたは分岐先ア
ドレスとして、プログラムのなかに記述された文
番号あるいは名前を用いることを特徴とする特許
請求の範囲第1項記載の命令トレース装置。 5 上記分岐命令の格納アドレスおよび分岐先ア
ドレスとして、エデイタやコンパイラによつて機
械的にプログラムに付加された文番号あるいは行
番号を用いることを特徴とする特許請求の範囲第
1項記載の命令トレース装置。
[Scope of Claims] 1. A first memory means for storing at least one pair of data of a storage address and a branch destination address for each input branch instruction;
By searching the memory means of the first memory means, it is checked whether the pair data of the storage address of the newly input branch instruction and the branch destination address is stored in the first memory means, and the data is stored. and control means for obtaining the data as trace data only when the command is not being executed. 2 If the pair of data of the storage address of the newly input branch instruction and its branch destination address is not stored in the first memory means, and there is no free area in the first memory means; The instruction according to claim 1, characterized in that, in a certain case, data of a pair of the storage address of the newly input branch instruction and its branch destination address is written into the first memory means. tracing device. 3 In the case where the paired data of the storage address of the newly input branch instruction and its branch destination address is not stored in the first memory means, and there is no free area in the first memory means. If not, the pairing of the storage address of the newly input branch instruction and its branch destination address is stored in the area of the data written earliest among the data already written in the first memory means. 2. The instruction tracing device according to claim 1, wherein the instruction tracing device writes data. 4. The instruction tracing device according to claim 1, wherein a statement number or name written in a program is used as the storage address or branch destination address of the branch instruction. 5. The instruction trace according to claim 1, wherein a statement number or line number mechanically added to the program by an editor or compiler is used as the storage address and branch destination address of the branch instruction. Device.
JP56201620A 1981-12-16 1981-12-16 Instruction tracing device Granted JPS58103047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56201620A JPS58103047A (en) 1981-12-16 1981-12-16 Instruction tracing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56201620A JPS58103047A (en) 1981-12-16 1981-12-16 Instruction tracing device

Publications (2)

Publication Number Publication Date
JPS58103047A JPS58103047A (en) 1983-06-18
JPH0434181B2 true JPH0434181B2 (en) 1992-06-05

Family

ID=16444074

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56201620A Granted JPS58103047A (en) 1981-12-16 1981-12-16 Instruction tracing device

Country Status (1)

Country Link
JP (1) JPS58103047A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7155570B1 (en) 2000-09-29 2006-12-26 Intel Corporation FIFO write/LIFO read trace buffer with software and hardware loop compression
JP4243463B2 (en) 2002-08-19 2009-03-25 株式会社半導体理工学研究センター Instruction scheduling simulation method and simulation system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5567853A (en) * 1978-11-16 1980-05-22 Nec Corp Logic device

Also Published As

Publication number Publication date
JPS58103047A (en) 1983-06-18

Similar Documents

Publication Publication Date Title
US6901581B1 (en) Method for software debugging via simulated re-execution of a computer program
US6539500B1 (en) System and method for tracing
CN101446918B (en) Method for realizing debugging of single function by user state debugger and system thereof
US5963741A (en) Information processor which rewrites instructions in program to dynamically change program structure and method therefor
JPS58103047A (en) Instruction tracing device
JPH0581087A (en) Processor monitoring system
JPS60262251A (en) Backup device for development of microprocessor
US20070028218A1 (en) Apparatus, system, and method for a software test coverage analyzer using embedded hardware
US20060161904A1 (en) Semi-automated desk checking system and method
JPS6073756A (en) Program tracer
CN117831605A (en) Solid state storage device debugging method, solid state storage device debugging device and storage medium
JPS61198340A (en) Path coverage measuring system
JPS61123942A (en) Debug device for microprocessor
JPH01166143A (en) Debugging system for firmware program
JPH02230335A (en) Tracing system of farmware
JPH0267644A (en) Specification verifying system
JPH07191875A (en) Debugger
JPS6367696B2 (en)
JPH0324640A (en) Debugging system for information processor
JPH06250879A (en) Program access tracing device
JPS5960657A (en) Device for analyzing execution bus
JPH02212953A (en) Information processor
JPH0883200A (en) Programmable controller
JPH0426736B2 (en)
JPH04336630A (en) Method and device for tracing address