JPH02195448A - Device for tracing instruction - Google Patents

Device for tracing instruction

Info

Publication number
JPH02195448A
JPH02195448A JP1015391A JP1539189A JPH02195448A JP H02195448 A JPH02195448 A JP H02195448A JP 1015391 A JP1015391 A JP 1015391A JP 1539189 A JP1539189 A JP 1539189A JP H02195448 A JPH02195448 A JP H02195448A
Authority
JP
Japan
Prior art keywords
instruction
execution
executed
counting
counter
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
JP1015391A
Other languages
Japanese (ja)
Inventor
Kiyoshi Senba
仙波 清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP1015391A priority Critical patent/JPH02195448A/en
Publication of JPH02195448A publication Critical patent/JPH02195448A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To collect data to be analyzed without increasing the execution time of a program to be traced by stopping counting operation in each prescribed interval. CONSTITUTION:A counter 1 counts up the number of instructions to be executed by counting up the number of pulses of an instruction execution signal 12 for outputting a pulse in each execution of an instruction. The output signal 13 of the counter 1 is compared with the output signal 11 of a register 2 by a comparator 3, and when both the signals coincide with each other, an interruption signal 16 is outputted, a reset signal 15 is generated to reset a flip flop (FF) 4, the counter 1 is cleared by an output 17, and the counting operation of the counter 1 is stopped. A trace memory 5 records an executed instruction address and an executed instruction word at the timing of instruction execution and stops its operation in each resetting of the FF 4, so that trace data recording the execution of plural instructions executed before the time in each interruption interval in order is obtained.

Description

【発明の詳細な説明】 皮血立! 本発明は命令トレース装置に関し、特にソフトウェアの
動特性を得るための命令トレースを行う命令トレース装
置に関する。
[Detailed description of the invention] Skin and blood stand! The present invention relates to an instruction tracing device, and more particularly to an instruction tracing device that performs instruction tracing to obtain software dynamic characteristics.

良困韮韮 一般に、情報処理装置において、ソフトウェアの動特性
をとる方法としては命令トレースによるものがある。
2. Description of the Related Art In general, in an information processing apparatus, one method of measuring the dynamic characteristics of software is to use instruction tracing.

これは、被トレース命令シーケンス−Lで、1命令終了
毎または一定命令数終了毎に割込みを行い、続いて割込
み処理ルーチンにおいて割込み直前に実行された命令の
アドレス、命令語等のデータ収集を行った後、割込み前
の被トレース命令シーケンスにもどるというものである
。そして、その方法はさらにトレース終了後この収集さ
れたデータを集計分析し、あるいはシミュレータへの入
力として使用し、ソフトウェアの動特性を得るというも
の、である。
This is the traced instruction sequence-L, which generates an interrupt every time one instruction or a certain number of instructions ends, and then collects data such as the address and instruction word of the instruction executed immediately before the interrupt in the interrupt processing routine. After that, the program returns to the traced instruction sequence before the interrupt. After completing the trace, the collected data is aggregated and analyzed or used as input to a simulator to obtain the dynamic characteristics of the software.

上述したように情報処理装置における命令トレースでは
、被トレース命令シーケンス中の、全命令に対し1命令
毎に割込みを発生させる方式と、一定命令数毎に割込み
を発生させ、その割込み直前に実行された1命令のデー
タを収集する方式とがあった。しかしながら、これらの
命令トレース方式には夫々以下のような欠点がある。
As mentioned above, in instruction tracing in an information processing device, there are two methods: one method generates an interrupt for every instruction in the traced instruction sequence, and the other method generates an interrupt every fixed number of instructions, and traces the instructions that are executed immediately before the interrupt. There was a method to collect data for one instruction. However, each of these instruction tracing methods has the following drawbacks.

