JPH1165897A - Microprocessor with debugger built-in - Google Patents

Microprocessor with debugger built-in

Info

Publication number
JPH1165897A
JPH1165897A JP9221842A JP22184297A JPH1165897A JP H1165897 A JPH1165897 A JP H1165897A JP 9221842 A JP9221842 A JP 9221842A JP 22184297 A JP22184297 A JP 22184297A JP H1165897 A JPH1165897 A JP H1165897A
Authority
JP
Japan
Prior art keywords
counter
count
microprocessor
cpu
debugger
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
JP9221842A
Other languages
Japanese (ja)
Inventor
Kazuyoshi Kuwabara
一悦 桑原
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 JP9221842A priority Critical patent/JPH1165897A/en
Publication of JPH1165897A publication Critical patent/JPH1165897A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a microprocessor with debugger built-in with high easiness/ convenience. SOLUTION: The operating state of a CPU 2 is inputted as data to be detected, an input/output part 3 outputs the detected result of these data to be detected, and a prescribed held reference value is compared with the data to be detected. Two event detecting parts 4 and 5 output the result of this comparison, and the outputted result is counted by a counter 7. In this counting, a counter control part 6 sets a countable state based on one detected result and sets a count stopped state based on the other detected result, and a debugging function part for debugging the program operation of the CPU 2 is constituted on one semiconductor. Thus, since RAM is not required, a circuit size is made compact so that the microprocessor can be mounted in one semiconductor. Further, counting can be started/ended at any arbitrary address, accuracy is improved and convenience is improved as well.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、デバッガ内蔵マイ
クロプロセッサに関し、特に、ソフトウェア開発用のデ
バッガを内蔵したデバッガ内蔵マイクロプロセッサに関
する。
The present invention relates to a microprocessor with a built-in debugger, and more particularly, to a microprocessor with a built-in debugger having a built-in debugger for software development.

【0002】[0002]

【従来の技術】従来、特に昨今、デバッガ内蔵マイクロ
プロセッサが注目を浴びている。その理由は、音声、サ
ウンド、画像、データ通信等のマルチメディア系アプリ
ケーションでは、一つのプロセッサで種々のアプリケー
ションを実行させることにより、システムのコストを下
げようとしている。このようなプロセッサ用ソフトウェ
アのデバッグは、色々な観点から行う必要がある。例え
ば、プログラムの論理性の確認、データの正当性の確認
などである。このような確認処理において、デバッガ内
蔵マイクロプロセッサは利用価値・利便性等があるから
である。
2. Description of the Related Art In recent years, microprocessors with a built-in debugger have been receiving attention, especially in recent years. The reason is that in multimedia applications such as voice, sound, image, data communication, etc., one processor is used to execute various applications to reduce the cost of the system. Such debugging of processor software needs to be performed from various viewpoints. For example, confirmation of the logic of the program, confirmation of the validity of the data, and the like. This is because in such a confirmation process, the microprocessor with a built-in debugger has utility value, convenience, and the like.

【0003】しかし、従来のソフトウェアと新しいマル
チメディアアプリケーションのソフトウェアには違いが
ある。これは、マルチメディア系アプリケーションは、
ある決まったサイクル内で色々な処理を施す必要があ
る。例えば、サウンド・アプリケーションでは、44.
1KHzでサンプリングするため、約20μsec 内で種
々のアプリケーションを実行する。通常アプリケーショ
ンの切り替えを出来るだけソフトウェア設計時に意識し
ないように、リアルタイムOSを用いてプログラミング
する。
[0003] However, there is a difference between conventional software and software for new multimedia applications. This is a multimedia application
Various processes need to be performed within a certain fixed cycle. For example, in a sound application, 44.
Execute various applications within about 20 μsec to sample at 1 KHz. Normally, programming is performed using a real-time OS so that switching of applications is as little as possible when designing software.

【0004】しかしこのリアルタイムOSを使えばすべ
てが解決するわけではない。なぜならば、先ほどのサウ
ンド系アプリケーションであれば、20μsec 以内にす
べての処理が終わるかどうかの確認が必要だからであ
る。このようなことには、リアルタイムOSは関知しな
い。処理が終了しなければ次の処理に影響が出る。この
ため、ソフトウェアのデバッグは、先ほど述べた論理性
の確認、データの正当性の他に、処理時間のチェックが
必要である。
[0004] However, not all solutions can be obtained by using this real-time OS. This is because, in the case of the sound-based application described above, it is necessary to confirm whether or not all processing is completed within 20 μsec. The real-time OS is unaware of this. If the processing is not completed, the next processing will be affected. For this reason, in software debugging, it is necessary to check the processing time in addition to the confirmation of the logic and the validity of the data described above.

【0005】処理時間を確認する方法としては、従来よ
りいくつかの方法が提案されている。例えば、ソフトウ
ェアシミュレータを用いて計測する方法、ハードウェア
エミュレータを用いて実際に実時間でプログラムを動作
させ計測する方法、などである。
[0005] As a method for confirming the processing time, several methods have conventionally been proposed. For example, there are a method of measuring by using a software simulator, a method of actually operating a program in real time by using a hardware emulator, and a method of measuring.

