JPH06187193A - Program debugging device and microcomputer - Google Patents

Program debugging device and microcomputer

Info

Publication number
JPH06187193A
JPH06187193A JP4334649A JP33464992A JPH06187193A JP H06187193 A JPH06187193 A JP H06187193A JP 4334649 A JP4334649 A JP 4334649A JP 33464992 A JP33464992 A JP 33464992A JP H06187193 A JPH06187193 A JP H06187193A
Authority
JP
Japan
Prior art keywords
instruction
branch
address
microcomputer
signal
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
JP4334649A
Other languages
Japanese (ja)
Inventor
Tetsuya Tanabe
部 徹 也 田
Norihiro Sakami
見 典 大 酒
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP4334649A priority Critical patent/JPH06187193A/en
Publication of JPH06187193A publication Critical patent/JPH06187193A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Abstract

PURPOSE:To provide a debugging device in which only trace information necessary on debugging is stored in a trace memory. CONSTITUTION:A program debugging device in which the debugging of a program executed by a microcomputer 11 is performed is equipped with a branching execution address storage memory 17 which discriminates whether or not an instruction executed by the microcomputer 11 is the branching instruction, and outputs a branching instruction execution signal 29 when it is the branching instruction, and an address control circuit 18 which inputs the branching instruction execution signal 29, and allows a trace memory 12 to store only the branching instruction and the instruction of a prescribed steps before and after the branching instruction.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、マイクロコンピュータ
で実行されるプログラムのデバッグを行うためのプログ
ラムデバッグ装置、および、プログラムのデバッグに適
したマイクロコンピュータに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program debugging device for debugging a program executed by a microcomputer, and a microcomputer suitable for debugging the program.

【0002】[0002]

【従来の技術】従来のデバッグ装置としては、例えば、
実行アドレスやステータス情報、リード/ライトデ−タ
などの実行状態を表す情報(以下、「トレース情報」と
記す)をトレースメモリに順次格納し、格納されたトレ
ース情報をディスプレイで表示させてマイクロコンピュ
ータの実行状態をチェックすることによってデバッグ作
業を行う形式のものが知られている。
2. Description of the Related Art As a conventional debug device, for example,
Information indicating the execution status such as execution address, status information, and read / write data (hereinafter referred to as “trace information”) is sequentially stored in the trace memory, and the stored trace information is displayed on the display to display the microcomputer. There is known a format in which debugging work is performed by checking the execution status.

【0003】図6は、従来のデバッグ装置におけるトレ
ース回路60の一構成例を概略的に示すブロック図であ
る。
FIG. 6 is a block diagram schematically showing a configuration example of a trace circuit 60 in a conventional debug device.

【0004】同図において、マイクロコンピュータ11
からはバス情報21が出力される。このバス情報21
は、アドレス、デ−タ、ステータス情報(リード、ライ
ト等)によって構成されている。
In FIG. 1, a microcomputer 11
Outputs the bus information 21. This bus information 21
Is composed of an address, data, and status information (read, write, etc.).

【0005】比較回路13は、外部のターゲット回路か
ら出力される外部ロジック信号22およびバス情報21
を入力する。そして、これらの信号値を予め記憶した設
定値と比較し、両者が一致したときにトレースメモリ1
2へのトレース情報の格納の開始或いは停止を指示する
制御信号26を出力する。
The comparator circuit 13 includes an external logic signal 22 and bus information 21 output from an external target circuit.
Enter. Then, these signal values are compared with the preset values stored in advance, and when they match, the trace memory 1
The control signal 26 for instructing to start or stop the storage of the trace information in 2 is output.

【0006】ライトストローブ生成回路14は、バス情
報21の内のステータス情報23を入力し、このステー
タスをトリガとして、トレースメモリ12へのバス情報
21の書込タイミングを与える信号であるライトストロ
ーブ信号24を生成する。このライトストローブ信号2
4は、ライトストローブ制御回路15に送られる。
The write strobe generation circuit 14 inputs the status information 23 of the bus information 21, and the write strobe signal 24 which is a signal for giving a write timing of the bus information 21 to the trace memory 12 is triggered by this status. To generate. This write strobe signal 2
4 is sent to the write strobe control circuit 15.

【0007】ライトストローブ制御回路15は、ライト
ストローブ信号24とともに比較回路13から上述の制
御信号26を入力し、トレース実行中はライトストロー
ブ信号24をイネーブルにし、トレースライトストロー
ブ信号25として出力する。一方、トレースを停止して
いる間、ライトストローブ制御回路15は、入力したラ
イトストローブ信号24をディセーブルにする。
The write strobe control circuit 15 inputs the above-mentioned control signal 26 from the comparison circuit 13 together with the write strobe signal 24, enables the write strobe signal 24 during the trace execution, and outputs it as the trace write strobe signal 25. On the other hand, while the trace is stopped, the write strobe control circuit 15 disables the input write strobe signal 24.