まず、前者の全命令に対して割込みを発生する方式では
、被トレース命令シーケンスの1命令が実行される毎に
、割込み処理ルーチン及びデータ収集ルーチンが走行す
るため、トレースを行わない場合に比べて被トレース命
令シーケンスの実行時間が数100倍と極端に伸びてし
まうという欠点がある。
First, in the former method of generating interrupts for all instructions, the interrupt handling routine and data collection routine run each time one instruction in the traced instruction sequence is executed, so compared to the case where tracing is not performed, This method has the disadvantage that the execution time of the traced instruction sequence is extremely increased by several hundred times.

また、記録媒体にもよるが、通常トレースデータを収集
記録できるのは105〜107命令分であり、この命令
数は大型計算機では数秒以下の実行時間に相当する。従
ってこの全命令をトレースする方式では通常の業務プロ
グラムのうちの非常に限られた部分のデータしか収集で
きないことになるという欠点もある。
Although it depends on the recording medium, trace data can usually be collected and recorded for 105 to 107 instructions, and this number of instructions corresponds to an execution time of several seconds or less in a large computer. Therefore, this method of tracing all instructions has the disadvantage that it is only possible to collect data on a very limited portion of a normal business program.

一方、後者の一定命令数毎の割込み方式は、前者の方式
の欠点を解決することができる。しかし、以下のような
欠点を有する。
On the other hand, the latter method of interrupting every fixed number of instructions can solve the drawbacks of the former method. However, it has the following drawbacks.

命令トレースデータの内容からは分析しないソフトウェ
アの動特性には命令実行Im序に関するものがある0例
えば、計算機のパイプラインの乱れに関するデータを得
るためには、命令の実行される順序を分析する必要があ
る。このような場合には、後者の方式により一定命令数
毎に1命令のデータをサンプリングしたトレースデータ
から分析ができないという欠点がある。
Some of the dynamic characteristics of software that are not analyzed from the contents of instruction trace data are related to the order of instruction execution.For example, in order to obtain data regarding disturbances in a computer's pipeline, it is necessary to analyze the order in which instructions are executed. There is. In such a case, the latter method has the drawback that analysis cannot be performed from trace data obtained by sampling data of one instruction every certain number of instructions.

1匪ゑ旦漕 本発明は上述した2つの方式を解決するためになされた
ものであり、被トレースプログラムの実行時間の増加を
最少限に抑えることができ、かつ命令の実行される順序
について分析可能なデータを収集することができる命令
トレース装置を堤供することを目的とする。
The present invention was made to solve the above-mentioned two methods, and it is possible to minimize the increase in the execution time of the traced program and analyze the order in which instructions are executed. The purpose is to provide an instruction tracing device capable of collecting possible data.

i匪立璽羞 本発明による命令トレース装置は、計数開始指令に応答
して計数動作を開始し、一命令実行毎にカウントアツプ
する計数手段と、前記計数手段が計数動作を行っている
間、実行された命令に関するトレースデータのトレース
を行うトレース手段と、前記計数手段の計数動作を所定
間隔毎に停止させる計数停止手段とを有することを特徴
とする。
An instruction tracing device according to the present invention includes a counting means that starts a counting operation in response to a counting start command and counts up each time an instruction is executed, and while the counting means is performing the counting operation. The present invention is characterized by comprising a tracing means for tracing trace data regarding executed instructions, and a counting stop means for stopping the counting operation of the counting means at predetermined intervals.

X崖」 以下、図面を用いて本発明の詳細な説明する。"X cliff" Hereinafter, the present invention will be explained in detail using the drawings.

第1図は本発明による命令トレース装置の一実施例の構
成を示すブロック図である0図において、本発明の一実
施例による命令トレース装置は、最新に実行された命令
語とその命令アドレスとを実行順に複数組記録する手段
としてのトレースメモリ5と、実行命令数を計数する計
数手段としてのカウンタ1と、カウンタ1のセット・リ
セットの制御を行うフリップフロップ4と、カウンタ1
の計数値を指定する指定手段としてのレジスタ2と、カ
ウンタ1の計数値がレジスタ2の指定する指定値に達し
なときに割込み信号16を送出する手段としての比較器
3とを含んで構成されている。
FIG. 1 is a block diagram showing the configuration of an embodiment of an instruction tracing device according to the present invention. In FIG. a trace memory 5 as a means for recording a plurality of sets in the order of execution; a counter 1 as a counting means for counting the number of executed instructions; a flip-flop 4 for controlling the setting and resetting of the counter 1;
The comparator 3 is a means for sending an interrupt signal 16 when the count value of the counter 1 does not reach the specified value specified by the register 2. ing.

