JPH02268343A - Instruction frequency measuring system - Google Patents

Instruction frequency measuring system

Info

Publication number
JPH02268343A
JPH02268343A JP1090030A JP9003089A JPH02268343A JP H02268343 A JPH02268343 A JP H02268343A JP 1090030 A JP1090030 A JP 1090030A JP 9003089 A JP9003089 A JP 9003089A JP H02268343 A JPH02268343 A JP H02268343A
Authority
JP
Japan
Prior art keywords
instruction
frequency
execution
sampling pulse
executed
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.)
Granted
Application number
JP1090030A
Other languages
Japanese (ja)
Other versions
JP2775830B2 (en
Inventor
Kazuyuki Shimizu
和之 清水
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1090030A priority Critical patent/JP2775830B2/en
Publication of JPH02268343A publication Critical patent/JPH02268343A/en
Application granted granted Critical
Publication of JP2775830B2 publication Critical patent/JP2775830B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To accurately measure the instruction frequency of a computer system with a simple circuit constitution by preliminarily determining the timing, at which program executed at present is temporarily interrupted in response to a sampling pulse, for each instruction and setting all of specific timings to the same length as instructions. CONSTITUTION:A specific sampling pulse 1 from a sampling pulse generating mechanism preliminarily determined for each instruction is inputted to an AND circuit 120, and AND between this pulse 1 and an instruction execution completion signal 2 inputted to the other input is operated. When AND in this circuit 120 is true, a timer interrupt latch 123 is set and an instruction frequency measuring routine is started. The sampling pulse 1 of each instruction is not automatically ignored when it does not coincide with the instruction execution completion signal 2, and the instruction frequency of the computer system is accurately measured by the simple circuit constitution.

Description

【発明の詳細な説明】 〔目 次〕 概要 産業上の利用分野 従来の技術と発明が解決しようとする課題課題を解決す
るための手段 作用 実施例 発明の効果 〔概要〕 情報処理装置、より限定的には中央処理装置(CPU)
で実行されるプログラム中のどの命令がどの位の頻度で
実行されたかを測定する命令頻度測定方式に関し、 少ないハードウェア量で、且つ、計算機システムの運用
環境への擾乱が少ない命令頻度測定方式を提供すること
を目的とし、 周期的にサンプリングパルスを発生するサンプリングパ
ルス発生機構と、該サンプリングパルスに呼応して現在
実行中のプログラムの実行を一時中断する機構と、該プ
ログラムの中断時点の情報から、次に実行すべきであっ
た命令を主記憶装置(MSU)から読み出す機構と、該
読み出した命令語を解読して命令頻度を計測する機構と
を備えた情報処理装置において、上記サンプリングパル
スに呼応して現在実行中のプログラムの実行を一時中断
するタイミングを、命令毎に予め定めた特定のタイミン
グとし、且つ、該特定のタイミングを全ての命令に対し
て同一の長さとする手段を設けて、該手段で生成された
信号に基づいて、上記命令頻度を計測する機構を起動し
、命令実行頻度を測定するように構成する。
[Detailed Description of the Invention] [Table of Contents] Overview Industrial Application Fields Conventional Technology and Problems to be Solved by the Invention Means for Solving the Problems Action Examples Effects of the Invention [Summary] Information processing equipment, more limited Central processing unit (CPU)
Regarding an instruction frequency measurement method that measures which instructions are executed and how often in a program executed by A sampling pulse generation mechanism that periodically generates sampling pulses, a mechanism that temporarily interrupts the execution of a currently running program in response to the sampling pulse, and information on the point at which the program is interrupted. , an information processing device equipped with a mechanism for reading an instruction to be executed next from a main storage unit (MSU), and a mechanism for measuring the instruction frequency by decoding the read instruction word, In response, a means is provided to temporarily suspend the execution of the currently executing program at a specific timing predetermined for each instruction, and to make the specific timing the same length for all instructions. , based on the signal generated by the means, the mechanism for measuring the frequency of instructions is activated to measure the frequency of instruction execution.

〔産業上の利用分野〕[Industrial application field]

本発明は、情報処理装置、より限定的には中央処理装置
(CPU)で実行されるプログラム中のどの命令がどの
位の頻度で実行されたかを測定する命令頻度測定方式に
関する。
The present invention relates to an instruction frequency measurement method for measuring which instructions in a program executed by an information processing device, more specifically a central processing unit (CPU), are executed and how often.

従来から、計算機システムの処理能力を向上させる為に
、ソフトウェア、ハードウェア込みで性能の評価をして
、改善点を抽出する手段の一つとして、中央処理装置(
CPU)で実際にプログラムが実行される時に、どの命
令がどの位の頻度で実行されているかを測定することが
行われている。
Traditionally, in order to improve the processing power of computer systems, central processing units (
When a program is actually executed by a CPU (CPU), it is measured which instructions are executed and how often.

この場合、できる限り少ないハードウェア量で、且つ、
より正確に、具体的には、計算機システムの運用環境を
擾乱させることを少なくして、命令実行頻度を測定でき
る命令頻度測定方式が要求される。
In this case, the amount of hardware is as small as possible, and
More precisely, there is a need for an instruction frequency measurement method that can measure the instruction execution frequency with less disturbance to the operating environment of a computer system.

〔従来の技術と発明が解決しようとする課題〕第2図は
従来の命令頻度測定方式を説明する図であり、(a)は
全体の構成例を示し、(b)はプロダラム・ステータス
語の一例を示し、(C)はサンプリング方式での割込み
処理回路の一例を示し、(d)は該サンプリング方式で
の動作タイムチャートを示している。
[Prior art and problems to be solved by the invention] Fig. 2 is a diagram explaining a conventional instruction frequency measurement method, in which (a) shows an example of the overall configuration, and (b) shows an example of the program/status word. An example is shown in which (C) shows an example of an interrupt processing circuit using the sampling method, and (d) shows an operation time chart using the sampling method.

従来の命令頻度測定方式には、大別して、ハードウェア
方式とソフトウェア(或いは、ファームウェア方式)の
2方式がある。
Conventional instruction frequency measurement methods can be roughly divided into two methods: a hardware method and a software (or firmware method).

(1)  ハードウェア方式 図示していないが、同時に実行頻度を測定したい命令の
種類の数だけ、カウンタをハードウェアで実現し、該当
命令が実行される毎に、該当のカウンタをカウントアツ
プし、プログラムの実行終了時、又は、適当な時点で、
該カウンタの値を読み出して、命令実行頻度を計算して
求めるものである。
(1) Hardware method Although not shown in the diagram, counters are implemented in hardware for the number of types of instructions whose execution frequency is to be measured at the same time, and each time the corresponding instruction is executed, the corresponding counter is counted up. At the end of program execution or at any other time,
The value of the counter is read and the instruction execution frequency is calculated.

従って、中央処理装置(CPU)が実行することができ
る命令の全種類の実行頻度を測定しようとすると、命令
の数、例えば、200命令前後のカウンタが必要となり
、ハードウェア量が膨大になってしまうという問題があ
った。
Therefore, if you try to measure the execution frequency of all types of instructions that can be executed by a central processing unit (CPU), you will need a counter for the number of instructions, for example, around 200 instructions, and the amount of hardware will become enormous. There was a problem with putting it away.

逆に、該カウンタの数を現実的な数、例えば、10個程
度に制限すると、同一の環境下で、20回程測定を繰り
返す必要があり、測定時間が膨大となるばかりでなく、
プログラムの内容によっては、同一環境を再現すること
自体が困難であるという問題があった。
On the other hand, if the number of counters is limited to a realistic number, for example, about 10, it is necessary to repeat the measurement about 20 times under the same environment, which not only increases the measurement time, but also
There was a problem in that it was difficult to reproduce the same environment depending on the content of the program.

(2)  ソフトウェア方式(或いは、ファームウェア
方式)(第2図参照) ソフトウェア方式とファームウェア方式とは、基本的に
は同じである。即ち、以下の説明で「プログラム割込み
」を「ファームウェアへの割込み」とし、「命令頻度測
定ルーチン」22を「命令頻度測定ファームウェア」と
すれば、該ソフトウェア方式の説明はファームウェア方
式の説明となる。ファームウェア方式では、更に、カウ
ンタ用のデータ域を主記憶装置(MSU) 2上にとる
代わりに、該ファームウェアだけがアクセスできるロー
カルストレージ(LS)上にとることがある。
(2) Software method (or firmware method) (see FIG. 2) Software method and firmware method are basically the same. That is, in the following explanation, if "program interrupt" is defined as "interruption to firmware" and "instruction frequency measurement routine" 22 is defined as "instruction frequency measurement firmware", then the explanation of the software method becomes the explanation of the firmware method. Furthermore, in the firmware method, instead of storing the data area for the counter on the main storage unit (MSU) 2, it may be stored on the local storage (LS) that can only be accessed by the firmware.

ソフトウェア方式にも、2方式があり、命令トレース方
式とサンプリング方式とがある。
There are also two software methods: an instruction trace method and a sampling method.

(八)命令トレース方式 第2図(a)において、中央処理装置(CPU) lが
プログラム23の1命令を実行する毎に、命令実行/割
込み制御回路12において、プログラム割込みを発生し
、命令頻度測定ルーチン22へ制御を渡すようにする。
(8) Instruction tracing method In FIG. 2(a), each time the central processing unit (CPU) l executes one instruction of the program 23, a program interrupt is generated in the instruction execution/interrupt control circuit 12, and the instruction frequency Control is passed to the measurement routine 22.

該別込み時に、その時のプログラム・ステータス語(P
SW)が旧プログラム・ステータス語(OLD PSW
) 21として、主記憶装置(MSU) 2上の固定番
地に格納される。
At the time of classification, the current program status word (P
SW) is the old program status word (OLD PSW)
) 21 and is stored at a fixed address on the main storage unit (MSU) 2.

該旧プログラム・ステータス語(以下、OLD PSW
という)21には、次に実行すべき命令のアドレスが、
(b)図のプログラム・ステータス語(PSW)の命令
アドレス部(IA)に示されている。
The old program status word (hereinafter referred to as OLD PSW)
)21 contains the address of the next instruction to be executed.
(b) Shown in the instruction address portion (IA) of the program status word (PSW) in the figure.