【0008】アドレス制御回路16は、トレースメモリ
12にバス情報を書き込む際のアドレスを指定するため
のアドレス信号27を生成して出力する。このアドレス
制御回路16の内部にはアドレスインクリメンタ(図示
せず)が備えられており、ライトストローブ制御回路1
5からトレースライトストローブ信号25を入力するた
びにアドレス信号27の示すアドレス値が「1」ずつ加
算される。また、比較回路13から入力する制御信号に
よってクリア等の制御が行われる。
The address control circuit 16 generates and outputs an address signal 27 for designating an address when writing bus information in the trace memory 12. An address incrementer (not shown) is provided inside the address control circuit 16, and the write strobe control circuit 1 is provided.
Every time the trace write strobe signal 25 is input from 5, the address value indicated by the address signal 27 is incremented by "1". Further, control such as clearing is performed by a control signal input from the comparison circuit 13.

【0009】トレースメモリ12は、デ−タ入力端子2
aから入力したバス情報21を、書込信号入力端子12
bから入力したトレースライトストローブ信号25のタ
イミングにしたがって、アドレス入力端子12cから入
力したアドレス信号27が指定するアドレスに格納す
る。
The trace memory 12 has a data input terminal 2
The bus information 21 input from a is transferred to the write signal input terminal 12
According to the timing of the trace write strobe signal 25 input from b, the trace write strobe signal 25 is stored in the address designated by the address signal 27 input from the address input terminal 12c.

【0010】このトレースメモリ12に格納されたバス
情報(トレース情報)21は、デバッグ時には、図示し
ないディスプレイ装置によって表示される。
The bus information (trace information) 21 stored in the trace memory 12 is displayed by a display device (not shown) during debugging.

【0011】このようなデバッグ装置では、比較回路1
3が出力する制御信号によってトレースが開始されてか
ら停止されるまでの間、マイクロコンピュータ11から
出力されるバス情報(トレース情報)21はすべてトレ
ースメモリ12に格納される。すなわち、トレースの開
始から停止までの間にマイクロコンピュータ11が実行
した処理内容は、すべてトレースメモリ12に格納され
る。
In such a debug device, the comparison circuit 1
All the bus information (trace information) 21 output from the microcomputer 11 is stored in the trace memory 12 from the start to the stop of the trace by the control signal output from the microcomputer 3. That is, all the processing contents executed by the microcomputer 11 from the start to the end of the trace are stored in the trace memory 12.

【0012】[0012]

【発明が解決しようとする課題】このようなデバッグ装
置を用いてユーザがマイクロコンピュータ11のプログ
ラムデバッグ作業を行う場合、マイクロコンピュータ1
1が実行した処理のすべて(すなわちトレースメモリ1
2に格納された内容のすべて)をチェックすることはま
れであり、通常は例えばジャンプ命令、コール命令、リ
ターン命令或いは割り込み命令等、実行アドレスの分岐
を伴う動作(以下、単に「分岐動作」と記す)に係わる
命令の前後のみをチェックすれば十分である。このよう
に、分岐動作のみをチェックしたい場合、従来は、ディ
スプレイ表示されたトレース情報から該当箇所を探しな
がらチェックを行っていた。
When a user performs a program debugging operation of the microcomputer 11 by using such a debugging device, the microcomputer 1
All the processing executed by 1 (that is, trace memory 1
It is rare to check all of the contents stored in 2), and normally an operation involving branching of an execution address, such as a jump instruction, a call instruction, a return instruction or an interrupt instruction (hereinafter simply referred to as “branch operation”) It is enough to check only before and after the instruction related to As described above, when it is desired to check only the branching operation, conventionally, the check is performed while searching for the corresponding portion from the trace information displayed on the display.

【0013】このため、従来のデバッグ装置では、トレ
ースメモリ12に格納されたトレース情報の大部分はデ
バッグ時に使用されない情報であり、トレースメモリ1
2の利用効率は非常に悪かった。
Therefore, in the conventional debug device, most of the trace information stored in the trace memory 12 is information that is not used during debugging.
The utilization efficiency of 2 was very poor.

【0014】また、チェックを行う情報よりもチェック
を行わない情報の方が遥かに多くなることによりユーザ
がチェック箇所を探しにくく、このためデバッグ作業の
効率が悪かった。さらに、このようにユーザがチェック
箇所を見落としやすいので、プログラムにバグがあって
もこれを見落としてしまう可能性も高かった。
Further, since the amount of information that is not checked is much larger than the amount of information that is checked, it is difficult for the user to find the check location, and thus the efficiency of the debugging work is poor. In addition, since the user can easily overlook the check point as described above, there is a high possibility that the user will overlook the check point even if the program has a bug.

【0015】これに対して、比較回路13の設定値を適
当に選ぶことにより、分岐動作の前後のみがトレースメ
モリ12に格納されるようにすることも可能である。し
かしながら、このようにしてジャンプ命令等のある箇所
を指定する場合には、コスト等の理由から数箇所ないし
数十箇所の指定しかできず、プログラム中の分岐動作に
係わる命令がある箇所のすべてを指定することは実質的
に不可能である。
On the other hand, by appropriately selecting the set value of the comparison circuit 13, it is possible to store only before and after the branch operation in the trace memory 12. However, when specifying a part such as a jump instruction in this way, only a few parts or tens of parts can be specified for the reason of cost, etc. It is virtually impossible to specify.

