JPS63643A - Program debugging system - Google Patents
Program debugging systemInfo
- Publication number
- JPS63643A JPS63643A JP61142826A JP14282686A JPS63643A JP S63643 A JPS63643 A JP S63643A JP 61142826 A JP61142826 A JP 61142826A JP 14282686 A JP14282686 A JP 14282686A JP S63643 A JPS63643 A JP S63643A
- Authority
- JP
- Japan
- Prior art keywords
- data
- address
- program
- trace
- subroutine
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
トレース開始アドレスを設定し、そのトレース開始アド
レスの命令実行後のサブルーチンのトレースポイントに
於けるデータをストアするものであり、成る条件のサブ
ルーチンのトレースポイントに於けるデータのみをスト
アして、デバッグを容易にするものである。[Detailed Description of the Invention] [Summary] A trace start address is set, and data at a trace point of a subroutine after the instruction at the trace start address is executed is stored. This makes debugging easier by storing only the data that is available.
本発明は、サブルーチンに於けるトレースポイントのデ
ータをストアして、プログラムのデバッグを行うプログ
ラムデバッグ方式に関するものである。The present invention relates to a program debugging method for debugging a program by storing trace point data in subroutines.
プログラム実行中の成る時点のデータをストアし、その
データを基にプログラムのデバッグを行うことができる
。その場合に、判別し易いトレースデータが得られるよ
うにすることが要望されている。It is possible to store data at specific points in time during program execution and debug the program based on that data. In this case, it is desired to be able to obtain trace data that is easy to distinguish.
トレースデータをストアし、そのデータを基にデバッグ
を行う従来例のプログラムデバッグ方式は、例えば、第
6図に示す構成によって行われていた。同図に於いて、
31は信号処理プロセッサ、32はプログラムメモリ、
33はトレースデータストア用のメモリ、35はトレー
スポイントアドレスを設定するレジスタ、36はプログ
ラムメモリアドレスとトレースポイントアドレスとを比
較する比較回路、37は遅延回路、38はアドレスカウ
ンタ、39はインバータである。A conventional program debugging method in which trace data is stored and debugging is performed based on the data has been carried out using, for example, the configuration shown in FIG. In the same figure,
31 is a signal processing processor, 32 is a program memory,
33 is a memory for storing trace data, 35 is a register for setting a trace point address, 36 is a comparison circuit that compares the program memory address and the trace point address, 37 is a delay circuit, 38 is an address counter, and 39 is an inverter. .
プログラムメモリ32のトレースポイントTPOアドレ
スがレジスタ35に設定され、信号処理プロセッサ31
からのアドレスがプログラムメモリ32のアドレス端子
ADHに加えられ、データ端子DATAから信号処理プ
ロセッサ31にデータが転送され、デコード結果に従っ
た処理が実行される。その場合のプログラムメモリアド
レスが比較回路36に加えられ、レジスタ35に設定さ
れたトレースポイントアドレスと比較され、−致した場
合は、遅延回路37を介した一致信号が、信号プロセッ
サ31にデータバスアウト信号DBOとして加えられ、
アドレスカウンタ38に歩進クロックとして加えられ、
又インバータ39により反転されて、メモリ33のライ
トイネーブル信号*WEとして加えられる。The trace point TPO address of the program memory 32 is set in the register 35, and the signal processing processor 31
The address from is added to the address terminal ADH of the program memory 32, the data is transferred from the data terminal DATA to the signal processing processor 31, and processing is executed according to the decoding result. The program memory address in that case is applied to the comparison circuit 36 and compared with the trace point address set in the register 35, and if they match, a match signal via the delay circuit 37 is sent to the signal processor 31 to output the data bus. added as signal DBO,
added to the address counter 38 as a step clock;
It is also inverted by an inverter 39 and applied as a write enable signal *WE to the memory 33.
信号処理プロセッサ31のデータバスアウト回路は、第
7図に示す構成を有するもので、“1”のデータバスア
ウト信号DBOが加えられると、ノア回路43の出力信
号は“0”となり、ゲート回路45は動作状態となり、
内部データバスDBUSのデータは、アンド回路41.
オア回路44及びゲート回路45を介して外部データバ
スEBUSに出力される。その時、外部出力レジスタE
OREGからのデータは、禁止回路42によって禁止さ
れる。即ち、信号処理プロセッサ31にデータバスアウ
ト信号DBOが加えられると、内部レジスタ等からの内
部データバスDBUSのデータが外部データバスEBU
Sに出力される。The data bus out circuit of the signal processing processor 31 has the configuration shown in FIG. 45 is in operation state,
The data on the internal data bus DBUS is transferred to the AND circuit 41.
It is output to external data bus EBUS via OR circuit 44 and gate circuit 45. At that time, external output register E
Data from OREG is inhibited by inhibit circuit 42. That is, when the data bus out signal DBO is applied to the signal processing processor 31, the data on the internal data bus DBUS from the internal register etc. is transferred to the external data bus EBU.
Output to S.
第8図はタイミングチャートを示し、(alはプログラ
ムカウンタ・クロック、(b)はプログラムメモリアド
レス、(C1はプログラムメモリ31がら続出されたデ
ータ、(d)は命令レジスタにセットされたデータ、(
elは内部データバスDBUSのデータ、(flは比較
回路36からの一致信号、(g)はデータバスアウト信
号DBO1(hlは外部データバスEBUSのデータ、
(1)はメモリ33のアドレス、(J)はメモリ33に
加える書込イネーブル信号*wEを示す。FIG. 8 shows a timing chart, (al is the program counter clock, (b) is the program memory address, (C1 is the data successively output from the program memory 31, (d) is the data set in the instruction register, (
el is the data on the internal data bus DBUS, (fl is the match signal from the comparison circuit 36, (g) is the data bus out signal DBO1 (hl is the data on the external data bus EBUS,
(1) indicates the address of the memory 33, and (J) indicates the write enable signal *wE applied to the memory 33.
(a)に示すプログラムカウンタ・クロックに従って、
プログラムメモリ32のアドレスが(blに示すように
、AO,AI、A2. ・・・と歩進する。According to the program counter clock shown in (a),
The address of the program memory 32 increments in the order of AO, AI, A2, . . . as shown in (bl).
このプログラムメモリアドレスによって(C)に示すよ
うにデータDO,DI、D2. ・・・が続出されて
、信号処理プロセッサ31内の命令レジスタに(d)に
示すようにセントされる。With this program memory address, data DO, DI, D2 . . . . are output one after another and are sent to the instruction register in the signal processing processor 31 as shown in (d).
プログラムメモリアドレスA1をトレースポイントTP
のアドレスとすると、fflに示すように、比較回路3
6からの一致信号が出力される。この−致信号は遅延回
路37により遅延されてfg)に示すデータバスアウト
信号DBOとなる。Program memory address A1 as trace point TP
Assuming that the address is , as shown in ffl, the comparator circuit 3
A match signal from 6 is output. This match signal is delayed by the delay circuit 37 and becomes the data bus out signal DBO shown in fg).
又命令レジスタにセントされたデータD1は、転送命令
であり、転送データはtelに示すように内部データバ
スDBUSに出力されており、(glに示すデータバス
アウト信号DBOにより、(hlに示すように、外部デ
ータバスEBUSに出〕Jされる。The data D1 sent to the instruction register is a transfer command, and the transfer data is output to the internal data bus DBUS as shown in tel, and is output to the internal data bus DBUS as shown in (gl). Then, the data is output to the external data bus EBUS.
又アドレスカウンタ38は、遅延回路37を介した一致
信号をカウントアツプして、(1)に示すように、メモ
リ33のアドレスをTAOからTAIに歩進する。この
アドレスTAIと、書込イネーブル信号*WEの立上り
とにより、外部データバスEBUSに出力されたトレー
スデータTDがメモリ33にストアされ、次に再びトレ
ースポイントを通過した時には、メモリ33のアドレス
TA2にトレースデータがストアされることになる。Further, the address counter 38 counts up the coincidence signal passed through the delay circuit 37, and increments the address of the memory 33 from TAO to TAI, as shown in (1). With this address TAI and the rise of the write enable signal *WE, the trace data TD output to the external data bus EBUS is stored in the memory 33, and the next time it passes through the trace point again, it is stored at the address TA2 of the memory 33. Trace data will be stored.
〔発明が解決しようとする問題点〕
従来のトレースデータは、トレースポイントTPを如何
なる条件で通過しても必ずストアされるものであり、特
にサブルーチンプログラムにトレースポイントTPを設
定した場合には、如何なる条件のサブルーチンコールの
場合でも、トレースデータがストアされることになる。[Problem to be solved by the invention] Conventional trace data is always stored no matter what conditions the trace point TP is passed through, and especially when the trace point TP is set in a subroutine program, Even in the case of a conditional subroutine call, trace data will be stored.
従って、サブルーチンコールを識別する等の条件判定を
行ってデバッグを行うことになり、デバッグが容易でな
い欠点があった。Therefore, debugging must be performed by making conditional judgments such as identifying subroutine calls, which has the disadvantage that debugging is not easy.
本発明は、成る条件のサブルーチンプログラムに設定し
たトレースポイントのデータのみをストアできるように
して、デバッグを容易にすることを目的とするものであ
る。SUMMARY OF THE INVENTION An object of the present invention is to facilitate debugging by making it possible to store only the data of trace points set in a subroutine program with the following conditions.
本発明のプログラムデバッグ方式は、トレース開始アド
レスを設定し、このトレース開始アドレスを通過した後
のトレースポイントのデータをストアすると共に、サブ
ルーチンリターン命令によって、再度トレース開始アド
レスを通過するまでは、トレースポイントのデータのス
トアを禁止するものであり、第1図を参照して説明する
。The program debugging method of the present invention sets a trace start address, stores the trace point data after passing through this trace start address, and uses a subroutine return instruction to store the trace point data until the trace start address is passed again. This will be explained with reference to FIG. 1.
プロセッサlと、そのプロセッサ1からのプログラムメ
モリアドレスPRAがアドレス端子ADRに加えられ、
データ端子DATAからデータが読出されるプログラム
メモリ2と、外部データバスEBUSに出力されたデー
タをストアするトレースデータストア用のメモリ3と、
レジスタ4゜10と、リターン命令デコーダ5と、比較
回路6と、遅延回路7と、アドレスカウンタ8と、イン
バータ9とを備え、レジスタ4にトレース開始アドレス
を設定し、レジスタ10にサブルーチンプログラムのト
レースポイントTPのアドレスを設定する。processor l and the program memory address PRA from processor 1 is applied to address terminal ADR;
a program memory 2 from which data is read from a data terminal DATA; a trace data store memory 3 which stores data output to an external data bus EBUS;
It includes a register 4.10, a return instruction decoder 5, a comparison circuit 6, a delay circuit 7, an address counter 8, and an inverter 9. The trace start address is set in the register 4, and the subroutine program trace is set in the register 10. Set the address of point TP.
プログラムメモリアドレスPRAと、レジスタ4に設定
されたトレース開始アドレスとが比較回路6に於いて比
較され、比較−致後は、プログラムメモリアドレスPR
Aと、レジスタ10に設定されたトレースポイントアド
レスとが比較回路6に於いて比較される。この比較によ
り一致信号が得られた時は、アドレスカウンタ8が歩進
され、プログラムlにデータバスアウト信号DBOが加
えられ、又メモリ3に書込イネーブル信号*WEが加え
られ、それによって、プロセッサ1の内部データバスの
データが外部データバスEBUSに出力され、メモリ3
にストアされる。The program memory address PRA and the trace start address set in the register 4 are compared in the comparison circuit 6, and after the comparison, the program memory address PRA is
A and the trace point address set in the register 10 are compared in the comparison circuit 6. When a match signal is obtained as a result of this comparison, the address counter 8 is incremented, the data bus out signal DBO is applied to the program 1, and the write enable signal *WE is applied to the memory 3, so that the processor The data on the internal data bus 1 is output to the external data bus EBUS, and the data is transferred to the memory 3.
Stored in
サブルーチンのトレースポイントTPのデータがメモリ
3にストアされた後、サブルーチンのリターン命令がデ
コーダ5によりデコードされると、再びトレース開始ア
ドレスとプログラムメモリアドレスPRAとが一致する
まで、サブルーチンに於けるトレースポインI−TPO
データのストアを禁止するものである。この禁止は、比
較回路6に於けるレジスタ10に設定されたトレースポ
イントアドレスとプログラムメモリアドレスPRAとの
比較を行わないように制御するか、或いは、その比較−
致信号の出力を阻止する制御を行うことになる。After the data at the trace point TP of the subroutine is stored in the memory 3, when the return instruction of the subroutine is decoded by the decoder 5, the trace point in the subroutine is stored until the trace start address and the program memory address PRA match again. I-TPO
This prohibits data storage. This prohibition is performed by controlling the comparison circuit 6 so that the trace point address set in the register 10 and the program memory address PRA are not compared, or by
Control is performed to prevent the output of the signal.
トレース開始アドレスを、所望の条件の時に通過するプ
ログラムメモリアドレスとして、レジスタ4に予めセッ
トしておくことにより、その他の条件でトレースポイン
トを通過しても、その時点のデータをストアしないこと
になる。又サブルーチンリターン命令をデコードした時
に、最初の状態に戻ることになり、再びトレース開始ア
ドレスとプログラムメモリアドレスとが一致するまでは
、トレースポイントのデータはストアされないので、成
る条件を満足した時のサブルーチンコールによるトレー
スポイントのデータのみをストアすることができる。By setting the trace start address in register 4 in advance as the program memory address to be passed under the desired conditions, the data at that point will not be stored even if the trace point is passed under other conditions. . Also, when the subroutine return instruction is decoded, it returns to the initial state, and the trace point data is not stored until the trace start address and program memory address match again, so the subroutine when the conditions are satisfied Only tracepoint data from calls can be stored.
以下図面を参照して本発明の実施例について詳細に説明
する。Embodiments of the present invention will be described in detail below with reference to the drawings.
第2図は本発明の実施例のブロック図であり、以下スナ
ップショット(snapshot)処理として説明する
。同図に於いて、11はスナップショット開始レジスタ
(SSR) 、12はスナップショットポイントレジス
タ(SPR) 、I 3はセレクタ、14は比較回路、
15,23.30はDフリップフロップ、16.24は
R−Sフリップフロップ、17はアンド回路、18は遅
延回路、19〜21はインバートノア回路、22はアド
レスカウンタ、25はインバータ、26はセレクタ、2
7はトレースデータストア用のメモリ、28はインバー
トノア回路、29はリターン命令デコーダであり、プロ
セッサ及びプログラムメモリは図示を省略している。FIG. 2 is a block diagram of an embodiment of the present invention, which will be described below as snapshot processing. In the figure, 11 is a snapshot start register (SSR), 12 is a snapshot point register (SPR), I3 is a selector, 14 is a comparison circuit,
15, 23.30 are D flip-flops, 16.24 are R-S flip-flops, 17 is an AND circuit, 18 is a delay circuit, 19 to 21 are invert NOR circuits, 22 is an address counter, 25 is an inverter, 26 is a selector ,2
7 is a memory for storing trace data, 28 is an invert NOR circuit, 29 is a return instruction decoder, and the processor and program memory are not shown.
第1図に於ける構成と対応させると、メモリ3がメモリ
27に対応し、レジスタ4がスナ・ノブショット開始レ
ジスタ11に、レジスタ10がスナップショットポイン
トレジスタ12に対応し、比較回路6が比較回路14に
対応し、リターン命令デコーダ5がリターン命令デコー
ダ29に対応し、アドレスカウンタ8がアドレスカウン
タ22に対応し、遅延回路7が遅延回路18に対応して
し)る。Corresponding to the configuration in FIG. 1, the memory 3 corresponds to the memory 27, the register 4 corresponds to the snare knob shot start register 11, the register 10 corresponds to the snapshot point register 12, and the comparison circuit 6 corresponds to the comparison circuit 6. The return instruction decoder 5 corresponds to the return instruction decoder 29, the address counter 8 corresponds to the address counter 22, and the delay circuit 7 corresponds to the delay circuit 18.
スナップショット開始レジスタ11にスナ・ノブショッ
ト開始アドレスが設定され、又スナ・ノブショットポイ
ントレジスタ12にスナップショットポイントアドレス
が設定される。セレクタ13しよ、フリップフロップ1
6のQ端子が“O”の時Gこスナップショット開始レジ
スタ11側を選択し、1″の時にスナップショットポイ
ントレジスタ12側を選択する。A snap shot start address is set in the snap shot start register 11, and a snapshot point address is set in the snap shot point register 12. Selector 13, flip-flop 1
When the Q terminal of 6 is "O", the G selects the snapshot start register 11 side, and when it is 1'', the snapshot point register 12 side is selected.
図示を省略したプロセッサからのプログラムメモリアド
レスPRAが比較回路14に加えられると共に、図示を
省略したプログラムメモリに加えられ、又プログラムカ
ウンタ・クロックPCGKがフリップフロップ15.2
3のクロック端子Cと遅延回路1Bのクロック端子GK
とに加えられる。又5SSFは、スナップショット実行
前に、“1”にセントされるフラグであり、又XR3T
はリセット信号である。A program memory address PRA from a processor (not shown) is applied to the comparison circuit 14 and also to a program memory (not shown), and a program counter clock PCGK is applied to the flip-flop 15.2.
Clock terminal C of 3 and clock terminal GK of delay circuit 1B
added to. 5SSF is a flag that is set to “1” before snapshot execution, and
is a reset signal.
メモリ27のアドレス端子ADRには、セレクタ26を
介してアドレスカウンタ22からのアドレス又はプロセ
ッサからの続出アドレスが加えられ、又インバータ25
の出力信号の書込イネーブル信号*WEが加えられ、外
部データバスEBUSを介してデータ端子DATAに加
えられたデータがメモリ27に書込まれる。The address from the address counter 22 or the successive address from the processor is added to the address terminal ADR of the memory 27 via the selector 26, and the inverter 25
The write enable signal *WE of the output signal of is applied, and the data applied to the data terminal DATA via the external data bus EBUS is written into the memory 27.
リセット信号XR3Tにより、アドレスカウンタ22の
クリア端子CLRにクリア信号が加えられて、初期状態
になるようにクリアされる。In response to the reset signal XR3T, a clear signal is applied to the clear terminal CLR of the address counter 22, and the address counter 22 is cleared to the initial state.
又リターン命令デコーダ29の禁止入力端子IN Hに
、フリップフロップ16のQ端子出力信号が加えられ、
そのQ端子出力信号が“1”の場合にリターン命令デコ
ーダ29は動作状態となり、サブルーチンリターン命令
RTNをデコードすると、そのデコード出力信号により
フリップフロ・ノブ30がセントされ、それにより、フ
リップフロップ16はリセットされる。Also, the Q terminal output signal of the flip-flop 16 is applied to the inhibit input terminal IN H of the return instruction decoder 29,
When the Q terminal output signal is "1", the return instruction decoder 29 becomes active, and when the subroutine return instruction RTN is decoded, the flip-flop knob 30 is set by the decoded output signal, thereby resetting the flip-flop 16. be done.
第3図は本発明の実施例のタイミングチャートを示し、
(a)〜(11は、第2図の各部の信号a % iの一
例を示し、(J)は信号dの他の例を示す。以下第3図
のタイミングチャートを参照して第・2図の動作を説明
する。FIG. 3 shows a timing chart of an embodiment of the present invention,
(a) to (11) show an example of the signal a%i of each part in FIG. 2, and (J) shows another example of the signal d. The operation of the diagram will be explained.
通常のプログラムメモリアクセスに於いては、(&)に
示すプログラムカウンタ・クロックa (PCCK)
をプログラムカウンタ(図示せず)がカウントアツプし
て、fblに示すプログラムメモリアドレスb (P
RA)がAO,AI、A2.A3. ・・・のように
歩進される。スナップショット開始アドレスをSAとし
、サブルーチンプログラムに於けるスナップショットポ
イントアドレスをPAとすると、スナップショット開始
アドレスSAはレジスタ11にセットされ、スナップシ
ョットポイントアドレスPAはレジスタ12にセットさ
れる。In normal program memory access, the program counter clock a (PCCK) shown in (&)
A program counter (not shown) counts up the program memory address b (P
RA) is AO, AI, A2. A3. It is progressed as follows. Assuming that the snapshot start address is SA and the snapshot point address in the subroutine program is PA, the snapshot start address SA is set in the register 11 and the snapshot point address PA is set in the register 12.
この状態では、クリップフロップ16のQ端子出力は“
0”、フリップフロップ24のQ端子出力は0′である
から、セレクタ13はレジスタll側を選択して比較回
路14にスナップショット開始アドレスSAを加え、又
比較回路14は動作状態、リターン命令デコーダ29は
停止状態となっている。この状態で、プログラムメモリ
アドレスb (PRA)がスナップショット開始アド
レスSAと比較回路14で比較され、成る条件のサブル
ーチンコール或いはその直前のアドレスA1をスナップ
ショット開始アドレスSAとすると、5A=A Iによ
り、(e)に示すように、−致信号eが出力され、この
−致信号eはフリップフロップ15のデータ端子りとア
ンド回路17とに加えられる。In this state, the Q terminal output of the clip-flop 16 is “
0'', and the Q terminal output of the flip-flop 24 is 0', so the selector 13 selects the register 1 side and adds the snapshot start address SA to the comparison circuit 14, and the comparison circuit 14 is in the operating state and the return instruction decoder 29 is in a stopped state. In this state, the program memory address b (PRA) is compared with the snapshot start address SA in the comparison circuit 14, and the subroutine call under the condition or the address A1 immediately before it is set as the snapshot start address. Assuming SA, 5A=AI. As shown in (e), a match signal e is output, and this match signal e is applied to the data terminal of the flip-flop 15 and the AND circuit 17.
フリップフロップ15が次のプログラムカウンタ・クロ
ックaによってセットされると、フリップフロップ16
もセットされ、そのQ端子出力信号Cはfc)に示すよ
うに“1”となり、スナップショットモードとなる。そ
して、リターン命令デコーダ29の禁止入力端子I N
Hには1″が加えられることにより動作状態となる。When flip-flop 15 is set by the next program counter clock a, flip-flop 16
is also set, and the Q terminal output signal C becomes "1" as shown in fc), entering the snapshot mode. Then, the inhibit input terminal I N of the return instruction decoder 29
When 1'' is added to H, the operating state is entered.
又フリップフロップ16のQ端子出力信号Cはアドレス
カウンタ22のイネーブル端子ENにカウントイネーブ
ル信号として加えられ、クロック端子CKに加えられる
データバスアウト信号f (DBO)をカウントアツ
プすることになる。又この時点では、フリップフロップ
24のQ端子出力信号dは+d)に示すように“0”で
あり、比較回路14は動作状態をm続している。The Q terminal output signal C of the flip-flop 16 is applied as a count enable signal to the enable terminal EN of the address counter 22, and counts up the data bus out signal f (DBO) applied to the clock terminal CK. Also, at this point, the Q terminal output signal d of the flip-flop 24 is "0" as shown by +d), and the comparator circuit 14 continues to be in the operating state.
そして、スナップショットモードとなることにより、セ
レクタ13はレジスタ12側を選択して比較回路14に
加えるので、プログラムメモリアドレスb (PRA
)と、スナップショットポイントアドレスとが比較回路
14に於いて比較されることになる。Then, by entering the snapshot mode, the selector 13 selects the register 12 side and adds it to the comparison circuit 14, so the program memory address b (PRA
) and the snapshot point address are compared in the comparison circuit 14.
プログラムメモリアドレスb (PRA)が歩進されて
、A4=PAとなると、比較回路14から(elに示す
ように一致信号eが出力される。この−致信号eは、フ
リップフロップ16のQ端子出力信号が1″であるから
、アンド回路17を介して遅延回路18に加えられる。When the program memory address b (PRA) is incremented and becomes A4=PA, the comparison circuit 14 outputs a match signal e as shown in (el). Since the output signal is 1'', it is applied to the delay circuit 18 via the AND circuit 17.
遅延回路18はクロック端子CKに加えられるプログラ
ムカウンタ・クロックa (PCCK)に同期して一致
信号eを遅延させるもので、シフトレジスタ等により構
成されている。The delay circuit 18 delays the coincidence signal e in synchronization with the program counter clock a (PCCK) applied to the clock terminal CK, and is composed of a shift register or the like.
この遅延回路18の(f)に示す出力信号fがデータバ
スアウト信号DBOとなるもので、プロセッサに加えら
れ、又アドレスカウンタ22のクロック端子GKに加え
られ、又メモリ27にインバータ25を介して書込イネ
ーブル信号*WEとして加えられる。アドレスカウンタ
22からのアドレス信号gは、(g)に示すように、T
AOからTAIに歩進し、このアドレス信号gがセレク
タ26を介してメモリ27のアドレス端子ADHに加え
られ、プロセッサから外部データバスEBUSに出力さ
れた(h)に示すデータhがメモリ27に書込まれる。The output signal f shown in (f) of this delay circuit 18 becomes the data bus out signal DBO, and is applied to the processor, the clock terminal GK of the address counter 22, and the memory 27 via the inverter 25. Added as write enable signal *WE. The address signal g from the address counter 22 is T as shown in (g).
Steps from AO to TAI, this address signal g is applied to the address terminal ADH of the memory 27 via the selector 26, and the data h shown in (h) output from the processor to the external data bus EBUS is written to the memory 27. be included.
次にサブルーチンリターン命令RTNがプログラムメモ
リアドレスb (PRA)の八6に読出されたとすると
、そのサブルーチンリターン命令RTNがリターン命令
デコーダ29によりデコードされ、そのデコード出力信
号がフリップフロップ30のデータ端子りに加えられる
ので、次のプログラムカウンタ・クロックa (PC
CK)のタイミングでフリップフロップ30はセットさ
れ、そのd端子出力信号は60゛となる。それによって
フリップフロップ16はリセットされ、スナップショッ
トモードは終了する。Next, if the subroutine return instruction RTN is read out to program memory address b (PRA) 86, the subroutine return instruction RTN is decoded by the return instruction decoder 29, and the decoded output signal is sent to the data terminal of the flip-flop 30. Since the next program counter clock a (PC
CK), the flip-flop 30 is set, and its d-terminal output signal becomes 60°. This resets flip-flop 16 and exits the snapshot mode.
以下スナップショット開始アドレスと一致したプログラ
ムメモリアドレスPRAとなった後に、スナップショッ
トポイントアドレスとプログラムメモリアドレスPRA
とが一致した時に、データバスアウト信号DBOがプロ
セッサに加えられ、プロセッサから外部データバスEB
USに出力されたデータがメモリ27に書込まれる。After reaching the program memory address PRA that matches the snapshot start address, the snapshot point address and program memory address PRA are
When the data bus out signal DBO is applied to the processor, the processor outputs the external data bus EB.
The data output to US is written into memory 27.
アドレスカウンタ22が順次データバスアウト信号DB
Oをカウントアツプし、キャリアウド信号iが(1)に
示すように出力されると、メモリ27の容量−杯にデー
タが書込まれたことになる。そこで、このキャリアウド
信号iによりフリップフロップ23がセットされ、それ
によってフリップフロップ24がセットされて、そのQ
端子出力信号dが01に示すように“1゛となるから、
比較回路14の動作が停止されて、スナップショット禁
止モードとなる。The address counter 22 sequentially outputs the data bus out signal DB.
When O is counted up and a carrier signal i is output as shown in (1), data has been written to the capacity of the memory 27. Therefore, the flip-flop 23 is set by this carrier signal i, which sets the flip-flop 24, and its Q.
Since the terminal output signal d becomes "1" as shown in 01,
The operation of the comparator circuit 14 is stopped and the snapshot prohibition mode is entered.
スセットされたフリップフロップ24のd端子出力信号
が0”となるから、インバートノア回路21の出力信号
が“0”となり、フリップフロップ15.16はリセッ
トされ、遅延回路18はクリアされる。従って、メモリ
27にストアされたデータに上書きされることがなくな
る。そして、プロセッサからの続出アドレスがセレクタ
26を介してメモリ27に加えられると、外部データバ
スEBUSにデータ端子DATAからデータが読出され
て出力される。Since the d-terminal output signal of the flip-flop 24 that has been set becomes "0", the output signal of the invert NOR circuit 21 becomes "0", the flip-flops 15 and 16 are reset, and the delay circuit 18 is cleared. Therefore, The data stored in the memory 27 will not be overwritten. Then, when successive addresses from the processor are added to the memory 27 via the selector 26, the data is read from the data terminal DATA and output to the external data bus EBUS. be done.
第4図はプログラムの説明図であり、メインプログラム
に於ける■のサブルーチンコールにより実線矢印で示す
ようにサブルーチンプログラムに移行し、そのサブルー
チンリターン命令RTNによって実線矢印で示すように
メインプログラムに戻ることになる。又■のサブルーチ
ンコールの場合は、点線矢印で示すように、サブルーチ
ンプログラムに移行し、サブルーチンリターン命令RT
Nによりメインプログラムに戻り、■のサブルーチンコ
ールにより鎖線矢印で示すように、サブルーチンプログ
ラムに移行し、サブルーチンリターン命令RTNにより
メインプログラムに戻る。FIG. 4 is an explanatory diagram of the program, in which the subroutine call (■) in the main program causes the transition to the subroutine program as shown by the solid line arrow, and the subroutine return instruction RTN returns to the main program as shown by the solid line arrow. become. In addition, in the case of the subroutine call (■), as shown by the dotted arrow, the transition is made to the subroutine program, and the subroutine return command RT is executed.
By N, the program returns to the main program, by subroutine call (3), it moves to the subroutine program as shown by the chain arrow, and by subroutine return command RTN, it returns to the main program.
スナップショット開始アドレスSAを■のサブルーチン
コールのアドレス或いはその直前に設定し、サブルーチ
ンプログラム中にスナップショットポイントアドレスP
Aを設定したとすると、このスナップショット開始アド
レスSAがレジスタ11にセットされ、スナップショッ
トポイントアドレスPAがレジスタ12にセットされる
。Set the snapshot start address SA at or immediately before the subroutine call address in ■, and set the snapshot point address P during the subroutine program.
If A is set, this snapshot start address SA is set in the register 11, and the snapshot point address PA is set in the register 12.
■のサブルーチンコールに従ってサブルーチンプログラ
ムが実行され、スナフプシ74 ’7トポイントアドレ
スPAを通過しても、スナップショット開始アドレスS
Aを通過していないので、比較回路14ではプログラム
メモリアドレスPFIAとレジスタ12にセットされた
スナップショットポイントアドレスPAとの比較を行わ
ないから、その時点のデータはメモリ27にはストアさ
れないことになる。Even if the subroutine program is executed according to the subroutine call in ■ and passes the snapshot start address PA,
Since the comparison circuit 14 does not compare the program memory address PFIA with the snapshot point address PA set in the register 12, the data at that point is not stored in the memory 27. .
スナップショット開始アドレスSAを通過すると、比較
回路14からの一致信号eによりフリップフロップ15
.16がセントされ、スナップショットモードとなり、
■のサブルーチンコールによりサブルーチンプログラム
に移行して、スナップショットポイントアドレスPAと
なると、比較回路14からの一致信号eが出力され、遅
延回路18を介してデータバスアウト信号DBOがプロ
セッサに加えられ、又メモリ27のアドレスが歩進され
、書込イネーブル信号*WEがメモリ27に加えられて
、スナップショットポイントのデータがプロセッサから
外部データバスEBUSに出力されて、メモリ27に書
込まれる。When the snapshot start address SA is passed, the match signal e from the comparison circuit 14 causes the flip-flop 15 to be activated.
.. 16 cents and enters snapshot mode,
When the subroutine program is entered by the subroutine call (2) and the snapshot point address PA is reached, the match signal e from the comparison circuit 14 is output, the data bus out signal DBO is applied to the processor via the delay circuit 18, and The address of memory 27 is incremented, a write enable signal *WE is applied to memory 27, and the data at the snapshot point is output from the processor to external data bus EBUS and written to memory 27.
サブルーチンリターン命令RTNによりメインプログラ
ムに戻るものであるが、そのサブルーチンリターン命令
RTNをデコーダ29でデコードしない場合は、次の■
のサブルーチンコールによりサブルーチンプログラムに
移行し、スナップショットポイントアドレスPAを通過
すると、その時点のデータがメモリ27にストアされる
。The subroutine return instruction RTN returns to the main program, but if the subroutine return instruction RTN is not decoded by the decoder 29, the following
When the subroutine program is entered by the subroutine call and the snapshot point address PA is passed, the data at that time is stored in the memory 27.
従って、メモリ27にストアされたデータは、第5図の
(alに示すものとなる。なお、■A 1+■A−i
は、サブルーチンコール■、■によるスナップショット
ポイントアドレスPAのデータを示し、i (1,2
,3,・・・)は、メインプログラムのジャンプスター
トにより繰り返された回数に相当する。この場合、■の
サブルーチンコールによるスナップショットポイントの
データであるか、■のサブルーチンコールによるスナッ
プショットポイントのデータであるかを識別することは
困難である。Therefore, the data stored in the memory 27 is as shown in (al) in FIG.
indicates the data of snapshot point address PA by subroutine calls ■, ■, and i (1, 2
, 3, . . . ) corresponds to the number of times the main program is repeated by jump start. In this case, it is difficult to identify whether the data is the snapshot point data due to the subroutine call (2) or the data at the snapshot point due to the subroutine call (2).
そこで、■のサブルーチンコールによりサブルーチンプ
ログラムに移行した時に、スナップショットモードとな
り、そのサブルーチンリターン命令RTNをデコーダ2
9でデコードし、そのデコード出力信号によってフリッ
プフロップ30をセットし、それによってフリップフロ
ップ16をリセットし、次の■のサブルーチンコールに
よりサブルーチンプログラムに移行してスナップショッ
トポイントアドレスPAとなっても、その時点のデータ
をメモリ27にはストアしないようにするものである。Therefore, when transitioning to the subroutine program by the subroutine call in (■), the snapshot mode is entered and the subroutine return instruction RTN is sent to the decoder 2.
9, the decoded output signal sets the flip-flop 30, thereby resetting the flip-flop 16, and the next subroutine call (2) moves to the subroutine program, even if it becomes the snapshot point address PA. This prevents current data from being stored in the memory 27.
このように、サブルーチンリターン命令RTNによって
スナップショットモードを元に戻す制御を行うことによ
り、メモリ27にストアされたデータは、第5図の(b
)に示すものとなる。即ち2■のサブルーチンコールに
よってサブルーチンプログラムに移行した場合のスナッ
プショットポイントのデータのみがストアされることに
なる。又スナップショット開始アドレスSAを■のサブ
ルーチンコールに設定すれば、その■のサブルーチンコ
ールによりサブルーチンプログラムに移行した場合のス
ナ・ノブショットポイント
リ27にストアされることになる。従って、どのサブル
ーチンコールによって移行した場合のスナップショット
ポイントのデータであるか判るので、デバッグが容易と
なる。In this way, by controlling the snapshot mode to return to its original state using the subroutine return instruction RTN, the data stored in the memory 27 is stored in (b) of FIG.
). That is, only the data at the snapshot point when transitioning to the subroutine program by the subroutine call in 2) is stored. Furthermore, if the snapshot start address SA is set to the subroutine call (2), it will be stored in the snap shot pointer 27 when the subroutine program is transitioned to by the subroutine call (2). Therefore, debugging is facilitated because it can be determined which subroutine call was used to determine which snapshot point data was transferred.
本発明は前述の実施例の構成に限定されるものではなく
、種々の論理構成を採用することができるものである。The present invention is not limited to the configuration of the above-described embodiment, but can employ various logical configurations.
(発明の効果〕
以上説明したように、本発明は、レジスタ4に設定され
たトレース開始アドレスとプログラムメモリアドレスと
が一致した後のサブルーチンプログラムに於いて、その
トレースポイントアドレスとプログラムメモリアドレス
とが一致した時のデータをメモリ3にストアし、サブル
ーチンリターン命令によって、再度トレース開始アドレ
スとプログラムメモリアドレスとが一致するまで、トレ
ースポイントのデータのストアを行わないものであり、
モニタしたいタイミングに於けるデータのみをストアす
ることができるから、デバッグが容易となる利点がある
。(Effects of the Invention) As explained above, the present invention allows the trace point address and the program memory address to be matched in the subroutine program after the trace start address set in the register 4 and the program memory address match. The data at the time of a match is stored in the memory 3, and the trace point data is not stored until the trace start address and the program memory address match again by a subroutine return instruction.
Since only data at the timing desired to be monitored can be stored, there is an advantage that debugging is facilitated.
第1図は本発明の原理ブロック図、第2図は本発明の実
施例のブロック図、第3図は本発明の実施例のタイミン
グチャート、第4図はプログラムの説明図、第5図(a
)、 (blはトレースデータの説明図、第6図は従来
例の説明図、第7図はデータバスアウト回路、第8図は
従来例のタイミングチャートである。
lはプロセッサ、2はプログラムメモリ、3はトレース
データストア用メモリ、4はレジスタ、5はリターン命
令デコーダ、6は比較回路、7は遅延回路、8はアドレ
スカウンタ、10はレジスタ、11はスナップショット
開始レジスタ、12はスナップショットポイントレジス
タ、13はセレクタ、14は比較回路、15,23.3
0はDフリップフロップ、16.24はR−Sフリップ
フロップ、17はアンド回路、18は遅延回路、19〜
21.28はインバートノア回路、22はアドレスカウ
ンタ、26はセレクタ、27はメモリ、29はリターン
命令デコーダである。Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a block diagram of an embodiment of the invention, Fig. 3 is a timing chart of an embodiment of the invention, Fig. 4 is an explanatory diagram of the program, and Fig. 5 ( a
), (bl is an explanatory diagram of trace data, FIG. 6 is an explanatory diagram of a conventional example, FIG. 7 is a data bus out circuit, and FIG. 8 is a timing chart of a conventional example. l is a processor, and 2 is a program memory. , 3 is a trace data store memory, 4 is a register, 5 is a return instruction decoder, 6 is a comparison circuit, 7 is a delay circuit, 8 is an address counter, 10 is a register, 11 is a snapshot start register, 12 is a snapshot point Register, 13 is selector, 14 is comparison circuit, 15, 23.3
0 is a D flip-flop, 16.24 is an R-S flip-flop, 17 is an AND circuit, 18 is a delay circuit, 19-
21 and 28 are invert NOR circuits, 22 is an address counter, 26 is a selector, 27 is a memory, and 29 is a return instruction decoder.
Claims (1)
データストア用のメモリ(3)とを備え、トレースポイ
ントに於けるデータを前記メモリ(3)にストアするプ
ログラムデバッグ方式に於いて、 トレース開始アドレスを設定するレジスタ(4)と、 サブルーチンリターン命令デコーダ(5)とを設け、 前記トレース開始アドレスとプログラムメモリアドレス
とが一致した後のサブルーチンの前記トレースポイント
のデータを前記メモリ(3)にストアし、前記サブルー
チンリターン命令デコーダ(5)によりサブルーチンリ
ターン命令をデコードした後は、再度前記トレース開始
アドレスとプログラムメモリアドレスとが一致するまで
、前記トレースポイントのデータのストアを禁止するこ
とを特徴とするプログラムデバッグ方式。[Claims] A program debugging method comprising a processor (1), a program memory (2), and a memory (3) for storing trace data, and storing data at a trace point in the memory (3). A register (4) for setting a trace start address and a subroutine return instruction decoder (5) are provided, and the data of the trace point of the subroutine after the trace start address and the program memory address match are stored in the memory ( 3) and after decoding the subroutine return instruction by the subroutine return instruction decoder (5), prohibiting the storage of data at the trace point until the trace start address and program memory address match again. A program debugging method featuring:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61142826A JPS63643A (en) | 1986-06-20 | 1986-06-20 | Program debugging system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61142826A JPS63643A (en) | 1986-06-20 | 1986-06-20 | Program debugging system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPS63643A true JPS63643A (en) | 1988-01-05 |
Family
ID=15324516
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61142826A Pending JPS63643A (en) | 1986-06-20 | 1986-06-20 | Program debugging system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS63643A (en) |
-
1986
- 1986-06-20 JP JP61142826A patent/JPS63643A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4222103A (en) | Real time capture registers for data processor | |
| EP0702297B1 (en) | A data processor with breakpoint circuit | |
| US5299320A (en) | Program control type vector processor for executing a vector pipeline operation for a series of vector data which is in accordance with a vector pipeline | |
| US4251859A (en) | Data processing system with an enhanced pipeline control | |
| US4652997A (en) | Method and apparatus for minimizing overhead when executing nested do loops | |
| JPH03204737A (en) | Debug circuit of signal processing processor | |
| JPH0474229A (en) | Information processor | |
| US6700582B2 (en) | Method and system for buffer management | |
| US4747045A (en) | Information processing apparatus having an instruction prefetch circuit | |
| CA2056356C (en) | Interruption handling system | |
| JPS63643A (en) | Program debugging system | |
| CA2157435C (en) | Vector data bypass mechanism for vector computer | |
| JPH0748183B2 (en) | Trace circuit | |
| JP2653412B2 (en) | How to set breakpoints | |
| JPS63642A (en) | Program debugging system | |
| JP2770420B2 (en) | Micro program control method | |
| JPH03184135A (en) | Data processor | |
| JPH0447851B2 (en) | ||
| JPH03163626A (en) | Microcomputer | |
| GB2042227A (en) | Rear time capture registers for data processor | |
| JPH033037A (en) | Microprogram control system | |
| JPH02183841A (en) | Data processor | |
| JPS6270947A (en) | Control system for debug interruption | |
| JPH06139084A (en) | Information processing equipment | |
| JPH0391055A (en) | Hardware lock setting method, hardware lock control device, hardware lock detection method and device |