【0006】ハードウェアエミュレータ等のデバッガを
用いる方法について次に説明する。通常、ハードウェア
デバッガでは、デバッグのための機能をいくつかの半導
体を組み合わせて構成している。ここでも各素子は専用
の半導体である。
A method using a debugger such as a hardware emulator will be described below. Normally, a hardware debugger is configured by combining some semiconductors with a function for debugging. Again, each element is a dedicated semiconductor.

【0007】従来の技術の動作例を、図3に基づき説明
する。図3は従来の被デバッグCPUをデバッグする回
路構成例を示している。本従来例のデバッグ回路は、被
デバッグCPU31、レジスタ32、トレースRAM3
3、双方向バッファ34、インバータ35、バッファ3
6、AND素子37、AND素子38、主記憶39、シ
ステムバス40、アドレスレジスタ41、被デバッグ装
置の主記憶42、被デバッグ装置のアドレスバス43、
システムバス44、プログラム開発装置ホストプロセッ
サバス45、アドレス情報出力タイミング信号46、マ
ッピング情報信号47、カウンタ52、フリップフロッ
プ53、AND素子54、クロック信号55、の各構成
部および信号系とにより構成される。
An operation example of the conventional technique will be described with reference to FIG. FIG. 3 shows an example of a circuit configuration for debugging a conventional debugged CPU. The debug circuit of the conventional example includes a debugged CPU 31, a register 32, a trace RAM 3
3, bidirectional buffer 34, inverter 35, buffer 3
6, AND element 37, AND element 38, main memory 39, system bus 40, address register 41, main memory 42 of the debugged device, address bus 43 of the debugged device,
It comprises a system bus 44, a program development device host processor bus 45, an address information output timing signal 46, a mapping information signal 47, a counter 52, a flip-flop 53, an AND element 54, a clock signal 55, and other components and a signal system. You.

【0008】上記構成の従来のデバッグ回路において、
被デバッグマイクロプロセッサ(CPU)31よりアド
レス情報がバス44に出力され、引き続いてアドレス情
報出力タイミング信号46が出力されると、まず、アド
レス情報出力タイミング信号46がRAM33の書き込
み信号端子に入力され、その時のカウンタの内容がRA
M33に書き込まれる。アドレス情報出力タイミング信
号46がレジスタ32のクロック端子に加わり、バス4
4上のアドレス情報がレジスタ32に格納されRAM3
3のアドレス入力が変化する。更新されたアドレスによ
りRAM33の該当する内容が読み出され、カウンタ5
2の入力端子に印加され、アドレス情報出力タイミング
信号46によりカウンタ52に取り込まれる。
In the conventional debug circuit having the above configuration,
When the address information is output from the debugged microprocessor (CPU) 31 to the bus 44 and subsequently the address information output timing signal 46 is output, first, the address information output timing signal 46 is input to the write signal terminal of the RAM 33. The contents of the counter at that time are RA
Written to M33. The address information output timing signal 46 is applied to the clock terminal of the register 32,
4 is stored in the register 32 and stored in the RAM 3
The address input 3 changes. The corresponding contents of the RAM 33 are read out by the updated address, and the counter 5
2 and is taken into the counter 52 by the address information output timing signal 46.

【0009】一方、デバッガは、被開発プログラムの動
作特性の測定を開始するため、プログラム開発装置のホ
ストプロセッサバス(単に、バスともいう)45に接続
されたフリップフロップ(F/F)53をセットし、A
ND素子54のゲートが開き単位時間クロック信号55
がカウンタ52のカウントアップ端子に印加される。ま
た、カウンタ52は、RAM33によってプリセットさ
れた値よりカウントアップ動作を開始する。このカウン
トアップ動作は、被デバッグマイクロプロセッサ31よ
り、次のアドレス情報出力タイミング信号46が出力さ
れるまで続行される。
On the other hand, the debugger sets a flip-flop (F / F) 53 connected to a host processor bus (simply referred to as a bus) 45 of the program development apparatus in order to start measuring the operating characteristics of the developed program. A
The gate of the ND element 54 opens and the unit time clock signal 55
Is applied to the count-up terminal of the counter 52. The counter 52 starts counting up from a value preset by the RAM 33. This count-up operation is continued until the next address information output timing signal 46 is output from the microprocessor 31 to be debugged.