なお、18は実行命令のアドレス信号、19は実行命令
B信号、10は割込み間隔を指定する命令により起動さ
れる割込み間隔指定信号、12は1命令毎にパルスが出
される命令実行信号、13はカウンタ1の出力信号、1
4は実行命令数の計数を起動する命令により起動される
計数起動信号、15はフリップフロップ4のリセット信
号、17はフリップフロップ4の出力信号である。
In addition, 18 is an address signal of an execution instruction, 19 is an execution instruction B signal, 10 is an interrupt interval designation signal activated by an instruction specifying an interrupt interval, 12 is an instruction execution signal whose pulse is issued for each instruction, and 13 is an execution instruction signal. Output signal of counter 1, 1
4 is a counting activation signal activated by an instruction to start counting the number of executed instructions; 15 is a reset signal for the flip-flop 4; and 17 is an output signal of the flip-flop 4.

本実施例の特徴は、カウンタ1、レジスタ2、比較器3
、フリップフロップ4及びメモリ5を設けてトレースを
行うようにしたことにある。
The features of this embodiment include a counter 1, a register 2, and a comparator 3.
, a flip-flop 4 and a memory 5 are provided to perform tracing.

次に、本実施例の動作について説明する。なお、本実施
例においては割込み間隔を指定する割込み間隔指定命令
と、実行命令数の計数を起動する計数起動命令と、トレ
ースメモリ内のトレースデータを主メモリに移送する移
送命令とが規定されている。
Next, the operation of this embodiment will be explained. Note that in this embodiment, an interrupt interval specification instruction that specifies an interrupt interval, a counting start instruction that starts counting the number of executed instructions, and a transfer instruction that transfers trace data in the trace memory to the main memory are defined. There is.

まず、割込み間隔指定命令が実行されるとその指定値が
割込み間隔指定信号10によりレジスタ2内にセットさ
れる。続いて実行命令数の計数起動命令が実行されると
計数起動信号14によってフリップフロップ4がセット
される。フリップフロップ4がセットされるとその出力
信号17により、カウンタ1が起動されると共に命令ア
ドレス及び命令語のトレースメモリ5への記録が開始さ
れる。
First, when an interrupt interval designation instruction is executed, the designated value is set in the register 2 by the interrupt interval designation signal 10. Subsequently, when a count start instruction for the number of executed instructions is executed, the flip-flop 4 is set by the count start signal 14. When the flip-flop 4 is set, the output signal 17 activates the counter 1 and starts recording the instruction address and instruction word in the trace memory 5.

カウンタ1では1命令実行毎にパルスが出される命令実
行信号12のパルス数を計数することにより、実行命令
数が計数される。このカウンタ1の出力信号13とレジ
スタ2の出力信号11とは比較器3で比軸される。そし
て、これら2つの値が一致すると、比較器3は割込み信
号16を出力し、割込みを発生ずると共に、リセット信
号15を出してフリップ70ツブ4をリセットする。こ
のように、フリップフロップ4の出力信号17によって
カウンタ1がクリアされると、実行命令数のh1数が停
止する。それと共に、次の命令に対するトレースメモリ
5への記録も停止する。
The counter 1 counts the number of executed instructions by counting the number of pulses of the instruction execution signal 12, which is output every time one instruction is executed. The output signal 13 of the counter 1 and the output signal 11 of the register 2 are ratio-axed by a comparator 3. When these two values match, the comparator 3 outputs an interrupt signal 16 to generate an interrupt, and also outputs a reset signal 15 to reset the flip 70 knob 4. In this way, when the counter 1 is cleared by the output signal 17 of the flip-flop 4, the h1 number of executed instructions stops. At the same time, recording to the trace memory 5 for the next instruction is also stopped.