【0016】本発明は、このような従来技術の欠点に鑑
みてなされたものであり、デバッグ上必要なトレース情
報のみをトレースメモリに格納させることができるデバ
ッグ装置およびこのようなデバッグ装置で使用されるマ
イクロコンピュータを提供することを目的とする。
The present invention has been made in view of such drawbacks of the prior art, and is used in a debug device capable of storing only trace information necessary for debugging in a trace memory and such a debug device. It is an object of the present invention to provide a microcomputer.

【0017】[0017]

【課題を解決するための手段】[Means for Solving the Problems]

(1) 第1の発明に係わるプログラムデバッグ装置は、マ
イクロコンピュータで実行されるプログラムのデバッグ
を行うためのプログラムデバッグ装置であって、前記マ
イクロコンピュータの実行が分岐動作であるか否かを判
別し、分岐動作である場合には分岐実行信号を出力する
判別手段と、前記分岐実行信号を入力した場合に、この
命令およびこの命令の前後所定ステップの命令のみを記
憶する記憶手段と、を備えたことを特徴とする。 (2) 第2の発明に係わるプログラムデバッグ装置は、マ
イクロコンピュータで実行されるプログラムのデバッグ
を行うためのプログラムデバッグ装置であって、分岐実
行信号を入力した場合に、この命令およびこの命令の前
後所定ステップの命令のみを記憶する記憶手段を備えた
ことを特徴とする。 (3) 第3の発明に係わるマイクロコンピュータは、上記
第2の発明に係わるプログラムデバッグ装置に使用する
マイクロコンピュータであって、実行が分岐動作である
か否かを判別し、分岐動作である場合には分岐実行信号
を出力する判別手段を備えたことを特徴とする。
(1) A program debug device according to the first invention is a program debug device for debugging a program executed by a microcomputer, and determines whether or not the execution of the microcomputer is a branch operation. In the case of a branch operation, a determination means for outputting a branch execution signal and a storage means for storing only this instruction and an instruction of a predetermined step before and after the instruction when the branch execution signal is input are provided. It is characterized by (2) A program debug device according to a second aspect of the invention is a program debug device for debugging a program executed by a microcomputer, and when a branch execution signal is input, this instruction and before and after this instruction. It is characterized in that it is provided with a storage means for storing only an instruction of a predetermined step. (3) A microcomputer according to a third aspect of the invention is the microcomputer used in the program debug device according to the second aspect of the invention, wherein it is determined whether the execution is a branch operation, and if it is a branch operation. Is equipped with a discrimination means for outputting a branch execution signal.

【0018】[0018]

【作用】本発明によれば、マイクロコンピュータの実行
が分岐動作であるか否かを判別手段が判別して分岐動作
である場合に分岐実行信号を出力し、記憶手段が分岐実
行信号を入力した場合にこのの動作に係わる命令および
この命令の前後所定ステップの命令のみを記憶すること
により、分岐動作に係わる命令およびこの命令の前後所
定ステップの命令のみをトレースすることが可能とな
る。
According to the present invention, the discriminating means discriminates whether or not the execution of the microcomputer is a branching operation, and when it is the branching operation, the branching execution signal is outputted and the storing means inputs the branching execution signal. In this case, by storing only the instruction relating to this operation and the instruction at a predetermined step before and after this instruction, it becomes possible to trace only the instruction relating to the branch operation and the instruction at a predetermined step before and after this instruction.

【0019】[0019]

【実施例】【Example】

(実施例1)第1の発明に係わるデバッグ装置の一実施
例について説明する。
(Embodiment 1) An embodiment of the debug device according to the first invention will be described.

【0020】図1は、本実施例に係わるデバッグ装置に
おけるトレース回路10の一構成例を概略的に示すブロ
ック図である。同図において、図6と同じ符号を付した
構成部は、それぞれ図6と同じものを示している。
FIG. 1 is a block diagram schematically showing a configuration example of the trace circuit 10 in the debug device according to the present embodiment. In the figure, the components denoted by the same reference numerals as those in FIG. 6 are the same as those in FIG.

【0021】分岐実行アドレス格納メモリ17は、マイ
クロコンピュータ11の実行命令のアドレスに対応させ
たアドレスを備えており、各アドレスについて1ビット
のデ−タの格納を行うことができる。そして、マイクロ
コンピュータ11の各実行命令に対応させて、この命令
が分岐動作を伴うもの(ジャンプ命令、コール命令、リ
ターン命令或いは割り込み命令等)であるか否かの情報
を格納する。ここでは、当該アドレスの命令が分岐動作
を伴うものであるときは「1」を格納し、分岐動作を伴
わないものであるときには「0」を格納するものとす
る。
The branch execution address storage memory 17 has an address corresponding to the address of the execution instruction of the microcomputer 11, and can store 1-bit data for each address. Then, in association with each execution instruction of the microcomputer 11, information on whether or not this instruction is accompanied by a branch operation (jump instruction, call instruction, return instruction, interrupt instruction, etc.) is stored. Here, it is assumed that "1" is stored when the instruction at the address is accompanied by a branch operation, and "0" is stored when the instruction at the address is not accompanied by the branch operation.