【0010】上記タイミング信号46が出力されると、
その時点でカウンタ52の値がRAM33の同一記憶位
置に書き込まれ、書き込まれた後に再び更新されたアド
レスで、上述と全く同様の動作が繰り返される。したが
って、被デバッグマイクロプロセッサ31が、プログラ
ムによりA番地、B番地、A番地と主記憶をアクセスし
たとすると、上記動作によりRAM33のA番地に相当
する記憶位置には、A番地にアクセスしていた時間の累
計がカウント値として記憶されている。更に、RAM3
3のアドレス入力をレジスタ32のアドレス出力の一
部、例えば上位8ビットのみとすることにより、256
後をブロックとしてプログラム実行時間を計測できる。
When the timing signal 46 is output,
At that time, the value of the counter 52 is written to the same storage location of the RAM 33, and the same operation as described above is repeated with the updated address after the writing. Therefore, assuming that the debugged microprocessor 31 accesses the addresses A, B, and A and the main memory by the program, the storage location corresponding to the address A in the RAM 33 is accessed by the above operation. The accumulated time is stored as a count value. Furthermore, RAM3
3 is a part of the address output of the register 32, for example, only the upper 8 bits, so that 256
The program execution time can be measured with the subsequent blocks.

【0011】本願発明と技術分野が類似する他の従来例
として、特開昭59−57355号公報の「プログラム
開発装置」は、マイクロプロセッサから出力されるアド
レス情報を記憶するレジスタと記憶装置とカウンタとを
設け、アドレス情報が出されてからの経過時間をカウン
タにより計時し、アドレスが更新される毎にその内容を
記憶装置に格納する。このことにより、プログラムの各
処分毎の実行時間を検出している。本機能は、図3に示
した従来例に相当する。
As another conventional example having a technical field similar to that of the present invention, a "program development device" disclosed in Japanese Patent Application Laid-Open No. S59-57355 discloses a register for storing address information output from a microprocessor, a storage device, and a counter. And the counter measures the elapsed time from when the address information is output, and stores the content in the storage device every time the address is updated. Thus, the execution time of each disposal of the program is detected. This function corresponds to the conventional example shown in FIG.

【0012】[0012]

【発明が解決しようとする課題】しかしながら、これら
の方法にはいくつかの欠点がある。パソコンやワークス
テーション上で、ソフトウェアシミュレータを使いソフ
トウェアだけで計測する方法では、実行するのに膨大な
時間がかかる。サウンド系では、少なくとも数秒間のデ
ータを入力して計測しなけらばならない。通常のソフト
ウェアシミュレータは、実際に動作する時間の1000
倍〜10000倍程度かかるので、例えば、5秒のデー
タを実行しようとすると5000秒以上もかかることに
なる。これではデバッグにも膨大な時間がかかってしま
う。また、入力データをつくるのも大変である。このよ
うな方式では次のような問題を生じさせる。
However, these methods have several disadvantages. Using a software simulator on a personal computer or workstation and using software alone to measure it takes an enormous amount of time to execute. In the sound system, data must be input for at least a few seconds and measured. A typical software simulator requires 1000 hours of actual operation.
Since it takes about 1 to 10000 times, it takes more than 5000 seconds to execute data for 5 seconds, for example. This would take an enormous amount of time to debug. It is also difficult to create input data. Such a system causes the following problem.

【0013】まず、処理実行時間を計るために、アドレ
ス情報タイミング信号によりカウントされた値をRAM
の中に書き込んでいる。これは、すなわち、RAMが不
可欠であることを示している。アドレス範囲が大きけれ
ばそれだけの膨大なメモリが必要である。
First, in order to measure the processing execution time, the value counted by the address information timing signal is stored in a RAM.
It is written in. This indicates that RAM is essential. The larger the address range, the more memory is needed.

【0014】また、このようなシステムは、昨今の非常
に高速なCPUの場合適用できない。なぜなら、CPU
の出力を基にCPU外部でカウントしRAMに書き込む
という作業のために、各素子で遅延時間が発生し、CP
Uの1命令実行時間内でこの処理が行えなくなる。つま
り、計測すると、CPUの実時間動作を遅くして計測し
なければならないという状態が生じる。
Further, such a system cannot be applied to a very high-speed CPU these days. Because the CPU
Due to the work of counting outside the CPU and writing it to the RAM based on the output of
This processing cannot be performed within one instruction execution time of U. In other words, when the measurement is performed, a state occurs in which the real-time operation of the CPU has to be delayed for the measurement.

【0015】高速なCPU、特にDSPと呼ばれる信号
処理プロセッサの場合に、この弊害は特に顕著である。
最近のDSPでは、簡単なプログラムデバッグ機能がデ
バイス内部に装備されているものもある。半導体内部で
このような機能を実現する場合には、通常このような遅
延は専用デバイスを組み合わせて作る場合と比べて問題
にならない。
[0015] In the case of a high-speed CPU, especially a signal processor called a DSP, this problem is particularly remarkable.
Some recent DSPs have a simple program debugging function inside the device. When realizing such a function inside a semiconductor, such a delay is generally not a problem compared to a case where a dedicated device is combined.

【0016】更に、メモリ量を減らして測定しようとす
ると、前述のようにアドレスの幅を制限しなければなら
ない。これは、ブロック単位でしか計測出来ないことを
意味している。従来技術の例では256ワード単位に測
定するようになっているが、通常アプリケーションは、
256ワードブロック単位で整理され、きれいに置かれ
ることはない。このため、アプリケーションすべてを測
定しようとすると、このアプリケーションが置かれてい
るすべてのブロックについて測定しなければならない。
これは厳密性に欠けることになる。
Further, in order to reduce the amount of memory and perform measurement, the width of the address must be limited as described above. This means that measurement can be performed only in block units. In the prior art example, measurement is performed in units of 256 words.
They are organized in 256 word blocks and are not neatly placed. Therefore, when trying to measure all applications, it is necessary to measure all blocks in which the application is located.
This would be less rigorous.