該別込みで制御が渡された命令頻度測定ルーチン22は
、主記憶装置(MSU) 2がら、上記OLD PS匈
21(又は、該OLD PSW 21(7)上記”IA
”部ノミ)を読み出し、更に、そこから得た“IA”部
を基に、主記憶装置(MStl) 2内のプログラム2
3中の、次に実行すべき命令語を読み出す。
The instruction frequency measurement routine 22 to which control is passed in the separate manner stores the OLD PS 21 (or the OLD PSW 21(7)) from the main storage unit (MSU) 2, and the OLD PSW 21(7)
The program 2 in the main memory device (MStl) 2 is read based on the "IA" section obtained from the "IA" section.
3, reads out the command word to be executed next.

次に、その命令語を解釈し、予め、主記憶装置(MSU
) 2上に命令の数だけ用意しである実行回数記録語(
1〜n)24の対応する語を読み出して+1゛を行って
、同じ領域に再格納する。
Next, the instruction word is interpreted and the main memory (MSU) is stored in advance.
) 2, there are execution count record words for the number of instructions (
1 to n) 24 corresponding words are read out, incremented by +1, and re-stored in the same area.

この方式においては、1命令実行する毎に、割込んで、
命令頻度測定ルーチン22が動作するので、オーバヘッ
ドが大きく、計算機システムの通常の動作環境を著しく
乱してしまう問題がある。
In this method, every time one instruction is executed, an interrupt is executed.
Since the instruction frequency measurement routine 22 operates, there is a problem in that the overhead is large and the normal operating environment of the computer system is significantly disturbed.