フリップフロップ4の出力信号17によって起動される
トレースメモリ5は、実行命令アドレスと実行命令語と
を命令実行信号12のタイミングで記録する。このトレ
ースメモリ5はその内容に応じた複数組の命令アドレス
と命令語とを記録でき、その記録はトレースメモリ5上
のアドレスを更新しながら行われる。従ってトレースメ
モリ5内には最新に実行された命令及びそれ以前の複数
組命令が順次記録されていることになる。また、このト
レースメモリ5への記録はフリップフロップ4がリセッ
トされることによって停止する。
The trace memory 5 activated by the output signal 17 of the flip-flop 4 records the execution instruction address and execution instruction word at the timing of the instruction execution signal 12. This trace memory 5 can record a plurality of sets of instruction addresses and instruction words according to its contents, and the recording is performed while updating the addresses on the trace memory 5. Therefore, the most recently executed instruction and a plurality of sets of previous instructions are sequentially recorded in the trace memory 5. Furthermore, recording to the trace memory 5 is stopped when the flip-flop 4 is reset.

上述の割込み信号16によって起動される割込み処理ル
ーチンではトレースメモリ5内のデータを図示せぬ主メ
モリ内のトレースバッファに移送する移送命令を実行し
、その後計数起動命令を実行すると共に割込み処理ルー
チンを出て元の処理に制御を渡す、これにより、上述の
動作が再び行われる。なお、トレースバッファがフルに
なった場合には割込み処理ルーチンにより、トレースデ
ータが図示せぬ記録媒体に出力される。
The interrupt processing routine activated by the interrupt signal 16 described above executes a transfer instruction to transfer the data in the trace memory 5 to a trace buffer in the main memory (not shown), and then executes a counting start instruction and executes the interrupt processing routine. It exits and passes control to the original process, which causes the operations described above to occur again. Note that when the trace buffer becomes full, trace data is output to a recording medium (not shown) by an interrupt processing routine.

以上の処理が繰返されると、レジスタ2にセ・ツトされ
ている値に応じた割込み間隔毎に、それ以前に実行され
た複数の命令がその実行順に記録されたトレースデータ
を得ることができる。そして、トレース後にこのデータ
を集計分析することにより、命令コードの出現頻度、可
変長命令の平均データ長等と共に、命令の実行順に依存
するパイプラインの乱れ量等のソフトウェア動特性デー
タを得ることができるのである。
When the above processing is repeated, it is possible to obtain trace data in which a plurality of previously executed instructions are recorded in the order of their execution at each interrupt interval according to the value set in register 2. By aggregating and analyzing this data after tracing, it is possible to obtain software dynamic characteristic data such as the frequency of occurrence of instruction codes, the average data length of variable-length instructions, and the amount of pipeline disturbance that depends on the order of instruction execution. It can be done.

また、レジスタ2にセットする値を変更すれば、割込み
処理ルーチンに入る間隔を変えることができるのである
。つまり、本発明によれば、割込み処理ルーチンに入る
間隔が可変な構成とすることができるため実行時間の増
加を最小限に抑えることができるのである9 ル匪五皇j 以上説明したようLこ本発明は、実行命令語とその命令
アドレスとを実行順にトレースメモリに記録し、指定命
令数実行される毎に割込みを発生させてトレースメモリ
内のデータを出力することにより、被トレースプログラ
ムの実行時間を大巾に増加することなく命令実行順序を
分析可能なデータが収集できるという効果がある。
Furthermore, by changing the value set in register 2, the interval at which the interrupt processing routine is entered can be changed. In other words, according to the present invention, since the interval at which the interrupt processing routine is entered can be configured to be variable, the increase in execution time can be minimized. The present invention records execution instruction words and their instruction addresses in a trace memory in the order of execution, generates an interrupt every time a specified number of instructions are executed, and outputs the data in the trace memory, thereby executing a traced program. This has the effect that data that can be used to analyze the instruction execution order can be collected without significantly increasing the time.

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