【0017】このようなモジュールを正しく計測する場
合には、モジュールすべてのアドレスについて計測して
処理時間を判断しなければならず、膨大なメモリ量が必
要である。また、実行を開始する手段がプログラム開発
装置からのみであるため、あるCPUの状態を検出し
て、それをトリガとして開始するといったことができず
不便である問題を伴う。
In order to correctly measure such a module, it is necessary to measure the addresses of all the modules to determine the processing time, which requires an enormous amount of memory. Further, since the means for starting the execution is only from the program development device, it is not possible to detect the state of a certain CPU and start it by using the state as a trigger, which is inconvenient.

【0018】本発明は、簡便性・利便性の高いデバッガ
内蔵マイクロプロセッサを提供することを目的とする。
An object of the present invention is to provide a microprocessor with a built-in debugger which is simple and convenient.

【0019】[0019]

【課題を解決するための手段】かかる目的を達成するた
め、本発明のデバッガ内蔵マイクロプロセッサは、所定
のCPUの動作状態を被検出データとして入力し、この
被検出データの検出結果を出力する入出力部と、所定の
保持された基準値と被検出データとを比較し、この比較
の結果を出力する2つのイベント検出部と、出力された
結果をカウントするカウンタと、カウンタを一方のイベ
ント検出部の結果に基づきカウント可能状態とし、且つ
他方のイベント検出部の検出結果によりカウント停止状
態とするカウンタ制御部とを有し、所定のCPUとこの
CPUのプログラム動作をデバッグするデバッグ機能部
とが一の半導体上に構成されたことを特徴としている。
In order to achieve the above object, a microprocessor with a built-in debugger according to the present invention inputs an operation state of a predetermined CPU as detected data and outputs a detection result of the detected data. An output unit, two event detectors for comparing a predetermined held reference value with the detected data and outputting the result of the comparison, a counter for counting the output result, and a counter for detecting one of the events. A counter control unit that sets a countable state based on the result of the unit, and sets a count stop state based on the detection result of the other event detection unit, wherein a predetermined CPU and a debug function unit that debugs a program operation of the CPU are provided. It is characterized by being formed on one semiconductor.

【0020】また、上記のカウンタ制御検出部は、カウ
ントアップ信号であるカウントクロックに基づきカウン
タのカウント動作を行なわせ、カウントアップ信号を、
CPUの実行クロックとするとよい。
The above-described counter control detection section causes the counter to perform a count operation based on a count clock which is a count-up signal, and outputs the count-up signal.
It is good to be the execution clock of CPU.

【0021】なお、上記のイベント検出部は、基準値と
カウンタのカウント数とを比較し、この比較結果が一致
した場合にはカウント終了信号をカウンタ制御部に出力
し、さらには、基準値を保持する保持手段を具備し、こ
の保持手段が入出力部を介して入力された基準値を保持
するとよい。
The event detecting section compares the reference value with the count number of the counter, and outputs a count end signal to the counter control section when the comparison result matches. It is preferable that a holding unit for holding the data is provided, and the holding unit holds the reference value input through the input / output unit.

【0022】さらに、デバッガ内蔵マイクロプロセッサ
は、2つのイベント検出部を1組とし少なくとも2組の
イベント検出部と、カウンタのカウント数値を保持する
保持回路と、カウント数値を読み出す読み出し回路とを
有し、CPUの実行期間の把握を可能とするとよい。
Furthermore, the microprocessor with a built-in debugger has at least two sets of event detectors, one set of two event detectors, a holding circuit for holding the count value of the counter, and a reading circuit for reading the count value. , The execution period of the CPU may be grasped.

【0023】[0023]

【発明の実施の形態】次に添付図面を参照して本発明に
よるデバッガ内蔵マイクロプロセッサの実施の形態を詳
細に説明する。図1および図2を参照すると、本発明の
デバッガ内蔵マイクロプロセッサの実施形態が示されて
いる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, an embodiment of a microprocessor with a built-in debugger according to the present invention will be described in detail with reference to the accompanying drawings. Referring to FIGS. 1 and 2, there is shown an embodiment of a microprocessor with a built-in debugger of the present invention.

【0024】<実施形態>図1は、本発明のデバッガ内
臓マイクロプロセッサの実施形態の回路構成ブロック図
である。本実施形態のデバッガ内臓マイクロプロセッサ
(以降、単に半導体1ともいう)は、CPU2とデバッ
ガとを内蔵している。デバッガは、入出力部3、イベン
ト検出部4および5、カウンタ制御部6、カウンタ7、
の各部により構成される。
<Embodiment> FIG. 1 is a block diagram showing a circuit configuration of an embodiment of a microprocessor with a built-in debugger according to the present invention. The microprocessor with a built-in debugger (hereinafter, also simply referred to as a semiconductor 1) of the present embodiment includes a CPU 2 and a debugger. The debugger includes an input / output unit 3, event detection units 4 and 5, a counter control unit 6, a counter 7,
It consists of each part of.