【0022】プログラム開発言語実行回路32は、マイ
クロコンピュータ11が実行する各命令が分岐動作を伴
うものであるか否かを判断し、分岐動作を伴う命令があ
ったときは当該命令のアドレスを出力する。例えば、こ
の回路32として、プログラムのアセンブリを行う際に
当該命令が分岐動作を伴うものであるか否かの判断も行
うことができるプログラム開発言語を用いたものを使用
することにより、このような判断を行うことができる。
The program development language execution circuit 32 determines whether or not each instruction executed by the microcomputer 11 is accompanied by a branch operation, and if there is an instruction accompanied by a branch operation, outputs the address of the instruction. To do. For example, by using, as the circuit 32, a circuit using a program development language that can also judge whether or not the instruction is accompanied by a branch operation when the program is assembled, Can make decisions.

【0023】分岐情報書込回路19は、プログラム開発
言語実行回路32から入力したアドレス情報にしたがっ
て、分岐実行アドレス格納メモリ17へのデ−タの格納
を行う。すなわち、この分岐情報書込回路19は、分岐
実行アドレス格納メモリ17内の、プログラム開発言語
実行回路32から入力したアドレス情報に該当するアド
レスには「1」を格納し、他のアドレスには「0」を格
納する。このような分岐情報書込回路19による分岐実
行アドレス格納メモリ17へのデ−タの格納は、トレー
スを行う前に予め実施しておく。
The branch information writing circuit 19 stores data in the branch execution address storage memory 17 according to the address information input from the program development language execution circuit 32. That is, the branch information writing circuit 19 stores "1" in the address corresponding to the address information input from the program development language execution circuit 32 in the branch execution address storage memory 17, and stores "1" in other addresses. 0 ”is stored. The storage of data in the branch execution address storage memory 17 by the branch information writing circuit 19 as described above is carried out in advance before tracing.

【0024】なお、プログラム開発言語実行回路32を
用いず、各命令が分岐動作に係わる命令であるか否かを
ユーザ自身がプログラムリストから判断して分岐実行ア
ドレス格納メモリ17の設定を行なうように、分岐情報
書込回路19を構成してもよい。
It should be noted that instead of using the program development language execution circuit 32, the user himself / herself determines whether or not each instruction is an instruction related to a branch operation from the program list and sets the branch execution address storage memory 17. The branch information writing circuit 19 may be configured.

【0025】さらに、上述の分岐実行アドレス格納メモ
リ17は、マイクロコンピュータ11からアドレス情報
28を入力すると、このアドレスに対応するビットの値
をチェックする。そして、このビットが「1」であれ
ば、図示しない出力回路から、アドレス制御回路18に
対して分岐実行信号29を出力する。
When the address information 28 is input from the microcomputer 11, the branch execution address storage memory 17 described above checks the value of the bit corresponding to this address. If this bit is "1", the branch execution signal 29 is output from the output circuit (not shown) to the address control circuit 18.

【0026】アドレス制御回路18は、トレースメモリ
12の書き込みアドレスを指定するためのアドレス信号
27を生成する。このアドレス信号27の示すアドレス
値は、ライトストローブ制御回路15からトレースライ
トストローブ信号25を入力するたびに「1」ずつ加算
されるが、初期アドレスから所定アドレス(ここでは2
nとする)増加すると、この初期アドレス(すなわち2
n個前のアドレス)に戻る。そして、分岐実行アドレス
格納メモリ17から分岐実行信号29を入力すると、ト
レースライトストローブ信号25に応じて「1」ずつ加
算されたn個のアドレス信号27を順次出力した後、
{初期アドレス+(2n+1)}番目のアドレスを示す
値を出力する。そして、このアドレスを初期アドレスと
して、同じ動作を繰り返す。なお、比較回路13から入
力する制御信号26によってクリア等の制御が行われる
点は、上述した従来のデバッグ装置(図6参照)のアド
レス制御回路16と同じである。
The address control circuit 18 generates an address signal 27 for designating a write address of the trace memory 12. The address value indicated by the address signal 27 is incremented by "1" each time the trace write strobe signal 25 is input from the write strobe control circuit 15, but from the initial address to a predetermined address (here, 2).
n), this initial address (ie 2
Return to n previous address). Then, when the branch execution signal 29 is input from the branch execution address storage memory 17, after sequentially outputting n address signals 27 added by “1” according to the trace write strobe signal 25,
A value indicating the {initial address + (2n + 1)} th address is output. The same operation is repeated using this address as the initial address. The point that control such as clearing is performed by the control signal 26 input from the comparison circuit 13 is the same as the address control circuit 16 of the above-described conventional debug device (see FIG. 6).

【0027】次に、本実施例のデバッグ装置を使用した
場合の、トレースメモリ12への格納動作の手順につい
て説明する。図2は、かかる動作を説明するための概念
図である。
Next, the procedure of the storing operation in the trace memory 12 when the debug device of this embodiment is used will be described. FIG. 2 is a conceptual diagram for explaining such an operation.

【0028】図2(a)に示したように、本実施例で
は、トレースメモリ12の記憶領域を複数のブロック
A,B,C,…に分割して考える。ここで、各ブロック
には、2n+1ずつのアドレスを有している。
As shown in FIG. 2A, in this embodiment, the storage area of the trace memory 12 is divided into a plurality of blocks A, B, C ,. Here, each block has 2n + 1 addresses.

