JPS6389940A - Program tracing circuit - Google Patents

Program tracing circuit

Info

Publication number
JPS6389940A
JPS6389940A JP61235792A JP23579286A JPS6389940A JP S6389940 A JPS6389940 A JP S6389940A JP 61235792 A JP61235792 A JP 61235792A JP 23579286 A JP23579286 A JP 23579286A JP S6389940 A JPS6389940 A JP S6389940A
Authority
JP
Japan
Prior art keywords
program
trace
circuit
signal
tracing
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
JP61235792A
Other languages
Japanese (ja)
Inventor
Teiichi Ishido
石戸 悌一
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 JP61235792A priority Critical patent/JPS6389940A/en
Publication of JPS6389940A publication Critical patent/JPS6389940A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform program tracing without stopping or interrupting a program in executing, or assembling a tracing program in a regulator program, by providing a trace stop control circuit, etc. CONSTITUTION:A microprocessor 1, when the start of a processing being instructed, outputs the value of a program counter, and a signal (a) to a bus 8. And the trace stop control circuit 4 outputs a start signal or a stop signal when the value set in an internal register coincides with an address inputted through the bus 8, and it is detected that the signal (a) is '1'. In this way, the start and the stop of the storage of a bit of trace information by a program counter sequential storing memory circuit 3 is controlled. Next, when a read signal from the processor 1 is inputted to a trace connect reading circuit 5, the bit of trace information stored in the circuit 3 is read out. In this way, it is possible to perform the program tracing without stopping the program in executing, and assembling the tracing program in the regular program.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はマイクロプロセッサを使用した装置のプログラ
ムトレース回路に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a program trace circuit for a device using a microprocessor.

〔従来の技術〕[Conventional technology]

マイクロプロセッサを使用した装置に於いて、プログラ
ムトレースを行なう場合、従来は、インサーキットエミ
ュレータを用いるか、或いは通常プログラム中にトレー
ス用プログラムを組込み、このトレース用プログラムに
よりプログラムトレースを行なうようにしている。
Conventionally, when performing program tracing in a device using a microprocessor, an in-circuit emulator is used or a tracing program is incorporated into the normal program, and the program is traced using this tracing program. .

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

しかし、インサーキットエミュレータを用いてプログラ
ムトレースを行なう場合は、マイクロプロセッサを制御
してプログラム走行状態を中断したり停止したりするこ
とが必要となる問題があり、また通常プログラムにトレ
ース用プログラムを組込む場合はプログラムの作成が面
倒であり、誤りを作り込む惧れがある問題があった。
However, when performing program tracing using an in-circuit emulator, there is a problem in that it is necessary to control the microprocessor to interrupt or stop the program running state, and it is also necessary to incorporate the tracing program into the normal program. In this case, creating a program is troublesome and there is a risk of introducing errors.

本発明は前述の如き問題点を解決したものであり、その
目的は実行中のプログラムを停止或いは中断させること
なく、または、通常プログラムにトレース用プログラム
を組込むことなしにプログラムトレースを行ない得るよ
うにすることにある。
The present invention solves the above-mentioned problems, and its purpose is to enable program tracing without stopping or interrupting a running program, or without incorporating a tracing program into a normal program. It's about doing.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は前述の如き問題点を解決するため、マイクロプ
ロセッサを使用した装置に於いて、トレース情報を逐次
記憶するメモリ回路と、該メモリ回路によるトレース情
報の記憶を停止させるトレースストップ制御回路と、 前記メモリ回路に記憶されているトレース情報を読出す
トレース内容読出し回路とを設けたものである。
In order to solve the above-mentioned problems, the present invention provides a memory circuit for sequentially storing trace information, a trace stop control circuit for stopping the storage of trace information by the memory circuit, in a device using a microprocessor. and a trace content reading circuit for reading trace information stored in the memory circuit.

〔作 用〕[For production]