【0025】本構成の半導体1の要部の信号関係は、カ
ウントアップ信号8、CPU実行状態データ9、CPU
実行状態データ10、カウント開始信号11、カウント
終了信号12、データバス13、データバス14、カウ
ンタ制御線15、データバス16、リセット信号17、
カウント開始制御信号18、カウント終了制御信号1
9、データバス20、動作クロック21等である。半導
体1には、外部からデータバス20を通して所定のデー
タを、入出力部3経由で本デバッガに入出力することが
できる構成となっている。
The signal relations of the main parts of the semiconductor 1 of this configuration include a count-up signal 8, CPU execution state data 9,
Execution state data 10, count start signal 11, count end signal 12, data bus 13, data bus 14, counter control line 15, data bus 16, reset signal 17,
Count start control signal 18, count end control signal 1
9, a data bus 20, an operation clock 21, and the like. The semiconductor 1 is configured so that predetermined data can be input / output to / from the debugger via the input / output unit 3 from the outside via the data bus 20.

【0026】まず、カウントを開始する条件を、前述の
入出力部3を通じてイベント検出部4に基準データとし
て設定する。この条件には種々のものが考えられるがこ
こでは特定しない。例えば、CPUが割り込みを発生す
るとか、ある特定のアドレスをアクセスするとかであ
る。また、同様にしてイベント検出部5にカウント終了
の条件を設定しておく。これらイベント検出部は、CP
U1の状態をCPU実行状態データとして入力してい
る。イベント検出部4とイベント検出部5に設定した基
準データは、CPU1から入力されるCPU実行状態デ
ータと比較される。
First, the condition for starting the counting is set as reference data in the event detecting unit 4 through the input / output unit 3 described above. Various conditions can be considered for this condition, but they are not specified here. For example, the CPU generates an interrupt or accesses a specific address. Similarly, a condition for terminating the count is set in the event detection unit 5. These event detectors are CP
The state of U1 is input as CPU execution state data. The reference data set in the event detection unit 4 and the event detection unit 5 are compared with CPU execution state data input from the CPU 1.

【0027】カウンタ制御部6は、カウンタ7を制御す
る機能を有している。カウンタ7を制御するためのコマ
ンドなどは、入出力部3を通して入力される。カウンタ
7をリセットするためのリセット信号17、データをプ
リセットするための制御線15、データバス16など
で、カウンタ7を制御する。
The counter control section 6 has a function of controlling the counter 7. Commands for controlling the counter 7 are input through the input / output unit 3. The counter 7 is controlled by a reset signal 17 for resetting the counter 7, a control line 15 for presetting data, a data bus 16, and the like.

【0028】まず、前述した方法でイベント検出部4、
およびイベント検出部5に基準値を設定する。次にカウ
ンタ制御部6に対して、カウンタ7をカウント可能状態
にするようなコマンドを、バス13を通して半導体1の
外部より発行する。これは、コマンドでなくても制御信
号でもかまわない。このような状態で、CPU2の状態
が、設定した基準値とイベント検出部4で比較される。
一致した場合には、イベント検出部4でカウント開始信
号11としてカウンタ制御部6に出力される。出力され
るとカウンタ制御部6は、カウント開始信号18をカウ
ンタ7に対して出力する。
First, the event detector 4,
Then, a reference value is set in the event detection unit 5. Next, a command to make the counter 7 countable is issued from outside the semiconductor 1 through the bus 13 to the counter control unit 6. This may be a control signal instead of a command. In such a state, the event detection unit 4 compares the state of the CPU 2 with the set reference value.
If they match, the event detection unit 4 outputs the count start signal 11 to the counter control unit 6. When output, the counter control unit 6 outputs a count start signal 18 to the counter 7.

【0029】この結果カウンタ7は、カウントアップ信
号であるカウントクロック8に基づきカウント動作を行
なう。このカウントアップ信号としては、通常、CPU
2の実行クロックが入力される。さらに、イベント検出
部5で、CPU2の状態を設定した基準値と比較され
る。一致した場合には、イベント検出部5でカウント終
了信号12としてカウンタ制御部6に出力される。出力
されるとカウンタ制御部6は、カウント終了信号19を
カウンタ7に対して出力する。終了信号19が入力され
るとカウンタ7は、カウント動作を停止する。この後
に、入出力部3を経由してカウンタ7のデータを読み出
す。
As a result, the counter 7 performs a counting operation based on a count clock 8 which is a count-up signal. As this count-up signal, usually, the CPU
2 are input. Further, the event detector 5 compares the state of the CPU 2 with a set reference value. If they match, the event detection section 5 outputs the count end signal 12 to the counter control section 6. When output, the counter control unit 6 outputs a count end signal 19 to the counter 7. When the end signal 19 is input, the counter 7 stops counting. Thereafter, the data of the counter 7 is read via the input / output unit 3.