従って、通常の動作環境での命令頻度とは異なる結果と
なる恐れがある。
Therefore, the result may be different from the instruction frequency in a normal operating environment.

(B)サンプリング方式 元々、計算機システムの中央処理装置(CPU) 1に
は、例えば、実時間処理を優先的に実行する為等を目的
としたタイマ割込み機構がある。
(B) Sampling method Originally, the central processing unit (CPU) 1 of a computer system had a timer interrupt mechanism for the purpose of, for example, preferentially executing real-time processing.

これは、サンプリングパルス発生機構11において、周
期的に発生するサンプリングパルス■を基に、該サンプ
リングパルス発生時点で命令を実行中ならば、その命令
の実行の完了時点で、又、命令の実行中でなければ、即
、その時点で、プログラム割込みを発生して、該実時間
処理に制御を渡す機構である。
In the sampling pulse generation mechanism 11, if an instruction is being executed at the time when the sampling pulse is generated, based on the sampling pulse (2) that is periodically generated, this is performed at the time when the execution of the instruction is completed, or during the execution of the instruction. If not, the mechanism immediately generates a program interrupt at that point and transfers control to the real-time processing.

具体的には、サンプリングパルス発生機構11から出力
されたサンプリングパルス■は、(c)図に示したよう
に、ラッチ121で一旦ラッチされ、命令実行完了信号
■を待ち、該実行中の命令が完了したことを示す命令実
行完了信号■で論理積(八ND)回路122で論理積が
取られて、割込みラッチ123が起動され、上記実時間
割込みルーチンの処理に制御が移るように機能する。(
(d)図の動作タイムチャート参照) そこで、サンプリング方式による命令頻度測定は、該タ
イマ割込み機構を使用して、サンプリングパルス■が発
生し、実行中の命令が完了した時に、前述の命令頻度測
定ルーチン22に制?lIlを渡すようにする。
Specifically, as shown in the figure (c), the sampling pulse (2) output from the sampling pulse generation mechanism 11 is once latched by the latch 121, waits for the instruction execution completion signal (2), and then the currently executed instruction is The logical product (8ND) circuit 122 performs a logical product with the instruction execution completion signal (2) indicating that the instruction has been completed, and the interrupt latch 123 is activated, thereby functioning to transfer control to the processing of the real-time interrupt routine. (
(d) Refer to the operation time chart in the figure) Therefore, the instruction frequency measurement using the sampling method uses the timer interrupt mechanism, and when the sampling pulse ■ is generated and the instruction being executed is completed, the instruction frequency measurement described above is performed. Ruled by routine 22? Make sure to pass lIl.

プログラムの実行をサンプリングして、命令の実行頻度
を測定するので、実際の命令実行頻度とは一致しないが
、測定時間を長くすることにより、確率的には、実際の
命令実行頻度に極めて近い実行頻度を得ることができ、
且つ、サンプリングしている為、通常の動作環境への擾
乱が少ないという特徴がある。
Since the program execution is sampled and the instruction execution frequency is measured, it does not match the actual instruction execution frequency, but by increasing the measurement time, the execution frequency is probability-wise very close to the actual instruction execution frequency. You can get the frequency,
In addition, since sampling is performed, there is little disturbance to the normal operating environment.

この時の命令頻度測定ルーチン22が実行する処理内容
には、以下の2通りの方式がある。
The processing contents executed by the instruction frequency measurement routine 22 at this time include the following two methods.

(B−1) :最後に実行した命令の次の命令をサンプ
リングする方式 前述の(A)方式と同様に、OLD PSW 21を基
に、次に実行すべきであった命令語を読み出し、その命
令語に対応した主記憶装置(MSU) 2上の実行回数
記録語(1〜n)24に1°を加算する。
(B-1): A method of sampling the next instruction after the last executed instruction. Similar to the method (A) described above, based on the OLD PSW 21, the instruction word that should have been executed next is read and the 1 degree is added to the execution count record word (1 to n) 24 on the main storage unit (MSU) 2 corresponding to the command word.