メモリ回路によりトレース情報が逐次記憶され、トレー
スストップ制御回路によりメモリ回路によるトレース情
報の記憶が停止され、トレース内容読出し回路によりメ
モリ回路に記憶されたトレース情報が読出される。
The trace information is sequentially stored by the memory circuit, the trace stop control circuit stops the memory circuit from storing the trace information, and the trace content reading circuit reads the trace information stored in the memory circuit.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の実施例のブロック図であり、マイクロ
プロセッサ1と、マイクロプロセッサ1が実行するプロ
グラム等が記憶されるメモリ2と、マイクロプロセッサ
1内のプログラムカウンタのカウント値をトレース情報
として記憶するプログラムカウンタ逐次記憶用メモリ回
路3と、プログラムカウンタ逐次記憶用メモリ回路3に
よるトレース情報の記憶の開始、停止を制御するトレー
スストップ制御回路4と、プログラムカウンタ逐次記憶
用メモリ回路3に記憶されたトレース情報を読出すトレ
ース内容読出し回路5と、インタフェース部6と、外部
装置7とから構成されている。
FIG. 1 is a block diagram of an embodiment of the present invention, which includes a microprocessor 1, a memory 2 in which programs, etc. executed by the microprocessor 1 are stored, and a count value of a program counter in the microprocessor 1 as trace information. A program counter sequential storage memory circuit 3 to be stored, a trace stop control circuit 4 that controls the start and stop of storage of trace information by the program counter sequential storage memory circuit 3, and a program counter sequential storage memory circuit 3 to store trace information. The trace content reading circuit 5 includes a trace content reading circuit 5 for reading out trace information, an interface section 6, and an external device 7.

尚、同図に於いて8はデータバス、アドレスバス及び制
御バスからなるバスである。
In the figure, 8 is a bus consisting of a data bus, an address bus, and a control bus.

また、第2図は第1図に示したプログラムカウンタ逐次
記憶用メモリ回路3、トレースストップ制御回路4、ト
レース内容読出し回路5及びインタフェース部6の構成
例を示したブロック図である。
FIG. 2 is a block diagram showing an example of the configuration of the program counter sequential storage memory circuit 3, trace stop control circuit 4, trace content reading circuit 5, and interface section 6 shown in FIG.

プログラムカウンタ逐次記憶用メモリ回路3はマイクロ
プロセッサ1よりバス8を介して加えられるプログラム
カウンタのカウント値を記憶するメモリ回路31と、メ
モリ回路31の書込みアドレスをjM7にするカウンタ
32と、アンドゲート33とがら構成されている。トレ
ースストップ制御回路4はトレースを開始する時のプロ
グラムカウンタのカウント値がマイクロプロセッサ1よ
りバス8を介してセットされるレジスタ41と、トレー
スを停止する時のプログラムカウンタのカウント値がマ
イクロプロセッサ1よりバス8を介してセットされるレ
ジスタ42と、トレーススタート信号す及びトレースス
トップ信号Cを出力するトレーススタート/ストップ検
出回路43と、オアゲート44.45と、フリフプフロ
ップ46とから構成されている。トレース内容読出し回
路5はメモリ回路31の読出しアドレスを指示するカウ
ンタ51と、スリーステートバッファ52と、オアゲー
ト53とから構成され、また、インタフェース部6はバ
ッファ61〜64から構成されている。
The program counter sequential storage memory circuit 3 includes a memory circuit 31 that stores the count value of the program counter that is added from the microprocessor 1 via the bus 8, a counter 32 that sets the write address of the memory circuit 31 to jM7, and an AND gate 33. It is made up of spikes. The trace stop control circuit 4 has a register 41 in which the count value of the program counter at the time of starting tracing is set by the microprocessor 1 via the bus 8, and a register 41 in which the count value of the program counter at the time of stopping the trace is set by the microprocessor 1. The trace start/stop detection circuit 43 outputs a trace start signal and a trace stop signal C, an OR gate 44, 45, and a flip-flop 46. The trace content reading circuit 5 is comprised of a counter 51 for instructing the read address of the memory circuit 31, a three-state buffer 52, and an OR gate 53, and the interface section 6 is comprised of buffers 61-64.

次に、第1図及び第2図の動作を説明する。本実施例は
、プログラムトレースを外部装置7からの指示及びマイ
クロプロセッサ1の制御の双方により行なうことができ
るものであり、先ず、マイクロプロセッサ1の制御によ
りプログラムトレースを行なう場合について説明する。
Next, the operations shown in FIGS. 1 and 2 will be explained. In this embodiment, program tracing can be performed both by instructions from the external device 7 and by control of the microprocessor 1. First, a case where program tracing is performed by the control of the microprocessor 1 will be described.

この場合、メモリ2には例えば第3図に示すように、ト
レース開始処理を行なうプログラムAと、トレース対象
となる処理を行なうプログラムBと、トレース情報読出
し処理を行なうプログラムCとを記憶させておく。尚、
プログラムAにはプログラムトレースを開始するプログ
ラムカウンタのカウント値をレジスタ41にセットする
命令及びプログラムトレースを終了するプログラムカウ
ンタのカウント値をレジスタ42にセントする命令が含
まれているものである。
In this case, the memory 2 stores, for example, as shown in FIG. 3, a program A that performs a trace start process, a program B that performs a process to be traced, and a program C that performs a trace information read process. . still,
Program A includes an instruction to set the count value of the program counter in the register 41 to start the program trace, and an instruction to set the count value of the program counter in the register 42 to end the program trace.