【0030】これをどのようにして、アプリケーション
の実行時間測定に用いるかを以下に説明する。まず、測
定したいアプリケーションの実行開始アドレスをイベン
ト検出部4に設定し、実行終了アドレスをイベント検出
部5に設定する。例えば、リアルタイムOS上でアプリ
ケーションが起動されるのは通常割り込みであるので、
ある割り込み処理のアドレスを設定すれば良い。CPU
2が実行開始アドレスをアクセスするとカウンタ7がカ
ウントを開始し、イベント検出部5で終了条件がみたさ
れるまで続ける。このカウンタ7の値を読めば、どのく
らい時間がかかったかがわかる。
How this is used for measuring the execution time of an application will be described below. First, the execution start address of the application to be measured is set in the event detection unit 4, and the execution end address is set in the event detection unit 5. For example, starting an application on a real-time OS is usually an interrupt,
What is necessary is just to set the address of a certain interrupt process. CPU
When 2 accesses the execution start address, the counter 7 starts counting and continues until the end condition is satisfied by the event detection unit 5. By reading the value of the counter 7, it is possible to know how long it took.

【0031】<実施形態の応用例>図2は、上記実施形
態のデバッガ内臓マイクロプロセッサを利用した、応用
例の回路構成ブロック図である。本応用例は、実施形態
で記載した半導体1に、さらに、イベント検出部104
および105、カウンタ値保持回路108および10
9、読み出し回路112、を追加して構成している。
<Application Example of Embodiment> FIG. 2 is a circuit configuration block diagram of an application example using the microprocessor with a built-in debugger of the above embodiment. In this application example, the event detection unit 104 is added to the semiconductor 1 described in the embodiment.
And 105, counter value holding circuits 108 and 10
9, a readout circuit 112.

【0032】上記の実施形態ではイベント検出部4およ
び5を1組みとして有しているが、本応用例では、さら
にイベント検出部104および105の1組が追加さ
れ、この追加したイベント検出部104、105に対応
したカウンタ保持回路108、109、並びに、このカ
ウンタ保持回路108、109の保持値の読み出しを行
う読み出し回路112が追加されている。
In the above embodiment, the event detectors 4 and 5 are provided as one set. However, in this application example, one set of the event detectors 104 and 105 is further added. , 105, and a reading circuit 112 for reading the values held by the counter holding circuits 108, 109 are added.

【0033】上記構成部のイベント検出部104、10
5では、実施形態1で記載したイベント検出部4、5と
同様に、CPUの実行状態データをCPU2から信号線
100を通して入力している。また、同様に、カウント
を開始する条件を、前述の入出力部3を通じて信号線1
01、103を通してイベント検出部104、105に
基準データとして設定する。
The event detectors 104, 10 of the above components
In 5, in the same manner as in the event detection units 4 and 5 described in the first embodiment, CPU execution state data is input from the CPU 2 through the signal line 100. Similarly, the condition for starting the count is set to the signal line 1 through the input / output unit 3 described above.
01 and 103 are set as reference data in the event detection units 104 and 105.

【0034】カウンタ値保持回路108と109は、イ
ベント検出部104、105から出力されるイベント一
致信号106、107により、カウンタの値を保持す
る。例えば、イベント検出部104にあるモジュールの
先頭のアドレスを比較値として設定し、イベント検出部
105にはこのモジュールの最後のアドレスを比較値と
して設定しておく。まず、カウンタ7が動作を始める。
この後、CPUがイベント検出部104で設定した状態
になると、イベント検出部104からイベント一致信号
106が出力され、この信号を基に保持回路108にそ
の時のカウンタ値が保持される。さらにCPUでの処理
が進み、イベント検出部105に設定した値になると、
イベント検出部105より一致信号107が出力され、
この信号を基に保持回路109にその時のカウンタ値が
保持される。
The counter value holding circuits 108 and 109 hold the counter values based on the event coincidence signals 106 and 107 output from the event detectors 104 and 105. For example, the first address of the module in the event detection unit 104 is set as a comparison value, and the last address of this module is set in the event detection unit 105 as a comparison value. First, the counter 7 starts operating.
Thereafter, when the CPU enters the state set by the event detection unit 104, an event coincidence signal 106 is output from the event detection unit 104, and the counter value at that time is held in the holding circuit 108 based on this signal. When the processing in the CPU further proceeds and reaches the value set in the event detection unit 105,
A match signal 107 is output from the event detection unit 105,
The counter value at that time is held in the holding circuit 109 based on this signal.

【0035】次に、この保持回路108、109に設定
されたデータを読み出し回路112を通して読み出す。
この値の差分を見ることにより実行していた期間が把握
できる。
Next, the data set in the holding circuits 108 and 109 are read through the reading circuit 112.
By looking at the difference between these values, it is possible to grasp the period of execution.