コノ方式では、分岐命令や、アドレスモードを変更する
命令等を実行した場合でも、上記OLD PS匈21は
、分岐先、アドレスモード変更先のものであるので、実
際に実行される命令のみが正しくカウントされる利点を
持つが、確率的に、実行時間の長い命令を実行中にサン
プリングパルス■が発生する回数が多くなることから、
該実行時間の長い命令の直後にある命令が実際の頻度よ
り高く測定されて、誤った測定を行うという問題がある
In the Kono method, even if a branch instruction or an instruction to change the address mode is executed, the OLD PS 21 is for the branch destination or address mode change destination, so only the actually executed instruction is correct. Although it has the advantage of being counted, the probability is that sampling pulses will occur more often while executing instructions that take a long time to execute.
There is a problem in that an instruction immediately following the long-running instruction is measured at a higher frequency than the actual frequency, resulting in erroneous measurements.

(B−2) :最後に実行した命令をサンプリングする
方式 OLD PSW 21には、割込み直前の命令、即ち、
最後に実行した命令の長さ情報((b)図のps−の命
令長コード(ILC) )が含まれているので、OLD
 PSw中の、次に実行すべき命令アドレスCIA”部
)の値から、該直前の命令の命令長コード(”ILC”
部)の値を差し引くことにより、最後に実行した命令の
アドレスを得ることができる。
(B-2): Method of sampling the last executed instruction The OLD PSW 21 includes the instruction immediately before the interrupt, that is,
Since it contains the length information of the last executed instruction (instruction length code (ILC) of ps- in figure (b)),
The instruction length code (“ILC”) of the immediately preceding instruction is determined from the value of the next instruction address (CIA) in PSw.
The address of the last executed instruction can be obtained by subtracting the value of .

そこで、このアドレスを基に、該最後に実行された命令
の命令語を主記憶装置(MSII) 2のプログラム2
3から読み出し、上記(A)と同様にして、その命令に
対応する主記憶装置(MSU) 2上の実行回数記録語
(1〜n)の内容に1゛を加算する。
Therefore, based on this address, the instruction word of the last executed instruction is stored in the program 2 of the main memory (MSII) 2.
3, and in the same manner as in (A) above, 1' is added to the contents of the execution count record word (1 to n) on the main storage unit (MSU) 2 corresponding to that instruction.

この方式では、実行時間の長い命令がサンプリングされ
る回数が多くなることから、命令の実行時間を重みとし
た、重み付命令頻度が測定できる利点があるが、前述の
命令アドレスを変更する分岐命令やアドレスモードを変
更する命令等を実行した場合に、は、該OLD PSW
 21は前述のように、分岐先、アドレスモード変更先