【0029】マイクロコンピュータ11が最初に命令を
実行したときのバス情報は、1番地(ブロックA)に格
納される。さらに、二回目以降に実行した命令について
のバス情報も、2番地以降に順次格納される。
The bus information when the microcomputer 11 first executes the instruction is stored in the address 1 (block A). Further, the bus information about the instructions executed after the second time is also sequentially stored at the second address and thereafter.

【0030】次いで、ブロックA内のすべての番地(1
番地〜2n+1番地)へのバス情報の格納が終わると、
次のバス情報は再び1番地に格納される(これにより、
前回1番地に格納されたバス情報は消去される)。そし
て、その後のバス情報も、2番地以降に順次格納されて
いく。このような動作は、マイクロコンピュータ11が
分岐動作に係わる命令を実行するまで繰り返される。
Next, all the addresses (1
When the storage of the bus information in the addresses 2n + 1) is completed,
The next bus information will be stored again at address 1 (
The bus information previously stored at address 1 is deleted). Then, the bus information after that is also stored sequentially from the second address. Such an operation is repeated until the microcomputer 11 executes the instruction related to the branch operation.

【0031】ここで、マイクロコンピュータ11が実行
した命令が分岐動作を伴うものである場合、その後のn
個のバス情報は、上述した場合と同様、ブロックA内の
番地に順次格納される。ここで、分岐動作実行後、n個
のバス情報を格納する前に2n+1番地へのバス情報の
格納が行われた場合も、上述した場合と同様、残りのバ
ス情報については1番地から再格納を行う。
Here, if the instruction executed by the microcomputer 11 involves a branching operation, the subsequent n
Similar to the case described above, the individual pieces of bus information are sequentially stored at the addresses in the block A. Even when the bus information is stored in the address 2n + 1 after the branch operation is executed and before the n pieces of bus information are stored, the remaining bus information is restored from the address 1 as in the case described above. I do.