マイクロプロセッサ1は処理開始が指示されると、プロ
グラムカウンタの値をバス8に出力し、メモリ2からプ
ログラムA、B、C中の命令等を順次読出し、実行する
。尚、マイクロプロセッサ1はメモリ2から1つの命令
を読出す毎に、プログラムカウンタのカウント値をバス
8に出力すると共にその出力信号aを“1”にするもの
である。
When the microprocessor 1 is instructed to start processing, it outputs the value of the program counter to the bus 8, sequentially reads out the instructions, etc. in the programs A, B, and C from the memory 2, and executes them. Each time the microprocessor 1 reads one instruction from the memory 2, it outputs the count value of the program counter to the bus 8 and sets its output signal a to "1".

プログラムAを読出すことにより、マイクロプロセンサ
1はレジスタ4Iにプログラムトレースを開始するプロ
グラムカウンタのカウント値をセットすると共にレジス
タ42にプログラムトレースを終了するプログラムカウ
ンタのカウント値をセントする。
By reading the program A, the microprocessor sensor 1 sets the count value of the program counter that starts the program trace in the register 4I, and also writes the count value of the program counter that ends the program trace in the register 42.

プログラムAの実行終了後、マイクロプロセッサlはプ
ログラムBの処理を実行する。トレースストップ制御回
路4内のトレーススタート/ストップ検出回路43はレ
ジスタ41にセントされている値とバス8を介して加え
られるアドレスとが一致し、且つ、マイクロプロセッサ
1の出力信号aが“1”であることを検出した場合、ス
タート信号すを“1″とする。スタート信号すが“1”
となると、フリップフロップ46がリセットされ、その
石出力力びI”となり、アンドゲート33がオン状態に
なる。これにより、マイクロプロセッサ1からの信号a
がメモリ回路31及びカウンタ32に加えられることに
なる。
After the execution of program A is completed, microprocessor l executes the processing of program B. The trace start/stop detection circuit 43 in the trace stop control circuit 4 detects that the value stored in the register 41 matches the address applied via the bus 8, and the output signal a of the microprocessor 1 is "1". If it is detected that this is the case, the start signal is set to "1". Start signal Suga “1”
Then, the flip-flop 46 is reset and its output becomes I'', and the AND gate 33 is turned on.As a result, the signal a from the microprocessor 1
will be added to the memory circuit 31 and counter 32.

カウンタ32はアンドゲート33を介して加えられる信
号aが1″となる毎にそのカウント値を+1し、カウン
ト値がメモリ回路31の最終アドレスと一致している時
に信号aが“1”となった場合及びフリップフロップ4
6のQ出力が“1”になった場合、リセットされ、その
カウント値をメモリ回路31の先頭アドレスに戻すもの
である。また、メモリ回路31はアンドゲート33を介
して加えられる信号aが1”となった時、バス8上のア
ドレス(プログラムカウンタのカウント値)をカウンタ
32が示すアドレスに記憶するものである。従って、ス
タート信号すが11”となることにより、メモリ回路3
1にはプログラムカウンタのカウント値が順次記憶され
ることになる。
The counter 32 increments its count value by 1 every time the signal a applied via the AND gate 33 becomes 1'', and when the count value matches the final address of the memory circuit 31, the signal a becomes ``1''. and flip-flop 4
When the Q output of 6 becomes "1", it is reset and the count value is returned to the start address of the memory circuit 31. Further, the memory circuit 31 stores the address on the bus 8 (the count value of the program counter) at the address indicated by the counter 32 when the signal a applied through the AND gate 33 becomes 1''. , the start signal becomes 11", so that the memory circuit 3
1, the count values of the program counter are sequentially stored.

そして、この後、レジスタ42にセントされている値と
バス8を介して加えられるアドレスとが−致し、且つマ
イクロプロセッサ1の出力信号aが1”であることを検
出すると、トレースストップ制御回路4内のトレースス
タート/ストップ検出回路43はストップ信号Cを“1
”とする。ストップ信号Cが“1”となることにより、
フリップフロップ46がセットされ、そのQ、  Q出
力がそれぞれ“1”、“O”となる。n出力が“0”と
なることにより、アンドゲート33がオフ状態となるの
で、メモリ回路31へのプログラムカウンタのカウント
値の書込みは停止される。また、Q出力が1″となるこ
とにより、カウンタ32のカウント値がトレース内容読
出し回路5内のカウンタ51にロードされると共にカウ
ンタ32がリセットされる。
After that, when it is detected that the value written in the register 42 and the address added via the bus 8 match and that the output signal a of the microprocessor 1 is 1'', the trace stop control circuit 4 The trace start/stop detection circuit 43 in the
”.When the stop signal C becomes “1”,
Flip-flop 46 is set, and its Q and Q outputs become "1" and "O", respectively. When the n output becomes "0", the AND gate 33 is turned off, and therefore writing of the count value of the program counter to the memory circuit 31 is stopped. Further, when the Q output becomes 1'', the count value of the counter 32 is loaded into the counter 51 in the trace content reading circuit 5, and the counter 32 is reset.