になっているので、最後に実行した命令のアドレスを求
めることができず、上記の方法で命令頻度を測定すると
、誤った命令(実際に実行されることのない命令)をカ
ウントするという致命的な問題がある。
This method has the advantage of being able to measure the weighted instruction frequency by weighting the instruction execution time, since instructions with long execution times are sampled many times. When an instruction to change the address mode or the like is executed, the corresponding OLD PSW
As mentioned above, since 21 is the branch destination or address mode change destination, it is not possible to obtain the address of the last executed instruction, and if the instruction frequency is measured using the above method, an incorrect instruction (actually There is a fatal problem in counting instructions that are never executed.

本発明は上記従来の欠点に鑑み、情報処理装置の中央処
理装置(CPU)で実行されるプログラム中のどの命令
がどの位の頻度で実行されたかを測定するのに、少ない
へ=ドウエア量で、且つ、計算機システムの運用環境へ
の擾乱が少ない命令頻度測定方式、即ち、最後に実行し
た命令の次の命令をサンプリングする方式で、実行時間
の長い命令が存在しても、直後の命令が実際の頻度より
高く測定されることがない命令頻度測定方式を提供する
ことを目的とするものである。
In view of the above-mentioned conventional drawbacks, the present invention provides a method for measuring which instructions in a program executed by a central processing unit (CPU) of an information processing device is executed and how often, with a small amount of hardware. , and an instruction frequency measurement method that causes less disturbance to the operating environment of the computer system, that is, a method that samples the instruction following the last executed instruction, so that even if there is an instruction with a long execution time, the immediately following instruction It is an object of the present invention to provide a method for measuring the frequency of commands that does not measure the frequency higher than the actual frequency.

〔課題を解決するための手段〕[Means to solve the problem]

上記の問題点は下記の如くに構成された命令頻度測定方
式によって解決される。
The above problems are solved by the instruction frequency measurement method configured as follows.

周期的にサンプリングパルスを発生するサンプリングパ
ルス発生機構と、該サンプリングパルスに呼応して現在
実行中のプログラムの実行を一時中断する機構と、該プ
ログラムの中断時点の情報から、次に実行すべきであっ
た命令を主記憶装置(MSU)から読み出す機構と、該
読み出した命令語を解読して命令頻度を計測する機構と
を備えた情報処理装置において、 上記サンプリングパルスに呼応して現在実行中のプログ
ラムの実行を一時中断するタイミングを、命令毎に予め
定めた特定のタイミングとし、且つ、該特定のタイミン
グを全ての命令に対して同一の長さとする手段を設けて
、 該手段で生成された信号に基づいて、上記命令頻度を計
測する機構を起動し、命令実行頻度を測定するように構
成する。
A sampling pulse generation mechanism that periodically generates sampling pulses, a mechanism that temporarily interrupts the execution of the currently running program in response to the sampling pulse, and a system that determines what should be executed next based on the information at the time of interruption of the program. In an information processing device that is equipped with a mechanism for reading out an instruction from a main memory unit (MSU) and a mechanism for measuring the frequency of instructions by decoding the read instruction word, an information processing device is configured to read out an instruction currently being executed in response to the sampling pulse. Providing a means for temporarily suspending the execution of the program at a specific timing predetermined for each instruction, and making the specific timing the same length for all instructions, Based on the signal, the mechanism for measuring the frequency of commands is activated to measure the frequency of command execution.

〔作用〕[Effect]

一般に、情報処理装置の中央処理装置(CPU)で実行
される命令には、1マシンサイクルで実行を完了する基
本的な命令から、数十マシンサイクルかかる複雑な命令
まで、種々存在する。更には、極度に実行時間の長い特
殊命令も存在する。
Generally, there are a variety of instructions executed by a central processing unit (CPU) of an information processing device, ranging from basic instructions that complete execution in one machine cycle to complex instructions that take several tens of machine cycles. Furthermore, there are special instructions that take an extremely long execution time.

一定周期のサンプリングパルスが発生した時点で、ある
命令が実行中である確率は、サンプリングパルスの発生
と命令の実行という2つの事象が独立であることから、
その命令の実行時間の長さに比例することになる。
The probability that a certain instruction is being executed when a sampling pulse of a certain period occurs is given by the fact that the two events, the generation of the sampling pulse and the execution of the instruction, are independent.
It is proportional to the length of execution time of the instruction.

又、前述の「最後に実行した命令の次の命令をサンプリ
ングするB−1方式」では、該サンプリングパルス■が
発生した時点で、ある命令が実行中であると、第2図(
c)のサンプリング方式の回路、及び、(d)図の動作
タイムチャートから明らかな如く、その命令の実行が完
了する迄、該サンプリングパルス■の発生事象を一時ラ
ッチ121に記憶しておき、該命令の実行完了と共に、
プログラム割込みが発生するようになっている。
In addition, in the above-mentioned "B-1 method of sampling the next instruction after the last executed instruction", if a certain instruction is being executed at the time when the sampling pulse ■ is generated, as shown in FIG.
As is clear from the sampling method circuit in c) and the operation time chart in FIG. Upon completion of execution of the command,
Program interrupts are now generated.

即ち、通常、割込みは、命令と命令との隙間で処理され
るようになっており、1つの命令実行中に生じた割込み
要因は、その命令の実行が完了する迄保留した後処理さ
れることになる。
In other words, interrupts are usually processed between instructions, and interrupt factors that occur during the execution of one instruction are suspended until the execution of that instruction is completed, and then processed. become.

従って、このような割込み処理機構を、そのまま利用し
た命令頻度測定方式も、サンプリング方式では、該別込
み機構を使用することになる為、上記のような動作とな
る。
Therefore, even in the instruction frequency measurement method that uses such an interrupt processing mechanism as is, the sampling method uses the separate interrupt processing mechanism, and thus operates as described above.

この結果、実行時間の長い命令程、その実行時間に比例
して、命令頻度測定ルーチンを頻繁に起動することにな
る。一方、上記「最後に実行した命令の次の命令をサン
プリングするB−1方式」による命令頻度測定ルーチン
では、最後に実行した命令の次の命令をカウントするこ
とになっており、結果的には、全く無関係な直前の命令
の実行時間の長さで重み付けされた無意味な命令頻度が
測定されてしまう。
As a result, the longer the execution time of an instruction, the more frequently the instruction frequency measuring routine will be activated in proportion to the execution time. On the other hand, in the instruction frequency measurement routine based on the above-mentioned "B-1 method of sampling the instruction following the last executed instruction," the instruction following the last executed instruction is counted, and as a result, , a meaningless instruction frequency weighted by the length of execution time of a completely unrelated immediately preceding instruction is measured.