【0032】そして、分岐動作実行後のn個のバス情報
の格納が終わると、引き続き、ブロックBの各番地(2
n+2番地〜4n+2番地)への格納が順次行われる。
When the storage of n pieces of bus information after the branch operation is completed, each address (2
The data is sequentially stored in the addresses (n + 2 to 4n + 2).

【0033】例えば、図2(b)に示したように、1ブ
ロック内のアドレス領域の数を17(すなわちn=8)
とし、12番地に格納すべきバス情報が分岐動作に係わ
る命令のものであったとすると、この命令に係わるバス
情報を12番地に格納した後、その後の8個のバス情報
は13番地〜17番地および1番地〜3番地に順次格納
し、9個目以降のバス情報は18番地〜34番地に順次
格納していく。
For example, as shown in FIG. 2B, the number of address areas in one block is 17 (that is, n = 8).
Assuming that the bus information to be stored in the 12th address is for the instruction related to the branch operation, after storing the bus information related to this instruction in the 12th address, the subsequent 8 bus information are the 13th address to the 17th address. And the first to third addresses are sequentially stored, and the ninth and subsequent bus information are sequentially stored at the 18th to 34th addresses.

【0034】そして、次にマイクロコンピュータ11が
分岐動作に係わる命令を実行するまで、ブロックBの各
番地への格納が繰り返し行われる。分岐動作に係わる命
令の実行が行われたときは、上述の場合と同様に、n個
のバス情報を格納した後、ブロックCの各番地への格納
が引き続き行われる。
Then, the storage in each address of the block B is repeated until the microcomputer 11 next executes the instruction relating to the branch operation. When the instruction related to the branch operation is executed, as in the case described above, after storing n pieces of bus information, the storage in each address of the block C is continued.

【0035】以下、同様にして、トレースが停止するま
で、各ブロックへのバス情報の格納が順次行われる。
Similarly, the bus information is sequentially stored in each block until the trace is stopped.

【0036】このように、本実施例のデバッグ装置によ
れば、分岐動作に係わる命令およびこの前後nビットの
トレース情報(バス情報21)のみをトレースメモリ1
2に格納することができる。
As described above, according to the debug device of the present embodiment, only the instruction relating to the branch operation and the trace information (bus information 21) of n bits before and after this are trace memory 1.
2 can be stored.

【0037】(実施例2)次に、第2の発明に係わるデ
バッグ装置および第3の発明に係わるマイクロコンピュ
ータの実施例について説明する。
(Embodiment 2) Next, an embodiment of the debug device according to the second invention and the microcomputer according to the third invention will be described.

【0038】図3は、本実施例に係わるデバッグ装置に
おけるトレース回路30の一構成例を概略的に示すブロ
ック図である。同図において、図1、図6と同じ符号を
付した構成部は、それぞれこれらの図と同じものを示し
ている。
FIG. 3 is a block diagram schematically showing a configuration example of the trace circuit 30 in the debug device according to the present embodiment. In the figure, the components denoted by the same reference numerals as those in FIGS. 1 and 6 are the same as those in these figures.

【0039】本実施例では、マイクロコンピュータ31
が、分岐動作に係わる命令が存在することを示す信号で
ある分岐実行信号29を出力する。
In this embodiment, the microcomputer 31
Outputs a branch execution signal 29 which is a signal indicating that there is an instruction related to the branch operation.

【0040】図4は、マイクロコンピュータ31の一構
成例を概略的に示すブロック図である。このマイクロコ
ンピュータ31は、分岐動作に係わる命令が格納された
ときに分岐動作デコード信号43を出力する命令デコー
ダ41と、割り込みイネーブル状態で割り込み要求があ
ったときに割込受付信号44を出力する割込受付回路4
2とを備えている。そして、分岐動作デコード信号43
および割込受付信号44は、OR回路45に入力され
る。このOR回路45は、分岐動作デコード信号43ま
たは割込受付信号44がオンのときには、分岐実行信号
29を出力する。
FIG. 4 is a block diagram schematically showing a configuration example of the microcomputer 31. The microcomputer 31 outputs an instruction decoder 41 which outputs a branch operation decode signal 43 when an instruction relating to a branch operation is stored, and an interrupt acceptance signal 44 which outputs an interrupt acceptance signal 44 when an interrupt request is made in an interrupt enabled state. Included acceptance circuit 4
2 and. Then, the branch operation decode signal 43
And the interrupt acceptance signal 44 is input to the OR circuit 45. The OR circuit 45 outputs the branch execution signal 29 when the branch operation decode signal 43 or the interrupt acceptance signal 44 is on.

【0041】この分岐実行信号29は、比較回路13を
介してアドレス制御回路18へ伝達される。
The branch execution signal 29 is transmitted to the address control circuit 18 via the comparison circuit 13.

【0042】アドレス制御回路18は、上述の実施例1
におけるアドレス制御回路と同様にして、トレースメモ
リ12の書き込みアドレスを指定するためのアドレス信
号27を生成する。アドレス信号27の示すアドレス値
は、ライトストローブ制御回路15からトレースライト
ストローブ信号25を入力するたびに「1」ずつ加算さ
れるが、初期アドレスから所定アドレス(ここでは2n
とする)増加すると初期アドレスに戻る。そして、分岐
実行信号29を入力すると、トレースライトストローブ
信号25に応じてn個のアドレス信号27を順次出力し
た後、{初期アドレス+(2n+1)}番目のアドレス
を示す値を出力し、これを初期アドレスとして同じ動作
を繰り返す。
The address control circuit 18 is the same as the first embodiment.
Similarly to the address control circuit in, the address signal 27 for designating the write address of the trace memory 12 is generated. The address value indicated by the address signal 27 is incremented by "1" each time the trace write strobe signal 25 is input from the write strobe control circuit 15, but from the initial address to a predetermined address (here, 2n
When it increases, it returns to the initial address. When the branch execution signal 29 is input, n address signals 27 are sequentially output according to the trace write strobe signal 25, and then a value indicating the {initial address + (2n + 1)} th address is output. The same operation is repeated for the initial address.

【0043】このような構成のトレース回路30および
マイクロコンピュータ31を用いることによっても、上
述の実施例1と同様にして(図2参照)、分岐動作に係
わる命令およびこの前後のトレース情報のみをトレース
メモリ12に格納することができる。
By using the trace circuit 30 and the microcomputer 31 having such a configuration, as in the above-described first embodiment (see FIG. 2), only the instruction relating to the branch operation and the trace information before and after this are traced. It can be stored in the memory 12.

【0044】ここで、マイクロコンピュータ31の構成
は図4に示されたものに限定されるものではなく、分岐
動作に係わる命令が存在するときに分岐実行信号29が
出力される構成でありさえすれば使用することができ
る。
Here, the structure of the microcomputer 31 is not limited to that shown in FIG. 4, and the structure may be such that the branch execution signal 29 is output when there is an instruction related to the branch operation. Can be used if

【0045】図5に、マイクロコンピュータ31の他の
構成例を示す。このマイクロコンピュータ31はパイプ
ライン処理方式を採用しており、内部に、命令バッファ
51と、分岐動作の実行時に命令バッファ内に格納され
た命令をクリアするための信号であるキューフラシュ信
号53を出力する命令デコーダ52とを備えている。そ
して、このキューフラシュ信号53を分岐実行信号29
として、外部に出力する。この分岐実行信号29は、比
較回路13を介してアドレス制御回路18へ取り込むこ
とにより、本実施例のデバッグ装置を用いたトレースを
行うことができる(図3参照)。
FIG. 5 shows another configuration example of the microcomputer 31. The microcomputer 31 employs a pipeline processing method, and internally outputs an instruction buffer 51 and a cue flash signal 53 which is a signal for clearing an instruction stored in the instruction buffer when executing a branch operation. And an instruction decoder 52 for Then, the cue flash signal 53 is converted into the branch execution signal 29.
As an external output. This branch execution signal 29 can be traced using the debug device of this embodiment by being taken into the address control circuit 18 via the comparison circuit 13 (see FIG. 3).

【0046】なお、以上説明した実施例1,2におい
て、トレースメモリ12に格納される命令は、分岐動作
に係わる命令の前のものと後のものとのとで数が異なっ
ていてもよいことは、もちろんである。
In the first and second embodiments described above, the number of instructions stored in the trace memory 12 may be different before and after the instruction relating to the branch operation. Is of course.

【0047】[0047]

【発明の効果】以上詳細に説明したように、本発明によ
れば、デバッグ上必要なトレース情報のみをトレースメ
モリに格納させることができるデバッグ装置およびこの
ようなデバッグ装置で使用されるマイクロコンピュータ
を提供することができる。
As described in detail above, according to the present invention, a debug device capable of storing only trace information necessary for debugging in a trace memory and a microcomputer used in such a debug device are provided. Can be provided.

【0048】したがって、デバッグ装置のメモリの記憶
容量を小さくすることができるのでコストを低下させる
ことができ、さらに、デバッグ作業の効率を向上させる
こともできる。
Therefore, the storage capacity of the memory of the debugging device can be reduced, so that the cost can be reduced and the efficiency of the debugging work can be improved.

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

【図1】第1の発明の一実施例に係わるデバッグ装置に
おけるトレース回路の一構成例を概略的に示すブロック
図である。
FIG. 1 is a block diagram schematically showing a configuration example of a trace circuit in a debug device according to an embodiment of the first invention.

【図2】(a)、(b)ともに、図1に示したデバッグ
装置を使用した場合のトレースメモリへの格納動作を説
明するための概念図である。
2A and 2B are conceptual diagrams for explaining a storage operation in a trace memory when the debug device shown in FIG. 1 is used.

【図3】第2の発明の一実施例に係わるデバッグ装置に
おけるトレース回路の一構成例を概略的に示すブロック
図である。
FIG. 3 is a block diagram schematically showing a configuration example of a trace circuit in a debug device according to an embodiment of the second invention.

【図4】第3の発明に係わるマイクロコンピュータの一
構成例を概略的に示すブロック図である。
FIG. 4 is a block diagram schematically showing a configuration example of a microcomputer according to a third invention.

【図5】第3の発明に係わるマイクロコンピュータの他
の構成例を概略的に示すブロック図である。
FIG. 5 is a block diagram schematically showing another configuration example of the microcomputer according to the third invention.

【図6】従来のデバッグ装置におけるトレース回路の一
構成例を概略的に示すブロック図である。
FIG. 6 is a block diagram schematically showing a configuration example of a trace circuit in a conventional debug device.

【符号の説明】[Explanation of symbols]

10,30,60 トレース回路 11,31 マイクロコンピュータ 12 トレースメモリ 13 比較回路 14 ライトストローブ生成回路 15 ライトストローブ制御回路 16,18 アドレス制御回路 17 分岐実行アドレス格納メモリ 19 分岐情報書込回路 21 バス情報 22 外部ロジック信号 23 ステータス情報 24 ライトストローブ信号 25 トレースライトストローブ信号 26 制御信号 27 アドレス信号 28 アドレス情報 29 分岐実行信号 41,52 命令デコーダ 42 割込受付回路 43 分岐動作デコード信号 44 割込受付信号 45 OR回路 51 命令バッファ 10, 30, 60 Trace circuit 11, 31 Microcomputer 12 Trace memory 13 Comparison circuit 14 Write strobe generation circuit 15 Write strobe control circuit 16, 18 Address control circuit 17 Branch execution address storage memory 19 Branch information writing circuit 21 Bus information 22 External logic signal 23 Status information 24 Write strobe signal 25 Trace write strobe signal 26 Control signal 27 Address signal 28 Address information 29 Branch execution signal 41, 52 Instruction decoder 42 Interrupt acceptance circuit 43 Branch operation decode signal 44 Interrupt acceptance signal 45 OR Circuit 51 Instruction buffer

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】マイクロコンピュータで実行されるプログ
ラムのデバッグを行うためのプログラムデバッグ装置で
あって、 前記マイクロコンピュータの実行が実行アドレスの分岐
を伴うもの(以下、「分岐動作」)であるか否かを判別
し、分岐動作である場合には分岐実行信号を出力する判
別手段と、 前記分岐実行信号を入力した場合に、この命令およびこ
の命令の前後所定ステップの命令のみを記憶する記憶手
段と、 を備えたことを特徴とするプログラムデバッグ装置。
1. A program debug device for debugging a program executed by a microcomputer, wherein execution of the microcomputer involves branching of an execution address (hereinafter, "branch operation"). And a determining means for outputting a branch execution signal in the case of a branch operation, and a storage means for storing only this instruction and an instruction of a predetermined step before and after this instruction when the branch execution signal is input. A program debugging device comprising:
【請求項2】前記判別手段が、 前記マイクロコンピュータの実行する各命令が分岐動作
に係る命令であるか否かを記憶する分岐実行アドレス格
納メモリと、 この分岐実行アドレス格納メモリの記憶内容のうち、入
力したアドレス情報に対応する命令が分岐動作に係るも
のであったときに、前記分岐実行信号を出力する出力手
段と、 を備えたことを特徴とする請求項1記載のプログラムデ
バッグ装置。
2. A branch execution address storage memory for storing whether or not each instruction executed by the microcomputer is an instruction relating to a branch operation, and a content stored in the branch execution address storage memory. 2. The program debug device according to claim 1, further comprising: an output unit that outputs the branch execution signal when the instruction corresponding to the input address information is related to a branch operation.
【請求項3】前記判別手段が、 前記マイクロコンピュータの実行する各命令が分岐動作
に係る命令であるか否かを判断して分岐動作に係わる命
令であるときは当該命令のアドレスを出力するプログラ
ム開発言語実行手段と、 判断結果を前記分岐実行アドレス格納メモリに書き込む
分岐情報書込手段とをさらに備えたことを特徴とする請
求項2記載のプログラムデバッグ装置。
3. A program for determining whether or not each instruction executed by the microcomputer is an instruction relating to a branch operation and, if the instruction is an instruction relating to a branch operation, outputting the address of the instruction. 3. The program debug device according to claim 2, further comprising: a development language executing means; and branch information writing means for writing a judgment result in the branch execution address storage memory.
【請求項4】前記記憶手段が、前記分岐実行信号を入力
しないときはメモリ内の所定ステップの格納領域に対し
て繰り返して順次格納を行い、前記分岐実行信号を入力
したときはその後の所定ステップの命令を格納した後他
の格納領域に対して格納を行うように、前記メモリの格
納アドレスを指定するアドレス制御手段を備えたことを
特徴とする、請求項1〜3のいずれかに記載のプログラ
ムデバッグ装置。
4. When the memory means does not input the branch execution signal, the storage area is repeatedly and sequentially stored in a storage area of a predetermined step in the memory, and when the branch execution signal is input, subsequent predetermined steps are performed. 4. An address control means for designating a storage address of the memory is provided so as to store the instruction of the above in another storage area after storing the instruction. Program debug device.
【請求項5】マイクロコンピュータで実行されるプログ
ラムのデバッグを行うためのプログラムデバッグ装置で
あって、 分岐実行信号を入力した場合に、この命令およびこの命
令の前後所定ステップの命令のみを記憶する記憶手段を
備えたことを特徴とするプログラムデバッグ装置。
5. A program debug device for debugging a program executed by a microcomputer, which stores only this instruction and instructions at predetermined steps before and after this instruction when a branch execution signal is input. A program debug device comprising means.
【請求項6】前記記憶手段が、前記分岐実行信号を入力
しないときはメモリ内の所定ステップの格納領域に対し
て繰り返して順次格納を行い、前記分岐実行信号を入力
したときはその後の所定ステップの命令を格納した後他
の格納領域に対して格納を行うように、前記メモリの格
納アドレスを指定するアドレス制御手段を備えたことを
特徴とする請求項5記載のプログラムデバッグ装置。
6. When the storage means does not input the branch execution signal, the storage area is repeatedly and sequentially stored in a storage area of a predetermined step in the memory, and when the branch execution signal is input, subsequent predetermined steps are performed. 6. The program debug device according to claim 5, further comprising address control means for designating a storage address of the memory so that the instruction is stored in another storage area after storing the instruction.
【請求項7】請求項4に記載のプログラムデバッグ装置
に使用するマイクロコンピュータであって、 実行する命令が分岐動作を伴うものであるか否かを判別
し、分岐動作である場合には分岐実行信号を出力する判
別手段を備えたことを特徴とするマイクロコンピュー
タ。
7. A microcomputer used in the program debug device according to claim 4, wherein it is determined whether or not an instruction to be executed is accompanied by a branch operation, and if it is a branch operation, branch execution is performed. A microcomputer provided with a discrimination means for outputting a signal.
【請求項8】前記判別手段が、分岐時に命令バッファ内
に格納された命令をクリアするためのキューフラシュ信
号を前記分岐実行信号として出力することを特徴とする
請求項7記載のマイクロコンピュータ。
8. The microcomputer according to claim 7, wherein said discriminating means outputs a queue flash signal for clearing the instruction stored in the instruction buffer at the time of branch as the branch execution signal.
JP4334649A 1992-12-15 1992-12-15 Program debugging device and microcomputer Pending JPH06187193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4334649A JPH06187193A (en) 1992-12-15 1992-12-15 Program debugging device and microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4334649A JPH06187193A (en) 1992-12-15 1992-12-15 Program debugging device and microcomputer

Publications (1)

Publication Number Publication Date
JPH06187193A true JPH06187193A (en) 1994-07-08

Family

ID=18279726

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4334649A Pending JPH06187193A (en) 1992-12-15 1992-12-15 Program debugging device and microcomputer

Country Status (1)

Country Link
JP (1) JPH06187193A (en)

Similar Documents

Publication Publication Date Title
EP0241946B1 (en) Information processing system
KR100695187B1 (en) Single step processing method and apparatus
US20080016415A1 (en) Evaluation system and method
JPH06187193A (en) Program debugging device and microcomputer
JPH1011315A (en) In-circuit emulator device and in-circuit emulation method
JPS60164842A (en) Instruction prefetching device
JPH0233173B2 (en)
JPH08320813A (en) Program simulator device and program debugging method
JP3100013B2 (en) Program debug device
JP3182287B2 (en) Microprocessor
JPS60220437A (en) Program check device
JP2604203B2 (en) Debug device for one-chip digital signal processor
JP2581214B2 (en) Logic simulator
JP2705359B2 (en) Trace circuit
JPH0399338A (en) Microprocessor
JPS59103158A (en) Debug system of digital signal processing program
JPS59153247A (en) Debugging device
JPH05233379A (en) Execution history storage device
JPS63131238A (en) Logic simulator
JPH05209938A (en) Pattern generator for semiconductor test device
JPS63123137A (en) Address coincidence signal generating system
JPS59208656A (en) Simulator
JPS5960657A (en) Device for analyzing execution bus
JPS59153245A (en) Debugging device
JPS63163533A (en) Microcomputer