プログラムBの実行が終了すると、マイクロプロセッサ
1はプログラムCを実行し、メモリ回路31に記憶され
ているトレース情報を読出す。マイクロプロセッサ1は
読出し信号dをトレース内容読出し回路5に加えること
によりメモリ回路31に記憶されているトレース情報を
読出すものである。
When execution of program B is completed, microprocessor 1 executes program C and reads trace information stored in memory circuit 31. The microprocessor 1 reads trace information stored in the memory circuit 31 by applying a read signal d to the trace content read circuit 5.

読出し信号dはオアゲート53を介してメモリ回路31
及びカウンタ51に加えられ、メモリ回路31は読出し
信号dが加えられることによりカウンタ51が示すアド
レスに記憶されているデータを出力し、カウンタ51は
読出し信号dが加えられることによりそのカウント値を
+1する。従って、メモリ回路31からは第4図に示す
ように、プログラムトレースを停止した次のアドレスか
ら順次トレース情報が読出されることになり、読出され
たトレース情報はスリーステートバッファ52を介して
マイクロプロセッサ1に加えられる。
The read signal d is sent to the memory circuit 31 via the OR gate 53.
and the counter 51, the memory circuit 31 outputs the data stored at the address indicated by the counter 51 when the read signal d is added, and the counter 51 increases its count value by +1 when the read signal d is added. do. Therefore, as shown in FIG. 4, trace information is sequentially read out from the memory circuit 31 starting from the next address where the program trace was stopped, and the read trace information is transferred to the microprocessor via the three-state buffer 52. Added to 1.

次に、プログラムトレース及びトレース情報の読出しを
外部袋W7から指示する場合の動作を説明する。
Next, the operation when instructing to read the program trace and trace information from the external bag W7 will be explained.

マイクロプロセッサ1が走行中に外部装置7からのスタ
ート信号eが1”になると、トレースストップ制御回路
4内のフリップフロップ46がリセットされてそのn出
力が“1”になり、アンドゲート33がオン状態になる
。これにより、マイクロプロセッサ1からの信号aがア
ンドゲート33を介してメモリ回路31及びカウンタ3
2に加えられることになるので、前述したと同様にして
、メモリ回路31にトレース情報が順次記憶されること
になる。そして、この後、外部袋W7からのストップ信
号fが1″になると、フリップフロップ46がセットさ
れてそのQ、 Q出力がそれぞれ“1“。
When the start signal e from the external device 7 becomes 1 while the microprocessor 1 is running, the flip-flop 46 in the trace stop control circuit 4 is reset, its n output becomes 1, and the AND gate 33 is turned on. As a result, the signal a from the microprocessor 1 is passed through the AND gate 33 to the memory circuit 31 and the counter 3.
2, the trace information is sequentially stored in the memory circuit 31 in the same way as described above. After this, when the stop signal f from the external bag W7 becomes 1'', the flip-flop 46 is set and its Q and Q outputs are each ``1''.

“0”となり、前述したと同様に、メモリ回路31への
トレース情報の書込みが停止され、カウンタ32のカウ
ント値がカウンタ51ヘロードされる。従って、スター
ト信号eが“1”となってからストップ信号fが“l”
となるまでの間のプログラムカウンタのカウント値がト
レース情報としてメモリ回路31に記憶されることにな
る。
The value becomes "0", and writing of trace information to the memory circuit 31 is stopped, and the count value of the counter 32 is loaded to the counter 51, as described above. Therefore, after the start signal e becomes "1", the stop signal f becomes "l".
The count value of the program counter up to this point is stored in the memory circuit 31 as trace information.

そして、メモリ回路31に記憶されているトレース情報
を読出す場合、外部装置7は読出し信号gを出力する。
When reading the trace information stored in the memory circuit 31, the external device 7 outputs a read signal g.

これにより、前述したと同様にして、プログラムトレー
スを停止した次のアドレスからトレース情報が順次読出
され、スリーステートバッファ52及びバッファ63を
介して読出されたトレース情報が外部装置7に加えられ
る。
As a result, in the same manner as described above, trace information is sequentially read from the next address where program tracing was stopped, and the read trace information is added to the external device 7 via the three-state buffer 52 and the buffer 63.