【0036】尚、上述の実施形態は本発明の好適な実施
の一例である。但し、これに限定されるものではなく、
本発明の要旨を逸脱しない範囲内において種々変形実施
が可能である。
The above embodiment is an example of a preferred embodiment of the present invention. However, it is not limited to this.
Various modifications can be made without departing from the spirit of the present invention.

【0037】[0037]

【発明の効果】以上の説明より明かなように、本発明の
デバッガ内蔵マイクロプロセッサは、所定のCPUの動
作状態を被検出データとして入力し、この被検出データ
の検出結果を出力し、所定の保持された基準値と被検出
データとを比較し、この比較の結果を出力する。出力さ
れた結果のカウントを制御し、CPUのプログラム動作
をデバッグするデバッグ機能部を一の半導体上に構成し
ている。本構成によれば、RAMを必要としないため回
路サイズがコンパクトであり、このため一つの半導体内
に実装可能となる。また、任意のアドレスにおいてカウ
ントの開始および終了ができ、高精度で、また使い勝手
も向上する。
As is apparent from the above description, the microprocessor with a built-in debugger of the present invention inputs the operation state of a predetermined CPU as data to be detected, outputs the detection result of the data to be detected, The stored reference value is compared with the detected data, and the result of the comparison is output. A debug function unit that controls the count of the output result and debugs the program operation of the CPU is formed on one semiconductor. According to this configuration, since the RAM is not required, the circuit size is compact, so that it can be mounted in one semiconductor. In addition, counting can be started and stopped at an arbitrary address, and the accuracy and usability are improved.

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

【図1】本発明のデバッガ内臓マイクロプロセッサの実
施形態の回路構成ブロック図である。
FIG. 1 is a circuit configuration block diagram of an embodiment of a microprocessor with a built-in debugger of the present invention.

【図2】応用例の回路構成ブロック図である。FIG. 2 is a circuit configuration block diagram of an application example.

【図3】従来の被デバッグCPUをデバッグするデバッ
ガの回路構成例を示している。
FIG. 3 shows a circuit configuration example of a conventional debugger for debugging a debugged CPU.

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

1 半導体 2 CPU 3 入出力部 4 イベント検出部 5 イベント検出部 6 カウンタ制御部 7 カウンタ 8 カウントアップ信号 9 CPU実行状態データ 10 CPU実行状態データ 11 カウント開始信号 12 カウント終了信号 13 データバス 14 データバス 15 カウンタ制御線 16 データバス 17 リセット信号 18 カウント開始制御信号 19 カウント終了制御信号 20 データバス 21 動作クロック 104、105 イベント検出部 106、107 イベント一致信号 108、109 カウンタ保持回路 112 読み出し回路 Reference Signs List 1 semiconductor 2 CPU 3 input / output unit 4 event detection unit 5 event detection unit 6 counter control unit 7 counter 8 count-up signal 9 CPU execution state data 10 CPU execution state data 11 count start signal 12 count end signal 13 data bus 14 data bus 15 Counter control line 16 Data bus 17 Reset signal 18 Count start control signal 19 Count end control signal 20 Data bus 21 Operation clock 104, 105 Event detector 106, 107 Event coincidence signal 108, 109 Counter holding circuit 112 Reading circuit

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 所定のCPUの動作状態を被検出データ
として入力し、該被検出データの検出結果を出力する入
出力部と、 所定の保持された基準値と前記被検出データとを比較
し、該比較の結果を出力する2つのイベント検出部と、 該出力された結果をカウントするカウンタと、 該カウンタを前記一方のイベント検出部の結果に基づき
カウント可能状態とし、且つ他方のイベント検出部の検
出結果によりカウント停止状態とするカウンタ制御部と
を有し、 前記所定のCPUと該CPUのプログラム動作をデバッ
グするデバッグ機能部とが一の半導体上に構成されたこ
とを特徴とするデバッガ内蔵マイクロプロセッサ。
An input / output unit for inputting a predetermined CPU operation state as detected data and outputting a detection result of the detected data, comparing a predetermined held reference value with the detected data. Two event detectors that output the result of the comparison, a counter that counts the output result, and a counter that can count based on the result of the one event detector, and the other event detector A built-in debugger, comprising: a counter control unit for setting a count stop state according to a detection result of the above; and the predetermined CPU and a debug function unit for debugging a program operation of the CPU are formed on one semiconductor. Microprocessor.
【請求項2】 前記カウンタ制御検出部は、カウントア
ップ信号であるカウントクロックに基づき前記カウンタ
のカウント動作を行なわせることを特徴とする請求項1
記載のデバッガ内蔵マイクロプロセッサ。
2. The apparatus according to claim 1, wherein the counter control detection section causes the counter to perform a count operation based on a count clock that is a count-up signal.
A microprocessor with a built-in debugger as described.
【請求項3】 前記カウントアップ信号は、前記CPU
の実行クロックであることを特徴とする請求項1または
2記載のデバッガ内蔵マイクロプロセッサ。
3. The CPU according to claim 2, wherein the count-up signal is supplied to the CPU.
3. The microprocessor with a built-in debugger according to claim 1, wherein the clock is an execution clock.
【請求項4】 前記イベント検出部は、前記基準値と前
記カウンタのカウント数とを比較し、該比較結果が一致
した場合にはカウント終了信号を前記カウンタ制御部に
出力することを特徴とする請求項1から3の何れか1項
に記載のデバッガ内蔵マイクロプロセッサ。
4. The apparatus according to claim 1, wherein the event detector compares the reference value with a count number of the counter, and outputs a count end signal to the counter controller when the comparison result matches. The microprocessor with a built-in debugger according to claim 1.
【請求項5】 前記イベント検出部は、前記基準値を保
持する保持手段を具備し、該保持手段は前記入出力部を
介して入力された前記基準値を保持することを特徴とす
る請求項1から4の何れか1項に記載のデバッガ内蔵マ
イクロプロセッサ。
5. The event detection unit according to claim 1, further comprising a holding unit for holding the reference value, wherein the holding unit holds the reference value input via the input / output unit. The microprocessor with a built-in debugger according to any one of 1 to 4.
【請求項6】 前記デバッガ内蔵マイクロプロセッサ
は、前記2つのイベント検出部を1組とし少なくとも2
組のイベント検出部と、前記カウンタのカウント数値を
保持する保持回路と、前記カウント数値を読み出す読み
出し回路とを有し、前記CPUの実行期間の把握を可能
としたことを特徴とする請求項1から5の何れか1項に
記載のデバッガ内蔵マイクロプロセッサ。
6. The microprocessor with a built-in debugger includes a pair of the two event detectors as at least two.
2. The system according to claim 1, further comprising: a set of event detectors, a holding circuit for holding the count value of the counter, and a reading circuit for reading the count value, so that the execution period of the CPU can be grasped. 6. The microprocessor with a built-in debugger according to any one of items 1 to 5.
JP9221842A 1997-08-19 1997-08-19 Microprocessor with debugger built-in Pending JPH1165897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9221842A JPH1165897A (en) 1997-08-19 1997-08-19 Microprocessor with debugger built-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9221842A JPH1165897A (en) 1997-08-19 1997-08-19 Microprocessor with debugger built-in