第1図は本発明の実施例による命令トレース装置の構成
を示すブロック図である。 主要部分の符号の説明 1・・・・・・カウンタ 2・・・・・・レジスタ 3・・・・・・比較器 4・・・・・・フリップフロップ 5・・・・・・トレースメモリ
FIG. 1 is a block diagram showing the configuration of an instruction tracing device according to an embodiment of the present invention. Explanation of symbols of main parts 1... Counter 2... Register 3... Comparator 4... Flip-flop 5... Trace memory

Claims (1)

【特許請求の範囲】[Claims] (1)計数開始指令に応答して計数動作を開始し、一命
令実行毎にカウントアップする計数手段と、前記計数手
段が計数動作を行っている間、実行された命令に関する
トレースデータのトレースを行うトレース手段と、前記
計数手段の計数動作を所定間隔毎に停止させる計数停止
手段とを有することを特徴とする命令トレース装置。
(1) A counting means that starts a counting operation in response to a counting start command and counts up every time an instruction is executed, and while the counting means is performing the counting operation, traces trace data related to executed instructions. 1. An instruction tracing device comprising: tracing means for performing the tracing; and counting stopping means for stopping the counting operation of the counting means at predetermined intervals.
JP1015391A 1989-01-25 1989-01-25 Device for tracing instruction Pending JPH02195448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1015391A JPH02195448A (en) 1989-01-25 1989-01-25 Device for tracing instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1015391A JPH02195448A (en) 1989-01-25 1989-01-25 Device for tracing instruction

Publications (1)

Publication Number Publication Date
JPH02195448A true JPH02195448A (en) 1990-08-02

Family

ID=11887438

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1015391A Pending JPH02195448A (en) 1989-01-25 1989-01-25 Device for tracing instruction

Country Status (1)

Country Link
JP (1) JPH02195448A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216056A (en) * 2010-04-02 2011-10-27 Mitsubishi Electric Corp Programmable controller and peripheral device thereof
CN111263891A (en) * 2018-09-30 2020-06-09 Oppo广东移动通信有限公司 Instruction time testing method and system and computer storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216056A (en) * 2010-04-02 2011-10-27 Mitsubishi Electric Corp Programmable controller and peripheral device thereof
CN111263891A (en) * 2018-09-30 2020-06-09 Oppo广东移动通信有限公司 Instruction time testing method and system and computer storage medium
CN111263891B (en) * 2018-09-30 2022-06-07 Oppo广东移动通信有限公司 Instruction time testing method and system and computer storage medium
US11614484B2 (en) 2018-09-30 2023-03-28 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and system for testing time parameters of adaptor

Similar Documents

Publication Publication Date Title
CN1072372C (en) Multi-media computer diagnostic system
US7739662B2 (en) Methods and apparatus to analyze processor systems
JPS6049354B2 (en) Event occurrence recording method
JPH02195448A (en) Device for tracing instruction
EP0685084A1 (en) Automatic gathering and graphical display of useability test data
JPH08328905A (en) Method and device for simulation
JPH02242440A (en) Instruction trace circuit
JP3550748B2 (en) Compiler unit
JPS6293737A (en) Information processor
JP2961199B2 (en) Pulse train input processor
JP2775830B2 (en) Instruction frequency measurement method
JPH04225439A (en) Log/sampling data analyzing method
JPS605018B2 (en) history recording device
JP2518390B2 (en) System performance monitoring method
Landry et al. A simulation environment for performing dataflow research
JPH05173846A (en) Fault analysis information tracing method
Johnson et al. Developing Monitoring and Debugging Tools for the AP1000 Array Multiprocessor,"
JPH04107781A (en) Fault analysis system for interactive cad system
JPH064299A (en) Optimized object program generating system
JPH10260872A (en) Computer system and recording medium
JPH06231011A (en) System for measuring number of times of access of peripheral equipment
JPH01145736A (en) Dynamic performance measuring system
JPS607554A (en) Measuring system for performance of computer system
JPH03282835A (en) Transaction trace information gathering system
JPH02294750A (en) Data storage system