尚、上述した実施例に於いては、プログラムカウンタの
カウント値をトレース情報としてメモリ回路31に記憶
させるようにしたが、これに限られるものではない。
In the above embodiment, the count value of the program counter is stored in the memory circuit 31 as trace information, but the present invention is not limited to this.

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

以上説明したように、本発明は、トレース情報を逐次記
憶するメモリ回路と、メモリ回路によるトレース情報の
記憶を停止させるトレースストップ制御回路と、メモリ
回路に記憶されたトレース情報を読出すトレース内容読
出し回路とを備えたものであるから、通常プログラムに
トレース用プテートバッファ、61〜64・・・バッフ
ァ。
As described above, the present invention includes a memory circuit that sequentially stores trace information, a trace stop control circuit that stops the memory circuit from storing trace information, and a trace content readout circuit that reads the trace information stored in the memory circuit. Since the circuit is equipped with a circuit, the program usually includes trace buffers, 61 to 64...buffers.

ログラムを組込むことなく、且つ実行中のプログラムを
停止、或いは中断することなく、プログラムトレースを
行なうことができる効果がある。
This has the advantage that program tracing can be performed without incorporating a program and without stopping or interrupting a running program.

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

第1図は本発明の実施例のブロック図、第2図はプログ
ラムカウンタ逐次記憶用メモリ回路3.トレースストッ
プ制御回路4.トレース内容読出し回路後5及びインタ
フェース部6の構成例を示すブロック図、 第3図はプログラムの一例を示す図及び、第4図はトレ
ース情報の書込み、読出し動作の説明図である。
FIG. 1 is a block diagram of an embodiment of the present invention, and FIG. 2 is a memory circuit 3 for sequentially storing a program counter. Trace stop control circuit 4. FIG. 3 is a block diagram showing an example of the configuration of the trace content reading circuit 5 and the interface section 6; FIG. 3 is a diagram showing an example of a program; and FIG. 4 is an explanatory diagram of trace information writing and reading operations.

Claims (1)

【特許請求の範囲】 マイクロプロセッサを使用した装置に於いて、トレース
情報を逐次記憶するメモリ回路と、該メモリ回路による
トレース情報の記憶を停止させるトレースストップ制御
回路と、 前記メモリ回路に記憶されているトレース情報を読出す
トレース内容読出し回路とを備えたことを特徴とするプ
ログラムトレース回路。
[Scope of Claim] A device using a microprocessor, comprising: a memory circuit that sequentially stores trace information; a trace stop control circuit that stops the memory circuit from storing trace information; A program trace circuit comprising: a trace content readout circuit for reading out trace information contained in a program.
JP61235792A 1986-10-03 1986-10-03 Program tracing circuit Pending JPS6389940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61235792A JPS6389940A (en) 1986-10-03 1986-10-03 Program tracing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61235792A JPS6389940A (en) 1986-10-03 1986-10-03 Program tracing circuit

Publications (1)

Publication Number Publication Date
JPS6389940A true JPS6389940A (en) 1988-04-20

Family

ID=16991324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61235792A Pending JPS6389940A (en) 1986-10-03 1986-10-03 Program tracing circuit

Country Status (1)

Country Link
JP (1) JPS6389940A (en)

Similar Documents

Publication Publication Date Title
JPH03204737A (en) Debug circuit of signal processing processor
JPS6389940A (en) Program tracing circuit
JPH04190430A (en) Emulator for software development
JPS62279438A (en) Tracking circuit
JPS60262251A (en) Backup device for development of microprocessor
JPH04167146A (en) Address tracing system for information processor
JPH02281341A (en) Write data confirming method for debugging
JPH04328644A (en) Debug back-up device
JPH0326416B2 (en)
JPS60193046A (en) Detecting system for instruction exception
JPS63174138A (en) Data processor
JPH06175883A (en) Program debugger
JPH01166144A (en) Debugging system for firmware program
JPH01205338A (en) Instruction control system
JPS61296431A (en) Data processor
JPS59205645A (en) Information transfer device
JPH0433136A (en) Microprocessor
JPS61221943A (en) Arithmetic processor
JPS62239242A (en) Debugging device
JPH0444973B2 (en)
JPH01137341A (en) Central arithmetic processing unit with emulating function
JPS5852261B2 (en) Program processing method
JPS60114937A (en) Microprogram processing unit
JPH01253045A (en) Logical analyzing circuit
JPS63170752A (en) Trace circuit