Publications (1)

Publication Number Publication Date
JPH1165897A true JPH1165897A (en) 1999-03-09

Family

ID=16773053

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9221842A Pending JPH1165897A (en) 1997-08-19 1997-08-19 Microprocessor with debugger built-in

Country Status (1)

Country Link
JP (1) JPH1165897A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2380827A (en) * 2001-10-12 2003-04-16 Siroyan Ltd Debugging of processors using two separate event detectors
JP2012133752A (en) * 2010-11-29 2012-07-12 Denso Corp Microcomputer
WO2021048964A1 (en) * 2019-09-12 2021-03-18 サンケン電気株式会社 Processor and event processing method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2380827A (en) * 2001-10-12 2003-04-16 Siroyan Ltd Debugging of processors using two separate event detectors
JP2012133752A (en) * 2010-11-29 2012-07-12 Denso Corp Microcomputer
WO2021048964A1 (en) * 2019-09-12 2021-03-18 サンケン電気株式会社 Processor and event processing method
JPWO2021048964A1 (en) * 2019-09-12 2021-03-18
CN114258516A (en) * 2019-09-12 2022-03-29 三垦电气株式会社 Processor and event processing method
US11868825B2 (en) 2019-09-12 2024-01-09 Sanken Electric Co., Ltd. Processor and event processing method
CN114258516B (en) * 2019-09-12 2024-05-14 三垦电气株式会社 Processor and event processing method

Similar Documents

Publication Publication Date Title
US7596719B2 (en) Microcontroller information extraction system and method
WO2006093554A2 (en) Method and appparatus for qualifying debug operation using source information
US6678838B1 (en) Method to track master contribution information in a write buffer
EP0166431A2 (en) An information processing apparatus having an instruction prefetch circuit
US6473841B1 (en) Signal processing apparatus with memory access history storage
US6877113B2 (en) Break determining circuit for a debugging support unit in a semiconductor integrated circuit
JPH11110255A (en) Software debugging device and method
US6269454B1 (en) Maintaining object information concurrent with data optimization for debugging
JPH0447340B2 (en)
JPH1165897A (en) Microprocessor with debugger built-in
JPH08171504A (en) Emulation device
JPH0581087A (en) Processor monitoring system
JP2760228B2 (en) Microprocessor with built-in cache memory and its trace analyzer
JP2902861B2 (en) Buffer device with trace function
JPH0736735A (en) Debugging device
JP2940000B2 (en) Single chip microcomputer
JPH0573347A (en) Emulation device
SU1746385A1 (en) Device for checking program execution time
JPH06202907A (en) Debug support device
US7206926B2 (en) Programmable unit including program operation unit and associated stopping device
JPH0695913A (en) Debugging device
JPS59144958A (en) Data processor
JPH04310138A (en) Debugging method for data transmitter
JPH04284544A (en) Micro-controller
JPH0644098A (en) Memory access bus comparator

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000912