JPS64731B2 - - Google Patents

Info

Publication number
JPS64731B2
JPS64731B2 JP55177280A JP17728080A JPS64731B2 JP S64731 B2 JPS64731 B2 JP S64731B2 JP 55177280 A JP55177280 A JP 55177280A JP 17728080 A JP17728080 A JP 17728080A JP S64731 B2 JPS64731 B2 JP S64731B2
Authority
JP
Japan
Prior art keywords
memory
instruction
address
program
trace
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
Application number
JP55177280A
Other languages
Japanese (ja)
Other versions
JPS57101953A (en
Inventor
Nobumitsu Kenbo
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 JP55177280A priority Critical patent/JPS57101953A/en
Publication of JPS57101953A publication Critical patent/JPS57101953A/en
Publication of JPS64731B2 publication Critical patent/JPS64731B2/ja
Granted legal-status Critical Current

Links

Classifications

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

Description

【発明の詳細な説明】 この発明は命令アドレストレース方式に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an instruction address tracing method.

メモリ内に格納された命令を読み出して実行す
る命令処理装置において、どのような順序で命令
が実行されたのか知る必要のあるときがある。従
来、この目的のため、実行された命令のアドレス
を順番にメモリに保存しておき、過去に実行され
た命令をトレース出来るようにしたものがある。
メモリに保存されるアドレスの数Nは限られるた
め、最新のN個の実行された命令のアドレスを記
憶し、それより過去のものは書きかえられる。し
かし、この方式ではトレースの最終部分と、観測
したい部分との間にループが形成されるような命
令が含まれていた場合、ループの部分で多くのア
ドレスを保存することになり、アドレスを保存す
るメモリが、前記ループ部のトレースのみに終つ
てしまい、観測したい部分がループ部のトレース
で書きかえられ保存されないという欠点があつ
た。
In an instruction processing device that reads and executes instructions stored in a memory, there are times when it is necessary to know in what order the instructions were executed. Conventionally, for this purpose, there is a system in which addresses of executed instructions are stored in memory in order, so that instructions executed in the past can be traced.
Since the number N of addresses stored in the memory is limited, the addresses of the latest N executed instructions are stored, and the addresses older than that are rewritten. However, with this method, if an instruction that creates a loop is included between the final part of the trace and the part you want to observe, many addresses will be saved in the loop part, and the address will not be saved. This has the disadvantage that the memory that is used for this purpose ends up containing only the trace of the loop portion, and the portion to be observed is rewritten by the trace of the loop portion and is not saved.

この発明の目的とするところは、たとえどのよ
うなループが構成されていようとも、プログラム
全体の流れを把握し、かつトレース終了時点直前
の命令実行の順序が判読できる命令アドレストレ
ース方式を提供するところにある。
An object of the present invention is to provide an instruction address tracing method that can grasp the flow of the entire program and read the order of instruction execution immediately before the end of the trace, no matter what kind of loop is configured. It is in.

この発明の特徴とするところは、実行された命
令のアドレスを保存するために、命令を格納する
メモリと同じ容量のアドレスを持つメモリを用意
し、このメモリに、各々のアドレスの命令が何番
目に実行されたかを書き込むことにより、命令の
トレースを行なおうとするものである。
A feature of this invention is that in order to store the addresses of executed instructions, a memory with addresses of the same capacity as the memory that stores the instructions is prepared, and the number of instructions at each address is stored in this memory. It attempts to trace instructions by writing whether they were executed.

次に本発明の実施例につき図面を用いて詳細に
説明する。第1図は本発明の一実施例であるアド
レス保存装置のブロツク図を示すものである。図
中2はプログラムを記憶しているコントロールメ
モリ、4は命令が1個実行される毎に1ずつカウ
ントアツプされるカウンタ、3はカウンタ4の値
を記憶できるエリアをコントロールメモリ1に記
憶される命令数をもつているトレースメモリであ
る。
Next, embodiments of the present invention will be described in detail using the drawings. FIG. 1 shows a block diagram of an address storage device which is an embodiment of the present invention. In the figure, 2 is a control memory that stores the program, 4 is a counter that counts up by 1 each time one instruction is executed, and 3 is an area where the value of counter 4 can be stored, which is stored in control memory 1. It is a trace memory that has a number of instructions.

命令処理装置1はコントロールメモリ2に対し
アドレス線5によつて読み出しアドレスを与え、
命令を読み出す。この時、前記アドレスはトレー
スメモリ3のアドレスにもなつている。カウンタ
4は、1命令毎に出る命令実行終了信号8による
カウントアツプ信号11により加算され、その値
7が命令処理装置1からの命令読み取り信号9に
よる書き込み許可信号10によりトレースメモリ
3に書き込まれる。カウンタ4の値は現命令は何
番目に実行されたものかを示している。また、任
意のトレース終了信号12により、トレースメモ
リ3に対する書き込み処理は終了する。
The instruction processing device 1 gives a read address to the control memory 2 through the address line 5,
Read instructions. At this time, the address also serves as the address of the trace memory 3. The counter 4 is incremented by a count up signal 11 caused by an instruction execution end signal 8 that is output for each instruction, and the value 7 is written into the trace memory 3 by a write permission signal 10 caused by an instruction read signal 9 from the instruction processing device 1. The value of counter 4 indicates the number of times the current instruction has been executed. Furthermore, the writing process to the trace memory 3 is terminated by an arbitrary trace end signal 12.

トレースメモリ3のワード数はコントロールメ
モリ2のワード数と同じだけのものが必要であ
る。またカウンタ4は常に1が加算されていく
為、出来るだけビツト数が多いことが望まれる。
トレースメモリ3の1ワードあたりのビツト数
は、カウント4と同じだけのものが必要である。
The number of words in the trace memory 3 is required to be the same as the number of words in the control memory 2. Furthermore, since the counter 4 is always incremented by 1, it is desirable that the number of bits be as large as possible.
The number of bits per word of trace memory 3 is required to be the same as count 4.

通常動作時、命令処理装置1がコントロールメ
モリ2から命令を読み出すと、トレースメモリ3
の同じアドレスに、今実行中の命令が何番目のも
のであるかを示す値7が格納される。よつてトレ
ースメモリ3の各々のアドレスには、コントロー
ルメモリの同じアドレス(同じ命令)を最後に読
み出し実行したときのカウンタの値7が格納され
ることになる。ただしカウンタ4は桁あふれによ
り零にもどるので、後でトレースメモリをダンプ
したとき混乱を記さないだけの充分な周期を持つ
て回転するビツト数が必要である。
During normal operation, when the instruction processing device 1 reads an instruction from the control memory 2, the trace memory 3
A value 7 indicating the number of the instruction currently being executed is stored at the same address. Therefore, each address in the trace memory 3 stores the counter value 7 when the same address (same instruction) in the control memory was last read and executed. However, since the counter 4 returns to zero due to overflow, it is necessary to have a number of bits that rotate with a sufficient period so that when the trace memory is dumped later, no confusion will be recorded.

命令処理装置の動きが停止する、あるいはトレ
ース終了信号12が来ると、その時点におけるカ
ウンタ4の値、及びトレスメモリ3の内容は保存
される。トレース終了時点と、観測したい部分と
の間にループを形成する部分があつた場合、ルー
プ部分には、そこを最後に通過したときのカウン
タの値7が入つている。よつて、ループ入口アド
レスに格納されているカウント値より小さく、か
つその値に最も近い値を持つアドレスを探せば、
そこがそのループに入る直前のアドレスである。
また、ループに入る直前の値と、ループ内のステ
ツプ数、ループ内アドレスに残されているカウン
ト値から、そのループを何回通過したかを計算す
ることもできる。また、トレースメモリ全体を概
観すれば、カウント値からプログラム全体の流れ
を読み取ることが出来、全く通過していない部分
を見つけ出すことも出来る。
When the operation of the instruction processing device stops or when the trace end signal 12 is received, the value of the counter 4 and the contents of the trace memory 3 at that time are saved. If there is a portion forming a loop between the end of the trace and the portion to be observed, the loop portion contains the counter value 7 when the loop was last passed through. Therefore, if you search for an address that is smaller than the count value stored in the loop entry address and has a value closest to that value,
This is the address immediately before entering the loop.
It is also possible to calculate how many times the loop has been passed from the value immediately before entering the loop, the number of steps in the loop, and the count value left at the address in the loop. Furthermore, by looking at the entire trace memory, it is possible to read the flow of the entire program from the count value, and it is also possible to find parts that have not been passed at all.

第2a図、第2b図は、ループを形成する命令
とトレースメモリの関係を抽いたものである。ア
ドレスとは、コントロールメモリ2の命令のアド
レスを示す。第2a図に示すように、アドレス
1004と1008の間で複数回ループが行なわれた場
合、トレースメモリの内容を見ると、アドレス
1003と1004の間で値が離れており、1003番地から
ループに入つたことがわかる。カウンタの値は16
進表示で表わしてある。そして、他の手段により
1008番地がループ終了番地であることがわかれ
ば、1003番地と1004番地の値の差から、ループを
4回通過したことを計算できる。また第2b図の
ように命令が動いた場合、1006番地から始まるル
ープに対して、最後にループに入る直前に実行さ
れたのは1004番地であることはトレースメモリの
内容から明らかであり、ループ突入時の様子を読
み取ることができる。
FIGS. 2a and 2b illustrate the relationship between instructions forming a loop and trace memory. The address indicates the address of the instruction in the control memory 2. As shown in Figure 2a, the address
If the loop is executed multiple times between 1004 and 1008, looking at the contents of trace memory, the address
The values are far apart between 1003 and 1004, indicating that the loop entered from address 1003. Counter value is 16
It is expressed in decimal notation. and by other means
If we know that address 1008 is the loop end address, we can calculate that the loop has been passed four times from the difference between the values at addresses 1003 and 1004. Furthermore, when the instruction moves as shown in Figure 2b, it is clear from the contents of the trace memory that for the loop starting at address 1006, the last execution immediately before entering the loop was at address 1004, and the loop starts at address 1006. You can read the situation at the time of entry.

以上の如き構成であるから、本発明にあつて
は、次の如き効果を得ることができる。
With the configuration as described above, the following effects can be obtained in the present invention.

1 どのようなループが構成されていても、プロ
グラムをトレースすることが出来る。
1. Programs can be traced no matter what kind of loops are configured.

2 プログラム全体の流れや、未通過部分を読み
取ることが出来る。
2. Can read the flow of the entire program and the parts that have not been passed.

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

第1図は本発明の一実施例を示す命令アドレス
トレース方式のブロツク図である。第2a図はプ
ログラムトレースの一例を示す図、第2b図は他
のプログラムトレース例を示す図である。 符号の説明 1……命令処理装置、2……コン
トロールメモリ、3……トレースメモリ、4……
カウンタ、5……命令アドレス線。
FIG. 1 is a block diagram of an instruction address trace system showing one embodiment of the present invention. FIG. 2a is a diagram showing an example of program tracing, and FIG. 2b is a diagram showing another example of program tracing. Explanation of symbols 1...Instruction processing device, 2...Control memory, 3...Trace memory, 4...
Counter, 5...Instruction address line.

Claims (1)

【特許請求の範囲】 1 プログラムメモリに格納されたプログラムの
実行をトレースする方式であつて、 プログラムされた命令が実行される毎に命令の
種類とは無関係にカウントアツプされて命令の実
行順序を示すカウンタと、前記プログラムメモリ
の命令数分の記憶エリアを有するトレースメモリ
とを具え、命令が実行される毎に、該命令が格納
されている前記プログラムメモリのアドレスに対
応する前記トレースメモリの記憶エリアにそのと
きの前記カウンタの値を記憶せしめ、前記プログ
ラムメモリの同一アドレスの命令が複数回実行さ
れる場合でも、対応する前記トレースメモリの記
憶エリアに前記カウンタの値を上書きすることに
よつて、限られたトレースメモリでプログラム命
令の実行順序を解析ならしめることを特徴とする
プログラム実行トレース方式。 2 前記トレースメモリは、トレースの実行を禁
止する信号に基づいて、前記カウンタの値の書込
みが許可されるか否かが制御され、前記プログラ
ムメモリの任意の範囲の命令がトレースされるこ
とを特徴とする特許請求の範囲第1項記載のプロ
グラム実行トレース方式。
[Claims] 1. A method for tracing the execution of a program stored in a program memory, in which a count is incremented each time a programmed instruction is executed, regardless of the type of instruction, and the execution order of the instructions is determined. and a trace memory having a storage area corresponding to the number of instructions in the program memory, and each time an instruction is executed, storage in the trace memory corresponds to an address in the program memory where the instruction is stored. By storing the value of the counter at that time in an area, and even if an instruction at the same address in the program memory is executed multiple times, the value of the counter is overwritten in the corresponding storage area of the trace memory. , a program execution tracing method characterized by analyzing the execution order of program instructions using limited trace memory. 2. The trace memory is characterized in that whether or not writing of the value of the counter is permitted is controlled based on a signal that prohibits execution of tracing, and instructions in an arbitrary range of the program memory are traced. A program execution tracing method according to claim 1.
JP55177280A 1980-12-17 1980-12-17 Program execution trace system Granted JPS57101953A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP55177280A JPS57101953A (en) 1980-12-17 1980-12-17 Program execution trace system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP55177280A JPS57101953A (en) 1980-12-17 1980-12-17 Program execution trace system

Publications (2)

Publication Number Publication Date
JPS57101953A JPS57101953A (en) 1982-06-24
JPS64731B2 true JPS64731B2 (en) 1989-01-09

Family

ID=16028276

Family Applications (1)

Application Number Title Priority Date Filing Date
JP55177280A Granted JPS57101953A (en) 1980-12-17 1980-12-17 Program execution trace system

Country Status (1)

Country Link
JP (1) JPS57101953A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS633347A (en) * 1986-06-21 1988-01-08 Nec Corp Extracting system for executing path of program including loop
JPH0668722B2 (en) * 1986-10-09 1994-08-31 日本電気株式会社 Instruction processing order controller

Also Published As

Publication number Publication date
JPS57101953A (en) 1982-06-24

Similar Documents

Publication Publication Date Title
US4040030A (en) Computer instruction control apparatus and method
JPS64731B2 (en)
EP1016966A2 (en) Method and protocol for inter-process communication
JP2731047B2 (en) Program operand check method
JPH0281141A (en) Trace control system
JPH03184135A (en) Data processor
JPH04287241A (en) History information storage device
JPH0659967A (en) Method for accessing memory area
KR100294655B1 (en) How to Control a My Programmable Controller That Performs a Multitask Function
JPS6142301B2 (en)
US5321822A (en) Information processing system with addressing exception
JPH01321531A (en) State information history circuit
KR0164725B1 (en) Cache memory
JPS6242237A (en) Loading system to instruction buffer
JPS5872233A (en) Channel device
JPS6125168B2 (en)
JPS626341A (en) Information processor
JPH04243436A (en) Execution history storage device
JPH0250495B2 (en)
JPS5968067A (en) Specifying system for number of run steps
JPH02205937A (en) Information processing system
JP2009199211A (en) Memory control method and device and computer program
JPS58181159A (en) Storage circuit of state history
JPS6124737B2 (en)
JPH04134786A (en) Memory address circuit