そこで、本発明では、[最後に実行した命令の次の命令
をサンプリングする命令頻度測定方式」即ち、前述のB
−1方式の欠点が「命令頻度の測定には無関係な直前の
命令の実行時間の長さで、実際に頻度測定を行う次の命
令に重み付けがされてしまう1点にあることに着目して
、 (1)  サンプリングパルス■の参照を、全ての命令
について、各命令の実行時に、唯−度だけ通過する特定
のタイミングに限定するようにし、(2)該サンプリン
グパルス■が上記特定のタイミング以外で発生した場合
には、該サンプリングパルスを無視し、該特定のタイミ
ングで発生した時のみ、該サンプリングパルス■を捕捉
して、従来と同じタイマ割込みを発生させ、命令頻度測
定ルーチンに制御を渡すようにする。
Therefore, in the present invention, an ``instruction frequency measurement method that samples the next instruction after the last executed instruction'', that is, the above-mentioned B
Focusing on the fact that the drawback of the -1 method is that the next instruction whose frequency is actually measured is weighted by the length of the execution time of the immediately preceding instruction, which is unrelated to the measurement of instruction frequency. (1) For all instructions, the reference to the sampling pulse ■ is limited to a specific timing that passes only once during the execution of each instruction, and (2) the sampling pulse ■ is limited to a specific timing other than the above-mentioned specific timing. If it occurs, ignore the sampling pulse, capture the sampling pulse only when it occurs at the specific timing, generate the same timer interrupt as before, and pass control to the instruction frequency measurement routine. do it like this.

(3)上記の特定タイミングの長さは、1マシンサイク
ルに限定する必要はないが、全ての命令に対して同じ長
さとして、命令の実行時間に影響されないようにする。
(3) The length of the specific timing described above does not need to be limited to one machine cycle, but should be the same length for all instructions so that it is not affected by the instruction execution time.

(4)特定タイミングの例として、各命令の実行時間と
は無関係な、例えば、命令実行の最初のサイクル(又は
、ステート)とか、実行の最終サイクルとかが考えられ
るが、通常、命令実行の最終サイクルは割込みの発生を
決定するサイクルでもあることから、該実行の最終サイ
クルを上記特定タイミングとして採用するのが効果的で
ある。
(4) Examples of specific timing include the first cycle (or state) of instruction execution, the final cycle of execution, etc., which are unrelated to the execution time of each instruction, but usually the final cycle of instruction execution Since the cycle also determines the occurrence of an interrupt, it is effective to use the final cycle of the execution as the specific timing.

(5)例として、平均命令実行時間が3マシンサイクル
の中央処理装置(CPU)で、上記1マシンサイクルの
特定タイミングを採用したとき、確率的に、サンプリン
グパルスの内の273が無駄に捨てられることになるの
で、このことを考慮して、サンプリングパルスの周期を
、3倍にするとか、該命令頻度の測定時間を3倍にすれ
ばよい。
(5) As an example, when the above specific timing of 1 machine cycle is adopted for a central processing unit (CPU) whose average instruction execution time is 3 machine cycles, 273 of the sampling pulses will be wasted with probability. Therefore, in consideration of this, the period of the sampling pulse may be tripled, or the measurement time of the instruction frequency may be tripled.

このように、機能するので、少ないハードウェア量で、
且つ、計算機システムの運用環境への擾乱が少ないサン
プリング方式による命令頻度測定を行って、命令の実行
時間の長さに影響されない正確な命令頻度測定ができる
効果がある。
This way, it works, so you can use less hardware.
In addition, the instruction frequency is measured using a sampling method that causes less disturbance to the operating environment of the computer system, and there is an effect that the instruction frequency can be accurately measured without being affected by the length of instruction execution time.

〔実施例〕〔Example〕

以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.

第1図は本発明の一実施例を示した図であり、(a)は
構成例を示し、(bl) 、 (b2)は動作タイムチ
ャートを示しており、第2図(a)に示した全体の構成
例にあるサンプリングパルス発生機構11から出力され
る一定周期のサンプリングパルス■を、命令実行時の特
定タイミングを示す信号、例えば、命令実行完了信号■
で論理積をとって割込みラッチ123をセットする手段
が本発明を実施するのに必要な手段である。尚、全図を
通して同じ符号は同じ対象物を示している。
FIG. 1 is a diagram showing an embodiment of the present invention, (a) shows a configuration example, (bl) and (b2) show operation time charts, and FIG. 2 (a) shows an example of the configuration. The sampling pulse (■) with a constant period output from the sampling pulse generation mechanism 11 in the overall configuration example shown in FIG.
A means for performing a logical AND operation and setting the interrupt latch 123 is a means necessary to implement the present invention. Note that the same reference numerals indicate the same objects throughout the figures.

以下、第1図によって本発明の命令頻度測定方式を説明
する。
Hereinafter, the instruction frequency measuring method of the present invention will be explained with reference to FIG.

本発明を実施しても、サンプリング方式による命令頻度
測定の基本的な動作は従来方式と特に変わることはない
ので省略し、ここでは、各命令毎に、予め、定められた
特定のタイミングを示す信号、例えば、命令実行完了信
号■で、タイマ割込みを発生させて、命令頻度測定ルー
チン22を起動する動作を中心にして説明する。
Even if the present invention is implemented, the basic operation of measuring the instruction frequency using the sampling method is not particularly different from the conventional method, so it will be omitted here. The following description focuses on the operation of generating a timer interrupt using a signal, for example, the instruction execution completion signal (2), and activating the instruction frequency measurement routine 22.

本実施例においては、前述のように、各命令毎に、予め
、定めた特定タイミングとして、最も効果的な、例えば
、割込みの発生を決定するサイクルであり、各命令の実
行が開始されると、該命令の実行時間に、無関係に、必
ず、出力される命令実行完了信号■を採用しているが、
これに、限定されるものでないことはいう迄もないこと
である。
In this embodiment, as described above, the predetermined specific timing for each instruction is the most effective, for example, the cycle that determines the occurrence of an interrupt, and when the execution of each instruction is started. , the instruction execution completion signal ■ is always output regardless of the execution time of the instruction, but
Needless to say, it is not limited to this.

この命令実行完了信号■と、サンプリングパル大発生機
構11(第2図(a)参照)から、周期的に出力される
サンプリングパルス■とを論理積(AND)回路120
で論理積をとり、一致が取れると、タイマ割込みラッチ
123をセットし、従来から使用されている命令頻度測
定ルーチン22を起動する。((b2)図の動作タイム
チャート参照)従って、該各命令が持っている特定のタ
イミング、即ち、命令実行完了信号■と一致しないサン
プリングパルス■は自動的に無視されることになる。(
(bl)図の動作タイムチャート参照)この結果、該サ
ンプリングパルス■の一部が無駄に捨てられることにな
るので、前述のように、該サンプリングパルス■の周期
を短くするとか、該命令頻度測定ルーチン22による命
令頻度測定時間を延長させる等の補正処理が必要である
This instruction execution completion signal ■ and the sampling pulse ■ periodically output from the large sampling pulse generation mechanism 11 (see FIG. 2(a)) are connected to a logical product (AND) circuit 120.
When a match is found, the timer interrupt latch 123 is set and the conventionally used instruction frequency measuring routine 22 is activated. (See the operation time chart in Figure (b2).) Therefore, the specific timing of each instruction, that is, the sampling pulse (2) that does not match the instruction execution completion signal (2) is automatically ignored. (
(Refer to the operation time chart in the figure (bl)) As a result, a part of the sampling pulse (■) will be wasted, so as mentioned above, the cycle of the sampling pulse (■) may be shortened, or the frequency of the command may be measured. Correction processing such as extending the command frequency measurement time by routine 22 is required.

このように、本発明は、計算機システムが元々備えてい
るタイマ割込み機構を用いて、タイマ割込みによるソフ
トウェア手段により、現在実行中のプログラムが中断さ
れた時に主記憶装置(MSU)上に保存されるOLD 
PS−を参照し、「最後に実行した命令の次の命令をサ
ンプリングする」命令頻度測定方式において、該最後に
実行した、命令頻度測定には無関係の命令の実行時間に
よって、実際に測定される命令の頻度に重みが付くのを
防止する為に、各命令の実行時の特定のタイミング、例
えば、割込み発生サイクルでもある命令実行完了信号■
と一致するサンプリングパルス■を捕捉して、上記タイ
マ割込みを発生させ、命令頻度測定ルーチンを起動させ
るようにした所に特徴がある。
As described above, the present invention utilizes the timer interrupt mechanism originally provided in the computer system to save information on the main storage unit (MSU) when the currently executing program is interrupted by software means using the timer interrupt. OLD
PS-, in the instruction frequency measurement method that "samples the next instruction after the last executed instruction", it is actually measured by the execution time of the last executed instruction, which is unrelated to instruction frequency measurement. In order to prevent the frequency of instructions from being weighted, the specific timing when each instruction is executed, for example, the instruction execution completion signal, which is also the interrupt generation cycle.
The feature is that the sampling pulse (2) that coincides with is captured, the above-mentioned timer interrupt is generated, and the instruction frequency measurement routine is activated.

〔発明の効果〕〔Effect of the invention〕

以上、詳細に説明したように、本発明の命令頻度測定方
式は、情報処理装置の中央処理装置(CPU)で実行さ
れるプログラム中のどの命令がどの位の頻度で実行され
たかを測定するのに、周期的にサンプリングパルスを発
生するサンプリングパルス発生機構と、該サンプリング
パルスに呼応して現在実行中のプログラムの実行を一時
中断する機構と、該プログラムの中断時点の情報から、
次に実行すべきであった命令を主記憶装置(MSU)か
ら読み出す機構と、該読み出した命令語を解読、して命
令頻度を計測する機構とを備えた情報処理装置において
、上記サンプリングパルスに呼応して現在実行中のプロ
グラムの実行を一時中断するタイミングを、命令毎に予
め定めた特定のタイミングとし、且つ、該特定のタイミ
ングを全ての命令に対して同一の長さとする手段を設け
て、該手段で生成された信号に基づいて、上記命令頻度
を計測する機構を起動し、命令実行頻度を測定するよう
にしたものであるので、少ないハードウェア量で、且つ
、計算機システムの運用環境への擾乱が少ないサンプリ
ング方式による命令頻度測定を行って、命令の実行時間
の長さに影響されない正確な命令頻度測定ができる効果
がある。
As described above in detail, the instruction frequency measurement method of the present invention measures which instructions in a program executed by the central processing unit (CPU) of an information processing device are executed and how often. a sampling pulse generation mechanism that periodically generates sampling pulses; a mechanism that temporarily interrupts execution of a currently running program in response to the sampling pulse; and information on the point at which the program is interrupted;
In an information processing device that is equipped with a mechanism that reads an instruction that should be executed next from a main storage unit (MSU), and a mechanism that decodes the read instruction word and measures the instruction frequency, the sampling pulse In response, a means is provided to temporarily suspend the execution of the currently executing program at a specific timing predetermined for each instruction, and to make the specific timing the same length for all instructions. , Based on the signal generated by the means, the mechanism for measuring the frequency of instructions is activated to measure the frequency of instruction execution, so that the amount of hardware is small and the operating environment of the computer system is By measuring the instruction frequency using a sampling method that causes less disturbance to the instruction, it is possible to accurately measure the instruction frequency without being affected by the length of the instruction execution time.

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

第1図は本発明の一実施例を示した図。 第2図は従来の命令頻度測定方式を説明する図。 である。 図面において、 1は中央処理装置(CPU) 。 11はサンプリングパルス発生機構。 12は命令実行/割込゛み制御回路。 120.122は論理積(AND)回路。 121.123はラッチ。 2は主記憶装置(MSU) 。 21は旧プログラム・ステータス語(OLD22は命令
頻度測定ルーチン。 23はプログラム。 24は実行回数記録語(1〜nL ■はサンプリングパルス。 ■は命令実行完了信号。 をそれぞれ示す。 PSW)。 第 図 第 図 (その1)
FIG. 1 is a diagram showing an embodiment of the present invention. FIG. 2 is a diagram illustrating a conventional instruction frequency measurement method. It is. In the drawings, 1 is a central processing unit (CPU). 11 is a sampling pulse generation mechanism. 12 is an instruction execution/interrupt control circuit. 120.122 is a logical product (AND) circuit. 121.123 is a latch. 2 is the main storage unit (MSU). 21 is an old program status word (OLD 22 is an instruction frequency measurement routine. 23 is a program. 24 is an execution count record word (1 to nL). ■ indicates a sampling pulse. ■ indicates an instruction execution completion signal. PSW). Figure (Part 1)

Claims (1)

【特許請求の範囲】 周期的にサンプリングパルス([1])を発生するサン
プリングパルス発生機構(11)と、該サンプリングパ
ルス([1])に呼応して現在実行中のプログラムの実
行を一時中断する機構(12)と、該プログラムの中断
時点の情報から、次に実行すべきであった命令を主記憶
装置(MSU)(2)から読み出す機構(21、12)
と、該読み出した命令語を解読して命令頻度を計測する
機構(12、22、24)とを備えた情報処理装置にお
いて、 上記サンプリングパルス([1])に呼応して現在実行
中のプログラムの実行を一時中断するタイミングを、命
令毎に予め定めた特定のタイミング([2])とし、且
つ、該特定のタイミング([2])を全ての命令に対し
て同一の長さとする手段(120)を設けて、 該手段(120)で生成された信号に基づいて、上記命
令頻度を計測する機構(12、22、24)を起動し、
命令実行頻度を測定することを特徴とする命令頻度測定
方式。
[Claims] A sampling pulse generation mechanism (11) that periodically generates a sampling pulse ([1]), and a temporary suspension of execution of a currently running program in response to the sampling pulse ([1]). and a mechanism (21, 12) that reads the next instruction to be executed from the main storage unit (MSU) (2) based on the information at the time the program was interrupted.
and a mechanism (12, 22, 24) for decoding the read instruction word and measuring the instruction frequency, the program currently being executed in response to the sampling pulse ([1]) A means ([2]) for temporarily suspending the execution of the instruction at a specific timing ([2]) predetermined for each instruction, and for making the specific timing ([2]) the same length for all instructions. 120), activating the mechanism (12, 22, 24) for measuring the frequency of commands based on the signal generated by the means (120);
An instruction frequency measurement method characterized by measuring instruction execution frequency.
JP1090030A 1989-04-10 1989-04-10 Instruction frequency measurement method Expired - Fee Related JP2775830B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1090030A JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1090030A JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Publications (2)

Publication Number Publication Date
JPH02268343A true JPH02268343A (en) 1990-11-02
JP2775830B2 JP2775830B2 (en) 1998-07-16

Family

ID=13987272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1090030A Expired - Fee Related JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Country Status (1)

Country Link
JP (1) JP2775830B2 (en)

Also Published As

Publication number Publication date
JP2775830B2 (en) 1998-07-16

Similar Documents

Publication Publication Date Title
JP2806524B2 (en) Vector operation instruction issue control method
EP1125199B1 (en) Method of debugging a program thread
JPH02268343A (en) Instruction frequency measuring system
JPH0357970A (en) Pulse input apparatus
JPS62279438A (en) Tracking circuit
JPS6128144A (en) Executing device of tracing
JPH0251749A (en) Circuit for measuring processor application rate
JP2595718B2 (en) In-circuit emulator
JPH0528002A (en) Microprocessor
JP3068578B2 (en) In-circuit emulator and saturation calculation processing method
JPS63113743A (en) Debugging system for computer hardware
JPS6411977B2 (en)
JPS6175937A (en) Electronic computer
JP2000250779A (en) Programmable controller
JPH11102306A (en) Emulator
JPH02202646A (en) Micro program controller
JPH02216546A (en) Program debugging supporting system for information processing system
JPS607554A (en) Measuring system for performance of computer system
JPS62109140A (en) Tracing circuit for program processor
JPS5953955A (en) Performance measuring system
JPS62109139A (en) Method and device for analyzing working of microprocessor
JPS6226546A (en) Execution bus cycle tracing circuit
JPS6263344A (en) Device for counting execution number of times of loop instruction
JPH0333940A (en) Microprocessor for evaluation
JPS62130436A (en) Trace controller

Legal Events

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